Copyright: Copyright © 1999 borland.com,                                   a division of Inprise Corp. All rights reserved.            This Help file was compiled on   Thursday, July 29, 1999 11:41:56.


TAggregate

Hierarchy	Properties 	Methods	Events	See also

TAggregate represents a maintained aggregate in a client dataset.

Unit

dbclient

Description

Use TAggregate to specify the formula for an aggregate that can be used by a client dataset. Each aggregate object describes a calculation that summarizes the data in a set of records. The group of records that is summarized is part of the aggregate object. Thus, if a client dataset is performing the same summary calculation over subgroups of records and over the entire dataset, it must use two separate TAggregate objects.

When aggregates summarize data over a group of records (rather than the entire client dataset), they must be associated with an index. The fields in the index define the possible groups of records. When a client dataset changes its index, any aggregate not associated with the new index becomes unavailable, and any active aggregate associated with the new index becomes available.

Aggregate objects can be created and used directly in code at runtime. At design time, you can use the Fields editor to add aggregate fields to a client dataset. When you define aggregate fields at design time, the Fields editor automatically creates the TAggregate objects for them.


TAggregate properties

TAggregate	Alphabetically	Legend

In TAggregate

Active

AggHandle

AggregateName

DataSet

DataSize

DataType

Expression

GroupingLevel

IndexName

InUse

Visible

Derived from TCollectionItem

Collection

DisplayName

ID

Index


TAggregate properties

TAggregate	By object	Legend

Active

AggHandle

AggregateName

Collection

DataSet

DataSize

DataType

DisplayName

Expression

GroupingLevel

ID

Index

IndexName

InUse

Visible


TAggregate.Active

TAggregate	See also

Indicates whether the aggregate should be calculated.

property Active: Boolean;

Description

Use the Active property to indicate that the aggregate value should be maintained. If Active is False, the value of the aggregate is never calculated.

If Active is True, the aggregate value is calculated unless

It summarizes records over a group not defined by the current index.

The client dataset’s AggregatesActive property is False.

Note:	To determine whether the aggregate is currently maintained, read the InUse property.


TAggregate.AggHandle

TAggregate	See also

Provides access to the aggregate handle.

type

  hDSAggregate = type Integer;

property AggHandle: hDSAggregate;

Description

AggHandle is the handle for the aggregate instance that is used by the utilities that implement the aggregate objects behavior. Most applications do not need to use this value.

Component writers can use AggHandle, if necessary, with the routines declared in the dsintf unit.


TAggregate.AggregateName

TAggregate	See also

Specifies the name user interface components use when describing the aggregate.

property AggregateName: string;

Description

Set AggregateName to provide a name that can be used to label values displayed to the user. When displaying aggregates, read AggregateName to obtain a label for the value.


TAggregate.DataSet

TAggregate	See also

Indicates the client dataset whose records are summarized by this aggregate.

property DataSet: TClientDataSet;

Description

Read DataSet to access the client dataset that uses this aggregate.


TAggregate.DataSize

TAggregate	See also

Indicates the number of bytes needed to store the aggregate’s value.

property DataSize: Integer;

Description

Read DataSize to determine how much memory is required to store the aggregate’s value. This is useful when defining objects that store aggregate values. For example, the Fields editor uses DataSize when defining aggregate fields.


TAggregate.DataType

TAggregate	See also

Indicates the data type of the calculated value.

property DataType: TFieldType;

Description

Read DataType to determine the data type of the value calculated by the aggregate. This may differ from the data type of the fields that are summarized. For example, an aggregate that counts non-null fields will return an integer (ftInteger), even if the records themselves are some other type.


TAggregate.Expression

TAggregate	See also

Specifies the formula used to calculate the aggregate value.

property Expression: String;

Description

Set Expression to indicate how aggregate values should be calculated. Expression is an expression that includes one or more of the summary operators in the following table:

Operator	Use

Sum	Totals the values for a numeric field or expression

Avg	Computes the average value for a numeric or date-time field or expression

Count	Specifies the number of non-blank values for a field or expression

Min	Indicates the minimum value for a string, numeric, or date-time field or expression

Max	Indicates the maximum value for a string, numeric, or date-time field or expression

The summary operators act on field values or on expressions built from field values using the same operators you use to create filters. (You can’t nest summary operators, however.) You can create expressions by using operators on summarized values with other summarized values, or on summarized values and constants. However, you can’t combine summarized values with field values, because such expressions are ambiguous (there is no indication of which record should supply the field value.) These rules are illustrated in the following expressions:

Sum(Qty * Price)	{legal -- summary of an expression on fields }

Max(Field1) - Max(Field2)	{legal -- expression on summaries }

Avg(DiscountRate) * 100	{legal -- expression of summary and constant }

Min(Sum(Field1))	{illegal -- nested summaries }

Count(Field1) - Field2	{illegal -- expression of summary and field }

Note:	To specify the set of records summarized by this expression, use the GroupingLevel property.


TAggregate.GroupingLevel

TAggregate	See also

Specifies the set of records summarized by this aggregate.

property GroupingLevel: Integer;

Description

Use GroupingLevel to indicate the groups of records over which this aggregate is calculated. When GroupingLevel is 0 (the default), the aggregate summarizes all the records in the client dataset. When GroupingLevel is greater than 0, the aggregate summarizes each group of records that has the same values on the first GroupingLevel fields of the index.

GroupingLevel can be any value from 0 to the number of fields in the index specified by IndexName.


TAggregate.IndexName

TAggregate 	See also

Specifies the index that is used to define subgroups of records.

property IndexName: String;

Description

Set IndexName to specify an index that sorts the records of DataSet into subgroups. Each subgroup is defined as a set of records which all have the same values on a set of fields. This defining set of fields is the first GroupingLevel fields of the index.

IndexName is required for any aggregate that does not summarize all the records in the client dataset (GroupingLevel > 0). When the index associated with an aggregate is not the current index of the client dataset, its value is unavailable.


TAggregate.InUse

TAggregate	See also

Indicates whether the aggregate value is currently available.

property InUse: Boolean;

Description

Read InUse to determine whether the Value method returns a summarized value. When InUse is False, Value returns Null. When InUse is True, the aggregate is maintained so that it calculates the formula specified by Expression for the current set of records, including any edits to records in the current group.


TAggregate.Visible

TAggregate	See also

Inidicates whether controls should display the aggregated value.

property Visible: Boolean;

Description

Set Visible to indicate to controls that the aggregate value should be hidden. When Visible is False, its value is still calculated.

To prevent the aggregate from being calculated, use the Active property instead.


TAggregate events

TAggregate	Alphabetically 	Legend

In TAggregate

OnUpdate


TAggregate events

TAggregate	By object 	Legend

OnUpdate


TAggregate.OnUpdate

TAggregate	See also

Occurs when the value of the aggregate is recalculated.

type TAggUpdateEvent = procedure(Agg: TAggregate) of object;

property OnUpdate: TAggUpdateEvent

Description

Write an OnUpdate event handler to respond when the aggregate value is recomputed. For example, write code in an OnUpdate event handler to invalidate any controls that display the value of the aggregate so that they can repaint with the new value.

The Agg parameter specifies the aggregate whose value has just been recomputed.


TAggregate methods

TAggregate	Alphabetically

In TAggregate

Assign

Create

Destroy

GetDisplayName

Value

Derived from TCollectionItem

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TAggregate methods

TAggregate	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetDisplayName

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

Value


TAggregate.Assign

TAggregate	See also

Copies the properties of another TAggregate object.

procedure Assign (Source: TPersistent); override;

Description

Call Assign to copy the properties of another object to the aggregate. If the Source object is another TAggregate object, Assign copies the values of its Expression, Active, IndexName, and GroupingLevel properties. Otherwise, Assign calls the inherited method, which copies the properties of any object that can copy to a TAggregate from its AssignTo method.


TAggregate.Create

TAggregate	See also

Creates and initializes an instance of TAggregate.

constructor Create(Aggregates: TAggregates; ADataSet: TClientDataSet); reintroduce; overload;

Description

Most applications do not call Create to create an aggregate object. Instead, they call the Add method of the TAggregates collection to which they should belong.

The Aggregates or Collection parameter specifies the TAggregates collection to which the TAggregate instance should belong.

The ADataSet parameter specifies the client dataset whose data the aggregate summarizes.


TAggregate.Destroy

TAggregate	See also

Destroys an instance of TAggregate.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free, which checks that the TAggregate reference is not nil before calling Destroy.

Destroy frees the internal buffer that is used for calculating values.


TAggregate.GetDisplayName

TAggregate	See also

Specifies the name of the aggregate object as it appears in the Object Inspector.

function  GetDisplayName: string; override;

Description

GetDisplayName overrides the inherited method to provide more meaningful names for the aggregate when it appears in the object inspector. If the AggregateName property is set, GetDisplayName returns that. Otherwise, if the Expression property is set, it returns that. If all else fails, it calls the inherited method, which returns the class name with a number suffixed to ensure uniqueness.


TAggregate.Value

TAggregate	See also

Returns the calculated value of the aggregate.

function Value: Variant;

Description

Call Value to obtain the evaluation of Expression over the group of records specified by GroupingLevel. If GroupingLevel is nonzero (that is, if the aggregate summarizes a subgroup of the records in the client dataset), Value summarizes the data for the group which contains the current record in the client dataset.

If the aggregate is not currently maintained, Value returns Null. An aggregate is not currently maintained when

The Active property is False.

The DataSet property is nil.

The aggregate summarizes a subgroup and the IndexName property does not match the current index of the client dataset.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TCollectionItem


TAggregates

Hierarchy	Properties	Methods	See also

TAggregates is a collection of TAggregate objects.

Unit

dbclient

Description

TAggregates is the type of the Aggregates property, which represents all the maintained aggregates for a client dataset.  A single TAggregate object represents each maintained aggregate. Maintained aggregates summarize data over the records in the client dataset.

TAggregates can include a mix of active and inactive aggregate objects. Active aggregates are updated dynamically as the data in the client dataset is edited. Inactive aggregates define a formula for summarizing data and a group of records to summarize, but these formulas are not evaluated. Aggregates can be inactive because they are not currently needed, or because the index that defines the group of records they summarize is inactive.


TAggregates properties

TAggregates	Alphabetically	Legend

In TAggregates

Items

Derived from TCollection

Count

ItemClass


TAggregates properties

TAggregates	By object	Legend

Count

ItemClass

Items


TAggregates.Items

TAggregates	See also

Provides indexed access to the TAggregate objects in the collection.

property Items[Index: Integer]:TAggregate; default;

Description

Use Items to access individual TAggregate objects maintained by TAggregates.

Items is the default property of TAggregates, so the name of the Items property can be left off when using this property. Thus the line

FirstAggregate := TClientDataSet1.Aggregates.Items[0];

can be written

FirstAggregate := TClientDataSet1.Aggregates[0];


TAggregates methods

TAggregates	Alphabetically

In TAggregates

Add

Clear

Create

Find

IndexOf

Derived from TCollection

Assign

BeginUpdate

Delete

Destroy

EndUpdate

FindItemID

GetNamePath

Insert

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TAggregates methods

TAggregates	By object

Add

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

Find

FindItemID

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

IndexOf

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TAggregates.Add

TAggregates	See also

Creates a new TAggregate object and adds it to the end of the Items property array.

function Add: TAggregate;

Description

Call Add to add a new aggregate to the set of aggregates that can be used with a client dataset. Once the aggregate is created and added using Add, its properties can be set to indicate how it is used.


TAggregates.Clear

TAggregates	See also

Removes all aggregates from the Items property array.

procedure Clear; override;

Description

Call Clear to empty the Items property array. After Clear frees each aggregate in the Items array, it informs the associated client dataset so that it can update it’s ActiveAggs property.


TAggregates.Create

TAggregates

Creates and initializes a TAggregates object.

constructor Create(Owner: TPersistent;

Description

Applications should not need to call the Create method directly.  The client dataset that uses TAggregates to represent its maintained aggregates creates this object from its own constructor.


TAggregates.Find

TAggregates	See also

Returns the TAggregate object with a specified name.

function Find(const DisplayName: string): TAggregate;

Description

Call Find to obtain a specified TAggregate object from the Items property array. The DisplayName parameter specifies the value of the aggregate’s AggregateName property. If there is no aggregate with the specified name in the Items property array, Find returns nil.


TAggregates.IndexOf

TAggregates	See also

Returns the index of the TAggregate object with a specified name.

function IndexOf(const DisplayName: string): Integer;

Description

Call IndexOf to obtain the index of a specified TAggregate object in the Items property array. The DisplayName parameter specifies the value of the aggregate’s AggregateName property. If there is no aggregate with the specified name in the Items property array, IndexOf returns -1.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


TApplyUpdatesButton

Hierarchy	Properties	Methods	See also

TApplyUpdatesButton generates an HTML control that sends an Update message to the XML broker on the MIDAS Web application.

Unit

MidItems

Description

Add TApplyUpdatesButton as the child of a TDataNavigator component (or a layout group that is a child of a TDataNavigator component) to enable the generated HTML form to submit changes made by end users. The resulting HTML button’s action generates an HTTP message that forwards all changes to a specific XML data packet back to the XML broker on the MIDAS Web application.

Use the properties of TApplyUpdatesButton to customize the appearance of the button and associate it with an XML broker. The associated XML broker adds the XML data packet to the HTML document and responds to update messages generated by the apply updates button on the HTML form.


TApplyUpdatesButton properties

TApplyUpdatesButton	Alphabetically	Legend

Derived from TXMLButton

Caption

XMLBroker

XMLUseParent

Derived from TWebButton

Custom

Style

StyleRule

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TApplyUpdatesButton properties

TApplyUpdatesButton	By object	Legend

Caption

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

XMLBroker

XMLUseParent


TApplyUpdatesButton methods

TApplyUpdatesButton	Alphabetically

In TApplyUpdatesButton

Create

Derived from TXMLButton

Destroy

Derived from TWebButton

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TApplyUpdatesButton methods

TApplyUpdatesButton	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TApplyUpdatesButton.Create

TApplyUpdatesButton	See also

Creates and initializes an instance of TApplyUpdatesButton.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TApplyUpdatesButton at runtime. Buttons added at design time using the Web Page editor are instantiated automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebButton

TXMLButton


EArrayError

Hierarchy	Properties	Methods	See also

EArrayError is the exception class for failures that occur when manipulating a descendant of TBaseArray.

Unit

mxarrays

Description

EArrayError is raised when an application tries to

Use an invalid index when accessing the elements of an array.

Add too many elements into a fixed-capacity array.

Insert an element into a sorted array.


EArrayError properties

EArrayError	Alphabetically

Derived from Exception

HelpContext

Message


EArrayError properties

EArrayError	By object

HelpContext

Message


EArrayError methods

EArrayError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelpException_CreateResHelp>Main

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EArrayError methods

EArrayError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


TBaseArray

Hierarchy	Properties	Methods	See also

TBaseArray is the base class for all arrays used by the decision cube components.

Unit

mxarrays

Description

Use TBaseArray as a base class when defining a specialized array for a specific data type. Like the TList or TStringList object, TBaseArray represents an ordered list of items that can grow dynamically. However, the elements of TBaseArray are arbitrary types whose size is specified in the constructor, while TStringList is limited to strings and TList is limited to pointers.

Descendants of TBaseArray represent arrays of specific data types such as short integers.

Note:	TBaseArray is only available in the Enterprise edition.


TBaseArray properties

TBaseArray	Alphabetically	Legend

In TBaseArray

AutoSize

Capacity

CompareProc

Count

Duplicates

ItemSize

Limit

List

SortOrder


TBaseArray properties

TBaseArray	By object	Legend

AutoSize

Capacity

CompareProc

Count

Duplicates

ItemSize

Limit

List

SortOrder


TBaseArray.AutoSize

TBaseArray	See also

Indicates whether the array grows dynamically as items are added.

property AutoSize: Boolean;

Description

Set AutoSize to True to allow the array to hold an arbitrary number of values. When AutoSize is True, the Capacity property increases automatically when new items are added beyond the current capacity of the array. When AutoSize is False, the Capacity property must be explicitly set to the number of entries allowed in the array. If an attempt is made to add items beyond the number specified in the Capacity property, an EArrayError exception is raised if AutoSize is False.


TBaseArray.Capacity

TBaseArray	See also

Specifies the maximum number of items that can be added to the array.

property Capacity: Integer;

Description

Set Capacity to change the amount of memory allocated for the array. Trying to set Capacity to a value less than the Count property will raise an EArrayError exception.

If the AutoSize property is True, the Capacity of the array increases automatically when necessary to accommodate new items as they are added.

Note:	To determine the amount of memory used by the array, use Capacity * ItemSize.


TBaseArray.CompareProc

TBaseArray	See also

Implements a sort order for the elements of the array.

type TCompareProc = function ( var item1, item2 ): Integer;

property CompareProc: TCompareProc;

Description

Set CompareProc to change the function that is used to sort the items of the array. If the SortOrder property is not TS_NONE, CompareProc is used to locate the position in which to add new items to the array and to locate items using the FindItem method.

CompareProc should compare the two items given as parameters and return a value less than 0 if item1 comes before item2, return a value greater than 0 if item1 comes after item2, and return 0 if item1 is the same as item2.


TBaseArray.Count

TBaseArray	See also

Specifies the number of items in the array.

property Count: Integer;

Description

Read Count to determine the number of entries in the array. Set Count to increase or decrease the number of entries. Increasing Count always increases the Capacity if necessary, even if the AutoSize property is False. Decreasing the Count property truncates the array after Count items, but does not affect the Capacity of the array.

When the value of Count is increased, new entries with the value of 0 are added to the end of the array. If the array is sorted, this will throw off the internal sort order, and cause the FindItem method to fail. If the array is sorted, call the Sort method to restore the sort order after filling the newly added members of the array.


TBaseArray.Duplicates

TBaseArray	See also

Specifies whether duplicate items can be added to sorted arrays.

type TDuplicates = (dupIgnore, dupAccept, dupError);

property Duplicates: TDuplicates;

Description

Set Duplicates to specify what should happen when an attempt is made to add a duplicate item to a sorted array. The value of Duplicates should be one of the following.

Value	Meaning

dupIgnore	Ignore attempts to add duplicate items to the sorted array.

dupError	Raise an EArrayError exception when an attempt is made to add duplicate items to the sorted array.

dupAccept	Permit duplicate items in the sorted array.

Set Duplicates before adding any items to the list. Setting Duplicates to dupIgnore or dupError does nothing about duplicate strings that are already in the array.

Note:	Duplicates does nothing if the array is not sorted.


TBaseArray.ItemSize

TBaseArray	See also

Indicates the number of bytes used to store each item in the array.

property ItemSize: Integer;

Description

Read ItemSize to determine the size of the elements of the array. The value of ItemSize is set by the Create method to the value of the iSize parameter. Descendants of TBaseArray change this value to the size of the data type they represent.


TBaseArray.Limit

TBaseArray	See also

Specifies the size of the array.

property Limit: Integer;

Description

Use Limit to determine the size of the array. If the array is empty, Limit is the same as the Capacity property. If the array is not empty, Limit is the same as the Count property, even if the value of Capacity is larger than Count. Setting Limit sets the Capacity of the array.


TBaseArray.List

TBaseArray	See also

Points to the array of values maintained by TBaseArray.

property List: Pointer;

Description

Use List to get direct access to the memory used to store the array items. Calculate the position of individual items in the list using the ItemSize property.

To access specific items in the list, use the GetItem method.


TBaseArray.SortOrder

TBaseArray	See also

Determines whether the array is sorted.

type TSortOrder = (TS_NONE, TS_ASCENDING, TS_DESCENDING);

property SortOrder: TSortOrder;

Description

Set SortOrder to indicate whether the array should be sorted using the CompareProc property. When an array is sorted, all new items are added in the correct sort-order position so as to maintain the sort order. SortOrder can have one of the following values:

Value	Meaning

TS_NONE	The array is unsorted.

TS_ASCENDING	The elements of the array are sorted in ascending order.

TS_DESCENDING	The elements of the array are sorted in descending order.

Setting the SortOrder property does not sort the items already in the array. If the array is not empty when the SortOrder property is changed to TS_ASCENDING or TS_DESCENDING, be sure to explicitly call the Sort method to sort the existing items.

Note:	The Duplicates property has no effect when SortOrder is TS_NONE.


TBaseArray methods

TBaseArray	Alphabetically

In TBaseArray

Clear

Create

Delete

Destroy

Exchange

FindItem

GetItem

IndexOf

Insert

InsertAt

PutItem

RemoveItem

Sort

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TBaseArray methods

TBaseArray	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

Exchange

FieldAddress

FindItem

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetItem

GetNamePath

IndexOf

InheritsFrom

InitInstance

Insert

InsertAt

InstanceSize

MethodAddress

MethodName

NewInstance

PutItem

RemoveItem

SafeCallException

Sort


TBaseArray.Clear

TBaseArray	See also

Clear removes all items from the array.

procedure Clear;

Description

Call Clear to empty the array and free all associated memory. Clear does the same thing as setting both the Count and Capacity properties to 0.


TBaseArray.Create

TBaseArray	See also

Creates an instance of TBaseArray for elements of a specific size.

constructor Create( Itemcount, iSize: Integer ); virtual;

Description

Call Create to create an array containing elements with the size specified by the iSize parameter.Create sets the Capacity property to Itemcount and the ItemSize property to iSize. It also initializes the AutoSize property to True and the Count property to 0.


TBaseArray.Delete

TBaseArray	See also

Removes an element from the array.

procedure Delete(Index: Integer); virtual;

Description

Call Delete to remove the element indicated by the Index parameter, where 0 is the first element, 1 is the second element, and so on. All subsequent elements in the array are moved up to fill the gap left when the element is removed.


TBaseArray.Destroy

TBaseArray	See also

Destroys an instance of TBaseArray.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the array reference is not nil before calling Destroy.

Destroy frees the memory allocated to hold the list of elements before calling the inherited destructor.


TBaseArray.Exchange

TBaseArray	See also

Provides the interface for a method that swaps the values of two elements in the array.

procedure Exchange(Index1, Index2: Integer); virtual;

Description

The Exchange method for TBaseArray does nothing other than provide an interface for a method that interchanges the values of two elements.


TBaseArray.FindItem

TBaseArray	See also

Locates a value in a sorted array and indicates whether an element with that value already exists.

function FindItem( var Index: Integer; var Value ): Boolean;

Description

Use FindItem to obtain the index in a sorted array where an element with the value Value should be added. If an element with the value Value already exists in the array, FindItem returns True. If none of the elements in the array have the value Value, FindItem returns False.

The index where Value should appear is returned in the Index parameter. The value of Index is zero-based, where the first element has the index 0, the second element has the index 1, and so on.

Note:	FindItem assumes the SortOrder property is TS_ASCENDING. For unsorted arrays, use the IndexOf method instead. For descending arrays, invert the CompareProc property before calling FindItem.


TBaseArray.GetItem

TBaseArray	See also

Returns the element in the array at the indicated position.

procedure GetItem(index: Integer; var Value );

Description

Call GetItem to obtain the value of an element in the array. The Index parameter indicates the element of the array, where the first element has the index 0, the second element has the index 1, and so on.


TBaseArray.IndexOf

TBaseArray	See also

Returns the position of the first element with a specified value.

function IndexOf( var Item ): Integer; virtual;

Description

Call IndexOf to obtain the position of the first occurrence of the value Value. IndexOf returns the 0-based index of the element. Thus, if Value matches the first element in the array, IndexOf returns 0, if Value matches the second element, IndexOf returns 1, and so on. If the value is not in the array, IndexOf returns -1.

Note:	IndexOf does not work for arrays sorted in descending order.


TBaseArray.Insert

TBaseArray	See also

Inserts an element into the array and assigns it a value.

procedure Insert(Index: Integer; var Value ); virtual;

Description

Call InsertAt to add an element to the array at the position specified by Index and assign it the value Value. If Index is 0, the element is inserted at the beginning of the array. If Index is 1, the element is put in the second position of the array, and so on.

Note:	Insert does not check the SortOrder property. If the array is sorted, be sure to insert the element in the proper sort-order position.


TBaseArray.InsertAt

TBaseArray	See also

Adds an element to the array at the position specified by Index.

procedure InsertAt(Index: Integer; const Value: Variant);

Description

InsertAt does the same thing as the Insert method. For most purposes, use the Insert method.

Descendants of TBaseArray can override the Insert method to raise an exception when an attempt is made to insert an element in a sorted array. InsertAt always succeeds as long as the value of Index is appropriate. InsertAt is intended for internal use when the value of Index is known to be appropriate.


TBaseArray.PutItem

TBaseArray	See also

Replaces the value of an element in the array.

procedure PutItem(Index: Integer; var Value );

Description

Call PutItem to change the value of an element to the value Value. Unlike the Insert method, PutItem does not add a new item to the array, but replaces the value of an existing element. The Index parameter indicates which element to change, where 0 specifies the first element, 1 specifies the second element, and so on.

Note:	Calling PutItem with Index set to the value of the Count property will add a new element to the end of the array. This is the only case where PutItem adds a new element instead of replacing an existing one.


TBaseArray.RemoveItem

TBaseArray	See also

Removes an element from the array.

procedure RemoveItem(Index: Integer);

Description

RemoveItem does the same thing as the Delete method. Use the Delete method instead.


TBaseArray.Sort

TBaseArray	See also

Provides the interface for a method that sorts the elements in the array.

type TCompareProc = function (var item1, item2): Integer;

procedure Sort(Compare: TCompareProc); virtual;

Description

The Sort method for TBaseArray does nothing. Descendants of TBaseArray override this method to sort the elements of the array using the ordering function provided in the Compare parameter.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TBaseProvider

Hierarchy	Properties 	Methods 	Events 	See also

TBaseProvider is a base class for all data providers.

Unit

provider

Description

Use TBaseProvider to derive customized data provider objects for application servers in a multi-tiered database application. Unlike its immediate ancestor (TCustomProvider) TBaseProvider includes no abstract methods. However, applications should not create instances of TBaseProvider, as many of the methods are merely stubs that provide a backstop for specialized descendants that do not implement all the provider methods.

A provider derived from TBaseProvider is an intermediate link between a TClientDataSet object on the client, and a dataset on the application server. It packages data from the server dataset and passes it in one or more transportable data packets to the client dataset. The client dataset receives the data packets and reconstructs the data to create a local, in-memory copy for user access. When user access is complete, the client dataset repackages any changed data and sends the updates to the provider on the application server. The provider applies the updates to the data on the server.

Do not create instances of TBaseProvider. To add a provider component to a form or data module, use TDataSetProvider.

Client applications communicate with a provider through the IAppServer interface, which is an interface of the remote data module that contains the provider. The remote data module maintains a list of its providers and dispatches incoming calls to the appropriate provider if its Exported property is True.


TBaseProvider properties

TBaseProvider	Alphabetically	Legend

In TBaseProvider

Options

Resolver

UpdateMode

Derived from TCustomProvider

Data

Exported

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TBaseProvider properties

TBaseProvider	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Data

DesignInfo

Exported

Name

Options

Owner

Resolver

Tag

UpdateMode

VCLComObject


TBaseProvider.Options

TBaseProvider 	See also

Influences what is included in data packets and how the information in data packets is used.

property Options: TProviderOptions;

Description

Set Options to customize how the provider communicates with client datasets. Options is a set that specifies

Whether nested detail sets and BLOB data are included in data packets or fetched separately.

Whether data packets include field component properties such as formats, display names, and maximum & minimum values.

Whether data packets are provided on a read-only basis, and whether specific types of changes (insertions, edits, or deletions) are disabled.

Whether changes to master table fields should cause corresponding updates to detail tables.

Whether a single client update can affect multiple server records.

Whether the clients records are refreshed when it applies updates.

Whether the client can send SQL statements that override the provider’s dataset.

Note:	Not all options are supported by an InternetExpress client. Specifically, InternetExpress clients don’t support poFetchBlobsOnDemand, poFetchDetailsOnDemand, poDisableInserts, poDisableEdits, psDisableDeletes, poPropogateChanges, and poAllowCommandText.


TBaseProvider.Resolver

TBaseProvider	See also

Provides access to the resolver component that applies updates and resolves update errors.

property Resolver: TCustomResolver;

Description

Provider components use a resolver to handle the details of applying updates and resolving update errors. Most applications do not need to use the resolver directly.

When any method that uses a resolver is called, the provider automatically creates a resolver component (using the CreateResolver method) if the value of Resolver is nil. Thus, this property may be nil until the first method that requires a resolver is called.


TBaseProvider.UpdateMode

TBaseProvider	See also	Example

Controls how the provider locates records when applying updates.

property UpdateMode: TUpdateMode;

Description

Use UpdateMode to specify the criteria to use for locating a record in the dataset when applying updates. UpdateMode specifies whether modified records are located based on all columns (fields), on only the key fields, or on the key fields plus the original values of fields that have been modified.

Note:	To control how the provider locates records by specifying individual fields, use the field component’s ProviderFlags property.


TBaseProvider events

TBaseProvider	Alphabetically

In TBaseProvider

AfterUpdateRecord

BeforeUpdateRecord

OnGetData

OnUpdateData

OnUpdateError

Derived from TCustomProvider

OnDataRequest


TBaseProvider events

TBaseProvider	By object

AfterUpdateRecord

BeforeUpdateRecord

OnDataRequest

OnGetData

OnUpdateData

OnUpdateError


TBaseProvider.AfterUpdateRecord

TBaseProvider	See also 	Example

Occurs when the associated resolver has just updated a record.

type  TAfterUpdateRecordEvent = procedure(Sender: TObject; SourceDS: TDataSet; DeltaDS: TClientDataSet; UpdateKind: TUpdateKind) of object;

property AfterUpdateRecord: TAfterUpdateRecordEvent;

Description

Write an AfterUpdateRecord event handler to provide special processing immediately after a record has been successfully updated. For example, use AfterUpdateRecord to maintain a log of successful updates.

The Sender parameter identifies the provider whose updates are being applied.

The SourceDS parameter is the dataset from which the data originated. If there is no source dataset, this value is nil. The source dataset may not be active when the event occurs, so set its Active property to True before trying to access its data.

The DeltaDS parameter is a client dataset whose current record is the update that was just applied.

The UpdateKind parameter indicates whether this update was the modification of an existing record (ukModify), a new record that was inserted (ukInsert), or a record that was deleted (ukDelete).


TBaseProvider.BeforeUpdateRecord

TBaseProvider	See also 	Example

Occurs immediately before each record is applied to the remote dataset.

type TBeforeUpdateRecordEvent = procedure(Sender: TObject; SourceDS: TDataSet; DeltaDS: TClientDataSet; UpdateKind: TUpdateKind; var Applied: Boolean) of object;

property BeforeUpdateRecord: TBeforeUpdateRecordEvent;

Description

Write a BeforeUpdateRecord event handler to prepare individual record updates before they are applied to the remote database server. BeforeUpdateRecord provides an opportunity to insert additional changes into a record before it is updated or to selectively prevent certain updates. Another use is to set the ProviderFlags property of the fields in the DataSet parameter to indicate how the provider should identify the records that are to be updated or changed and which fields should be updated.

The Sender parameter identifies the provider whose updates are being applied.

The SourceDS parameter is the dataset from which the data originated. If there is no source dataset, this value is nil. The source dataset may not be active when the event occurs, so set its Active property to True before trying to access its data.

The DeltaDS parameter is a client dataset containing all the updates that are being applied.

The UpdateKind parameter indicates whether this update is the modification of an existing record (ukModify), a new record to insert (ukInsert), or an existing record to delete (ukDelete).

If you apply the update from the BeforeUpdateRecord event handler, set the Applied parameter to True. This indicates that the update has already been applied, and prevents any further attempt to apply the update a second time. When a BeforeUpdateRecord event handler sets Applied to True, the update is discarded. It is not counted as an update error. That is, there is no OnUpdateError event generated for the update, the update is not sent back to the client, and the update does not count towards the limit on update errors supplied when ApplyUpdates was called.


TBaseProvider.OnGetData

TBaseProvider	See also 	Example

Occurs after a provider retrieves data but before it is sent to the client.

type TProviderDataEvent = procedure(Sender: TObject; DataSet: TClientDataSet) of object;

property OnGetData: TProviderDataEvent;

Description

Write an OnGetData event handler to perform any custom data processing the provider should handle before returning data to a client. The OnGetData event occurs after a provider fetches data from its dataset but before the data is sent on to the client. Using the methods of the DataSet parameter, data can be edited in the OnGetData event handler before sending it to the client.

Note:	OnGetData occurs whenever the Data property is read, as well as when the GetRecords method is called.


TBaseProvider.OnUpdateData

TBaseProvider	See also 	Example

Occurs when a provider begins to apply updates.

type TProviderDataEvent = procedure(Sender: TObject; DataSet: TClientDataSet) of object;

property OnUpdateData: TProviderDataEvent;

Description

Write an OnUpdateData event to handle special processing before the provider actually applies updates received from the client to a database. Using the methods belonging to the DataSet parameter, an application can

Examine data (for example, for values or data changes that should not permitted), and raise exceptions that cancel applying of updates before they occur.

Change data (for example encrypting or decrypting values) before it is sent on to the database server.


TBaseProvider.OnUpdateError

TBaseProvider	See also 	Example

Occurs when a provider attempts to update a record but cannot because of an error condition.

type

  TResolverErrorEvent = procedure(Sender: TObject; DataSet: TClientDataSet; E: EUpdateError; UpdateKind: TUpdateKind; var Response: TResolverResponse) of object;

property OnUpdateError: TResolverErrorEvent;

Description

Write an OnUpateError event handler to respond to error conditions that arise when the provider applies a client dataset’s updates to the database server. The OnUpdateError event handler is called for each record that can’t be updated.

Warning:	The provider can’t detect when an update conflicts with another user’s changes to a memo field. This situation will not generate an OnUpdateError event.

DataSet is a temporary client dataset to use for accessing data during the update process. Use the OldValue, NewValue, and CurValue properties of the dataset’s field components to view the changed fields and determine the cause of the problem.

Warning:	The code in an OnUpdateError handler must not call any methods that make a different record the current one.

E is an EUpdateError object from which the error handler can extract an error message and the actual cause of the error condition. This information can help determine how to respond to the error condition.

UpdateKind describes the type of update that generated the error. It can specify the edit of an existing record (ukModify), the insertion of a new record (ukInsert), or the deletion of an existing record (ukDelete).

Response indicates the action to take when the OnUpdateError handler exits. On entry into the handler, Response is set to either rrAbort or rrSkip, based on the MaxErrors parameter passed to the ApplyUpdates function that triggers OnUpdateError. If MaxErrors is 0 then Response is rrAbort; otherwise it is rrSkip. If OnUpdateError can handle or correct the error, set Response to rrApply before exiting the error handler.


TBaseProvider methods

TBaseProvider	Alphabetically	Legend

In TBaseProvider

CheckResolver

Create

CreateDataPacket

CreateResolver

Destroy

DoOnGetData

DoOnUpdateData

FetchDetails

FreeResolver

InternalApplyUpdates

InternalGetRecords

InternalRowRequest

LocateRecord

UpdateRecord

Derived from TCustomProvider

ApplyUpdates

DataRequest

Execute

GetParams

GetRecords

RowRequest

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBaseProvider methods

TBaseProvider	By object	Legend

AfterConstruction

ApplyUpdates

Assign

BeforeDestruction

CheckResolver

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateDataPacket

CreateResolver

DataRequest

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DoOnGetData

DoOnUpdateData

Execute

ExecuteAction

FetchDetails

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

FreeResolver

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParams

GetParentComponent

GetRecords

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

InternalApplyUpdates

InternalGetRecords

InternalRowRequest

LocateRecord

MethodAddress

MethodName

NewInstance

RemoveComponent

RowRequest

SafeCallException

UpdateAction

UpdateRecord


TBaseProvider.CheckResolver

TBaseProvider	See also

Instantiates a resolver for the Resolver property if it does not already exist.

procedure CheckResolver;

Description

CheckResolver is called internally when the provider needs to use its resolver component. It checks whether Resolver is nil, and if so, calls CreateResolver to assign a value.


TBaseProvider.Create

TBaseProvider	See also

Creates and initializes a TBaseProvider object.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a provider at runtime. Providers placed in forms or data modules at design time are created automatically.

After calling the inherited constructor, Create initializes the ProviderOptions property to an empty set.


TBaseProvider.CreateDataPacket

TBaseProvider	See also

Generates a data packet for the data associated with the provider.

procedure CreateDataPacket(PacketOpts: TGetRecordOptions; ProvOpts: TProviderOptions; var RecsOut: Integer; var Data: OleVariant); virtual;

Description

CreateDataPacket is used internally to generate data packets. As implemented in TBaseProvider, CreateDataPacket sets RecsOut to 0 and Data to NULL. Descendants override this method to create the data packets that are returned by GetRecords.

The PacketOpts parameter indicates what information (other than record values) is included in the data packet. It reflects the Options passed to the GetRecords method.

The ProvOpts parameter reflects the current value of the Options property.

The RecsOut parameter specifies the number of records desired in the packet and returns the actual number of records in the generated data packet.

The Data parameter returns the generated data packet.


TBaseProvider.CreateResolver

TBaseProvider	See also

Creates a resolver component for handling the application of updates.

function CreateResolver: TCustomResolver; virtual;

Description

CreateResolver is called automatically when a resolver is needed to implement one of TBaseProvider’s methods. As implemented in TBaseProvider, CreateResolver always returns nil. Descendants of TBaseProvider override this method to create a TCustomResolver descendant that applies updates in the desired manner.


TBaseProvider.Destroy

TBaseProvider	See also

Frees an instance of a provider object.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead, call Free, which checks that the provider is not nil before calling the Destroy method. Destroy frees the associated resolver if the Resolver property is not nil and calls its inherited destructor.


TBaseProvider.DoOnGetData

TBaseProvider	See also

Generates an OnGetData event.

procedure DoOnGetData(var Data: OleVariant);

Description

DoOnGetData is the protected implementation of the OnGetData event. Override this method to perform class-specific actions in response to client data requests.


TBaseProvider.DoOnUpdateData

TBaseProvider	See also

Generates an OnUpdateData event.

procedure DoOnUpdateData(Delta: TPacketDataSet);

Description

DoOnUpdateData is the protected implementation of the OnUpdateData event. The Delta property contains the delta packet from the client. It is passed to the OnUpdateData event handler as a client dataset.

Override this method to perform class-specific actions in response to client update requests.


TBaseProvider.FetchDetails

TBaseProvider	See also

Fills a delta dataset with all nested dataset field values.

procedure FetchDetails(Source, Delta: TDataSet); virtual;

Description

FetchDetails is used internally to fetch the current values of any nested datasets when the provider is executing its RowRequest method. As implemented in TBaseProvider, FetchDetails does nothing. Descendants override this method to add nested detail datasets to the delta packet specified by Delta.

Source is a source dataset that has the current values for all fields. Delta is a delta dataset that must be updated so that its nested detail fields match the values in Source.


TBaseProvider.FreeResolver

TBaseProvider	See also

Frees the resolver specified by the Resolver property.

procedure FreeResolver;

voidDescription

Call FreeResolver to safely dispose of the component specified by the Resolver property. FreeResolver sets the Resolver property to nil after calling the resolver’s Free method.


TBaseProvider.InternalApplyUpdates

TBaseProvider 	See also

Provides the underlying implementation of the ApplyUpdates method.

function InternalApplyUpdates(const Delta: OleVariant; MaxErrors: Integer; out ErrorCount: Integer): OleVariant; override;

Description

The ApplyUpdates method calls InternalApplyUpdates to apply the updates contained in a delta packet after generating the BeforeApplyUpdates event and before generating the AfterApplyUpdates event.

If the Options property includes poReadOnly, InternalApplyUpdates raises an exception. Otherwise, it calls the ApplyUpdates method of its Resolver component to handle the actual update and resolving process. If the Resolver property is nil, ApplyUpdates calls the CreateResolver method and assigns the resulting resolver to the Resolver property.

Delta is the delta packet containing insertions, deletions, and modifications to be applied.

MaxErrors indicates the maximum number of errors that can be applied before stopping the update operation. If MaxErrors is –1, the provider tries to apply all updates.

ErrorCount returns the number of errors encountered during the update operation.

InternalApplyUpdates returns a data packet of updates that could not be applied to the database as an OleVariant.


TBaseProvider.InternalGetRecords

TBaseProvider	See also

Provides the underlying implementation of the GetRecords method.

function InternalGetRecords(Count: Integer; out RecsOut: Integer; Options: TGetRecordOptions; const CommandText: WideString; var Params: OleVariant); OleVariant; override;

Description

The GetRecords method calls InternalGetRecords to assemble a data packet after calling DoBeforeGetRecords to apply the CommandText and Params and generate a BeforeGetRecords event. InternalGetRecords calls CreateDataPacket to create a data packet that reflects the current property settings of the provider. It then generates an OnGetData event.

Count indicates the number of records to retrieve. If Count is -1, all records are retrieved. If Count is 0, only metadata is retrieved. If Count is greater than 0, only the specified number of records are retrieved.

RecsOut returns the actual number of records retrieved.

Options indicates what information should be added to the data packet in addition to data. It can include grMetaData (include metadata), grReset (start providing records with the first one in the dataset), and grXML (encode the datapacket in XML rather than as an OleVariant).

CommandText specifies an optional SQL statement that replaces the SQL of an associated query, or the name of a table or stored procedure that replaces the associated table or stored procedure. This parameter is ignored if the Options property does not include poAllowCommandText.

Params specifies any parameter values that should be applied to CommandText or to an associated query or stored procedure. If the provider is associated with a table, Params specifies field values that filter the result set. On exit from GetRecords, Params returns any output parameters.

Records are returned as a data packet in a Variant.


TBaseProvider.InternalRowRequest

TBaseProvider	See also

Provides the underlying implementation of the RowRequest method.

function InternalRowRequest(const Row: OleVariant; RequestType: TFetchOptions): OleVariant; override;

Description

The RowRequest method calls InternalRowRequest to assemble the specified information after generating a BeforeRowRequest event and before generating an AfterRowRequest event. InternalRowRequest passes this request on to its associated Resolver.

The Row parameter is an OleVariant that describes the current record on the client dataset. It enables the provider to locate the record of interest.

The RequestType parameter indicates the type of information required.

InternalRowRequest returns the requested information in a delta packet.


TBaseProvider.LocateRecord

TBaseProvider 	See also

Positions a data set on the record that corresponds to the current update in a specified delta packet.

procedure LocateRecord(Source, Delta: TDataSet; virtual;

Description

LocateRecord is called indirectly by the RowRequest method to locate a record before fetching information about a specified record. The Source parameter is the dataset containing current record values. The Delta parameter is a delta packet that identifies the desired type of information and information identifying the desired record.

As implemented in TBaseProvider, LocateRecord does nothing. Descendants override this method to locate the specified record in Source and navigate to it.


TBaseProvider.UpdateRecord

TBaseProvider 	See also

Retrieves specified data from a source dataset into a delta packet.

procedure UpdateRecord(Source, Delta: TDataSet; BlobsOnly: Boolean); virtual;

Description

UpdateRecord is called indirectly by the RowRequest method to fetch BLOB fields or nested detail sets. The Source parameter is the dataset containing the BLOB fields or the detail dataset. The Delta parameter is a delta packet that returns the requested data to a client application. BlobsOnly indicates whether all field values should be provided (BlobsOnly = False) or only Blob field values (BlobsOnly = True).

As implemented in TBaseProvider, UpdateRecord does nothing. Descendants override this method to fill the Delta parameter with the requested information.


Scope

Published

Protected

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TCustomProvider


ECacheError

Hierarchy	Properties	Methods	See also

ECacheError is the exception class for failures that occur when building the cache of a decision cube.

Unit

mxstore

Description

ECacheError is raised when

•	The dataset for a decision cube includes too many fields.

•	The dataset for a decision cube does not include the necessary summaries for computing a derived value such as an average.

•	A dimension item in the dimension map specifies a date range for dimension that does not represent a date or date-time field.


ECacheError properties

ECacheError	Alphabetically

Derived from Exception

HelpContext

Message


ECacheError properties

ECacheError	By object

HelpContext

Message


ECacheError methods

ECacheError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelpException_CreateResHelp>Main

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


ECacheError methods

ECacheError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


TCaptionAttributes

Hierarchy	Properties	Methods	See also

TCaptionAttributes customizes the appearance of the label that identifies a display control in a MIDAS Web application.

Unit

MidItems

Description

TCaptionAttributes is the type of the CaptionAttributes property of Web items that generate display controls. It defines several properties that customize the appearance of the label generated by the Web item.


TCaptionAttributes properties

TCaptionAttributes	Alphabetically	Legend

In TCaptionAttributes

Custom

Parent

Style

StyleRule


TCaptionAttributes properties

TCaptionAttributes	By object	Legend

Custom

Parent

Style

StyleRule


TCaptionAttributes.Custom

TCaptionAttributes	See also

Represents a tag option and its value.

property Custom: string;

Description

Use Custom to add one or more options to the tag that surrounds the caption. When used by TWebDataInput, this is a SPAN tag. Each option and its value has the form

OPTIONNAME=Value

The options specified by Custom should be separated by spaces.

The Web item that generates the caption inserts the Custom string into the HTML tag when it generates its content.


TCaptionAttributes.Parent

TCaptionAttributes	See also

Indicates the Web item that uses TCaptionAttributes to customize the appearance of its generated caption.

property Parent: TComponent;

Description

Use Parent to access the Web item that uses the TCaptionAttributes object.


TCaptionAttributes.Style

TCaptionAttributes	See also

Adds style attributes to the generated caption.

property Style: string;

Description

Use Style to specify display characteristics that affect the generated caption. The Style option consists of one or more attribute descriptions such as

font-family: arial; font-weight: bold; font-size: 10px

These attributes are added to the HTML tag that generates the caption as the value of a STYLE option.


TCaptionAttributes.StyleRule

TCaptionAttributes	See also

Applies a style in the page producer’s style sheet to the generated caption.

property StyleRule: string;

Description

Use StyleRule to assign one of the user-defined styles in the HTML document’s style sheet to the generated caption. The value of StyleRule specifies one of the user-defined style names defined in the MIDAS page producer’s Styles or StylesFile property.

To apply a style definition that is not included in the style sheet, use the Style property instead.


TCaptionAttributes methods

TCaptionAttributes	Alphabetically

In TCaptionAttributes

Create

Derived from TPersistent

Assign

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCaptionAttributes methods

TCaptionAttributes	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCaptionAttributes.Create

TCaptionAttributes	See also

Creates an instance of TCaptionAttributes.

constructor Create(AParent: TComponent);

Description

Do not create instances of TCaptionAttributes. This object is instantiated by the Web item that uses it to implement its CaptionAttributes property.

The AParent parameter specifies the Web item that creates a TCaptionAttributes instance for its CaptionAttributes property. This becomes the value of the Parent property.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent


TClientBlobStream

Hierarchy	Properties	Methods 	See also

TClientBlobStream lets applications read from or write to BLOB fields in a client dataset.

Unit

Dbclient

Description

Use TClientBlobStream to access or modify the value of a Binary Large Object (BLOB) field in a client dataset. BLOB fields are TBlobField objects and descendants of TBlobField such as TGraphicField and TMemoField. BLOB fields in client datasets use client BLOB streams to implement many of their data access properties and methods.

TClientBlobStream allows objects that have no specialized knowledge of how data is stored in a BLOB field to read or write such data by employing the uniform stream interface.

To use a client BLOB stream, create an instance of TClientBlobStream, use the methods of the stream to read or write the data, and then free the BLOB stream. Do not use the same instance of TClientBlobStream to access data from more than one record. Instead, create a new TClientBlobStream object every time you need to read or write BLOB data on a new record.

Note:	Explicitly creating a TClientBlobStream instance does not ensure that the current record has fetched its BLOB data. To ensure that the BLOB field contains its data before reading from the BLOB stream, call the client dataset’s FetchBlobs method before creating the BLOB stream or use the client dataset’s CreateBlobStream method to create the BLOB stream indirectly.


TClientBlobStream properties

TClientBlobStream	Alphabetically	Legend

Derived from TCustomMemoryStream

Memory

Derived from TStream

Position

Size


TClientBlobStream properties

TClientBlobStream	By object	Legend

Memory

Position

Size


TClientBlobStream methods

TClientBlobStream	Alphabetically

In TClientBlobStream

Create

Destroy

Truncate

Write

Derived from TMemoryStream

Clear

LoadFromFile

LoadFromStream

SetSize

Derived from TCustomMemoryStream

Read

SaveToFile

SaveToStream

Seek

Derived from TStream

CopyFrom

FixupResourceHeader

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TClientBlobStream methods

TClientBlobStream	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

CopyFrom

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

FixupResourceHeader

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

Read

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

SafeCallException

SaveToFile

SaveToStream

Seek

SetSize

Truncate

Write

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader


TClientBlobStream.Create

TClientBlobStream	See also

Creates and initializes an instance of TClientBlobStream.

constructor Create(Field: TBlobField; Mode: TBlobStreamMode);

Description

Call Create to obtain an instance of TClientBlobStream for reading from or writing to a specific TBlobField object in a client dataset.

Create links the TClientBlobStream to the field object specified by the Field parameter. Mode specifies whether the BLOB stream will be used to read data (bmRead), write data (bmWrite) or modify data (bmReadWrite).

Tip:	Because Client datasets sometimes fetch BLOB data on demand, it is a good idea to use the Client dataset’s CreateBlobStream method rather than calling the Client BLOB stream’s constructor. CreateBlobStream ensures that BLOB data is fetched for the current record unless the FetchOnDemand property is False.


TClientBlobStream.Destroy

TClientBlobStream	See also

Frees an instance of TClientBlobStream.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead call Free. Free verifies that the TBlobStream object is not nil and only then calls Destroy.

Destroy the TClientBlobStream object by calling Free when it is no longer needed for reading from or writing to the BLOB field. Client blob streams should be destroyed when the client dataset changes the current record

Destroy triggers an OnDataChange event if the BLOB stream was used to overwrite or modify the data in the field. Destroy then frees any buffers that were allocated to handle the data.


TClientBlobStream.Truncate

TClientBlobStream	See also

Discards all data in the BLOB field from the current position on.

procedure Truncate;

Description

Use Truncate to limit the size of the BLOB data. Calling Truncate does the same thing as setting the Size property to the value of the Position property. Calling Truncate when the current position is 0 will clear the contents of the BLOB field.

Note:	Do not call Truncate when the TBlobStream was created in bmRead mode.


TClientBlobStream.Write

TClientBlobStream	See also

Writes Count bytes from Buffer to the current position in the field and updates the current position by Count bytes.

function Write(const Buffer; Count: Longint): Longint; override;

Description

Use Write to write Count bytes to the BLOB field, starting at the current position. The Write method for TClientBlobStream always writes the entire Count bytes, as BLOB data does not necessarily include a termination character. Thus, Write is equivalent to the WriteBuffer method.

All the other data-writing methods of a BLOB stream (WriteBuffer, WriteComponent) call Write to do their actual writing.

Note:	Do not call Write when the TClientBlobStream was created in bmRead mode.


Accessibility

Read-only


Hierarchy

TObject

TStream

TCustomMemoryStream

TMemoryStream


TCustomDataGrid

Hierarchy	Properties	Methods	See also

TCustomDataGrid is the base class for Web items that generate an HTML table to display a dataset in an XML data packet.

Unit

MidItems

Description

Use TCustomDataGrid as a base class for Web items that generate an HTML table to display multiple records from a dataset as a set of rows and columns.  Each TCustomDataGrid object maintains a list of Web items that generate the individual fields (columns) of the table. These Web items can be from the following classes: TTextColumn, TSelectOptionColumn, TTextAreaColumn, and TStatusColumn.

You can bind the data grid to an XML data packet or dataset field within an XML data packet. The column Web items can then use that binding to determine the source of the data they display.

TCustomDataGrid introduces a number of properties that affect the appearance of the generated table.

In order to let other Web items use the HTML table that the data grid generates, TCustomDataGrid inherits the IWebContent interface from TWebControlGroup.

Do not create instances of TCustomDataGrid. Instead, use a descendant of TCustomDataGrid such as TDataGrid.


TCustomDataGrid properties

TCustomDataGrid	Alphabetically	Legend

In TCustomDataGrid

DisplayRows

HeadingAttributes

RowAttributes

TableAttributes

Derived from TXMLDisplayGroup

VisibleFields

XMLBroker

XMLDataSetField

Derived from TWebControlGroup

WebFieldControls

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomDataGrid properties

TCustomDataGrid	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

DisplayRows

HeadingAttributes

Name

Owner

RowAttributes

TableAttributes

Tag

VCLComObject

VisibleFields

WebFieldControls

XMLBroker

XMLDataSetField


TCustomDataGrid.DisplayRows

TCustomDataGrid	See also

Limits the number of rows in the HTML table.

property DisplayRows: Integer;

Description

Use DisplayRows to specify the number of rows that appear in the generated HTML table.

Note that the number of rows in the HTML table does not limit the number of records that end users can view and edit.  When DisplayRows is less than the number of records in the data packet, the control generated by TNextPageButton or TPriorPageButton lets end users scroll through the records in the data packet.


TCustomDataGrid.HeadingAttributes

TCustomDataGrid	See also

Determines the display characteristics of the table’s header.

property HeadingAttributes: TGridRowAttributes;

Description

Use HeadingAttributes to specify any display attributes that apply only to the heading of the generated HTML table. HeadingAttributes determines the options that are added to the <TR> tag that defines the header of the grid. These include the color of the header, the alignment of the caption for each column, and any custom options or style rules.

Note:	To influence the display attributes of the grid as a whole or only the rows of the grid, use the TableAttributes or RowAttributes property instead.


TCustomDataGrid.RowAttributes

TCustomDataGrid	See also

Determines the display characteristics of the table’s body.

property RowAttributes: TGridRowAttributes;

Description

Use RowAttributes to specify any display attributes that apply only to the rows of the generated HTML table. RowAttributes determines the options that are added to the <TR> tag for each row in the body of the grid. These include the color of the rows, the alignment of data within each cell, and any custom options or style rules.

Note:	To influence the display attributes of the grid as a whole or only the header of the grid, use the TableAttributes or HeadingAttributes property instead.


TCustomDataGrid.TableAttributes

TCustomDataGrid	See also

Determines the basic display characteristics of the table.

property TableAttributes: TGridAttributes;

Description

Use TableAttributes to specify values for the most common options on the HTML <TABLE> tag. TableAttributes lets you specify the alignment of the table in its HTML document, its color and border size, the offset of data within each table cell, as well as any custom options or style rules.

Note:	To influence the display attributes of only the header of the grid, or only the rows in its body, use the TableAttributes or HeadingAttributes property instead.


TCustomDataGrid methods

TCustomDataGrid	Alphabetically

In TCustomDataGrid

Create

Destroy

Derived from TWebControlGroup

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomDataGrid methods

TCustomDataGrid	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TCustomDataGrid.Create

TCustomDataGrid	See also

Creates and initializes an instance of TCustomDataGrid.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TCustomDataGrid at runtime. TCustomDataGrid components added at design time using the Web Page editor are instantiated automatically.


TCustomDataGrid.Destroy

TCustomDataGrid	See also

Frees an instance of TCustomDataGrid.

Description

Do not call Destroy directly. Instead, call Free, which checks whether the object reference is nil before calling Destroy.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebControlGroup

TXMLDisplayGroup


TCustomDecisionGraph

Hierarchy	Properties	Methods	Events	See also

TCustomDecisionGraph is the base class for controls that graph crosstabulated data.

Unit

mxgraph

Description

Use TCustomDecisionGraph as a base class when defining objects that graph the data from a decision source. Decision graphs chart a single summary that is calculated over a number of dimensions. The dimensions appear as axes of the graph.

The field that is summarized and the fields (dimensions) over which it is summarized can be changed dynamically at runtime to view any configuration of summary and dimensions chosen from the dimension map of a decision cube. Changes to the dimensions and summary can be initiated using a TDecisionPivot object.

Do not create instances of TCustomDecisionGraph. To put a decision graph on a form, use TDecisionGraph.


TCustomDecisionGraph properties

TCustomDecisionGraph	Alphabetically	Legend

In TCustomDecisionGraph

DecisionSource

Derived from TChart

AllowPanning

AllowZoom

Foot

Gradient

LeftWall

PrintResolution

Title

Zoomed

Derived from TCustomChart

AnimatedZoom

AnimatedZoomSteps

AxisVisible

BackColor

BackImage

BackImageInside

BackImageMode

BottomAxis

BottomWall

BufferedDisplay

Canvas

Chart3DPercent

ClipPoints

BufferedDisplay

Frame

LeftAxis

Legend

MarginBottom

MarginLeft

MarginRight

MarginTop

MaxPointsPerPage

Monochrome

Page

RightAxis

ScaleLastPage

Series

SeriesList

TopAxis

View3d

View3dWalls

Derived from TCustomTeePanel

Canvas

Derived from TCustomPanel

BevelInner

BevelOuter

BevelWidth

BorderStyle

BorderWidth

Locked

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragMode

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomDecisionGraph properties

TCustomDecisionGraph	By object	Legend

Action

Align

AllowPanning

AllowZoom

Anchors

AnimatedZoom

AnimatedZoomSteps

AxisVisible

BackColor

BackImage

BackImageInside

BackImageMode

BevelInner

BevelOuter

BevelWidth

BorderStyle

BorderWidth

BiDiMode

BottomAxis

BottomWall

BottomAxis

BottomWall

BoundsRect

Brush

BufferedDisplay

BufferedDisplay

Canvas

Chart3DPercent

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ClipPoints

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DecisionSource

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragMode

Enabled

Floating

FloatingDockSiteClass

Foot

Frame

Gradient

Handle

Height

HelpContext

Hint

HostDockSite

Left

LeftAxis

LeftWall

Legend

Locked

LRDockWidth

MarginBottom

MarginLeft

MarginRight

MarginTop

MaxPointsPerPage

Monochrome

Name

Owner

Page

Parent

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

PrintResolution

RightAxis

ScaleLastPage

Series

SeriesList

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Title

Top

TopAxis

UndockHeight

UndockWidth

VCLComObject

View3d

View3dWalls

Visible

VisibleDockClientCount

Width

WindowProc

Zoomed


TCustomDecisionGraph.DecisionSource

TCustomDecisionGraph 	See also

Specifies the decision source object that supplies data values for the decision graph.

property DecisionSource: TDecisionSource;

Description

Set DecisionSource to link the decision graph to the crosstabulated data from a decision cube. The DecisionSource object maintains information about the current pivot state of the data. Thus, any two decision controls that share the same decision source will display the data from the decision cube using the same configuration of dimensions, including any closed dimensions or drilled down values.


TCustomDecisionGraph events

TCustomDecisionGraph	Alphabetically	Legend

Derived from TChart

OnAllowScroll

OnClickAxis

OnClickBackground

OnClickLegend

OnClickSeries

OnGetLegendPos

OnGetLegendRect

OnScroll

OnUndoZoom

OnZoom

Derived from TCustomChart

OnAfterDraw

OnGetAxisLabel

OnGetLegendText

OnGetNextAxisLabel

OnPageChange

OnResize

Derived from TWinControl

OnDockDrop

OnDockOver

OnEnter

OnExit

OnGetSiteInfo

OnUnDock

Derived from TControl

OnCanResize

OnClick

OnConstrainedResize

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock


TCustomDecisionGraph events

TCustomDecisionGraph	By object	Legend

OnAfterDraw

OnAllowScroll

OnCanResize

OnClick

OnClickAxis

OnClickBackground

OnClickLegend

OnClickSeries

OnConstrainedResize

OnDblClick

OnDockDrop

OnDockOver

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnGetAxisLabel

OnGetLegendPos

OnGetLegendRect

OnGetLegendText

OnGetNextAxisLabel

OnGetSiteInfo

OnMouseDown

OnMouseMove

OnMouseUp

OnPageChange

OnResize

OnScroll

OnStartDock

OnUnDock

OnUndoZoom

OnZoom


TCustomDecisionGraph methods

TCustomDecisionGraph	Alphabetically

In TCustomDecisionGraph

Create

Destroy

Derived from TChart

CalcClickedPart

CalcMetaBounds

ChartPrintRect

CopyToClipboardBitmap

CopyToClipboardMetafile

DrawToMetaCanvas

ExchangeSeries

FillSeriesSourceItems

FillValueSourceItems

GetEditorClass

IsScreenHighColor

NextPage

PreviousPage

Print

PrintLandscape

PrintOrientation

PrintPartial

PrintPartialCanvas

PrintPortrait

PrintRect

SaveToBitmapFile

SaveToMetafile

SaveToMetafileEnh

SaveToMetafileRect

SeriesDown

SeriesUp

TeeCreateMetafile

UndoZoom

ZoomPercent

ZoomRect

Derived from TCustomChart

ActiveSeriesLegend

AddSeries

BackWallRect

CalcSize3d

CalcSize3dWalls

ChartRegionRect

CheckDatasource

CheckPenWidth

ClipRectangle

Draw

FormattedLegend

FormattedValueLegend

FreeAllSeries

GetASeries

GetAxisSeries

GetFreeSeriesColor

GetLabelsSeries

InternalDraw

IsFreeSeriesColor

IsValidDataSource

MarkText

MaxMarkWidth

MaxTextWidth

MaxXValue

MaxYValue

MinXValue

MinYValue

NumPages

RemoveAllSeries

RemoveSeries

SeriesCount

SeriesTitleLegend

UnClipRectangle

XLabelText

Derived from TCustomTeePanel

CanvasChanged

DoHorizLine

DoLine

DoPolygon

DoRectangle

DoVertLine

FontCanvas

GetCursorPos

GetRectangle

GetWidthHeight

ReCalcWidthHeight

RotateLabel

SetBooleanProperty

SetBrushCanvas

SetColorProperty

SetDoubleProperty

SetIntegerProperty

SetInternalCanvas

SetLongintProperty

SetStringProperty

TeeCharHeight

TeeTextHeight

TeeTextOut

TeeTextWidth

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomDecisionGraph methods

TCustomDecisionGraph	By object

ActiveSeriesLegend

AddSeries

AfterConstruction

Assign

BackWallRect

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CalcClickedPart

CalcMetaBounds

CalcSize3d

CalcSize3dWalls

CanFocus

CanvasChanged

ChartPrintRect

ChartRegionRect

CheckDatasource

CheckPenWidth

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ClipRectangle

ContainsControl

ControlAtPos

CopyToClipboardBitmap

CopyToClipboardMetafile

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DoHorizLine

DoLine

DoPolygon

DoRectangle

DoVertLine

DragDrop

Dragging

Draw

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

DrawToMetaCanvas

EnableAlign

EndDrag

ExchangeSeries

ExecuteAction

FieldAddress

FillSeriesSourceItems

FillValueSourceItems

FindChildControl

FindComponent

FlipChildren

Focused

FontCanvas

FormattedLegend

FormattedValueLegend

Free

FreeAllSeries

FreeInstance

FreeNotification

FreeOnRelease

GetASeries

GetAxisSeries

GetControlsAlignment

GetCursorPos

GetEditorClass

GetFreeSeriesColor

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetLabelsSeries

GetNamePath

GetParentComponent

GetRectangle

GetTabOrderList

GetTextBuf

GetTextLen

GetWidthHeight

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

InternalDraw

Invalidate

IsFreeSeriesColor

IsRightToLeft

IsScreenHighColor

IsValidDataSource

ManualDock

ManualFloat

MarkText

MaxMarkWidth

MaxTextWidth

MaxXValue

MaxYValue

MethodAddress

MethodName

MinXValue

MinYValue

MouseWheelHandler

NewInstance

NextPage

NumPages

PaintTo

Perform

PreviousPage

Print

PrintLandscape

PrintOrientation

PrintPartial

PrintPartialCanvas

PrintPortrait

PrintRect

Realign

ReCalcWidthHeight

Refresh

RemoveAllSeries

RemoveComponent

RemoveControl

RemoveSeries

Repaint

ReplaceDockedControl

RotateLabel

SafeCallException

SaveToBitmapFile

SaveToMetafile

SaveToMetafileEnh

SaveToMetafileRect

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SeriesCount

SeriesDown

SeriesTitleLegend

SeriesUp

SetBooleanProperty

SetBounds

SetBrushCanvas

SetColorProperty

SetDoubleProperty

SetFocus

SetIntegerProperty

SetInternalCanvas

SetLongintProperty

SetStringProperty

SetTextBuf

Show

TeeCharHeight

TeeCreateMetafile

TeeTextHeight

TeeTextOut

TeeTextWidth

UnClipRectangle

UndoZoom

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

XLabelText

ZoomPercent

ZoomRect


TCustomDecisionGraph.Create

TCustomDecisionGraph	See also

Creates and initializes an instance of TCustomDecisionGraph.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create a decision graph at runtime. Do not create instances of TCustomDecisionGraph. Instead, create a descendant of TCustomDecisionGraph such as TDecisionGraph. Decision graphs placed in forms at design time are created automatically.

Pass a single Component as a parameter to provide the decision graph with an Owner that is responsible for freeing it.


TCustomDecisionGraph.Destroy

TCustomDecisionGraph	See also

Destroys an instance of TCustomDecisionGraph.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the decision grid is not nil and only then calls Destroy.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomPanel

TCustomTeePanel

TCustomChart

TChart


TCustomDecisionGrid

Hierarchy	Properties	Methods	Events	See also

TCustomDecisonGrid is the base class for controls that present crosstabulated data in a two-dimensional grid.

Unit

mxgrid

Description

Use TCustomDecisionGrid as a base class when defining a decision grid object. Decision grids can present a single summary that is calculated over an arbitrary number of dimensions.

The field that is summarized and the fields (dimensions) over which it is summarized can be changed dynamically at runtime to view any configuration of summary and dimensions chosen from the dimension map of a decision cube. Changes to the dimensions and summary can be initiated by direct manipulation of the decision grid, or by using a TDecisionPivot object.

Do not create instances of TCustomDecisionGrid. To add a decision grid to a form, use the TDecisionGrid object.


TCustomDecisionGrid properties

TCustomDecisionGrid	Alphabetically	Legend

In TCustomDecisionGrid

CaptionColor

CaptionFont

Cells

ColCount

ColWidth

DataColor

DataFont

DataSumColor

DecisionSource

DefaultColWidth

DefaultRowHeight

Dimensions

FixedCols

FixedRows

GridLineColor

GridLineWidth

LabelColor

LabelFont

LabelSumColor

Options

RowCount

RowHeight

ShowCubeEditor

Totals

Derived from TWinControl

BevelEdges

BevelInner

BevelKind

BevelOuter

BevelWidth

BorderWidth

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BoundsRect

BiDiMode

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomDecisionGrid properties

TCustomDecisionGrid	By object	Legend

Action

Align

Anchors

BevelEdges

BevelInner

BevelKind

BevelOuter

BevelWidth

BiDiMode

BorderWidth

BoundsRect

Brush

CaptionColor

CaptionFont

Cells

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ColCount

ColWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DataColor

DataFont

DataSumColor

DecisionSource

DefaultColWidth

DefaultRowHeight

DesignInfo

Dimensions

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

FixedCols

FixedRows

Floating

FloatingDockSiteClass

GridLineColor

GridLineWidth

Handle

Height

HelpContext

Hint

HostDockSite

LabelColor

LabelFont

LabelSumColor

Left

LRDockWidth

Name

Options

Owner

Parent

ParentWindow

RowCount

RowHeight

ShowCubeEditor

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

Totals

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TCustomDecisionGrid.CaptionColor

TCustomDecisionGrid	See also

Specifies the background color of cells containing the names of the row and column dimensions.

property CaptionColor: TColor;

Description

Set CaptionColor to the color that should be used to make the names of the row and column dimensions stand out. These are the names for the dimensions that are set in the Decision Cube Editor.

The actual values of the fields that make up the row and column dimensions are drawn using the LabelColor property.


TCustomDecisionGrid.CaptionFont

TCustomDecisionGrid	See also

Specifies the font used to write the names of the row and column dimensions.

property CaptionFont: TFont;

Description

Set CaptionFont to the font that should be used to make the names of the row and column dimensions stand out. These are the names for the dimensions that are set in the Decision Cube Editor.

The actual values of the fields that make up the row and column dimensions are written using the LabelFont property.


TCustomDecisionGrid.Cells

TCustomDecisionGrid	See also

Provides indexed access to the values of all cells in the decision grid.

property Cells[ACol, ARow: Integer]: string;

Description

Use Cells to obtain the value of a cell in the grid, formatted as a string. The ACol and ARow parameters indicate the column and row indexes of the cell, where (0,0) indicates the top left cell of the data region (not the top left cell of the grid). Cells that have been closed up using the Display Data or Display SubTotals menu items are still counted even though they are not visible.

If the cell is a row or column caption (negative value for ACol or ARow), Cells returns the name of the dimension. If the cell is a row or column label, Cells returns the field value of the dimension field. If the cell is a subtotal label, Cells returns the string Sum. If the cell is in the data region of the grid, Cells returns the summarized value.


TCustomDecisionGrid.ColCount

TCustomDecisionGrid	See also

Indicates the total number of columns in the decision grid.

property ColCount: Integer;

Description

Read ColCount to determine the number of columns in the decision grid, including the columns containing dimension captions and label cells. Compute the number of columns in the data region of the decision grid by subtracting the value of FixedCols from ColCount.


TCustomDecisionGrid.ColWidth

TCustomDecisionGrid	See also

Specifies the default column width.

property ColWidth: Integer;

Description

Set ColWidth to the desired width of the columns in the decision grid that are not resized by the user. Setting ColWidth changes the size of all columns in the grid, including columns that have been resized using the mouse.


TCustomDecisionGrid.DataColor

TCustomDecisionGrid	See also

Specifies the background color of the cells containing summarized values.

property DataColor: TColor;

Description

Set DataColor to the color that should be used for the scrollable data region of the decision grid. The data region contains the values of the current summary of the decision cube, where each cell represents the value of a field summarized over the values indicated by the row and column dimensions.

The subtotals that represent values summarized over all values within a given dimension (as well as the single value in other dimensions) are drawn using the DataSumColor property.


TCustomDecisionGrid.DataFont

TCustomDecisionGrid	See also

Specifies the font used to write the summarized values in the scrollable region of the decision grid.

property DataFont: TFont;

Description

Set DataFont to the font that should be used for the data region of the decision grid. The data region contains the values of the current summary of the decision cube, where each cell represents the value of a field summarized over the values indicated by the row and column dimensions. It also includes the dimension subtotals over the summary field.


TCustomDecisionGrid.DataSumColor

TCustomDecisionGrid	See also

Specifies the background color of cells that represent subtotals over entire dimensions.

property DataSumColor: TColor;

Description

Set DataSumColor to make the subtotals that represent an entire dimension stand out from the summary values that summarize information over a single value in each dimension. The subtotal cells are placed in the scrollable data region at the ends of the set of rows or columns that correspond to a given dimension.


TCustomDecisionGrid.DecisionSource

TCustomDecisionGrid	See also

Specifies the decision source that supplies crosstabulated data to the decision grid.

property DecisionSource: TDecisionSource;

Description

Set DecisionSource to link the decision grid to the crosstabulated data from a decision cube. The DecisionSource object maintains information about the current pivot state of the data. Thus, any two decision controls that share the same decision source will display the data from the decision cube using the same configuration of row and column dimensions, including any closed dimensions or drilled down values.


TCustomDecisionGrid.DefaultColWidth

TCustomDecisionGrid	See also

Specifies the width of all columns that are not explicitly resized.

property DefaultColWidth: Integer;

Description

Set DefaultColWidth to the desired width of the columns in the decision grid that are not resized using the mouse. Setting DefaultColWidth changes the size of all columns in the grid, including columns that have been resized.


TCustomDecisionGrid.DefaultRowHeight

TCustomDecisionGrid	See also

Specifies the height of all rows that are not explicitly resized.

property DefaultRowHeight: Integer;

Description

Set DefaultRowHeight to the desired height of the rows in the decision grid that are not resized using the mouse. Setting DefaultRowHeight changes the size of all rows in the grid, including rows that have been resized.


TCustomDecisionGrid.Dimensions

TCustomDecisionGrid	See also

Provides access to the collection of TDisplayDim objects that control the appearance of each dimension.

property Dimensions: TDisplayDims;

Description

Set the properties of the individual TDisplayDim objects to control the appearance of individual dimensions within the grid. The TDisplayDim objects have properties that can override the various color and font properties of the grid to make individual dimensions stand out. They also allow the dimension names, alignments, and formats to be customized, and permit the dimension subtotals for a dimension to be turned on or off.

Note:	Do not change the Dimensions property, only the properties of individual TDisplayDim objects accessed through the Dimensions property. To programmatically change the configuration of dimensions that appears in the grid, use the decision source object.


TCustomDecisionGrid.FixedCols

TCustomDecisionGrid	See also

Indicates the number of columns used for dimension captions and dimension value labels.

property FixedCols: Integer;

Description

Read FixedCols to determine the number of columns in the decision grid that are not part of the data region. Subtract FixedCols from the value of the ColCount property to obtain the number of columns in the data region.


TCustomDecisionGrid.FixedRows

TCustomDecisionGrid	See also

Indicates the number of rows used for dimension captions and dimension value labels.

property FixedRows: Integer;

Description

Read FixedRows to determine the number of rows in the decision grid that are not part of the data region. Subtract FixedRows from the value of the RowCount property to obtain the number of rows in the data region.


TCustomDecisionGrid.GridLineColor

TCustomDecisionGrid	See also

Specifies the color of the lines that separate the cells in the decision grid.

property GridLineColor: TColor;

Description

Set GridLineColor to specify the color of the lines drawn between the cells of the grid. The grid lines only appear when the Options property includes cgGridLines.


TCustomDecisionGrid.GridLineWidth

TCustomDecisionGrid	See also

Specifies the width, in pixels, of the lines that separate the cells of the grid.

property GridLineWidth: Integer;

Description

Set GridLineWidth to make the lines that separate the cells in the decision grid heavier or lighter. The grid lines only appear when the Options property includes cgGridLines.


TCustomDecisionGrid.LabelColor

TCustomDecisionGrid	See also

Specifies the color of the individual row and column labels.

property LabelColor: TColor;

Description

Set LabelColor to the color that should be used to make the row and column labels stand out. The row and column labels of the decision grid contain the values of the fields that correspond to the dimensions of the decision cube. These are the values over which the data is summarized.


TCustomDecisionGrid.LabelFont

TCustomDecisionGrid	See also

Specifies the font used to write the individual row and column labels.

property LabelFont: TFont;

Description

Set LabelFont to the font that should be used to write the labels that display the values of the dimensions over which data is summarized. The row and column labels of the decision grid contain the values of the fields that correspond to the dimensions of the decision cube. LabelFont is also used when writing the labels for rows or columns that represent dimension subtotals.


TCustomDecisionGrid.LabelSumColor

TCustomDecisionGrid	See also

Specifies the background color for the subtotal labels.

property LabelSumColor: TColor;

Description

Set LabelSumColor make the subtotal labels stand out from the labels that represent individual field values along a dimension. The subtotal labels appear at the end of the set of field value labels for an individual dimension.


TCustomDecisionGrid.Options

TCustomDecisionGrid	See also

Specifies settings that affect the entire grid display.

type

  TDecisionGridOption = (cgGridLines, cgOutliner, cgPivotable);

TDecisionGridOptions = set of TDecisionGridOption;

property Options: TDecisionGridOptions;

Description

Set Options to include the desired properties for the grid. Options is a set drawn from the following values:

Value	Meaning

cgGridLines	Vertical and horizontal lines are drawn to separate the cells in the scrollable data region.

cgOutliner	The dimension caption cells contain plus (+) and minus (-) signs that open or close dimensions in the grid when clicked. The minus sign closes (hides) an adjacent dimension. The plus sign opens (shows) an adjacent dimension.

cgPivotable	Dimensions can be rearranged by clicking on the dimension caption cells and dragging them to a new position.

Note:	If Options does not include cgOutliner, individual dimensions can still be opened and closed using the decision pivot. Similarly, if Options does not include cgPivotable, individual dimensions can still be opened and closed with the decision pivot.


TCustomDecisionGrid.RowCount

TCustomDecisionGrid	See also

Indicates the total number of rows in the decision grid.

property RowCount: Integer;

Description

Read RowCount to determine the number of rows in the decision grid, including the rows containing dimension captions and label cells. Compute the number of rows in the data region of the decision grid by subtracting the value of FixedRows from RowCount.


TCustomDecisionGrid.RowHeight

TCustomDecisionGrid	See also

Specifies the default row height.

property RowHeight: Integer;

Description

Set RowHeight to the desired height of the rows in the decision grid that are not resized by the user. Setting RowHeight changes the size of all rows in the grid, including rows that have been resized using the mouse.


TCustomDecisionGrid.ShowCubeEditor

TCustomDecisionGrid	See also

Determines whether the Cube Editor can be displayed.

property ShowCubeEditor: Boolean;

Description

ShowCubeEditor determines whether the Cube Editor for the associated TDecisionCube can be invoked. If set to True, a menu item to invoke the Cube Editor is added to the speed menu displayed on a right-click on the decision grid at runtime.


TCustomDecisionGrid.Totals

TCustomDecisionGrid	See also

Indicates whether the grid includes subtotals.

property Totals: Boolean;

Description

Set Totals to turn row and column subtotals on or off for the whole grid. To turn subtotals on or off for individual dimensions, use the Dimensions property.


TCustomDecisionGrid events

TCustomDecisionGrid	Alphabetically

In TCustomDecisionGrid

OnDecisionDrawCell

OnDecisionExamineCell

OnTopLeftChanged


TCustomDecisionGrid events

TCustomDecisionGrid	By object

OnDecisionDrawCell

OnDecisionExamineCell

OnTopLeftChanged


TCustomDecisionGrid.OnDecisionDrawCell

TCustomDecisionGrid	See also

Occurs just before a cell in the grid is drawn.

type

  TDecisionDrawStates = (dsGroupStart, dsRowCaption, dsColCaption, dsSum, dsRowValue, dsColValue, dsData, dsOpenAfter, dsCloseAfter, dsRowIndicator, dsColIndicator, dsRowPlus, dsColPlus, dsNone);

  TDecisionDrawState = set of TDecisionDrawStates;

TDecisionDrawCellEvent = procedure (Sender: TObject; Col, Row: Longint; var Value: string; var AFont: TFont; var AColor: TColor; AState: TGridDrawState; ADrawState: TDecisionDrawState) of object;

property OnDecisionDrawCell: TDecisionDrawCellEvent;

Description

Write an OnDecisionDrawCell event handler to change the color, font, or text used to display an individual cell in the grid. Change the AColor, AFont, or Value parameter to change the color, font, or text respectively.

For example, to change the row and column labels from the values of the fields in the dataset to customized labels, change the Value parameter of the event handler when the Row and Column parameters represent a label cell.

The Row and Column parameters indicate the row and column of a cell within the grid, where (0,0) specifies the upper left summary value, not the upper left corner of the grid. Thus, the label cells contain negative row or column indexes. In addition, the AState parameter includes gdFixed when the cell is a label cell. AState also indicates whether the cell being drawn is selected.

The ADrawState parameter indicates the type of cell that is about to be drawn. ADrawState includes one or more of the following values:

Value	Meaning

dsGroupStart	The cell is the first row or column label for a dimension. Always appears with dsRowValue or dsColValue.

dsRowCaption	The cell displays a row caption (the name of a dimension whose values are listed down a column on the left of the grid).

dsColCaption	The cell displays a column caption (the name of a dimension whose values are listed along the top of the grid).

dsSum	The cell displays a subtotal label or value. Always appears with dsRowValue, dsColValue, or dsData.

dsRowValue	The cell is a row label. It represents a value from a dimension listed down a column on the left of the grid or a summary label that appears at the end of each group of dimension values.

dsColValue	The cell is a column label. It represents a value from a dimension listed across the top of the grid or a summary label that appears at the end of the dimension.

dsData	The cell is in the scrollable data region of the grid.

dsOpenAfter	The cell has a plus sign (+) on the right that will open following dimension when clicked. Always appears with dsRowCaption, dsColCaption, dsRowPlus, or dsColPlus.

dsCloseAfter	The cell has a minus sign (-) on the right that will close the following dimension when clicked. Always appears with dsRowCaption, dsColCaption, dsRowPlus, or dsColPlus.

dsRowIndicator	The cell appears on the left grid margin that is used to display the open and close indicators (+ and -).

dsColIndicator	The cell appears on the upper grid margin that is used to display the open and close indicators (+ and -).

dsRowPlus	The cell appears in the left margin and contains a plus sign (+) indicating that the adjacent dimension is closed. Always appears with dsRowIndicator.

dsColPlus	The cell appears in the top margin and contains a plus sign (+) indicating that the adjacent dimension is closed. Always appears with dsColIndicator.

dsNone	The cell has no function.


TCustomDecisionGrid.OnDecisionExamineCell

TCustomDecisionGrid	See also

Occurs when the user right-clicks on a cell in the data region of the grid.

Type

  TDecisionExamineCellEvent = procedure (Sender: TObject; ICol, IRow: Longint; ISum: Integer; const ValueArray: TValueArray) of object;

property OnDecisionExamineCell: TDecisionExamineCellEvent;

Description

Write an OnDecisionExamineCell event handler to take specific action when the user right-clicks on one of the cells that contains summarized data. The ICol and IRow parameters indicate the column and row indexes of the cell. The column and row indexes specify the value 0 for the top or leftmost cell in the scrollable data region, not the top left cell of the decision grid. The ISum parameter is the index of the current summary in the decision cube, where the first active summary has an index of 0. The ValueArray parameter gives the coordinates of the cell in terms of the dimensions of the decision source. If the cell represents a subtotal value, the entry in the ValueArray for the dimension over which the subtotal is calculated is a negative number.

Use the Cells property to obtain the value of the summary in the cell. Use the GetDimensionName method of the decision source to get the name of each dimension represented by an entry in the ValueArray parameter. Use the GetValueAsString or GetValueAsVariant method of the decision source to obtain the label values for each dimension represented in the ValueArray parameter.


TCustomDecisionGrid.OnTopLeftChanged

TCustomDecisionGrid	See also

Occurs when the data region of the grid scrolls.

property OnTopLeftChanged: TNotifyEvent;

Description

Write an OnTopLeftChanged event handler to take specific action when the summarized data in the grid scrolls. Use the Cells property or the CellDrawState method to obtain the new values of the data cells.


TCustomDecisionGrid methods

TCustomDecisionGrid	Alphabetically	Legend

In TCustomDecisionGrid

CellDrawState

CellValueArray

ColWidthsChanged

Create

Destroy

DrawCell

GetCells

MouseDown

MouseMove

MouseUp

Notification

Paint

RowHeightsChanged

SelectCell

TopLeftChanged

Derived from TCustomGrid

MouseCoord

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

Dock

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

InitiateAction

IsRightToLeft

Hide

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomDecisionGrid methods

TCustomDecisionGrid	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

CellDrawState

CellValueArray

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ColWidthsChanged

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawCell

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindComponent

FindChildControl

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetCells

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

IsRightToLeft

InstanceSize

Invalidate

ManualDock

ManualFloat

MethodAddress

MethodName

MouseCoord

MouseDown

MouseMove

MouseUp

MouseWheelHandler

NewInstance

Notification

Paint

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

RowHeightsChanged

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SelectCell

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TopLeftChanged

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TCustomDecisionGrid.CellDrawState

TCustomDecisionGrid	See also

Retrieves information about a data cell in the grid.

type

  TDecisionDrawStates = (dsGroupStart, dsRowCaption, dsColCaption, dsSum, dsRowValue, dsColValue, dsData, dsOpenAfter, dsCloseAfter, dsCloseBefore, dsOpenBefore, dsRowIndicator, dsColIndicator, dsRowPlus, dsColPlus, dsNone);

TDecisionDrawState = set of TDecisionDrawStates;&DrawState);

function CellDrawState(ACol, ARow: Integer; var Value: string; var DrawState: TDecisionDrawState): Boolean;

Description

Call CellDrawState to obtain information about a cell in the scrollable data region of the grid. The ACol and ARow parameters specify the index of the cell, where (0,0) is the upper left cell in the data region, not the upper left cell in the grid. The Value parameter returns the value of the summary in the cell, formatted for display. The DrawState parameter returns information about the type of information contained in the cell. For more information about the possible values of DrawState, see the entry for the OnDecisionDrawCell event.

CellDrawState returns True if the Value and DrawState parameters are correctly filled in. CellDrawState returns False if the cell specified by ACol and ARow is not in the data region of the grid.

The ADrawState parameter indicates the type of cell that is about to be drawn. ADrawState includes one or more of the following values:

Value	Meaning

dsGroupStart	The cell is the first row or column label for a dimension. Always appears with dsRowValue or dsColValue.

dsRowCaption	The cell displays a row caption (the name of a dimension whose values are listed down a column on the left of the grid).

dsColCaption	The cell displays a column caption (the name of a dimension whose values are listed along the top of the grid).

dsSum	The cell displays a subtotal label or value. Always appears with dsRowValue, dsColValue, or dsData.

dsRowValue	The cell is a row label. It represents a value from a dimension listed down a column on the left of the grid or a summary label that appears at the end of each group of dimension values.

dsColValue	The cell is a column label. It represents a value from a dimension listed across the top of the grid or a summary label that appears at the end of the dimension.

dsData	The cell is in the scrollable data region of the grid.

dsOpenAfter	The cell has a plus sign (+) on the right that will open following dimension when clicked. Always appears with dsRowCaption, dsColCaption, dsRowPlus, or dsColPlus.

dsCloseAfter	The cell has a minus sign (-) on the right that will close the following dimension when clicked. Always appears with dsRowCaption, dsColCaption, dsRowPlus, or dsColPlus.

dsRowIndicator	The cell appears on the left grid margin that is used to display the open and close indicators (+ and -).

dsColIndicator	The cell appears on the upper grid margin that is used to display the open and close indicators (+ and -).

dsRowPlus	The cell appears in the left margin and contains a plus sign (+) indicating that the adjacent dimension is closed. Always appears with dsRowIndicator.

dsColPlus	The cell appears in the top margin and contains a plus sign (+) indicating that the adjacent dimension is closed. Always appears with dsColIndicator.

dsNone	The cell has no function.


TCustomDecisionGrid.CellValueArray

TCustomDecisionGrid	See also

Returns the values of all dimension fields over which a data cell is summarized.

function CellValueArray(ACol, ARow: Integer; var ValueArray: TValueArray): Boolean;

Description

Call CellValueArray to obtain the coordinates of a data cell in the multidimensional array maintained by the decision cube. The ACol and ARow parameters represent the indexes of the column and row containing the cell, where (0,0) specifies the upper left data cell, not the top left cell in the grid. The ValueArray parameter returns the indexes of the field values for each dimension over which the cell summarizes data. Use the GetMemberAsString or GetMemberAsVariant method of the decision source to convert the indexes in the ValueArray parameter into field values. CellValueArray returns a boolean indicating whether the function was successful.


TCustomDecisionGrid.ColWidthsChanged

TCustomDecisionGrid	See also

Responds when the column widths change.

procedure ColWidthsChanged; override;

Description

ColWidthsChanged is called immediately after the column widths change. The change can result from setting the ColWidth property or from resizing the columns with the mouse.

ColWidthsChanged adjusts the scroll bar to accommodate the change. At design time, ColWidthsChanged forces all columns to have the same size when the columns are resized using the mouse.


TCustomDecisionGrid.Create

TCustomDecisionGrid	See also

Creates and initializes an instance of TCustomDecisionGrid.

constructor Create(AOwner: TComponent); override;

Description

Create initializes the following properties:

CaptionColor to clActiveCaption and CaptionFont.Color to clCaptionText.

DataColor to clInfoBk and DataSumColor to clNone.

LabelColor to clBtnFace and LabelSumColor to clTeal.

Color to clWindow and ParentColor to False.

Options to [cgGridLines, cgOutliner, cgPivotable].

GridLineColor to clBlack and GridLineWidth to 1.

ColWidth to 80 and RowHeight to 20.

ScrollBars to ssBoth.

DefaultDrawing to True.


TCustomDecisionGrid.Destroy

TCustomDecisionGrid	See also

Destroys an instance of TCustomDecisionGrid.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the decision grid is not nil, and only then calls Destroy. Destroy frees all helper objects used by TCustomDecisionGrid.


TCustomDecisionGrid.DrawCell

TCustomDecisionGrid	See also

Draws a cell in the grid.

procedure DrawCell(ACol, ARow: Longint; ARect: TRect; AState: TGridDrawState); override;

Description

DrawCell is called automatically when the cell specified by the ACol and ARow parameters needs to be painted. DrawCell generates an OnDecisionDrawCell event, and then draws the cell using the color, font, and value for the cell.


TCustomDecisionGrid.GetCells

TCustomDecisionGrid	See also

Returns the value of a cell in the grid, formatted as a string.

function GetCells(ACol, ARow: Integer): String;

Description

GetCells is the protected property access method for the Cells property. Override GetCells to change the implementation of the Cells property.


TCustomDecisionGrid.MouseDown

TCustomDecisionGrid	See also

Starts the drag of a dimension to a new location.

procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;

Description

MouseDown is called automatically when the user clicks the mouse in a cell of the grid. After calling the inherited method, MouseDown starts a pivot operation if the cell is a dimension label that can be dragged.

When overriding the MouseDown method, be sure to call the inherited method.


TCustomDecisionGrid.MouseMove

TCustomDecisionGrid	See also

Computes the drop site of a pivoting dimension.

procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;

Description

MouseMove is called automatically when the user moves the mouse. After calling the inherited method, MouseMove calculates the new pivot state if a dimension is being dragged to a new location.

When overriding the MouseMove method, be sure to call the inherited method.


TCustomDecisionGrid.MouseUp

TCustomDecisionGrid	See also

Rearranges the dimensions after a pivot and updates the decision source.

procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;

Description

MouseUp is called automatically when the user releases the mouse. After calling the inherited method, MouseUp checks whether a dimension was just dragged to a new location. If a dimension was just moved, MouseUp changes the Dimensions property appropriately and updates the decision source to reflect the new configuration.

When overriding the MouseUp method, be sure to call the inherited method.


TCustomDecisionGrid.Notification

TCustomDecisionGrid	See also

Links the buttons in TDecisionPivot to the decision source.

procedure Notification(AComponent: TComponent; Operation: TOperation); override;

Description

After calling the inherited method, Notification performs the necessary internal adjustments when new elements are added to the decision grid. When overriding the Notification method, be sure to call the inherited method.


TCustomDecisionGrid.Paint

TCustomDecisionGrid	See also

Renders the image of the decision grid.

procedure Paint; override;

Description

Paint is called when the grid receives a Windows paint message. Paint draws the grid, calling the DrawCell method when it is time to paint the contents of each cell. After all the cells are drawn, Paint draws the grid lines.

If DefaultDrawing is False, Paint does not draw the background of the cells or draw the focus rectangle around the selected cell when it has focus.


TCustomDecisionGrid.RowHeightsChanged

TCustomDecisionGrid	See also

Responds when the row heights change.

procedure RowHeightsChanged; override;

Description

RowHeightsChanged is called immediately after the row heights change. The change can result from setting the RowHeight property or from resizing the rows with the mouse.

RowHeightsChanged adjusts the scroll bar to accommodate the change. At design time, RowHeightsChanged forces all rows to have the same size when the rows are resized using the mouse.


TCustomDecisionGrid.SelectCell

TCustomDecisionGrid	See also

Indicates whether the user can navigate to a specified cell.

function SelectCell(Arow, AColumn:LongInt): Boolean; override;

Description

Decision grids call SelectCell internally before attempting to move selection to the cell identified by the ACol and ARow parameters. ACol and ARow are the column and row indexes for the cell, where the first column has index 0, and the top row has index 0.

As implemented in TCustomDecisionGrid, SelectCell always returns True, indicating that focus can move to the indicated cell.


TCustomDecisionGrid.TopLeftChanged

TCustomDecisionGrid	See also

Generates an OnTopLeftChanged event.

procedure TopLeftChanged; override;

Description

Decision grids call TopLeftChanged internally, whenever the data region of the grid scrolls.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGrid


 TClientDataSet

Hierarchy	Properties	Methods	Events	See also

TClientDataSet implements a database-independent dataset.

Unit

dbclient

Description

TClientDataSet encapsulates a database-independent, distributed dataset. A client dataset can be used as a

Fully-functional, standalone, flat-file dataset for single-tiered database applications. When used in this manner, an application uses the client dataset to read from and write to a user’s hard disk directly, without accessing a database engine.

Client dataset in the client application portion of a multi-tiered database application.

Note:	The two functions described above are not mutually exclusive. A multi-tiered application can be designed to support the option of working with data off-line, using the “briefcase” model. On site, the application uses TClientDataSet to communicate with the application server’s data provider. When a user works off site, the client dataset writes a snapshot of the data to the hard disk.  The application works with this snapshot off site, with the client dataset acting as a flat-file dataset in a single-tiered application.

The client dataset can communicate with a data provider directly by calling the provider component’s methods. When used in a client application as part of a multi-tiered application, the client dataset passes all calls to the provider through the remote data module’s IAppServer interface.

Note:	See the Midas demos for examples of how to use TClientDataSet.


TClientDataSet properties

TClientDataSet	Alphabetically	Legend

In TClientDataSet

Active

ActiveAggs

Aggregates

AggregatesActive

AppServer

CanModify

ChangeCount

CloneSource

CommandText

Data

DataSetField

DataSize

DataSource

Delta

FetchOnDemand

FileName

Filter

Filtered

FilterOptions

GroupingLevel

HasAppServer

IndexDefs

IndexFieldCount

IndexFieldNames

IndexFields

IndexName

KeyExclusive

KeyFieldCount

KeySize

LogChanges

MasterFields

MasterSource

PacketRecords

Params

ProviderName

ReadOnly

RecNo

RecordCount

RecordSize

RemoteServer

SavePoint

StatusFilter

StoreDefs

Derived from TDataSet

AggFields

AutoCalcFields

BlockReadSize

Bof

Bookmark

Constraints

DefaultFields

Designer

Eof

FieldCount

FieldDefList

FieldDefs

FieldList

Fields

FieldValues

Found

Modified

Name

ObjectView

SparseArrays

State

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TClientDataSet properties

TClientDataSet	By object	Legend

Active

ActiveAggs

AggFields

Aggregates

AggregatesActive

AppServer

AutoCalcFields

BlockReadSize

Bof

Bookmark

CanModify

ChangeCount

CloneSource

CommandText

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

Data

DataSetField

DataSize

DataSource

DefaultFields

Delta

Designer

DesignInfo

Eof

FetchOnDemand

FieldCount

FieldDefList

FieldDefs

FieldList

Fields

FieldValues

FileName

Filter

Filtered

FilterOptions

Found

GroupingLevel

HasAppServer

IndexDefs

IndexFieldCount

IndexFieldNames

IndexFields

IndexName

KeyExclusive

KeyFieldCount

KeySize

LogChanges

MasterFields

MasterSource

Modified

Name

ObjectView

Owner

PacketRecords

Params

ProviderName

ReadOnly

RecNo

RecordCount

RecordSize

RemoteServer

SavePoint

SparseArrays

State

StatusFilter

StoreDefs

Tag

VCLComObject


TClientDataSet.Active

TClientDataSet	See also

Specifies whether or not a client dataset contains data.

property Active: Boolean;

Description

Use Active to determine whether a client dataset makes its data available. When Active is False, the client dataset is closed; the client dataset can’t manipulate the data it represents. When Active is True, data can be read or edited using the client dataset.

Setting Active to True:

1	Fills the client dataset with data. Depending on the other properties of the client dataset, this data comes from:

The file specified by the FileName property.

The provider specified by the ProviderName property or SetProvider method.

The data that was active when the client dataset was deactivated (only if the application has run continuously since the dataset was deactivated).

2	Triggers a BeforeOpen event.

3	Sets the State property to dsBrowse.

4	Opens a cursor into the dataset.

5	Triggers an After Open event.

If the client dataset has never been active previously, setting Active to True defines the structure (metadata) of the client dataset. This structure is retrieved from a provider if the client dataset is linked to a provider component. Otherwise, this structure is read from a file on disk or built using the current value of the FieldDefs property or from the persistent field components listed by the Fields property.

If an error occurs during the dataset open, the dataset state is set to dsInactive, and the cursor is closed.

Note:	Calling the Open method sets Active to True; calling the Close method sets Active to False.


TClientDataSet.ActiveAggs

TClientDataSet	See also

Lists the maintained aggregates supported by the current index.

property ActiveAggs[Index: Integer] : TList;

Description

Read ActiveAggs to obtain a list of currently maintained aggregates for a specified grouping level. The Index parameter specifies whether the aggregates summarize data over the entire client dataset (Index = 0), over the current value of the first grouping level (Index = 1), over the current value of the second grouping level (Index = 2), and so on.

ActiveAggs is a List object (TList) whose items are a subset of the possible aggregates maintained by the Aggregates property. If there are no aggregates maintained for the specified grouping level, the value of ActiveAggs is either an empty list or nil.

Note:	Each grouping level is determined by the current index. Grouping level 1 is the set of records with the same value on the first field in the index. Grouping level 2 is the set of records with the same values on the first two fields in the index, and so on.


TClientDataSet.Aggregates

TClientDataSet	See also

Lists all aggregates that apply to the client dataset.

property Aggregates: TAggregates;

Description

Use Aggregates to define aggregates that summarize the data in the client dataset. Aggregates is a collection of TAggregate objects, each of which defines a formula for calculating an aggregate value from a group of records in the client dataset. The individual aggregates can summarize all the records in the client dataset or subgroups of records that have the same value on a set of fields. Aggregates that summarize a subgroup of records are associated with indexes, and can only be used when the associated index is current.

Do not use Aggregates to obtain summarized values maintained by the client dataset. Aggregates can contain TAggregate objects that are not currently active. Instead, use the ActiveAggs property, which represents only those TAggregate objects that are currently active.


TClientDataSet.AggregatesActive

TClientDataSet	See also

Specifies whether the client dataset calculates and maintains aggregate values.

property AggregatesActive: Boolean;

Description

Use AggregatesActive to indicate whether the client dataset should maintain aggregate values. When AggregatesActive is False (the default), the client dataset does not support maintained aggregates. This allows the client dataset to avoid the overhead of calculating values that the application is not using. When AggregatesActive is True, the client dataset calculates and maintains all aggregate values specified by the Aggregates property that are compatible with the current index.

When aggregates are maintained, the Value method of every active aggregate object returns a value that reflects the current data in the client dataset. When users edit the data in the dataset, these values are recalculated to reflect the user’s changes.

Note:	To selectively enable and disable aggregates instead, use the Active property of individual TAggregate objects. These objects are available through the Aggregates property.


TClientDataSet.AppServer

TClientDataSet	See also

Provides access to the interface the client dataset uses to communicate with the application server.

property AppServer: IAppServer;

Description

Use AppServer to communicate with the providers that supply data to and resolve updates for the client dataset. If the providers are on a remote application server, AppServer has the same value as the AppServer property of the connection component. If the client dataset uses a provider in the same process space, AppServer is the interface to an internally created object that dispatches IAppServer calls to the local provider.

Applications don’t need to work directly with the IAppServer interface. The properties and methods of the client dataset are automatically translated into IAppServer calls as needed.


TClientDataSet.CanModify

TClientDataSet	See also

Indicates whether an application can insert, edit, or delete data in a client dataset.

property CanModify: Boolean;

Description

Check the status of CanModify to determine if an application can modify a dataset in any way. If CanModify is True, the dataset can be modified. If CanModify is False, the dataset is read-only.

CanModify is set automatically when an application opens a dataset. If the ReadOnly property of a client dataset component is True, then CanModify is set to False.


TClientDataSet.ChangeCount

TClientDataSet	See also	Example

Indicates the number of changes made to the client dataset.

property ChangeCount: Integer;

Description

Check ChangeCount to determine how many modifications are pending for the dataset. ChangeCount increases when the data is edited. It is reset when updates are applied or merged and any differences are reconciled by the client dataset.


TClientDataSet.CloneSource

TClientDataSet	See also

Indicates the client dataset (if any) with which this client dataset shares data.

property CloneSource: TClientDataSet;

Description

Read CloneSource to access another client dataset that shares its data cursor with this one. CloneSource is set by the CloneCursor method when the datasets are linked.

If the client dataset has not called CloneCursor to share the data cursor of another client dataset, CloneSource is nil.


TClientDataSet.CommandText

TClientDataSet	See also	Example

Specifies an SQL command to execute on the server.

property CommandText: string;

Description

Use CommandText to override the SQL statement of a query on the application server or replace a table or stored procedure on the application server. When CommandText is a non-empty string, its value is sent to the application server when the client dataset opens and when you call the Execute method. The specified SQL command, table, or stored procedure overrides the current value of the dataset associated with the provider on the application server.

If the SQL statement takes parameters, be sure that they are in the correct order, as the application server performs parameter binding on CommandText statements by index only.

Note:	CommandText has no effect unless the provider’s Options property includes poAllowCommandText.


TClientDataSet.Data

TClientDataSet	See also	Example

Represents the data of the client dataset in a transportable format.

property Data: OleVariant;

Description

Data represents the client dataset’s local, in-memory copy of its data, encoded as a data packet. In multi-tiered applications, data packets are received from the application server. In one-tiered applications, packets are read from a data file.


TClientDataSet.DataSetField

TClientDataSet	See also

Indicates the TDataSetField component that represents this client dataset.

property DataSetField: TDataSetField;

Description

Use DataSetField when the client dataset is the nested detail set of another (master) client dataset. Read DataSetField to access the data set field component in the master dataset that comprises this client dataset. Set DataSetField to a field component in the master dataset to assign this client dataset as the value of that field component.

When setting DataSetField, the ProviderName, RemoteServer, and FileName properties of the client dataset are cleared. This is because the client dataset’s data is now maintained by the master table in which it is nested.

Note:	The master dataset that includes the TDataSetField component must be another client dataset. Otherwise, setting DataSetField raises an exception. Further, setting DataSetField to a TDataSetField that is contained in the same client dataset raises an exception (A dataset can’t be nested in itself).


TClientDataSet.DataSize

TClientDataSet	See also

Indicates the number of bytes required to represent the Data property.

property DataSize: Integer;

Description

Read DataSize to determine the number of bytes required for storing the client dataset’s data. For example, before streaming the Data property to a fixed size buffer using the SaveToStream method, read DataSize to determine the necessary size of that buffer.


TClientDataSet.DataSource

TClientDataSet	See also

Indicates the data source when the client dataset is the detail table in a master/detail relationship.

property DataSource: TDataSource;

Description

DataSource is a read-only version of the MasterSource property.

Note:	DataSource (or MasterSource) are used when creating traditional linked master/detail relationships. To use the client dataset as a nested detail set instead of a separate linked detail, use the DataSetField property instead.


TClientDataSet.Delta

TClientDataSet	See also

Represents a packet of change log data

property Delta: OleVariant;

Description

Use Delta to pass a packet of change log data from the client dataset to a provider. Delta contains only information about those records inserted, modified, or deleted through the client.

In multi-tiered applications, Delta is passed as an argument to the ApplyUpdates and Reconcile methods, which use the information in the change log to update the database. On return from successful application of updates, Delta is cleared. If update errors occur, the value of Delta after applying updates depends on the error tolerance allowed by the client dataset. This value is

All log change data when the maximum number of tolerated errors is encountered and all changes are rolled back.

Only those log changes that could not be applied when fewer errors occurred than the maximum specified as a tolerance level.

In one-tiered applications, Delta is cleared when the changes are merged into the Data property using the MergeChangeLog method.


TClientDataSet.FetchOnDemand

TClientDataSet	See also

Indicates whether to fetch data from the provider on an as needed basis.

property FetchOnDemand: Boolean;

Description

By default FetchOnDemand is True, meaning that the client dataset fetches additional packets of data as needed (for example, as a user scrolls through data, or conducts a search). If the server does not automatically include BLOB fields or nested detail sets in data packets, setting FetchOnDemand to True causes the client dataset to fetch these values when needed as well.

Set FetchOnDemand to False only if your client application contains code that explicitly fetches data packets as needed using the GetNextPacket method. Similarly, if FetchOnDemand is False, and the provider component does not include BLOB data by default (Options includes poFetchBlobsOnDemand), the client application must fetch BLOB fields explicitly using the FetchBlobs method. If the provider does not include nested detail sets (Options includes poFetchDetailsOnDemand) and FetchOnDemand is False, the client application must fetch nested details explicitly using the FetchDetails method.


TClientDataSet.FileName

TClientDataSet	See also

Specifies a flat file that stores the data for a client dataset.

property FileName: string;

Description

Set FileName if the client dataset always reads its data from and writes its data to a single file. When FileName represents a valid file name, the client dataset automatically writes its data to that file when it is closed. When FileName specifies the name of an existing file, the client dataset automatically reads its data from that file when it is opened.

Changes are not merged into the data when it is saved to the file. This allows an application that employs the “briefcase” model to set FileName without losing updates that are destined for an application server. However, single-tiered applications should explicitly merge changes before closing the dataset and saving the data to disk.

Note:	When client datasets write their data to a file, they overwrite the contents of the file. Any previous contents of the file are lost.

To read from or write to a different file, use the LoadFromFile and SaveToFile methods instead. These methods can also be used to load and save data at times other than when the Active property changes.


TClientDataSet::.Filter
TClientDataSet.Filter

TClientDataSet	See also

Specifies the text of the current filter for a dataset.

property Filter: string;

Description

Use Filter to specify a dataset filter. When filtering is applied to a dataset, only those records that meet a filter’s conditions are available to an application. Filter contains the string that describes the filter condition. Client datasets support a larger set of filter operations than other types of dataset. These are described in the following table:

Operator  or  function	Example	Available  in other  datasets	Comment
Comparisons
=	State = 'CA'	Always
<>	State <> 'CA'	Always
>=	DateEntered >= '1/1/1998'	Always
<=	Total <= 100,000	Always
>	Percentile > 50	Always
<	Field1 < Field2	Always
BLANK	State <> 'CA' or State = BLANK	Always	Blank records do not appear unless explicitly included in the filter.
IS NULL	Field1 IS NULL	No
IS NOT NULL	Field1 IS NOT NULL	No
Logical operators
and	State = 'CA' and Country = 'US'	Always
or	State = 'CA' or State = 'MA'	Always
not	not (State = 'CA')	Always
Arithmetic operators
+	Total + 5 > 100	Depends on driver	Applies to numbers, strings, or date (time) + number
-	Field1 - 7 <> 10	Depends on driver	Applies to numbers, dates, or date (time) - number
*	Discount * 100 > 20	Depends on driver	Applies to numbers only
/	Discount > Total / 5	Depends on driver	Applies to numbers only
String functions
Upper	Upper(Field1) = 'ALWAYS'	No
Lower	Lower(Field1 + Field2) = 'josp'	No
Substring	Substring(DateString,8) = '1998' Substring(DateString,1,3) = 'JAN'	No	Value goes from position of second argument to end or number of chars in third arg. First char has position 1.
Trim	Trim(Field1 + Field2) Trim(Field1, '-')	No	removes third argument from front and back. If no third argument, trims spaces.
TrimLeft	TrimLeft(StringField) TrimLeft(Field1, '$') <> ''	No	See Trim
TrimRight	TrimRight(StringField) TrimRight(Field1, '.') <> ''	No	See Trim
DateTime functions
Year	Year(DateField) = 2000	No
Month	Month(DateField) <> 12	No
Day	Day(DateField) = 1	No
Hour	Hour(DateField) < 16	No
Minute	Minute(DateField) = 0	No
Second	Second(DateField) = 30	No
GetDate	GetDate - DateField > 7	No	Represents current date and time
Date	DateField = Date(GetDate)	No	Returns the date portion of a datetime value
Time	TimeField > Time(GetDate)	No	Returns the time portion of a datetime value
Miscellaneous
Like	Memo LIKE '%filters%'	No	Works like SQL-92 without the ESC clause. When applied to BLOB fields, FilterOptions determines whether case is considered.
In	Day(DateField) in (1,7)	No	Works like SQL-92. Second argument is a list of values all with the same type.
*	State = 'M*'	Always	Wildcard for partial comparisons


TClientDataSet.Filtered

TClientDataSet	See also

Specifies whether or not filtering is active for the dataset.

property Filtered: Boolean;

Description

Check Filtered to determine whether or not dataset filtering is in effect. If Filtered is True, then filtering is active. Otherwise Filtered is False. To apply filter conditions specified in the Filter property or the OnFilterRecord event handler, set Filtered to True.

Note:	When filtering is enabled, user edits to a record may mean that the record no longer meets a filter’s test condition. The next time the record is retrieved from the dataset while the filter is in effect, the record may seem to disappear. If that happens, the next record that passes the filter condition becomes the current record.


TClientDataSet.FilterOptions

TClientDataSet	See also

Specifies whether filter strings are applied case-sensitively, and whether partial comparisons are permitted when applying the filter string.

property FilterOptions: TFilterOptions;

Description

Set FilterOptions to indicate how the Filter property is applied. FilterOptions determines whether the Filter property is applied case-sensitively when filtering on string or character fields, and whether partial comparisons for matching filter conditions is allowed.

By default, FilterOptions is set to an empty set. For filters based on string fields, set FilterOptions to foCaseInsensitive to catch all variations on a string regardless of capitalization.

To disable partial string matches in the filter expression, include foNoPartialCompare in the filter options.

Note:	To filter strings bases on partial comparisons, use an asterisk as a wildcard. For example:

State = 'M*'


TClientDataSet.GroupingLevel

TClientDataSet	See also

Indicates the depth of grouping support provided by the current index.

property GroupingLevel: Integer;

Description

Read GroupingLevel to determine the maximum level group for which grouping support is available. Client datasets provide grouping support in two ways:

The GetGroupState method indicates where the current record falls within a group.

The ActiveAggs property provides summary information over all the records in a group.

A group is defined as the set of records that have the same value on each of a set of fields. A level 0 group is the set of all records in the client dataset. A level 1 group is the set of records with the same value on the first field of the index. A level 2 group is the set of records with the same values on each of the first two fields of the index. A level n group is the set of records with the same values on each of the first n fields of the index.

GroupingLevel is the default grouping level of the current index or the maximum grouping level of a maintained aggregate on the current index, whichever is greater. GroupingLevel can never be greater than IndexFieldCount.


TClientDataSet.HasAppServer

TClientDataSet	See also

Indicates whether the client dataset is connected to a remote application server.

property HasAppServer: Boolean;

Description

Read HasAppServer to determine whether the client dataset gets its data from an IAppServer interface. When HasAppServer is True, the client can interact with providers on a remote application server or local providers in the same process space through the IAppServer interface.

Use HasAppServer to check whether the client dataset is connected to an application server rather than reading the AppServer property. Reading AppServer causes the client dataset to establish a connection and obtain an IAppServer interface if it does not already have one.


TClientDataSet.IndexDefs

TClientDataSet	See also 	Example

Contains information about the indexes for a client dataset.

property IndexDefs: TIndexDefs;

Description

Examine IndexDefs for index information. IndexDefs is an array of index items, each of which describes an available index for the dataset. Set the value of IndexDefs before calling CreateDataSet to create a set of indexes with the client dataset.

Note:	The index items in IndexDefs may not always reflect the current indexes available for a dataset. Before examining IndexDefs, call the IndexDefs.Update method to refresh the item list.


TClientDataSet.IndexFieldCount

TClientDataSet	See also 	Example

Indicates number of fields that make up the current index for the dataset.

property IndexFieldCount: Integer;

Description

Check IndexFieldCount to determine how many fields are used by the current index for the dataset.


TClientDataSet.IndexFieldNames

TClientDataSet	See also

Lists the fields to use as an index for a dataset.

property IndexFieldNames: string;

Description

Use IndexFieldNames as an alternative method of specifying the index to use for a dataset. In IndexFieldNames specify the name of each field to use as an index for a dataset. Ordering of field names is significant. Separate names with semicolon.

Tip:	Use IndexFieldNames to create sort orders on the fly at runtime. Indexes added using IndexFieldNames do not support grouping or maintained aggregates.

Note:	The IndexFieldNames and IndexName properties are mutually exclusive. Setting one clears the other.


TClientDataSet.IndexFields

TClientDataSet	See also 	Example

Specifies the array of fields associated with the current index.

property IndexFields[Index: Integer]: TField;

Description

IndexFields provides a zero-based array of field objects, each of which corresponds to a field in the current index. Index is an ordinal value indicating the position of a field in the index. The first field in the index is IndexFields[0], the second is IndexFields[1], and so on.

Note:	Do not set IndexField directly. Instead use the IndexFieldNames property to order datasets on the fly at runtime.


TClientDataSet.IndexName

TClientDataSet	See also 	Example

Identifies an index for the client dataset.

property IndexName: string;

Description

Use IndexName to specify an alternative index for a dataset. If IndexName is empty, a dataset’s sort order is based on the IndexFieldNames property or on its default ordering in the data packet. Default ordering is determined by the predefined index, DEFAULT_ORDER.

If IndexName contains a valid index name, then that index is used to determine sort order of records.

Note:	IndexFieldNames and IndexName are mutually exclusive. Setting one clears the other.


TClientDataSet.KeyExclusive

TClientDataSet	See also

Specifies the upper and lower boundaries for a range.

property KeyExclusive: Boolean;

Description

Use KeyExclusive to specify whether or not a range includes or excludes the records that match the specified starting and ending values for a range. By default, KeyExclusive is False, meaning that matching values are included.

To restrict a range to those records that are greater than the specified starting value and less than the specified ending value, set KeyExclusive to True.


TClientDataSet.KeyFieldCount

TClientDataSet	See also

Specifies the number of fields to use when conducting a partial key search on a multi-field key.

property KeyFieldCount: Integer;

Description

Use KeyFieldCount to limit a search based on a multi-field key to a consecutive sub-set of those fields. For example, if the primary key for a dataset consists of three-fields, a partial-key search can be conducted using only the first field in the key by setting KeyFieldCount to 1. Setting KeyFieldCount to 0 allows the client dataset to search on all key fields.

Note:	Searches are only conducted based on consecutive key fields beginning with the first field in the key. For example if a key consists of three fields, an application can set KeyFieldCount to 1 to search on the first field, 2 to search on the first and second fields, or 3 to search on all fields. By default KeyFieldCount is initially set to include all fields in a search.


TClientDataSet.KeySize

TClientDataSet	See also

Indicates the size of the current key used for the dataset.

property KeySize: Word;

Description

Examine KeySize to determine the size of the current key used for the dataset. KeySize corresponds to the size of the key fields in the primary index for the dataset.


TClientDataSet.LogChanges

TClientDataSet	See also

Indicates whether to log data changes.

property LogChanges: Boolean;

Description

Use LogChanges to control whether or not changes made to the data in a client dataset are recorded. When LogChanges is True (the default), all changes are recorded in the Delta property. They can later be applied to an application server, backed out, or merged into the Data property. When LogChanges is False, data changes are made directly to the Data property and cannot be applied to an application server.

Tip:	When using a client dataset in a one-tiered application where data changes made by the application will never be applied to another dataset, set LogChanges to False to conserve system resources.


TClientDataSet.MasterFields

TClientDataSet	See also

Names one or more fields in a master table to link with corresponding fields in this dataset in order to establish a master-detail relationship.

property MasterFields: string;

Description

Use MasterFields after setting the MasterSource property to specify the names of one or more fields to use in establishing a detail-master relationship between this dataset and the one specified in MasterSource.

MasterFields is a string containing one or more field names in the master table. Separate field names with semicolons.

Each time the current record in the master table changes, the new values in those fields are used to select corresponding records in this dataset for display.

Note:	At design time, use the Field Link designer to establish the master-detail relationship between two datasets.


TClientDataSet.MasterSource

TClientDataSet	See also

Specifies a data source component for the master dataset when establishing a detail-master relationship between this dataset and another one.

property MasterSource: TDataSource;

Description

Use MasterSource to specify the name of the data source component whose DataSet property identifies a dataset to use as a master table in establishing a detail-master relationship between this dataset and another one.

Note:	At design time choose an available data source from the MasterSource property’s drop-down list in the Object Inspector.

After setting the MasterSource property, specify which fields to use in the master table by setting the MasterFields property. At runtime each time the current record in the master table changes, the new values in those fields are used to select corresponding records in this dataset for display.

Note:	At design time, use the Field Link designer to establish the master-detail relationship between two datasets.

Tip:	MasterSource establishes a master/detail relationship using the traditional linked cursor approach. Alternately, client datasets can participate in master/detail relationships using nested datasets, where the detail dataset is stored with the master table’s data. To assign a client dataset’s data as the value of a nested detail, use the DataSetField property instead.


TClientDataSet.PacketRecords

TClientDataSet	See also

Indicates the number or type of records in a single data packet.

property PacketRecords: Integer;

Description

Use PacketRecords to specify how many records should be contained in a single packet fetched from the application server, or to indicate that the packet returned should contain only metadata from the server.

When a client dataset is instantiated, PacketRecords is automatically set to -1, meaning that a single packet should contain all records in the dataset.

If PacketRecords is greater than zero, then it specifies the exact number of records to return in a packet.

To retrieve the metadata for a dataset, set PacketRecords to 0. When PacketRecords is zero, the application returns all information from the remote database server that define the database’s structure, such as table, column, constraint, and domain definitions.

Warning:	When PacketRecords is greater than 0, the client dataset must fetch its data incrementally. If the application server is stateless, the client dataset must inform the provider on the application server where to start fetching data. This communication can occur using a BeforeGetRecords event handler.


TClientDataSet.Params

TClientDataSet	See also

Contains parameter values that are sent to the application server.

property Params: TParams;

Description

Use Params to specify parameter values that should be passed to a source dataset on the application server. These parameter values are used to supply parameter values to a query or stored procedure on the application server or to limit the records that are sent in data packets. After specifying the parameters (at design time or runtime), they are sent to the application server automatically when the client dataset fetches data or executes a query or stored procedure remotely.

To send parameter values to a query or stored procedure, for every parameter on the query or stored procedure for which the client dataset should send a value, add a parameter object (TParam) to Params. Assign each parameter object the same Name, DataType, and ParamType as the corresponding parameter on the query or stored procedure. These values are automatically encoded and sent to the application server when the client dataset fetches data.

To send parameter values to a table, add a parameter object for each field in the table that is used to limit the values sent in data packets. Assign each parameter object the same Name and DataType as the corresponding field component on the table. These parameter values are automatically sent when the client dataset fetches data, and the records returned in data packets from the application server only contain records that match the assigned value on the corresponding fields. You can achieve the same affect by applying a filter to the field, but using Params is more efficient because the data need not be sent from the application server.

Note:	To initialize Params so that it reflects the parameters of a query or stored procedure on an application server, call the FetchParams method.

Warning:	The parameters are only applied on the application server when a query or stored procedure is run the first time the client dataset fetches records. To change parameter values and force a query or stored procedure to be re-run with new values, use the Execute method.


TClientDataSet.ProviderName

TClientDataSet	See also

Specifies the name of a registered provider from the application server.

property ProviderName: string;

Description

Use ProviderName to specify the provider object with which to communicate on the server. This property is passed as a parameter to IAppServer interface calls when the client fetches data from or applies updates to the application server. If the application server contains multiple provider objects, a client application can set ProviderName to any of them once the client’s connection component establishes an initial connection to the application server.

If the connection component is a Web connection or socket connection, or if the application server is registered on the client system (using TRegsvr.exe), ProviderName can be set from a drop-down in the Object Inspector once the RemoteServer property is set.

Note:	ProviderName can also be used to link the client dataset to a provider in the same process space, as long as the provider component has the same Owner as the client dataset. If the local provider component has a different Owner, use the SetProvider method instead.


TClientDataSet.ReadOnly

TClientDataSet	See also

Specifies whether or not a client dataset is read-only for this application.

property ReadOnly: Boolean;

Description

Use the ReadOnly property to prevent users from updating, inserting, or deleting data in the dataset. By default, ReadOnly is False, meaning users can potentially alter a dataset’s data.

To guarantee that users cannot modify or add data to a dataset, set ReadOnly to True.

When ReadOnly is True, the dataset’s CanModify property is False.

Note:	Even if ReadOnly is False, users may not be able to modify or add data to a client dataset if it represents data from a remote application server.


TClientDataSet.RecNo

TClientDataSet	See also

Indicates the current record in the dataset.

property RecNo: Integer;

Description

Examine RecNo to determine the record number of the current record in the dataset. Set RecNo to change the current record to a record specified by its sequential position.


TClientDataSet.RecordCount

TClientDataSet	See also

Indicates the total number of records in the dataset.

property RecordCount: Integer;

Description

Examine RecordCount to determine the total number of records currently in the dataset. If the PacketRecords property is greater than 0, the value for RecordCount may change as a user scrolls through the data and additional data packets are fetched from the provider.

Applications can use this property with RecNo to iterate through all the records in a dataset, though typically record iteration is handled with calls to First, Last, MoveBy, and Prior.


TClientDataSet.RecordSize

TClientDataSet	See also

Indicates the size of a record in the dataset.

property RecordSize: Word;

Description

Examine RecordSize to determine the physical size, in bytes, of the buffer allocated to hold a record in the dataset. When a dataset is opened, the Open procedure requests record-buffer size information and stores the returned information in RecordSize. Client datasets use this information internally. Applications seldom, if ever, require this information.


TClientDataSet.RemoteServer

TClientDataSet	See also

Specifies the connection component that this client dataset uses to connect to an application server.

property RemoteServer: TCustomRemoteServer;

Description

Use RemoteServer to specify the connection component that establishes a connection to the remote application server. The connection component obtains an IAppServer interface for data exchange in a multi-tiered application and maintains the interface of the remote data module on the application server.

If a client application uses more than connection component, the application can change which connection a client dataset uses by changing the value for this property.


TClientDataSet.SavePoint

TClientDataSet	See also

Represents the current state of edits when logging changes.

property SavePoint: Integer;

Description

Use SavePoint to save and later revert to an editing state. SavePoint is an integer that represents the current state of the change log. To use SavePoint to roll back the changes in the change log to an earlier state, set SavePoint to the value it had before the changes that should be rolled back.

Thus, when the client dataset is in a state you may want to return to, assign SavePoint to a variable:

BeforeChanges := ClientDataSet1.SavePoint;

Later, to roll back all edits that were made since that point, assign the variable to SavePoint:

ClientDataSet1.SavePoint := BeforeChanges;

Warning:	Client datasets can’t return to a SavePoint once the change log has been backed out to a prior state. This includes undoing changes by setting SavePoint to a previously saved value, backing out too many changes using the RevertRecord method, or clearing the change log using CancelUpdates. Trying to set SavePoint to a state that is no longer available in the change log raises an exception.


TClientDataSet.StatusFilter

TClientDataSet	See also

Filters the client dataset so that it exposes only those records with a specific update status.

TUpdateStatusSet = set of TUpdateStatus;

property StatusFilter: TUpdateStatusSet;

Description

Use StatusFilter to limit the client dataset to records that represent a specific update status. This can be useful when processing updates in a provider’s event handlers.

StatusFilter is a set of TUpdateStatus values, so that it can indicate more than one type of update. If StatusFilter is an empty set (the default), the client dataset appears as if all updates in the change log have been incorporated.

Note:	 Including usUnmodified in StatusFilter has no effect.


TClientDataSet.StoreDefs

TClientDataSet	See also

Indicates whether field and index definitions are saved with the client dataset.

property StoreDefs: Boolean;

Description

If StoreDefs is True, the table's index and field definitions are stored with the client dataset when the form or data module that contains it is saved. Setting StoreDefs to True makes the CreateDataSet method into a one-step procedure that creates fields and indexes at runtime.


TClientDataSet events

TClientDataSet	Alphabetically	Legend

In TClientDataSet

AfterApplyUpdates

AfterExecute

AfterGetParams

AfterGetRecords

AfterRowRequest

BeforeApplyUpdates

BeforeExecute

BeforeGetParams

BeforeGetRecords

BeforeRowRequest

OnReconcileError

Derived from TDataSet

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TClientDataSet events

TClientDataSet	By object	Legend

AfterApplyUpdates

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterExecute

AfterGetParams

AfterGetRecords

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterRowRequest

AfterScroll

BeforeApplyUpdates

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeExecute

BeforeGetParams

BeforeGetRecords

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeRowRequest

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnReconcileError


KTClientDataSet.AfterApplyUpdates
TClientDataSet.AfterApplyUpdates

TClientDataSet	See also

Occurs after the client dataset applies updates to the remote server but before it attempts to reconcile update errors.

property AfterApplyUpdates: TRemoteEvent;

Description

Write an AfterApplyUpdates event handler to respond to custom information returned to the client dataset from a provider’s AfterApplyUpdates event handler. AfterApplyUpdates is part of the mechanism by which a client dataset and a remote provider communicate information about updates. When working with a provider on a stateless application server, this mechanism allows the client dataset and the provider to communicate persistent state information.

When the client application calls the client dataset’s ApplyUpdates method, the following events occur:

1.	The client dataset receives a BeforeApplyUpdates event, where it can encode custom information into an OleVariant that is passed to the application server as the OwnerData parameter.

2.	The provider on the application server receives a BeforeApplyUpdates event, where it can respond to or change that information before the provider applies the updates.

3.	The provider applies the updates, and receives an OnUpdateError event for any problem records.

4.	The provider receives an AfterApplyUpdates event, where it can encode custom information into its OwnerData parameter or respond to information from the BeforeApplyUpdates event handler.

5.	The client dataset receives an AfterApplyUpdates event, where it can respond to the custom information returned by the provider in its AfterApplyUpdates event handler.

6.	The client dataset generates an OnReconcileError for every record that could not be applied on the application server.


TClientDataSet.AfterExecute

TClientDataSet	See also

Occurs after the client dataset receives the results from an execute command.

property AfterExecute: TRemoteEvent;

Description

Write an AfterExecute event handler to respond to custom information returned to the client dataset from a provider’s AfterExecute event handler. AfterExecute is part of the mechanism by which a client dataset and a remote provider communicate information when executing an SQL command from the client. When working with a provider on a stateless application server, this mechanism allows the client dataset and the provider to communicate persistent state information.

When the client application calls the client dataset’s Execute method, the following events occur:

1.	The client dataset receives a BeforeExecute event, where it can encode custom information into an OleVariant that is passed to the application server as the OwnerData parameter.

2.	The provider on the application server receives a BeforeExecute event, where it can respond to or change that information before the provider executes the query or stored procedure.

3.	The provider executes the appropriate command (either the command supplied by the CommandText property, or the command associated with a dataset such as a query or stored procedure).

4.	The provider receives an AfterExecute event, where it can encode custom information into its OwnerData parameter or respond to information from the BeforeExecute event handler.

5.	The client dataset unpacks any output parameters from the application server into the Params property and then receives an AfterExecute event, where it can respond to the custom information returned by the provider in its AfterExecute event handler.


TClientDataSet.AfterGetParams

TClientDataSet	See also

Occurs after the client dataset receives parameter values from the application server.

property AfterGetParams: TRemoteEvent;

Description

Write an AfterGetParams event handler to respond to custom information returned to the client dataset from a provider’s AfterGetParams event handler. AfterGetParams is part of the mechanism by which a client dataset and a remote provider communicate information when the client application calls FetchParams. When working with a provider on a stateless application server, this mechanism allows the client dataset and the provider to communicate persistent state information.

When the client application calls the client dataset’s FetchParams method, the following events occur:

1.	The client dataset receives a BeforeGetParams event, where it can encode custom information into an OleVariant that is passed to the application server as the OwnerData parameter.

2.	The provider on the application server receives a BeforeGetParams event, where it can respond to or change that information before the provider retrieves parameter values.

3.	The provider encodes all of its dataset’s current parameter values into an OleVariant.

4.	The provider receives an AfterGetParams event, where it can encode custom information into its OwnerData parameter or respond to information from the BeforeGetParams event handler.

5.	The client dataset unpacks the parameters from the application server into the Params property and then receives an AfterGetParams event, where it can respond to the custom information returned by the provider in its AfterGetParams event handler.


KTClientDataSet.AfterGetRecords
TClientDataSet.AfterGetRecords

TClientDataSet	See also

Occurs after the client dataset fetches a data packet from the application server.

property AfterGetRecords: TRemoteEvent;

Description

Write an AfterGetRecords event handler to respond to custom information returned to the client dataset from a provider’s AfterGetRecords event handler. AfterGetRecords is part of the mechanism by which a client dataset and a remote provider communicate information about data fetching. When working with a provider on a stateless application server, this mechanism allows the client dataset and the provider to communicate persistent state information.

When the client dataset fetches data from the application server, the following events occur:

1.	The client dataset receives a BeforeGetRecords event, where it can encode custom information into an OleVariant that is passed to the application server as the OwnerData parameter.

2.	The provider on the application server receives a BeforeGetRecords event, where it can respond to or change that information before the provider creates a data packet.

3.	The provider generates an OnGetData event where it can edit the data before creating a data packet, and then generates the data packet.

4.	The provider receives an AfterGetRecords event, where it can encode custom information into its OwnerData parameter or respond to information from the BeforeGetRecords event handler.

5.	The client dataset receives an AfterGetRecords event, where it can respond to the custom information returned by the provider in its AfterGetRecords event handler.


KTClientDataSet.AfterRowRequest
TClientDataSet.AfterRowRequest

TClientDataSet	See also

Occurs after the client dataset fetches new information about the current record.

property AfterRowRequest: TRemoteEvent;

Description

Write an AfterRowRequest event handler to respond to custom information returned to the client dataset from a provider’s AfterRowRequest event handler. AfterRowRequest is part of the mechanism by which a client dataset and a remote provider communicate information about data fetching. When working with a provider on a stateless application server, this mechanism allows the client dataset and the provider to communicate persistent state information.

When the client dataset fetches detail information about the current record or refreshes the current record, the following events occur:

1.	The client dataset receives a BeforeRowRequest event, where it can encode custom information into an OleVariant that is passed to the application server as the OwnerData parameter.

2.	The provider on the application server receives a BeforeRowRequest event, where it can respond to or change that information before the provider looks up the requested information.

3.	The provider creates a delta packet that contains the requested information.

4.	The provider receives an AfterRowRequest event, where it can encode custom information into its OwnerData parameter or respond to information from the BeforeRowRequest event handler.

5.	The client dataset receives an AfterRowRequest event, where it can respond to the custom information returned by the provider in its AfterRowRequest event handler.


KTClientDataSet.BeforeApplyUpdates
TClientDataSet.BeforeApplyUpdates

TClientDataSet	See also

Occurs before the client dataset applies updates to the remote server.

property BeforeApplyUpdates: TRemoteEvent;

Description

Write a BeforeApplyUpdates event handler to send to custom information to the client dataset’s provider. BeforeApplyUpdates is part of the mechanism by which a client dataset and a remote provider communicate information about updates. When working with a provider on a stateless application server, this mechanism allows the client dataset and the provider to communicate persistent state information.

When the client application calls the client dataset’s ApplyUpdates method, the following events occur:

1.	The client dataset receives a BeforeApplyUpdates event, where it can encode custom information into an OleVariant that is passed to the application server as the OwnerData parameter.

2.	The provider on the application server receives a BeforeApplyUpdates event, where it can respond to or change that information before the provider applies the updates.

3.	The provider applies the updates, and receives an OnUpdateError event for any problem records.

4.	The provider receives an AfterApplyUpdates event, where it can encode custom information into its OwnerData parameter or respond to information from the BeforeApplyUpdates event handler.

5.	The client dataset receives an AfterApplyUpdates event, where it can respond to the custom information returned by the provider in its AfterApplyUpdates event handler.


TClientDataSet.BeforeExecute

TClientDataSet	See also

Occurs before the client dataset executes a query or stored procedure on the application server.

property BeforeExecute: TRemoteEvent;

Description

Write a BeforeExecute event handler to send custom information to the client dataset’s provider. BeforeExecute is part of the mechanism by which a client dataset and a remote provider communicate information when explicitly executing an SQL command from the client. When working with a provider on a stateless application server, this mechanism allows the client dataset and the provider to communicate persistent state information.

When the client application calls the client dataset’s Execute method, the following events occur:

1.	The client dataset receives a BeforeExecute event, where it can encode custom information into an OleVariant that is passed to the application server as the OwnerData parameter.

2.	The provider on the application server receives a BeforeExecute event, where it can respond to or change that information before the provider executes the query or stored procedure.

3.	The provider executes the appropriate command (either the command supplied by the CommandText property, or the command associated with a dataset such as a query or stored procedure).

4.	The provider receives an AfterExecute event, where it can encode custom information into its OwnerData parameter or respond to information from the BeforeExecute event handler.

5.	The client dataset unpacks any output parameters from the application server into the Params property and then receives an AfterExecute event, where it can respond to the custom information returned by the provider in its AfterExecute event handler.


TClientDataSet.BeforeGetParams

TClientDataSet	See also

Occurs before the client dataset fetches parameter values from the application server.

property BeforeGetParams: TRemoteEvent;

Description

Write a BeforeGetParams event handler to send custom information to the client dataset’s provider. BeforeGetparams is part of the mechanism by which a client dataset and a remote provider communicate information when passing parameter values from server to client. When working with a provider on a stateless application server, this mechanism allows the client dataset and the provider to communicate persistent state information.

When the client application calls the client dataset’s FetchParams method, the following events occur:

1.	The client dataset receives a BeforeGetParams event, where it can encode custom information into an OleVariant that is passed to the application server as the OwnerData parameter.

2.	The provider on the application server receives a BeforeGetParams event, where it can respond to or change that information before the provider retrieves parameter values.

3.	The provider encodes all of its dataset’s current parameter values into an OleVariant.

4.	The provider receives an AfterGetParams event, where it can encode custom information into its OwnerData parameter or respond to information from the BeforeGetParams event handler.

5.	The client dataset unpacks the parameters from the application server into the Params property and then receives an AfterGetParams event, where it can respond to the custom information returned by the provider in its AfterGetParams event handler.


KTClientDataSet.BeforeGetRecords
TClientDataSet.BeforeGetRecords

TClientDataSet	See also

Occurs before the client dataset fetches a data packet from the application server.

property BeforeGetRecords: TRemoteEvent;

Description

Write a BeforeGetRecords event handler to send custom information to the client dataset’s provider. BeforeGetRecords is part of the mechanism by which a client dataset and a remote provider communicate information about data fetching. When working with a provider on a stateless application server, this mechanism allows the client dataset and the provider to communicate persistent state information.

When the client dataset fetches data from the application server, the following events occur:

1.	The client dataset receives a BeforeGetRecords event, where it can encode custom information into an OleVariant that is passed to the application server as the OwnerData parameter.

2.	The provider on the application server receives a BeforeGetRecords event, where it can respond to or change that information before the provider creates a data packet.

3.	The provider generates the data packet.

4.	The provider receives an AfterGetRecords event, where it can encode custom information into its OwnerData parameter or respond to information from the BeforeGetRecords event handler.

5.	The client dataset receives an AfterGetRecords event, where it can respond to the custom information returned by the provider in its AfterGetRecords event handler.


KTClientDataSet.BeforeRowRequest
TClientDataSet.BeforeRowRequest

TClientDataSet	See also

Occurs before the client dataset fetches new information about the current record.

property BeforeRowRequest: TRemoteEvent;

Description

Write a BeforeRowRequest event handler to send custom information to the client dataset’s provider. BeforeRowRequest is part of the mechanism by which a client dataset and a remote provider communicate information about data fetching. When working with a provider on a stateless application server, this mechanism allows the client dataset and the provider to communicate persistent state information.

When the client dataset fetches detail information about the current record or refreshes the current record, the following events occur:

1.	The client dataset receives a BeforeRowRequest event, where it can encode custom information into an OleVariant that is passed to the application server as the OwnerData parameter.

2.	The provider on the application server receives a BeforeRowRequest event, where it can respond to or change that information before the provider looks up the requested information.

3.	The provider creates a delta packet that contains the requested information.

4.	The provider receives an AfterRowRequest event, where it can encode custom information into its OwnerData parameter or respond to information from the BeforeRowRequest event handler.

5.	The client dataset receives an AfterRowRequest event, where it can respond to the custom information returned by the provider in its AfterRowRequest event handler.


TClientDataSet.OnReconcileError

TClientDataSet	See also 	Example

Occurs when a client dataset needs to reconcile an update to a record that could not be resolved by the provider.

type

  TReconcileErrorEvent = procedure(DataSet: TClientDataSet; E: EReconcileError; UpdateKind: TUpdateKind; var Action: TReconcileAction) of object;

property OnReconcileError: TReconcileErrorEvent;

Description

Write an OnReconcileError event handler to respond to error conditions that arise when the Reconcile method cycles through records returned by the application server after it applies updates to a database. Records returned by the server are ones that the server could not apply to the database. The OnReconcileError event handler is called once for each record returned by the server.

Warning:	The application server can’t detect when an update conflicts with another user’s changes to a memo field. This situation will not generate an OnReconcileError event.

DataSet is a client dataset that contains the record that generated an update error. If the error occurred while updating a nested detail dataset in a master/detail relationship, DataSet represents the detail dataset although the event occurs on the master dataset. Do not use any methods that change the current record of DataSet (such as Next or Prior). You can, however, use the NewValue, OldValue, and CurValue properties of DataSet’s fields to obtain more information about the update error.

E is a pointer to an EReconcileError object from which an application can extract an error message and the actual cause of the error condition. An OnReconcileError handler can use this information to determine how to respond to the error condition.

UpdateKind describes the type of update (insertion, deletion, or modification) that generated the error.

Action indicates the action to take when the OnReconcileError handler exits. If OnReconcileError can handle or correct the error, set Action to raCorrect before exiting the error handler.

Note:	The code in an OnReconcileError handler can examine and apply the OldValue, NewValue, and CurValue properties for each field in the current record, but should not call any methods that make a different record current.


TClientDataSet methods

TClientDataSet	Alphabetically

In TClientDataSet

AddIndex

AppendData

ApplyRange

ApplyUpdates

BookmarkValid

Cancel

CancelRange

CancelUpdates

CloneCursor

CompareBookmarks

ConstraintsDisabled

Create

CreateBlobStream

CreateDataSet

DataRequest

DeleteIndex

Destroy

DisableConstraints

EditKey

EditRangeEnd

EditRangeStart

EmptyDataSet

EnableConstraints

Execute

FetchBlobs

FetchDetails

FetchParams

FindKey

FindNearest

GetCurrentRecord

GetFieldData

GetGroupState

GetIndexInfo

GetIndexNames

GetNextPacket

GetOptionalParam

GotoCurrent

GotoKey

GotoNearest

LoadFromFile

LoadFromStream

Locate

Lookup

MergeChangeLog

Post

Reconcile

RefreshRecord

RevertRecord

SaveToFile

SaveToStream

SetAltRecBuffers

SetKey

SetOptionalParam

SetProvider

SetRange

SetRangeEnd

SetRangeStart

UndoLastChange

UpdateStatus

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

CheckBrowseMode

ClearFields

Close

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBlobFieldData

GetBookmark

GetDetailDataSets

GetDetailLinkFields

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsEmpty

IsLinkedTo

IsSequenced

Last

MoveBy

Next

Open

Prior

Refresh

Resync

SetFields

Translate

UpdateCursorPos

UpdateRecord

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TClientDataSet methods

TClientDataSet	By object

ActiveBuffer

AddIndex

AfterConstruction

Append

AppendData

AppendRecord

ApplyRange

ApplyUpdates

Assign

BeforeDestruction

BookmarkValid

Cancel

CancelRange

CancelUpdates

CheckBrowseMode

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClearFields

CloneCursor

Close

CompareBookmarks

ConstraintsDisabled

ControlsDisabled

Create

CreateBlobStream

CreateDataSet

CursorPosChanged

DataRequest

DefaultHandler

Delete

DeleteIndex

Destroy

DestroyComponents

Destroying

DisableConstraints

DisableControls

Dispatch

Edit

EditKey

EditRangeEnd

EditRangeStart

EmptyDataSet

EnableConstraints

EnableControls

Execute

ExecuteAction

FetchBlobs

FetchDetails

FetchParams

FieldAddress

FieldByName

FindComponent

FindField

FindFirst

FindKey

FindLast

FindNearest

FindNext

FindPrior

First

Free

FreeBookmark

FreeInstance

FreeNotification

FreeOnRelease

GetBlobFieldData

GetBookmark

GetCurrentRecord

GetDetailDataSets

GetDetailLinkFields

GetFieldData

GetFieldList

GetFieldNames

GetGroupState

GetIndexInfo

GetIndexNames

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetNextPacket

GetOptionalParam

GetParentComponent

GotoBookmark

GotoCurrent

GotoKey

GotoNearest

HasParent

InheritsFrom

InitInstance

Insert

InsertComponent

InsertRecord

InstanceSize

IsEmpty

IsLinkedTo

IsSequenced

Last

LoadFromFile

LoadFromStream

Locate

Lookup

MergeChangeLog

MethodAddress

MethodName

MoveBy

NewInstance

Next

Open

Post

Prior

Reconcile

Refresh

RefreshRecord

RemoveComponent

Resync

RevertRecord

SafeCallException

SaveToFile

SaveToStream

SetAltRecBuffers

SetFields

SetKey

SetOptionalParam

SetProvider

SetRange

SetRangeEnd

SetRangeStart

Translate

UndoLastChange

UpdateAction

UpdateCursorPos

UpdateRecord

UpdateStatus


TClientDataSet.AddIndex

TClientDataSet	See also	Example

Creates a new index for the client dataset.

procedure AddIndex(const Name, Fields: string; Options: TIndexOptions; const DescFields: string = ''; const CaseInsFields: string = ''; const GroupingLevel: Integer = 0 );

Description

Call AddIndex to create a new index for the client dataset.

Name is the name of the new index.

Fields is a semicolon-delimited list of the fields to include in the index.Options is a (potentially empty) set that can include up to two TIndexOptions values. The valid members for that set include ixDescending (specifying that the index sorts in descending alphanumeric order) and ixCaseInsensitve (specifying that the index should ignore case when sorting).

Warning:	Attempting to create an index that includes any other TIndexOptions values raises an exception.

DescFields is a semicolon-delimited list of field names. Use DescFields instead of an Options value that includes ixDescending to create an index that is in ascending order on some fields and descending order on others. All fields named in DescFields are sorted in descending order.

CaseInsFields is a semicolon-delimited list of field names. Use CaseInsFields instead of an Options value that includes ixCaseInsensitve to create an index that is case-insensitive on some fields and case-sensitive on others. All fields named in CaseInsFields are sorted without regard to case.

GroupingLevel is the default grouping level supported by the index. When the client dataset uses this index, grouping information is automatically available for subgroups defined by up to GroupingLevel fields in the index. (If the client dataset uses maintained aggregates, information about more deeply nested groups can become available when the aggregates are defined on a grouping level greater than the default value of the index). GroupingLevel can be any value from 0 to the number of fields in the index.

Note:	Indexes added by AddIndex are not saved with data when using SaveToFile.

Tip:	You can support maintained aggregates using an index added with AddIndex.


TClientDataSet.AppendData

TClientDataSet	See also

Adds a newly fetched packet of records to those already stored in the client dataset.

procedure AppendData(const Data: OleVariant; HitEOF: Boolean);

Description

Use AppendData to add a newly fetched packet of records from the server application to the client dataset. Data indicates the packet of records to add. HitEOF indicates whether or not the application server encountered the end of the dataset when it fetched the records from the database server.

Most applications call GetNextPacket instead to fetch a packet of records and automatically add them to those already available. Use AppendData when fetching data packets directly from the application server rather than letting the client dataset fetch data.


TClientDataSet.ApplyRange

TClientDataSet	See also 	Example

Applies a range to the dataset.

procedure ApplyRange;

Description

Call ApplyRange to cause a range established with SetRangeStart and SetRangeEnd, or EditRangeStart and EditRangeEnd, to take effect. When a range is in effect, only those records that fall within the range are available to the application for viewing and editing.


TClientDataSet.ApplyUpdates

TClientDataSet	See also	Example

Sends all updated, inserted, and deleted records from the client dataset to the provider on the application server for writing to the database.

function ApplyUpdates(MaxErrors: Integer); Integer; virtual;

Description

Call ApplyUpdates to write all updated, inserted, and deleted records from the client dataset to the provider on the application server. MaxErrors indicates the maximum number of errors that the provider should allow before prematurely stopping the update operation. Set MaxErrors to –1 to indicate that there is no limit to the number of errors.

ApplyUpdates

1.	Generates a BeforeApplyUpdates event.

2.	Calls the application server to apply the updates in the Delta property and receives any records returned by the server because they generated errors when the server attempted to apply them to the database.

3.	Generates an AfterApplyUpdates event.

4.	Calls the client dataset’s Reconcile method to reconcile any records that are returned in step 2.

Warning:	The provider can’t detect when an update conflicts with another user’s changes to a memo field. The server will not detect and return these conflicts as errors.

ApplyUpdates returns the number of errors it encountered. Based on this return value and the setting of MaxErrors, successfully applied records are removed from the client dataset’s change log. If the update process is aborted before all updates are applied, any unapplied updates remain in the change log.


TClientDataSet.BookmarkValid

TClientDataSet	See also

Tests the validity of a specified bookmark.

function BookmarkValid(Bookmark: TBookmark): Boolean;

Description

Determines if a bookmark is valid. Bookmark is the bookmark pointer to test. If the bookmark is valid, BookmarkValid returns True. Otherwise it returns False.


TClientDataSet.Cancel

TClientDataSet	See also

Cancels unposted changes to the current record.

procedure Cancel; override;

Description

Call Cancel to undo modifications made to one or more fields belonging to the current record. As long as those changes are not already posted to the database, Cancel returns the record to its previous state, and sets the dataset state to dsBrowse.

Note:	Do not confuse Cancel with the RevertRecord method, which also backs out changes to the current record. Cancel backs out unposted changes while RevertRecord removes changes that have already been posted to the change log.


TClientDataSet.CancelRange

TClientDataSet	See also

Removes any ranges currently in effect for the client dataset.

procedure CancelRange;

Description

Call CancelRange to remove a range currently applied to a client dataset. Canceling a range reenables access to all records in the dataset.


TClientDataSet.CancelUpdates

TClientDataSet	See also

Clears all pending edits and clears the change log.

procedure CancelUpdates;

Description

Call CancelUpdates to clear all pending updates from the Delta property. Delta is a Variant maintained by the client dataset to record updates, inserts, and deletes.


TClientDataSet.CloneCursor

TClientDataSet	See also	Example

Points to the data belonging to another client dataset.

procedure CloneCursor(Source :TClientDataSet; Reset: Boolean; KeepSettings: Boolean = False);

Description

Call CloneCursor to share the data belonging to another client dataset. Source indicates another client dataset whose data is to be shared.

Reset and KeepSettings determine how to set the values of the following properties and events:

Filter, Filtered, FilterOptions, and OnFilterRecord

IndexName

MasterSource and MasterFields

ReadOnly

RemoteServer and ProviderName

If Reset and KeepSettings are both False, the values of the properties listed above are all set to match the source dataset.

If Reset is True, the properties listed above are all cleared.

If Reset is False and KeepSettings is True, the properties listed above are not changed. In this case, the application must ensure that existing indexes, providers, and so on are compatible with the cloned data.

After calling CloneCursor, the data for the client dataset is the same as the data for Source. Edits performed by either client dataset are reflected in the data of both datasets.

Note:	Because cloned cursors are shared, changing properties that affect the cursor affect both datasets. For example, setting the ReadOnly property of either dataset will make both datasets read-only.


TClientDataSet.CompareBookmarks

TClientDataSet	See also 	Example

Compares two bookmarks.

function CompareBookmarks(Bookmark1, Bookmark2: TBookmark): Integer;

Description

Call CompareBookmarks to determine if two bookmarks are identical. Bookmark1 and Bookmark2 are the bookmarks to compare. CompareBookmarks returns -1 if Bookmark1 is less than Bookmark2, 1 if Bookmark1 is greater than Bookmark2, and 0 if the bookmarks are identical or nil.


TClientDataSet.ConstraintsDisabled

TClientDataSet	See also

Indicates whether or not constraints are enabled for a client dataset.

function ConstraintsDisabled: Boolean;

Description

Call ConstraintsDisabled to determine if constraints are currently disabled for a dataset. If ConstraintsDisabled returns True, constraints are not enforced when edits are posted to the client dataset. If False, constraints are enforced when records are posted.


TClientDataSet.Create

TClientDataSet	See also

Creates and initializes instance of TClientDataSet.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a client dataset component at runtime. Create clears the Data property and sets up the master links for the dataset.


TClientDataSet.CreateBlobStream

TClientDataSet	See also

Returns a TClientBlobStream object for reading or writing the data in a specified blob field.

function CreateBlobStream(Field: TField; Mode: TBlobStreamMode): TStream; override;

Description

Call CreateBlobStream to obtain a stream for reading data from or writing data to a binary large object (BLOB) field. The Field parameter must specify a TBlobField component from the Fields property array. The Mode parameter specifies whether the stream will be used for reading, writing, or updating the contents of the field.

Note:	Calling CreateBlobStream ensures that the current record has fetched its BLOB data if the FetchOnDemand property is True. If FetchOnDemand is False and the provider does not include BLOB data in data packets by default, call FetchBlobs before calling CreateBlobStream.


TClientDataSet.CreateDataSet

TClientDataSet	See also	Example

Creates a new, empty client dataset.

procedure CreateDataSet;

Description

Call CreateDataSet at runtime to create a new, empty client dataset that then be edited and saved.

If the FieldDefs property contains values, these values are used to create field definitions. Otherwise the Fields property is used. One or both of these properties must contain values in order to create a dataset. If neither property is set, CreateDataSet raises an exception.

If the IndexDefs property contains values, these values are used to create indexes for the dataset.

Note:	You can create a dataset at design time by creating persistent field component or field definitions. Then right-click the client dataset and select Create Data Set.


TClientDataSet.DataRequest

TClientDataSet	See also	Example

Generates an OnDataRequest event on the associated provider

function DataRequest(Data: OleVariant): OleVariant; virtual;

Description

Call DataRequest to invoke an OnDataRequest event handler. This method is provided to allow application developers to customize the communication between a client application and a provider component.

There is no predefined meaning for the Input parameter or the returned value. Instead, the Data parameter provides the input parameter to an OnDataRequest event handler and DataRequest returns the value that that event handler returns.


TClientDataSet.DeleteIndex

TClientDataSet	See also

Deletes an index for the client dataset.

procedure DeleteIndex(const Name: string);

Description

Call DeleteIndex to remove an index for a client dataset. Name is the name of the index to delete.

Note:	You cannot delete the reserved indexes, DEFAULT_ORDER and CHANGEINDEX.


TClientDataSet.Destroy

TClientDataSet	See also

Destroys the instance of a client dataset component.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Usually destruction of datasets is handled automatically. If an application creates its own instances of a dataset, however, it should call Free, which verifies that the dataset component is not nil before calling Destroy.

Destroy clears the Data property, calls its inherited Destroy destructor, frees the master links for the client dataset, and frees its index definitions list.


TClientDataSet.DisableConstraints

TClientDataSet	See also

Disables application of server constraints on the dataset.

procedure DisableConstraints;

Description

Call DisableConstraints to prevent, on a temporary basis, application of server constraints replicated to the dataset. For example, when an application iterates through a dataset, it may improve performance to disable constraints temporarily.

Note:	Calling DisableConstraints increments a reference count. As long as this reference count is greater than zero, constraints are disabled for the dataset. To prevent accidental disabling of constraints, always group a call to DisableConstraints with a call to EnableConstraints.


TClientDataSet.EditKey

TClientDataSet	See also

Enables modification of the search key buffer.

procedure EditKey;

Description

Call EditKey to put the client dataset in dsSetKey state while preserving the current contents of the current search key buffer. To determine current search keys, you can use the IndexFields property to iterate over the fields used by the current index.

EditKey is especially useful when performing multiple searches where only one or two field values among many change between each search.


TClientDataSet.EditRangeEnd

TClientDataSet	See also 	Example

Enables changing the ending value for an existing range.

procedure EditRangeEnd;

Description

Call EditRangeEnd to change the ending value for an existing range. To specify an end range value, call FieldByName after calling EditRangeEnd. After assigning a new ending value, call ApplyRange to activate the modified range.


TClientDataSet.EditRangeStart

TClientDataSet	See also 	Example

Enables changing the starting value for an existing range.

procedure EditRangeStart;

Description

Call EditRangeStart to change the starting value for an existing range. To specify a start range value, call FieldByName after calling EditRangeStart. After assigning a new ending value, call ApplyRange to activate the modified range.


TClientDataSet.EmptyDataSet

TClientDataSet	See also

Removes all records from the dataset.

procedure EmptyDataSet;

Description

Call EmptyDataSet to empty the client dataset.


TClientDataSet.EnableConstraints

TClientDataSet	See also

Enables application of server constraints against dataset entries.

procedure EnableConstraints;

Description

Call EnableConstraints to turn on application server constraints previously disabled by a call to DisableConstraints.

Note:	Calling EnableConstraints decrements a reference count. When this reference count is zero constraints are enabled for the dataset. To prevent accidental disabling of constraints, always follow a call to DisableConstraints with a matching call to EnableConstraints.


TClientDataSet.Execute

TClientDataSet	See also

Executes an SQL command on the application server.

procedure Execute; virtual;

Description

Execute allows the client dataset to interact with a remote query or stored procedure even if it does not generate a result set. Call Execute to execute the command specified by CommandText or the provider’s query or stored procedure. If CommandText is not an empty string and the provider Options allow clients to supply a CommandText value, then Execute passes CommandText to the application server along with the Params property (to supply parameters for the statement). Otherwise, Execute tells the provider to apply any Params and execute the query or stored procedure associated with the Provider. After executing the appropriate statement, the provider returns any output parameters and Execute updates the Params property to reflect them.

When the client application calls Execute, the client dataset receives a BeforeExecute event before the request is passed to the provider component. After the provider executes the query or stored procedure, it returns any output parameters, which are used to update the Params property. Finally, the client dataset receives an AfterExecute event.


TClientDataSet.FetchBlobs

TClientDataSet	See also

Retrieves BLOB field values from the application server.

procedure FetchBlobs;

Description

Call FetchBlobs to retrieve BLOB field values from an application server when this information is not provided automatically. BLOB field values are automatically included in data packets unless the provider on the application server includes poFetchBlobsOnDemand in its Options property.

There is no need to call FetchBlobs if the provider automatically includes BLOB data or if the client dataset’s FetchOnDemand property is True.


TClientDataSet.FetchDetails

TClientDataSet	See also

Retrieves nested detail datasets from the application server.

procedure FetchDetails;

Description

Call FetchDetails to retrieve nested detail sets from an application server when this information is not provided automatically. Nested details are automatically included in data packets unless the provider on the application server includes poFetchDetailsOnDemand in its Options property. FetchDetails updates the current record to include the missing detail data sets.

There is no need to call FetchDetails if the provider automatically includes nested detail sets or if the client dataset’s FetchOnDemand property is True.


TClientDataSet.FetchParams

TClientDataSet	See also

Retrieves parameter values from the application server.

function FetchParams;

Description

Call FetchParams to initialize the Params property with the current parameter values on the application server. FetchParams does nothing unless the provider component on the application server can supply parameter values.

Note:	At design time, you can fetch parameter values by right-clicking the client dataset and choosing Fetch Params.

Warning:	If the client dataset uses a stateless application server, the values returned by FetchParams can be changed at any time by other clients. To obtain output parameters from a stateless application server, use the Execute method instead.


TClientDataSet.FindKey

TClientDataSet	See also 	Example

Searches for a record containing specified field values.

function FindKey(const KeyValues: array of const): Boolean; virtual;

Description

Call FindKey to search for a specific record in a dataset. KeyValues contains a comma-delimited array of field values, called a key. Each value in the key can be a literal, a variable, a NULL, or nil. If the number of values passed in KeyValues is less than the number of columns in the index used for the search, the missing values are assumed to be NULL

If a search is successful, FindKey positions the cursor on the matching record and returns True. Otherwise the cursor is not moved, and FindKey returns False.


TClientDataSet.FindNearest

TClientDataSet	See also

Moves the cursor to the record that most closely matches a specified set of key values.

procedure FindNearest(const KeyValues: array of const);

Description

Call FindNearest to move the cursor to a specific record in a dataset or to the first record in the dataset that is greater than the values specified in the KeyValues parameter. KeyValues contains a comma-delimited array of field values, called a key. If the number of values passed in KeyValues is less than the number of columns in the index used for the search, the missing values are assumed to be NULL.

Note:	FindNearest works only with string data types.

FindNearest positions the cursor either on a record that exactly matches the search criteria, or on the first record whose values are greater than those specified in the search criteria. The current setting of KeyExclusive also affects this behavior.


TClientDataSet.GetCurrentRecord

TClientDataSet	See also

Retrieves the current record into a buffer.

function GetCurrentRecord(Buffer: PChar): Boolean; override;

Description

Most applications should not need to call GetCurrentRecord. TClientDataSet automatically allocates a buffer for the active record.

Call GetCurrentRecord to copy the current record into a buffer allocated by the application. Buffer must be at least as big as the record size indicated by the RecordSize property.


TClientDataSet.GetFieldData

TClientDataSet	See also

Retrieves the current value of a field.

function GetFieldData(FieldNo: Integer; Buffer: Pointer): Boolean; overload; override;

function GetFieldData(Field: TField; Buffer: Pointer): Boolean; overload; override;

function GetFieldData(Field: TField; Buffer: Pointer; NativeFormat: Boolean): Boolean; overload; virtual;

Description

Call GetFieldData to obtain the value of a field component as it is stored in the record buffer. TField objects call GetFieldData to implement their GetData method.

The Field or FieldNo parameter indicates the field whose data should be fetched. Field specifies the component itself, while FieldNo indicates its field number. The Buffer parameter is a memory buffer with sufficient space to accept the value of the field as it exists in the database (unformatted and untranslated). NativeFormat indicates whether the dataset fetches the field in Delphi’s native format for the field type. When NativeFormat is False, the dataset must convert the field value to the native type. This allows the field to handle data from different types of datasets (ADO-based, BDE-based, and so on) in a uniform manner.

GetFieldData returns a value that indicates whether the data was successfully fetched.


TClientDataSet.GetGroupState

TClientDataSet	See also

Indicates where the current record sits within a specified group of records.

type

  TGroupPosInd = (gbFirst, gbMiddle, gbLast);

  TGroupPosInds = set of TGroupPosInd;

function GetGroupState(Level: Integer): TGroupPosInds;

Description

Call GetGroupState to determine where the current record falls in the group of records specified by the Level parameter.

Level identifies a group by its grouping level on the current index. Grouping level 1 is the set of records with the same value on the first field in the index. Grouping level 2 is the set of records with the same values on the first two fields in the index, and so on. If Level specifies a grouping level greater than the GroupingLevel property, GetGroupState raises an exception.

GetGroupState returns a set that indicates where the current record falls in the current grouping level. It has one of the following values:

Value	Meaning

[gbMiddle]	The current record is neither the first nor the last in the group.

[gbFirst]	The current record is the first in the group, which contains at least two records.

[gbLast]	The current record is the last in the group, which contains at least two records.

[gbFirst,gbLast]	The current record is the only record in the group.

Note:	If AggregatesActive is False or the current index does not support grouping, GetGroupState returns an empty set.


TClientDataSet.GetIndexInfo

TClientDataSet	See also

Retrieves information about the current index.

procedure GetIndexInfo(IndexName: String);

Description

Call GetIndexInfo to populate a dataset’s internal index fields with information about the current index, including its field count, map, and key size.

Pass the name of the current index as the IndexName to retrieve the default grouping level of the index as well. If an empty string is supplied for IndexName, no grouping level information is retrieved.

Warning:	Do not pass GetIndexInfo the name of any index other than the current index.


TClientDataSet.GetIndexNames

TClientDataSet	See also

Retrieves a list of available indexes for a client dataset.

procedure GetIndexNames(List: TStrings);

Description

Call GetIndexNames to retrieve a list of all available indexes for a client dataset. List is a string list object, created and maintained by the application, into which to retrieve the index names.

Note:	Two indexes are automatically generated for all client datasets:

DEFAULT_ORDER, which describes the order of data when it is put into the data packet.

CHANGEINDEX, which orders the data as it would if it were a delta assigned to another dataset.


TClientDataSet.GetNextPacket

TClientDataSet	See also

Retrieves the next block of records from the application server.

function GetNextPacket: Integer;

Description

Call GetNextPacket to retrieve the next sequential block of records from the application server. To specify the maximum number of records to return in a packet, set the PacketRecords property before calling GetNextPacket. A packet is appended to those records already stored in the Data property.

GetNextPacket returns the number of records added to Data. If the return value is 0, the client application has already received all available records from the application server.

Warning:	If the client dataset uses a stateless application server, you must use a BeforeGetRecords event handler to ensure that the data packet returns the correct set of records.


TClientDataSet.GetOptionalParam

TClientDataSet	See also 	Example

Retrieves a custom parameter from the data packet.

function GetOptionalParam(const ParamName: string): OleVariant;

Description

Application developers can add custom information to the data packet using the SetOptionalParam method. This information is saved with the data packet when it is saved to a file or stream, and copied with the value of the Data property. Call GetOptionalParam to retrieve this custom information from the data packet.

The ParamName parameter specifies the name under which the custom information was stored.

Note:	Do not confuse the optional data retrieved by this method with the Params property.


TClientDataSet.GotoCurrent

TClientDataSet	See also 	Example

Sets the current record in this dataset the same as the current record in another, cloned dataset.

procedure GotoCurrent(DataSet: TClientDataset);

Description

Call GotoCurrent to position the cursor on the same record that is current in the specified dataset. DataSet is the cloned dataset whose cursor position is to be matched in this dataset.

GotoCurrent is only useful for synchronizing two client datasets that use separate data sources to view and edit the same data.


TClientDataSet.GotoKey

TClientDataSet	See also

Moves the cursor to a record specified by the current key.

function GotoKey: Boolean;

Description

Use GotoKey to move to a record specified by key values assigned with previous calls to SetKey or EditKey and actual search values indicated in the search key buffer.

If GotoKey finds a matching record, it positions the cursor on the record and returns True. Otherwise the current cursor position remains unchanged, and GotoKey returns False.


TClientDataSet.GotoNearest

TClientDataSet	See also

Moves the cursor to the record that most closely matches the current key.

procedure GotoNearest;

Description

Call GotoNearest to position the cursor on the record that is either the exact record specified by the current key values in the key buffer, or on the first record whose values exceed those specified.

Note:	KeyExclusive determines which records are considered part of a search range.

Before calling GotoNearest, an application must specify key values by calling SetKey or EditKey to put the dataset is dsSetKey state, and then use FieldByName to populate the buffer with search values.


TClientDataSet.LoadFromFile

TClientDataSet	See also

Loads a client dataset’s data from a file.

procedure LoadFromFile(const FileName: string = '');

Description

Call LoadFromFile to populate the Data property of the client dataset with data stored in an external file. FileName is the name of the file containing the data to load. If the FileName parameter is an empty string, or if this parameter is omitted, LoadFromFile reads from the file specified by the FileName property.

To load data from a file at design time, right-click on the client dataset and choose Load from File.

Note:	FileName must contain data saved to a file by a previous call to this or another client dataset’s SaveToFile method.


TClientDataSet.LoadFromStream

TClientDataSet	See also

Loads a client dataset’s data from a stream.

procedure LoadFromStream(Stream: TStream);

Description

Call LoadFromStream to populate the Data property of the client dataset with data from a stream. Stream is the name of the stream from which to read data.

Note:	Stream must contain data in a client dataset’s internal format (for example, data written to a stream by another client dataset using the SaveToStream method.


TClientDataSet.Locate

TClientDataSet	See also

Searches the dataset for a specified record and makes that record the current record.

function Locate(const KeyFields: string; const KeyValues: Variant; Options: TLocateOptions): Boolean; override;

Description

Call Locate to search a dataset for a specific record and position the cursor on it. KeyFields is a string containing a semicolon-delimited list of field names on which to search.

KeyValues is a Variant containing the values to match in the key fields. If KeyFields lists a single field, KeyValues represents the search value for that field. If KeyFields lists multiple fields, pass a Variant array as the KeyValues parameter. You can construct a variant array on the fly using the VarArrayOf routine. For example:

with CustTable do

  Locate('Company;Contact;Phone', VarArrayOf(['Sight Diver', 'P', '831-431-1000']), [loPartialKey]);

Options is a set that optionally specifies additional search latitude when searching on string fields. If Options contains the loCaseInsensitive setting, then Locate ignores case when matching fields. If Options contains the loPartialKey setting, then the KeyValues parameter can specify incomplete strings for field values. (For example, in the previous statement, the Contact field would match any record where Contact begins with ‘P’). If Options is an empty set, or if the KeyFields are not string fields, Options is ignored.

Locate returns True if it finds a matching record, and makes that record the current one. Otherwise Locate returns False.


TClientDataSet.Lookup

TClientDataSet	See also

Retrieves field values from a record that matches specified search values.

function Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: string): Variant; override;

Description

Call Lookup to retrieve values for specified fields from a record that matches search criteria. KeyFields is a string containing a semicolon-delimited list of field names on which to search.

KeyValues is a Variant containing the values to match in the key fields. To specify multiple search values, pass KeyValues as a variant array as an argument, or construct a variant array on the fly using the VarArrayOf routine.

ResultFields is a string containing a semicolon-delimited list of field names whose values should be returned from the matching record.

Lookup returns a variant array containing the values from the fields specified in ResultFields.


TClientDataSet.MergeChangeLog

TClientDataSet	See also

Merges any data changes in the change log into the client dataset, overwriting existing values.

procedure MergeChangeLog;

Description

Call MergeChangeLog to merge changes in the change log into the actual data for the dataset, effectively creating a new data baseline. Existing values for which changes exist are overwritten.

Note:	This method is seldom called explicitly in multi-tiered applications because is called automatically by ApplyUpdates as part of the updating process. In single-tiered (flat-file) applications, MergeChangeLog must be called explicitly if LogChanges is True.


TClientDataSet.Post

TClientDataSet	See also

Writes a modified record to the Data property or the change log.

procedure Post; override;

Description

Call Post to commit changes to the current record. Methods that change the dataset state, such as Edit, Insert, or Append, or that move from one record to another, such as First, Last, Next, and Prior automatically call Post.

Note:	If the LogChanges property is True, Post updates the change log specified by the Delta property. If LogChanges is False, Post writes the changes directly to the Data property.


TClientDataSet.Reconcile

TClientDataSet	See also

Clears successfully updated records from the client dataset’s cache of changes.

function Reconcile(const Results: OleVariant): Boolean;

Description

Reconcile is called by the ApplyUpdates function to handle error conditions that occur during the update process. Reconcile is called after changes are applied to the dataset managed by a provider from the changes in a client dataset’s Delta property. (In a multi-tiered application, the provider resides on the application server.)

Results is a variant, returned by the ApplyUpdates method of a provider, that contains error information and record information for each record that could not be applied. Reconcile generates an OnReconcileError event for every record in Results (every record that was not applied on the application server). Finally, Reconcile adjusts the Delta property so that it includes only those records that were not applied to the application server. Any changes made in the OnReconcileError event are reflected in the new value of Delta.

Reconcile returns a value that indicates whether reconciling is successful. If True, Reconcile succeeded without error. If False, one or more errors could not be reconciled.


TClientDataSet.RefreshRecord

TClientDataSet	See also

Updates the base values of the current record to match the current values of the provider’s dataset.

procedure RefreshRecord;

Description

Call Refresh to change the base values of the current record to match the current value on the server. Refresh replaces the original values obtained from a provider, but leaves any changes in the change log intact.

Warning:	RefreshRecord should be used with care. If the user has modified the current record, refreshing the original values may mask update conflicts. When the client application calls ApplyUpdates, no reconcile error will occur, even where this is appropriate.

Note:	A similar method, Refresh, replaces the entire contents of the client dataset with the current values supplied by the provider. Unlike RefreshRecord, which leaves unapplied changes in the change log, Refresh raises an exception when the change log is not empty.


TClientDataSet.RevertRecord

TClientDataSet	See also

Undoes edits to the current record.

procedure RevertRecord;

Description

Call RevertRecord to remove any modifications made to the current record. RevertRecord can only remove modifications to records that are still in the change log. Changes that have been removed because they were applied to the application server or merged into the Data property can’t be undone using RevertRecord.

Note:	To undo the last edit made to a record, call UndoLastChange. To cancel all pending modifications, call CancelUpdates. To undo all edits since an application-defined state, use the SavePoint property.


TClientDataSet.SaveToFile

TClientDataSet	See also

Saves a client dataset’s data to an external file.

procedure SaveToFile(const FileName: string = ''; Format TDataPacketFormat=dfBinary);

Description

Call SaveToFile to write a client dataset’s data to an external file for later use by this or other client datasets.

FileName is the name of the external file to use. If the file already exists, its current contents are overwritten. If an empty string is passed for the FileName parameter (or if this parameter is omitted), the data is saved to the file specified by the FileName property.

Format indicates what format to use when saving the data, binary (dfBinary) or XML (dfXML).


TClientDataSet.SaveToStream

TClientDataSet	See also

Saves a client dataset’s data to a stream.

procedure SaveToStream(Stream: TStream; Format TDataPacketFormat=dfBinary);

Description

Call SaveToStream to write a client dataset’s data to a stream.

Stream is the name of an existing stream to write to.

Format indicates what format to use when saving the data, binary (dfBinary) or XML (dfXML).

If the stream requires a buffer, use the DataSize property to determine the required size of the buffer.


TClientDataSet.SetAltRecBuffers

TClientDataSet	See also

Sets record buffers when accessing field values.

procedure SetAltRecBuffers(Old, New, Cur: PChar);

Description

Applications do not normally need to call this method. SetAltRecBuffers sets pointers to records buffers that are used when accessing the OldValue, NewValue, and CurValue properties of a field component belonging to the client dataset. These value are accessed only while processing updates.


TClientDataSet.SetKey

TClientDataSet	See also

Enables setting of keys and ranges for a dataset prior to a search.

procedure SetKey;

Description

Call SetKey to put the dataset into dsSetKey state and clear the current contents of the search key buffer. Use FieldByName to supply the buffer then with a new set of values prior to conducting a search.

Note:	To modify an existing key or range, call EditKey.


TClientDataSet.SetOptionalParam

TClientDataSet	See also

Saves a custom parameter with the data packet.

procedure SetOptionalParam(const ParamName: string; const Value: OleVariant; IncludeInDelta: Boolean = False);

Description

Application developers can add custom information to a data packet using the SetOptionalParam method. This information is saved with the data packet when it is saved to a file or stream, and copied with the value of the Data property. For example, by setting a parameter in the OnGetData event of provider, application servers can include custom information with the data that is sent to client applications. Call GetOptionalParam to retrieve the custom information from the data packet.

The ParamName parameter specifies the name under which the custom information is stored. It can be any value except one of the following:

UNIQUE_KEY	DEFAULT_ORDER	CHANGE_LOG	SERVER_COL

CONSTRAINTS	DATASET_CONTEXT	DATASET_DELTA	LCID

BDERECORD_X	TABLE_NAME	MD_FIELDLINKS	UPDATEMODE

The Value parameter is an OleVariant that represents the custom information.

The IncludeInDelta parameter specifies whether the parameter is also stored with the Delta property. By including the parameter in the Delta property, it is sent along with updates to the application server. A provider on the application server can then retrieve this information using the GetOptionalParam method of the client dataset passed as a parameter to an OnUpdateData event handler.

Note:	Do not confuse the optional data saved by this method with the Params property.


TClientDataSet.SetProvider

TClientDataSet	See also

Associates the client dataset with a provider in the same process space.

procedure SetProvider(Provider: TComponent);

Description

Use SetProvider to specify a local provider component that provides data to and applies updates from the client dataset. The client dataset communicates with this provider using the IAppServer interface specified by the AppServer property.

Do not use SetProvider for remote providers on an application server. If the provider is not in the same process space as the client dataset, use the ProviderName property.

The Provider parameter must be a descendant of TCustomProvider. Otherwise, SetProvider raises an exception.

Note:	If you close the client dataset after assigning a provider using the SetProvider method, when you reopen the client dataset you must call SetProvider again to reassign that provider.


TClientDataSet.SetRange

TClientDataSet	See also 	Example

Sets the starting and ending values of a range, and applies it.

procedure SetRange(const StartValues, EndValues: array of const);

Description

Call SetRange to specify a range and apply it to the dataset. StartValues indicates the field values that designate the first record in the range. EndValues indicates the field values that designate the last record in the range.

SetRange combines the functionality of SetRangeStart, SetRangeEnd, and ApplyRange in a single procedure call. SetRange performs the following functions:

1	Puts the dataset into dsSetKey state.

2	Erases any previously specified starting range values and ending range values.

3	Sets the start and end range values.

4	Applies the range to the dataset.

If either StartValues or EndValues has fewer elements than the number of fields in the current index, then the remaining entries are set to NULL.


TClientDataSet.SetRangeEnd

TClientDataSet	See also 	Example

Indicates that subsequent assignments to field values specify the end of the range of rows to include in the dataset.

procedure SetRangeEnd;

Description

Call SetRangeEnd to put the dataset into dsSetKey state, erase any previous end range values, and set them to NULL. Subsequent field assignments made with FieldByName specify the actual set of ending values for a range.

After assigning end-range values, call ApplyRange to activate the modified range.


TClientDataSet.SetRangeStart

TClientDataSet	See also 	Example

Indicates that subsequent assignments to field values specify the start of the range of rows to include in the dataset.

procedure SetRangeStart;

Description

Call SetRangeStart to put the dataset into dsSetKey state, erase any previous start range values, and set them to NULL. Subsequent field assignments to FieldByName specify the actual set of starting values for a range.

After assigning start-range values, call ApplyRange to activate the modified range.


TClientDataSet.UndoLastChange

TClientDataSet	See also

Undoes the last edit, insert, or delete operation to a record in the client dataset.

function UndoLastChange(FollowChange: Boolean): Boolean;

Description

Call UndoLastChange to undo the last edit, insert, or delete operation to a record in the client dataset. FollowChange indicates whether or not to reposition the cursor on the restored record. If FollowChange is True, the cursor is positioned on the restored record. If FollowChange is False, the cursor remains on current record.


TClientDataSet.UpdateStatus

TClientDataSet	See also 	Example

Reports the update status for the current record in the dataset.

function UpdateStatus: TUpdateStatus; override;

Description

Call UpdateStatus to determine the update status for the current record in the client dataset. Update status can change frequently as records are edited, inserted, or deleted. UpdateStatus offers a convenient method for applications to assess the current status before undertaking or completing operations that depend on the update status of the current record.

Note:	To determine whether or not there are updates pending for an entire dataset, check the ChangeCount property.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataSet


 TCustomMidasPageProducer

Hierarchy	Properties	Methods	Events	See also

TCustomMidasPageProducer is the base class for page producers that display live database information.

Unit

dsprod

Description

Use TCustomMidasPageProducer as a base class for components that create Web pages in a MIDAS Web application. These pages display database information from an application server and include data packets encoded in XML and javascript that lets Web browsers navigate that data, post changes, and apply updates back to the application server.

The MIDAS page producer creates its HTML document from a template. Unlike other page producers, the MIDAS page producer has a default template that coordinates several top-level declarations for the HTML document with content produced by other components. The other components that generate HTML content for the MIDAS page producer can be added at design time using the Web Page editor.

Do not instantiate TCustomMidasPageProducer. To create a producer that generate HTML pages with javascript database functions and XML data packets, use a descendant class such as TMidasPageProducer.


TCustomMidasPageProducer properties

TCustomMidasPageProducer	Alphabetically	Legend

in TCustomMidasPageProducer

EnableXMLIslands

IncludePathURL

Styles

StylesFile

Derived from TPageItemsProducer

WebPageItems

Derived from TCustomPageProducer

HTMLDoc

HTMLFile

StripParamQuotes

Derived from TCustomContentProducer

Dispatcher

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomMidasPageProducer properties

TCustomMidasPageProducer	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Dispatcher

EnableXMLIslands

HTMLDoc

HTMLFile

IncludePathURL

Name

Owner

StripParamQuotes

Styles

StylesFile

Tag

VCLComObject

WebPageItems


TCustomMidasPageProducer.EnableXMLIslands

TCustomMidasPageProducer	See also

Specifies whether XML data packets should be declared using XML islands if the requesting browser supports them.

property EnableXMLIslands: Boolean;

Description

Set EnableXMLIslands to indicate whether the XML in the generated HTML document should be declared using XML islands. XML islands are only used if the document is created in response to a request message whose headers indicate that the browser supports XML islands.

Set EnableXMLIslands to False prevent the MIDAS page producer from declaring XML islands even if the requesting browser supports them.


TCustomMidasPageProducer.IncludePathURL

TCustomMidasPageProducer	See also

Indicates the URL where the javascript libraries are installed.

property IncludePathURL: string;

Description

Set IncludePathURL to indicate where the javascript libraries are installed. The MIDAS page producer uses this value to create HTML statements that include the libraries in the generated HTML document. These statements have the form

<SCRIPT language=Javascript type="text/javascript" SRC="IncludePathURL/xmldb.js"> </SCRIPT>

The javascript libraries define classes and methods that allow the HTML document to interpret XML data packets if the Web browser is not XML-enabled, and that enable controls in the document to navigate the data, post changes, and apply updates.


TCustomMidasPageProducer.Styles

TCustomMidasPageProducer	See also

Defines the styles that can be used by the MIDAS page producer and its Web items.

property Styles: TStrings;

Description

Use Styles to define a style sheet for the HTML document produced by TCustomMidasPageProducer. Each string in the TStrings object specifies a specific style by giving a style selector followed by a set of attributes in curly braces. These definitions can define styles for standard HTML elements such as

H2 B  {color: red}

or they can define styles that you name, such as

.MyStyle  {font-family: arial; font-weight: bold; font-size: 18px }

Note that user-defined style names must begin with a dot.

Styles for standard elements are applied automatically to HTML that uses the tag or tags that form the style selector. User-defined styles can be applied by setting the StyleRule property of a Web item to the user-defined style name that forms the selector.

Note:	If you are sharing a set of styles between multiple page producers or multiple applications, you can define the styles in a file. To define the styles in a file, use the StylesFile property instead. If StylesFile is defined, it takes precedence over the Styles property.


TCustomMidasPageProducer.StylesFile

TCustomMidasPageProducer	See also

Specifies a file containing the individual styles for the MIDAS page producer’s style sheet.

property StylesFile: TFileName;

Description

Set StylesFile to the name of a file containing the style definitions used by the MIDAS page producer. The MIDAS page producer uses these style definitions to declare a style sheet in the HTML document it generates.

Styles for standard elements are applied automatically to HTML in the document. User-defined styles can be applied by setting the StyleRule property of a Web item to the user-defined style name that forms the selector of a style definition.

Note:	If the StylesFile property is not set, you can specify the style definitions using the Styles property instead.


TCustomMidasPageProducer events

TCustomMidasPageProducer	Alphabetically	Legend

In TCustomMidasPageProducer

OnAfterGetContent

OnAfterGetXMLData

OnBeforeGetContent

OnBeforeGetXMLData

Derived from TPageProducer

OnHTMLTag


TCustomMidasPageProducer events

TCustomMidasPageProducer	By object	Legend

OnAfterGetContent

OnAfterGetXMLData

OnBeforeGetContent

OnBeforeGetXMLData

OnHTMLTag


TCustomMidasPageProducer.OnAfterGetContent

TCustomMidasPageProducer	See also

Occurs after the MIDAS page producer generates its HTML document.

property OnAfterGetContent: TNotifyEvent;

Description

Write an OnAfterGetContent event handler to take specific action immediately after the MIDAS page producer generates an HTML document. This event occurs immediately before the Content method returns the generated document. Typically it is used in applications where the MIDAS page producer automatically responds to messages as the Provider property of an action item or the Response producer property of an XML broker.


TCustomMidasPageProducer.OnAfterGetXMLData

TCustomMidasPageProducer	See also

Occurs after the MIDAS page producer translates fetches an XML data packet from an XML broker.

property OnAfterGetXMLData: TXMLDataEvent;

Description

Write an OnAfterGetXMLData event handler to take specific action immediately after the MIDAS page producer obtains an XML data packet from an XML broker. Typically, the OnAfterGetXMLData event handler responds to any values returned by the provider on the application server as the OwnerData parameter.

When the MIDAS page producer generates its HTML document (that is, when the Content method executes), it adds code to define the XML data packets manipulated in the document. To fetch these XML data packets, the MIDAS page producer calls an XML broker’s RequestRecords method. OnAfterGetXMLData occurs after the MIDAS page producer has returned an XML data packet but before it is assigned as part of the emerging content.


TCustomMidasPageProducer.OnBeforeGetContent

TCustomMidasPageProducer	See also

Occurs when the Content method is called.

property OnBeforeGetContent: TNotifyEvent;

Description

Write an OnBeforeGetContent event handler to take specific action immediately before the MIDAS page producer generates an HTML document. This event occurs when the Content method is called before the MIDAS page producer starts assembling its HTML document. Typically it is used in applications where the MIDAS page producer automatically responds to messages as the Provider property of an action item or the Response producer property of an XML broker.


TCustomMidasPageProducer.OnBeforeGetXMLData

TCustomMidasPageProducer	See also	Example

Occurs before the MIDAS page producer fetches an XML data packet from an XML broker.

property OnAfterGetXMLData: TXMLDataEvent;

Description

Write an OnBeforeGetXMLData event handler to take specific action immediately before the MIDAS page producer requests an XML data packet from an XML broker. Typically, the OnBeforeGetXMLData event handler encodes any values for the provider on the application server as the OwnerData parameter or initializes properties on the XML broker that affect the data packet.

When the MIDAS page producer generates its HTML document (that is, when the Content method executes), it adds code to define the XML data packets manipulated in the document. To fetch these XML data packets, the MIDAS page producer calls an XML broker’s RequestRecords method. OnBeforeGetXMLData occurs immediately before the MIDAS page producer requests an XML data packet. Any value assigned to the OwnerData parameter is passed to the XML broker’s OnRequestRecords event handler, and from there to the provider’s OnBeforeGetRecords event handler.


TCustomMidasPageProducer methods

TCustomMidasPageProducer	Alphabetically

In TCustomMidasPageProducer

Content

Create

Destroy

FindXMLBroker

FindXMLBrokerName

GetXMLData

SetIncludePathURL

SetStyles

SetStylesFile

Derived from TCustomPageProducer

ContentFromStream

ContentFromString

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomMidasPageProducer methods

TCustomMidasPageProducer	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Content

ContentFromStream

ContentFromString

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FindXMLBroker

FindXMLBrokerName

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetXMLData

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

SetIncludePathURL

SetStyles

SetStylesFile

UpdateAction


TCustomMidasPageProducer.Content

TCustomMidasPageProducer	See also

Returns the HTML document assembled by the MIDAS page producer.

function Content: string; override;

Description

Call Content to get the HTML document produced by TCustomMidasPageProducer. This document contains a mixture of HTML, XML, and javascript. It allows Web browsers to view and edit data from an application server.

The MIDAS page producer creates its content by replacing HTML-transparent tags in the template specified by HTMLDoc or HTMLFile.

By default, this template has the form

<HTML>

<HEAD>

</HEAD>

<BODY>

<#INCLUDES> <#STYLES> <#WARNINGS> <#FORMS> <#SCRIPT>

</BODY>

</HTML>

Although the template can be changed to include any combination of these tags with tags of the following forms

<#COMPONENT Name=WebItemName>

<#DATAPACKET XMLBroker=BrokerName>

which are also translated automatically. The template can replace the default html-transparent tags with the tag

<#BODYELEMENTS>

Finally, the template can include any tags translated by the OnHTMLTag event handler.

The Content method translates the tags listed above as follows:

<#INCLUDES> generates the statements that include the javascript libraries at the location specified by IncludePathURL.

<#STYLES> generates the statements that defines a style sheet from the definitions listed in the Styles or StylesFile property.

<#WARNINGS> generates nothing at runtime. At design time, it adds warning messages for problems detected while generating the HTML document. You can see these messages in the Web page editor.

<#FORMS> generates the HTML produced by the components listed in the WebPageItems property. The HTML from each component is listed in the order it appears in WebPageItems.

<#SCRIPT> generates a block of javascript declarations that are used by the components listed in WebPageItems.

<#BODYELEMENTS> generates the same HTML as results from the 5 tags in the default template. It is useful when generating a template in an HTML editor when you want to use the default layout but add additional elements (such as style sheets) using the editor.

<#COMPONENT> is replaced with the content produced by the specified component. Typically, this is a component listed in the WebPageItems property, but it can be any component that supports the IWebContent interface and has the same Owner as the MIDAS page producer.

<#DATAPACKET> is replaced with the XML data packet obtained from the specified XML broker.

The string returned by Content can be used as the Content property of the response to an HTTP request message.


TCustomMidasPageProducer.Create

TCustomMidasPageProducer

Creates and initializes an instance of TCustomMidasPageProducer.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a MIDAS page producer at runtime. MIDAS page producers placed in a Web module at design time are instantiated automatically.


TCustomMidasPageProducer.Destroy

TCustomMidasPageProducer	See also

Frees an instance of TCustomMidasPageProducer.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead, call the Free method, which checks whether the reference to the producer is not nil before calling Destroy.


TCustomMidasPageProducer.FindXMLBroker

TCustomMidasPageProducer	See also

Returns the XML broker that supplies the data packet specified by a DATAPACKET tag.

function FindXMLBroker(TagParams: TStrings): TXMLBroker; virtual;

Description

The MIDAS page producer translates HTML-transparent tags of the form

<#DATAPACKET XMLBroker=BrokerName>

into the XML returned by the XML broker. To do so, it calls FindXMLBroker to locate the XML broker specified by the XMLBroker parameter.

TagParams is a set of Name=Value pairs. This comes from the parameter portion of the DATAPACKET tag.

FindXMLBroker returns the XML broker with the name specified by the XMLBroker parameter. If TagParams does not contain a string of the form XMLBroker=BrokerName, FindXMLBroker returns nil.


TCustomMidasPageProducer.FindXMLBrokerName

TCustomMidasPageProducer	See also

Returns the name of an XML broker given the parameters in a DATAPACKET tag..

function FindXMLBrokerName(TagParams: TStrings): string; virtual;

Description

The MIDAS page producer translates HTML-transparent tags of the form

<#DATAPACKET XMLBroker=BrokerName>

into the XML returned by the XML broker. To do so, it calls FindXMLBrokerName to parse the parameters for the value of the XMLBroker parameter.

TagParams is a set of Name=Value pairs. This comes from the parameter portion of the DATAPACKET tag.

FindXMLBrokerName returns the value string from the XMLBroker parameter. If TagParams does not contain a string of the form XMLBroker=BrokerName, FindXMLBrokerName returns an empty string.


TCustomMidasPageProducer.GetXMLData

TCustomMidasPageProducer	See also

Obtains an XML data packet from a specified XML broker.

function GetXMLData(XMLBroker: TXMLBroker, XMLOptions: TXMLOptions): string; virtual;

Description

GetXMLData first generates an OnBeforeGetXMLData event. It then calls the RequestRecords method of the XML broker specified by XMLBroker, passing in the formatting options specified by XMLOptions. Finally, it generates an OnAfterGetXLData event.

GetXMLData returns the XML data packet that XMLBroker supplies.


TCustomMidasPageProducer.SetIncludePathURL

TCustomMidasPageProducer	See also

Assigns a value to the IncludePathURL property.

procedure SetIncludePathURL(const Value: string);

Description

SetIncludePathURL is the write implementation of the IncludePathURL property.


TCustomMidasPageProducer.SetStyles

TCustomMidasPageProducer	See also

Assigns a value to the Styles property.

procedure SetStyles(Value: TStrings);

Description

SetStyles is the write implementation of the Styles property.


TCustomMidasPageProducer.SetStylesFile

TCustomMidasPageProducer	See also

Assigns a value to the StylesFile property.

procedure SetStylesFile(const Value: TFileName);

Description

SetStylesFile is the write implementation of the StylesFile property.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomContentProducer

TCustomPageProducer

TPageProducer

TComponentsPageProducer

TPageItemsProducer


TCustomObjectBroker

Hierarchy	Properties	Methods	See also

TCustomObjectBroker is the abstract base class for components that locate available application servers for a connection component.

Unit

mconnect

Description

TCustomObjectBroker defines the methods by which a connection component obtains information about available application servers. When a connection component uses an object broker, it does not save any properties that identify a particular server machine. Instead, when it needs to open a connection, it uses the methods of the object broker to get that identifying information. This process allows client applications to locate server systems dynamically at runtime. If there are redundant server systems, this allows client applications to continue functioning when a server goes down.

TCustomObjectBroker does not implement any of the methods that provide information to connection components. Instead, descendants such as TSimpleObjectBroker implement a mechanism for choosing servers and identifying them to connection components. Application developers can derive more elaborate object brokers that provide additional benefits such as intelligent load balancing.


TCustomObjectBroker properties

TCustomObjectBroker	Alphabetically	Legend

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomObjectBroker properties

TCustomObjectBroker	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomObjectBroker methods

TCustomObjectBroker	Alphabetically

In TCustomObjectBroker

GetComputerForGUID

GetComputerForProgID

GetPortForComputer

SetConnectStatus

Derived from TComponent

Create

Destroy

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomObjectBroker methods

TCustomObjectBroker	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetComputerForGUID

GetComputerForProgID

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetPortForComputer

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

SetConnectStatus

UpdateAction


TCustomObjectBroker.GetComputerForGUID

TCustomObjectBroker 	See also

Returns a string that identifies a server machine for an interface identified by its GUID.

function GetComputerForGUID(GUID: TGUID): string; virtual; abstract;

Description

Call GetComputerForGUID to obtain a string that identifies a server machine on which a given interface is registered. The GUID parameter specifies the global unique identifier of the desired interface.

TCustomObjectBroker declares GetComputerForGUID as an abstract method. It is implemented in descendant objects that return a string designed to work with a particular connection component.

Connection components call this method, passing in the value of their ServerGUID property. They use the return value to set the ComputerName, URL, Host, or Address property, as appropriate.


TCustomObjectBroker.GetComputerForProgID

TCustomObjectBroker 	See also

Returns the machine name, URL, host name, or IP address of a server machine that supports an interface identified by its class name.

function GetComputerForProgID(const ProgID): string; virtual; abstract;

Description

Call GetComputerForProgID to obtain the name or address of a server machine on which a given interface is registered. The ProgID parameter specifies the name of the desired interface. If the server was created using one of Delphi’s Wizards, this is the value that was entered as the class name for the Wizard.

TCustomObjectBroker declares GetComputerForProgID as an abstract method. It is implemented in descendant objects that return a string designed to work with a particular connection component.

Connection components can call this method, passing in the value of their ServerName property. They can use the return value to set the ComputerName, URL, Host, or Address property, as appropriate.


TCustomObjectBroker.GetPortForComputer

TCustomObjectBroker	See also

Returns a port number for connecting to a specified remote server.

function GetPortForComputer(const ComputerName: string): Integer; virtual; abstract;

Description

Socket connection components call GetPortForComputer to get a value for their Port property. The ComputerName parameter specifies a Host name or IP address that was returned by GetComputerForGUID or GetComputerForProgID.

TCustomObjectBroker declares GetPortForComputer as an abstract method. It is implemented in descendant objects that return a string designed to work with a particular connection component.

Note:	This interface assumes that a single socket dispatcher on each server system handles all client requests, even when they are destined for different application servers on the same host.


TCustomObjectBroker.SetConnectStatus

TCustomObjectBroker	See also

Records whether a connection was established to a specified server.

procedure SetConnectStatus(ComputerName: string; Success: Boolean); virtual; abstract;

Description

After calling GetComputerForGUID or GetComputerForProgID, connection components use the returned value to open a connection to the identified server. They then call SetConnectStatus to tell the broker whether the connection was successfully opened.

TCustomObjectBroker declares SetConnectStatus as an abstract method. Descendants override this method to keep track of when server machines are down or to monitor the number of connections created for each server.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


TCOMConnection

Hierarchy	Properties	Methods	Events	See also

TCOMConnection is the base class for components that connect to application servers using DCOM or OLE.

Unit

mconnect

Description

Do not create instances of TCOMConnection. Instead, use TCOMConnection as a base class when created a custom component that forms a COM-based connection to an application server.

TCOMConnection adds to the ability to work with COM objects to the generic connection capabilities inherited from TDispatchConnection. It has two descendants: TDCOMConnection, which creates and manages connections using DCOM, and TOLEnterpriseConnection, which is provided for backward compatibility and handles connections using OLEnterprise.


TCOMConnection properties

TCOMConnection	Alphabetically	Legend

In TCOMConnection

Connected

Derived from TDispatchConnection

AppServer

ServerGUID

ServerName

Derived from TCustomConnection

DataSetCount

DataSets

LoginPrompt

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCOMConnection properties

TCOMConnection	By object	Legend

AppServer

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Connected

DataSetCount

DataSets

DesignInfo

LoginPrompt

Name

Owner

ServerGUID

ServerName

Tag

VCLComObject


TCOMConnection.Connected

TCOMConnection	See also

Indicates whether the TCOMConnection object is connected to an application server.

property Connected: Boolean;

Description

Set Connected to True to establish a connection to the application server. Set Connected to False to terminate the connection.

When changing the value of Connected, TCOMConnection generates a BeforeConnect and an AfterConnect event, or a BeforeDisconnect and an AfterDisconnect event. In addition, when setting Connected to True, TCOMConnection may display a login dialog, depending on the value of LoginPrompt.

The Connected property uses the protected DoConnect and DoDisconnect methods to connect to or disconnect from an application server. Descendants of TCOMConnection override DoConnect and DoDisconnect to change the way the connection is formed or terminated.


TCOMConnection events

TCOMConnection	Alphabetically	Legend

Derived from TDispatchConnection

OnGetUserName

Derived from TCustomConnection

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnLogin


TCOMConnection events

TCOMConnection	By object	Legend

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnGetUserName

OnLogin


TCOMConnection methods

TCOMConnection	Alphabetically	Legend

In TCOMConnection

DoConnect

SetConnected

Derived from TDispatchConnection

Create

GetServer

Derived from TCustomConnection

Close

Destroy

Open

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCOMConnection methods

TCOMConnection	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DoConnect

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetServer

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Open

RemoveComponent

SafeCallException

SetConnected

UpdateAction


TCOMConnection.DoConnect

TCOMConnection	See also

Connects to an application server.

procedure DoConnect; override;

Description

DoConnect is called internally when the Connected property is set to True. DoConnect creates a COM object for the application server (based on the ServerName or ServerGUID property), and sets the value of the AppServer property to this COM object.

Descendants of TCOMConnection override DoConnect to change the way the client application forms a connection to an application server.


TCOMConnection.SetConnected

TCOMConnection	See also

Sets the Connected property.

procedure SetConnected(Value: Boolean); override;

Description

SetConnected is the protected implementation of the Connected property.

If Value is False, SetConnected generates a BeforeDisconnect event, closes the connection, and generates an AfterDisconnect event.

If Value is True, SetConnected performs the following actions:

1. It checks the value of the ServerGUID or ServerName property and raises an exception if these do not specify a valid application server.

2. If LoginPrompt is True, and the connection is not already open, SetConnected generates an OnGetUserName event, and uses that to initialize a login dialog. It displays the login dialog, and aborts the connection if the user cancels.

3. It generates a BeforeConnect event.

4. It opens the connection.

5. It generates an AfterConnect event.

6. If LoginPrompt is True, and the connection opened successfully, SetConnected generates an OnLogin event.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomConnection

TCustomRemoteServer

TDispatchConnection


TComponentsPageProducer

Hierarchy	Properties	Methods	Events	See also

TComponentsPageProducer produces a string of HTML commands based on an input template.

Unit

Compprod

Description

Use TComponentsPageProducer to convert an HTML template that includes content generated by other components into a string of HTML commands that can be interpreted by a client application such as a Web browser. HTML templates include HTML commands and HTML-transparent tags that are replaced with customized content by the components page producer in an OnHTMLTag event handler.

Components page producers differ from other page producer components in that they replace special HTML-transparent tags of the format

<#COMPONENT Name=WebContentComponent>

with the HTML produced by the component named WebContentComponent. WebContentComponent must have the same Owner as the components page producer and support the IWebContent interface, which the components page producer uses to obtain the replacement HTML for the COMPONENT tag.


TComponentsPageProducer properties

TComponentsPageProducer	Alphabetically	Legend

Derived from TCustomPageProducer

HTMLDoc

HTMLFile

StripParamQuotes

Derived from TCustomContentProducer

Dispatcher

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TComponentsPageProducer properties

TComponentsPageProducer	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Dispatcher

HTMLDoc

HTMLFile

Name

Owner

StripParamQuotes

Tag

VCLComObject


TComponentsPageProducer events

TComponentsPageProducer	Alphabetically	Legend

Derived from TPageProducer

OnHTMLTag


TComponentsPageProducer events

TComponentsPageProducer	By object	Legend

OnHTMLTag


TComponentsPageProducer methods

TComponentsPageProducer	Alphabetically

Derived from TCustomPageProducer

Content

ContentFromStream

ContentFromString

Create

Destroy

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TComponentsPageProducer methods

TComponentsPageProducer	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Content

ContentFromStream

ContentFromString

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomContentProducer

TCustomPageProducer

TPageProducer


 TCorbaConnection

Hierarchy	Properties	Methods	Events	See also

TCorbaConnection connects CORBA client applications to an application server.

Unit

corbacon

Description

TCorbaConnection is used in the client portion of a multi-tiered database application to establish and maintain the connection between the client and a remote application server. The CORBA connection component can

Establish an initial connection to a remote application server.

Obtain an IAppServer for the application server.

Obtain a list of providers on the application server.

Drop the connection to the remote application server.

TCorbaConnection establishes the initial connection between the client application and a remote application server using CORBA. Once the connection is established, client datasets on the client application use the IAppServer interface from the CORBA connection component to communicate with providers on the application server, or to otherwise call the application server’s CORBA data module interface.

To connect client applications to remote application servers using DCOM, use TDCOMConnection instead. To connect using TCP/IP sockets, use TSocketConnection.


TCorbaConnection properties

TCorbaConnection	Alphabetically	Legend

In TCorbaConnection

AppServer

Cancelable

Connected

HostName

ObjectName

RepositoryID

Derived from TCustomConnection

DataSetCount

DataSets

LoginPrompt

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCorbaConnection properties

TCorbaConnection	By object	Legend

AppServer

Cancelable

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Connected

DataSetCount

DataSets

DesignInfo

HostName

LoginPrompt

Name

ObjectName

Owner

RepositoryID

Tag

VCLComObject


TCorbaConnection.AppServer

TCorbaConnection	See also

Contains the interface for communicating with the application server.

property AppServer: Variant;

Description

AppServer provides read-only access to the interface returned by the application server’s CORBA data module (a descendant of IAppServer). Client applications can communicate directly with the application server through this interface.

To use the dynamic invocation interface (DII), call the methods of the CORBA data module’s interface using code such as the following:

CorbaConnection1.AppServer.MyMethod;

To get better performance, use the as operator to cast the AppServer property to the Interface type of the CORBA data module as follows:

with IUnknown(CorbaConnection1.AppServer) as IMyCorbaDataModule do

  MyMethod;

This allows the client application to take advantage of static binding.

Note:	When using DII, you must use the Any type to encapsulate the values of parameters that are not simple types.


TCorbaConnection.Cancelable

TCorbaConnection	See also

Allows connections that are not established quickly to be canceled.

property Cancelable: Boolean;

Description

Set Cancelable to True to prevent the CORBA connection component from blocking the application during lengthy connection attempts.

When Cancelable is True, the CORBA connection component generates a separate thread when trying to establish a connection. If the connection takes more than one second to establish, the CORBA connection component generates an OnCancel event, which allows the application to determine whether the continue waiting for the connection or to abort the attempt and retry after making changes (such as fixing a mistyped repository ID). If there is no OnCancel event handler, the CORBA connection component displays a modal connecting dialog that allows the user to cancel the connection attempt.

When Cancelable is False, the CORBA connection component attempts to connect to the server using the thread that contains it. This blocks that thread until a connection is established. If the server specified by the CORBA connection component is unavailable (either because it is down or because of an error such as a mistyped repository ID), this can take a long time because the CORBA smart agent must search the entire network for an available server.

Note:	The time for establishing a connection can be shortened by changing the port number that the smart agent uses.


TCorbaConnection.Connected

TCorbaConnection	See also

Indicates whether the TCorbaConnection object is connected to an application server.

property Connected: Boolean;

Description

Set Connected to True to establish a connection to the application server. Set Connected to False to terminate the connection.

When changing the value of Connected, TCorbaConnection generates a BeforeConnect and an AfterConnect event, or a BeforeDisconnect and an AfterDisconnect event.


TCorbaConnection.HostName

TCorbaConnection	See also

Specifies the host name or IP address of the desired application server.

property HostName: string;

Description

Use HostName to optionally specify the machine on which the application server is running. If HostName is an empty string, the CORBA connection component will open a connection to the first server located that supports the interface specified by the RepositoryID property.


TCorbaConnection.ObjectName

TCorbaConnection	See also

Specifies the instance name of an object instance on the CORBA server.

property ObjectName: string;

Description

Use ObjectName to specify that the interface indicated by RepositoryID must be implemented by an object with an instance name of ObjectName. The object instance on the server is given an instance name when it is created. This instance name can come from the client on whose behalf the instance is created.

If there is only one object that implements the desired interface, ObjectName may be left as an empty string.


TCorbaConnection.RepositoryID

TCorbaConnection	See also

Specifies the Repository ID of the CORBA data module’s interface.

type TRepositoryId = type string;

property RepositoryId: TRepositoryId;

Description

Use RepositoryId to identify the CORBA data module type to which a connection should be formed. RepositoryID can be specified in one of two ways:

The Repository ID of the data module’s interface (an IAppServer descendant). This is a string of the form ‘IDL:MyProject/MyCorbaDataModule:1.0’;

The base name of the CORBA data module. The base name that corresponds to the previous Repository ID is ‘MyProject/MyCorbaDataModule’.

RepositoryId must have a value before the CORBA data module can connect to a server. The server can be further identified (optionally) by using the HostName and ObjectName properties.


TCorbaConnection events

TCorbaConnection	Alphabetically	Legend

In TCorbaConnection

OnCancel

Derived from TCustomConnection

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnLogin


TCorbaConnection events

TCorbaConnection	By object	Legend

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnCancel

OnLogin


TCorbaConnection.OnCancel

TCorbaConnection	See also

Occurs when a cancelable connection has not been established within one second.

type TCancelEvent = procedure(Sender: TObject; var Cancel: Boolean; var DialogMessage: string) of object;

property OnCancel: TCancelEvent;

Description

OnCancel occurs if the Cancelable property is True and a connection has not been established with the server within one second. The default value of DialogMessage is “Connecting to a CORBA server...” and the default value of Cancel is False.

If Cancel is False and DialogMessage is a nonempty string, the string is displayed in a modal dialog box along with a Cancel button. The user can abort the operation (raising an EAbort exception) by pressing the button.

If Cancel is False and DialogMessage is an empty string, the dialog is not displayed and OnCancel occurs again after another second has elapsed.

If Cancel is True, the operation is canceled immediately (raising an EAbort exception). You can also cancel by raising any exception.


TCorbaConnection methods

TCorbaConnection	Alphabetically

In TCorbaConnection

Create

GetServer

Derived from TCustomConnection

Close

Destroy

Open

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCorbaConnection methods

TCorbaConnection	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetServer

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Open

RemoveComponent

SafeCallException

UpdateAction


TCorbaConnection.Create

TCorbaConnection	See also

Creates an instance of a CORBA connection component.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a CORBA connection component at runtime. Connection components placed in forms or data modules at design time are created automatically.


TCorbaConnection.GetServer

TCorbaConnection	See also

Returns the IAppServer interface of the application server.

function GetServer: IAppServer; override;

Description

GetServer returns the interface of the application server after establishing a connection.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomConnection

TCustomRemoteServer


TCorbaDataModule

Hierarchy	Properties	Methods	Events	See also

TCorbaDataModule encapsulates the objects and interfaces of a CORBA application server.

Unit

corbardm

Description

Use a TCorbaDataModule object as the central repository for all objects in a CORBA-enabled application server. CORBA data modules can contain any nonvisual components. Typically these are data access components, such as datasets and the provider components that handle communication between these datasets and client applications. CORBA data modules can also contain other nonvisual components, such as TTimer, or TImageList.

At design time a TCorbaDataModule object provides a visual container into which a developer can place nonvisual components, set their properties, and write event handlers for them. In the unit file for the remote data module a developer may also code any business rules that are to be centralized in the middle tier of multi-tiered applications.

To create a CORBA data module at design time, choose File|New, and select CORBA Data Module from the multitier page of the new items dialog. The Corba Data Module Wizard then creates a new descendant of TCorbaDataModule that supports an interface that descends from IAppServer.


TCorbaDataModule properties

TCorbaDataModule	Alphabetically	Legend

Derived from TRemoteDataModule

Providers

Derived from TDataModule

DesignOffset

DesignSize

OldCreateOrder

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCorbaDataModule properties

TCorbaDataModule	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

DesignOffset

DesignSize

Name

OldCreateOrder

Owner

Providers

Tag

VCLComObject


TCorbaDataModule events

TCorbaDataModule	Alphabetically	Legend

Derived from TDataModule

OnCreate

OnDestroy


TCorbaDataModule events

TCorbaDataModule	By object	Legend

OnCreate

OnDestroy


TCorbaDataModule methods

TCorbaDataModule	Alphabetically

Derived from TRemoteDataModule

Create

Destroy

Lock

RegisterProvider

Unlock

UnRegisterProvider

Derived from TDataModule

AfterConstruction

BeforeDestruction

CreateNew

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCorbaDataModule methods

TCorbaDataModule	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateNew

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Lock

MethodAddress

MethodName

NewInstance

RegisterProvider

RemoveComponent

SafeCallException

Unlock

UnRegisterProvider

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataModule

TRemoteDataModule


TCustomResolver

Hierarchy	Properties	Methods	See also

TCustomResolver is the base class for components that apply updates on behalf of a provider.

Unit

provider

Description

TCustomResolver defines the fundamental properties and methods used by resolver components for applying updates from a client application and resolving errors that occur as part of that update process.

TCustomResolver has two descendants: TDataSetResolver, which applies updates to a dataset, and TSQLResolver, which applies updates directly to a database server.

Do not create resolver instances. Provider components create their own TCustomResolver descendants for applying updates.


TCustomResolver properties

TCustomResolver	Alphabetically	Legend

In TCustomResolver

Provider

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomResolver properties

TCustomResolver	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Provider

Tag

VCLComObject


TCustomResolver.Provider

TCustomResolver 	See also

Points to the provider that uses this resolver to apply updates.

property Provider: TBaseProvider;

Description

Provider is a read-only property that points to the provider that uses this resolver for applying updates. The Provider property is set in the constructor.

Resolvers use the Provider property internally to obtain information supplied in the provider’s properties. They also use it to generate events on the provider at appropriate points in the update process.


TCustomResolver methods

TCustomResolver	Alphabetically	Legend

In TCustomResolver

ApplyUpdates

BeginUpdate

Create

Destroy

DoDelete

DoInsert

DoUpdate

EndUpdate

FreeTreeData

GetTableName

HandleUpdateError

InitializeConflictBuffer

InitKeyFields

InitTreeData

InternalBeforeResolve

InternalUpdateRecord

LogUpdateError

LogUpdateRecord

RowRequest

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomResolver methods

TCustomResolver	By object	Legend

AfterConstruction

ApplyUpdates

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DoDelete

DoInsert

DoUpdate

EndUpdate

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

FreeTreeData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTableName

HandleUpdateError

HasParent

InheritsFrom

InitializeConflictBuffer

InitInstance

InitKeyFields

InitTreeData

InsertComponent

InstanceSize

InternalBeforeResolve

InternalUpdateRecord

LogUpdateError

LogUpdateRecord

MethodAddress

MethodName

NewInstance

RemoveComponent

RowRequest

SafeCallException

UpdateAction


TCustomResolver.ApplyUpdates

TCustomResolver 	See also

Applies updates received from a provider.

function ApplyUpdates(const Delta: OleVariant; MaxErrors: Integer; out ErrorCount: Integer); OleVariant; virtual;

Description

Providers call ApplyUpdates to apply updates received from a client dataset.

ApplyUpdates generates an OnUpdateData event on the associated provider, and then applies the updates passed in as the Delta parameter, returning an OleVariant that contains any updates that could not be applied.

The Delta parameter specifies a delta packet that originates from a client dataset. MaxErrors indicates the maximum number of errors to permit before aborting the update operation. ErrorCount indicates the actual number of errors encountered during the update operation. If ErrorCount is greater than MaxErrors, (or an OnUpdateError event returns rrAbort), all updates that have been successfully applied so far are rolled back, and the update process is aborted.

If the associated provider has an OnUpdateError event handler, it is called automatically whenever a record in Delta cannot be updated. In the OnUpdateError handler, applications can correct error conditions and try reapplying an update before returning unsuccessfully updated records back to the client dataset.


TCustomResolver.BeginUpdate

TCustomResolver 	See also

Provides the interface for a method that performs any initialization before applying updates.

procedure BeginUpdate; virtual;

Description

The ApplyUpdates method calls BeginUpdate before applying updates from a client dataset.

As implemented in TCustomResolver, BeginUpdate does nothing. Descendants that need take specific action before applying updates override this method.


TCustomResolver.Create

TCustomResolver	See also

Creates and initializes a resolver.

constructor Create(AProvider: TBaseProvider); reintroduce;

Description

Provider components call the TCustomResolver constructor when they need a resolver component for applying updates. The AProvider parameter specifies the provider that creates and uses the resolver.

Do not create resolver instances directly. Resolvers are designed to be created and used by providers, and can not function independently of a provider.


TCustomResolver.Destroy

TCustomResolver	See also

Frees an instance of a resolver object.

destructor Destroy; override;

Description

Applications rarely have to destroy resolvers explicitly. Once a resolver has been assigned as the Resolver property of a provider, the provider is responsible for freeing the resolver.


TCustomResolver.DoDelete

TCustomResolver	See also

Defines a method that deletes a record.

procedure DoDelete(Tree: TUpdateTree); virtual; abstract;

Description

DoDelete is one of several helper methods internal to the ApplyUpdates method. These helper methods perform the actual updates passed from the client. ApplyUpdates wraps the delta packet from the client in a TUpdateTree object. For each record that must be deleted, the resolver calls DoDelete.

TCustomResolver does not implement the DoDelete method. Descendants override this method to delete records in their own specialized way.


TCustomResolver.DoInsert

TCustomResolver 	See also

Defines a method that inserts a record.

procedure DoInsert(Tree: TUpdateTree); virtual; abstract;

Description

DoInsert is one of several helper methods internal to the ApplyUpdates method. These helper methods perform the actual updates passed from the client. ApplyUpdates wraps the delta packet from the client in a TUpdateTree object. For each record that must be inserted, the resolver calls DoInsert.

TCustomResolver does not implement the DoInsert method. Descendants override this method to insert records in their own specialized way.


TCustomResolver.DoUpdate

TCustomResolver 	See also

Defines a method that modifies a record.

procedure DoUpdate(Tree: TUpdateTree); virtual; abstract;

Description

DoUpdate is one of several helper methods internal to the ApplyUpdates method. These helper methods perform the actual updates passed from the client. ApplyUpdates wraps the delta packet from the client in a TUpdateTree object. For each record that must be modified, the resolver calls DoUpdate.

TCustomResolver does not implement the DoUpdate method. Descendants override this method to insert records in their own specialized way.


TCustomResolver.EndUpdate

TCustomResolver 	See also

Provides the interface for a method that performs any finalization after applying updates.

procedure EndUpdate; virtual;

Description

The ApplyUpdates method calls EndUpdate after applying updates from a client dataset.

As implemented in TCustomResolver, EndUpdate does nothing. Descendants that need take specific action after applying updates override this method.


TCustomResolver.FreeTreeData

TCustomResolver	See also

Frees the internal data maintained by a TUpdateTree.

procedure FreeTreeData(Tree: TUpdateTree); virtual;

Description

The ApplyUpdates method wraps delta packets from client datasets in a TUpdateTree object. The TUpdateTree stores the delta packet, along with information that the resolver uses when applying updates. This information varies, depending on the class of resolver.

FreeTreeData is called internally just before the resolver’s TUpdateTree object is freed. As implemented in TCustomResolver, FreeTreeData does nothing. Descendants override this method if any specific action is required to free the resolver’s data that is stored in the update tree.


TCustomResolver.GetTableName

TCustomResolver	See also

Frees the internal data maintained by a TUpdateTree.

procedure GetTableName(DataSet: TDataSet; var TableName: string);

Description

TCustomResolver descendants call GetTableName from their InitTreeData method when they need a name for generating commands to update a dataset.

GetTableName generates an OnGetTableName event on the associated provider. This allows an application to supply a table name when it can’t be easily deduced from the dataset to which updates are applied. For example, stored procedures and non-live queries can’t be updated unless the application supplies a table name.

The DataSet parameter is the dataset to which updates should be applied.

The TableName parameter returns the name to use when applying updates to DataSet. If the OnGetTableName event handler does not supply a name, TableName is left unaltered.


TCustomResolver.HandleUpdateError

TCustomResolver	See also

Manages the resolving process when errors occur while applying updates.

function HandleUpdateError(Tree: TUpdateTree; E: EUpdateError; var MaxErrors, ErrorCount: Integer): Boolean;

Description

When a resolver encounters errors in applying updates, it calls HandleUpdateError to determine how to proceed. HandleUpdateError generates an OnUpdateError event on the associated provider so that applications have an opportunity to correct update errors. Depending on the response provided by the OnUpdateError handler (if any), HandleUpdateError logs the unresolved error or signals that the resolver should try to apply the (corrected) record again.

The Tree parameter specifies the TUpdateTree that wraps all the updates currently being applied. The MaxErrors parameter indicates the maximum number of errors that the resolver will tolerate before the update operation is rolled back. The ErrorCount parameter specifies how many errors have been encountered so far.

HandleUpdateError returns True if the record has been corrected and the resolver should try to reapply the update. It returns False if the record is added to the error log.


TCustomResolver.InitializeConflictBuffer

TCustomResolver 	See also

Introduces a method for adding information about a failed update to the client dataset that is passed to an OnUpdateError event handler.

procedure InitializeConflictBuffer(Tree: TUpdateTree); virtual; abstract;

Description

The HandleUpdateError method calls InitializeConflictBuffer before generating an OnUpdateError event. This ensures that the ClientDataSet passed to an OnUpdateError event handler represents the update that caused the problem, with appropriate values for field’s CurValue property.

Descendants of TCustomResolver implement this method to obtain information from the dataset or server to which they are applying updates.


TCustomResolver.InitKeyFields

TCustomResolver 	See also

Sets the provider flag pfInKey on all key fields in a delta data packet.

procedure InitKeyFields(Tree: TUpdateTree; ADelta: TPacketDataSet);

Description

InitKeyFields is used internally to mark fields from a delta packet that can be used to uniquely identify records in the underlying dataset.

The Tree parameter is the internal TUpdateTree that the resolver uses to store information about the delta packet. The ADelta parameter is the data packet of changes to apply. For every field in this data packet that acts as a key value to uniquely identify records, InitKeyFields adds pfInKey to its ProviderFlags property.


TCustomResolver.InitTreeData

TCustomResolver	See also

Initializes the internal data maintained by a TUpdateTree.

procedure InitTreeData(Tree: TUpdateTree); virtual;

Description

The ApplyUpdates method wraps delta packets from client datasets in a TUpdateTree object. The TUpdateTree encodes stores the delta packet, along with information that the resolver uses when applying updates. This information varies, depending on the class of resolver.

InitTreeData is called internally when the resolver’s TUpdateTree object is created. As implemented in TCustomResolver, InitTreeData does nothing. Descendants override this method to store any class-specific information that they use when applying updates.


TCustomResolver.InternalBeforeResolve

TCustomResolver	See also

Initializes internal data structures once the delta packet has been wrapped in an update tree but before any updates are applied.

procedure InternalBeforeResolve(Tree: TUpdateTree); virtual;

Description

The ApplyUpdates method wraps delta packets from client datasets in a TUpdateTree object. Once this is complete, InternalBeforeResolve performs any other initialization before the updates are applied.

As implemented in TCustomResolver, InternalBeforeResolve does nothing. Descendants override this method to perform class-specific initialization.


TCustomResolver.InternalUpdateRecord

TCustomResolver	See also

Manages the updating process once a delta packet is wrapped in a TUpdateTree object.

function InternalUpdateRecord(Tree: TUpdateTree): Boolean;

Description

InternalUpdateRecord orchestrates the updating process, ensuring that updates are applied in the correct order and that errors are resolved or logged. For each record that must be updated, InternalUpdateRecord

1.Generates a BeforeUpdateRecord event.

2.Applies the update.

3.Generates an AfterUpdateRecord event if the update is successful, or calls HandleUpdateError to generate an OnUpdateError event.


TCustomResolver.LogUpdateError

TCustomResolver 	See also

Adds an update that could not be resolved to the error log that is returned to clients.

procedure LogUpdateError(Tree: TUpdateTree; E: EUpdateError; Response: TResolverResponse);

Description

When the HandleUpdateError method can’t resolve an update conflict, it calls LogUpdateError to add the unapplied update to the error log. This error log is eventually returned by the ApplyUpdates method when the update operation ends.

The Tree parameter represents the set of updates passed from the client. The E parameter is the EUpdateError exception that represents the current update error. The Response parameter is rrSkip if the update process should continue after the update is logged, and rrAbort if the entire update operation should be rolled back. LogUpdateError is never called with Response set to any other value.


TCustomResolver.LogUpdateRecord

TCustomResolver 	See also

Adds records to the error log if their data has been changed by another application.

procedure LogUpdateRecord(Tree: TUpdateTree);

Description

When the InternalUpdateRecord method detects that a record includes other changes than those specified by an update in the delta packet, it calls LogUpdateRecord to add the changed and updated record to the error log so that the record on the client dataset can be refreshed. This error log is eventually returned by the ApplyUpdates method when the update operation ends.

The Tree parameter represents the set of updates passed from the client.


TCustomResolver.RowRequest

TCustomResolver	See also

Returns information from a specified record.

function RowRequest(Row: OleVariant; Options: TFetchOptions): OleVariant; virtual;

Description

RowRequest is called automatically in response to the associated provider’s RowRequest method.

The Row parameter is an OleVariant that describes the current record on the client dataset. This allows the resolver to locate the record about which information is required.

The Options parameter indicates the type of information required.

The requested information is returned as a delta packet.


Scope

Published

Protected

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent


UpdateRegistry, DisableSocketTransport, EnableSocketTransport, DisableWebTransport, EnableWebTransport, RegisterPooled, UnregisterPooled Example

The following UpdateRegistry method adjusts a remote data module so that it can be pooled when accessed from a TWebConnection component. This allows the resources of the data module to be freed when it is not in use, while optimizing the use of existing remote data modules by letting clients share them.

The UpdateRegistry method also comments out the calls to DisableSocketTransport and EnableSocket transport that are added by the Remote Data Module Wizard. This prevents socket-based connections, which do not provide for a secure connection, from using the remote data module.

class procedure TMyRDM.UpdateRegistry(Register: Boolean; const ClassID, ProgID: string);

begin

  if Register then

  begin

    inherited UpdateRegistry(Register, ClassID, ProgID);

    { EnableSocketTransport(ClassID); }

    EnableWebTransport(ClassID);

    RegisterPooled(ClassID, 16, 30);

  end else

  begin

    { DisableSocketTransport(ClassID); }

    DisableWebTransport(ClassID);

    UnregisterPooled(ClassID);

    inherited UpdateRegistry(Register, ClassID, ProgID);

  end;

end;


OnGetDataSetProperties, GetOptionalParam Example

The following OnGetDataSetProperties event handler adds information to data packets that specifies when the data packet was created and the total number of records in the dataset used to generate the data packet. Only the time the data packet was created is included in delta packets when the client applies updates.

procedure TAppServerModule.Provider1GetDataSetProperties(Sender: TObject; DataSet: TDataSet; out Properties: OleVariant);

begin

  Properties := VarArrayCreate([0,1], varVariant);

  Properties[0] := VarArrayOf(['TimeProvided', Now, True]);

  Properties[1] := VarArrayOf(['TableSize', DataSet.RecordCount, False]);

end;

Later, when the client applies updates, the time the original records were provided can be read in the provider’s OnUpdateData event handler:

procedure TAppServerModule.Provider1UpdateData(Sender: TObject; DataSet: TClientDataSet);

var

  WhenProvided: TDateTime;

begin

  WhenProvided := DataSet.GetOptionalParam('TimeProvided');

  ...

end;

Note that the TableSize values can’t be obtained from the delta packet because its third array element was False.


Data, DataRequest, OnDataRequest Example

This example shows how to use the OnDataRequest event to allow a client application to pass a filter expression to the provider and then receive only the records matching the filter.

The OnDataRequest event handler of the provider looks like the following:

function TForm1.Provider1DataRequest(Sender: TObject; Input: OleVariant): OleVariant;

begin

  with (Sender as TDataSetProvider) do

  begin

    DataSet.Filter := Input;

    DataSet.Filtered := True;

    DataSet.First;

    Result := Data;

  end;

end;

On the client side, the DataRequest method can be used to fetch the data.  The DataRequest method triggers an OnDataRequest event in the Provider component and returns the result of the event handler:

procedure TForm1.Button1Click(Sender: TObject);

begin

  ClientDataSet1.Data := ClientDataSet1.DataRequest(FilterEdit.Text);

end;


DataSet, OnGetData Example

This example shows how to use a provider to encrypt the contents of a field containing sensitive data before it is sent on to the client. The client application must decrypt the data in the OnGetText routine of the SensitiveData field or some other appropriate place.

procedure TDBClientTest.ProviderGetData(DataSet: TClientDataSet);

begin

  with DataSet do

  begin

    while not EOF do

    begin

      Edit;

      SensitiveData.AsString := DoEncrypt(SensitiveData.AsString);

      Post;

      Next;

    end;

  end;

end;


UpdateStatus, OnUpdateData Example

This example shows an OnUpdateData event handler that scans for deleted records and saves them to a log. LogDelete is a helper function which copies the data from the deleted record into the log.

procedure TDBClientTest.ProviderUpdateData(DataSet: TClientDataSet);

begin

  with DataSet do

    while not EOF do

    begin

      if UpdateStatus = usDeleted then

        LogDelete(DataSet, UserName, Date, Time);

      Next;

    end;

end;


OnUpdateError Example

When a user deletes a record that has already been deleted by another user, this error is reported back to the client.  The following example shows how to suppress this client-side error in an OnUpdateError event handler.

procedure TDBClientTest.ProviderUpdateError(DataSet: TClientDataSet;

  E: EUpdateError; UpdateKind: TUpdateKind; var Response: TResolverResponse);

begin

  if (UpdateKind = ukDelete) and

    (E.ErrorCode = DBIERR_OPTRECLOCKFAILED) then

    Response := rrIgnore else

    Response := rrSkip;

end;


CloneCursor, GotoCurrent, FindKey, CompareBookmarks, SetRange Example

The following example uses a cloned cursor to determine whether the current record is within a specified range, and if so, applies the range to a client dataset.  The use of the cloned cursor allows the application to test a new range without changing the current range until it is determined that the new range is valid.

Note:	this example does not include any try .. finally statements to ensure that all allocations are freed if an exception occurs.  These should be added in any real application.

var

  TempDataSet: TClientDataSet;

  CurRec, RangeRec: TBookmark;

begin

  { create a second client dataset for checking the range }

  TempDataSet = TClientDataSet.Create(nil);

  with TempDataSet do

  begin

    { clone the real dataset with Reset set to True }

    { so that the current range is not cloned }

    CloneCursor(ClientDataSet1, True);

    { but we DO want the filters, if any, so apply them to the new client dataset }

    if ClientDataSet1.Filtered then

    begin

      FilterOptions := ClientDataSet1.FilterOptions;

      Filter := ClientDataSet1.Filter;

      OnFilterRecord := ClientDataSet1.OnFilterRecord;

      Filtered := True;

    end;

    { now move to the same record, and get a bookmark for it }

    GotoCurrent(ClientDataSet1);

    CurRec := GetBookmark;

    if FindKey([Edit1.Text]) then { go to the new start of range }

    begin

      RangeRec := GetBookmark;

      { check if start range is before current record }

      if CompareBookmarks(RangeRec, CurRec) <= 0 then

      begin

        { now try the end of the range }

        if FindKey([Edit2.Text]) then

        begin

          FreeBookmark(RangeRec); { free old bookmark at range start }

          RangeRec := GetBookmark; { replace it with bookmark at range end }

          { check if the range end is after current record }

          if CompareBookmarks(CurRec, RangeRec) <= 0 then

            { the new range is good – apply it! }

            TClientDataSet1.SetRange([Edit1.Text],[Edit2.Text]);

        end; { end of range was found }

      end; { start of range before current record }

      FreeBookmark(RangeRec);

    end; { start of range was found }

    { cleanup }

    FreeBookmark(CurRec);

    Free; { free the temporary data set }

  end; { end of with TempDataSet }

end;


OnReconcileError Example

The following code shows an OnReconcileError event handler that uses the reconcile error dialog from the RecError unit which ships in the object repository directory. (To use this dialog, add RecError to your uses clause.)

procedure TForm1.ClientDataSetReconcileError(DataSet: TClientDataSet; E: EReconcileError; UpdateKind: TUpdateKind; var Action TReconcileAction);

begin

  Action := HandleReconcileError(DataSet, UpdateKind, E);

end;


SetComplete, SetAbort Example

This example shows how to use the MTS data module’s SetComplete and SetAbort methods in an interface member that returns a single specified database record. CustNo is a Variant that specifies the value of the CustNo field (the key value to identify the record). This method returns a data packet containing a single record.

function TMyRemoteDataModule.GetCustomerRecord (CustNo: OleVariant): OleVariant;

var

  RecsOut: Integer;

begin

  Result := NULL;

  try

  if Customer1.Locate('CustNo', KeyValues, []) then

    Result := CustomerProvider.GetRecords(1, RecsOut);

  SetComplete;

  except

    SetAbort;

  end;

end;


CreateDataSet Example

The following code creates and activates a client dataset in the form’s OnCreate event handler:

procedure TForm1.FormCreate(Sender: TObject);

begin

  with ClientDataSet1 do

  begin

    with FieldDefs.AddFieldDef do

    begin

      DataType := ftInteger;

      Name := 'Field1';

    end;

    with FieldDefs.AddFieldDef do

    begin

      DataType := ftString;

      Size := 10;

      Name := 'Field2';

    end;

    with IndexDefs.AddIndexDef do

    begin

      Fields := 'Field1';

      Name := 'IntIndex';

    end;

    CreateDataSet;

  end;

end;


OnActivate, OnDeactivate Example

This example shows how an MTS data module uses the OnActivate and OnDeactivate events to open and close database connections. Database connections must not be left open when the MTS data module is deactivated or opened before the MTS data module is activated.

procedure TMyRemoteDataModule.MyRemoteDataModuleActivate(Sender: TObject);

begin

  Database1.Open; { connect to the database server }

  Table1.Open; { open the datasets...}

  Query1.Open;

end;

procedure TMyRemoteDataModule.MyRemoteDataModuleDeactivate(Sender: TObject);

begin

  Database1.Close; { close all datasets and disconnect from server }

end;


AfterUpdateRecord Example

This AfterUpdateRecord event handler keeps a log file of successful record postings, including the username, date, time, and client dataset name.

procedure TMyRDM.Provider1AfterUpdateRecord(Sender: TObject;

    SourceDS: TDataSet; DeltaDS: TClientDataSet; UpdateKind: TUpdateKind);

const

  SP = '  ';

var

  logfile: TextFile;

begin

  AssignFile(logfile,'log.txt');

  if not(FileExists('log.txt')) then ReWrite(logfile)

  else Append(logfile);

  writeln(logfile,(UserName+SP+DateToStr(Date)+SP+TimeToStr(Time)+SP+

        DeltaDS.Name));

end;


AddIndex Example

The code below creates a new case-insensitive index at runtime and then sorts the client dataset using that index. The user specifies the field on which to sort the client dataset in an edit control.

procedure TForm1.QuickIndexClick(Sender: TObject);

begin

  if Edit1.Text <> '' and

     ClientDataSet1.Fields.FindField(Edit1.Text) then

  begin

    ClientDataSet1.AddIndex(Edit1.Text + 'Index', Edit1.Text, [ixCaseInsensitive],'','',0);

    ClientDataSet1.IndexName := Edit1.Text + 'Index';

  end;

end;


UpdateMode Example

This OnUpdateError event handler checks whether a record update failed because the record could not be located. If so, it sets the UpdateMode property to locate the record based only on key values and retries the update by setting the Response parameter to rrApply.

Note:	Be sure to add BDE to the uses clause to use this example.

procedure TMyRDM.Provider1UpdateError(Sender: TObject; DataSet: TClientDataSet; E: EUpdateError; UpdateKind: TUpdateKind;  var Response: TResolverResponse);

begin

  with Sender as TDataSetProvider do

  begin

    if (ErrCat(E.ErrorCode) = ERRCAT_NOTFOUND) and

       (UpdateMode <> upWhereKeyOnly) then

    begin

      UpdateMode := upWhereKeyOnly;

      Response := rrApply;

    end;

  end;

end;


ServerData, Servers, ComputerName, HasFailed, Enabled Example

This example demonstrates how to update the active servers maintained by TSimpleObjectBroker. It then writes the current state to the registry so that it may be reinstated at a different time.

procedure TForm1.Button1Click(Sender: TObject);

var

  i: Integer;

  S1: String;

  Ole1: OleVariant;

begin

  with SimpleObjectBroker1 do

  begin

    for i:=0 to Servers.Count - 1 do

    begin

      if not Servers[i].HasFailed then {don’t enable down servers }

      begin

        S1 := 'Do you want ' + Servers[i].ComputerName + ' enabled?';

        if MessageBox(Handle, PChar(S1), PChar(Caption), MB_YESNO) = IDYES then

          Servers[i].Enabled := True

        else

          Servers[i].Enabled := False;

        end;

      end;

    end;

    { save the ServerData to the registry for later use. }

    Ole1 := ServerData;

  end;

  with TRegistry.Create do

  try

    OpenKey('\Software\Borland\Delphi\Servers\', True);

    WriteInteger('ServerInfoSize', SizeOf(Ole1));

    WriteBinaryData('ServerInfo', Ole1, SizeOf(Ole1));

  finally

    Free;

  end;

end;

The following code restores the Simple object broker to the state saved in the previous code.

procedure TForm1.Button2Click(Sender: TObject);

var

  P: Pointer;

  i: Integer;

begin

  with TRegistry.Create do

  try

    if OpenKey('\Software\Borland\Delphi\Servers\', False) then

    begin

      i := ReadInteger('ServerInfoSize');

      GetMem(P, i); { create a buffer }

      try { read the state and restore SimpleObjectBroker1 }

        ReadBinaryData('ServerInfo', P^, i);

        SimpleObjectBroker1.ServerData := OleVariant(P^);

      finally

        FreeMem(P);

      end;

  finally

    Free;

  end;

end;


BeforeDisconnect, ChangeCount, ApplyUpdates Example

This BeforeDisconnect event handler makes sure that the client dataset has applied all its pending updates before terminating the connection to the server.

procedure TDataModule1.ConnectionBeforeDisconnect(Sender: TObject);

begin

  if (ClientDataSet1.ChangeCount > 0) then

    ClientDataSet1.ApplyUpdates(-1);

  end;

end;


CreateTransactionContextEx Example

A client base application can control transaction context through the ITransactionContextEx interface. The following code example shows how a client application uses CreateTransactionContextEx to create the transaction context. This method returns an interface to this object.

This example wraps the call to the transaction context in a call to OleCheck which is necessary because the CreateInstance method is not declared as safecall.

procedure TForm1.MoveMoneyClick(Sender: TObject);

begin

  Transfer(CLASS_AccountA, CLASS_AccountB, 100);

end;

procedure TForm1.Transfer(DebitAccountId, CreditAccountId: TGuid; Amount: Currency);

var

  TransactionContextEx: ITransactionContextEx;

  CreditAccountIntf, DebitAccountIntf: IAccount;

begin

  TransactionContextEx := CreateTransactionContextEx;

  try

    OleCheck(TransactionContextEx.CreateInstance(DebitAccountId,

      IAccount, DebitAccountIntf));

    OleCheck(TransactionContextEx.CreateInstance(CreditAccountId,

      IAccount, CreditAccountIntf));

    DebitAccountIntf.Debit(Amount);

    CreditAccountIntf.Credit(Amount);

  except

    TransactionContextEx.Abort;

    raise;

  end;

  TransactionContextEx.Commit;

end;


BeforeUpdateRecord Example

This BeforeUpdateRecord event handler checks records to be sure that delivery date is at least 7 days in the future. If the date is too early, it raises an exception to prevent the update.

procedure TRemoteDataModule1.Provider1BeforeUpdateRecord(Sender: TObject; SourceDS: TDataSet; DeltaDS: TClientDataSet; UpdateKind: TUpdateKind; var Applied Boolean);

begin

  if UpdateKind <> ukDelete and

     DeltaDS.FieldByName('DeliveryDate').AsDateTime – Now < 7 then

    raise Exception.Create('You must allow at least 7 days for delivery.');

end;


OnBeforeGetXMLData, Params, FetchParams, AssignStrings, ContentFields Example

This example shows an OnBeforeGetXMLData event handler that assigns parameter values to an XML broker before it supplies the XML data packet. The parameter values are retrieved from a request message that was sent by a query form (generated by TQueryForm with a TSubmitQueryButton object).

procedure WebModule1.MidasPageProducer1BeforeGetXMLData(Sender: TObject; Request: TWebRequest; XMLBroker: TXMLBroker; var OwnerData: OleVariant);

begin

  if XMLBroker.Params.Count = 0 then

    XMLBroker.FetchParams;

  XMLBroker.Params.AssignStrings(Request.ContentFields);

end;


OnLogin Example
OnLogin

This example shows how to use an OnLogin event handler to pass authentication information to the server. This example assumes that the connection component’s LoginPrompt property is True and an AS_Login method has been added to the application server’s interface (using the type library). AS_Login returns True if the user name and password are accepted, False otherwise.

procedure Form1.MyDCOMConnectionLogin(Sender: TObject; UserName, Password: string);

var

  EncryptedValues: OleVariant;

begin

  { Create an encrypted version of the user name and password

    before sending them over an insecure connection. AS_Login

    decrypts them on the server side. }

  EncryptedValues := EncryptThem(UserName, Password);

  if not AppServer.AS_Login(EncryptedValues) then

    raise ELoginFailed.Create('Login rejected');

end;

Note that if the login fails, OnLogin raises an exception. The client application must catch this exception and provide feedback to the user:

KeepTrying := True;

while KeepTrying do

begin

  try

    MyDCOMConnection.Connected := True;

  except

    on ELoginFailed do

      if MessageDlg('Incorrect password– retry?', mtError, [mbYes, mbNo], 0) <> mrYes then

        KeepTrying := False;

  end;

end;


CommandText Example

This example shows how to use the CommandText property to send an SQL command to a query on the MIDAS server.

procedure TForm1.RunButtonClick(Sender: TObject);

begin

  { Send the query string to the server and open the client dataset }

  ClientData.Close;

  ClientData.CommandText := Memo1.Lines.Text;

  ClientData.Open;

end;


OnRequestRecords Example

This example shows how to use the OnRequestRecords event handler to supply parameter values from the request message before fetching a data packet.

procedure TWebModule1.XMLBroker1RequestRecords(Sender: TObject; Request: TWebRequest; out RecCount: Integer; var OwnerData: OleVariant; var Records: String);

begin

  // Set params using name/value pairs in URL

  XMLBroker1.Params.AssignStrings(Request.QueryFields);

end;


PEXTENSION_CONTROL_BLOCK type

PEXTENSION_CONTROL_BLOCK is the type of the TISAPIRequest.ECB property.

Unit

Isapiapp

type

  TEXTENSION_CONTROL_BLOCK = packed record

    cbSize: DWORD; // size of this struct.

    dwVersion: DWORD; // version info of this spec

    ConnID: HCONN; // Context number not to be modified!

    dwHttpStatusCode: DWORD; // HTTP Status code

    lpszLogData: array [0..HSE_LOG_BUFFER_LEN-1] of Char; // DLL specific log information

    lpszMethod: PChar; // REQUEST_METHOD

    lpszQueryString: PChar; // QUERY_STRING

    lpszPathInfo: PChar; // PATH_INFO

    lpszPathTranslated: PChar; // PATH_TRANSLATED

    cbTotalBytes: DWORD; // Total bytes indicated from client

    cbAvailable: DWORD; // Available number of bytes

    lpbData: Pointer; // pointer to cbAvailable bytes

    lpszContentType: PChar; // Content type of client data

    GetServerVariable: TGetServerVariableProc;

    WriteClient: TWriteClientProc;

    ReadClient: TReadClientProc;

    ServerSupportFunction: TServerSupportFunctionProc;

  end;

  PEXTENSION_CONTROL_BLOCK = ^TEXTENSION_CONTROL_BLOCK;

Description

PEXTENSION_CONTROL_BLOCK is the type of the TISAPIRequest.ECB property, which represents the extension control block structure used by the server application DLL to communicate with the web server.


TDataPacketFormat type

Indicates how information is encoded in a data packet or delta packet.

Unit

dbclient

type TDataPacketFormat = (dfBinary, dfXML);

Description

TDataPacketFormat indicates how a provider encodes database information into data packets. The following table lists the possible values:

Value	Meaning

dfBinary	Information is encoded in binary format.

dfXML	Information is encoded in XML.


TFetchOption, TFetchOptions type

Indicates the type of information about a record that a client dataset can request.

Unit

dbclient

type

  TFetchOption = (foRecord, foBlobs, foDetails);

  TFetchOptions = set of TFetchOption;

Description

Providers encode the flags received from a client dataset that indicate what type of row information they require into a value of type TFetchOptions. This value is used internally when assembling the requested information. TFetchOptions is a set that includes zero or more of the following values:

Value	Meaning

foRecord	The values of fields on the current record. (Used to refresh records).

foBlobs	The values of BLOB fields on the current record. (Used to implement delayed fetching of BLOB data).

foDetails	Any nested dataset fields for the current record. (Used to implement delayed fetching of detail datasets.


TGetRecordOption, TGetRecordOptions type

See also

Influences what type of information added to data packets.

Unit

provider

type

  TGetRecordOption = (grMetaData, grReset, grXML);

  TGetRecordOptions = set of TGetRecordOption;

Description

TGetRecordOptions is a set of TGetRecordOption values. TGetRecordOption values are listed in the following table:

Value	Meaning

grMetaData	The data packet includes metadata as well as record values.

grReset	The records in the data packet start with the first record, regardless of the contents of any previously sent data packets.

grXML	The data packet is transmitted as a string of XML instead of as an OleVariant.


THTTPMethodEvent type

See also

The type for event handlers that are called while processing an HTTP request message.

Unit

httpapp

type THTTPMethodEvent = procedure (Sender: TObject; Request: TWebRequest; Response: TWebResponse; var Handled: Boolean) of object;

Description

THTTPMethodEvent is the type for event handlers that allow components in Web server applications to respond to HTTP request messages.

Sender is the dispatcher that receives the message or the component to which the dispatcher forwards the request message.

Request is the Request object that describes the headers and content of the incoming request message.

Response is the emerging response to the message described by Request. The event handler can fill out the properties of this response and even send it back to the originator of the request.

Handled indicates whether the response object specified by Response is completed. If the event handler does not complete the response, it must set Handled to False, so that the message is sent on to another component for further processing (or, in some cases, so that the component continues processing the message). If the event handler completes the response message, even if it does not send the message, it should set Handled to True.


TLayout type

See also

The type for helper objects that generate layout code for a Web item.

Unit

miditems

type TLayout = TObject;

Description

TLayout is the type for objects that Web items use to transmit common functions that control the layout of HTML controls. When a Web item generates content that includes HTML produced by child components, it passes a TLayout object to those children. The TLayout object implements an interface (ILayoutWebContent) that generates HTML to lay out the controls which the child components generate.


TMethodType type

See also

Represents the type of an HTTP request message.

Unit

httpapp

type TMethodType = (mtAny, mtGet, mtPut, mtPost, mtHead);

Description

HTTP request messages include a METHOD header that indicates the purpose of the message. TMethodType encodes the most common values of the METHOD header for easy lookup and comparison. Components that respond to HTTP request methods use MethodType to indicate the type of messages to which they respond.

The following table lists the possible values:

Value	Meaning

mtAny	On a request object, this indicates a METHOD header that can’t be encoded using another TMethodType value. On a component that handles request messages, this indicates that the component will accept any message, regardless of its METHOD header (including any value that can be encoded using another TMethodType value).

mtGet	A request for information associated with the target URL. This corresponds to a METHOD header of GET.

mtPut	A request that the content of the request be used to replace the resource identified by the target URL. This corresponds to a METHOD header of PUT.

mtPost	A request that the application post the content of the request, as appropriate. This corresponds to a METHOD header of POST.

mtHead	A request for the properties of the response message, but not its content. This corresponds to a METHOD header of HEAD.


TProviderOption, TProviderOptions type

See also

Influences what type of information is communicated between client datasets and provider components.

Unit

provider

type

  TProviderOption = (poFetchBlobsOnDemand, poFetchDetailsOnDemand, poIncFieldProps, poCascadeDeletes, poCascadeUpdates, poReadOnly, poAllowMultiRecordUpdates, poDisableInserts, poDisableEdits, poDisableDeletes, poNoReset, poAutoRefresh, poPropogateChanges, poAllowCommandText);

  TProviderOptions = set of TProviderOption;

Description

TProviderOptions is a set of TProviderOption values. TProviderOption values are listed in the following table:

Value	Meaning

poFetchBlobsOnDemand	BLOB fields are not included in data packets. Instead, client applications must request these values on an as-needed basis. If the client dataset’s FetchOnDemand property is True, the client requests these values automatically. Otherwise, the client application uses the FetchBlobs method to retrieve BLOB data.

poFetchDetailsOnDemand	When the provider represents the master of a master/detail relationship, nested detail values are not included in the data packet. Instead, client applications request these on an as-needed basis. If the client dataset’s FetchOnDemand property is True, the client requests these values automatically. Otherwise the client application uses the FetchDetails method to retrieve nested detail sets.

poIncFieldProps	The data packet includes the following field properties (where applicable): Alignment, DisplayLabel, DisplayWidth, Visible, DisplayFormat, EditFormat, MaxValue, MinValue, Currency, EditMask, DisplayValues

poCascadeDeletes	Tells the server to delete detail records automatically when master table records are deleted. To use this option, the provider must represent the master of a master/detail relationship and the database must support cascaded deletes as part of its referential integrity settings.

poCascadeUpdates	Tells the server to update detail records automatically when master table key values are changed. To use this option, the provider must represent the master of a master/detail relationship and the database must support cascaded updates as part of its referential integrity settings.

poReadOnly	The client dataset can’t apply updates to the provider.

poAllowMultiRecordUpdates	Enables individual updates that affect multiple records. When poAllowMultiRecordUpdates is not included, updates that change multiple records are automatically aborted.

poDisableInserts	Clients can’t add new records. If the client tries to insert a record an exception is raised. (This does not affect the client’s ability to edit or delete records)

poDisableEdits	Clients can’t modify existing data values. If the client tries to edit a field an exception is raised. (This does not affect the client’s ability to insert or delete records)

poDisableDeletes	Clients can’t delete records. If the client tries to delete a record an exception is raised. (This does not affect the client’s ability to edit or insert records)

poNoReset	Ignores the reset flag in calls to AS_GetRecords (TGetRecordsOption value of grReset).

poAutoRefresh	Refreshes the client dataset with current record values whenever it applies updates.

poPropogateChanges	Changes made in a BeforeUpdateRecord or AfterUpdateRecord event handler are sent back to the client and merged into the client dataset.

poAllowCommandText	Enables the client to override the provider’s dataset by replacing its associated SQL text or the name of its stored procedure or table. These overrides are supplied to the GetRecords or Execute method.


TReconcileAction type

See also

Indicates how a client dataset should handle a record whose update generated an error.

Unit

Dbclient

type TReconcileAction = (raSkip, raAbort, raMerge, raCorrect, raCancel, raRefresh);

Description

TReconcileAction is the type of the return parameter in a client dataset’s OnReconcileError event handler. It indicates the action to take when the OnReconcileError handler exits. The following table lists the possible values and what they indicate:

Value	Meaning

raSkip	Skip updating the record that raised the error condition, and leave the unapplied changes in the change log.

raAbort	Abort the entire reconcile operation.

raMerge	Merge the updated record with the record on the server.

raCorrect	Replace the current updated record with the value of the record in the event handler.

raCancel	Back out all changes for this record, reverting to the original field values.

raRefresh	Back out all changes for this record, replacing it with the current values from the server.


TRemoteEvent type

See also

The type for event handlers that pass custom information to or from an application server.

Unit

provider

type

  TRemoteEvent = procedure(Sender: TObject; var OwnerData: OleVariant) of object;

Description

TRemoteEvent is the type for event handlers that allow client applications and application servers to customize the communication that occurs over an IAppServer interface. Before every  IAppServer call that is directed toward a provider on the application server, the client dataset receives an event of type TRemoteEvent where it can return custom information as an OleVariant. When the application server passes the command to the target provider, the provider receives an event of type TRemoteEvent where it can respond to or change the incoming information before the command is executed. After executing the command, the provider receives another event of the same type, where it can once again review the custom information and return custom information to the client application. Finally, the client receives the returned information in a TRemoteEvent event handler or as a parameter to the method.

Sender is the client dataset or provider that receives the event:

OwnerData is the custom information defined by the application developer.

In client dataset “BeforeXXX” events, this parameter is for output only so that it can be sent to the provider.

In provider “BeforeXXX” events, this parameter enters as information sent by the client dataset “BeforeXXX” event and returns the information passed to the provider “AfterXXX” event.

 In the provider “AfterXXX” event, this parameter enters as information from the provider (or client dataset) “BeforeXXX” event and returns the information that is passed to the client dataset “AfterXXX” event.

In client dataset “AfterXXX” events, this parameter is for input only, and contains the information returned by the provider.


TResolverResponse type

See also

Indicates the action a resolver component should take after an OnUpdateError event handler handles an update error.

Unit

provider

type

  TResolverResponse = (rrSkip, rrAbort, rrMerge, rrApply, rrIgnore);

Description

The following table lists the possible values for TResolverResponse and what they indicate:

Value	Meaning

rrSkip	Skip updating the record that raised the error condition, and leave the unapplied changes in the cache.

rrAbort	Abort the entire update operation without displaying an error message.

rrMerge	Merge the updates in the delta packet with the new underlying value from the database. This will only succeed if none of the updated fields have been changed by another user.

rrApply	Apply the current record value (as it has been fixed in the OnUpdateError handler) instead of the original update.

rrIgnore	Ignore the error condition: Do not apply the record but do not return the record to the client for resolving either.


TWebComponentContainer type

See also

The type for components that maintain a list of Web items.

Unit

miditems

type TWebComponentContainer = TObject;

Description

TWebComponentContainer is the type for objects that make use of Web items (components that generate HTML and support the IWebContent interface). Each TWebComponentContainer has a property of type TWebComponentList that lists its Web items. The TWebComponentContainer uses these Web items to generate constituent parts of the HTML that it generates.


TXMLDataEvent type

See also

The type for event handlers that occur when a MIDAS page producer adds an XML data packet to its HTML document.

Unit

midprod

type

  TXMLDataEvent = procedure (Sender: TObject; Request: TWebRequest; XMLBroker: TXMLBroker; var OwnerData: OleVariant) of object;

Description

TXMLDataEvent is the type for event handlers that occur before and after a MIDAS page producer translates a DATAPACKET tag into a string of XML.

Sender is the MIDAS page producer that is creating an HTML document containing the XML data packet.

Request is the request message in response to which the MIDAS page producer is creating the HTML document.

XMLBroker is the XMLBroker that fetches the XML data packet from the application server and returns it to the MIDAS page producer.

OwnerData is application-specific information that allows the MIDAS page producer to communicate with the XMLBroker and with the provider on the application server. Typically, this parameter is used to communicate persistent state information when the application server is stateless. If the event handler is used for an OnBeforeGetXMLData event, the event handler creates and returns a value in OwnerData which is passed to the XMLBroker’s OnRequestRecords event handler, and from there passed to the provider on the application server. If the event handler is used for an OnAfterGetXMLData event, OwnerData is set to the value returned by the provider on the application server on entry into the event handler and is ignored on exit.


TXMLOption, TXMLOptions type

See also

A set of flags that indicates how database information should be formatted in an XML data packet.

Unit

xmlbrokr

type

  TXMLOption = (xoQuote);

  TXMLOptions = set of TXMLOption;

Description

TXMLOption is the type for flags that influence how an XML broker formats the XML string that an application server provides. After the XML broker fetches data from an application server, it reformats the data using a set of TXMLOption flags.

TXMLOptions is a set of zero or more TXMLOption flags.

The following table lists the TXMLOption flags:

Value	Meaning

xoQuote	The XML string is divided into readable lines, each of which is enclosed in quotation marks.


TCubeDim

Hierarchy	Properties	Methods	See also

TCubeDim represents an entry in the dimension map of a decision cube.

Unit

mxstore

Description

Use TCubeDim to obtain information about the dimensions or summaries maintained by a decision cube. The decision cube maintains a collection of TCubeDim objects that describe the fields over which the information in the decision cube is summarized and the fields that supply those summarized values. The properties of TCubeDim can be used to change the display names of the dimensions of the decision cube, or to expand or collapse individual dimensions of the multidimensional array of values cached by the decision cube.

TCubeDim introduces properties and methods to allow a decision cube to include date ranges as the values along one of its dimensions.


TCubeDim properties

TCubeDim	Alphabetically	Legend

In TCubeDim

BinData

BinFormat

BinType

Loaded

StartDate

StartValue

ValueCount

Derived from TDimensionItem

ActiveFlag

BaseName

DerivedFrom

DimensionType

Fieldname

FieldType

Format

Name

Derived from TCollectionItem

Collection

DisplayName

ID

Index


TCubeDim properties

TCubeDim	By object	Legend

ActiveFlag

BaseName

BinData

BinFormat

BinType

Collection

DerivedFrom

DimensionType

DisplayName

Fieldname

FieldType

Format

ID

Index

Loaded

Name

StartDate

StartValue

ValueCount


TCubeDim.BinData

TCubeDim	See also

Represents information about the implementation of paged dimensions.

property BinData: TBinData;

Description

Do not use the BinData property. It is used internally to manage paged (permanently drilled) dimensions.


TCubeDim.BinFormat

TCubeDim	See also

Indicates how range values are formatted.

property BinFormat: string;

Description

Set BinFormat to indicate how the labels for date ranges should appear. Use any standard Delphi date and time formatting strings, such as those used with the FormatDateTime function.


TCubeDim.BinType

TCubeDim	See also

Indicates how the values of the field represented by the dimension are grouped.

type TBinType = (binNone, binYear, binQuarter, binMonth, binSet, binCustom);;

property BinType: TBinType;

Description

Set BinType to restrict the values that appear along the dimension. BinType can have one of the following values:

Value	Meaning

binNone	All values along the dimension appear.

binYear	Each cell along the dimension represents all field values that represent dates from the same year.

binQuarter	Each cell along the dimension represents all field values that represent dates from the same quarter.

binMonth	Each cell along the dimension represents all field values that represent dates from the same month.

binSet	The dimension is in a paged (permanently drilled) state. The drill-down value of the dimension can be changed, but the dimension can not be opened or closed.

binCustom	binCustom is not currently used but is provided to allow component writers to support other types of ranges.

If BinType is binYear, binQuarter, or binMonth, use the BinFormat property to indicate how the values of the ranges along the dimension should be formatted.

If BinType is binSet, use the StartValue property to specify which value along the dimension is used as the drill-down value. Unlike the drill-down value of a normal dimension, which is part of the pivot state stored by the decision source, the drill-down value of a paged dimension is the only value cached by the decision cube. Changing the drill-down value of paged dimensions causes the decision cube to rebuild its cache, which can be very time-consuming.

Note:	When BinType is binSet, the dimension item consumes considerably less memory in the decision cube.

Note:	Do not set BinType to binYear, binQuarter, or binMonth if the dimension does not represent a date or date-time field.


TCubeDim.Loaded

TCubeDim	See also

Indicates whether the dimension item is currently cached by the decision cube.

property Loaded: Boolean;

Description

Read Loaded to determine whether the dimension item is currently available through the decision cube. When the ActiveFlag property is diActive, Loaded is always True. When the value of ActiveFlag is diInactive, Loaded is always False. When the value of ActiveFlag is diAsNeeded, use Loaded to determine whether the decision cube has cached the dimension item so that it is available to a decision source.

When Loaded is True, the dimension item consumes memory. When Loaded is False, the dimension item is unavailable.


TCubeDim.StartDate

TCubeDim	See also

Determines how values are grouped along a dimension.

property StartDate: TDate;

Description

When the BinType property is binYear, binQuarter, or binMonth, set StartValue to the first date in the first range of the dimension. If the BinType property is binSet, set StartValue to the drill-down value of the dimension.


TCubeDim.StartValue

TCubeDim	See also

Determines how values are grouped along a dimension.

property StartValue: String;

Description

When the BinType property is binYear, binQuarter, or binMonth, set StartValue to the first date (expressed as a string) in the first range of the dimension. If the BinType property is binSet, set StartValue to the drill-down value of the dimension.


TCubeDim.ValueCount

TCubeDim	See also

Indicates the number of distinct values exist for the dimension.

property ValueCount: Integer;

Description

Read ValueCount to determine the number of distinct values for this dimension. The decision cube sets this value using its GetDimensionMemberCount method.


TCubeDim methods

TCubeDim	Alphabetically

In TCubeDim

DefineProperties

GetBinValues

IsBinData

Derived from TDimensionItem

IsDimension

IsSummary

Derived from TCollectionItem

Create

Destroy

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCubeDim methods

TCubeDim	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

DefineProperties

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetBinValues

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

IsBinData

IsDimension

IsSummary

MethodAddress

MethodName

NewInstance

SafeCallException


TCubeDim.DefineProperties

TCubeDim	See also

Designates methods for storing the dimension’s unpublished data on a stream such as a form file.

procedure DefineProperties(Filer: TFiler); override;

Description

Do not call DefineProperties. It is called automatically when forms or data modules containing the dimension’s decision cube component are loaded or saved.

DefineProperties allows the dimension to load and save information as if it were a set of published property values. TCubeDim uses this method to save some of its unpublished properties, including

an indication of whether the dimension is open or closed.

the public StartValue property.

DefineProperties also allows the dimension to read information that was previously saved in other formats so as to preserve backward compatibility.


TCubeDim.GetBinValues

TCubeDim	See also

Returns the set of values that are summarized by a single value along a dimension.

function GetBinValues(Value: Variant): Variant;

Description

Call GetBinValues to determine the actual values that underlie a single dimension member when the BinType property is not binNone. The Value parameter is the single dimension member that represents a date range or the single value of a paged dimension. The value of Value can be obtained by calling the GetMemberAsVariant method of the decision cube or decision source.

If the BinType property of the dimension is binYear, binQuarter, or binMonth, GetBinValues returns the starting and ending values of the range that includes the Value parameter. If the BinType property is binSet, GetBinValues returns the single drilled value of the dimension.


TCubeDim.IsBinData

TCubeDim	See also

Indicates whether the dimension includes a member for every field value.

function IsBinData: Boolean;

Description

Call IsBinData to determine if the dimension item represents a dimension of the decision cube that groups values into date ranges or represents a paged dimension. IsBinData returns True if the value of the BinType property is not binNone.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem

TDimensionItem


TCubeDims

Hierarchy	Properties	Methods	See also

TCubeDims is a collection of TCubeDim objects.

Unit

mxstore

Description

Use TCubeDims as the dimension map of a crosstabulated data store. Each TCubeDim object maintained by TCubeDims corresponds to a field from the data set of the crosstabulated data store. Each TCubeDim object can be used as either a dimension (a field over which data is summarized), or a summary (a value summarized over the dimensions).

TCubeDims introduces new properties to handle dimension maps that include date ranges.


TCubeDims properties

TCubeDims	Alphabetically	Legend

In TCubeDims

IsDirty

Items

Derived from TDimensionItems

ActiveDimensionCount

ActiveSummaryCount

DimensionCount

SummaryCount

Derived from TCollection

Count

ItemClass


TCubeDims properties

TCubeDims	By object	Legend

ActiveDimensionCount

ActiveSummaryCount

Count

DimensionCount

IsDirty

ItemClass

Items

SummaryCount


TCubeDims.IsDirty

TCubeDims	See also

Indicates that the fields that correspond to the TCubeDim objects in the Items array have changed.

property IsDirty: Boolean;

Description

Read IsDirty to determine whether the information cached by the decision cube is valid. When any of the properties of the TCubeDim objects in the Items array change, IsDirty becomes True. When the value of IsDirty is read, IsDirty is reset to False.


TCubeDims.Items

TCubeDims	See also

Lists all dimension items maintained by the TCubeDims object.

property Items[Index: Integer]:TCubeDim default;

Description

Use Items to access individual dimensions or summaries maintained by the TCubeDims object. The first TCubeDim object has an Index of 0, the second has an Index of 1, and so on.

Each TCubeDim object in the Items array represents a field from the data set of a decision cube. Each item represents either a dimension (a field over which data is summarized), or a summary (a value summarized over the dimensions).

Items is the default property of TCubeDims. This means that the name of the Items property can be eliminated from code that uses the Items property. Thus, the line

DecisionCube1.DimensionMap.Items[0].Active := False;

could be written

DecisionCube1.DimensionMap[0].Active := False;

Note:	Do not change the Items property. The set of items in the Items array is set automatically to represent the fields from the data set. The properties of individual TCubeDim objects within the Items array may be changed to specify whether they should be cached by the data store, the name to use when displaying them, and so on.


TCubeDims methods

TCubeDims	Alphabetically

Derived from TDimensionItems

Add

AddDerivedField

AlreadyExists

Assign

AverageFieldCheck

Create

Derived from TCollection

BeginUpdate

Clear

Destroy

EndUpdate

FindItemID

Insert

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCubeDims methods

TCubeDims	By object

Add

AddDerivedField

AfterConstruction

AlreadyExists

Assign

AverageFieldCheck

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

Dispatch

EndUpdate

FieldAddress

FindItemID

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection

TDimensionItems


TCustomDataNavigator

Hierarchy	Properties	Methods	See also

TCustomDataNavigator assembles the HTML generated by a set of TDataSetButton and TXMLButton descendants.

Unit

MidItems

Description

Use TCustomDataNavigator as a base class for Web items that generate the HTML to arrange a collection of button controls in a data form. Each TCustomDataNavigator object has an associated Web item that generates display controls in the form. The buttons arranged by the data navigator component manipulate the information these display controls show.

TCustomDataNavigator introduces properties that customize the appearance of the buttons it arranges.

Do not create instances of TCustomDataNavigator. TCustomDataNavigator is intended to act as a base class. Instead, instantiate a descendant class such as TDataNavigator.


TCustomDataNavigator properties

TCustomDataNavigator	Alphabetically	Legend

In TCustomDataNavigator

Custom

Style

StyleRule

Derived from TXMLDisplayReferenceGroup

XMLComponent

Derived from TWebControlGroup

WebFieldControls

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomDataNavigator properties

TCustomDataNavigator	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

WebFieldControls

XMLComponent


TCustomDataNavigator.Custom

TCustomDataNavigator	See also

Represents a tag option and its value in the generated TABLE tag.

property Custom: string;

Description

TCustomDataNavigator generates an HTML table to lay out the buttons listed in the WebFieldControls property. Use Custom to add options that qualify the TABLE tag. Each option and its value has the form

OPTIONNAME=Value

The options specified by Custom should be separated by spaces. For example, to add a border around the buttons and color the background blue, you can set Custom to

BORDER=2 BGCOLOR=BLUE


TCustomDataNavigator.Style

TCustomDataNavigator	See also

Adds style attributes to the generated HTML table.

property Style: string;

Description

TCustomDataNavigator generates an HTML table to lay out the buttons listed in the WebFieldControls property. Use Style to add a STYLE option that qualifies the TABLE tag. The Style option consists of one or more attribute descriptions such as

font-family: arial; font-weight: bold; font-size: 10px

These attributes are added to the generated TABLE tag as the value of a STYLE option.


TCustomDataNavigator.StyleRule

TCustomDataNavigator	See also

Applies a style in the page producer’s style sheet to the group of buttons.

property StyleRule: string;

Description

TCustomDataNavigator generates an HTML table to lay out the buttons listed in the WebFieldControls property. Use StyleRule to assign one of the user-defined styles in the HTML document’s style sheet to the generated table. The value of StyleRule specifies one of the user-defined style names defined in the MIDAS page producer’s Styles or StylesFile property.

Note:	To apply a style definition that is not included in the style sheet, use the Style property.


TCustomDataNavigator methods

TCustomDataNavigator	Alphabetically

Derived from TXMLDisplayReferenceGroup

Create

Destroy

Derived from TWebControlGroup

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomDataNavigator methods

TCustomDataNavigator	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebControlGroup

TXMLDisplayReferenceGroup


TCustomFieldGroup

Hierarchy	Properties	Methods	See also

TCustomFieldGroup is the base class for Web items that arrange information on an HTML form as a set of labeled fields.

Unit

MidItems

Description

Use TCustomFieldGroup as a base class for Web items that display information in labeled fields on an HTML form. Each TCustomFieldGroup object maintains a list of Web items that generate the individual display fields. These Web items are restricted to classes that are appropriate for the specific TCustomFieldGroup descendant.

If the controls generated for TCustomFieldGroup by its Web items represent database information, you can bind the field group to an XML data packet or dataset field within an XML data packet. The Web items can use that binding to determine the source of the data they display.

TCustomFieldGroup introduces a number of properties that affect the appearance of the generated set of fields.

In order to let other Web items use the HTML that the TCustomFieldGroup object generates, TCustomFieldGroup inherits the IWebContent interface from TWebControlGroup.

Do not create instances of TCustomFieldGroup. Instead, use a descendant of TCustomFieldGroup such as TFieldGroup or TQueryFieldGroup.


TCustomFieldGroup properties

TCustomFieldGroup	Alphabetically	Legend

In TCustomFieldGroup

Custom

Style

StyleRule

Derived from TXMLDisplayGroup

VisibleFields

XMLBroker

XMLDataSetField

Derived from TWebControlGroup

WebFieldControls

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomFieldGroup properties

TCustomFieldGroup	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

VisibleFields

WebFieldControls

XMLBroker

XMLDataSetField


TCustomFieldGroup.Custom

TCustomFieldGroup	See also

Represents a tag option and its value in the generated TABLE tag.

property Custom: string;

Description

TCustomFieldGroup generates an HTML table to manage the layout of the HTML controls that its Web items generate. Use Custom to add options that qualify the TABLE tag. Each option and its value has the form

OPTIONNAME=Value

The options specified by Custom should be separated by spaces. For example, to surround the set of fields with a border and give them a blue background, set Custom to

BORDER=2 BGCOLOR=BLUE


TCustomFieldGroup.Style

TCustomFieldGroup	See also

Adds style attributes to the generated set of fields.

property Style: string;

Description

TCustomFieldGroup generates an HTML table to lay out the fields that its Web items generate. Use Style to add a STYLE option that qualifies the TABLE tag. The Style option consists of one or more attribute descriptions such as

font-family: arial; font-weight: bold; font-size: 10px

These attributes are added to the generated TABLE tag as the value of a STYLE option.


TCustomFieldGroup.StyleRule

TCustomFieldGroup	See also

Applies a style in the page producer’s style sheet to the table.

property StyleRule: string;

Description

Use StyleRule to assign one of the user-defined styles in the HTML document’s style sheet to the generated set of fields. The value of StyleRule specifies one of the user-defined style names defined in the MIDAS page producer’s Styles or StylesFile property.

Note:	To apply a style definition that is not included in the style sheet, use the Style property.


TCustomFieldGroup methods

TCustomFieldGroup	Alphabetically

In TCustomFieldGroup

Create

Destroy

Derived from TWebControlGroup

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomFieldGroup methods

TCustomFieldGroup	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TCustomFieldGroup.Create

TCustomFieldGroup	See also

Creates and initializes an instance of TCustomFieldGroup.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TCustomFieldGroup at runtime. TCustomFieldGroup components added at design time using the Web Page editor are instantiated automatically.


TCustomFieldGroup.Destroy

TCustomFieldGroup	See also

Frees an instance of TCustomFieldGroup.

Description

Do not call Destroy directly. Instead, call Free, which checks whether the object reference is not nil before calling Destroy.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebControlGroup

TXMLDisplayGroup


TCustomLayoutGroup

Hierarchy	Properties	Methods	See also

TCustomLayoutGroup is the base class for Web items that arrange content produced by arbitrary Web items.

Unit

MidItems

Description

Use TCustomLayoutGroup as a base class for Web items that are used purely for layout. There are few restrictions on what Web items can use a layout group because it has no special content that it displays. It merely imposes a layout on content generated by other Web items.

TCustomLayoutGroup maintains a list of Web items that display information in the final HTML document, but imposes no restrictions of its own on the possible types of Web items. Instead, it restricts those Web items to the classes that its parent allows. In order to let the parent component use the HTML that TCustomLayoutGroup generates, TCustomLayoutGroup inherits the IWebContent interface from TWebControlGroup.

Do not create instances of TCustomLayoutGroup. Instead, use a descendant of TCustomLayoutGroup such as TLayoutGroup.


TCustomLayoutGroup properties

TCustomLayoutGroup	Alphabetically	Legend

In TCustomLayoutGroup

Custom

DisplayColumns

Style

StyleRule

Derived from TWebControlGroup

WebFieldControls

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomLayoutGroup properties

TCustomLayoutGroup	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

DisplayColumns

Name

Owner

Style

StyleRule

Tag

VCLComObject

WebFieldControls


TCustomLayoutGroup.Custom

TCustomLayoutGroup	See also

Represents a tag option and its value in the generated TABLE tag.

property Custom: string;

Description

TCustomLayoutGroup generates an HTML table to lay out the controls generated by the Web items in its WebFieldControls property. Use Custom to add options that qualify the TABLE tag. Each option and its value has the form

OPTIONNAME=Value

The options specified by Custom should be separated by spaces. For example, to add a border around the group of controls and color the background blue, you can set Custom to

BORDER=2 BGCOLOR=BLUE


TCustomLayoutGroup.DisplayColumns

TCustomLayoutGroup	See also

Specifies the number of columns the layout group uses to lay out its child controls.

property DisplayColumns: Integer;

Description

TCustomLayoutGroup generates an HTML table to lay out the controls generated by the Web items in its WebFieldControls property. It adds the HTML generated by each Web item listed in WebFieldControls to a cell of the table, filling the cells out row by row until it displays all the Web items. DisplayColumns determines the number of cells in each row.


TCustomLayoutGroup.Style

TCustomLayoutGroup	See also

Adds style attributes to the generated HTML table.

property Style: string;

Description

TCustomLayoutGroup generates an HTML table to lay out the controls generated by the Web items in WebFieldControls. Use Style to add a STYLE option that qualifies the TABLE tag. The Style option consists of one or more attribute descriptions such as

font-family: arial; font-weight: bold; font-size: 10px

These attributes are added to the generated TABLE tag as the value of a STYLE option.


TCustomLayoutGroup.StyleRule

TCustomLayoutGroup	See also

Applies a style in the page producer’s style sheet to the group of buttons.

property StyleRule: string;

Description

TCustomLayoutGroup generates an HTML table to lay out the controls generated by its Web items. Use StyleRule to assign one of the user-defined styles in the HTML document’s style sheet to the generated table. The value of StyleRule specifies one of the user-defined style names defined in the MIDAS page producer’s Styles or StylesFile property.

Note:	To apply a style definition that is not included in the style sheet, use the Style property.


TCustomLayoutGroup methods

TCustomLayoutGroup	Alphabetically

In TCustomLayoutGroup

Create

Destroy

Derived from TWebControlGroup

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomLayoutGroup methods

TCustomLayoutGroup	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TCustomLayoutGroup.Create

TCustomLayoutGroup	See also

Creates and initializes an instance of TCustomLayoutGroup.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TCustomLayoutGroup at runtime. TCustomLayoutGroup components added at design time using the Web Page editor are instantiated automatically.


TCustomLayoutGroup.Destroy

TCustomLayoutGroup	See also

Frees an instance of TCustomLayoutGroup.

Description

Do not call Destroy directly. Instead, call Free, which checks whether the layout group is nil before calling Destroy.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebControlGroup


TCustomProvider

Hierarchy	Properties 	Methods 	Events	See also

TCustomProvider is the base class for data providers.

Unit

provider

Description

Use TCustomProvider to derive customized data provider objects for application servers in a multi-tiered database application. TCustomProvider defines the fundamental properties, methods, and events required of all provider objects, either through abstract method declarations or through virtual methods that do nothing but provide a backstop.

A provider derived from TCustomProvider is an intermediate link between a TClientDataSet object on the client, and data available on the application server. It packages data from the server and passes it in one or more transportable data packets to the client dataset. The client dataset receives the data packets and reconstructs the data to create a local, in-memory copy for user access. When user access is complete, the client dataset repackages any changed data and sends the updates to the provider on the application server. The provider applies the updates to the remote database server.

Client applications communicate with providers through the IAppServer interface. To enable the remote data module, which implements IAppServer, to pass calls to the provider, the provider’s Exported property must be True, and its Owner property must specify the remote data module.

Do not create instances of TCustomProvider. To add a provider component to a form or data module, use a descendant of TCustomProvider such as TDataSetProvider.


TCustomProvider properties

TCustomProvider	Alphabetically	Legend

In TCustomProvider

Data

Exported

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomProvider properties

TCustomProvider	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Data

DesignInfo

Exported

Name

Owner

Tag

VCLComObject


TCustomProvider.Data

TCustomProvider	See also	Example

Denotes a data packet created by the provider.

property Data: OleVariant;

Description

Data is a read-only property that is provides access to a data packet containing all records. Reading Data calls GetRecords with a parameter of -1.

As implemented in TCustomProvider, GetRecords returns NULL. Descendants of TCustomProvider reimplement the GetRecords method to implement the Data property.


TCustomProvider.Exported

TCustomProvider 	See also

Allows client applications to pass calls to the provider.

property Exported: Boolean;

Description

Use Exported to indicate whether the provider is made available to clients by the remote data module that owns it. When Exported is True, client applications can specify the provider as a target for calls made using the IAppServer interface. When Exported is False, IAppServer calls that specify the provider cause an exception.

Note:	In addition to the Exported property, the provider must be registered with the remote data module for clients to access it using the data module’s IAppServer interface. When the provider’s Owner is the remote data module, it is automatically registered. If the provider has a different owner, the server application must explicitly register providers using the remote data module’s RegisterProvider method.


TCustomProvider events

TCustomProvider	Alphabetically

In TCustomProvider

AfterApplyUpdates

AfterExecute

AfterGetParams

AfterGetRecords

AfterRowRequest

BeforeApplyUpdates

BeforeExecute

BeforeGetParams

BeforeGetRecords

BeforeRowRequest

OnDataRequest


TCustomProvider events

TCustomProvider	By object

AfterApplyUpdates

AfterExecute

AfterGetParams

AfterGetRecords

AfterRowRequest

BeforeApplyUpdates

BeforeExecute

BeforeGetParams

BeforeGetRecords

BeforeRowRequest

OnDataRequest


TCustomProvider.AfterApplyUpdates

TCustomProvider	See also

Occurs after the provider applies updates to a dataset or database.

property AfterApplyUpdates: TRemoteEvent;

Description

Write an AfterApplyUpdates event handler to return custom information to the client dataset after applying updates. AfterApplyUpdates is part of the mechanism by which a client dataset and a provider communicate information about updates. When the provider is part of a stateless application server, this mechanism allows the provider and the client dataset to communicate persistent state information.

When the client application calls the remote data module’s AS_ApplyUpdates method, the following events occur:

1.	The provider receives a BeforeApplyUpdates event, where it can respond to or change custom information that the client application sends.

2.	The provider receives an OnUpdateData event where it can edit the updates before they are applied.

3. The provider applies the updates, and attempts to resolve problems.

4.	The provider receives an AfterApplyUpdates event, where it can encode custom information into its OwnerData parameter or respond to information from the BeforeApplyUpdates event handler.

5.	The client dataset receives an AfterApplyUpdates event, where it can respond to the custom information returned by the provider in its AfterApplyUpdates event handler.

Note:	If ApplyUpdates is called without the OwnerData parameter, on entry to the event handler the OwnerData parameter contains the value set in the BeforeApplyUpdates event handler and it is ignored on exit from the AfterApplyUpdates event handler.


TCustomProvider.AfterExecute

TCustomProvider	See also

Occurs after the provider passes an execute command to its dataset.

property AfterExecute: TRemoteEvent;

Description

Write an AfterExecute event handler to return custom information to the client dataset after executing a query or stored procedure. AfterExecute is part of the mechanism by which a client dataset and a provider communicate information when generating the content of the provider’s dataset. When the provider is part of a stateless application server, this mechanism allows the provider and the client dataset to communicate persistent state information.

When the client application calls the remote data module’s AS_Execute method, the following events occur:

1.	The provider receives a BeforeExecute event, where it can respond to or change custom information that the client application sends.

2.	The provider dispatches its Execute method to generate the content of its dataset.

3.	The provider receives an AfterExecute event, where it can encode custom information into its OwnerData parameter or respond to information from the BeforeExecute event handler. This information is returned to the client dataset.


TCustomProvider.AfterGetParams

TCustomProvider	See also

Occurs after the provider creates an OleVariant containing parameter values to send to the client dataset.

property AfterGetParams: TRemoteEvent;

Description

Write an AfterGetParams event handler to send custom information to the client dataset when returning parameters from the provider’s dataset. AfterGetParams is part of the mechanism by which a provider and a client dataset communicate information about parameter values. When the provider is part of a stateless application server, this mechanism allows the provider and the client dataset to communicate persistent state information.

When the client application calls the remote data module’s AS_GetParams method, the following events occur:

1.	The provider receives a BeforeGetParams event, where it can respond to or change custom information that the client application sends.

2.	The provider looks up the parameter values, if appropriate, and encodes them in an OleVariant.

3.	The provider receives an AfterGetParams event, where it can encode custom information into its OwnerData parameter or respond to information from the BeforeGetParams event handler.

4.	The client dataset receives an AfterGetParams event, where it can respond to the custom information returned by the provider in its AfterGetParams event handler.


TCustomProvider.AfterGetRecords

TCustomProvider	See also

Occurs after the provider creates a data packet to send to the client dataset.

property AfterGetRecords: TRemoteEvent;

Description

Write an AfterGetRecords event handler to send custom information to the client dataset when providing a data packet. AfterGetRecords is part of the mechanism by which a provider and a client dataset communicate information about data fetching. When the provider is part of a stateless application server, this mechanism allows the provider and the client dataset to communicate persistent state information.

When the client application calls the remote data module’s AS_GetRecords method, the following events occur:

1.	The provider receives a BeforeGetRecords event, where it can respond to or change custom information that the client application sends.

2.	The provider receives an OnGetData event where it can edit the data before creating a data packet, and then generates the data packet.

3.	The provider receives an AfterGetRecords event, where it can encode custom information into its OwnerData parameter or respond to information from the BeforeGetRecords event handler.

4.	The client dataset receives an AfterGetRecords event, where it can respond to the custom information returned by the provider in its AfterGetRecords event handler.


TCustomProvider.AfterRowRequest

TCustomProvider	See also

Occurs after the provider fetches new information about the current record.

property AfterRowRequest: TRemoteEvent;

Description

Write an AfterRowRequest event handler to send custom information to the client dataset along with information about the current record. AfterRowRequest is part of the mechanism by which a provider and a client dataset communicate information about data fetching. When the provider is part of a stateless application server, this mechanism allows the provider and the client dataset to communicate persistent state information.

When the client application calls the remote data module’s AS_RowRequest method, the following events occur:

1.	The provider receives a BeforeRowRequest event, where it can respond to or change custom information that the client application sends.

2.	The provider creates a delta packet that contains the requested information.

3.	The provider receives an AfterRowRequest event, where it can encode custom information into its OwnerData parameter or respond to information from the BeforeRowRequest event handler.

4.	The client dataset receives an AfterRowRequest event, where it can respond to the custom information returned by the provider in its AfterRowRequest event handler.


TCustomProvider.BeforeApplyUpdates

TCustomProvider	See also

Occurs before the provider applies updates from the client application.

property BeforeApplyUpdates: TRemoteEvent;

Description

Write a BeforeApplyUpdates event handler to respond to custom information from the client dataset. BeforeApplyUpdates is part of the mechanism by which a provider and a client dataset communicate information about updates. When the provider is part of a stateless application server, this mechanism allows the provider and the client dataset to communicate persistent state information.

When the client application calls the client dataset’s ApplyUpdates method, the following events occur:

1.	The client dataset receives a BeforeApplyUpdates event, where it can encode custom information into an OleVariant that is passed to the application server as the OwnerData parameter.

2.	The provider on the application server receives a BeforeApplyUpdates event, where it can respond to or change that information before the provider applies the updates.

3.	The provider applies the updates, and receives an OnUpdateError event for any problem records.

4.	The provider receives an AfterApplyUpdates event, where it can encode custom information into its OwnerData parameter or respond to information from the BeforeApplyUpdates event handler.

5.	The client dataset receives an AfterApplyUpdates event, where it can respond to the custom information returned by the provider in its AfterApplyUpdates event handler.

Note:	If ApplyUpdates is called without the OwnerData parameter, the OwnerData parameter is nil on entry to the event handler and its value (on exit) is only passed to the AfterApplyUpdates event handler but not returned to the caller.


TCustomProvider.BeforeExecute

TCustomProvider	See also

Occurs before the provider passes an execute command to its dataset.

property AfterExecute: TRemoteEvent;

Description

Write a BeforeExecute event handler to respond to custom information from the client dataset before executing a query or stored procedure. Any parameter values supplied by the client application with the Execute command are applied before this event.

BeforeExecute is part of the mechanism by which a provider and a client dataset communicate information when generating the content of the provider’s dataset. When the provider is part of a stateless application server, this mechanism allows the provider and the client dataset to communicate persistent state information.

When the client application calls the remote data module’s AS_Execute method, the following events occur:

1.	The provider receives a BeforeExecute event, where it can respond to or change custom information that the client application sends.

2.	The provider dispatches its Execute method to generate the content of its dataset.

3.	The provider receives an AfterExecute event, where it can encode custom information into its OwnerData parameter or respond to information from the BeforeExecute event handler. This information is returned to the client dataset.


TCustomProvider.BeforeGetParams

TCustomProvider	See also

Occurs before the provider creates an OleVariant that encodes the current parameter values and sends it to a client dataset.

property BeforeGetParams: TRemoteEvent;

Description

Write a BeforeGetParams event handler to respond to custom information from a client dataset. BeforeGetParams is part of the mechanism by which a provider and a client dataset communicate information during parameter fetching. When the provider is part of a stateless application server, this mechanism allows the provider and the client dataset to communicate persistent state information.

When the client dataset fetches parameter values from the application server, the following events occur:

1.	The client dataset receives a BeforeGetParams event, where it can encode custom information into an OleVariant that is passed to the application server as the OwnerData parameter.

2.	The provider on the application server receives a BeforeGetParams event, where it can respond to or change that information before the provider fetches and encodes the parameter values.

3.	The provider generates an OleVariant for the current parameter values of its dataset, if appropriate.

4.	The provider receives an AfterGetParams event, where it can encode custom information into its OwnerData parameter or respond to information from the BeforeGetParams event handler.

5.	The client dataset receives an AfterGetParams event, where it can respond to the custom information returned by the provider in its AfterGetParams event handler.


TCustomProvider.BeforeGetRecords

TCustomProvider	See also

Occurs before the provider creates a data packet and sends it to a client dataset.

property BeforeGetRecords: TRemoteEvent;

Description

Write a BeforeGetRecords event handler to respond to custom information from a client dataset. BeforeGetRecords is part of the mechanism by which a provider and a client dataset communicate information about data fetching. When the provider is part of a stateless application server, this mechanism allows the provider and the client dataset to communicate persistent state information.

When the client dataset fetches data from the application server, the following events occur:

1.	The client dataset receives a BeforeGetRecords event, where it can encode custom information into an OleVariant that is passed to the application server as the OwnerData parameter.

2.	The provider on the application server receives a BeforeGetRecords event, where it can respond to or change that information before the provider creates a data packet.

3.	The provider generates the data packet.

4.	The provider receives an AfterGetRecords event, where it can encode custom information into its OwnerData parameter or respond to information from the BeforeGetRecords event handler.

5.	The client dataset receives an AfterGetRecords event, where it can respond to the custom information returned by the provider in its AfterGetRecords event handler.


TCustomProvider.BeforeRowRequest

TCustomProvider	See also

Occurs before the provider creates a delta packet with information about the current record.

property BeforeRowRequest: TRemoteEvent;

Description

Write a BeforeRowRequest event handler to respond to custom information from the client dataset. BeforeRowRequest is part of the mechanism by which a provider and a client dataset communicate information about data fetching. When the provider is part of a stateless application server, this mechanism allows the provider and the client dataset to communicate persistent state information.

When the client dataset fetches detail information about the current record or refreshes the current record, the following events occur:

1.	The client dataset receives a BeforeRowRequest event, where it can encode custom information into an OleVariant that is passed to the application server as the OwnerData parameter.

2.	The provider on the application server receives a BeforeRowRequest event, where it can respond to or change that information before the provider looks up the requested information.

3.	The provider creates a delta packet that contains the requested information.

4.	The provider receives an AfterRowRequest event, where it can encode custom information into its OwnerData parameter or respond to information from the BeforeRowRequest event handler.

5.	The client dataset receives an AfterRowRequest event, where it can respond to the custom information returned by the provider in its AfterRowRequest event handler.


TCustomProvider.OnDataRequest

TCustomProvider	See also 	Example

Occurs when a provider calls its DataRequest method.

type

  TDataRequestEvent = function(Sender: TObject; Input : OleVariant) : OleVariant of object;

property OnDataRequest: TDataRequestEvent;

Declaration

Write an OnDataRequest event handler to do custom processing of data. OnDataRequest has no built-in use. Instead, it allows developers to augment the IProvider interface so that clients can communicate directly with an individual provider.

If an application does not provide an OnDataRequest event handler, calls to DataRequest return NULL.

Note:	To provide the same sort of custom processing on the client side, use an automation method on the connection component.


TCustomProvider methods

TCustomProvider	Alphabetically	Legend

In TCustomProvider

ApplyUpdates

Create

DataRequest

Destroy

DoBeforeExecute

DoBeforeGetRecords

Execute

GetParams

GetRecords

InternalApplyUpdates

InternalExecute

InternalGetParams

InternalGetRecords

InternalRowRequest

RowRequest

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomProvider methods

TCustomProvider	By object	Legend

AfterConstruction

ApplyUpdates

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DataRequest

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DoBeforeExecute

DoBeforeGetRecords

Execute

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParams

GetParentComponent

GetRecords

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

InternalApplyUpdates

InternalExecute

InternalGetParams

InternalGetRecords

InternalRowRequest

MethodAddress

MethodName

NewInstance

RemoveComponent

RowRequest

SafeCallException

UpdateAction


TCustomProvider.ApplyUpdates

TCustomProvider	See also

Applies updates received from a client dataset.

function ApplyUpdates(const Delta: OleVariant; MaxErrors: Integer; out ErrorCount: Integer); OleVariant; overload;

function ApplyUpdates(const Delta: OleVariant; MaxErrors: Integer; out ErrorCount: Integer; var OwnerData:OleVariant); OleVariant; overload;

Description

Call ApplyUpdates to apply updates contained in a delta packet. ApplyUpdates generates a BeforeApplyUpdates event, applies the updates, and then generates an AfterApplyUpdates event.

Specify the delta packet as the Delta parameter.

Use the MaxErrors parameter to indicate the maximum number of errors that can be applied before stopping the update operation. If MaxErrors is –1, the provider tries to apply all updates.

ErrorCount returns the number of errors encountered during the update operation.

The OwnerData parameter (if used) supplies custom information from the client that is passed to the BeforeApplyUpdates event handler and which returns any information supplied by that event handler.

ApplyUpdates returns a data packet of updates that could not be applied to the database as an OleVariant.

Note:	ApplyUpdates always generates the BeforeApplyUpdates and AfterApplyUpdates events, even if you use the syntax that does not include an OwnerData parameter. In that case, the value of OwnerData is nil on entry to the BeforeApplyUpdates event handler and is discarded on exit from the AfterApplyUpdates event handler.

Warning:	The provider can’t detect when an update conflicts with another user’s changes to a memo field. This situation will not contribute to the errors counted by ErrorCount.


TCustomProvider.Create

TCustomProvider	See also

Creates a new TCustomProvider object.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a provider at runtime. Providers placed in forms or data modules at design time are created automatically.

The constructor assigns the AOwner parameter as the owner of the provider. This owner is responsible for freeing the provider when it is destroyed. If the owner is a remote data module, the constructor registers the provider with that remote data module so that it is available to client applications that use the IAppServer interface.


TCustomProvider.DataRequest

TCustomProvider	See also 	Example

Generates an OnDataRequest event.

function DataRequest(Input: OleVariant): OleVariant; virtual;

Description

Write an OnDataRequest event handler and call the DataRequest function to invoke the event handler at runtime. This function and the event it invokes enable an application to perform custom processing in response to a request for data.

Note:	Client applications can call DataRequest using the client dataset’s DataRequest method.


TCustomProvider.Destroy

TCustomProvider	See also

Frees an instance of a provider object.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead, call Free, which checks that the provider is not nil before calling its Destroy method. Destroy unregisters the provider from the remote data module if the remote data module is listed as the provider’s Owner.


TCustomProvider.DoBeforeExecute

TCustomProvider	See also

Generates a BeforeExecute event.

procedure DoBeforeExecute(const CommandText: WideString, var Params, OwnerData: OleVariant); virtual;

Description

The Execute method calls DoBeforeExecute to generate the BeforeExecute event before it executes CommandText or executes an associated query or stored procedure.

CommandText specifies an optional SQL statement that replaces the SQL of an associated query, or the name of a stored procedure that replaces the associated stored procedure. This parameter is ignored if the Options property does not include poAllowCommandText.

Params contains any parameter values that should be applied to CommandText or to the query or stored procedure before execution.

OwnerData supplies custom information to the BeforeExecute event handler. The event handler can change this value. The returned value is then passed to an AfterExecute event handler and then returned to the caller of the Execute method.

As implemented in TCustomProvider, CommandText and Params are ignored. Descendant classes apply these values before generating the BeforeExecute event.


TCustomProvider.DoBeforeGetRecords

TCustomProvider	See also

Generates a BeforeGetRecords event.

procedure DoBeforeGetRecords(Count: Integer; Options: Integer; const CommandText: WideString; var Params, OwnerData: OleVariant); virtual;

Description

The GetRecords method calls DoBeforeGetRecords to generate the BeforeGetRecords event before it fetches data and assembles it into a data packet.

Count is the number of records requested. If Count is –1, all records are requested.

Options indicates whether the data packet should include metadata, whether it should start with the first record, and whether the data packet should be encoded in XML. For details, see the GetRecords method.

CommandText specifies an optional SQL statement that replaces the SQL of an associated query, or the name of a table or stored procedure that replaces the associated table or stored procedure. This parameter is ignored if the Options property does not include poAllowCommandText.

Params contains any parameter values that should be applied to CommandText or to a query or stored procedure before fetching data into a data packet.

OwnerData supplies custom information to the BeforeGetRecords event handler. The event handler can change this value. The returned value is then passed to an AfterGetRecords event handler and then (optionally) returned to the caller of the GetRecords method.

As implemented in TCustomProvider, Count, Options, CommandText, and Params are ignored. Descendant classes can apply these values before generating the BeforeExecute event.


TCustomProvider.Execute

TCustomProvider	See also

Executes a query, stored procedure, or custom SQL statement.

procedure Execute(const CommandText: WideString, var Params, OwnerData: OleVariant);

Description

Client applications call Execute through the remote data module’s AS_Execute method. In response, the provider executes an SQL command. If the provider represents a query or stored procedure, calling Execute causes the provider to execute the query or stored procedure. If the caller supplies a value for CommandText, Execute may execute that statement instead (see below).

Before executing the appropriate command, Execute generates a BeforeExecute event. After executing the command, it generates an AfterExecute event. Finally, it returns any output parameters as the value of the Params parameter.

CommandText is a client-supplied SQL statement that replaces the SQL of an associated query, or the name of a table or stored procedure that replaces the associated table or stored procedure. This parameter is ignored if the Options property does not include poAllowCommandText.

On entry, Params supplies parameter values for the query, stored procedure, or CommandText string. On exit, Params returns any output parameters.

OwnerData contains custom information passed to the provider from the client dataset’s Execute method. This information is passed in to the provider’s BeforeExecute event handler and is returned by the provider’s AfterExecute event handler.


TCustomProvider.GetParams

TCustomProvider	See also

Returns the current parameter values.

function GetParams(var OwnerData: OleVariant); OleVariant;

Description

GetParams returns a variant array of variant arrays that contains the current parameter values for the provider’s data source. The first array dimension is an index into all the parameter values. Its value runs from 0 to one less than the number of parameters. The second array dimension has four values: The parameter name (a string), the parameter data type (a TFieldType), the parameter type (a TParamType), and the parameter value (a Variant). The values in this array can be applied to a TParams object using the global UnpackParams procedure.

Before fetching the current parameter values, GetParams generates a BeforeGetParams event, passing the value supplied as the OwnerData parameter to the event handler. After creating the OleVariant that contains the parameter values, GetParams generates an AfterGetParams event, passing in the current value of OwnerData. Finally, the value of OwnerData returned by the AfterGetParams is returned in the OwnerData parameter.


TCustomProvider.GetRecords

TCustomProvider	See also

Retrieves a data packet that represents a provider’s associated data.

function GetRecords(Count: Integer; out RecsOut: Integer; Options: Integer); OleVariant; overload;

function GetRecords(Count: Integer; out RecsOut: Integer; Options: Integer; const CommandText: WideString; var Params, OwnerData: OleVariant); OleVariant; overload;

Description

Call GetRecords to retrieve a data packet containing a specified number of records. GetRecords generates a BeforeGetRecords event, assembles a data packet, and then generates an AfterGetRecords event.

Count indicates the number of records to retrieve. If Count is -1, all records are retrieved. If Count is 0, only metadata is retrieved. If Count is greater than 0, only the specified number of records are retrieved.

RecsOut returns the actual number of records retrieved.

Options indicates what information should be added to the data packet in addition to data. It is an integer version of the TGetRecordOptions type. (An integer because the value must be compatible with a COM interface). To convert the TGetRecordOptions value to the appropriate integer, use the Ord function. For example:

Ord(grMetaData) + Ord(grXML)

CommandText specifies an optional SQL statement that replaces the SQL of an associated query, or the name of a table or stored procedure that replaces the associated table or stored procedure. This parameter is ignored if the Options property does not include poAllowCommandText.

Params specifies any parameter values that should be applied to CommandText or to an associated query or stored procedure. If the provider is associated with a table, Params specifies field values that filter the result set. On exit from GetRecords, Params returns any output parameters.

OwnerData contains custom information that is supplied by a client dataset’s BeforeGetRecords event handler. This information is passed to the provider’s BeforeGetRecords event handler and is returned by the provider’s AfterGetRecords event handler.

Records are returned as a data packet in a Variant.

Note:	GetRecords always generates the BeforeGetRecords and AfterGetRecords events, even if you use the syntax that does not include an OwnerData parameter. In that case, the value of OwnerData is nil on entry to the BeforeGetRecords event handler and is discarded on exit from the AfterGetRecords event handler.

Warning:	If the provider is part of a stateless application server, there is no guarantee that the provider will be positioned on the desired record before it creates a data packet. Use a BeforeGetRecords event handler to position the cursor before the call to GetRecords.


TCustomProvider.InternalApplyUpdates

TCustomProvider	See also

Provides the underlying implementation of the ApplyUpdates method.

function InternalApplyUpdates(const Delta: OleVariant; MaxErrors: Integer; out ErrorCount: Integer): OleVariant; virtual; abstract;

Description

The ApplyUpdates method calls InternalApplyUpdates to apply the updates contained in a delta packet after generating the BeforeApplyUpdates event and before generating the AfterApplyUpdates event. The InternalApplyUpdates method of TCustomProvider is abstract, meaning that it has no implementation. Descendant classes override this method to apply updates, resolve update errors, and return any updates that could not be applied.

Delta is the delta packet containing insertions, deletions, and modifications to be applied.

MaxErrors indicates the maximum number of errors that can be applied before stopping the update operation. If MaxErrors is –1, the provider tries to apply all updates.

ErrorCount returns the number of errors encountered during the update operation.

InternalApplyUpdates returns a data packet of updates that could not be applied to the database as an OleVariant.


TCustomProvider.InternalExecute

TCustomProvider	See also

Provides the underlying implementation of the Execute method.

procedure InternalExecute(const CommandText: WideString, var Params: OleVariant); virtual;

Description

The Execute method calls InternalExecute to execute the appropriate SQL statement after calling DoBeforeExecute to generate a BeforeExecute event and apply the CommandText and Params. As Implemented in TCustomProvider, InternalExecute does nothing. Descendants override this method to pass the execute command on to an associated dataset.

CommandText is a client-supplied SQL statement that replaces the SQL of an associated query, or the name of a stored procedure that replaces the associated stored procedure. This parameter is ignored if the Options property does not include poAllowCommandText.

On entry, Params supplies parameter values for the query, stored procedure, or CommandText string. On exit, Params returns any output parameters.


TCustomProvider.InternalGetParams

TCustomProvider	See also

Returns the requested parameter values as a Variant array.

function InternalGetParams(Types: TParamTypes = AllParamTypes): OleVariant; virtual;

Description

TCustomProvider uses InternalGetParams internally whenever it needs to assemble the current parameter values into an OleVariant. This provides the underlying implementation of the GetParams method, as well as assembling parameter values for methods that return output parameters (such as Execute or GetRecords).

The Types parameter limits the parameter values that are returned to a subset of all possible parameter types. If this parameter is omitted, all parameter values are returned.

As implemented in TCustomProvider, InternalGetParams always returns NULL. Descendants override this method to return the requested parameter values.


TCustomProvider.InternalGetRecords

TCustomProvider	See also

Provides the underlying implementation of the GetRecords method.

function InternalGetRecords(Count: Integer; out RecsOut: Integer; Options: TGetRecordOptions; const CommandText: WideString; var Params: OleVariant); OleVariant; virtual;

Description

The GetRecords method calls InternalGetRecords to assemble a data packet after calling DoBeforeGetRecords to apply the CommandText and Params and generate a BeforeGetRecords event. As implemented in TCustomProvider, InternalGetRecords always returns NULL. Descendant classes override this method to fetch the requested records and assemble them into a data packet.

Count indicates the number of records to retrieve. If Count is -1, all records are retrieved. If Count is 0, only metadata is retrieved. If Count is greater than 0, only the specified number of records are retrieved.

RecsOut returns the actual number of records retrieved.

Options indicates what information should be added to the data packet in addition to data. It can include grMetaData (include metadata), grReset (start providing records with the first one in the dataset), and grXML (encode the datapacket in XML rather than as an OleVariant).

CommandText specifies an optional SQL statement that replaces the SQL of an associated query, or the name of a table or stored procedure that replaces the associated table or stored procedure. This parameter is ignored if the Options property does not include poAllowCommandText.

Params specifies any parameter values that should be applied to CommandText or to an associated query or stored procedure. If the provider is associated with a table, Params specifies field values that filter the result set. On exit from GetRecords, Params returns any output parameters.

Records are returned as a data packet in a Variant.


TCustomProvider.InternalRowRequest

TCustomProvider	See also

Provides the underlying implementation of the RowRequest method.

function InternalRowRequest(const Row: OleVariant; RequestType: TFetchOptions): OleVariant; virtual;

Description

The RowRequest method calls InternalRowRequest to assemble the specified information after generating a BeforeRowRequest event and before generating an AfterRowRequest event. As implemented in TCustomProvider, InternalRowRequest does nothing. Descendant classes override this method to assemble the requested information into an OleVariant.

The Row parameter is an OleVariant that describes the current record on the client dataset. It enables the provider to locate the record of interest.

The RequestType parameter indicates the type of information required.

InternalRowRequest returns the requested information in a delta packet.


TCustomProvider.RowRequest

TCustomProvider	See also

Returns information from a specified record.

function RowRequest(const Row: OleVariant; RequestType: Integer; var OwnerData: OleVariant): OleVariant;

Description

RowRequest is called automatically in response to the client dataset’s FetchBlobs, FetchDetails, or RefreshRecord method. It generates a BeforeRowRequest event, assembles the requested information, and generates an AfterRowRequest event.

The Row parameter is an OleVariant that describes the current record on the client dataset. It enables the provider to locate the record of interest.

The RequestType parameter indicates the type of information required. It is an integer version of the TFetchOptions type. (An integer because the value must be compatible with a COM interface). To convert the TFetchOptions value to the appropriate integer, use the Ord function. For example:

Ord(foBlobs) + Ord(foDetails);

RowRequest returns the requested information in a delta packet.

As implemented in TCustomProvider, RowRequest always returns NULL. Descendant classes override this method to return the requested data.


Scope

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent


TCustomQueryForm

Hierarchy	Properties	Methods	See also

TCustomQueryForm is the base class for Web items that generate HTML forms for letting users enter application-defined values.

Unit

MidItems

Description

Use TCustomQueryForm as a base class for components that generate an HTML form that displays application-defined values and submits them to a MIDAS Web application. TCustomQueryForm introduces properties for specifying the method and target URL of messages submitted by the form.

When building an HTML form, TCustomQueryForm makes use of content generated by the components listed in its WebComponents property. These components can include Web items that display application-defined values (TQueryFieldGroup) or that generate buttons to operate on those values (TQueryButtons). They can also include components that manage the layout of other HTML controls (TLayoutGroup).

In order to let a MIDAS page producer use the generated HTML query form, TCustomQueryForm inherits support for the IWebContent interface from TWebForm.

Do not create instances of TCustomQueryForm. Instead, create descendants of TCustomQueryForm, such as TQueryForm.


TCustomQueryForm properties

TCustomQueryForm	Alphabetically	Legend

In TCustomQueryForm

Action

Method

Derived from TWebForm

Custom

Style

StyleRule

WebComponents

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomQueryForm properties

TCustomQueryForm	By object	Legend

Action

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Method

Name

Owner

Style

StyleRule

Tag

VCLComObject

WebComponents


TCustomQueryForm.Action

TCustomQueryForm	See also

Specifies the path info portion of the URL to which the query submits request messages.

property Action: string;

Description

Use Action to specify the target URL for messages that the query form submits. Action supplies the PathInfo property of Web request messages from the query form. This value is matched to the PathInfo property of a Web action item when determining what object responds to those messages.


TCustomQueryForm.Method

TCustomQueryForm	See also

Specifies the METHOD header of messages that the query form submits.

type TFormMethod = (fmPost, fmGet);

property Method: TFormMethod;

Description

Set Method to specify the METHOD header for messages that the query form submits. This value gives rise to the MethodType property of the HTTP request message. By matching this to the MethodType property of Web action items, a Web dispatcher determines what objects handle these messages.

The following table describes the possible values:

Value	Corresponding MethodType	Meaning

fmPost	mtPost	The query submits messages that post displayed values to the Web application. Named value pairs are passed as content fields of the HTTP message. (See ContentFields)
The Web application determines the meaning and use of these values. A typical use is supplying parameter values that the Web application passes on to an application server.

fmGet	mtGet	The query submits messages that request values it can display. Named value pairs are supplied as query fields in the URL. (See QueryFields)
This method has the advantage of providing a URL that can be bookmarked.


TCustomQueryForm methods

TCustomQueryForm	Alphabetically

In TCustomQueryForm

AssignStrings

Create

Derived from TWebForm

Destroy

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomQueryForm methods

TCustomQueryForm	By object

AfterConstruction

Assign

AssignStrings

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TCustomQueryForm.AssignStrings

TCustomQueryForm	See also

Assigns values to display controls from a list of name/value pairs.

procedure AssignStrings(Value: TStrings);

Description

Use AssignStrings to initialize the values displayed by the controls in the query form. For each display control named in the specified list of strings, AssignStrings initializes its Text property with the associated value.

Value is a list of strings with the form Name=Value. The Name portion identifies the Web item for a display control that is listed in the WebComponents property list or is a child of one of those Web items. Name must match the string returned by the component’s GetHTMLControlName method. The Value portion of the string specifies the value that is assigned to the Web item’s Text property.

Note:	AssignStrings is a convenient way to initialize the values in a query form before the HTML document is sent to a Web browser. When the browser returns values that are entered by the end user, the Web server application must extract them from the request message’s ContentFields property.


TCustomQueryForm.Create

TCustomQueryForm	See also

Creates and initializes an instance of TCustomQueryForm.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a query form at runtime. Query forms added at design time using the Web Page editor are instantiated automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebForm


TCustomQueryButtons

Hierarchy	Properties	Methods	See also

TCustomQueryButtons assembles the HTML generated by a set of TQueryButton descendants.

Unit

MidItems

Description

Use TCustomQueryButtons as a base class for Web items that generate the HTML to arrange a collection of button controls in a query form. The buttons arranged by the query buttons component manipulate information shown by display controls in the parent Query form.

TCustomQueryButtons introduces properties that customize the appearance of the buttons it arranges.

Do not create instances of TCustomQueryButtons. TCustomQueryButtons is intended to act as a base class. Instead, instantiate a descendant class such as TQueryButtons.


TCustomQueryButtons properties

TCustomQueryButtons	Alphabetically	Legend

In TCustomQueryButtons

Custom

Style

StyleRule

Derived from TWebControlGroup

WebFieldControls

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomQueryButtons properties

TCustomQueryButtons	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

WebFieldControls


TCustomQueryButtons.Custom

TCustomQueryButtons	See also

Represents a tag option and its value in the generated TABLE tag.

property Custom: string;

Description

TCustomQueryButtons generates an HTML table to lay out the buttons listed in the WebFieldControls property. Use Custom to add options that qualify the TABLE tag. Each option and its value has the form

OPTIONNAME=Value

The options specified by Custom should be separated by spaces. For example, to add a border around the query buttons and color the background blue, you can set Custom to

BORDER=2 BGCOLOR=BLUE


TCustomQueryButtons.Style

TCustomQueryButtons	See also

Adds style attributes to the generated HTML table.

property Style: string;

Description

TCustomQueryButtons generates an HTML table to lay out the buttons listed in the WebFieldControls property. Use Style to add a STYLE option that qualifies the TABLE tag. The Style option consists of one or more attribute descriptions such as

font-family: arial; font-weight: bold; font-size: 10px

These attributes are added to the generated TABLE tag as the value of a STYLE option.


TCustomQueryButtons.StyleRule

TCustomQueryButtons	See also

Applies a style in the page producer’s style sheet to the group of buttons.

property StyleRule: string;

Description

TCustomQueryButtons generates an HTML table to lay out the buttons listed in the WebFieldControls property. Use StyleRule to assign one of the user-defined styles in the HTML document’s style sheet to the generated table. The value of StyleRule specifies one of the user-defined style names defined in the MIDAS page producer’s Styles or StylesFile property.

Note:	To apply a style definition that is not included in the style sheet, use the Style property.


TCustomQueryButtons methods

TCustomQueryButtons	Alphabetically

Derived from TWebControlGroup

Create

Destroy

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomQueryButtons methods

TCustomQueryButtons	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebControlGroup


TCustomRemoteServer

Hierarchy	Properties	Methods	Events	See also

TCustomRemoteServer is the base class for all components that connect to an application server in a multi-tiered database application.

Unit

dbclient

Description

Do not create instances of TCustomRemoteServer. TCustomRemoteServer introduces the properties and methods needed to connect to a remote application server and make the IAppServer interface available to one or more client datasets. Descendant classes override many of TCustomRemoteServer’s methods to create or close connections to the application server and to manage the interface communication with the application server.

To enable a client application to connect to an application server, use a descendant of TCustomRemoteServer such as TSocketConnection, TWebConnection,  TDCOMConnection, or TCorbaConnection.


TCustomRemoteServer properties

TCustomRemoteServer	Alphabetically	Legend

Derived from TCustomConnection

Connected

DataSetCount

DataSets

LoginPrompt

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomRemoteServer properties

TCustomRemoteServer	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Connected

DataSetCount

DataSets

DesignInfo

LoginPrompt

Name

Owner

Tag

VCLComObject


TCustomRemoteServer events

TCustomRemoteServer	Alphabetically	Legend

Derived from TCustomConnection

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnLogin


TCustomRemoteServer events

TCustomRemoteServer	By object	Legend

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnLogin


TCustomRemoteServer methods

TCustomRemoteServer	Alphabetically	Legend

In TCustomRemoteServer

Create

GetProviderNames

GetServer

GetServerList

Derived from TCustomConnection

Close

Destroy

Open

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomRemoteServer methods

TCustomRemoteServer	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetProviderNames

GetServer

GetServerList

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Open

RemoveComponent

SafeCallException

UpdateAction


TCustomRemoteServer.Create

TCustomRemoteServer	See also

Creates an instance of a remote server component.

constructor Create(AOwner: TComponent); override;

Description

Create instantiates an instance of a remote server component and initializes its properties.


TCustomRemoteServer.GetProviderNames

TCustomRemoteServer	See also

Provides the interface for a method that executes a callback for all provider objects on the application server.

procedure GetProviderNames(Proc: TGetStrProc); virtual;

Description

Descendant classes override this method to execute the procedure specified by the Proc parameter for every provider exposed by the application server. For every provider, Proc is called with the S parameter set to the name of the provider.

As implemented for TCustomRemoteServer, GetProviderNames is an empty procedure.


TCustomRemoteServer.GetServer

TCustomRemoteServer	See also

Returns the IAppServer interface of the application server.

function GetServer: IAppServer; virtual;

Description

Descendant classes override this function to return the interface of the application server after establishing a connection. As implemented in TCustomRemoteServer, GetServer always returns nilNULL.


TCustomRemoteServer.GetServerList

TCustomRemoteServer	See also

Returns a list of MIDAS servers (remote data modules) to which the component can connect.

function GetServerList: OleVariant; virtual;

Description

Connection components use GetServerList internally to fill the drop down list in the Object Inspector for the ServerName property.

As implemented in TCustomRemoteServer, GetServerList always returns NULL. Descendant classes override this method to return a list of MIDAS servers on the local machine and MIDAS servers registered in the system registry (TDispatchConnection), or MIDAS servers fetched from the server machine (TStreamedConnection).


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TCustomConnection


TDataBlockInterpreter

Hierarchy	Methods	See also

TDataBlockInterpreter marshals COM interface calls for non COM-based connection components.

Unit

sconnect

Description

Streamed connection components and Web connection components use TDataBlockInterpreter to handle the marshaling of messages sent to and received from an application server. An object that supports the IDataBlock interface stores the messages themselves.


TDataBlockInterpreter methods

TDataBlockInterpreter	Alphabetically

In TDataBlockInterpreter

CallCreateObject

Create

Destroy

InterpretData

ReadVariant

WriteVariant

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDataBlockInterpreter methods

TDataBlockInterpreter	By object

AfterConstruction

BeforeDestruction

CallCreateObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

InterpretData

MethodAddress

MethodName

NewInstance

ReadVariant

SafeCallException

WriteVariant


TDataBlockInterpreter.Create

TDataBlockInterpreter	See also

Creates and initializes an instance of TDataBlockInterpreter.

constructor Create(SendDataBlock: ISendDataBlock; CheckRegValue: string);

Description

Applications should not need to instantiate data block interpreters. Typically, they are instantiated by the streamed connection components that use them to marshal data. To access a streamed connection component’s data block interpreter instance, use its Interpreter property.

Create takes two arguments:

An ISendDataBlock interface that the data block interpreter can use to send information in a data block to its destination object (usually the remote data module of an application server).

A string that specifies a registry key value which must appear for application servers that can be accessed using the data block interpreter.


TDataBlockInterpreter.CallCreateObject

TDataBlockInterpreter	See also

Creates a COM object on a remote application server given its class name.

function CallCreateObject(Name: String): OleVariant;

Description

CallCreateObject sends a message to the remote application server, telling it to create an object of the class specified by the Name parameter. Name is the string representation of the Class ID (CLSID). CreateObject returns a reference to interface that can be used to communicate with the remote COM object.


TDataBlockInterpreter.Destroy

TDataBlockInterpreter	See also

Destroys an instance of TDataBlockInterpreter.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the TDataBlockInterpreter reference is not nil and only then calls Destroy.


TDataBlockInterpreter.InterpretData

TDataBlockInterpreter	See also

Interprets a call received from a remote application server.

procedure InterpretData(const Data: IDataBlock);

Description

Call InterpretData to respond to a COM interface call that is marshaled to a data block. The Data parameter specifies an IDataBlock interface that can be used to read the marshaled version of the message.

InterpretData reads the call, interprets it as an IDispatch call, and performs the appropriate actions (such as invoking a local COM interface).


TDataBlockInterpreter.ReadVariant

TDataBlockInterpreter	Methods 	See also

Returns an OleVariant that represents a Variant value read from an IDataBlock interface.

type

  TVarFlag = (vfByRef, vfVariant);

  TVarFlags = set of TVarFlag;

function ReadVariant(out Flags: TVarFlags; const Data: IDataBlock): OleVariant;

Description

ReadVariant converts a variant value that has been written to a data block into the corresponding OleVariant. The Data parameter specifies the interface of the data block that contains the Variant value. The Flags parameter returns information about how the variant value is used in interface calls. It includes zero or more of the following:

Value	Meaning

vfByRef	The Variant represents a parameter that is passed by reference.

vfVariant	The Variant is a Variant array.

Note:	 The Variant read by ReadVariant must be previously written to the data block (or its remote equivalent) using the WriteVariant method.


TDataBlockInterpreter.WriteVariant

TDataBlockInterpreter	Methods 	See also

Writes an OleVariant to a data block where it is stored as a Variant value.

procedure WriteVariant(const Value: OleVariant; const Data: IDataBlock);

Description

WriteVariant copies an OleVariant value to a data block so that it can be sent to an application server. The Value parameter specifies the OleVariant to write. The Data parameter specifies the interface to a data block that stores Value after it has been converted to a Variant.


Hierarchy

TObject


TDataForm

Hierarchy	Properties	Methods	See also

TDataForm generates an HTML form that displays database information and lets users apply updates.

Unit

MidItems

Description

Add TDataForm to the Web items of a MIDAS page producer to add an HTML form that displays database information that users can view and edit.

Data forms generate an HTML form that contains controls which display information from an XML data packet. Buttons on the form manipulate that data, and submit updates back to the XML broker that supplies the XML data packet.

TDataForm generates the HTML FORM tag and assembles the HTML generated by its Web items. It restricts the Web items that generate the contents of the form to components that generate data displays (TDataGrid or TFieldGroup), components that contain buttons which operate on those displays (TDataNavigator), and components that manage the layout of HTML controls (TLayoutGroup). At design time, you can add these Web items to the form using the Web page editor.


TDataForm properties

TDataForm	Alphabetically	Legend

Derived from TWebForm

Custom

Style

StyleRule

WebComponents

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDataForm properties

TDataForm	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

WebComponents


TDataForm methods

TDataForm	Alphabetically

Derived from TWebForm

Create

Destroy

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataForm methods

TDataForm	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebForm


TDataGrid

Hierarchy	Properties	Methods	See also

TDataGrid generates an HTML table to display a dataset in an XML data packet.

Unit

MidItems

Description

Add TDataGrid to the Web items of a TDataForm component (or a layout group that is a child of a TDataForm component.) TDataGrid generates an HTML table that displays multiple records from a dataset as a set of rows and columns.

Each TDataGrid object maintains a list of Web items that generate the individual fields (columns) of the table. These Web items can be from the following classes: TTextColumn, TSelectOptionColumn, TTextAreaColumn, and TStatusColumn. You can bind the data grid to an XML data packet or dataset field within an XML data packet. The column Web items can then use that binding to determine the source of the data they display.

You can also use the properties of TDataGrid to affect the appearance of the generated table.


TDataGrid properties

TDataGrid	Alphabetically	Legend

Derived from TCustomDataGrid

DisplayRows

HeadingAttributes

RowAttributes

TableAttributes

Derived from TXMLDisplayGroup

VisibleFields

XMLBroker

XMLDataSetField

Derived from TWebControlGroup

WebFieldControls

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDataGrid properties

TDataGrid	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

DisplayRows

HeadingAttributes

Name

Owner

RowAttributes

TableAttributes

Tag

VCLComObject

VisibleFields

WebFieldControls

XMLBroker

XMLDataSetField


TDataGrid methods

TDataGrid	Alphabetically

Derived from TCustomDataGrid

Create

Destroy

Derived from TWebControlGroup

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataGrid methods

TDataGrid	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebControlGroup

TXMLDisplayGroup

TCustomDataGrid


TDataNavigator

Hierarchy	Properties	Methods	See also

TDataNavigator assembles the HTML generated by a set of TDataSetButton and TXMLButton descendants.

Unit

MidItems

Description

Add TDataNavigator as the child of a TDataForm component (or a layout group that is a child of a TDataForm component) to enable the generated HTML form to navigate the displayed data and apply updates that end users make to the data. TDataNavigator can be associated with the Web item that displays the data, such as TDataGrid or TFieldGroup.

TDataNavigator generates HTML containing the controls generated by its children. These children must be descendants of TDataSetButton or TXMLButton, such as TInsertButton and TApplyUpdatesButton.

Use the properties of TDataNavigator to customize the appearance of the group of buttons.


TDataNavigator properties

TDataNavigator	Alphabetically	Legend

Derived from TCustomDataNavigator

Custom

Style

StyleRule

Derived from TXMLDisplayReferenceGroup

XMLComponent

Derived from TWebControlGroup

WebFieldControls

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDataNavigator properties

TDataNavigator	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

WebFieldControls

XMLComponent


TDataNavigator methods

TDataNavigator	Alphabetically

Derived from TXMLDisplayReferenceGroup

Create

Destroy

Derived from TWebControlGroup

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataNavigator methods

TDataNavigator	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebControlGroup

TXMLDisplayReferenceGroup


TCustomDataStore

Hierarchy	Properties	Methods	Events	See also

TCustomDataStore is the base class for components that analyze and maintain crosstabulated data.

Unit

mxstore

Description

Use TCustomDataStore as a base class when defining classes that fetch data from appropriately structured datasets and analyze it into a multidimensional array of summary values. Each dimension corresponds to a field in the dataset over which information is summarized. TCustomDataStore maintains a cached projection of this array over a set of active dimensions. The cache allows TCustomDataStore to quickly provide a projection of any subset of the active dimensions.

TCustomDataStore introduces properties and methods that describe the dimensions of the crosstabulated data array and the summary values that are computed over those dimensions.

Do not create instances of TCustomDataStore. To make the crosstabulated data from a TCustomDataStore object available to the objects in a form, use a TDecisionCube object.


TCustomDataStore properties

TCustomDataStore	Alphabetically	Legend

In TCustomDataStore

BinData

Capacity

CurrentSummary

DataSet

DimensionCount

DimensionMap

DimensionMapCount

MaxCells

MaxDimensions

MaxSummaries

ShowProgressDialog

SummaryCount

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomDataStore properties

TCustomDataStore	By object	Legend

BinData

Capacity

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

CurrentSummary

DataSet

DesignInfo

DimensionCount

DimensionMap

DimensionMapCount

MaxCells

MaxDimensions

MaxSummaries

Name

Owner

ShowProgressDialog

SummaryCount

Tag

VCLComObject


TCustomDataStore.BinData

TCustomDataStore	See also

Indicates whether all the dimensions in the multidimensional array include a cell for every value along the dimension.

property BinData: Boolean;

Description

Read BinData to determine whether any of the active dimensions have been grouped into ranges or been put into a paged (permanently drilled) state. When BinData is True, at least one dimension has been paged or has been collapsed into ranges of values. When BinData is False, all dimensions include entries for every value of the dimension field that appears in the dataset.


TCustomDataStore.Capacity

TCustomDataStore	See also

Limits the memory that may be used by the cached array of summary values.

property Capacity: Integer;

Description

Set Capacity to limit the number of bytes that may be used by the crosstabulated data store for storing the multidimensional array of summary values. If the number of active dimensions and summaries causes the cache to exceed this value, an ELowCapacityError is raised.


TCustomDataStore.CurrentSummary

TCustomDataStore	See also

Specifies the index of the current summary from the set of active summaries maintained by the crosstabulated data store.

property CurrentSummary: Integer;

Description

Use CurrentSummary to determine which of the active summaries is used to provide values to clients of the data store. CurrentSummary returns 0 if the first active summary is the current summary. CurrentSummary returns SummaryCount-1 if the last active summary is the current summary.

The dataset specified by the DataSet property provides all the fields that make up the dimensions and summaries of the dimension map. At any time, a subset of all the dimensions and summaries provided by the dataset is cached by the crosstabulated data store and available to decision source objects. Of all the active (cached) summaries, only one can be provided to decision source objects at a time. That one summary is the current summary.


TCustomDataStore.DataSet

TCustomDataStore	See also

Specifies the dataset that provides the fields which make up the dimensions and summaries maintained by the crosstabulated data store.

property DataSet: TDataSet;

Description

Set DataSet to the dataset that contains the crosstabulated data for the data store. Usually, DataSet is a TDecisionQuery object. TDecisionQuery objects are SQL queries that are grouped appropriately to calculate summaries for a crosstabulated data store.

The DataSet property can also be set to a TQuery object where the SQL has the same form as that of a TDecisionQuery or to any other dataset that contains summarized values in the same structure as the result of a TDecisionQuery query.

If the DataSet property is a TQuery or TDecisionQuery object, the crosstabulated data store automatically determines which fields are dimensions and which are summaries. If the DataSet property is not a query, the fields in the dimension map must be explicitly identified as dimensions or summaries, and, if they represent summaries, the type of summary must be indicated.

Note:	The summary values for the crosstabulated data store must be calculated by the TDataSet object. The data store does not summarize raw data, but analyzes summarized data into dimensions.


TCustomDataStore.DimensionCount

TCustomDataStore	See also

Specifies the number of dimensions cached by the crosstabulated data store.

property DimensionCount: Integer;

Description

Read DimensionCount to determine the number of active dimensions. The dataset specified by the DataSet property provides all the fields that make up the dimensions and summaries of the dimension map. At any time, a subset of all the dimensions and summaries provided by the dataset is cached by the crosstabulated data store and available to decision source objects. DimensionCount is the number of active (cached) dimensions that can be provided to decision source objects.


TCustomDataStore.DimensionMap

TCustomDataStore	See also

Describes the dimensions and summaries maintained by the crosstabulated data store.

property DimensionMap: TCubeDims;

Description

Read DimensionMap to access the dimensions and summaries of the data store. The individual entries of the dimension map represent the fields of the dataset specified by the DataSet property or calculated fields derived from those fields, such as averages. DimensionMap provides information about these fields from the dataset that make up the crosstabulated data store, including the field names and the use of the fields within the multidimensional array.

When the data store is not active, use the properties of the TCubeDim objects to change the information cached by the data store. Use the ActiveFlag property of individual TCubeDim objects to specify whether those dimensions or summaries from the dataset are cached by the crosstabulated data store. Use the BinType property of the TCubeDim objects to allow cells along temporal dimensions to represent date ranges or to put the dimensions in a paged (permanently drilled) state.

If the dataset is not a query, use the DimensionType property of the TCubeDim objects to identify which fields are dimensions and which are summaries, and to identify the type of summary represented by the summary fields.

To change the properties of the entries in the dimension map when the data store is active, use the Refresh method.

Note:	At design time, the DimensionType, Name, and ActiveFlag properties of the TCubeDim objects that make up the dimension map can be set using the Decision Cube Editor.


TCustomDataStore.DimensionMapCount

TCustomDataStore	See also

Specifies the total number of fields from the dataset that make up the dimensions and summaries of the dimension map.

property DimensionMapCount: Integer;

Description

Read DimensionMapCount to determine the number of TCubeDim objects that can be accessed through the DimensionMap property. The value of DimensionMapCount is the number of fields in the dataset specified by the DataSet property plus the number of derived fields based on those fields, such as fields for average values that are derived from count and summary fields.

The value of DimensionMapCount is not the same as DimensionCount + SummaryCount. DimensionCount and SummaryCount count the number of dimensions and summaries that are cached by the crosstabulated data cube and available to the decision source. DimensionMapCount also counts any inactive dimensions or summaries that are not included in the cache.


TCustomDataStore.MaxCells

TCustomDataStore	See also

Limits the number of cells that can be included in the cache at any one time.

property MaxCells: Integer;

Description

Use MaxCells to limit the memory usage of the crosstabulated data store. Memory consumption increases geometrically with each dimension that is cached in the multidimensional array and linearly with each summary. MaxCells prevents too many dimensions or summaries from being cached at once.

When the ActiveFlag property of a dimension or summary is diActive, it is always added to the cache. When the ActiveFlag property of a dimension or summary is diAsNeeded, it can be added only if it does not cause the number of cells to exceed MaxCells. The data store swaps in as-needed dimensions and summaries when they are used by the decision source, making room, if necessary, by swapping out closed dimensions or summaries that are not current.

Note:	Be sure to set MaxCells to a value big enough to accommodate all active dimensions and summaries plus the number of as-needed dimensions and summaries that can be open at one time.


TCustomDataStore.MaxDimensions

TCustomDataStore	See also

Limits the number of dimensions that can be cached by the crosstabulated data store at any one time.

property MaxDimensions: Integer;

Description

Use MaxDimensions to limit the memory usage of the data store. Memory consumption increases geometrically with each dimension that is cached in the multidimensional array. MaxDimensions prevents too many dimensions to be cached at once.

When the ActiveFlag property of a dimension is diActive, the dimension is always added to the cache. When the ActiveFlag property of a dimension is diAsNeeded, it can be added only if it does not cause the number of active dimensions to exceed MaxDimensions. The data store swaps in as-needed dimensions when they are open in the decision source, making room, if necessary, by swapping out closed dimensions.

Note:	Be sure to set MaxDimensions to a value big enough to accommodate all active dimensions plus the number of as-needed dimensions that can be open at one time.


TCustomDataStore.MaxSummaries

TCustomDataStore	See also

Limits the number of summaries that can be cached by the crosstabulated data store at one time.

property MaxSummaries: Integer;

Description

Use MaxSummaries to limit the memory usage of the data store. Memory consumption increases linearly with each summary that is cached in the multidimensional array. MaxSummaries prevents too many summaries to be cached at once.

When the ActiveFlag property of a summary is diActive, the summary is always added to the cache. When the ActiveFlag property is diAsNeeded, it can be added only if it does not cause the number of active summaries to exceed MaxSummaries. The data store swaps in as-needed summaries when they are chosen as the current summary, making room, if necessary, by swapping out other as-needed summaries.


TCustomDataStore.ShowProgressDialog

TCustomDataStore	See also

Determines whether a progress bar appears when the cache of crosstabulated values is built.

property ShowProgressDialog: Boolean;

Description

Set ShowProgressDialog to specify whether a progress bar should appear to provide users with a visual indication when the cache is being built. If the crosstabulated data store includes may dimensions, rebuilding the cache can take a noticeable amount of time. The progress bar provides users with feedback about how long this process will take.


TCustomDataStore.SummaryCount

TCustomDataStore	See also

Specifies the number of summary fields cached by the crosstabulated data store.

property SummaryCount: Integer;

Description

Read SummaryCount to determine the number of active summaries in the dimension map. The dataset specified by the DataSet property provides all the fields that make up the dimensions and summaries of the dimension map. At any time, a subset of all the dimensions and summaries provided by the dataset is cached by the crosstabulated data store and available to decision source objects. SummaryCount is the number of active (cached) summaries that can provide data to decision source objects.


TCustomDataStore events

TCustomDataStore	Alphabetically

In TCustomDataStore

AfterClose

AfterOpen

BeforeClose

BeforeOpen

OnLowCapacity

OnRefresh


TCustomDataStore events

TCustomDataStore	By object

AfterClose

AfterOpen

BeforeClose

BeforeOpen

OnLowCapacity

OnRefresh


TCustomDataStore.AfterClose

TCustomDataStore	See also

Occurs immediately after the crosstabulated data store has been deactivated.

type TCubeNotifyEvent = procedure(DataCube: TCustomDataStore) of object;

property AfterClose: TCubeNotifyEvent;

Description

Write an AfterClose event handler to take specific action when the crosstabulated data store has been shut down. For example, an application could provide feedback about the state of the data store, or update the dimension map for the next time the data store is activated.


TCustomDataStore.AfterOpen

TCustomDataStore	See also

Occurs immediately after the crosstabulated data store has been activated.

type TCubeNotifyEvent = procedure(DataCube: TCustomDataStore) of object;

property AfterOpen: TCubeNotifyEvent;

Description

Write an AfterOpen event handler to take specific action when the crosstabulated data store is activated. This is the first opportunity to determine how much memory is consumed by the multidimensional cache maintained by the data store.


TCustomDataStore.BeforeClose

TCustomDataStore	See also

Occurs immediately before the crosstabulated data store is deactivated.

type TCubeNotifyEvent = procedure(DataCube: TCustomDataStore) of object;

property BeforeClose: TCubeNotifyEvent;

Description

Write a BeforeClose event handler to take specific action before the data store shuts down. For example, an application can store information about the current state of the cache before it is cleared and all associated memory freed.


TCustomDataStore.BeforeOpen

TCustomDataStore	See also

Occurs immediately before the crosstabulated data store is activated.

type TCubeNotifyEvent = procedure(DataCube: TCustomDataStore) of object;

property BeforeOpen: TCubeNotifyEvent;

Description

Write a BeforeOpen event handler to take specific action before the crosstabulated data store is activated. This is an appropriate time to adjust the value of Capacity, or set the ShowProgressDialog based on the number of active dimensions in the DimensionMap.

This is the last opportunity to adjust the entries in the DimensionMap before the cache is built. If the data store has never been active before this, the DimensionMap property will be nil at this point. A BeforeOpen event handler can build a dimension map programmatically if it is nil. If the dimension map is not nil, the properties of the dimension items can be changed, but the order and number of the dimension items themselves should not be changed.


TCustomDataStore.OnLowCapacity

TCustomDataStore	See also

Occurs when the multidimensional cache requires more memory than is allowed by the Capacity property.

type

  TErrorAction = (eaFail, eaContinue);

TCapacityErrorEvent = procedure(var EAction: TErrorAction) of object;

property OnLowCapacity: TCapacityErrorEvent;

Description

Write an OnLowCapacity event handler to respond to ELowCapacityError exceptions. An OnLowCapacity event handler can change the value of Capacity or deactivate some of the dimensions in the dimension map in order to allow the cache to fit in the available memory. If the memory problem is handled by the OnLowCapacity event handler, change the Action parameter to eaContinue to allow the data store to continue building the cache. Otherwise, an ELowCapacityError exception will be raised.


TCustomDataStore.OnRefresh

TCustomDataStore	See also

Occurs immediately before the dimension map is changed.

type TCubeRefreshEvent = procedure(DataCube: TCustomDataStore; DimMap: TCubeDims) of object;

property OnRefresh: TCubeRefreshEvent;

Description

Write an OnRefresh event handler to take specific action when the dimension map changes. The DimMap parameter specifies the new value that is about to be set for the DimensionMap property. Use an OnRefresh event handler to change the properties of these dimension items before the DimensionMap property is set and the cache is rebuilt. This is also an opportunity to reset the MaxDimensions or MaxSummaries property to accommodate the dimension map that is about to be set.


TCustomDataStore methods

TCustomDataStore	Alphabetically

In TCustomDataStore

CalcSubTotals

Create

Destroy

GetDimensionMemberCount

GetDimensionName

GetMemberAsString

GetMemberAsVariant

GetMemoryUsage

GetSummaryAsString

GetSummaryAsVariant

GetSummaryName

Refresh

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomDataStore methods

TCustomDataStore	By object

AfterConstruction

Assign

BeforeDestruction

CalcSubTotals

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetDimensionMemberCount

GetDimensionName

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetMemberAsString

GetMemberAsVariant

GetMemoryUsage

GetNamePath

GetParentComponent

GetSummaryAsString

GetSummaryAsVariant

GetSummaryName

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Refresh

RemoveComponent

SafeCallException

UpdateAction


TCustomDataStore.Create

TCustomDataStore	See also

Creates an instance of TCustomDataStore.

constructor Create(AOwner: TComponent); override;

Description

Create allocates the helper objects used by the crosstabulated data store to manage the dimension map and the crosstabulated data.


TCustomDataStore.CalcSubTotals

TCustomDataStore	See also

Calculates dimension subtotals.

procedure CalcSubTotals;

Description

CalcSubTotals calculates dimension subtotals in cached data. CalcSubtotal is used internally by TCustomDataStore; an application should not call CalcSubTotals directly.


TCustomDataStore.Destroy

TCustomDataStore	See also

Destroys an instance of TCustomDataStore.

destructor Destroy; override;

Description

Do not call the Destroy method directly. Instead call Free. Free verifies that the decision cube is not nil, and only then calls Destroy.


TCustomDataStore.GetDimensionMemberCount

TCustomDataStore	See also

Returns the number of distinct values for a dimension of the data store.

function GetDimensionMemberCount(Dimension: Integer): Integer; virtual;

Description

Call GetDimensionMemberCount to determine the number of distinct field values in the dimension specified by the Dimension parameter. Zero specifies the first active dimension, and DimensionCount-1 specifies the last active dimension.

To obtain the individual values of the dimension, use the GetMemberAsString or GetMemberAsVariant method. GetDimensionMemberCount returns a value that provides an upper limit to the Index parameter of the GetMemberAsString or GetMemberAsVariant method.

To obtain the name of the dimension referred to by the Dimension parameter, use the GetDimensionName method.


TCustomDataStore.GetDimensionName

TCustomDataStore	See also

Returns the name of an active dimension.

function GetDimensionName(Dimension: Integer): String; virtual;

Description

Call GetDimensionName to obtain the name of the dimension indexed by the Dimension parameter. Zero specifies the first active dimension and DimensionCount-1 specifies the last active dimension. The name of a dimension is the name of the database field the dimension represents, unless the Name property of the corresponding TDimensionItem object is changed.


TCustomDataStore.GetMemberAsString

TCustomDataStore	See also

Returns the specified value from a dimension of the data store, formatted as a string.

function GetMemberAsString(Dimension, Index: Integer): String; virtual;

Description

Call GetMemberAsString to retrieve one of the values from the dimension specified by the Dimension parameter. Zero specifies the first dimension, and DimensionCount-1 specifies the last dimension. The Index parameter indicates which value along the dimension is returned, where 0 is the first value. GetDimensionMemberCount returns the number of values included in the dimension.

GetMemberAsString returns a field value formatted as a string. To obtain the field value as an unformatted variant, use the GetMemberAsVariant method.


TCustomDataStore.GetMemberAsVariant

TCustomDataStore	See also

Returns the specified value from a dimension of the crosstabulated data store.

function GetMemberAsVariant(Dimension, Index: Integer): Variant;

Description

Call GetMemberAsVariant to retrieve one of the values from the dimension specified by the Dimension parameter. Zero specifies the first dimension, and DimensionCount-1 specifies the last dimension. The Index parameter indicates which value along the dimension is returned, where 0 is the first value. GetDimensionMemberCount returns the number of values included in the dimension.


TCustomDataStore.GetMemoryUsage

TCustomDataStore	See also

Returns the number of bytes of memory used to cache the multidimensional array of summaries along all active dimensions.

function GetMemoryUsage: Integer;

Description

Call GetMemoryUsage to determine the size of the cache that stores the crosstabulated information for the data store. If the returned value is too large, consider making some of the active dimensions paged by setting their BinType property to binSet or allowing the data store to swap some dimensions out by setting their ActiveFlag property to diAsNeeded. The cube dimension can be accessed using the DimensionMap property.

The storage needs of the crosstabulated data store increase geometrically with each active dimension that is added. Applications must find the best balance between the performance benefit of caching many dimensions so that they are immediately available to decision controls, and the need to keep the number of active dimensions small enough so that the cache does not consume inordinate amounts of memory.


TCustomDataStore.GetSummaryAsString

TCustomDataStore	See also

Returns the value of the current summary for a set of values along all the active dimensions.

function GetSummaryAsString(Coord: TSmallIntArray): String; virtual;

Description

Call GetSummaryAsString to obtain the value of a single cell from the multidimensional array of summary values. Set the Coord parameter to an array of indexes, where each index identifies a value along one of the dimensions of the array. The first value of Coord is the index of the desired value along the first active dimension, the second value of Coord is the index of the desired value along the second active dimension, and so on. Coord should contain DimensionCount values.

To obtain the names of the active dimensions that correspond to the entries in the Coord parameter, use the GetDimensionName method. To obtain the name of the specified value along any of the dimensions, use the GetMemberAsString method.

GetSummaryAsString formats the summarized value as a string. To obtain the summary as a variant, use the GetSummaryAsVariant method.


TCustomDataStore.GetSummaryAsVariant

TCustomDataStore	See also

Returns the value of the current summary for a set of values along all the active dimensions.

function GetSummaryAsVariant(Coord: TSmallIntArray): Variant; virtual;

Description

Call GetSummaryAsVariant to obtain the value of a single cell from the multidimensional array of summary values. Set the Coord parameter to an array of indexes, where each index identifies a value along one of the dimensions of the array. The first value of Coord is the index of the desired value along the first active dimension, the second value of Coord is the index of the desired value along the second active dimension, and so on. Coord should contain DimensionCount values.

To obtain the names of the active dimensions that correspond to the entries in the Coord parameter, use the GetDimensionName method. To obtain the name of the specified value along any of the dimensions, use the GetMemberAsString method.

To obtain the summary formatted as a string, use the GetSummaryAsString method.


TCustomDataStore.GetSummaryName

TCustomDataStore	See also

Returns the name of an active summary.

function GetSummaryName(ISum: Integer): String; virtual;

Description

Call GetSummaryName to obtain the name of the summary specified by the ISum parameter. Zero specifies the first active summary and SummaryCount-1 specifies the last active summary.


TCustomDataStore.Refresh

TCustomDataStore	See also

Updates the dimension map of the crosstabulated data store.

procedure Refresh(DimensionMap : TCubeDims; bForce: Boolean);

Description

To change the properties of the dimensions in the dimension map, make a copy of the DimensionMap property, make any desired changes to the properties of the TCubeDim objects, and call Refresh, passing in the altered dimension map. The bForce parameter specifies whether the cache should be rebuilt unconditionally. When bForce is False, the cache will not be rebuilt unless the changes require it.

When the data store is active, call Refresh rather than directly altering the dimension map. Do not call Refresh while the data store is building the cache. Use the BeforeOpen and AfterOpen events to determine when the cache is being rebuilt.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


 TDataSetProvider

Hierarchy	Properties	Methods	Events	See also

TDataSetProvider provides data from and resolves data to a dataset or database.

Unit

provider

Description

Use TDataSetProvider to provide data from a dataset to a client dataset and to resolve updates from a client dataset back to that dataset or to its underlying database. TDataSetProvider is usually placed in the application server of a multi-tiered application.  It serves as a data broker between a remote database server and a client dataset in the desktop client application.

TDataSetProvider packages data from a dataset and passes it in one or more transportable data packets to the client dataset. The client dataset receives the data packets and reconstructs the data to create a local, in-memory copy for user access. When user access is complete, the client dataset repackages any changed data and sends the updates to the provider on the application server. The provider applies the updates back to the dataset or its underlying database table.

Client applications can access TDataSetProvider methods using the IAppServer interface of the remote data module that contains the provider.


TDataSetProvider properties

TDataSetProvider	Alphabetically	Legend

In TDataSetProvider

Constraints

DataSet

ResolveToDataSet

Derived from TBaseProvider

Options

Resolver

UpdateMode

Derived from TCustomProvider

Data

Exported

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDataSetProvider properties

TDataSetProvider	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

Data

DataSet

DesignInfo

Exported

Name

Options

Owner

Resolver

ResolveToDataSet

Tag

UpdateMode

VCLComObject


TDataSetProvider.Constraints

TCustomProvider 	See also

Controls whether database constraints are passed to the client so that it can check them locally.

property Constraints: Boolean;

Description

Set Constraints to specify whether data constraints defined for the provider’s associated dataset are sent to clients along with the metadata for the dataset. Sending constraints allows client datasets to check for constraint violations locally, so that updates are less likely to fail when sent back to the application server.

When Constraints is True, constraints are sent. To prevent the provider from sending constraint information, set Constraints to False.Note:	Before constraints can be sent to client applications, they must be imported to the data dictionary on the application server. Use SQL explorer to import constraints to the data dictionary.


TDataSetProvider.DataSet

TDataSetProvider 	See also	Example

Specifies the dataset from which the provider provides data and to which it applies updates.

property DataSet: TDataSet;

Description

Set DataSet to link the dataset provider to a dataset that it represents. The dataset provider packages the records from (and other information about) DataSet into data packets that can be used by client datasets. DataSet must be defined if the provider is used to create data packets.

If the ResolveToDataSet property is True, the provider applies updates from the application server directly to this dataset. Otherwise, the provider applies updates directly to the underlying database server.

DataSet must be a descendant of TDataSet that supports the IProviderSupport interface.


TDataSetProvider.ResolveToDataSet

TDataSetProvider 	See also

Specifies whether updates should be applied to a dataset or directly to the database server.

property ResolveToDataSet: Boolean;

Description

Set ResolveToDataSet to specify how updates are applied. When ResolveToDataSet is True, the Resolver property is set to a TDataSetResolver component, which applies updates directly to the dataset specified by the DataSet property. This can be useful if the application uses the events on the dataset component or if the dataset does not represent the data from a database server (for example, a client dataset).

When ResolveToDataSet is False, the Resolver property is set to a TSQLResolver component, which applies updates directly to the database server associated with DataSet. This can be more efficient, because it skips the intermediate step of using the dataset.


TDataSetProvider events

TDataSetProvider	Alphabetically 	Legend

In TDataSetProvider

OnGetDataSetProperties

OnGetTableName

Derived from TBaseProvider

AfterUpdateRecord

BeforeUpdateRecord

OnGetData

OnUpdateData

OnUpdateError

Derived from TCustomProvider

AfterApplyUpdates

AfterExecute

AfterGetParams

AfterGetRecords

AfterRowRequest

BeforeApplyUpdates

BeforeExecute

BeforeGetParams

BeforeGetRecords

BeforeRowRequest

OnDataRequest


TDataSetProvider events

TDataSetProvider	By object 	Legend

AfterApplyUpdates

AfterExecute

AfterGetParams

AfterGetRecords

AfterRowRequest

AfterUpdateRecord

BeforeApplyUpdates

BeforeExecute

BeforeGetParams

BeforeGetRecords

BeforeRowRequest

BeforeUpdateRecord

OnDataRequest

OnGetData

OnGetDataSetProperties

OnGetTableName

OnUpdateData

OnUpdateError


TDataSetProvider.OnGetDataSetProperties

TDataSetProvider 	See also 	Example

Specifies the dataset from which the provider provides data and to which it applies updates.

type TGetDSProps = procedure(Sender: TObject; DataSet: TDataSet; out Properties: OleVariant) of object;

property OnGetDataSetProperties: TGetDSProps;

Description

Write an OnGetDataSetProperties event handler to include application-defined information in the data packets. This information can later be returned using the GetOptionalParam method of the client dataset that represents the data in the packet.

The Sender parameter specifies the provider that is creating the data packet. The DataSet parameter specifies the source dataset that the data packet represents. Return the custom information as the Properties parameter.

The structure of Properties is a Variant array of Variant arrays. Each member of the Properties array represents a single named item that can be retrieved using GetOptionalParam. This item must be specified as an array of three elements:

A string representing the name used to later retrieve the information.

A Variant representing the value that can be retrieved.

A Boolean that indicates whether the information is sent back to the provider in delta packets.

Note:	The following names are reserved and can’t be used as the name for storing custom information:

UNIQUE_KEY	DEFAULT_ORDER	CHANGE_LOG	SERVER_COL

CONSTRAINTS	DATASET_CONTEXT	DATASET_DELTA	LCID

BDERECORD_X	TABLE_NAME	MD_FIELDLINKS	UPDATEMODE


TDataSetProvider.OnGetTableName

TDataSetProvider	See also

Occurs when a resolver initializes its information about the table to which it applies updates.

type TGetTableNameEvent = procedure(Sender: TObject; DataSet: TDataSet; var TableName: string) of object;

property OnGetTableName: TGetTableNameEvent;

Description

Write an OnGetTableName event handler to enable the provider to apply updates to non-live queries, stored procedures, or other datasets where the resolver can’t determine the target table from the provider’s dataset. When the resolver component is initialized, it stores the name of the table that is the target of its updates. This table name can be used in generated SQL statements that apply the updates. When the dataset is a TTable, the resolver can use the table’s TableName property. However, if the dataset is a “dead” query or stored procedure, the resolver has no way to determine the destination of the update without input from an OnGetTableName event handler.

The Sender parameter is the provider component.

The DataSet parameter is the dataset to which updates should be applied. This may be the provider’s dataset or a nested detail dataset.

Return the name of the target table as the TableName parameter. The resolver uses this to apply updates.


TDataSetProvider methods

TDataSetProvider	Alphabetically	Legend

In TDataSetProvider

Create

CreateDataPacket

CreateResolver

Destroy

DoBeforeExecute

DoBeforeGetRecords

DoGetProviderAttributes

DoGetTableName

FetchDetails

InternalApplyUpdates

InternalExecute

InternalGetParams

InternalGetRecords

InternalRowRequest

LocateRecord

Notification

UpdateRecord

Derived from TCustomProvider

ApplyUpdates

DataRequest

Execute

GetParams

GetRecords

RowRequest

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataSetProvider methods

TDataSetProvider	By object	Legend

AfterConstruction

ApplyUpdates

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateDataPacket

CreateResolver

DataRequest

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DoBeforeExecute

DoBeforeGetRecords

DoGetProviderAttributes

DoGetTableName

Execute

ExecuteAction

FetchDetails

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParams

GetParentComponent

GetRecords

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

InternalApplyUpdates

InternalExecute

InternalGetParams

InternalGetRecords

InternalRowRequest

LocateRecord

MethodAddress

MethodName

NewInstance

Notification

RemoveComponent

RowRequest

SafeCallException

UpdateAction

UpdateRecord


TDataSetProvider.Create

TDataSetProvider	See also

Creates and initializes a TDataSetProvider object.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a provider at runtime. Providers placed in forms or data modules at design time are created automatically.


TDataSetProvider.CreateDataPacket

TDataSetProvider	See also

Generates a data packet for the data associated with the provider.

procedure CreateDataPacket(PacketOpts: TGetRecordOptions; ProvOpts: TProviderOptions; var RecsOut: Integer; var Data: OleVariant); override;

Description

CreateDataPacket is used internally to generate the data packets that are returned by GetRecords.

The PacketOpts parameter indicates what information (other than record values) is included in the data packet. It reflects any Options passed to the GetRecords method.

The ProvOpts parameter reflects the current value of the Options property.

The RecsOut parameter specifies the number of records desired in the packet and returns the actual number of records in the generated data packet.

The Data parameter returns the generated data packet.


TDataSetProvider.CreateResolver

TDataSetProvider	See also

Creates a resolver component for handling the application of updates.

function CreateResolver: TCustomResolver; override;

Description

CreateResolver is called automatically when a resolver is needed to implement one of the provider’s methods. CreateResolver returns a newly instantiated resolver object, which is assigned to the Resolver property. The type of resolver created depends on the ResolveToDataSet property:

When ResolveToDataSet is True, CreateResolver returns a TDataSetResolver component, which applies updates directly to the dataset specified by the DataSet property.

When ResolveToDataSet is False, CreateResolver returns a TSQLResolver component, which applies updates directly to the database server associated with DataSet.


TDataSetProvider.Destroy

TDataSetProvider	See also

Frees an instance of a data set provider.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead, call Free, which checks that the reference to the provider is not nil before calling its Destroy method. Destroy frees all helper objects, including the resolver component referenced by the Resolver property.


TDataSetProvider.DoBeforeExecute

TDataSetProvider	See also

Generates a BeforeExecute event.

procedure DoBeforeExecute(const CommandText: WideString, var Params, OwnerData: OleVariant); override;

Description

The Execute method calls DoBeforeExecute to generate the BeforeExecute event before it executes CommandText or executes an associated query or stored procedure.

CommandText specifies an optional SQL statement that replaces the SQL of an associated query, or the name of a stored procedure that replaces the associated stored procedure. If Options includes poAllowCommandText, DoBeforeExecute sends CommandText to the associated dataset so that it can execute the provided statement instead of its query or stored procedure.

Params contains any parameter values that should be applied to CommandText or to the query or stored procedure before execution. DoBeforeExecute assigns these parameter values to the dataset (if appropriate).

OwnerData supplies custom information to the BeforeExecute event handler. The event handler can change this value. The returned value is then passed to an AfterExecute event handler and then returned to the caller of the Execute method.


TDataSetProvider.DoBeforeGetRecords

TDataSetProvider	See also

Generates a BeforeGetRecords event.

procedure DoBeforeGetRecords(Count: Integer; Options: Integer; const CommandText: WideString; var Params, OwnerData: OleVariant); override;

Description

The GetRecords method calls DoBeforeGetRecords to generate the BeforeGetRecords event before it fetches data and assembles it into a data packet.

Count is the number of records requested. TDataSetProvider does not use this parameter.

Options indicates whether the data packet should include metadata, whether it should start with the first record, and whether the data packet should be encoded in XML. TDataSetProvider does not use this parameter.

CommandText specifies an optional SQL statement that replaces the SQL of an associated query, or the name of a table or stored procedure that replaces the associated table or stored procedure. If Options includes poAllowCommandText, DoBeforeGetRecords sends CommandText to the associated dataset so that it can generate the set of records.

Params contains any parameter values that should be applied to CommandText or to a query or stored procedure before fetching data into a data packet. DoBeforeGetRecords assigns these values to the associated dataset, if appropriate.

OwnerData supplies custom information to the BeforeGetRecords event handler. The event handler can change this value. The returned value is then passed to an AfterGetRecords event handler and then (optionally) returned to the caller of the GetRecords method.


TDataSetProvider.DoGetProviderAttributes

TDataSetProvider	See also

Fills a list with information about the dataset that can be used when providing or resolving.

procedure DoGetProviderAttributes(DataSet: TDataSet; List: TList); virtual;

Description

DoGetParams is used internally to fetch information about the dataset such as its locale. The DataSet parameter specifies the dataset that stores the information. The List parameter is the list that is filled by DoGetParams. DoGetParams adds information to the list in Name/Value pairs.


TDataSetProvider.DoGetTableName

TDataSetProvider	See also

Generates an OnGetTableName event.

procedure DoGetTableName(DataSet: TDataSet; var TableName: string); virtual;

Description

The resolver calls DoGetTableName when it initializes the information it needs to apply updates. Override this method to provide an alternate mechanism for determining the name of the dataset that is the target of an update operation.

DataSet is the dataset that is the target of the update operation.

The name of the target dataset as it should appear in generated SQL statements is returned as the TableName parameter.


TDataSetProvider.FetchDetails

TDataSetProvider	See also

Fills a delta dataset with all nested dataset field values.

procedure FetchDetails(Source, Delta: TDataSet); override;

Description

FetchDetails is used internally to fetch the current values of any nested datasets when the provider is executing its RowRequest method. Source is a source dataset that has the current values for all fields. Delta is a delta dataset that must be updated so that its nested detail fields match the values in Source.


TDataSetProvider.InternalApplyUpdates

TDataSetProvider 	See also

Provides the underlying implementation of the ApplyUpdates method.

function InternalApplyUpdates(const Delta: OleVariant; MaxErrors: Integer; out ErrorCount: Integer): OleVariant; override;

Description

The ApplyUpdates method calls InternalApplyUpdates to apply the updates contained in a delta packet after generating the BeforeApplyUpdates event and before generating the AfterApplyUpdates event.

If the Options property includes poReadOnly, InternalApplyUpdates raises an exception. Otherwise, it tells the dataset to start a transaction, calls the ApplyUpdates method of its Resolver component to handle the actual update and resolving process, and tells the dataset to complete the transaction.

Delta is the delta packet containing insertions, deletions, and modifications to be applied.

MaxErrors indicates the maximum number of errors that can be applied before stopping the update operation. If MaxErrors is –1, the provider tries to apply all updates.

ErrorCount returns the number of errors encountered during the update operation.

InternalApplyUpdates returns a data packet of updates that could not be applied to the database as an OleVariant.


TDataSetProvider.InternalExecute

TDataSetProvider	See also

Provides the underlying implementation of the Execute method.

procedure InternalExecute(const CommandText: WideString, var Params: OleVariant); override;

Description

The Execute method calls InternalExecute to execute the appropriate SQL statement after calling DoBeforeExecute to generate a BeforeExecute event and apply the CommandText and Params. InternalExecute passes the execute command on to its associated dataset. Datasets that execute SQL statements (such as queries, stored procedures, or ADO datasets) execute the appropriate SQL command, while datasets that do not execute SQL statements (such as TTable or TClientDataSet) ignore the command.

CommandText is a client-supplied SQL statement that replaces the SQL of an associated query, or the name of a table or stored procedure that replaces the associated table or stored procedure. This parameter is ignored if the Options property does not include poAllowCommandText.

On entry, Params supplies parameter values for the query, stored procedure, or CommandText string. On exit, Params returns any output parameters.


TDataSetProvider.InternalGetParams

TDataSetProvider	See also

Returns the requested parameter values as a Variant array.

function InternalGetParams(Types: TParamTypes = AllParamTypes): OleVariant; override;

Description

The provider uses InternalGetParams internally whenever it needs to assemble the current parameter values into an OleVariant. This provides the underlying implementation of the GetParams method, as well as assembling parameter values for methods that return output parameters (such as Execute or GetRecords).

The Types parameter limits the parameter values that are returned to a subset of all possible parameter types. If this parameter is omitted, all parameter values are returned.


TDataSetProvider.InternalGetRecords

TDataSetProvider	See also

Provides the underlying implementation of the GetRecords method.

function InternalGetRecords(Count: Integer; out RecsOut: Integer; Options: TGetRecordOptions; const CommandText: WideString; var Params: OleVariant); OleVariant; override;

Description

The GetRecords method calls InternalGetRecords to assemble a data packet after calling DoBeforeGetRecords to apply the CommandText and Params and generate a BeforeGetRecords event. InternalGetRecords calls CreateDataPacket to create a data packet that reflects the current property settings of the provider. It then generates an OnGetData event.

Count indicates the number of records to retrieve. If Count is -1, all records are retrieved. If Count is 0, only metadata is retrieved. If Count is greater than 0, only the specified number of records are retrieved.

RecsOut returns the actual number of records retrieved.

Options indicates what information should be added to the data packet in addition to data. It can include grMetaData (include metadata), grReset (start providing records with the first one in the dataset), and grXML (encode the datapacket in XML rather than as an OleVariant).

CommandText specifies an optional SQL statement that replaces the SQL of an associated query, or the name of a table or stored procedure that replaces the associated table or stored procedure. This parameter is ignored if the Options property does not include poAllowCommandText.

Params specifies any parameter values that should be applied to CommandText or to an associated query or stored procedure. If the provider is associated with a table, Params specifies field values that filter the result set. On exit from GetRecords, Params returns any output parameters.

Records are returned as a data packet in a Variant.

Note:	If the DataSet property is not set, InternalGetRecords raises an exception.


TDataSetProvider.InternalRowRequest

TDataSetProvider	See also

Provides the underlying implementation of the RowRequest method.

function InternalRowRequest(const Row: OleVariant; RequestType: TFetchOptions): OleVariant; override;

Description

The RowRequest method calls InternalRowRequest to assemble the specified information after generating a BeforeRowRequest event and before generating an AfterRowRequest event. InternalRowRequest passes this request on to its associated Resolver.

The Row parameter is an OleVariant that describes the current record on the client dataset. It enables the provider to locate the record of interest.

The RequestType parameter indicates the type of information required.

InternalRowRequest returns the requested information in a delta packet.


TDataSetProvider.LocateRecord

TDataSetProvider 	See also

Positions a data set on the record that corresponds to the current update in a specified delta packet.

procedure LocateRecord(Source, Delta: TDataSet; virtual;

Description

LocateRecord is called indirectly by the RowRequest method to locate a record before fetching information about it. The Source parameter is the dataset containing current record values. The Delta parameter is a delta packet that identifies the desired type of information and information identifying the desired record.

LocateRecord uses the criteria specified by UpdateMode to identify the desired record.


TDataSetProvider.Notification

TDataSetProvider	See also

Responds to notifications that objects are being created or destroyed.

procedure Notification(AComponent: TComponent; Operation: TOperation); override;

Description

Notification overrides the inherited method to add a check that the dataset specified by the DataSet property is not being deleted. If DataSet is about to be destroyed, Notification sets the DataSet property to nil.


TDataSetProvider.UpdateRecord

TDataSetProvider 	See also

Retrieves specified data from a source dataset into a delta packet.

procedure UpdateRecord(Source, Delta: TDataSet; BlobsOnly: Boolean); override;

Description

UpdateRecord is called indirectly by the RowRequest method to fetch information about a specified record. The Source parameter is the dataset containing indicated record. The Delta parameter is a delta packet that returns the requested data to a client application. BlobsOnly indicates whether all field values should be provided (BlobsOnly = False) or only Blob field values (BlobsOnly = True).


Scope

Published

Protected

Accessibility

Read-only


Scope

Published


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TCustomProvider

TBaseProvider


 TDCOMConnection

Hierarchy	Properties	Methods	Events	See also

TDCOMConnection handles a client application’s DCOM connection to the remote server in a in a multi-tiered application.

Unit

mconnect

Description

TDCOMConnection is used in the client portion of a multi-tiered database application to establish and maintain the connection between the client and a remote application server. The DCOM connection object can

Establish an initial connection to a remote application server.

Obtain an IAppServer for the application server.

Obtain a list of providers on the application server.

Drop the connection to the remote application server.

TDCOMConnection uses DCOM to establish the initial connection between the client application and a remote application server. Once the connection is established, the client registers any or all of its client datasets with TDCOMConnection, and these client datasets use the IAppServer interface from the DCOM connection component to communicate with providers on the application server, or to otherwise call the application server’s data module interface.

To connect client applications to remote application servers using TCP/IP sockets, use TSocketConnection instead. To connect to remote application servers using HTTP, use the TWebConnection component. To connect to application servers using CORBA, use the TCORBAConnection component.


TDCOMConnection properties

TDCOMConnection	Alphabetically	Legend

In TDCOMConnection

ComputerName

Derived from TCOMConnection

Connected

In TDispatchConnection

AppServer

Connected

ObjectBroker

ServerGUID

ServerName

Derived from TCustomConnection

DataSetCount

DataSets

LoginPrompt

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDCOMConnection properties

TDCOMConnection	By object	Legend

AppServer

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ComputerName

Connected

DataSetCount

DataSets

DesignInfo

LoginPrompt

Name

ObjectBroker

Owner

ServerGUID

ServerName

Tag

VCLComObject


TDCOMConnection.ComputerName

TDCOMConnection	See also

Specifies the name of the machine on which the application server is located.

property ComputerName: string;

Description

Set ComputerName to the machine name of the computer where the application server resides. If ComputerName is blank (the default), TDCOMConnection assumes the application server can be found on the user’s machine or that the computer name can be derived from the system registry based on the DCOM configuration. If ComputerName is not blank, it overrides any system registry entries.

Normally the client and the application server run on different machines, so ComputerName must be set by the client application or available as part of the registry’s DCOM configuration.


TDCOMConnection events

TDCOMConnection	Alphabetically	Legend

Derived from TDispatchConnection

OnGetUserName

Derived from TCustomConnection

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnLogin


TDCOMConnection events

TDCOMConnection	By object	Legend

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnGetUserName

OnLogin


TDCOMConnection methods

TDCOMConnection	Alphabetically	Legend

In TDCOMConnection

Create

DoConnect

Derived from TDispatchConnection

GetServer

Derived from TCustomConnection

Close

Destroy

Open

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDCOMConnection methods

TDCOMConnection	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DoConnect

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetServer

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Open

RemoveComponent

SafeCallException

UpdateAction


TDCOMConnection.Create

TDCOMConnection

Creates and initializes a DCOM connection component.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TDCOMConnection at runtime. DCOM connection components placed in forms or data modules at design time are created automatically.

The AOwner parameter specifies the component (usually the form or data module) that is responsible for freeing the DCOM connection component.


TDCOMConnection.DoConnect

TDCOMConnection	See also

Connects to an application server.

procedure DoConnect; override;

Description

DoConnect is called when the Connected property is set to True. DoConnect establishes a dual interface with the remote data module on the application server. This interface is used to locate providers on the application server.

To locate the server system, DoConnect uses the ComputerName property. If the ObjectBroker property is set, DoConnect gets this value from the object broker. Otherwise, the application must assign this property a value directly.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomConnection

TCustomRemoteServer

TDispatchConnection

TCOMConnection


 TDecisionCube

Hierarchy	Properties	Methods	Events	See also

TDecisionCube maintains crosstabulated data that it provides to a TDecisionSource object.

Unit

mxdb

Description

Add a TDecisionCube object to a form or data module to allow an application to represent crosstabulated data. TDecisionCube analyzes the data from a source dataset into a multidimensional structure where each dimension corresponds to a field in the dataset over which information is summarized. Any dataset can be used as the source of a TDecisionCube object, but it is easiest to work with TDecisionQuery.

Usually, the summarized values are calculated by the dataset that is the source of the decision cubes. However, average values can be calculated internally by the Decision Cube instead.  Internally calculated averages have the advantage that they can be pivoted, subtotalled, and drilled-in correctly by Decision grids that display the data from the Decision Cube.

TDecisionCube introduces properties and methods that allow a crosstabulated data store to provide its data to a TDecisionSource object. Decision grids and Decision graphs do not retrieve data directly from the decision cube. They use a TDecisionSource object, which represents a configuration of the dimensions from the TDecisionCube object.


TDecisionCube properties

TDecisionCube	Alphabetically	Legend

In TDecisionCube

Active

DesignState

Derived from TCustomDataStore

BinData

Capacity

CurrentSummary

DataSet

DimensionCount

DimensionMap

DimensionMapCount

MaxCells

MaxDimensions

MaxSummaries

ShowProgressDialog

SummaryCount

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDecisionCube properties

TDecisionCube	By object	Legend

Active

BinData

Capacity

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

CurrentSummary

DataSet

DesignInfo

DesignState

DimensionCount

DimensionMap

DimensionMapCount

MaxCells

MaxDimensions

MaxSummaries

Name

Owner

ShowProgressDialog

SummaryCount

Tag

VCLComObject


TDecisionCube.Active

TDecisionCube	See also

Specifies whether the decision cube can provide data.

property Active: Boolean;

Description

Read Active to determine whether the decision cube is ready to provide data to a decision control. Set Active to True to cause the decision cube to fetch and analyze data from the dataset specified in the DataSet property.

When Active is False, the decision cube is closed and the decision source cannot read data from the decision cube. When Active is True, data can be read from the decision cube.

Note:	The Active property cannot be set to True unless the dataset specified by the DataSet property is already active.


TDecisionCube.DesignState

TDecisionCube	See also

Specifies how much data is displayed by the decision cube at design time.

type TCubeDesignState = (dsNoData, dsMetaData, dsDimensionData, dsAllData );

property DesignState: TCubeDesignState;

Description

Set DesignState to limit the amount of information that is provided when the decision cube is active at design time. Building the cache of the decision cube can be time and memory intensive.  Limiting the information the decision cube can supply at design time can improve design time performance when the decision cube has many dimensions or when the dimensions have many values.

DesignState has one of the following values:

Value	Meaning

dsNoData	The decision cube can’t be activated at design time.

dsMetaData	The decision cube provides the dimension captions, but no listing of values along the dimensions, and no summarized data.

dsDimensionData	The decision cube provides dimension captions, and the values of the dimension fields, but no summarized data.

dsAllData	The decision cube provides all possible data: dimension captions, the values of dimension fields, and summarized data.

Note:	The Value of DesignState can be changed at design time using the Decision Cube editor.


TDecisionCube events

TDecisionCube	Alphabetically	Legend

Derived from TCustomDataStore

AfterClose

AfterOpen

BeforeClose

BeforeOpen

OnLowCapacity

OnRefresh


TDecisionCube events

TDecisionCube	By object	Legend

AfterClose

AfterOpen

BeforeClose

BeforeOpen

OnLowCapacity

OnRefresh


TDecisionCube methods

TDecisionCube	Alphabetically

In TDecisionCube

Create

Destroy

GetDetailSQL

GetSQL

ShowCubeDialog

StateChanged

Derived from TCustomDataStore

CalcSubTotals

GetDimensionMemberCount

GetDimensionName

GetMemberAsString

GetMemberAsVariant

GetMemoryUsage

GetSummaryAsString

GetSummaryAsVariant

GetSummaryName

Refresh

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

CalcSubTotals

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDecisionCube methods

TDecisionCube	By object

AfterConstruction

Assign

BeforeDestruction

CalcSubTotals

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetDetailSQL

GetDimensionMemberCount

GetDimensionName

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetMemberAsString

GetMemberAsVariant

GetMemoryUsage

GetNamePath

GetParentComponent

GetSQL

GetSummaryAsString

GetSummaryAsVariant

GetSummaryName

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Refresh

RemoveComponent

SafeCallException

ShowCubeDialog

StateChanged

UpdateAction


TDecisionCube.Create

TDecisionCube	See also

Creates an instance of TDecisionCube.

constructor Create( AOwner: TComponent ); override;

Description

Call Create to instantiate a decision cube at runtime. Decision cubes placed on a form or data module at design time are created automatically.

Create allocates the memory for the decision cube and its helper objects and initializes the Active property to False and the DesignState property to dsAllData.


TDecisionCube.Destroy

TDecisionCube	See also

Destroys an instance of TDecisionCube.

destructor Destroy; override;

Description

Do not call the Destroy method directly. Instead call Free. Free checks that the decision cube is not nil, and only then calls Destroy.


TDecisionCube.GetDetailSQL

TDecisionCube	See also

Returns an SQL statement that can be used to generate the described subset of the data in the decision cube.

function GetDetailSQL( ValueArray: TSmallIntArray; SelectList: String; bActive: Boolean): string;

Description

Use the SQL statement returned by GetDetailSQL to generate a dataset that represents the records that gave rise to a subset of the values in the decision cube. The resulting query produces the records represented in the projection described by the ValueArray parameter. The dataset will include all fields that make up the dimensions of the decision cube, plus any fields listed in the SelectList parameter. The query does not include any summary values or grouping, such as must be imposed by the dataset of the decision cube.

Each entry in the ValueArray parameter corresponds to a dimension of the decision cube, where the first entry corresponds to the first dimension, the second entry corresponds to the second dimension, and so on. If the value of an entry in the value array is less than 0, all field values over that dimension are included in the new dataset. If the value of an entry in the value array is equal to or greater than 0, it is interpreted as the index of a value over the dimension field. When the ValueArray specifies a field value, the SQL statement restricts the dataset to records that match that value on the corresponding field of the original database table. Thus, ValueArray represents the dimension array with a set of drilled dimensions.

bActive specifies whether the ValueArray parameter includes inactive dimensions. Only active dimensions are included when bActive is True. Also when bActive is True, only the fields that correspond to active dimensions are included automatically in the SQL query.

The SelectList parameter is a list of comma delimited field names for the fields that are included in the result set of the SQL query. The query always includes the fields that correspond to the dimensions represented by the ValueArray parameter. If SelectList consists of a single asterisk (*), all the fields in the original dataset are included.


TDecisionCube.GetSQL

TDecisionCube	See also

Returns an SQL statement that can be used to generate the described subset of the data in the decision cube

function GetSQL( ValueArray: TSmallIntArray; bActive: Boolean): String;

Description

Use the SQL statement returned by GetSQL to view the data that gave rise to a subset of the information in the decision cube. The resulting query produces a dataset containing the projection described by the ValueArray parameter. All the summaries of the current dataset are included in the resulting query.

Each entry in the ValueArray parameter corresponds to a dimension of the decision cube, where the first entry corresponds to the first dimension, the second entry corresponds to the second dimension, and so on. If the value of an entry in the value array is less than 0, all field values over that dimension are included in the new dataset. If the value of an entry in the value array is equal to or greater than 0, it is interpreted as the index of a value over the dimension field. When the ValueArray specifies a field value, the SQL statement restricts the dataset to records that match that value on the corresponding field of the original database table. Thus, ValueArray represents the dimension array with a set of drilled dimensions.

bActive specifies whether the ValueArray parameter includes inactive dimensions. Only active dimensions are included when bActive is True.

To further restrict the dataset so that it includes only a subset of the dimensions in the decision cube, use the GetDetailSQL method.


TDecisionCube.ShowCubeDialog

TDecisionCube	See also

Displays the Decision Cube editor.

procedure ShowCubeDialog;

Description

Call ShowCubeDialog to allow the user to change the active dimensions of the data cube using the Decision Cube editor. ShowCubeDialog brings up the same dialog that appears when Decision Cube editor is selected from the pop-up menu of the decision cube component at design time.

The Decision Cube editor allows the user to make dimensions active or inactive and to change the names of dimensions. It also controls how much information is shown in a decision control at design time.


TDecisionCube.StateChanged

TDecisionCube	See also

Updates the dimension map when the pivot state changes.

procedure StateChanged; virtual;

Description

StateChanged is called automatically when dimensions are opened or closed, the current summary changes, or dimensions are pivoted. In response, the decision cube updates the dimension map to reflect the current state of its dimensions and summaries.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomDataStore


TDecisionGraph

Hierarchy	Properties	Methods	Events	See also

TDecisionGraph displays a graph of crosstabulated data.

Unit

mxgraph

Description

Use TDecisionGraph to put a decision graph in a form. Decision graphs chart a single summary that is calculated over a number of dimensions. The axes of the graph correspond to these dimensions, which are provided by a decision source object. By default, the first row dimension appears as the x axis and the first column dimension appears as the y axis.

The field that is summarized and the fields (dimensions) over which it is summarized can be changed dynamically at runtime to view any configuration of summary and dimensions chosen from the dimension map of a decision cube. Changes to the dimensions and summary can be initiated using a TDecisionPivot object.

TDecisionGraph publishes many of the properties, events, and methods inherited from TCustomDecisionGraph, but introduces no new behavior.

To present the crosstabulated data in a grid, use TDecisionGrid instead.


TDecisionGraph properties

TDecisionGraph	Alphabetically	Legend

Derived from TCustomDecisionGraph

DecisionSource

Derived from TChart

AllowPanning

AllowZoom

AnimatedZoom

AnimatedZoomSteps

BackImage

BackImageInside

BackImageMode

BottomWall

Foot

Gradient

LeftWall

PrintResolution

Title

Zoomed

Derived from TCustomChart

AxisVisible

BackColor

BottomAxis

BufferedDisplay

Chart3DPercent

ClipPoints

Frame

LeftAxis

Legend

MarginBottom

MarginLeft

MarginRight

MarginTop

MaxPointsPerPage

Monochrome

Page

RightAxis

ScaleLastPage

Series

SeriesList

TopAxis

View3d

View3dWalls

Derived from TCustomTeePanel

Canvas

Derived from TCustomPanel

BevelInner

BevelOuter

BevelWidth

BorderStyle

BorderWidth

Locked

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragMode

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDecisionGraph properties

TDecisionGraph	By object	Legend

Action

Align

AllowPanning

AllowZoom

Anchors

AnimatedZoom

AnimatedZoomSteps

AxisVisible

BackColor

BackImage

BackImageInside

BackImageMode

BevelInner

BevelOuter

BevelWidth

BorderStyle

BorderWidth

BiDiMode

BottomAxis

BottomWall

BoundsRect

Brush

BufferedDisplay

Canvas

Chart3DPercent

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ClipPoints

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DecisionSource

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragMode

Enabled

Floating

FloatingDockSiteClass

Foot

Frame

Gradient

Handle

Height

HelpContext

Hint

HostDockSite

Left

LeftAxis

LeftWall

Legend

Locked

LRDockWidth

MarginBottom

MarginLeft

MarginRight

MarginTop

MaxPointsPerPage

Monochrome

Name

Owner

Page

Parent

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

PrintResolution

RightAxis

ScaleLastPage

Series

SeriesList

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Title

Top

TopAxis

UndockHeight

UndockWidth

VCLComObject

View3d

View3dWalls

Visible

VisibleDockClientCount

Width

WindowProc

Zoomed


TDecisionGraph events

TDecisionGraph	Alphabetically	Legend

Derived from TChart

OnAllowScroll

OnClickAxis

OnClickBackground

OnClickLegend

OnClickSeries

OnGetLegendPos

OnGetLegendRect

OnScroll

OnUndoZoom

OnZoom

Derived from TCustomChart

OnAfterDraw

OnGetAxisLabel

OnGetLegendText

OnGetNextAxisLabel

OnPageChange

Derived from TWinControl

OnDockDrop

OnDockOver

OnEnter

OnExit

OnGetSiteInfo

OnUnDock

Derived from TControl

OnCanResize

OnClick

OnConstrainedResize

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock


TDecisionGraph events

TCustomDecisionGraph	By object	Legend

OnAfterDraw

OnAllowScroll

OnCanResize

OnClick

OnClickAxis

OnClickBackground

OnClickLegend

OnClickSeries

OnConstrainedResize

OnDblClick

OnDockDrop

OnDockOver

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnGetAxisLabel

OnGetLegendPos

OnGetLegendRect

OnGetLegendText

OnGetNextAxisLabel

OnGetSiteInfo

OnMouseDown

OnMouseMove

OnMouseUp

OnPageChange

OnResize

OnScroll

OnStartDock

OnUnDock

OnUndoZoom

OnZoom


TDecisionGraph methods

TDecisionGraph	Alphabetically

Derived from TCustomDecisionGraph

Create

DestroyTCustomDecisionGraph_Destroy>Main

Derived from TChart

CalcClickedPart

CalcMetaBounds

ChartPrintRect

CopyToClipboardBitmap

CopyToClipboardMetafile

DrawToMetaCanvas

ExchangeSeries

FillSeriesSourceItems

FillValueSourceItems

GetEditorClass

IsScreenHighColor

NextPage

PreviousPage

Print

PrintLandscape

PrintOrientation

PrintPartial

PrintPartialCanvas

PrintPortrait

PrintRect

SaveToBitmapFile

SaveToMetafile

SaveToMetafileEnh

SaveToMetafileRect

SeriesDown

SeriesUp

TeeCreateMetafile

UndoZoom

ZoomPercent

ZoomRect

Derived from TCustomChart

ActiveSeriesLegend

AddSeries

BackWallRect

CalcSize3d

CalcSize3dWalls

ChartRegionRect

CheckDatasource

CheckPenWidth

ClipRectangle

Draw

FormattedLegend

FormattedValueLegend

FreeAllSeries

GetASeries

GetAxisSeries

GetFreeSeriesColor

GetLabelsSeries

InternalDraw

IsFreeSeriesColor

IsValidDataSource

MarkText

MaxMarkWidth

MaxTextWidth

MaxXValue

MaxYValue

MinXValue

MinYValue

NumPages

RemoveAllSeries

RemoveSeries

SeriesCount

SeriesTitleLegend

UnClipRectangle

XLabelText

Derived from TCustomTeePanel

CanvasChanged

DoHorizLine

DoLine

DoPolygon

DoRectangle

DoVertLine

FontCanvas

GetCursorPos

GetRectangle

GetWidthHeight

ReCalcWidthHeight

RotateLabel

SetBooleanProperty

SetBrushCanvas

SetColorProperty

SetDoubleProperty

SetIntegerProperty

SetInternalCanvas

SetLongintProperty

SetStringProperty

TeeCharHeight

TeeTextHeight

TeeTextOut

TeeTextWidth

Derived from TCustomPanel

GetControlsAlignment

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDecisionGraph methods

TDecisionGraph	By object

ActiveSeriesLegend

AddSeries

AfterConstruction

Assign

BackWallRect

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CalcClickedPart

CalcMetaBounds

CalcSize3d

CalcSize3dWalls

CanFocus

CanvasChanged

ChartPrintRect

ChartRegionRect

CheckDatasource

CheckPenWidth

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ClipRectangle

ContainsControl

ControlAtPos

CopyToClipboardBitmap

CopyToClipboardMetafile

Create

CreateParented

CreateParentedControl

DefaultHandler

DestroyComponents

Destroying

DestroyTCustomDecisionGraph_Destroy>Main

DisableAlign

Dispatch

Dock

DockDrop

DoHorizLine

DoLine

DoPolygon

DoRectangle

DoVertLine

DragDrop

Dragging

Draw

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

DrawToMetaCanvas

EnableAlign

EndDrag

ExchangeSeries

ExecuteAction

FieldAddress

FillSeriesSourceItems

FillValueSourceItems

FindChildControl

FindComponent

FlipChildren

Focused

FontCanvas

FormattedLegend

FormattedValueLegend

Free

FreeAllSeries

FreeInstance

FreeNotification

FreeOnRelease

GetASeries

GetAxisSeries

GetControlsAlignment

GetCursorPos

GetEditorClass

GetFreeSeriesColor

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetLabelsSeries

GetNamePath

GetParentComponent

GetRectangle

GetTabOrderList

GetTextBuf

GetTextLen

GetWidthHeight

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

InternalDraw

Invalidate

IsFreeSeriesColor

IsRightToLeft

IsScreenHighColor

IsValidDataSource

ManualDock

ManualFloat

MarkText

MaxMarkWidth

MaxTextWidth

MaxXValue

MaxYValue

MethodAddress

MethodName

MinXValue

MinYValue

MouseWheelHandler

NewInstance

NextPage

NumPages

PaintTo

Perform

PreviousPage

Print

PrintLandscape

PrintOrientation

PrintPartial

PrintPartialCanvas

PrintPortrait

PrintRect

Realign

ReCalcWidthHeight

Refresh

RemoveAllSeries

RemoveComponent

RemoveControl

RemoveSeries

Repaint

ReplaceDockedControl

RotateLabel

SafeCallException

SaveToBitmapFile

SaveToMetafile

SaveToMetafileEnh

SaveToMetafileRect

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SeriesCount

SeriesDown

SeriesTitleLegend

SeriesUp

SetBooleanProperty

SetBounds

SetBrushCanvas

SetColorProperty

SetDoubleProperty

SetFocus

SetIntegerProperty

SetInternalCanvas

SetLongintProperty

SetStringProperty

SetTextBuf

Show

TeeCharHeight

TeeCreateMetafile

TeeTextHeight

TeeTextOut

TeeTextWidth

UnClipRectangle

UndoZoom

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

XLabelText

ZoomPercent

ZoomRect


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomPanel

TCustomTeePanel

TCustomChart

TChart

TCustomDecisionGraph


 TDecisionGrid

Hierarchy	Properties	Methods	Events	See also

TDecisionGrid presents crosstabulated data from a decision source in a grid format.

Unit

mxgrid

Description

Use TDecisionGrid to put a decision grid in a form. Decision grids present a single summary that is calculated over an arbitrary number of dimensions. The dimensions can appear as rows or columns in the grid, with the field values of the dimensions listed as labels along the top and left edges of the grid.

The field that is summarized and the fields (dimensions) over which it is summarized can be changed dynamically at runtime to view any configuration of summary and dimensions chosen from the dimension map of a decision cube. Changes to the dimensions and summary can be initiated by direct manipulation of the decision grid, or by using a TDecisionPivot object.

TDecisionGrid publishes many of the properties, events, and methods inherited from TCustomDecisionGrid, but introduces no new behavior.

To present the crosstabulated data in a chart, use TDecisionGraph instead.


TDecisionGrid properties

TDecisionGrid	Alphabetically	Legend

Derived from TCustomDecisionGrid

CaptionColor

CaptionFont

Cells

ColCount

DataColor

DataFont

DataSumColor

DecisionSource

DefaultColWidth

DefaultRowHeight

Dimensions

FixedCols

FixedRows

GridLineColor

GridLineWidth

LabelColor

LabelFont

LabelSumColor

Options

RowCount

ShowCubeEditor

Totals

Derived from TCustomGrid

BorderStyle

DefaultDrawing

ScrollBars

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Ctl3D

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BoundsRect

BiDiMode

ClientHeight

ClientWidth

Constraints

Color

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragMode

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDecisionGrid properties

TDecisionGrid	By object	Legend

Action

Align

Anchors

BiDiMode

BorderStyle

BoundsRect

Brush

CaptionColor

CaptionFont

Cells

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ColCount

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DataColor

DataFont

DataSumColor

DecisionSource

DefaultColWidth

DefaultDrawing

DefaultRowHeight

DesignInfo

Dimensions

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragMode

Enabled

FixedCols

FixedRows

Floating

FloatingDockSiteClass

GridLineColor

GridLineWidth

Handle

Height

HelpContext

Hint

HostDockSite

LabelColor

LabelFont

LabelSumColor

Left

LRDockWidth

Name

Options

Owner

Parent

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

RowCount

ScrollBars

ShowCubeEditor

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

Totals

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TDecisionGrid events

TDecisionGrid	Alphabetically	Legend

Derived from TCustomDecisionGrid

OnDecisionDrawCell

OnDecisionExamineCell

OnTopLeftChanged

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDrag


TDecisionGrid events

TDecisionGrid	By object	Legend

OnClick

OnDblClick

OnDecisionDrawCell

OnDecisionExamineCell

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDrag

OnTopLeftChanged


TDecisionGrid methods

TDecisionGrid	Alphabetically

Derived from TCustomDecisionGrid

CellDrawState

CellValueArray

Create

Destroy

Notification

Derived from TCustomGrid

MouseCoord

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

Dock

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDecisionGrid methods

TDecisionGrid	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

CellDrawState

CellValueArray

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseCoord

MouseWheelHandler

NewInstance

Notification

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGrid

TCustomDecisionGrid


 TDecisionPivot

Hierarchy	Properties	Methods	Events	See also

TDecisionPivot allows the user to control the pivot state of a decision source.

Unit

mxpivsrc

Description

Add a decision pivot to a form to allow users to control the pivot state of decision graphs and decision grids. Decision pivots contain buttons that correspond to the active dimensions of a decision cube and a drop-down list box for choosing the current summary.

Pressing the dimension buttons opens or closes the dimensions, controlling whether the decision source provides detailed data values for those dimensions. Right-clicking the buttons of a decision pivot brings up a menu that allows users to control the drill state of a dimension. Drilled dimensions focus on a single value within the dimension. Dragging the buttons on a decision pivot rearranges the dimensions of the decision source into a new pivot configuration.

Note:	Do not use the Decision pivot to pivot, subtotal, or drill in on summaries that are not additive.  SUM and COUNT summaries are additive, AVERAGE (unless calculated by the Decision cube), MAX, and MIN are not.


TDecisionPivot properties

TDecisionPivot	Alphabetically	Legend

In TDecisionPivot

BorderStyle

BorderWidth

ButtonAutoSize

ButtonHeight

ButtonSpacing

ButtonWidth

DecisionSource

GroupLayout

Groups

GroupSpacing

Derived from TCustomPanel

Alignment

BevelInner

BevelOuter

BevelWidth

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDecisionPivot properties

TDecisionPivot	By object	Legend

Action

Align

Alignment

Anchors

BevelInner

BevelOuter

BevelWidth

BiDiMode

BorderStyle

BorderWidth

BoundsRect

Brush

ButtonAutoSize

ButtonHeight

ButtonSpacing

ButtonWidth

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DecisionSource

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

GroupLayout

Groups

GroupSpacing

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TDecisionPivot.BorderStyle

TDecisionPivot	See also

Determines whether a line is drawn around the perimeter of the decision pivot.

property BorderStyle: TBorderStyle;

Description

Use BorderStyle to specify whether the decision pivot has a single line drawn around it. When BorderStyle is bsSingle, a single line is drawn around the panel outside of the outer bevel.

Note:	Do not confuse the line drawn around the decision pivot with the BorderWidth property. The BorderWidth is the distance between the outer and inner bevels.


TDecisionPivot.BorderWidth

TDecisionPivot	See also

Specifies the distance, in pixels, between the outer and inner bevels.

type TBorderWidth: 0..MaxInt;

property BorderWidth: TBorderWidth;

Description

Use BorderWidth to specify how wide the border around the decision pivot should be. A value of 0 means no border should appear.

The border of the decision pivot is the area between the outer and inner bevels. It is visible only if the inner bevel is raised or lowered, but affects the inset of the controls in the pivot even if BevelInner is bvNone.

Do not confuse the border of the pivot with line drawn around it. The line around the pivot is specified by the BorderStyle property.


TDecisionPivot.ButtonAutoSize

TDecisionPivot	See also

Specifies whether the dimension buttons resize automatically when the decision pivot resizes.

property ButtonAutoSize: Boolean;

Description

Set ButtonAutoSize to True to cause the dimension buttons to expand and contract automatically when the size of the decision pivot changes. Set ButtonAutoSize to False to specify fixed size buttons.

Note:	The value of ButtonAutoSize is ignored when GroupLayout is xtTopLeft.


TDecisionPivot.ButtonHeight

TDecisionPivot	See also

Specifies the height, in pixels, of the dimension buttons.

property ButtonHeight: Integer;

Description

Use ButtonHeight to determine the Height of the dimension buttons. Do not set ButtonHeight when the ButtonAutoSize property is True. When ButtonAutoSize is True, the height of the buttons is reset automatically whenever the layout of the decision pivot changes.


TDecisionPivot.ButtonSpacing

TDecisionPivot	See also

Specifies the number of pixels that appear between dimension buttons.

property ButtonSpacing: Integer;

Description

Set ButtonSpacing to control the spacing between the buttons in a single group. Increase ButtonSpacing to make a decision pivot look less crowded. Decrease ButtonSpacing to make the row and column groups look more compact.


TDecisionPivot.ButtonWidth

TDecisionPivot	See also

Specifies the width, in pixels, of the dimension buttons.

property ButtonWidth: Integer;

Description

Use ButtonWidth to determine the Width of the dimension buttons. Do not set ButtonWidth when the ButtonAutoSize property is True. When ButtonAutoSize is True, the width of the buttons is reset automatically whenever the layout of the decision pivot changes.


TDecisionPivot.DecisionSource

TDecisionPivot	See also

Specifies the decision source object that the decision pivot controls.

property DecisionSource: TDecisionSource;

Description

Set DecisionSource to link the decision pivot to a decision source component. The controls in the decision pivot change the pivot state of the decision source.

The pivot state of the decision source can also change in response to another control, such as a decision grid. When the pivot state of the decision source changes, the decision pivot updates the layout of the dimension buttons and the selection in the summary combo box.


TDecisionPivot.GroupLayout

TDecisionPivot	See also

Specifies how the dimension buttons and summary control are arranged on the decision pivot.

Type

  TDecisionButtonPosition = (xtHorizontal, xtVertical, xtLeftTop);

property GroupLayout: TDecisionButtonPosition;

Description

Set Layout to specify the organization of a decision pivot. Layout can have one of the following values:

Value	Meaning

xtHorizontal	The controls in the pivot are lined up side by side.

xtVertical	The controls in the pivot are lined up top to bottom.

xtLeftTop	The controls in the pivot are lined up along the edges of the pivot, with the row dimensions down the left side, the column dimensions along the top, and the summary control in the upper left corner.

When Layout is xtLeftTop, the center of the decision pivot is empty. A decision graph or decision grid can be placed in this empty spot so that the buttons line up with the dimensions they control.

When Layout is xtHorizontal or xtVertical, the summary control appears first, followed by a the row dimensions and then the column dimensions. The Groups property can omit any of these from the layout.


TDecisionPivot.Groups

TDecisionPivot	See also

Specifies which controls appear in a decision pivot.

type

  TDecisionPivotOption = (xtRows, xtColumns, xtSummaries);

TDecisionPivotOptions = set of TDecisionPivotOption;

property Groups: TDecisionPivotOptions;

Description

Set Groups to limit the types of controls that appear in the decision pivot. This allows greater flexibility over where the controls appear in a form. For example, a form can contain three decision pivots: one containing only row dimension buttons, one containing only column dimension buttons, and one containing only the summary selection combo box. These three pivots can then be arranged anywhere on the form.

Groups is a set containing one or more of the following values:

Value	Meaning

xtRows	The pivot contains row dimension buttons.

xtColumns	The pivot contains column dimension buttons.

xtSummaries	The pivot contains a summary selection combo box.


TDecisionPivot.GroupSpacing

TDecisionPivot	See also

Determines the number of pixels that appear between control groups.

property GroupSpacing: Integer;

Description

Set GroupSpacing to control the spaces that appear between the summary combo box, the group of row dimension buttons, and the group of column dimension buttons. Increase GroupSpacing to make the groups of controls appear more distinct. Decrease GroupSpacing to make the decision pivot look more compact.


TDecisionPivot events

TDecisionPivot	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnResize

OnStartDrag


TDecisionPivot events

TDecisionPivot	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnResize

OnStartDrag


TDecisionPivot methods

TDecisionPivot	Alphabetically

In TDecisionPivot

Create

Destroy

SetBounds

Derived from TCustomPanel

GetControlsAlignment

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDecisionPivot methods

TDecisionPivot	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TDecisionPivot.Create

TDecisionPivot	See also

Creates and initializes an instance of TDecisionPivot.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a decision pivot at runtime. Decision pivots placed on forms at design time are created Pass a single Component as a parameter to provide the decision pivot with an Owner that is responsible for freeing it.

After calling the inherited constructor, Create initializes the following properties:

BorderStyle to bsNone and BorderWidth to 3.

ButtonAutoSize to True.

ButtonHeight to 24 and ButtonWidth to 64.

ButtonSpacing to 3 and GroupSpacing to 10.

Groups to [xtRows, xtColumns, xtSummaries].

GroupLayout to xtHorizontal.


TDecisionPivot.Destroy

TDecisionPivot	See also

Destroys an instance of TDecsionPivot.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the decision pivot reference is not nil, and only then calls Destroy.


TDecisionPivot.SetBounds

TDecisionPivot	See also

Resizes the decision pivot.

procedure SetBounds(Left, Top, Height, Width: Integer); override;

Description

Use SetBounds to change all of the decision pivot’s boundary properties at once. The same effect can be achieved by setting the Left, Top, Width, and Height properties separately. By setting all four properties at once, SetBounds ensures that the control will not repaint between changes. Specify the values for the Left, Top, Width, and Height properties as the value of the Left, Top, Width, and Height parameters, respectively.

SetBounds overrides the inherited method to adjust the layout of the buttons in the decision pivot when the size changes.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomPanel


 TDecisionQuery

Hierarchy	Properties	Methods	Events	See also

Unit

mxtables

Description

TDecisionQuery is a specialized query that prepares crosstabulated data for a decision cube.

Use a TDecisionQuery as the dataset of a decision cube to ensure that the data is properly prepared. TDecisionQuery allows the dimensions and summaries to be defined directly on the dataset analyzed in a decision control. It then prepares an SQL query to provide the information from that dataset in a format that can be used by a decision cube.

Decision cubes can use other types of datasets, but the information must be structured in the same way as the output of a TDecisionQuery object.

Note:	In the Decision Query editor that is displayed from the Decision query component, the query is initially handled in ANSI-92 SQL syntax, then translated (if necessary) into the dialect used by the data source of the query. Use only ANSI standard SQL in the Decision Query editor. Use the dialect of the data source in the SQL property of the Decision Query.


TDecisionQuery properties

TDecisionQuery	Alphabetically	Legend

Derived from TQuery

Constrained

DataSource

Handle

Local

ParamCheck

ParamCount

Params

Prepared

RequestLive

RowsAffected

SQL

SQLBinary

StmtHandle

Text

UniDirectional

Derived from TDBDataSet

AutoRefresh

Database

DatabaseName

DBHandle

DBLocale

DBSession

SessionName

UpdateMode

Derived from TBDEDataSet

BlockReadSize

CacheBlobs

CachedUpdates

CanModify

ExpIndex

Filter

Filtered

FilterOptions

KeySize

Locale

RecNo

RecordCount

RecordSize

UpdateObject

UpdateRecordTypes

UpdatesPending

Derived from TDataSet

Active

AggFields

AutoCalcFields

Bof

Bookmark

Constraints

DataSetField

DefaultFields

Designer

Eof

FieldCount

FieldDefList

FieldDefs

FieldList

Fields

FieldValues

Found

Modified

Name

ObjectView

State

SparseArrays

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDecisionQuery properties

TDecisionQuery	By object	Legend

Active

AggFields

AutoCalcFields

AutoRefresh

BlockReadSize

Bof

Bookmark

CacheBlobs

CachedUpdates

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constrained

Constraints

Database

DatabaseName

DataSetField

DataSource

DBHandle

DBLocale

DBSession

DefaultFields

Designer

DesignInfo

Eof

ExpIndex

FieldCount

FieldDefList

FieldDefs

FieldList

Fields

FieldValues

Filter

Filtered

FilterOptions

Found

Handle

KeySize

Local

Locale

Modified

Name

ObjectView

Owner

ParamCheck

ParamCount

Params

Prepared

RecNo

RecordCount

RecordSize

RequestLive

RowsAffected

SessionName

SparseArrays

SQL

SQLBinary

State

StmtHandle

Tag

Text

UniDirectional

UpdateMode

UpdateObject

UpdateRecordTypes

UpdatesPending

VCLComObject


TDecisionQuery events

TDecisionQuery	Alphabetically	Legend

Derived from TBDEDataSet

OnUpdateError

OnUpdateRecord

Derived from TDataSet

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TDecisionQuery events

TDecisionQuery	By object	Legend

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnUpdateError

OnUpdateRecord


TDecisionQuery methods

TDecisionQuery	Alphabetically

Derived from TQuery

Create

Destroy

ExecSQL

GetDetailLinkFields

ParamByName

Prepare

UnPrepare

Derived from TDBDataSet

CheckOpen

CloseDatabase

OpenDatabase

Derived from TBDEDataSet

ApplyUpdates

BookmarkValid

Cancel

CancelUpdates

CommitUpdates

CompareBookmarks

ConstraintCallBack

ConstraintsDisabled

CreateBlobStream

DisableConstraints

EnableConstraints

FetchAll

GetFieldData

FlushBuffers

GetBlobFieldData

GetCurrentRecord

GetIndexInfo

IsSequenced

Locate

Lookup

Post

RevertRecord

Translate

UpdateStatus

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

CheckBrowseMode

ClearFields

Close

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetDetailDataSets

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsEmpty

IsLinkedTo

Last

MoveBy

Next

Open

Prior

Refresh

Resync

SetFields

UpdateCursorPos

UpdateRecord

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDecisionQuery methods

TDecisionQuery	By object

ActiveBuffer

AfterConstruction

Append

AppendRecord

ApplyUpdates

Assign

BeforeDestruction

BookmarkValid

Cancel

CancelUpdates

CheckBrowseMode

CheckOpen

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClearFields

Close

CloseDatabase

CommitUpdates

CompareBookmarks

ConstraintCallBack

ConstraintsDisabled

ControlsDisabled

Create

CreateBlobStream

CursorPosChanged

DefaultHandler

Delete

Destroy

DestroyComponents

Destroying

DisableConstraints

DisableControls

Dispatch

Edit

EnableConstraints

EnableControls

ExecSQL

ExecuteAction

FetchAll

FieldAddress

FieldByName

FindComponent

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FlushBuffers

Free

FreeBookmark

FreeInstance

FreeNotification

FreeOnRelease

GetBlobFieldData

GetBookmark

GetCurrentRecord

GetDetailDataSets

GetDetailLinkFields

GetFieldData

GetFieldList

GetFieldNames

GetIndexInfo

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GotoBookmark

HasParent

InheritsFrom

InitInstance

Insert

InsertComponent

InsertRecord

InstanceSize

IsEmpty

IsLinkedTo

IsSequenced

Last

Locate

Lookup

MethodAddress

MethodName

MoveBy

NewInstance

Next

Open

OpenDatabase

ParamByName

Post

Prepare

Prior

Refresh

RemoveComponent

Resync

RevertRecord

SafeCallException

SetFields

Translate

UnPrepare

UpdateAction

UpdateCursorPos

UpdateRecord

UpdateStatus


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataSet

TBDEDataSet

TDBDataSet

TQuery


 TDecisionSource

Hierarchy	Properties	Methods	Events	See also

TDecisionSource links a decision control to a configuration (pivot state) of the data from a decision cube.

Unit

mxdb

Description

Use TDecisionSource to provide a decision grid or decision graph with cross-tabulated data from a decision cube. TDecisionSource represents a particular pivot state of dimensions from the decision cube into row and column dimensions. TDecisionSource also provides methods to drill down the display of a dimension to focus on summaries over a single value, or hide or show dimensions in the pivot state.

All decision controls that share a decision source display the same pivot state. For example, a form could contain a decision grid and a decision graph linked to the same decision source. Pivoting the dimensions of the decision grid would automatically update the image of the graph accordingly. To display two separate projections of the information from a decision cube in a single form, use two separate decision sources.

The pivot state of a decision source can be changed by manipulating a decision grid or by using a decision pivot.


TDecisionSource properties

TDecisionSource	Alphabetically	Legend

In TDecisionSource

ControlType

CurrentSum

DecisionCube

nColDims

nDataCols

nDataRows

nDims

nOpenColDims

nOpenRowDims

nRowDims

nSums

Ready

SparseCols

SparseRows

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDecisionSource properties

TDecisionSource	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ControlType

CurrentSum

DecisionCube

DesignInfo

Name

nColDims

nDataCols

nDataRows

nDims

nOpenColDims

nOpenRowDims

nRowDims

nSums

Owner

Ready

SparseCols

SparseRows

Tag

VCLComObject


TDecisionSource.ControlType
TDecision.ControlType

TDecisionSource	See also

Specifies how the decision source responds to messages from the decision pivot.

type

  TDecisionControlType = (xtCheck, xtRadio, xtRadioEx);

property ControlType: TDecisionControlType;

Description

Use ControlType to specify what combination of row or column dimensions can be open at the same time. ControlType has one of the following values:

Value	Meaning

xtCheck	Pressing dimension buttons opens or closes an individual dimension, changing the number of open dimensions.

xtRadio	Pressing dimension buttons opens or closes the selected dimension and closes all other dimensions in that direction. When ControlType is xtRadio, at most one row dimension and one column dimension may be open at a time.

xtRadionEx	Pressing dimension buttons opens the selected dimension and closes all other dimensions in that direction or closes the selected dimension and opens another dimension in the same direction. When ControlType is xtRadioEx, exactly one row dimension and one column dimension must be open at any time.


TDecisionSource.CurrentSum

TDecisionSource	See also

Indicates the index of the current summary from the set of active summaries maintained by the decision cube.

property CurrentSum: Integer;

Description

Read CurrentSum to determine which of the active summaries is used to provide values to clients of the decision source. CurrentSum returns 0 if the first active summary is the current summary. CurrentSum returns nSums-1 if the last active summary is the current summary.

To change the current summary, use the SetCurrentSummary method. Use the GetSummaryName method to obtain the name of the current summary.

Note:	Do not pivot, subtotal, or drill the information provided by the Decision source unless the CurrentSum property refers to an additive summary. Additive Summaries are SUM and COUNT. AVERAGE (unless calculated internally by the Decision Cube), MAX, and MIN are not additive.


TDecisionSource.DecisionCube

TDecisionSource	See also

Specifies the decision cube that provides the crosstabulated data for the decision source.

property DecisionCube: TDecisionCube;

Description

Set DecisionCube to specify where the decision source should fetch its data. The decision cube maintains a multidimensional array of summaries in a cache. The decision source can provide decision controls with any projection of the data in that cache.


TDecisionSource.nColDims

TDecisionSource	See also

Indicates the number of column dimensions in the current pivot state of the decision source.

property nColDims: Integer;

Description

Read nColDims to determine the number of column dimensions the decision source can provide to a decision control. Column dimensions appear on the y axis of a decision graph or listed along the top of a decision grid. nColDims counts both the open and closed column dimensions. To determine the number of column dimensions actually provided to decision controls, use the nOpenColDims property.


TDecisionSource.nDataCols

TDecisionSource	See also

Indicates the number of columns provided to the data region of a decision grid.

property nDataCols: Integer;

Description

Read nDataCols to determine the number of summarized values the decision source provides for a row in a decision grid. Each of the columns counted by nDataCols represents a combination of values or dimension subtotals for each of the open column dimensions.


TDecisionSource.nDataRows

TDecisionSource	See also

Indicates the number of rows provided to the data region of a decision grid.

property nDataRows: Integer;

Description

Read nDataRows to determine the number of summarized values the decision source provides for a column in a decision grid. Each of the rows counted by nDataRows represents a combination of values or dimension subtotals for each of the open row dimensions.


TDecisionSource.nDims

TDecisionSource	See also

Indicates the number of active dimensions in the decision cube.

property nDims: Integer;

Description

Read nDims to determine the number of dimensions the decision source can provide to a decision control. The decision source does not necessarily provide decision controls with all the dimensions counted by the nDims property. Some of the dimensions may be closed.

The dimensions available through the decision source are divided into column dimensions and row dimensions. These are counted by the nColDims and nRowDims properties, respectively. nDims is equal to the sum of nColDims and nRowDims.


TDecisionSource.nOpenColDims

TDecisionSource	See also

Indicates the number of column dimensions provided by the decision source.

property nOpenColDims: Integer;

Description

Read nOpenColDims to determine the number of open column dimensions the decision source provides to a decision control. Column dimensions appear on the y axis of a decision graph or listed along the top of a decision grid. nOpenColDims counts only the open column dimensions that appear in the decision control. To determine the number of column dimensions potentially available in the current pivot state, use the nColDims property.


TDecisionSource.nOpenRowDims

TDecisionSource	See also

Indicates the number of row dimensions provided by the decision source.

property nOpenRowDims: Integer;

Description

Read nOpenRowDims to determine the number of open row dimensions the decision source provides to a decision control. Row dimensions appear on the x axis of a decision graph or listed along the left side of a decision grid. nOpenRowDims counts only the open row dimensions that appear in the decision control. To determine the number of row dimensions potentially available in the current pivot state, use the nRowDims property.


TDecisionSource.nRowDims

TDecisionSource	See also

Indicates the number of row dimensions in the current pivot state of the decision source.

property nRowDims: Integer;

Description

Read nRowDims to determine the number of row dimensions the decision source can provide to a decision control. Row dimensions appear on the x axis of a decision graph or listed along the left side of a decision grid. nRowDims counts both the open and closed row dimensions. To determine the number of row dimensions actually provided to decision controls, use the nOpenRowDims property.


TDecisionSource.nSums

TDecisionSource	See also

Indicates the number of active summaries in the decision cube.

property nSums: Integer;

Description

Read nSums to determine the number of summary types the decision source can provide to a decision control. The decision source can only provide decision controls with a single summary at a time. The CurrentSum property indicates which of the nSums possibilities is currently provided by the decision source.


TDecisionSource.Ready

TDecisionSource	See also

Indicates whether the decision source is linked to an active decision cube.

property Ready: Boolean;

Description

Read Ready to determine whether the decision source can provide data to a decision control.


TDecisionSource.SparseCols

TDecisionSource	See also

Indicates whether empty columns are removed from the current projection.

property SparseCols: Boolean;

Description

Set SparseCols to True to display columns that are empty in the current pivot state. Set SparseCols to False to show only those dimension values that have summarized data over one or more of the row dimensions.

Note:	SparseCols does not change the value returned by GetDimensionMemberCount.


TDecisionSource.SparseRows

TDecisionSource	See also

Indicates whether empty rows are removed from the current projection.

property SparseRows: Boolean;

Description

Set SparseRows to True to display rows that are empty in the current pivot state. Set SparseRows to False to show only those dimension values that have summarized data over one or more of the column dimensions.

Note:	SparseRows doesn’t change the value returned by GetDimensionMemberCount.


TDecisionSource events

TDecisionSource	Alphabetically	Legend

In TDecisionSource

OnAfterPivot

OnBeforePivot

OnLayoutChange

OnNewDimensions

OnStateChange

OnSummaryChange


TDecisionSource events

TDecisionSource	By object	Legend

OnAfterPivot

OnBeforePivot

OnLayoutChange

OnNewDimensions

OnStateChange

OnSummaryChange


TDecisionSource.OnAfterPivot

TDecisionSource	See also

Occurs immediately after the current pivot state changes.

property OnAfterPivot: TNotifyEvent;

Description

Write an OnAfterPivot event handler to take specific action after the information provided by the decision source changes but before any decision controls are updated to reflect the change. This is a good opportunity to save information about the pivot state.

When the pivot state of the decision source changes, an OnBeforePivot occurs when the results of the change have been calculated, and OnAfterPivot occurs when the decision source has been updated to reflect the change. Once the decision controls that are linked to the decision pivot are updated to reflect the change, an OnLayoutChange event occurs.


TDecisionSource.OnBeforePivot

TDecisionSource	See also

Occurs just before the current pivot state changes.

property OnBeforePivot: TNotifyEvent;

Description

Write an OnBeforePivot event handler to take specific action just before the information provided by the decision source changes. When OnBeforePivot occurs, the results of the pivot have been computed but not implemented. Use the GetGroup, GetIndex, GetState, GetValue, and GetRowState methods to get information about the pivot state that is about to be implemented. To get information about the pivot state that is ending, save the dimension information in an OnAfterPivot event handler. The information about the new state can then be compared to information captured the last time the pivot state was changed. The OnBeforePivot event handler can make additional alterations to the pivot state using the methods of the decision source.


TDecisionSource.OnLayoutChange

TDecisionSource	See also

Occurs immediately after decision controls are updated to reflect a change to the pivot state of the decision source.

property OnLayoutChange: TNotifyEvent;

Description

Write an OnLayoutChange event handler to respond to changes in the configuration of the active dimensions. OnLayoutChange occurs when the pivot or drill state changes, but the information cached by the decision cube remains the same. When OnLayoutChange occurs, the information the decision source can potentially provide does not change, only the current configuration of that information. To respond to changes in the data cached by the decision cube, use the OnNewDimensions event.


TDecisionSource.OnNewDimensions

TDecisionSource	See also

Occurs immediately after the data provided by the decision cube changes.

property OnNewDimensions: TNotifyEvent;

Description

Write an OnNewDimensions event handler to respond to changes that alter the data array, such as when the active property of a dimension in the data cube changes. When OnNewDimensions occurs, the information the decision source can provide changes. To respond to changes that reorganize the data but do not change the data cached by the data cube, use the OnEndPivot or OnLayoutChange event. To respond to changes in the data cube itself, use the OnStateChange event.


TDecisionSource.OnStateChange

TDecisionSource	See also

Occurs when the DecisionCube property changes.

property OnStateChange: TNotifyEvent;

Description

Write an OnStateChange event handler to respond when the DecisionCube property changes or when the decision cube’s Active property changes. To respond to less drastic changes, use the OnNewDimensions event, the OnLayoutChange event, or the OnEndPivot event.


TDecisionSource.OnSummaryChange

TDecisionSource	See also

Occurs immediately after the CurrentSum property changes.

property OnSummaryChange: TNotifyEvent;

Description

Write an OnSummaryChange event handler to take specific action when the summary provided by the decision source changes. The value of the CurrentSum property reflects the new current summary.


TDecisionSource methods

TDecisionSource	Alphabetically

In TDecisionSource

CloseDimIndexRight

Create

DefineProperties

Destroy

DrillDimIndex

Get2DDataAsVariant

GetActiveDim

GetDataAsString

GetDataAsVariant

GetDimensionMemberCount

GetDimensionName

GetGroup

GetGroupCount

GetGroupExtent

GetIndex

GetMemberAsString

GetMemberAsVariant

GetRowState

GetState

GetSummaryName

GetValue

GetValueArray

GetValueIndex

MoveDimIndexes

OpenDimIndexLeft

OpenDimIndexRight

SetCurrentSummary

SwapDimIndexes

ToggleDimIndex

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDecisionSource methods

TDecisionSource	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

CloseDimIndexRight

Create

DefaultHandler

DefineProperties

Destroy

DestroyComponents

Destroying

Dispatch

DrillDimIndex

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

Get2DDataAsVariant

GetActiveDim

GetDataAsString

GetDataAsVariant

GetDimensionMemberCount

GetDimensionName

GetGroup

GetGroupCount

GetGroupExtent

GetIndex

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetMemberAsString

GetMemberAsVariant

GetNamePath

GetParentComponent

GetRowState

GetState

GetSummaryName

GetValue

GetValueArray

GetValueIndex

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

MoveDimIndexes

NewInstance

OpenDimIndexLeft

OpenDimIndexRight

RemoveComponent

SafeCallException

SetCurrentSummary

SwapDimIndexes

ToggleDimIndex

UpdateAction


TDecisionSource.CloseDimIndexRight

TDecisionSource	See also

Closes a dimension.

procedure CloseDimIndexRight(dimGroup: TDimGroup; Index: Integer; bOpen: Boolean);

Description

Call CloseDimIndexRight to close a dimension so that it does not appear in the projection displayed by decision controls that use the decision source.

CloseDimIndexRight closes the first open dimension after the dimension identified by the Index parameter.

The dimGroup parameter indicates whether the dimension to be closed is a row dimension (dgRow) or a column dimension (dgCol). No other values for dimGroup should be used with the CloseDimIndexRight method.

If the dimGroup parameter is dgRow, Index identifies a row dimension, where 0 specifies the first row dimension, 1 specifies the second row dimension, and so on. If the dimGroup parameter is dgCol, Index identifies a column dimension, starting with an index of 0 for the first column dimension. No other values for dimGroup should be used with the CloseDimIndexRight method. To close the first open row or column dimension, set Index to -1.

The bOpen parameter specifies whether closed dimensions are counted when interpreting Index. Only open dimensions are counted when bOpen is True.


TDecisionSource.Create

TDecisionSource	See also

Creates and initializes an instance of TDecisionSource.

constructor Create( AOwner: TComponent ); override;

Description

Call Create to instantiate a decision source at runtime. Decision source objects placed in forms or data modules at design time are created automatically.


TDecisionSource.DefineProperties

TDecisionSource	See also

Designates methods for storing the decision source’s unpublished data on a stream such as a form file.

procedure DefineProperties(Filer: TFiler); override;

Description

Do not call DefineProperties. It is called automatically when forms or data modules containing a decision source component are loaded or saved.

DefineProperties allows the decision source to load and save information as if it were a set of published property values. The decision source uses this method to save some of its unpublished properties, including

CurrentSum

nDims

nSums

DefineProperties also calls the inherited method, to allow additional properties or pseudo-properties to be saved with the decision source.


TDecisionSource.Destroy

TDecisionSource	See also

Destroys an instance of TDecisionSource.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the decision source reference is not nil and only then calls Destroy.

For all decision controls linked to the decision source, Destroy changes the DecisionSource property to nil.


TDecisionSource.DrillDimIndex

TDecisionSource	See also

Collapses a dimension to focus on a single value.

procedure DrillDimIndex(dimGroup: TDimGroup; Index: Integer; ValueIndex: Integer; bOpen: Boolean);

Description

Call DrillDimIndex to “drill down” on a dimension, so that only the summaries for a single value are displayed.

The dimGroup parameter specifies the type of dimension to be drilled. If dimGroup is dgRow, the Index parameter identifies a row dimension to be drilled. If dimGroup is dgCol, Index identifies a column dimension to be drilled. No other values for dimGroup should be used with the DrillDimIndex method. The first row or column dimension has an Index of 0, the second dimension has an Index of 1, and so on.

The ValueIndex parameter is the index of single value from all values over the dimension that should be displayed. To display only the summaries over the entire dimension, rather than for a single value along the dimension, set ValueIndex to -1.

 The bOpen parameter specifies whether closed dimensions are counted when interpreting Index. Only open dimensions are counted when bOpen is True.

To restore the dimension from its drilled state so that it displays all values again, use the ToggleDimIndex method.

Note:	Do not drill a dimension of the Decision Source unless the CurrentSum property specifies an additive summary. Additive Summaries are SUM and COUNT.  AVERAGE (unless calculated internally by the Decision Cube), MAX, and MIN are not additive.


TDecisionSource.Get2DDataAsVariant

TDecisionSource	See also

Returns the summary for a two dimensional projection of the current pivot state.

function Get2DDataAsVariant(iDimA, iDimB: Integer; aValueIndex, bValueIndex: Integer): Variant;

Description

Call Get2DDataAsVariant to obtain the summary value from the decision cube that corresponds to the coordinates of aValueIndex on the iDimA dimension and bValueIndex on the iDimB dimension. The returned value is a variant that summarizes all values over the other active dimensions, unless they are drilled. For drilled dimensions, only the drilled value is included in the summary.

The iDimA and iDimB parameters specify the dimensions for the two dimensional projection, where 0 indicates the first active dimension, 1 indicates the second active dimension, and so on. The dimension indexes are expressed as absolute indexes. To obtain an absolute index from a row or column index, use the GetActiveDim method. The aValueIndex and bValueIndex parameters are the indexes of the values on the two dimensions, where 0 indicates the first value, 1 indicates the second value, and so on. Use the GetMemberAsString or GetMemberAsVariant method to obtain the field values that correspond to the aValueIndex and bValueIndex parameters.


TDecisionSource.GetActiveDim

TDecisionSource	See also

Converts a row-specific or column-specific dimension index into an absolute dimension index.

function GetActiveDim(dimGroup: TDimGroup; Index: Integer; bOpen: Boolean): Integer;

Description

Call GetActiveDim to obtain the index of a dimension in the decision cube from its position in a decision grid. The names and values of row dimensions appear in the label cells on the right of the decision grid. The first row dimension appears in the first column, the second row dimension appears in the second column, and so on. Similarly, column dimensions appear in the label cells on the top of the decision grid, with the first column dimension appearing in the first row of the grid.

The dimGroup parameter indicates whether the dimension of interest is a row dimension or column dimension. If dimGroup is dgRow, the dimension is a row dimension. If dimGroup is dgCol, the dimension is a column dimension. GetActiveDim is only implemented for dimGroup values of dgRow and dgCol.

The Index parameter indicates the position of the dimension in the set of row or column dimensions, where 0 specifies the first row or column dimension, 1 specifies the second dimension, and so on.

The bOpen parameter specifies whether closed dimensions are counted when interpreting Index. Only open dimensions are counted when bOpen is True.

GetActiveDim returns the absolute index of the dimension. Absolute indexes are used by many methods of the decision source, such as GetDimensionName or GetMemberAsString.

Note:	To obtain a row-specific index or column-specific index from an absolute dimension index, use the GetIndex method.


TDecisionSource.GetDataAsString

TDecisionSource	See also

Returns the data value that should appear in the cell of a decision grid, formatted as a string.

function GetDataAsString(ARow, ACol:Integer; var SubLevel: Integer): String;

Description

Call GetDataAsString to obtain the display string for a data cell in a decision grid. The ARow and ACol parameters indicate the row and column numbers of the cell in the decision grid, where (0,0) specifies the top left cell in the data region.

GetDataAsString computes the dimension coordinates in the decision cube that correspond to the row and column indexes, making note of all dimensions over which subtotals must be taken. It then obtains the summary value from the decision cube, combining values for each summarized dimension. GetDataAsString returns the final summary value, formatted as a string. It also returns the number of summarized dimensions in the SubLevel parameter.


TDecisionSource.GetDataAsVariant

TDecisionSource	See also

Returns the data value that should appear in the cell of a decision grid.

function GetDataAsVariant(ARow, ACol: Integer; var SubLevel: Integer): Variant;

Description

Call GetDataAsVariant to obtain the value of a data cell in a decision grid. The ARow and ACol parameters indicate the row and column numbers of the cell in the decision grid, where (0,0) specifies the top left cell in the data region.

GetDataAsVariant computes the dimension coordinates in the decision cube that correspond to the row and column indexes, making note of all dimensions over which subtotals must be taken. It then obtains the summary value from the decision cube, combining values for each summarized dimension. GetDataAsVariant returns the final summary value. It also returns the number of summarized dimensions in the SubLevel parameter.


TDecisionSource.GetDimensionMemberCount

TDecisionSource	See also

Returns the number of distinct values to be displayed for a given dimension.

function GetDimensionMemberCount(iDim: Integer): Integer;

Description

Call GetDimensionMemberCount to determine the number of values in the dimension identified by the iDim parameter. The iDim parameter is the absolute index of the dimension, where 0 indicates the first active dimension in the decision cube, 1 indicates the second active dimension, and so on. To convert from a row-specific or column-specific dimension index into an absolute dimension index, use the GetActiveDim method.

GetDimensionMemberCount provides an upper limit to the ValueIndex parameter of the GetMemberAsString or GetMemberAsVariant method.

Note:	The value returned by GetDimensionMemberCount may change depending on the pivot state.


TDecisionSource.GetDimensionName

TDecisionSource	See also

Returns the display name for a dimension.

function GetDimensionName(iDim: Integer): String;

Description

Call GetDimensionName to obtain a name to display as a label for the dimension. The iDim parameter is the absolute index of the dimension, where 0 indicates the first active dimension in the decision cube, 1 indicates the second active dimension, and so on. To convert from a row-specific or column-specific dimension index into an absolute dimension index, use the GetActiveDim method.

The name of a dimension is often the name of the field the dimension represents. The dimension name can be changed in the Decision Cube Editor or by setting the Name property of the dimension in the dimension map of the decision cube.


TDecisionSource.GetGroup

TDecisionSource	See also

Indicates where a dimension appears in the current pivot state.

function GetGroup(iDim: Integer): TDimGroup;

Description

Call GetGroup to determine how the dimension specified by the iDim parameter is used in the current pivot state. The iDim parameter is the absolute index of the dimension, where 0 is the first active dimension, 1 is the second active dimension, and so on.

If the dimension is a row dimension (displayed to the left of a decision grid or on the y-axis of a decision graph), GetGroup returns dgRow. If it is a column dimension (displayed at the top of a decision grid or on the x-axis of a decision graph), GetGroup returns dgCol. If the dimension is a paged dimension (not appearing in the decision control but limiting the data to a single value along the dimension), GetGroup returns dgPage. GetGroup never returns dgSum or dgNone.

Note:	To determine the position of the dimension within the row dimensions or column dimensions, use the GetIndex method.


TDecisionSource.GetGroupCount

TDecisionSource	See also

Returns the number of dimensions there are of a specified type.

function GetGroupCount( dimGroup: TDimGroup, bOpen: Boolean): Integer;

Description

Call GetGroupCount to determine how many row, column, or paged dimensions exist in the current pivot state.

Specify the type of dimension to count as the value of dimGroup. This value can be dgRow, dgCol, or dgPage.  Do not use other TDimGroup values with GetGroupCount.

bOpen indicates whether to count all dimensions (including those currently closed), or only the open dimensions.

Note:	You can get the same information about row and column dimensions using the NRowDims, nOpenRowDims, nColDims, or nOpenColDims property.


TDecisionSource.GetGroupExtent

TDecisionSource	See also

Returns the range of cell indexes for a single value of a dimension.

type

  TDimRange = Record

    First: Integer;

    Last: Integer;

  end;

function GetGroupExtent(dimGroup: TDimGroup; Index: Integer; Cell: Integer): TDimRange;

Description

Call GetGroupExtent to find the range of cells in a decision grid that has the same value on a given dimension as the cell specified by the Cell parameter.

Cell is the index of the row or column containing the cell, where 0 specifies the first row or column in the data area of a decision grid.

If dimGroup is dgRow, Cell identifies a row of the grid. If dimGroup is dgCol, Cell identifies a column of the grid. Do not use other values for dimGroup.

Index specifies the row-specific or column-specific index of the dimension.

For example, if a decision grid has two row dimensions listed in the first two columns of the decision grid, the line

MyRange := GetGroupExtent(dgRow, 0, 3);

sets MyRange to the range of row indexes for cells that have the same value on the first row dimension as the third cell. The number of cells in this range is the same as the value returned by GetDimensionMemberCount for the second open row dimension. The line

MyRange := GetGroupExtent(dgRow, 1, 3);

sets MyRange to the range from 3 to 3, because the second row dimension is the innermost row dimension, so each value is represented by a single row.

Note:	If the dimension includes subtotals, the subtotal cell is included in the range returned by GetGroupExtent.


TDecisionSource.GetIndex

TDecisionSource	See also

Returns the row-specific or column-specific index of a dimension.

function GetIndex(iDim: Integer; bOpen: Boolean): Integer;

Description

Call GetIndex to obtain the row-specific index or column-specific index of a dimension from its index in the decision cube. GetIndex returns 0 for the first row dimension or the first column dimension. GetIndex returns 1 for the second row dimension or the second column dimension, and so on. The iDim parameter is the absolute index of the dimension. If the bOpen parameter is True, GetIndex is the position of the dimension when only open dimensions are counted. If bOpen is False, all dimensions, including closed dimensions are counted.

Use the GetGroup method to determine whether the index returned by GetIndex is a row-specific index (GetGroup returns dgRow) or a column-specific index (GetGroup returns dgCol).

To obtain the index of a dimension in the decision cube from its row-specific or column-specific index, use the GetActiveDim method.


TDecisionSource.GetMemberAsString

TDecisionSource	See also

Returns the label string for a dimension value.

function GetMemberAsString(iDim: Integer; ValueIndex: Integer): String;

Description

Call GetMemberAsString to obtain the value indicated by the ValueIndex parameter along the dimension specified by the iDim parameter, formatted as a string.

The iDim parameter is the absolute index of the dimension, where 0 indicates the first active dimension in the decision cube, 1 indicates the second active dimension, and so on. To convert from a row-specific or column-specific dimension index into an absolute dimension index, use the GetActiveDim method.

The ValueIndex parameter is the index of a value along the dimension, where 0 specifies the first value of the dimension and GetDimensionMemberCount returns the number of values along the dimension.


TDecisionSource.GetMemberAsVariant

TDecisionSource	See also

Returns a value along a dimension.

function GetMemberAsVariant(iDim: Integer; ValueIndex: Integer): Variant;

Description

Call GetMemberAsVariant to obtain the value indicated by the ValueIndex parameter along the dimension specified by the iDim parameter.

The iDim parameter is the absolute index of the dimension, where 0 indicates the first active dimension in the decision cube, 1 indicates the second active dimension, and so on. To convert from a row-specific or column-specific dimension index into an absolute dimension index, use the GetActiveDim method.

The ValueIndex parameter is the index of a value along the dimension, where 0 specifies the first value of the dimension and GetDimensionMemberCount returns the number of values along the dimension.


TDecisionSource.GetRowState

TDecisionSource	See also

Indicates whether the adjacent dimensions are open or closed.

type

  TRowStates = (rcNextOpen, rcPrevOpen, rcNextClosed, rcPrevClosed);

TRowState = set of TRowStates;

function GetRowState(iDim: Integer): TRowState;

Description

Call GetRowState to determine the state of the dimensions that are adjacent to a dimension in the current pivot state. The iDim parameter specifies the absolute index of the dimension whose neighbors are to be checked. When iDim is 0, the dimension is the first active dimension in the decision cube. When iDim is 1, it is the second active dimension, and so on.

The return value includes rcPrevOpen if the previous dimension is open or rcPrevClosed if the previous dimension is closed. The return value includes rcNextOpen if the following dimension is open or rcNextClosed if it is closed. The first row or column dimension does not include either rcPrevOpen or rcPrevClosed. The last row or column does not include either rcNextOpen or rcNextClosed.

Note:	Do not be confused by the name of the GetRowState method. It provides information about the adjacent column dimensions if iDim specifies a column dimension, or information about the adjacent row dimensions if iDim specifies a row dimension.


TDecisionSource.GetState

TDecisionSource	See also

Returns the state of a dimension.

type

  TDimState = (dmClosed, dmOpen, dmDrilled, dmPaged, dmNone);

function GetState(iDim: Integer): TDimState;

Description

Call GetState to determine whether a specified dimension is open, closed, or drilled. The iDim parameter is the absolute index of the dimension, where 0 specifies the first active dimension in the decision cube, 1 specifies the second active dimension, and so on. GetState returns one of the following values:

Value	Meaning

dmClosed	The dimension is closed. None of its values appear in the decision control.

dmOpen	The dimension is open. All of its values appear in the decision control.

dmDrilled	The dimension is drilled. Only a single value (or a summary over all values) along the dimension appears in the decision control.

dmPaged	The dimension can only display a single value or summarize all values together.

dmNone	The dimension is not active.

Note:	The state dmDrilled appears the same as dmPaged in a decision control. However, drilled dimensions can be changed to open or closed, while paged dimensions cannot change their state. Paged dimensions use considerably less memory than other types.


TDecisionSource.GetSummaryName

TDecisionSource	See also

Returns the name of an active summary in the decision cube.

function GetSummaryName(iSum: Integer): String;

Description

Call GetSummaryName to determine the name of a summary. The iSum parameter is the index of the summary from the list of active summaries available from the decision cube. Use GetSummaryName to determine the name of the possible summaries that can be set using the SetCurrentSummary method.


TDecisionSource.GetValue

TDecisionSource	See also

Returns the drill value of a drilled or paged dimension.

function GetValue(iDim: Integer): Integer;

Description

Call GetValue to determine the value focused on by a drilled or paged dimension. Drilled dimensions and paged dimensions display only the data for a single field value along the dimension. GetValue returns the index of that single value. The value itself can be obtained from this index by calling the GetMemberAsString or GetMemberAsVariant method.

The iDim parameter is the absolute index of the drilled or paged dimension, where 0 specifies the first active dimension in the decision cube, 1 specifies the second active dimension, and so on.

Note:	If the dimension is drilled so that it displays only summaries over all the values in the dimension, GetValue returns -1. If the dimension specified by the iDim parameter is not drilled or paged, GetValue returns -1.


TDecisionSource.GetValueArray

TDecisionSource	See also

Returns the values of all dimension fields over which a data cell is summarized.

function GetValueArray(ACol, ARow: Integer; var ValueArray: TSmallIntArray): Boolean;

Description

Call GetValueArray to obtain the coordinates of a data cell from a decision grid in the multidimensional array maintained by the decision cube. The ACol and ARow parameters represent the indexes of the column and row containing the cell, where (0,0) specifies the upper left data cell, not the top left cell in the grid. The ValueArray parameter returns the indexes of the field values along each active dimension. An index of -1 indicates that the cell represents a subtotal across all values in the corresponding dimension. Use the GetMemberAsString or GetMemberAsVariant method to convert the indexes in the ValueArray parameter into field values. GetValueArray returns a boolean indicating whether the function was successful.


TDecisionSource.GetValueIndex

TDecisionSource	See also

Returns the index of a single dimension value that corresponds to a cell in a decision grid.

function GetValueIndex(dimGroup: TDimGroup; Index: Integer; Cell: Integer; var isBreak: Boolean; var isSum: boolean) : Integer;

Description

Call GetValueIndex to obtain the coordinate of a cell in a decision grid along the dimension specified by the Index parameter. The dimGroup parameter indicates whether the dimension is a row dimension (dgRow) or a column dimension (dgCol). Do not call GetValueIndex with dimGroup set to any other TDimGroup value. The Index parameter is the row- or column-specific index of the dimension. The first row or column dimension has an Index of 0, the second dimension has an Index of 1, and so on. The Cell parameter is the index of the cell row or column, where 0 specifies the first row or column in the data region of the grid.

In addition to returning the index of the dimension value, GetValueIndex provides additional information about the position of Cell within the cells for the dimension. GetValueIndex sets isBreak to True when Cell is the first cell in the dimension group with the returned value on the specified dimension. GetValueIndex sets iSum to True when Cell represents a subtotal over the dimension.


TDecisionSource.MoveDimIndexes

TDecisionSource	See also

Changes the position of a dimension.

procedure MoveDimIndexes(SDimGroup, DDimGroup: TDimGroup; SIndex, DIndex: Integer; bOpen: Boolean);

Description

Call MoveDimIndexes to change the pivot state of the decision grid. MoveDimIndexes moves the dimension indicated by the SIndex and SDimGroup parameters to the position indicated by the DIndex and DDimGroup parameters.

The SDimGroup and DDimGroup parameters specify whether the dimension position is along the rows of a decision grid (SDimGroup or DDimGroup is dgRow), or across the columns of the decision grid (SDimGroup or DDimGroup is dgCol). The SIndex and DIndex parameters indicate the index of the dimension position among the row dimensions or column dimensions, where 0 specifies the first position, 1 specifies the second position, and so on. The bOpen parameter specifies whether closed dimensions are counted when interpreting the SIndex and DIndex parameters. When bOpen is True, only open dimensions are counted.

Note:	Do not move a dimension of the Decision Source unless the CurrentSum property specifies an additive summary. Additive Summaries are SUM and COUNT.  AVERAGE (unless calculated internally by the Decision Cube), MAX, and MIN are not additive.


TDecisionSource.OpenDimIndexLeft

TDecisionSource	See also

Opens the first closed dimension that appears before a specified dimension.

procedure OpenDimIndexLeft(dimGroup: TDimGroup; Index: Integer; bOpen: Boolean);

Description

Call OpenDimIndexLeft to reopen a closed dimension so that its values appear in the decision control.

OpenDimIndexLeft opens the first closed dimension before the dimension identified by the Index parameter. If the dimGroup parameter is dgRow, Index identifies a row dimension, where 0 specifies the first row dimension, 1 specifies the second row dimension, and so on. If the dimGroup parameter is dgCol, Index identifies a column dimension, starting with an index of 0 for the first column dimension. No other values for dimGroup should be used with the OpenDimIndexLeft method. To open the last closed row or column dimension, set Index to -1. The bOpen parameter specifies whether closed dimensions are counted when interpreting Index. Only open dimensions are counted when bOpen is True.


TDecisionSource.OpenDimIndexRight

TDecisionSource	See also

Opens the first closed dimension that appears after a specified dimension.

procedure OpenDimIndexRight(dimGroup: TDimGroup; Index: Integer; bOpen: Boolean);

Description

Call OpenDimIndexRight to reopen a closed dimension so that its values appear in the decision control.

OpenDimIndexRight opens the first closed dimension after the dimension identified by the Index parameter. If the dimGroup parameter is dgRow, Index identifies a row dimension, where 0 specifies the first row dimension, 1 specifies the second row dimension, and so on. If the dimGroup parameter is dgCol, Index identifies a column dimension, starting with an index of 0 for the first column dimension. No other values for dimGroup should be used with the OpenDimIndexRight method. To open the first closed row or column dimension, set Index to -1. The bOpen parameter specifies whether closed dimensions are counted when interpreting Index. Only open dimensions are counted when bOpen is True.


TDecisionSource.SetCurrentSummary

TDecisionSource	See also

Specifies which summary is provided by the decision source.

procedure SetCurrentSummary(Value: Integer);

Description

The decision cube maintains a set of active summaries in its cache. The decision source can only present one of those summaries to decision controls. Call SetCurrentSummary to specify which of the active summaries is surfaced by the decision source. The Value parameter specifies the index of the summary in the list of active summaries maintained by the decision cube.

To obtain the names of the active summaries from which the current summary is chosen, use the GetSummaryName method.


TDecisionSource.SwapDimIndexes

TDecisionSource	See also

Interchanges the positions of two dimensions.

procedure SwapDimIndexes(SDimGroup, DDimGroup: TDimGroup; SIndex, DIndex: Integer; bOpen: Boolean);

Description

Call SwapDimIndexes to change the pivot state of the decision grid. SwapDimIndexes interchanges the positions of the dimension indicated by the SIndex and SDimGroup parameters and the dimension indicated by the DIndex and DDimGroup parameters.

The SDimGroup and DDimGroup parameters specify whether the dimension position is along the rows of a decision grid (SDimGroup or DDimGroup is dgRow), or across the columns of the decision grid (SDimGroup or DDimGroup is False). The SIndex and DIndex parameters indicate the index of the dimension position among the row dimensions or column dimensions, where 0 specifies the first position, 1 specifies the second position, and so on. The bOpen parameter specifies whether closed dimensions are considered when interpreting the SIndex and DIndex parameters. When bOpen is True, only open dimensions are counted.

Note:	Do not move a dimension of the Decision Source unless the CurrentSum property specifies an additive summary. Additive Summaries are SUM and COUNT.  AVERAGE (unless calculated internally by the Decision Cube), MAX, and MIN are not additive.


TDecisionSource.ToggleDimIndex

TDecisionSource	See also

Changes whether a dimension is open, closed, or drilled.

procedure ToggleDimIndex(dimGroup: TDimGroup; Index: Integer; bOpen: Boolean);

Description

Call ToggleDimIndex to open a closed dimension, close an open dimension, or expand a drilled dimension.

When dimGroup is dgRow, the Index parameter specifies the row-specific index of the dimension. When dimGroup is dgCol, Index specifies the column-specific index of the dimension. The first row or column dimension has an Index of 0, the second dimension has an Index of 1, and so on. The bOpen parameter specifies whether closed dimensions should be counted when interpreting the Index parameter. When bOpen is True, only open dimensions are counted.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TDeleteButton

Hierarchy	Properties	Methods	See also

TDeleteButton generates an HTML control that deletes a record from an XML data packet.

Unit

MidItems

Description

Add TDeleteButton as the child of a TDataNavigator component (or a layout group that is a child of a TDataNavigator component) to enable the generated HTML form to delete records. The resulting HTML button’s action adds the record deletion to the emerging delta packet, which can then be submitted using an apply updates button.

Use the properties of TDeleteButton to customize the appearance of the button and associate it with a Web item. The associated Web item displays the records that the delete button can delete.


TDeleteButton properties

TDeleteButton	Alphabetically	Legend

Derived from TDataSetButton

Caption

Derived from TXMLDisplayReferenceButton

XMLComponent

XMLUseParent

Derived from TWebButton

Custom

Style

StyleRule

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDeleteButton properties

TDeleteButton	By object	Legend

Caption

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

XMLComponent

XMLUseParent


TDeleteButton methods

TDeleteButton	Alphabetically

In TDeleteButton

Create

Derived from TXMLDisplayReferenceButton

Destroy

Derived from TWebButton

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDeleteButton methods

TDeleteButton	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TDeleteButton.Create

TDeleteButton	See also

Creates and initializes an instance of TDeleteButton.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TDeleteButton at runtime. Buttons added at design time using the Web Page editor are instantiated automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebButton

TXMLDisplayReferenceButton

TDataSetButton


EDimIndexError

Hierarchy	Properties	Methods	See also

EDimIndexError is the exception class for when an invalid index is used to specify a dimension in a decision source.

Unit

mxdb

Description

EDimIndexError is raised when any of the methods of a decision source are called with a dimension index that does not correspond to a dimension.


EDimIndexError properties

EDimIndexError	Alphabetically

Derived from Exception

HelpContext

Message


EDimIndexError properties

EDimIndexError	By object

HelpContext

Message


EDimIndexError methods

EDimIndexError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelpException_CreateResHelp>Main

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EDimIndexError methods

EDimIndexError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelpException_CreateResHelp>Main

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


TDimensionItem

Hierarchy	Properties	Methods	See also

TDimensionItem is the base class for objects that represent dimensions and summaries in a crosstabulated data store.

Unit

mxcommon

Description

Use TDimensionItem as a base class when defining classes that represent the fields used by a crosstabulated data store. TDimensionItem describes a field from the data set used by a crosstabulated data store and the role that field plays in the data store. Crosstabulated data stores automatically create dimension items to represent the fields that make up their multidimensional arrays of summary values.

TDimensionItem has a single descendant, TCubeDim, that enhances the dimension item with the ability to represent date ranges.


TDimensionItem properties

TDimensionItem	Alphabetically	Legend

In TDimensionItem

ActiveFlag

BaseName

DerivedFrom

DimensionType

FieldName

FieldType

Format

Name

Derived from TCollectionItem

Collection

DisplayName

ID

Index


TDimensionItem properties

TDimensionItem	By object	Legend

ActiveFlag

BaseName

Collection

DerivedFrom

DimensionType

DisplayName

FieldName

FieldType

Format

ID

Index

Name


TDimensionItem.ActiveFlag

TDimensionItem	See also

Indicates whether the dimension item is stored in the cache of a crosstabulated data store.

type TActiveFlags = (diActive, diAsNeeded, diInactive);

property ActiveFlag: TActiveFlags;

Description

Set ActiveFlag to diActive when it is critical that the dimension item is available at all times. Set ActiveFlag to diAsNeeded instead if the dimension item is used less frequently. The decision cube swaps dimension items with Active set to diAsNeeded in and out of the cache depending on when they are actually used, in order to conserve memory. Set ActiveFlag to diInactive to collapse the multidimensional array maintained by the data store so that it does not include the dimension item. When ActiveFlag is diInactive, the data store can not provide information about the dimension item to a decision source object.

The memory needs of a crosstabulated data store increase geometrically with each active dimension that is included. Memory needs increase linearly with each active summary that is included. Applications must find the best balance between the performance benefit of caching many dimensions and summaries so that they are immediately available to decision controls, and the need to keep the size of the cached multidimensional data array small enough so that it does not consume inordinate amounts of memory.


TDimensionItem.BaseName

TDimensionItem	See also

Specifies the FieldName of the database field that is represented by or summarized in the dimension item.

property BaseName: String;

Description

Use BaseName to identify the field whose values underlie the dimension item. If the dimension item represents a dimension then BaseName is the name of the field that corresponds to the dimension. Otherwise, BaseName is the field name of the field whose values are summarized by the dimension item.

Note:	Basename is a fully qualified SQL selector. Table and field names must be correctly punctuated, including quotations.


TDimensionItem.DerivedFrom

TDimensionItem	See also

Specifies the index of a dimension item from which a derived value is calculated.

property DerivedFrom: Integer;

Description

Read DerivedFrom to determine whether the dimension item represents a field from the dataset of its decision cube. Dimension items that represent averages do not come directly from the dataset, but are derived from count and summary fields that appear in the dataset. When a derived average dimension item is created, DerivedFrom is set to the index of the count or summary dimension item. The corresponding summary or count dimension item is located by matching the BaseName property when the derived values are calculated.


TDimensionItem.DimensionType

TDimensionItem	See also

Indicates the use of the dimension item.

type TDimFlags = (dimDimension, dimSum, dimCount, dimAverage, dimMin, dimMax, dimGenericAgg, dimUnknown);

property DimensionType: TDimFlags;

Description

Read DimensionType to determine whether the dimension item represents a dimension of the multidimensional array maintained by the crosstabulated data store or whether the dimension item represents a summary field that supplies the values to the cells of the multidimensional array. If the dimension item represents a summary, DimensionType also indicates the type of summary.

Do not set DimensionType if the dimension item represents a field from a query. The value of DimensionType is set automatically to reflect the semantics of the query if the crosstabulated data store that uses the dimension item is bound to a query. If the data store is bound to another type of data set, set DimensionType to a value that indicates the use of the dimension item in the multidimensional array.

DimensionType can have any of the following values:

Value	Meaning

dimDimension	The dimension item represents a dimension of the multidimensional array.

dimSum	The dimension item is a summary that represents the sum of a field value.

dimCount	The dimension item is a summary that represents the count of nonblank field values.

dimAverage	The dimension item is a summary that represents the average field value.

dimMin	The dimension item is a summary that represents the minimum field value. (not currently implemented)

dimMax	The dimension item is a summary that represents the maximum field value. (not currently implemented)

dimGenericAgg	The dimension item is some other type of summary.

dimUnknown	The use of the dimension item is not known. This occurs when the DataSet property of the data store is not based on a query. The value must be changed before the dimension item can be used.


TDimensionItem.FieldName

TDimensionItem	See also

Specifies the name of the field that the dimension item represents.

property FieldName: String;

Description

Read FieldName to determine the name of the field on which the dimension item is based. FieldName is the same as the FieldName property of the TField object the dimension represents.

Do not set the FieldName property. Its value is set automatically to indicate the field from the dataset that supplies the values for the dimension item. To change the name used by decision controls that display the dimension, use the Name property instead.


TDimensionItem.FieldType

TDimensionItem	See also

Indicates the data type of the field that the dimension item represents.

property FieldType: TFieldType;

Description

Read FieldType to determine the type of data that makes up the values of the dimension item. FieldType is the same as the DataType property of the corresponding TField object from the dataset of the crosstabulated data store.

Do not set the FieldType property. The value of FieldType is set automatically to reflect the type of data provided by the dimension item.


TDimensionItem.Format

TDimensionItem	See also

Indicates how field values are formatted on dimensions that represent numeric or temporal data.

property Format: String;

Description

Set Format on dimension items that represent numeric or temporal fields. The format specifiers that make up the Format string depend on the field type.

See the FormatFloat runtime library function for a description of the format specifiers for a numeric field. See the FormatDateTime runtime library function for a description of the format specifiers for a temporal field.

Decision controls that display value names read the value of Format, but can override it when formatting field values.


TDimensionItem.Name

TDimensionItem	See also

Denotes the name of a dimension or summary.

property Name: String;

Description

Set Name to change the name provided by the GetDimensionName or GetSummaryName method of the crosstabulated data store. Decision controls that display dimension names read the value of Name, but can override it.


TDimensionItem methods

TDimensionItem	Alphabetically

In TDimensionItem

IsDimension

IsSummary

Derived from TCollectionItem

Create

Destroy

GetNamePath

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDimensionItem methods

TDimensionItem	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

IsDimension

IsSummary

MethodAddress

MethodName

NewInstance

SafeCallException


TDimensionItem.IsDimension

TDimensionItem	See also

Indicates whether the dimension item represents a dimension.

function IsDimension: Boolean;

Description

Call IsDimension to determine the use of the dimension item. IsDimension returns True if the dimension item represents one of the dimensions of the multidimensional array maintained by a crosstabulated data store. IsDimension returns False if the dimension item represents a field that provides the summary values that fill the cells of the multidimensional array.


TDimensionItem.IsSummary

TDimensionItem	See also

Indicates whether the dimension item represents a summary.

function IsSummary: Boolean;

Description

Call IsSummary to determine the use of the dimension item. IsSummary returns True if the dimension item represents a field that provides the summary values that fill the cells of the multidimensional array maintained by a crosstabulated data store. IsSummary returns False if the dimension item represents a one of the dimensions of the multidimensional array.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem


TDimensionItems

Hierarchy	Properties	Methods	See also

TDimensionItems is the base class for objects that represent dimension maps.

Unit

mxcommon

Description

Use TDimensionItems as a base class when defining classes that represent the dimension map of a crosstabulated data store. TDimensionItems represents a collection of TDimensionItem objects, where each TDimensionItem corresponds to a field from the data set of the crosstabulated data store.

TDimensionItems has a single descendant, TCubeDims, that adds additional functionality to handle dimension maps that include date ranges.


TDimensionItems properties

TDimensionItems	Alphabetically	Legend

In TDimensionItems

ActiveDimensionCount

ActiveSummaryCount

DimensionCount

Items

SummaryCount

Derived from TCollection

Count

ItemClass


TDimensionItems properties

TDimensionItems	By object	Legend

ActiveDimensionCount

ActiveSummaryCount

Count

DimensionCount

ItemClass

Items

SummaryCount


TDimensionItems.ActiveDimensionCount

TDimensionItems	See also

Indicates the number of dimension items that represent active dimensions in the crosstabulated data store.

property ActiveDimensionCount: Integer;

Description

Read ActiveDimensionCount to determine the number of dimensions in the multidimensional data array cached by the data store. The memory requirements of the cached array go up exponentially with each active dimension, so ActiveDimensionCount provides a rough sense of the size of the cached array.

ActiveDimensionCount is the number of dimension items in the Items array that have their DimensionType property set to dimDimension and their Active property set to True. Change ActiveDimensionCount indirectly by changing the Active property on dimension items with DimensionType values of dimDimension.

The DimensionCount property indicates the total number of dimension items with DimensionType set to dimDimension. It provides an upper limit to the ActiveDimensionCount property.


TDimensionItems.ActiveSummaryCount

TDimensionItems	See also

Indicates the number of dimension items that represent active summaries in the crosstabulated data store.

property ActiveSummaryCount: Integer;

Description

Read ActiveSummaryCount to determine the number of summaries in the cells of the multidimensional data array cached by the data store. The memory requirements of the cached array go up linearly with each active summary. ActiveSummaryCount is the number of different summaries that can be made available to decision controls.

ActiveSummaryCount is the number of dimension items in the Items array that don’t have their DimensionType property set to dimDimension and do have their Active property set to True. Change ActiveSummaryCount indirectly by changing the Active property on dimension items with DimensionType values other than dimDimension.

The SummaryCount property indicates the total number of dimension items that do not have DimensionType set to dimDimension. It provides an upper limit to the ActiveSummaryCount property.


TDimensionItems.DimensionCount

TDimensionItems	See also

Indicates the number of dimension items in the Items array with DimensionType set to dimDimension.

property DimensionCount: Integer;

Description

Read DimensionCount to determine the number of potential dimensions for the multidimensional data array cached by the data store. DimensionCount reflects the number of unsummarized fields in the data set of the crosstabulated data store. While the data store can make any of these dimensions available, usually only a subset are active at any time, in order to limit memory consumption. The ActiveDimensionCount property gives the number of dimensions that are currently active.


TDimensionItems.Items

TDimensionItems	See also

Lists all dimension items maintained by the TDimensionItems object.

property Items[Index: Integer]:TDimensionItem; default;

Description

Use Items to access individual dimension items maintained by the TDimensionItems object. The first dimension item has an Index of 0, the second dimension item has an Index of 1, and so on.

Each dimension item in the Items array represents a field from the data set of a crosstabulated data store. Each dimension item represents either a dimension (a field over which data is summarized), or a summary (a value summarized over the dimensions).

Items is the default property of TDimensionItems. This means that the name of the Items property can be eliminated from code that uses the Items property. Thus, the line

DecisionCube1.DimensionMap.Items[0].Active := False;

could be written

DecisionCube1.DimensionMap[0].Active := False;

Note:	Do not change the Items property. The set of items in the Items array is set automatically to represent the fields from the data set. The properties of individual dimension items within the Items array may be changed to specify whether the dimension items should be cached by the data store, to change the name used when displaying the dimension items, and so on.


TDimensionItems.SummaryCount

TDimensionItems	See also

Indicates the number of dimension items in the Items array with DimensionType set to a value other than dimDimension.

property SummaryCount: Integer;

Description

Read SummaryCount to determine the number of potential summaries that could be stored in the cells of the multidimensional data array cached by the data store. SummaryCount reflects the number of summarized fields in the data set of the crosstabulated data store. If memory is a serious concern, the data store can make any of these summaries inactive. The ActiveSummaryCount property gives the number of summaries that are currently active.


TDimensionItems methods

TDimensionItems	Alphabetically

In TDimensionItems

Add

AddDerivedField

AlreadyExists

Assign

AverageFieldCheck

Create

Derived from TCollection

BeginUpdate

Clear

Destroy

EndUpdate

FindItemID

Insert

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDimensionItems methods

TDimensionItems	By object

Add

AddDerivedField

AfterConstruction

AlreadyExists

Assign

AverageFieldCheck

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

Dispatch

EndUpdate

FieldAddress

FindItemID

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDimensionItems.Add

TDimensionItems	See also

Adds a dimension item to the end of the Items array.

function Add: TDimensionItem; reintroduce;

Description

Do not call the Add method to add dimension items to a TDimensionItems object. The dimension items are added automatically to reflect the fields in the data set of the associated crosstabulated data store.

Add adds a new dimension item to the collection and returns the new dimension item.


TDimensionItems.AddDerivedField

TDimensionItems	See also

Adds a derived average summary to the end of the Items array.

type TDimFlags = (dimDimension, dimSum, dimCount, dimAverage, dimMin, dimMax, dimGenericAgg, dimUnknown);

function AddDerivedField(Index: Integer; DimType: TDimFlags): Boolean;

Description

Summaries that represent average values are not taken directly from the source dataset of a decision cube, but are derived from count summaries and summation summaries. AddDerivedField creates a dimension item for an average summary. The Index parameter specifies the index of an existing dimension item whose BaseName property specifies the field over which averages should be computed. AddDerivedField checks for the summary dimension items needed to derive the average. If both an average and a summation are available for the base field, AddDerivedField creates the average summary dimension item. AddDerivedField returns True if the dimension item is successfully created, False otherwise.

Note:	The DimType parameter is currently ignored. Descendants of AddDerivedField can override this method to derive other types of dimension items. In this case, DimType should specify the type of derived dimension item that should be created. When overriding AddDerivedField, call the inherited method if DimType is dimAverage.


TDimensionItems.AlreadyExists

TDimensionItems	See also

Indicates whether a dimension item with specified properties already exists in the Items property array.

type TDimFlags = ( dimDimension, dimSum, dimCount, dimAverage, dimMin, dimMax, dimGenericAgg, dimUnknown);

function AlreadyExists(BaseName: String; SType: TDimFlags): Boolean;

Description

Call AlreadyExists to determine whether there is a dimension item in the Items property array with the BaseName property equal to the BaseName parameter and the DimensionType property equal to the SType parameter.


TDimensionItems.Assign

TDimensionItems	See also

Copies the list of dimension items from another TDimensionItems object.

procedure Assign(Source: TPersistent); override;

Description

Assign calls the inherited method to copy the properties of the Source parameter. The inherited method will copy properties from any object that implements an AssignTo method that can copy to a TDimensionItems object.


TDimensionItems.AverageFieldCheck

TDimensionItems	See also

Determines whether the necessary summary dimension items over a base dimension exist so that a dimension item of type dimAverage can be computed.

function AverageFieldCheck(Index: Integer; var SumIndex, CountIndex: Integer): Boolean;

Description

Call AverageFieldCheck to ensure that the necessary summary dimension items exist for creating an average summary. The Index parameter specifies an existing dimension item whose BaseName property specifies the field over which the average should be computed. The SumIndex and CountIndex parameters return the summation and count dimension items that can be used to compute average values.


TDimensionItems.Create

TDimensionItems	See also

Creates an instance of TDimensionItems.

type TDimensionItemClass = class of TDimensionItem;

constructor Create(Owner: TPersistent; ItemClass: TDimensionItemClass);

Description

Applications should not need to call the constructor of TDimensionItems. TCustomDataStore objects create TDimensionItems objects to implement their DimensionMap property.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


EDimensionMapError

Hierarchy	Properties	Methods	See also

EDimensionMapError is the exception class for when the dataset of a decision cube does not have the proper format.

Unit

mxdb

Description

EDimensionMapError is raised when the dataset of a decision cube does not contain any summary values, contains only summary values, or is a query that does not contain the appropriate grouping.


EDimensionMapError properties

EDimensionMapError	Alphabetically

Derived from Exception

HelpContext

Message


EDimensionMapError properties

EDimensionMapError	By object

HelpContext

Message


EDimensionMapError methods

EDimensionMapError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EDimensionMapError methods

EDimensionMapError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


TDispatchConnection

Hierarchy	Properties	Methods	Events	See also

TDispatchConnection is the base class for objects that connect client applications to a COM-based application server.

Unit

mconnect

Description

Do not create instances of TDispatchConnection. Instead, use TDispatchConnection as a base class when creating a custom component that forms a connection to a COM-based application server in a multi-tiered database application.

TDispatchConnection introduces the infrastructure for logging on to an application server, obtaining an IAppServer interface, calling the application server’s interface, and managing a remote connection. Additionally, TCustomRemoteServer inherits the ability to work with one or more client datasets.

TDispatchConnection is not capable of connecting to an application server. This ability is added by descendants, which are specialized for different connection types. Once a connection is formed, however, TDispatchConnection makes the application server’s IAppServer interface available to client datasets.

To enable a client application to connect to a COM-based application server, use a descendant of TDispatchConnection such as TSocketConnection, TWebConnection, or TDCOMConnection.


TDispatchConnection properties

TDispatchConnection	Alphabetically	Legend

In TDispatchConnection

AppServer

Connected

ObjectBroker

ServerGUID

ServerName

Derived from TCustomConnection

DataSetCount

DataSets

LoginPrompt

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDispatchConnection properties

TDispatchConnection	By object	Legend

AppServer

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Connected

DataSetCount

DataSets

DesignInfo

LoginPrompt

Name

ObjectBroker

Owner

ServerGUID

ServerName

Tag

VCLComObject


TDispatchConnection.AppServer

TDispatchConnection	See also

Contains the interface for communicating with the application server.

property AppServer: Variant;

Description

AppServer provides read-only access to the interface returned by the application server’s remote data module. Client applications can communicate directly with the application server through this interface.

When calling methods directly using AppServer, the client application uses late binding. For better performance, cast the AppServer property to the appropriate interface type to take advantage of early (vtable) binding. It is not always possible to use early binding: this will work only when the connection is formed using DCOM. If the connection is formed using another protocol (such as TCP/IP sockets), it is possible to get a performance advantage over late binding by using the dispatch interface. This is not as efficient as true early binding. To use the dispatch interface, assign the AppServer property to a variable of the dispatch interface type.

Note:	To use the IAppServer methods of the application server’s interface, obtain an interface using the GetServer method instead.


TDispatchConnection.Connected

TDispatchConnection	See also

Indicates whether the TDispatchConnection object is connected to an application server.

property Connected: Boolean;

Description

Set Connected to True to establish a connection to the application server. Set Connected to False to terminate the connection.

When changing the value of Connected, TDispatchConnection generates a BeforeConnect and an AfterConnect event, or a BeforeDisconnect and an AfterDisconnect event. In addition, when setting Connected to True, TDispatchConnection may display a login dialog, depending on the value of LoginPrompt.

The Connected property uses the protected DoConnect and DoDisconnect methods to connect to or disconnect from an application server. Descendants of TDispatchConnection override DoConnect and DoDisconnect to change the way the connection is formed or terminated.


TDispatchConnection.ObjectBroker

TDispatchConnection	See also

Specifies an Object Broker that allows the connection component to choose from several application servers.

property ObjectBroker: TCustomObjectBroker;

Description

Use ObjectBroker to use a broker that maintains a list of servers that support the application specified by ServerName or ServerGUID. When the connection component needs to open a connection, it requests information to identify a server machine from the Object Broker.

Descendants of TDispatchConnection define properties that specify how to locate server machines. These properties are not saved with the connection component if the ObjectBroker property is set. Instead, the Object Broker provides this information dynamically at runtime from its list of available servers.

Applications can use TSimpleObjectBroker for an object broker, or derive their own object brokers from TCustomObjectBroker.


TDispatchConnection.ServerGUID

TDispatchConnection	See also

Specifies the name of the GUID of the application server with which to connect.

property ServerGUID: string;

Description

Use ServerGUID to specify the application server to which the client application should connect by its GUID. If the value specifies a valid GUID for a registered application server, setting ServerGUID changes the value of ServerName to the class name of the corresponding COM object.

Using ServerGUID rather than ServerName to identify the application server is more robust because it does not require the application server to be registered on the client system.

Note:	Either ServerName or ServerGUID must be provided so that the dispatch connection can create and communicate with the appropriate server COM object. This is true even for connections that are not formed using DCOM, because the remote data module on the application server is always implemented as a COM object.


TDispatchConnection.ServerName

TDispatchConnection	See also

Specifies the name of the application server with which to connect.

property ServerName: string;

Description

Use ServerName to specify the name of the application server to which the client application should connect. At design time, the Object Inspector provides a drop-down list of all available servers if one of the following conditions is met.

For DCOM and OLEnterprise connections, the servers must be registered in the system Registry.

For Socket connections, ScktSrvr.exe must be running on the server machine.

For Web connections, the connection component must have an URL for locating httpsrvr.dll.

If ServerName specifies a valid name for a registered application server, setting ServerName sets the ServerGUID property to the GUID that corresponds to the named application server.

Note:	Either ServerName or ServerGUID must be provided so that the dispatch connection can create and communicate with the appropriate server COM object. This is true even for connections that are not formed using DCOM, because the remote data module on the application server is always implemented as a COM object. Using ServerGUID rather than ServerName to identify the application server is more robust because it does not require the application server to be registered on the client system when using a COM-based connection.


TDispatchConnection events

TDispatchConnection	Alphabetically	Legend

In TDispatchConnection

OnGetUserName

Derived from TCustomConnection

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnLogin


TDispatchConnection events

TDispatchConnection	By object	Legend

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnGetUserName

OnLogin


TDispatchConnection.OnGetUsername

TDispatchConnection	See also

Occurs immediately before the remote login dialog.

type TGetUsernameEvent = procedure(Sender: TObject; var Username: string) of object;

property OnGetUsername: TGetUsernameEvent;

Description

Write an OnGetUsername event handler to initialize the user name in the remote login dialog that appears when the LoginPrompt property is True. Set the Username parameter to provide the initial value for the user name. If no OnGetUsername event handler is provided, the user name is initialized to an empty string.

The remote login dialog occurs immediately before a new connection is established to the application server. If the user cancels from that dialog, the connection attempt is aborted.

Note:	The OnGetUsername event does not occur unless the LoginPrompt property is True.


TDispatchConnection methods

TDispatchConnection	Alphabetically	Legend

In TDispatchConnection

Create

DoDisconnect

GetAppServer

GetConnected

GetProviderNames

GetServer

GetServerCLSID

GetServerList

Notification

SetAppServer

SetConnected

Derived from TCustomConnection

Close

Destroy

Open

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDispatchConnection methods

TDispatchConnection	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DoDisconnect

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetAppServer

GetConnected

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetProviderNames

GetServer

GetServerCLSID

GetServerList

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Notification

Open

RemoveComponent

SafeCallException

SetAppServer

SetConnected

UpdateAction


TDispatchConnection.Create

TDispatchConnection	See also

Creates an instance of a dispatch connection component.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a dispatch connection component at runtime. Connection components placed in forms or data modules at design time are created automatically.

After calling the inherited constructor, Create initializes the LoginPrompt property to False.


TDispatchConnection.DoDisconnect

TDispatchConnection	See also

Drops a connection to an application server.

procedure DoDisonnect; override;

Description

DoDisconnect is called internally when the Connected property is set to False. It drops the connection and changes the AppServer property to a NULL Variant.


TDispatchConnection.GetAppServer

TDispatchConnection	See also

Returns the value of the AppServer property.

function GetAppServer: Variant; virtual;

Description

GetAppServer is the protected implementation of the AppServer property. Override GetAppServer to change the way this property is stored or managed.


TDispatchConnection.GetConnected

TDispatchConnection	See also

Returns the value of the Connected property.

function GetConnected: Boolean; override;

Description

GetConnected is the protected implementation of the Connected property. It uses the AppServer property (set by the DoConnect method of a TDispatchConnection descendant) to determine whether a connection is established.

If a connection is established, GetConnected returns True. Otherwise, GetConnected returns False.


TDispatchConnection.GetProviderNames

TDispatchConnection	See also

Executes a callback for all provider objects on the application server.

procedure GetProviderNames(Proc: TGetStrProc); override;

Description

Call GetProviderNames to execute the procedure specified by the Proc parameter for every provider exposed by the application server. For every provider listed by the remote data module’s AS_GetProviderNames method, Proc is called with the name of the provider.


TDispatchConnection.GetServer

TDispatchConnection	See also

Returns the IAppServer interface of the application server.

function GetServer: IAppServer; override;

Description

Client datasets call GetServer to set the value of their AppServer property. This allows them to access providers on the remote application server.

GetServer ensures that there is a connection and then returns an IAppServer interface that can be used to communicate with providers on the application server. To use other methods of the application server’s interface, use the AppServer property instead.


TDispatchConnection.GetServerCLSID

TDispatchConnection	See also

Returns the GUID for the application server.

function GetServerCLSID: TGUID;

Description

GetServerCLSID is used internally to obtain the GUID for the application server.

In most cases, GetServerCLSID returns the value of the ServerGUID property. However, if the application server was specified using the ServerName property, and the application server was not registered when the ServerName property was set, ServerGUID will not represent the application server’s GUID. ServerGUID can return a GUID that only becomes available when a connection is opened.

If neither the ServerName nor the ServerGUID property is set, GetServerCLSID raises an exception.


TDispatchConnection.GetServerList

TDispatchConnection	See also

Returns a list of MIDAS servers (remote data modules) to which the component can connect.

function GetServerList: OleVariant; virtual;

Description

Connection components use GetServerList internally to fill the drop down list in the Object Inspector for the ServerName property. GetServerList returns a variant array that lists all MIDAS servers on the local machine and MIDAS servers registered in the system registry.


TDispatchConnection.Notification

TDispatchConnection	See also

Responds when other objects are created or destroyed.

procedure Notification(AComponent: TComponent; Operation: TOperation); override;

Description

Notification is called automatically so objects can make internal adjustments when components are created or destroyed. TDispatchConnection overrides the inherited method to set the ObjectBroker property to nil when it receives notification that that object is about to be destroyed.


TDispatchConnection.SetAppServer

TDispatchConnection	See also

Sets the AppServer property.

procedure SetAppServer(Value: Variant); virtual;

Description

SetAppServer allows descendants of TDispatchConnection to set the read-only AppServer property when they establish a connection to the application server.


TDispatchConnection.SetConnected

TDispatchConnection	See also

Sets the Connected property.

procedure SetConnected(Value: Boolean); override;

Description

SetConnected is the protected implementation of the Connected property. It establishes a connection to the Application server if Value is True, and disconnects from the application server if Value is False.

If Value is False, SetConnected generates a BeforeDisconnect event, closes the connection, and generates an AfterDisconnect event.

If Value is True, SetConnected performs the following actions:

1. If LoginPrompt is True, and the connection is not already open, SetConnected generates an OnGetUserName event, and uses that to initialize a login dialog. It displays the login dialog, and aborts the connection if the user cancels.

2. It generates a BeforeConnect event.

3. It opens the connection.

4. It generates an AfterConnect event.

5. If LoginPrompt is True, and the connection opened successfully, SetConnected generates an OnLogin event.


Scope

Published

Protected

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomConnection

TCustomRemoteServer

TDispatchConnection


TDisplayDim

Hierarchy	Properties	Methods	See also

TDisplayDim represents a dimension in a decision grid.

Unit

mxgrid

Description

Use TDisplayDim to set the properties of a dimension in a decision grid. Decision grids maintain a collection of TDisplayDim objects that describe the dimension labels that run along their left and top edges. The properties of TDisplayDim can be used to make the labels for a single dimension stand out, or to turn on or off subtotals over the dimension.


TDisplayDim properties

TDisplayDim	Alphabetically	Legend

In TDisplayDim

Alignment

Color

DisplayName

FieldName

Format

Subtotals

Derived from TCollectionItem

Collection

ID

Index


TDisplayDim properties

TDisplayDim	By object	Legend

Alignment

Collection

Color

DisplayName

FieldName

Format

ID

Index

Subtotals


TDisplayDim.Alignment

TDisplayDim 	See also

Specifies the placement of values within the label cells.

property Alignment: TAlignment;

Description

Set Alignment to determine how the values of the dimension field are aligned in the label cells. Alignment can be one of the following values:

Value	Meaning

taLeftJustify	Values appear lined up along the left edge of the label cells.

taRightJustify	Values appear lined up along the right edge of the label cells.


TDisplayDim.Color

TDisplayDim	See also

Specifies the background color of the label cells for the dimension.

property Color: TColor;

Description

Set Color to override the LabelColor property of the decision grid for the labels along a single dimension. Cells that display the field values along this dimension use Color for the background color.


TDisplayDim.DisplayName

TDisplayDim	See also

Describes the dimension in the caption cell.

property DisplayName: String;

Description

Set DisplayName to the name that appears in the caption cell that displays the name of this dimension. DisplayName overrides the name of the dimension returned by the decision source in its GetDimensionName method.


TDisplayDim.FieldName

TDisplayDim	See also

Names the field in the underlying data set that the dimension represents.

property FieldName: String;

Description

Read FieldName to determine the name of the field on which the dimension item is based. FieldName is the same as the FieldName property of the TField object for the field in the dataset.

Note:	Do not change the FieldName property. Changing the FieldName property loses the link to the underlying field in the data set.


TDisplayDim.Format

TDisplayDim	See also

Specifies the format of the value labels along the dimension.

property Format: String;

Description

Set Format to specify how the values of the dimension field should be formatted into display labels. The format specifiers that make up the Format string depend on the field type.

See the FormatFloat runtime library function for a description of the format specifiers for a numeric field. See the FormatDateTime runtime library function for a description of the format specifiers for a temporal field. Format has no effect on other field types.


TDisplayDim.SubTotals

TDisplayDim	See also

Indicates whether the grid should display subtotals over the dimension.

property Subtotals: Boolean;

Description

Set SubTotals to True to add a row or column of subtotals following the last value of the dimension. The subtotal row or column contains values of the summary field summarized over all values in the dimension. Set SubTotals to False to omit the subtotal row or column at the end of the dimension.

To turn subtotals on or off for all dimensions in the grid at once, use the Totals property of the decision grid.


TDisplayDim methods

TDisplayDim	Alphabetically

Derived from TCollectionItem

Create

Destroy

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDisplayDim methods

TDisplayDim	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem

TDimensionItem


TDisplayDims

Hierarchy	Properties	Methods	See also

TDisplayDims represents a collection of TDisplayDim objects.

Unit

mxgrid

Description

Use TDisplayDims to describe the dimensions of a decision grid. Each TDisplayDim object maintained by TDisplayDims corresponds to a field from the decision source. Decision grids use TDisplayDims to specify the appearance of the dimension labels that appear along the left and top edges of the grid.


TDisplayDims properties

TDisplayDims	Alphabetically	Legend

In TDisplayDims

Items

Derived from TCollection

Count

ItemClass


TDisplayDims properties

TDisplayDims	By object	Legend

Count

ItemClass

Items


TDisplayDims.Items

TDisplayDims	See also

Lists the TDisplayDim objects in the collection.

property Items[Index: Integer]: TDisplayDim; default;

Description

Use Items to access the properties of the TDisplayDim objects maintained by TDisplayDims. Items is the default property of TDisplayDims, so the name of the Items property can be left off when using this property. Thus the line

MyDim := DecisionGrid1.Dimensions.Items[0];

can be written

MyDim := DecisionGrid1.Dimensions[0];

The TDisplayDim objects in the Items array should correspond exactly to the dimensions of the decision source used by the decision control associated with the TDisplayDims object. Do not directly change the elements of the Items array. To rearrange the display dimensions, use the SwapDimIndexes method of the decision source. To hide display dimensions, use the CloseDimIndexRight method of the decision source. To show hidden dimensions, use the OpenDimIndexLeft or OpenDimIndexRight method of the decision source.


TDisplayDims methods

TDisplayDims	Alphabetically

Derived from TCollection

Add

Assign

BeginUpdate

Clear

Create

Destroy

EndUpdate

FindItemID

Insert

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDisplayDims methods

TDisplayDims	By object

Add

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

Dispatch

EndUpdate

FieldAddress

FindItemID

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


TDataSetButton

Hierarchy	Properties	Methods	See also

TDataSetButton is the base class for Web items that create HTML buttons for navigating or editing data.

Unit

MidItems

Description

Use TDataSetButton as a base class for components that generate the HTML statements defining a specialized button control for working with the data displayed by another Web item. TDataSetButton objects are used by TDataNavigator, which organizes the generated buttons.

TDataSetButton defines properties and methods for

Generating the HTML code to define the button control.

Associating the button with another Web item that generates HTML for displaying the data that the button manipulates.

Specifying tag attributes of the HTML button control, including those defined by a style sheet.

Fitting the component into a hierarchy of Web items, each of which generates part of a larger HTML document.

In order to allow other Web items to use the HTML generated by the button control, TDataSetButton inherits support for the IWebContent interface from TWebButton.

Do not create instances of TDataSetButton. TDataSetButton relies on an abstract method to generate the HTML statements defining a button control. Trying to use an instance of TDataSetButton will lead to an EAbstractError exception. Instead, create descendants of TDataSetButton, such as TNextButton, TPostButton, TInsertButton, and so on.


TDataSetButton properties

TDataSetButton	Alphabetically	Legend

In TDataSetButton

Caption

Derived from TXMLDisplayReferenceButton

XMLComponent

XMLUseParent

Derived from TWebButton

Custom

Style

StyleRule

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDataSetButton properties

TDataSetButton	By object	Legend

Caption

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

XMLComponent

XMLUseParent


TDataSetButton.Caption

TDataSetButton	See also

Specifies the caption that appears on the button.

property Caption: string;

Description

Use Caption to specify the caption that appears on the generated HTML button. The value of Caption is used as the value of a VALUE parameter on the HTML INPUT tag generated to implement the button.


TDataSetButton methods

TDataSetButton	Alphabetically

Derived from TXMLDisplayReferenceButton

Create

Destroy

Derived from TWebButton

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataSetButton methods

TDataSetButton	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebButton

TXMLDisplayReferenceButton


TDataSetResolver

Hierarchy	Properties	Methods	See also

TDataSetResolver applies updates to a dataset on behalf of a provider.

Unit

provider

Description

TDataSetProvider components use TDataSetResolver to apply updates from a client application to a dataset on the application server when their ResolveToDataSet property is True. Otherwise, they use TSQLResolver.

Do not create instances of TDataSetResolver. Provider components create their own TDataSetResolver objects for applying updates.


TDataSetResolver properties

TDataSetResolver	Alphabetically	Legend

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDataSetResolver properties

TDataSetResolver	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDataSetResolver methods

TDataSetResolver	Alphabetically

In TDataSetResolver

Create

Derived from TCustomResolver

Destroy

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataSetResolver methods

TDataSetResolver	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TDataSetResolver.Create

TDataSetResolver	See also

Creates and initializes a dataset resolver.

constructor Create(AProvider: TDataSetProvider); reintroduce;

Description

Provider components call Create when they need a resolver component for applying updates to a dataset. The AProvider parameter specifies the provider that creates and uses the resolver.

Do not create resolver instances directly. Resolvers are designed to be created and used by providers, and can not function independently of a provider.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TCustomResolver


EBrokerException

Hierarchy	Properties 	Methods 	See also

EBrokerException is the exception raised by simple object brokers when they can’t locate an available server.

Unit

objbrkr

Description

EBrokerException is raised when a simple object broker can’t locate an available server.


EBrokerException properties

EBrokerException	Alphabetically	Legend

Derived from Exception

HelpContext

Message


EBrokerException properties

EBrokerException	By object	Legend

HelpContext

Message


EBrokerException methods

EBrokerException	Alphabetically

In EBrokerException

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EBrokerException methods

EBrokerException	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Accessibility

Read-only


Hierarchy

TObject

Exception


EDBClient

Hierarchy	Properties	Methods	See also

EDBClient is the exception class for client dataset errors.

Unit

dbclient

Description

EDBClient is raised if an error occurs when an application is using a TClientDataSet object.


EDBClient properties

EDBClient	Alphabetically	Legend

In EDBClient

ErrorCode

Derived from Exception

HelpContext

Message


EDBClient properties

EDBClient	By object	Legend

ErrorCode

HelpContext

Message


EDBClient.ErrorCode

EDBClient	See also

The error code returned by the BDE.

property ErrorCode: DBResult;

Description

ErrorCode is the error code returned by the BDE, ADO, or other underlying database engine.

DBResult is a special integer type used to represent database error codes.


EDBClient methods

EDBClient	Alphabetically

In EDBClient

Create

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EDBClient methods

EDBClient	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EDBClient.Create

EDBClient

Initializes an instance of EDBClient using error information returned by the BDE.

constructor Create(Message: string; ErrorCode: DBResult);

Description

Create generates an EDBClient object. Message is the error message for the exception. ErrorCode is the error code this exception represents.


Accessibility

Read-only


Hierarchy

TObject

Exception

EDatabaseError


EDSWriter

Hierarchy	Properties 	Methods 	See also

EDSWriter is the exception class for errors that occur when creating data packets to represent the data or metadata in a dataset.

Unit

provider

Description

EDSWriter is raised whenever a provider component encounters an error while trying to create a data packet from a dataset.


EDSWriter properties

EDSWriter	Alphabetically	Legend

In EDSWriter

ErrorCode

Derived from Exception

HelpContext

Message


EDSWriter properties

EDSWriter	By object	Legend

ErrorCode

HelpContext

Message


EDSWriter.ErrorCode

EDSWriter 	See also

Indicates the error code that this exception represents.

property ErrorCode: Integer;

Description

Use ErrorCode to determine what error gave rise to this exception. ErrorCode is the value passed to the Create method.


EDSWriter methods

EDSWriter	Alphabetically

In EDSWriter

Create

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EDSWriter methods

EDSWriter	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EDSWriter.Create

EDSWriter	See also

Creates an instance of EDSWriter using a specified error code and message string.

constructor Create(ErrMsg: string; Status: Integer);

Description

Create calls the Create method inherited from Exception, passing the ErrMsg as the error message associated with the exception instance. It then sets the value of the ErrorCode property to the error code passed in as Status.


Accessibility

Read-only


Hierarchy

TObject

Exception


EInterpreterError

Hierarchy	Properties	Methods 	See also

EInterpreterError is the exception class for errors that arise when trying to interpret COM calls that have been marshaled to a data block.

Unit

Sconnect

Description

Data block interpreters (TDataBlockInterpreter) raise EInterpreterError when they can’t interpret the information in a data block. Streamed connection components such as TSocketConnection use data block interpreters to send interface calls to and receive interface calls from a remote application server.


EInterpreterError properties

EInterpreterError	Alphabetically

Derived from Exception

HelpContext

Message


EInterpreterError properties

EInterpreterError	By object

HelpContext

Message


EInterpreterError methods

EInterpreterError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EInterpreterError methods

EInterpreterError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EReconcileError

Hierarchy	Properties	Methods	See also

EReconcileError is the exception class for client dataset errors.

Unit

dbclient

Description

EReconcileError is raised if an error occurs when updates are being applied from a TClientDataSet.


EReconcileError properties

EReconcileError	Alphabetically	Legend

In EReconcileError

Context

PreviousError

Derived from EDBClient

ErrorCode

Derived from Exception

HelpContext

Message


EReconcileError properties

EReconcileError	By object	Legend

Context

ErrorCode

HelpContext

Message

PreviousError


EReconcileError.Context

EReconcileError	See also

Contains context information from the error stack.

property Context: string;

Description

Context contains additional information returned with the error message.


EReconcileError.PreviousError

EReconcileError

Indicates the previous error in the reconcile process.

property PreviousError: DBResult;

Description

PreviousError is the error code of the last update error in this update operation. If the last update error did not have an error code, PreviousError is 0.


EReconcileError methods

EReconcileError	Alphabetically

In EReconcileError

Create

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EReconcileError methods

EReconcileError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EReconcileError.Create

EReconcileError

Initializes an instance of EReconcileError using error information returned by the BDE.

constructor Create(NativeError, Context: string; ErrorCode, PreviousError: DBResult);

Description

Create generates an EReconcileError object.

NativeError is the runtime error message to display in the exception dialog box.

Context provides context information about the error that occurred. It initializes the Context property.

ErrorCode is the error code that this exception represents. Not all exceptions are associated with an error code. If there is no error code, ErrorCode is 0.

PreviousError is the error code of the last error in this reconciliation process. If the last exception did not have an error code, PreviousError is 0.


Accessibility

Read-only


Hierarchy

TObject

Exception

EDatabaseError

EDBClient


ESocketConnectionError

Hierarchy	Properties	Methods 	See also

ESocketConnectionError is the exception class for errors that arise when sending or receiving messages using TSocketConnection.

Unit

sconnect

Description

Socket connection components raise ESocketConnectionError when the socket they use to send and receive messages reports an error, or when the information read from the socket is incomplete.


ESocketConnectionError properties

ESocketConnectionError	Alphabetically

Derived from Exception

HelpContext

Message


ESocketConnectionError properties

ESocketConnectionError	By object

HelpContext

Message


ESocketConnectionError methods

ESocketConnectionError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


ESocketConnectionError methods

ESocketConnectionError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EUpdateError

Hierarchy	Properties 	Methods 	See also

EUpdateError is the exception class for dataset provider update errors.

Unit

db

Description

EUpdateError is raised if an error occurs when updates are applied by a provider component. Raise this exception class for update errors when implementing the IProviderSupport interface in a custom dataset.


EUpdateError properties

EUpdateError	Alphabetically	Legend

In EUpdateError

Context

ErrorCode

OriginalException

PreviousError

Derived from Exception

HelpContext

Message


EUpdateError properties

EUpdateError	By object	Legend

Context

ErrorCode

HelpContext

Message

OriginalException

PreviousError


EUpdateError.Context

EUpdateError	See also

Contains context information from the error stack.

property Context: string;

Description

Context contains additional information returned with the error message. If there is no additional context information, Context is an empty string.


EUpdateError.ErrorCode

EUpdateError	See also

Indicates the error code that this exception represents.

property ErrorCode: Integer;

Description

EUpdateError objects represent exceptions that occur when updating records. These exceptions can represent error codes generated by the BDE, or by other exceptions that are caught by resolver components. If the update error represents an error code returned by the BDE, ErrorCode is that BDE error code (DBIResult). Otherwise, ErrorCode is 0.

Note:	If the EUpdateError object does not represent a BDE error, ErrorCode is 0, but the OriginalException property provides access to the exception that was caught.


EUpdateError.OriginalException

EUpdateError	See also

Indicates the exception object that this update error represents.

property OriginalException: Exception;

Description

EUpdateError objects represent exceptions that occur when updating records. OriginalException is the exception object that is caught during the update process. Use this value to obtain more information about the problem that occurred.

Note:	If the EUpdateError object represents an EDBEngineError, the ErrorCode property provides immediate access to its BDE error code without going through the OriginalException property.


EUpdateError.PreviousError

EUpdateError	See also

Indicates the previous error code for this update process.

property PreviousError: Integer;

Description

PreviousError is the error code of the last update error in this update operation. If the last update error was not based on an EDBEngineError, PreviousError is 0.


EUpdateError methods

EUpdateError	Alphabetically

In EUpdateError

Create

Destroy

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EUpdateError methods

EUpdateError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EUpdateError.Create

EUpdateError	See also

Creates and initializes an instance of EUpdateError.

constructor Create(NativeError, Context: string; ErrCode, PrevError: Integer; E: Exception);

Description

Create generates an EUpdateError object to represent another error that is caught while applying updates.

NativeError specifies the error message for the exception.

Context is a string providing additional context information. It becomes the value of the Context property.

ErrCode and PrevError specify the error code of an EDBEngineError object that represents this exception or the previous exception in this update operation. If the current exception or previous exception is not an EDBEngineError object, these parameters are empty strings. The ErrCode and PrevError parameters initialize the ErrorCode and PreviousError properties.

Exception specifies the exception that was caught (which this EUpdateError represents). It becomes the value of the OriginalException property.


EUpdateError.Destroy

EUpdateError	See also

Destroys an instance of EUpdateError.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free, which checks that the EUpdateError reference is not nil before calling Destroy.


Accessibility

Read-only


Hierarchy

TObject

Exception

EDatabaseError


TFieldGroup

Hierarchy	Properties	Methods	See also

TFieldGroup arranges database information on an HTML form as a set of labeled fields.

Unit

MidItems

Description

Add TFieldGroup to a data form component (TDataForm) or a layout group (TLayoutGroup) that is a child for a data form. TFieldGroup generates the HTML to display information from an XML data packet in labeled fields.

TFieldGroup maintains a list of Web items that generate the individual display fields. These Web items are restricted to the following classes: TFieldText, TFieldTextArea, TFieldSelectOptions, TFieldRadioGroup, and TFieldStatus. You can bind the field group to an XML data packet or dataset field within an XML data packet. The Web items can then use that binding to determine the source of the data they display.

You can also use the properties of TFieldGroup to affect the overall appearance of the set of fields.


TFieldGroup properties

TFieldGroup	Alphabetically	Legend

Derived from TCustomFieldGroup

Custom

Style

StyleRule

Derived from TXMLDisplayGroup

VisibleFields

XMLBroker

XMLDataSetField

Derived from TWebControlGroup

WebFieldControls

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TFieldGroup properties

TFieldGroup	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

VisibleFields

WebFieldControls

XMLBroker

XMLDataSetField


TFieldGroup methods

TFieldGroup	Alphabetically

Derived from TCustomFieldGroup

Create

Destroy

Derived from TWebControlGroup

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFieldGroup methods

TFieldGroup	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebControlGroup

TXMLDisplayGroup


TFirstButton

Hierarchy	Properties	Methods	See also

TFirstButton generates an HTML control that moves to the first record in an XML data packet.

Unit

MidItems

Description

Add TFirstButton as the child of a TDataNavigator component (or a layout group that is a child of a TDataNavigator component) to enable the generated HTML form to move quickly to the first record in a dataset. The resulting HTML button’s action changes the associated display control so that it shows the first record as current.

Use the properties of TFirstButton to customize the appearance of the button and associate it with a Web item. The associated Web item displays the records that the first button navigates.


TFirstButton properties

TFirstButton	Alphabetically	Legend

Derived from TDataSetButton

Caption

Derived from TXMLDisplayReferenceButton

XMLComponent

XMLUseParent

Derived from TWebButton

Custom

Style

StyleRule

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TFirstButton properties

TFirstButton	By object	Legend

Caption

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

XMLComponent

XMLUseParent


TFirstButton methods

TFirstButton	Alphabetically

In TFirstButton

Create

Derived from TXMLDisplayReferenceButton

Destroy

Derived from TWebButton

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFirstButton methods

TFirstButton	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TFirstButton.Create

TFirstButton	See also

Creates and initializes an instance of TFirstButton.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TFirstButton at runtime. Buttons added at design time using the Web Page editor are instantiated automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebButton

TXMLDisplayReferenceButton

TDataSetButton


TFieldRadioGroup

Hierarchy	Properties	Methods	See also

TFieldRadioGroup creates an HTML radio group control to represent a field in an XML data packet.

Unit

MidItems

Description

Add TFieldRadioGroup as the child of a TFieldGroup component to add a radio group control that represents a field from the field group’s associated dataset.

Use the properties and methods of TFieldRadioGroup to

Specify the field whose value the radio group displays.

Specify the possible values for the field from which the user can choose.

Specify a caption that describes the field.

Customize the appearance of the radio group.

Fit the radio group into the tab order of the generated HTML form.


TFieldRadioGroup properties

TFieldRadioGroup	Alphabetically	Legend

Derived from TWebRadioGroupInput

DisplayColumns

DisplayWidth

ReadOnly

Derived from TWebListInput

DataSet

Items

ItemsField

Values

ValuesField

Derived from TWebDataInput

FieldName

Derived from TWebDataDisplay

Caption

CaptionAttributes

CaptionPosition

Custom

Style

StyleRule

TabIndex

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TFieldRadioGroup properties

TFieldRadioGroup	By object	Legend

Caption

CaptionAttributes

CaptionPosition

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DataSet

DesignInfo

DisplayColumns

DisplayWidth

FieldName

Items

ItemsField

Name

Owner

ReadOnly

Style

StyleRule

TabIndex

Tag

Values

ValuesField

VCLComObject


TFieldRadioGroup methods

TFieldRadioGroup	Alphabetically

Derived from TWebRadioGroupInput

Create

Derived from TWebListInput

Destroy

Derived from TWebDataDisplay

GetParentComponent

HasParent

IsColumn

IsQueryField

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFieldRadioGroup methods

TFieldRadioGroup	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsColumn

IsQueryField

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebDataDisplay

TWebDataInput

TWebListInput

TWebRadioGroupInput


TFieldSelectOptions

Hierarchy	Properties	Methods	See also

TFieldSelectOptions creates an HTML list control to represent a field in an XML data packet.

Unit

MidItems

Description

Add TFieldSelectOptions as the child of a TFieldGroup component to add a list control that represents a field from the field group’s associated dataset.

Use the properties and methods of TFieldSelectOptions to

Specify the field whose value the list box displays.

Specify the possible values for the field from which the user can choose.

Specify a caption that describes the field.

Customize the appearance of the list box.

Fit the list box into the tab order of the generated HTML form.


TFieldSelectOptions properties

TFieldSelectOptions	Alphabetically	Legend

Derived from TWebSelectOptionsInput

DisplayRows

Derived from TWebListInput

DataSet

Items

ItemsField

Values

ValuesField

Derived from TWebDataInput

FieldName

Derived from TWebDataDisplay

Caption

CaptionAttributes

CaptionPosition

Custom

Style

StyleRule

TabIndex

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TFieldSelectOptions properties

TFieldSelectOptions	By object	Legend

Caption

CaptionAttributes

CaptionPosition

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DataSet

DesignInfo

DisplayRows

FieldName

Items

ItemsField

Name

Owner

Style

StyleRule

TabIndex

Tag

Values

ValuesField

VCLComObject


TFieldSelectOptions methods

TFieldSelectOptions	Alphabetically

Derived from TWebSelectOptionsInput

Create

Derived from TWebListInput

Destroy

Derived from TWebDataDisplay

GetParentComponent

HasParent

IsColumn

IsQueryField

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFieldSelectOptions methods

TFieldSelectOptions	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsColumn

IsQueryField

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebDataDisplay

TWebDataInput

TWebListInput


TFieldStatus

Hierarchy	Properties	Methods	See also

TFieldStatus generates an HTML control that indicates whether a record in an XML data packet has been modified by the end user.

Unit

MidItems

Description

Add TFieldStatus as the child of a TFieldGroup component to provide feedback about whether the current record has been modified. The generated control displays an M if the user has edited the record, an I if the user has inserted the record, and blank if the user has made no changes to the record.

Use the properties and methods of TFieldStatus to

Specify a caption that labels the status control.

Customize the appearance of the control.

Fit the control into the tab order of the generated HTML form.


TFieldStatus properties

TFieldStatus	Alphabetically	Legend

Derived from TWebStatus

DisplayWidth

Derived from TWebDataDisplay

Caption

CaptionAttributes

CaptionPosition

Custom

Style

StyleRule

TabIndex

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TFieldStatus properties

TFieldStatus	By object	Legend

Caption

CaptionAttributes

CaptionPosition

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

DisplayWidth

Name

Owner

Style

StyleRule

TabIndex

Tag

VCLComObject


TFieldStatus methods

TFieldStatus	Alphabetically

Derived from TWebStatus

Create

Identifier

Derived from TWebDataDisplay

Destroy

GetParentComponent

HasParent

IsColumn

IsQueryField

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFieldStatus methods

TFieldStatus	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

Identifier

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsColumn

IsQueryField

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebDataDisplay

TWebStatus


TFieldText

Hierarchy	Properties	Methods	See also

TFieldText creates a single-line HTML input control to represent a field in an XML data packet.

Unit

MidItems

Description

Add TFieldText as the child of a TFieldGroup component to add a single-line edit control that represents a field from the field group’s associated dataset.

Use the properties and methods of TFieldText to

Specify the field whose value the control displays.

Specify a caption that describes the field.

Customize the appearance of the edit control.

Fit the control into the tab order of the generated HTML form.


TFieldText properties

TFieldText	Alphabetically	Legend

Derived from TWebTextInput

DisplayWidth

ReadOnly

Derived from TWebDataInput

FieldName

Derived from TWebDataDisplay

Caption

CaptionAttributes

CaptionPosition

Custom

Style

StyleRule

TabIndex

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TFieldText properties

TFieldText	By object	Legend

Caption

CaptionAttributes

CaptionPosition

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

DisplayWidth

FieldName

Name

Owner

ReadOnly

Style

StyleRule

TabIndex

Tag

VCLComObject


TFieldText methods

TFieldText	Alphabetically

Derived from TWebTextInput

Create

Derived from TWebDataDisplay

Destroy

GetParentComponent

HasParent

IsColumn

IsQueryField

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFieldText methods

TFieldText	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsColumn

IsQueryField

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebDataDisplay

TWebDataInput

TWebTextInput


TFieldTextArea

Hierarchy	Properties	Methods	See also

TFieldTextArea creates a multi-line HTML input control to represent a field in an XML data packet.

Unit

MidItems

Description

Add TFieldTextArea as the child of a TFieldGroup component to add a multi-line edit control that represents a field from the field group’s associated dataset.

Use the properties and methods of TFieldTextArea to

Specify the field whose value the control displays.

Specify a caption that describes the field.

Customize the appearance of the control.

Fit the control into the tab order of the generated HTML form.


TFieldTextArea properties

TFieldTextArea	Alphabetically	Legend

Derived from TWebTextAreaInput

DisplayRows

DisplayWidth

ReadOnly

Wrap

Derived from TWebDataInput

FieldName

Derived from TWebDataDisplay

Caption

CaptionAttributes

CaptionPosition

Custom

Style

StyleRule

TabIndex

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TFieldTextArea properties

TFieldTextArea	By object	Legend

Caption

CaptionAttributes

CaptionPosition

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

DisplayRows

DisplayWidth

FieldName

Name

Owner

ReadOnly

Style

StyleRule

TabIndex

Tag

VCLComObject

Wrap


TFieldTextArea methods

TFieldTextArea	Alphabetically

Derived from TWebTextAreaInput

Create

Derived from TWebDataDisplay

Destroy

GetParentComponent

HasParent

IsColumn

IsQueryField

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFieldTextArea methods

TFieldTextArea	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsColumn

IsQueryField

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebDataDisplay

TWebDataInput

TWebTextAreaInput


TGridAttributes

Hierarchy	Properties	Methods	See also

TGridAttributes describes the options the TDataGrid component adds to an HTML <TABLE> tag.

Unit

miditems

Description

TGridAttributes implements the TableAttributes property of a TDataGrid component. It describes display attributes that apply to an HTML table generated by TDataGrid. The properties of TGridAttributes specify the options added to the generated HTML <TABLE> tag, as well as any styles that should be applied.


TGridAttributes properties

TGridAttributes	Alphabetically	Legend

In TGridAttributes

Align

BgColor

Custom

Parent

Style

StyleRule


TGridAttributes properties

TGridAttributes	By object	Legend

Align

BgColor

Custom

Parent

Style

StyleRule


TGridAttributes.Align

TGridAttributes 	See also

Specifies the alignment of the table within the HTML document.

property Align: THTMLAlign;

Description

Set Align to indicate the desired alignment of the table within the HTML document, or within the cell of a surrounding HTML table in a layout group.  Align indicates the desired value of the Align option of the HTML table tag.

The default value of Align is haDefault, which means the web browser that reads the HTML document positions the HTML table where it wants.


TGridAttributes.BgColor

TGridAttributes	See also

Specifies the background color of the HTML table.

property BgColor: THTMLBgColor;

Description

Use BgColor to indicate the desired background color of the HTML table. The value of BgColor is the name of color. This can be one of the following strings:

Aqua	Black	Blue
Fuschia	Gray	Green
Lime	Maroon	Navy
Olive	Purple	Red
Silver	Teal	White
Yellow
Note:	The row or heading attributes can override this background color for a portion of the HTML table.


TGridAttributes.Border

TGridAttributes	See also

Specifies the thickness of the border drawn around the HTML table.

property Border: Integer;

Description

Set Border to specify whether a border should be drawn around the table, and if so, how thick it should be. The thickness specified by any particular value of border depends on the web browser that views the HTML table. For any browser, however, larger numbers indicate thicker borders. A value of -1 indicates that no border should be drawn around the table.


TGridAttributes.CellPadding

TGridAttributes	See also

Specifies the amount of space to leave around the contents of each cell in the HTML table.

property CellPadding: Integer;

Description

Set CellPadding to specify how many pixels of whitespace should appear between a cell’s contents and the edges of the cell. A value of -1 indicates that the web browser should decide how to pad the cells of the HTML table.


TGridAttributes.CellSpacing

TGridAttributes	See also

Specifies the amount of space to leave between cells in the HTML table.

property CellSpacing: Integer;

Description

Set CellSpacing to specify how many pixels of whitespace should appear between the cells in the table. A value of -1 indicates that the web browser should decide how to separate the cells of the HTML table.

Note:	CellSpacing refers to the whitespace between cells in an HTML table, not the thickness of the lines drawn to separate rows and columns.


TGridAttributes.Custom

TGridAttributes	See also

Represents a tag option and its value in an HTML tag.

property Custom: string;

Description

Use Custom to represent one or more options to be added to the HTML <TABLE> tag. Each option and its value should have the form

OPTIONNAME=Value

The options specified by Custom should be separated by spaces. For example, to hide the side borders and add row dividers, you can set Custom to

FRAME=HSIDES RULES=ROWS


TGridAttributes.Parent

TGridAttributes	See also

Indicates the TDataGrid object that uses this TGridAttributes to describe its attributes.

property Parent: TComponent;

Description

Read Parent to access the TDataGrid that uses this TGridAttributes object. The value of Parent is assigned by the constructor.


TGridAttributes.Style

TGridAttributes	See also

Adds style attributes to the generated table.

property Style: string;

Description

Use Style to specify display characteristics that affect the entire table. The Style option consists of one or more attribute descriptions such as

font-family: arial; font-weight: bold; font-size: 10px

These attributes are added to the <TABLE> tag as the value of a STYLE option.


TGridAttributes.StyleRule

TGridAttributes	See also

Applies a style in the page producer’s style sheet to the generated table.

property StyleRule: string;

Description

Use StyleRule to assign one of the user-defined styles in the HTML document’s style sheet to the generated table. The value of StyleRule specifies one of the user-defined style names defined in the MIDAS page producer’s Styles or StylesFile property.

To apply a style definition that is not included in the style sheet, use the Style property instead.


TGridAttributes methods

TGridAttributes	Alphabetically

In TGridAttributes

Create

Derived from TPersistent

Assign

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TGridAttributes methods

TGridAttributes	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TGridAttributes.Create

TGridAttributes	See also

Creates an instance of TGridAttributes.

constructor Create(AParent: TComponent);

Description

Most applications have no need to instantiate TGridAttributes. TGridAttributes is instantiated by the TDataGrid component that uses it.

The AParent parameter is the TDataGrid component that uses the TGridAttributes instance. This parameter becomes the value of the Parent property.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent


TGridRowAttributes

Hierarchy	Properties	Methods	See also

TGridRowAttributes describes the options the TDataGrid component adds to its HTML row tags (<TR>).

Unit

miditems

Description

TGridRowAttributes implements the RowAttributes and HeadingAttributes properties of a TDataGrid component. It describes display attributes that apply to the generated HTML table’s rows. The properties of TGridRowAttributes specify the options added to the generated HTML <TR> tag, as well as any styles that should be applied to the header or body of the table.


TGridRowAttributes properties

TGridRowAttributes	Alphabetically	Legend

In TGridRowAttributes

Align

BgColor

Custom

Parent

Style

StyleRule

VAlign


TGridRowAttributes properties

TGridRowAttributes	By object	Legend

Align

BgColor

Custom

Parent

Style

StyleRule

VAlign


TGridRowAttributes.Align

TGridRowAttributes 	See also

Specifies the alignment of the table within the HTML document.

property Align: THTMLAlign;

Description

Set Align to indicate the desired alignment of the contents of each cell in the table row or header.  Align indicates the desired value of the Align option of the <TR> tag.

The default value of Align is haDefault, which means the web browser that reads the HTML document positions the cell contents wherever it wants horizontally.


TGridRowAttributes.BgColor

TGridRowAttributes	See also

Specifies the background color of the rows or header of an HTML table.

property BgColor: THTMLBgColor;

Description

Use BgColor to indicate the desired background color of the rows or heading of an HTML table. The value of BgColor is the name of color. This can be one of the following strings:

Aqua	Black	Blue
Fuschia	Gray	Green
Lime	Maroon	Navy
Olive	Purple	Red
Silver	Teal	White
Yellow
Note:	This property overrides the background color option of the HTML table itself.


TGridRowAttributes.Custom

TGridRowAttributes	See also

Represents a tag option and its value in an HTML tag.

property Custom: string;

Description

Use Custom to represent one or more options to be added to the HTML <TR> tag. Each option and its value should have the form

OPTIONNAME=Value

To specify multiple options, separate the Name/value pairs with spaces.


TGridRowAttributes.Parent

TGridRowAttributes	See also

Indicates the TDataGrid object that uses this TGridRowAttributes to describe its header or row attributes.

property Parent: TComponent;

Description

Read Parent to access the TDataGrid that uses this TGridRowAttributes object. The value of Parent is assigned by the constructor.


TGridRowAttributes.Style

TGridRowAttributes	See also

Adds style attributes to the generated table body or header.

property Style: string;

Description

Use Style to specify display characteristics that affect the rows or header of the HTML table. The Style option consists of one or more attribute descriptions such as

font-family: arial; font-weight: bold; font-size: 10px

These attributes are added to the <TR> tag as the value of a STYLE option.


TGridRowAttributes.StyleRule

TGridRowAttributes	See also

Applies a style in the page producer’s style sheet to the generated table body or header.

property StyleRule: string;

Description

Use StyleRule to assign one of the user-defined styles in the HTML document’s style sheet to the generated table body or header. The value of StyleRule specifies one of the user-defined style names defined in the MIDAS page producer’s Styles or StylesFile property.

To apply a style definition that is not included in the style sheet, use the Style property instead.


TGridRowAttributes.VAlign

TGridRowAttributes	See also

Specifies the vertical alignment within the cells of the HTML table body or header.

property VAlign: THTMLVAlign;

Description

Set VAlign to indicate the desired vertical alignment of the contents of each cell. VAlign indicates the desired value of the VAlign option of the <TR> tag for the table rows or header.

The default value of VAlign is haVDefault, which means the web browser that reads the HTML document positions the contents of cells in the table element wherever it wishes vertically.


TGridRowAttributes methods

TGridRowAttributes	Alphabetically

In TGridRowAttributes

Create

Derived from TPersistent

Assign

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TGridRowAttributes methods

TGridRowAttributes	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TGridRowAttributes.Create

TGridRowAttributes	See also

Creates an instance of TGridRowAttributes.

constructor Create(AParent: TComponent);

Description

Most applications have no need to instantiate TGridRowAttributes. TGridRowAttributes is instantiated by the TDataGrid component that uses it.

The AParent parameter is the TDataGrid component that uses the TGridRowAttributes instance. This parameter becomes the value of the Parent property.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent


IAppServer

Hierarchy	Methods 	See also

IAppServer is the interface that client datasets use to communicate with a provider component on an application server.

Unit

Midas

Description

Client datasets use an IAppServer interface to implement many of their properties and methods. This interface provides the basis of communication for many multi-tiered database applications. Client datasets obtain an IAppServer instance from a connection component in the client application.

Using IAppServer, client datasets talk to a provider on a remote application server, passing the name of the desired provider to all method calls. By default, the interface is stateless, meaning that each method call functions independently, with no reliance on previous method calls. Because of this, IAppServer has no properties, which would represent persistent state information. However, there are cases where the client dataset relies on state information, such as the current database cursor position when performing incremental fetching using the AS_GetRecords method. This state information is preserved only if multiple clients do not share the application server that implements IAppServer.


IAppServer methods

IAppServer	Alphabetically

In IAppServer

AS_ApplyUpdates

AS_DataRequest

AS_Execute

AS_GetParams

AS_GetProviderNames

AS_GetRecords

AS_RowRequest

Derived from IDispatch

GetIDsOfNames

GetTypeInfo

GetTypeInfoCount

Invoke

Derived from IUnknown

_AddRef

_Release

QueryInterface


IAppServer methods

IAppServer	By object

_AddRef

_Release

AS_ApplyUpdates

AS_DataRequest

AS_Execute

AS_GetParams

AS_GetProviderNames

AS_GetRecords

AS_RowRequest

GetIDsOfNames

GetTypeInfoCount

GetTypeInfo

Invoke

QueryInterface


IAppServer.AS_ApplyUpdates

IAppServer	See also

Applies updates received from a client dataset using a specified provider.

function AS_ApplyUpdates(const ProviderName: WideString; Delta: OleVariant; MaxErrors: Integer; out ErrorCount: Integer; var OwnerData: OleVariant): OleVariant; safecall;

Description

AS_ApplyUpdates writes client updates to a dataset or database server. ProviderName specifies the name of the provider component that manages the update operation. Delta is a Variant containing the updated, inserted, and deleted records to write to the database. MaxErrors indicates the maximum number of errors to permit before stopping the update operation; ErrorCount indicates the actual number of errors encountered during the update operation. OwnerData is information supplied by the client application in a BeforeApplyUpdates event handler and returned to the client application in an AfterApplyUpdates event handler.

AS_ApplyUpdates returns a Variant that is a data packet containing all records that could not be applied to the database.


IAppServer.AS_DataRequest

IAppServer	See also

Generates an OnDataRequest event on the specified provider component.

function AS_DataRequest(const ProviderName: WideString; Data: OleVariant): OleVariant; safecall;

Description

Use AS_DataRequest to invoke an OnDataRequest event handler of the provider named by ProviderName. This method is provided to allow application developers to customize the communication between a client application and a provider component. There is no predefined meaning for the Data parameter or the return value.

Client applications must explicitly call DataRequest through the client dataset’s DataRequest method. Delphi does not call DataRequest automatically.


IAppServer.AS_Execute

IAppServer	See also

Executes the query or stored procedure bound to a specified provider.

procedure AS_Execute(const ProviderName: WideString; const CommandText: WideString; var Params: OleVariant; var OwnerData: OleVariant); safecall;

Description

Use AS_Execute to pass an execute command to a remote provider, using a specified set of parameters. AS_Execute calls the Execute method of the specified provider after assigning any parameters. Output parameters that result from executing a query or stored procedure are returned in the Params parameter.

Note:	Different types of provider interpret the Execute command in different ways. Some providers merely generate BeforeExecute and AfterExecute events, while others execute a query or stored procedure.

The ProviderName parameter specifies the name of the provider component associated with the query or stored procedure.

CommandText specifies an optional SQL statement that replaces the SQL of the provider’s query, or the name of a stored procedure that replaces the provider’s stored procedure. This parameter is ignored if the Options property does not include poAllowCommandText.

The Params parameter encodes any parameters expected by the query or stored procedure and returns any output parameters. To create a properly encoded value for Params from a TParams object, use the PackageParams routine. To decode Params into a TParams object, use the UnpackParams routine.

The OwnerData parameter contains custom information that appears as an argument to the provider’s BeforeExecute and AfterExecute event handlers. This information originates in a client dataset’s BeforeExecute event handler. The value returned in OwnerData is passed to the client dataset’s AfterExecute event handler.

Client applications must explicitly call AS_Execute through the client dataset’s Execute method. Delphi does not call AS_Execute automatically.


IAppServer.AS_GetParams

IAppServer	See also

Fetches current parameter values from the dataset bound to a specified provider.

function AS_GetParams(const ProviderName: WideString; var OwnerData: OleVariant): OleVariant; safecall;

Description

Use AS_GetParams to retrieve the current parameter values from the dataset associated with a provider. The ProviderName parameter specifies the name of the provider component whose dataset has the parameters. The OwnerData represents custom information that originates in a client dataset’s BeforeGetParams event handler and returns information that is passed tot he client dataset’s AfterGetParams event handler. AS_GetParams returns the parameters, encoded as a Variant array, where each element is a 2-element Variant array containing a parameter name and a parameter value. If the dataset has no parameters, or if the provider does not support parameter fetching, AS_GetParams returns a Null Variant.

AS_GetParams should not be used to retrieve output parameters from stateless application servers, because parameter values may be changed by other applications. When writing a stateless application server, retrieve parameter values using the AS_Execute method instead.


IAppServer.AS_GetProviderNames

IAppServer	See also

Returns a list of all the available providers on a remote data module.

function AS_GetProviderNames: OleVariant; safecall;

Description

Call AS_GetProviderNames for a list of all providers available from a remote data module. These values indicate the possible values for the ProviderName property of a client dataset that uses the IAppServer interface. When calling any other IAppServer method, pass one of these names to indicate the provider that is the target of the method call.

AS_GetProviderNames returns the names of the providers in a Variant array. Client datasets are associated with a provider by setting their ProviderName property to one of these names.


IAppServer.AS_GetRecords

IAppServer	See also

Returns a data packet that contains the specified data.

function AS_GetRecords(const ProviderName: WideString, Count: Integer; out RecsOut: Integer; Options: Integer; const CommandText: WideString; var Params: OleVariant; var OwnerData:OleVariant): OleVariant; safecall;

Description

Call AS_GetRecords to retrieve a specified number of records. GetRecords returns the requested records, starting with the current record of the provider’s dataset. When working with a stateless remote data module, you may need to reposition the cursor or re-execute a query or stored procedure in the provider’s BeforeGetRecords event handler.

ProviderName gives the name of the provider component that provides the records.

Count indicates the number or type of records to retrieve. If Count is -1, all records are retrieved. If Count is 0, only metadata is retrieved. If Count is greater than 0, only Count records are retrieved.

RecsOut returns the actual number of records retrieved.

Options indicates is an integer version of the TGetRecordOptions type. (An integer because the value must be compatible with a COM interface). To convert the TGetRecordOptions value to the appropriate integer, use the Ord function. For example:

Ord(grMetaData) + Ord(grXML)

CommandText specifies an optional SQL statement that replaces the SQL of a query, or the name of a table or stored procedure that replaces the provider’s table or stored procedure. This parameter is ignored if the Options property does not include poAllowCommandText.

Params is a Variant containing any parameters that should be passed to the provider’s dataset before it executes to generate the requested data. It returns any output parameters.

OwnerData contains custom information that is supplied by a client dataset’s BeforeGetRecords event handler. This information is passed to the provider’s BeforeGetRecords event handler. OwnerData returns information supplied by the provider’s AfterGetRecords event handler.

Records are returned as a data packet in a Variant.


IAppServer.AS_RowRequest

IAppServer	See also

Returns information from a specified record of the provider’s dataset.

function AS_RowRequest(const ProviderName: WideString; Row: OleVariant; RequestType: Integer; var OwnerData: OleVariant): OleVariant; safecall;

Description

Client datasets call AS_RowRequest automatically to implement their FetchBlobs, FetchDetails , or RefreshRecord method.

The ProviderName parameter indicates the provider associated with the dataset from which information should be fetched.

The Row parameter is an OleVariant that describes the current record on the client dataset.

The RequestType parameter indicates the type of information required. It is an integer version of the TFetchOptions type. (An integer because the value must be compatible with a COM interface). To convert the TFetchOptions value to the appropriate integer, use the Ord function. For example:

Ord(foBlobs) + Ord(foDetails);

OwnerData contains custom information that is supplied by a client dataset’s BeforeRowRequest event handler. This information is passed to the provider’s BeforeRowRequest event handler. OwnerData returns custom information supplied by the provider’s AfterRowRequest event handler.

The requested data is returned as a delta packet.


Hierarchy

IUnknown

IDispatch


IDataBlock

Hierarchy	Properties	Methods	See also

IDataBlock is the interface used by TDataBlockInterpreter to access memory buffers.

Unit

sconnect

Description

TDataBlockInterpreter uses IDataBlock when marshaling COM interface calls. Streamed connection components send data obtained from IDataBlock to an application server once the TDataBlockInterpreter has filled its memory by marshaling interface calls. They also read data from the application server into IDataBlock and pass it to TDataBlockInterpreter for marshaling.

IDataBlock is an interface, and as such can’t be directly instantiated. Instead, objects that implement the IDataBlock properties and methods include IDataBlock in their class definition. Such objects can be cast to an IDataBlock so that they can be used by TDataBlockInterpreter.


IDataBlock properties

IDataBlock	Alphabetically	Legend

In IDataBlock

BytesReserved

Memory

Signature

Size

Stream


IDataBlock properties

IDataBlock	By object	Legend

BytesReserved

Memory

Signature

Size

Stream


IDataBlock.BytesReserved

IDataBlock	See also

Indicates the number of bytes from Memory that are reserved for internal use.

property BytesReserved: Integer;

Description

BytesReserved indicates how many bytes of Memory can’t be used for reading and writing. When interpreting the value of the Size property, use BytesReserved to determine how much buffer space is available for reading and writing data.


IDataBlock.Memory

IDataBlock	See also

Points to a buffer from which data is read or to which data is written.

property Memory: Pointer;

Description

Memory provides access to the buffer that contains data that is read or written. Memory includes a reserved area (of size BytesReserved) for internal information such as the value of Signature,

Note:	When implementing the Receive and Send methods of the ITransport interface, component writers should read directly from and write directly to Memory, rather than using the Read and Write methods. Otherwise, the information in the reserved area will not be sent to or from the application server.


IDataBlock.Signature

IDataBlock	See also

Indicates the contents of the data block.

property Signature: Integer;

Description

Write Signature values to indicate what type of data is written to the data block. Read Signature to determine what type of data can be read from the data block.

The value of signature is stored somewhere in the first BytesReserved bytes of Memory.


IDataBlock.Size

IDataBlock	See also

Indicates the size of the data in the memory buffer.

property Size: Integer;

Description

Size is the number of bytes available in Memory, excluding the reserved bytes. Set Size to ensure that Memory is large enough to contain the data that the data block will read or write.


IDataBlock.Stream

IDataBlock	See also

Provides access to an internal stream that contains the data block’s memory.

property Stream: TStream;

Description

Stream allows component writers more convenient access to the data block’s memory buffer. This memory buffer contains the data that is read or written.


IDataBlock methods

IDataBlock	Alphabetically

In IDataBlock

Clear

GetBytesReserved

GetMemory

GetSignature

GetSize

GetStream

IgnoreStream

InitData

Read

SetSignature

SetSize

Write

Derived from IUnknown

_AddRef

_Release

QueryInterface


IDataBlock methods

IDataBlock	By object

_AddRef

_Release

Clear

GetBytesReserved

GetMemory

GetSignature

GetSize

GetStream

IgnoreStream

InitData

QueryInterface

Read

SetSignature

SetSize

Write


IDataBlock.Clear

IDataBlock	See also

Removes all data from Memory except for the reserved bytes.

procedure Clear;

Description

Call Clear when finished reading from Memory or when the information written to Memory has been used. Clear reclaims the resources used to store information that is read from or written to the data block.


IDataBlock.GetBytesReserved

IDataBlock	See also

Returns the value of the BytesReserved property.

function GetBytesReserved: Integer;

Description

GetBytesReserved is the read implementer for the BytesReserved property.


IDataBlock.GetMemory

IDataBlock	See also

Returns the value of the Memory property.

function GetMemory: Pointer;

Description

GetMemory is the read implementer for the Memory property.


IDataBlock.GetSignature

IDataBlock	See also

Returns the value of the Signature property.

function GetSignature: Integer;

Description

GetSignature is the read implementer for the Signature property.


IDataBlock.GetSize

IDataBlock	See also

Returns the value of the Size property.

function GetSize: Integer;

Description

GetSize is the read implementer for the Size property.


IDataBlock.GetStream

IDataBlock	See also

Returns the value of the Stream property.

function GetStream: TStream; stdcall;

Description

GetStream is the read implementer for the Stream property.


IDataBlock.IgnoreStream

IDataBlock	See also

Informs the data block when its stream is invalidated.

procedure IgnoreStream; stdcall;

Description

Call IgnoreStream after taking responsibility for freeing the component specified by Stream. After a call to IgnoreStream, the data block will not free the memory for its internal Stream component.


IDataBlock.InitData

IDataBlock	See also

Adds data to the data block.

function InitData(Data: Pointer; DataLen: Integer; CheckLen: Boolean): Integer; stdcall;

Description

Data is the data to be added to the data block. It must include a valid signature or InitData raises an exception.

DataLen is the number of bytes referenced by Data.

CheckLen specifies whether InitData should verify that the signature indicates the same amount of data as is indicated by the DataLen parameter.


IDataBlock.Read

IDataBlock	Methods 	See also

Reads a specified number of bytes into a buffer.

function Read(var Buffer; Count: Integer): Integer;

Description

Call Read to copy the contents stored in the memory buffer to the buffer supplied by the Buffer parameter. Read reads up to Count bytes and returns the number of bytes actually read.

The first call to Read begins reading from Memory at the first position after the reserved bytes. Subsequent calls begin reading at the point where the last call to Read left off.

Note:	The Count parameter should specify a value less than or equal to Size - BytesReserved.


IDataBlock.SetSignature

IDataBlock	Methods 	See also

Sets the value of the Signature property.

procedure SetSignature(Value: Integer);

Description

SetSignature is the write implementer for the Signature property.


IDataBlock.SetSize

IDataBlock	Methods 	See also

Sets the value of the Size property.

procedure SetSize(Value: Integer);

Description

SetSize is the write implementer for the Size property.


IDataBlock.Write

IDataBlock	Methods 	See also

Writes a specified number of bytes from a buffer.

function Write(const Buffer; Count: Integer): Integer;

Description

Call Write to copy the contents of the buffer supplied as the Buffer parameter to the next position in Memory. Write writes up to Count bytes and returns the number of bytes actually written.

The first call to Write begins writing to Memory at the first position after the reserved bytes. Subsequent calls begin writing at the point where the last call to Write left off.

Note:	The Count parameter should specify a value less than or equal to Size - BytesReserved.


Accessibility

Read-only


Hierarchy

IUnknown


IDataIntercept

Hierarchy	Methods	See also

IDataIntercept is the interface used by TSocketConnection components to transform data that is communicated over the socket connection.

Unit

sconnect

Description

TSocketConnection uses IDataIntercept before messages are sent and after responses are received. Developers can create a COM object that implements IDataIntercept to transform the data, which is accessed through an IDataBlock interface. For example, use the methods of IDataIntercept to encrypt and decrypt data or to compress and decompress messages.

Set the InterceptGUID property of a socket connection component to the GUID of a COM object that implements IDataIntercept to cause the socket connection to instantiate the COM object and use it to transform messages before they are sent and after they are received. The transformation must leave the reserved bytes of the data blocks unchanged or the socket connection component won’t be able to communicate properly.


IDataIntercept methods

IDataIntercept	Alphabetically

In IDataIntercept

DataIn

DataOut

Derived from IUnknown

_AddRef

_Release

QueryInterface


IDataIntercept methods

IDataIntercept	By object

_AddRef

_Release

DataIn

DataOut

QueryInterface


IDataIntercept.DataIn

IDataIntercept	Methods 	See also

Undoes the transformation applied by the DataOut method.

procedure DataIn(const Data: IDataBlock); stdcall;

Description

Call DataIn to undo any transformations that were applied to information received by the socket connection. For example, use this method to decrypt or decompress data.

The Data parameter is an IDataBlock interface to the data that was received by the socket connection component. Use the properties and methods of IDataBlock to reverse the transformation that was applied by the DataOut method.

Warning:	Do not transform the reserved bytes in the data block.


IDataIntercept.DataOut

IDataIntercept	Methods 	See also

Returns the value of the BytesReserved property.

procedure DataOut(const Data: IDataBlock); stdcall;

Description

Call DataOut to transform data before it is sent using a socket connection component. For example, use this method to encrypt or compress data.

The Data parameter is an IDataBlock interface to the data that is about to be sent by the socket connection component. Use the properties and methods of IDataBlock to transform the data.

Warning:	Do not transform the reserved bytes in the data block.


Hierarchy

IUnknown


TInsertButton

Hierarchy	Properties	Methods	See also

TInsertButton generates an HTML control that inserts a new record in an XML data packet.

Unit

MidItems

Description

Add TInsertButton as the child of a TDataNavigator component (or a layout group that is a child of a TDataNavigator component) to enable the generated HTML form to add records to an XML data packet. The resulting HTML button’s action adds a new blank record to the emerging XML delta packet and causes the associated display control to display that new record.

Use the properties of TInsertButton to customize the appearance of the button and associate it with a Web item. The associated Web item generates the HTML control that displays the newly inserted record.


TInsertButton properties

TInsertButton	Alphabetically	Legend

Derived from TDataSetButton

Caption

Derived from TXMLDisplayReferenceButton

XMLComponent

XMLUseParent

Derived from TWebButton

Custom

Style

StyleRule

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TInsertButton properties

TInsertButton	By object	Legend

Caption

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

XMLComponent

XMLUseParent


TInsertButton methods

TInsertButton	Alphabetically

In TInsertButton

Create

Derived from TXMLDisplayReferenceButton

Destroy

Derived from TWebButton

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TInsertButton methods

TInsertButton	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TInsertButton.Create

TInsertButton	See also

Creates and initializes an instance of TInsertButton.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TInsertButton at runtime. Buttons added at design time using the Web Page editor are instantiated automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebButton

TXMLDisplayReferenceButton

TDataSetButton


IProviderSupport

Hierarchy	Methods 	See also

IProviderSupport is the interface that datasets use to enable a provider to represent them in a multi-tiered database application.

Unit

db

Description

TDataSetProvider uses the IProviderSupport interface to interact with its associated dataset. Any dataset that implements the IProviderSupport interface can be placed in the application server of a multi-tiered database application, along with a provider that uses the interface to provide data to clients and apply updates received from clients.

TDataSet, the base class for all datasets, includes support for IProviderSupport. This support appears as a set of protected methods. However, most of these methods are simple stubs that either do nothing or generate an exception. Most of the dataset classes that ship with Delphi (BDE-enabled datasets, ADO-enabled datasets, Client datasets, and InterBase Express components) override these protected methods to implement the IProviderSupport interface in a more useful fashion.

Component writers that create their own custom descendants from TDataSet must override all appropriate IProviderSupport methods if their datasets are to work in the application server of a MIDAS-based multi-tiered application.


IProviderSupport methods

IProviderSupport	Alphabetically

In IProviderSupport

PSEndTransaction

PSExecute

PSExecuteStatement

PSGetAttributes

PSGetDefaultOrder

PSGetIndexDefs

PSGetKeyFields

PSGetParams

PSGetQuoteChar

PSGetTableName

PSGetUpdateException

PSInTransaction

PSIsSQLBased

PSIsSQLSupported

PSReset

PSSetCommandText

PSSetParams

PSStartTransaction

PSUpdateRecord

Derived from IUnknown

_AddRef

_Release

QueryInterface


IProviderSupport methods

IProviderSupport	By object

_AddRef

_Release

PSEndTransaction

PSExecute

PSExecuteStatement

PSGetAttributes

PSGetDefaultOrder

PSGetIndexDefs

PSGetKeyFields

PSGetParams

PSGetQuoteChar

PSGetTableName

PSGetUpdateException

PSInTransaction

PSIsSQLBased

PSIsSQLSupported

PSReset

PSSetCommandText

PSSetParams

PSStartTransaction

PSUpdateRecord

QueryInterface


IProviderSupport.PSEndTransaction

IProviderSupport	See also

Ends a transaction that was started by a call to PSStartTransaction

procedure PSEndTransaction(Commit: Boolean);

Description

The provider component applies updates within a transaction, if possible. To do so, it uses PSEndTransaction in conjunction with the PSStartTransaction method.

The Commit parameter indicates whether the dataset should commit the current transaction (Commit is True), or roll it back (Commit is False).

Note:	TDataSetProvider only starts a transaction (Using PSStartTransaction) if the PSInTransaction method indicates that there is no transaction already established. That is, it does not assume nested transaction support is available. Thus, there is no need to ensure that PSEndTransaction does not terminate a transaction that was not started by the provider.


IProviderSupport.PSExecute

IProviderSupport	See also

Executes the SQL command associated with the dataset.

procedure PSExecute;

Description

The provider component calls PSExecute to implement its Execute method. If the dataset represents a query or stored procedure, this method executes the query or stored procedure. If the provider Options includes poAllowCommandText and the dataset supports the PSSetCommandText method, the statement specified by PSSetCommandText may be executed instead.

If there is not statement to execute, PSExecute raises an EDatabaseError exception.


IProviderSupport.PSExecuteStatement

IProviderSupport	See also

Executes a specified SQL command.

function PSExecuteStatement(const ASQL: string; AParams: TParams; ResultSet: Pointer = nil): Integer;

Description

If the value of ResolveToDataSet is False, the provider component calls PSExecuteStatement indirectly to execute SQL statements that it generates for applying updates. Usually, the dataset passes these statements on to its database server for execution.

The ASQL parameter specifies the SQL command to execute.

AParams contains any parameter values that should be applied to ASQL before execution.

ResultSet allows PSExecuteStatement to return a dataset component that contains the results of a SELECT statement. If ResultSet is not nil, PSExecuteStatement creates a new dataset component as the target of this pointer and fills it with the result set. The caller is responsible for freeing the dataset.

PSExecuteStatement returns the number of rows affected by executing ASQL.


IProviderSupport.PSGetAttributes

IProviderSupport	See also

Returns information that is stored in data packets as Name/Value pairs.

procedure PSGetAttributes(List: TList);

Description

The provider component calls PSGetAttributes to add information about the dataset to the metadata stored with generated data packets. This information is stored as Name/Value pairs that are added to the list specified by the List parameter.


IProviderSupport.PSGetDefaultOrder

IProviderSupport	See also

Returns the definition of an index that imposes the default order on the data included in data packets.

function PSGetDefaultOrder: TIndexDef;

Description

The provider component calls PSGetDefaultOrder to generate a default index, called DEFAULT_ORDER, for the records that appear in data packets. This index defines the default sort order for records when they appear in the client dataset on the client.

PSGetDefaultOrder creates a TIndexDef object to describe the default index. The provider that calls PSGetDefaultOrder subsequently frees this TIndexDef object.


IProviderSupport.PSGetIndexDefs

IProviderSupport	See also

Returns the definitions of all specified indexes defined for the dataset.

function PSGetIndexDefs(IndexTypes:TIndexOptions= [ixPrimary..ixNonMaintained]): TIndexDefs;

Description

The provider component calls PSGetIndexDefs to locate an index that contains information it needs. For example, it uses PSGetIndexDefs to locate an index that contains the key fields returned by PSGetKeyFields. This information allows the provider to locate the records that need to change when it applies updates. The provider also calls this method to locate indexes that it adds to the metadata of data packets.

IndexTypes indicates the options required of the returned indexes. PSgetIndexDefs returns all indexes whose Options property includes the specified flags.

PSGetIndexDefs returns a TIndexDefs object that contains all the indexes of the dataset that match the IndexTypes parameter.


IProviderSupport.PSGetKeyFields

IProviderSupport	See also

Returns the names of all fields required to uniquely identify records in the data packet.

function PSGetKeyFields: string;

Description

The provider component calls PSGetKeyFields to determine what information is required to uniquely identify records in the data packet. This information allows it to locate the records that need to change when it applies updates.

PSGetKeyFields returns a semicolon-delimited string that lists the names of the key fields of the dataset. By default (as implemented by TDataSet), these are the fields with pfInKey included in their ProviderFlags property.


IProviderSupport.PSGetParams

IProviderSupport	See also

Returns the current parameter values of the dataset.

function PSGetParams: TParams;

Description

The provider component calls PSGetParams to implement its GetParams method.

PSGetParams returns a TParams object that describes the current values of all parameters of the dataset. If the dataset does not have any parameters, PSGetParams returns nil.

Note:	The PSGetParams method should not create a new instance of TParams for the return value. The provider that calls PSGetParams does not free the returned value.


IProviderSupport.PSGetQuoteChar

IProviderSupport	See also

Returns the character or characters to use in generated SQL statements to enclose quoted strings.

function PSGetQuoteChar: string;

Description

The provider component calls PSGetQuoteChar indirectly when generating the dynamic SQL statements that apply updates. These statements are subsequently executed by a call to PSExecuteStatement.

PSGetQuoteChar returns the character or characters that delimit quoted strings in the generated SQL. This string appears both before and after quoted strings.


IProviderSupport.PSGetTableName

IProviderSupport	See also

Returns the name of the dataset table that appears in generated SQL statements.

function PSGetTablename: string;

Description

PSGetTableName returns the name of the underlying database table against which updates are applied when the provider’s ResolveToDataSet property is False. This value is used for generating the SQL statements that apply updates. The generated SQL statements are subsequently executed by a call to PSExecuteStatement.

If PSGetTableName does not return a table name, the provider must have an OnGetTableName event handler to supply this value.


IProviderSupport.PSGetUpdateException

IProviderSupport	See also

Generates an EUpdateError object based on another exception object.

function PSGetUpdateException(E: Exception; Prev: EUpdateError): EUpdateError;

Description

The provider component calls PSGetUpdateException when the exception E occurs while applying updates. This method allows the provider to create a single EUpdateError object that encapsulates all the exceptions that occur in an update operation.

PSGetUpdateError determines the error message, context string, and error code from the exception specified by E and creates a new EUpdateError exception that includes that information as well as the information about a previous error as specified by Prev. The context string and error code for E may be specific to the Exception class associated with the dataset. By default, TDataSet generates an EUpdateError with an error code or 1 and an empty context string.


IProviderSupport.PSInTransaction

IProviderSupport	See also

Indicates whether actions against the dataset occur in the context of a transaction.

function PSInTransaction: Boolean;

Description

The provider component applies updates within a transaction, if possible. To do so, it first checks whether a transaction is already underway, and if not, generates one using PSStartTransaction. To determine whether a transaction is already underway, the provider calls PSInTransaction.

PSInTransaction returns True if there is a transaction underway, and False otherwise.


IProviderSupport.PSIsSQLBased

IProviderSupport	See also

Indicates whether the dataset includes native SQL support.

function PSIsSQLBased: Boolean;

Description

The provider calls PSIsSQLBased to determine whether the dataset supports some form of native SQL. This information is used when generating SQL commands that are executed by PSExecuteStatement.

Even if the dataset is not SQL-based, it may still allow the provider to execute SQL statements for applying updates. For example, BDE-enabled local databases such as Paradox and DBASE provide SQL support via the BDE’s local SQL engine, but are not SQL-based. However, table and field names are not specified in the same way for the local SQL engine as they are for native SQL. The provider uses PSIsSQLBased to determine how these names should appear in generated SQL.

Note:	The PSIsSQLSupported method indicates whether the dataset can execute SQL commands at all, regardless of whether the dataset is SQL-based.


IProviderSupport.PSIsSQLSupported

IProviderSupport	See also

Indicates whether the dataset can execute SQL statements.

function PSIsSQLSupported: Boolean;

Description

PSIsSQLSupported indicates whether the provider can call PSExecuteStatement to execute an SQL statement. When PSIsSQLSupported returns False, calling PSExecuteStatement generates an exception. The provider can still work with a dataset that returns False from PSIsSQLSupported, but it must set the ResolveToDataSet property to True, or provide data on a read-only basis.


IProviderSupport.PSReset

IProviderSupport	See also

Resets the dataset so that it is positioned on the first record.

procedure PSReset;

Description

The provider calls PSReset to reposition the dataset on the first record before fetching records.


IProviderSupport.PSSetCommandText

IProviderSupport	See also

Assigns a specified SQL command to be executed by PSExecute.

procedure PSSetCommandText(const CommandText: string);

Description

If the provider’s Options property includes poAllowCommandText, clients can supply an SQL command along with a call to GetRecords or Execute. This command is passed to the dataset by a call to PSSetCommandText, and subsequently executed by a call to PSExecute.

The value of the CommandText parameter replaces the dataset’s SQL statement (if it has one), or replaces the name of an underlying database table or stored procedure.


IProviderSupport.PSSetParams

IProviderSupport	See also

Assigns the specified parameter values to the dataset.

procedure PSSetParams(AParams: TParams);

Description

PSSetParams assigns the parameter values specified by AParams to the parameters of the dataset.


IProviderSupport.PSStartTransaction

IProviderSupport	See also

Starts a transaction that encapsulates all activity until a call to PSEndTransaction.

procedure PSStartTransaction;

Description

The provider component applies updates within a transaction, if possible. To do so, it calls PSStartTransaction to start a transaction before applying updates, and calls PSEndTransaction when all updates are applied or too many errors are encountered.

Note:	TDataSetProvider only starts a transaction (Using PSStartTransaction) if the PSInTransaction method indicates that there is no transaction already established. That is, it does not assume nested transaction support is available.


IProviderSupport.PSUpdateRecord

IProviderSupport	See also

Applies a single update to the underlying database table or tables.

function PSUpdateRecord(UpdateKind: TUpdateKind; Delta: TDataSet): Boolean;

Description

Before the provider generates SQL statements to apply an update, it calls PSUpdateRecord to let the dataset apply the update in some other fashion. For example, BDE-enabled datasets generate an OnUpdateRecord to allow the application to apply the update and, if the OnUpdateRecord event handler does not apply the update, uses any associated TUpdateSQL object to apply the update.

UpdateKind indicates whether the update is an insertion (ukInsert), deletion (ukDelete), or modification (ukModify).

Delta is the delta datapacket. The current record represents the record to be updated.

PSUpdateRecord returns True if it updates the record, False otherwise. If PSUpdateRecord returns False, the provider generates dynamic SQL to perform the update and calls PSExecuteStatement.

Note:	PSUpdateRecord is only called if the provider’s ResolveToDataSet property is False.


Hierarchy

IUnknown


ISendDataBlock

Hierarchy	Methods	See also

ISendDataBlock is the interface used by TDataBlockInterpreter to send messages to application server after they are marshaled.

Unit

Sconnect

Description

Streamed connection components implement ISendDataBlock to allow a TDataBlockInterpreter object (which handles marshaling of COM interface calls) to send interface calls to the application server.

ISendDataBlock is an interface, and as such can’t be directly instantiated. Instead, streamed connection components (which implement ISendDataBlock) can be cast to an ISendDataBlock.


ISendDataBlock methods

ISendDataBlock	Alphabetically

In ISendDataBlock

Send

Derived from IUnknown

_AddRef

_Release

QueryInterface


ISendDataBlock methods

ISendDataBlock	By object

_AddRef

_Release

QueryInterface

Send


ISendDataBlock.Send

ISendDataBlock	Methods 	See also

Sends information retrieved from an IDataBlock interface to the application server.

function Send(const Data: IDataBlock; WaitForResult: Boolean): IDataBlock;

Description

ISendDataBlock dispatches information to an application server. The information must be available as the Memory property of an IDataBlock interface.

The WaitForResult parameter indicates whether the caller requires a response when the information is sent. If WaitForResult is True, Send will not return until a response is received from the application server. This response is returned as an IDataBlock interface. If  WaitForResult is False, Send may still return a response, but only if the application server responds immediately.


Hierarchy

IUnknown


ITransport

Hierarchy	Properties	Methods	See also

ITransport is the interface used by TStreamedConnection to connect to, read from, and write to a remote application server.

Unit

sconnect

Description

Streamed connection components use ITransport to connect to an application server and to send or receive data over that connection. ITransport is responsible only for managing the communication protocols. It does not provide any support for marshaling or storing information.

ITransport is an interface, and as such can’t be directly instantiated. Instead, objects that implement the ITransport properties and methods include ITransport in their class definition. Such objects can be cast to an ITransport so that they can be used by TStreamedConnection.


ITransport properties

ITransport	Alphabetically

In ITransport

Connected


ITransport properties

ITransport	By object

Connected


ITransport.Connected

ITransport	See also

Indicates whether the connection to the application server is established.

property Connected: Boolean;

Description

Set Connected to True to connect to the application server. Set Connected to False to close a connection.

Read the Connected property to verify that the connection is open before reading from or writing to the application server.


ITransport methods

ITransport	Alphabetically

In ITransport

GetConnected

GetWaitEvent

Receive

Send

SetConnected

Derived from IUnknown

_AddRef

_Release

QueryInterface


ITransport methods

ITransport	By object

_AddRef

_Release

GetConnected

GetWaitEvent

QueryInterface

Receive

Send

SetConnected


ITransport.GetConnected

ITransport	See also

Returns the value of the Connected property.

function GetConnected: Boolean;

Description

GetConnected is the read property implementer for the Connected property.


ITransport.GetWaitEvent

ITransport	See also

Returns the handle for an event object that is managed by the object that implements ITransport.

type THandle = Integer;

function GetWaitEvent: THandle; stdcall;

Description

Streamed connection components perform all reading from and writing to the application server using a separate execution thread. This limits the impact that communication with the application server has on the speed of the client application, because execution does not need to wait while messages are marshaled and sent or received. The streamed connection component needs to coordinate its use of the communication thread. To do this, it needs an event object that is a member of the object that implements ITransport.

GetWaitEvent returns a handle to this event object. When implementing an object that supports ITransport, create a TEvent object as a member and return its handle as the return value of GetWaitEvent. Do not use the event object for internal purposes or it will interfere with the streamed connection’s use of the event.


ITransport.Receive

ITransport	See also

Returns an IDataBlock interface that can be used to read information received from the application server.

function Receive(WaitForInput: Boolean; Context: Integer): IDataBlock;

Description

Receive creates a COM object that implements the IDataBlock interface and reads information from the application server into its Memory property.

If WaitForInput is True, Receive halts execution until the application server sends the expected information. If WaitForInput is False, Receive can fail (reading no information) if the application server does not send any information immediately (or after a brief timeout period).

Context is transport-specific data that can be used when implementing a class that supports ITransport. Its value is the return value of the Send method.


ITransport.Send

ITransport	See also

Sends information retrieved from an IDataBlock interface to the application server.

function Send(const Data: IDataBlock): Integer; stdcall;

Description

Send sends the entire contents of the Data parameter’s Memory property to the application server. It returns a transport-specific value that is used by the next call to the Receive method. For example, HTTP transport classes return the handle for the internet connection.


ITransport.SetConnected

ITransport

Sets the value of the Connected property.

property Connected: Boolean;

Description

SetConnected is the write implementer for the Connected property.


Hierarchy

IUnknown


IWebComponent

Hierarchy	Properties	Methods	See also

IWebComponent is the interface supported by components that TWebComponentList manages.

Unit

WebComp

Description

TWebComponentList uses IWebComponent to ensure that all components in its list have access to information about how they fit in the hierarchy of Web items.


IWebComponent properties

IWebComponent	Alphabetically

In IWebComponent

ComponentList

Container

Index


IWebComponent properties

IWebComponent	By object

ComponentList

Container

Index


IWebComponent.ComponentList

IWebComponent	See also

Indicates the component list that contains the Web item.

property ComponentList: TObject;

Description

The Web component list assigns a value to ComponentList when the component is added to it. The component can use this value to access the list and obtain information about the other components in the list.

Note that the IWebComponent interface does not include any methods for reading the value of ComponentList.


IWebComponent.Container

IWebComponent	See also

Specifies the component that uses content generated by this Web item.

property Container: TWebComponentContainer;

Description

Web items are arranged in a hierarchy, where each item generates its content using content produced by its children. Container specifies the parent that uses the content of this Web item. Container maintains a list of all its children using a TWebComponentList object.


IWebComponent.Index

IWebComponent	See also

Indicates where the Web item appears in the Web component list’s array of Web items.

property Index: Integer;

Description

The Web component list sets Index to indicate where the component sits in its WebComponents property array.


IWebComponent methods

IWebComponent	Alphabetically

In IWebComponent

GetContainer

GetIndex

SetComponentList

SetContainer

SetIndex

Derived from IUnknown

_AddRef

_Release

QueryInterface


IWebComponent methods

IWebComponent	By object

_AddRef

_Release

GetContainer

GetIndex

QueryInterface

SetComponentList

SetContainer

SetIndex


IWebComponent.GetContainer

IWebComponent	See also

Returns the value of the Container property.

function GetContainer: TWebComponentContainer;

Description

GetContainer is the read method for the Container property.


IWebComponent.GetIndex

IWebComponent	See also

Returns the value of the Index property.

function GetIndex: Integer;

Description

GetIndex is the read method for the Index property.


IWebComponent.SetComponentList

IWebComponent	See also

Sets the value of the ComponentList property.

procedure SetComponentList(List: TObject);

Description

SetComponentList is the write method for the ComponentList property. The List parameter specifies the value to assign to ComponentList.


IWebComponent.SetContainer

IWebComponent	See also

Sets the value of the Container property.

procedure SetContainer(Container: TWebComponentContainer);

Description

SetContainer is the write method for the Container property. The Container parameter specifies the value to assign to Container.


IWebComponent.SetIndex

IWebComponent	See also

Sets the value of the Index property.

procedure SetIndex(Value: Integer);

Description

SetIndex is the write method for the Index property. The Value parameter specifies the value to assign to Index.


Hierarchy

IUnknown


IWebContent

Hierarchy	Methods	See also

IWebContent is an interface that allows components page producers and Web items to access the HTML generated by other components.

Unit

WebComp

Description

TMidasPageProducer and TComponentsPageProducer create HTML documents that include content generated by other components, called Web items. Similarly, the Web items that generate content can make use of other Web items when producing their content.

The only requirement for a component for it to act as a Web item is that it must support the IWebContent interface. This interface defines one new method, Content, which returns the HTML generated by the Web item.


IWebContent methods

IWebContent	Alphabetically

In IWebContent

Content

Derived from IUnknown

_AddRef

_Release

QueryInterface


IWebContent methods

IWebContent	By object

_AddRef

_Release

Content

QueryInterface


IWebContent.Content
IWebContent.::Content

IWebContent

Returns the HTML that the Web item generates.

function Content(Options: TWebContentOptions; ParentLayout: TLayout): string;

Description

Call Content to access the HTML produced by the Web item.

Options contains a set of flags that limit what can be included in the generated HTML.

ParentLayout specifies a helper object that the caller supplies for determining how the Web item should lay out its constituent parts. The type of this object depends on the caller and on the Web item supporting the IWebContent interface.

Content returns a string of HTML produced by the Web item.


Hierarchy

IUnknown


TLastButton

Hierarchy	Properties	Methods	See also

TLastButton generates an HTML control that moves to the last record in an XML data packet.

Unit

MidItems

Description

Add TLastButton as the child of a TDataNavigator component (or a layout group that is a child of a TDataNavigator component) to enable the generated HTML form to move quickly to the last record in a dataset. The resulting HTML button’s action changes the associated display control so that it shows the last record as current.

Use the properties of TLastButton to customize the appearance of the button and associate it with a Web item. The associated Web item displays the records that the last button navigates.


TLastButton properties

TLastButton	Alphabetically	Legend

Derived from TDataSetButton

Caption

Derived from TXMLDisplayReferenceButton

XMLComponent

XMLUseParent

Derived from TWebButton

Custom

Style

StyleRule

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TLastButton properties

TLastButton	By object	Legend

Caption

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

XMLComponent

XMLUseParent


TLastButton methods

TLastButton	Alphabetically

In TLastButton

Create

Derived from TXMLDisplayReferenceButton

Destroy

Derived from TWebButton

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TLastButton methods

TLastButton	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TLastButton.Create

TLastButton	See also

Creates and initializes an instance of TLastButton.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TLastButton at runtime. Buttons added at design time using the Web Page editor are instantiated automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebButton

TXMLDisplayReferenceButton

TDataSetButton


TLayoutAttributes

Hierarchy	Methods	See also

TLayoutAttributes describes how an HTML control should be laid out.

Unit

WebComp

Description

TLayoutAttributes embodies a set of flags that describe how an HTML control should be laid out. These flags form the value of several public fields of the object, including

LabelAttributes: a string that describes style attributes that apply to the control’s label (if any).

LabelPosition: an enumerated value describing the the position of the label (if any) relative to the control. Possible values are lposLeft (to the left of the control), lposRight (to the right of the control), lposAbove (above the control) and lposBelow (below the control).

ControlAttributes: a string that describes style attributes that apply to the control.


TLayoutAttributes methods

TLayoutAttributes	Alphabetically

In TLayoutAttributes

Create

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TLayoutAttributes methods

TLayoutAttributes	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TLayoutAttributes.Create

TLayoutAttributes

Creates a new TLayoutAttributes object.

constructor Create;

Description

Typically, applications do not instantiate TLayoutAttributes. Instead, each Web item that generates HTML for a MIDAS Web application instantiates an internal TLayoutAttributes object and uses it to encode property values that affect the layout of its generated HTML.


Hierarchy

TObject


TLayoutGroup

Hierarchy	Properties	Methods	See also

TLayoutGroup generates the HTML to arrange content produced by other Web items.

Unit

MidItems

Description

Use TLayoutGroup to adjust the layout of items in an HTML document. There are few restrictions on what Web items can use a layout group because it has no special content that it displays. It merely imposes a layout on content generated by other Web items.

TLayoutGroup maintains a list of Web items that display information in the final HTML document, but imposes no restrictions of its own on the possible types of Web items. Instead, it restricts those Web items to the classes that its parent allows. In order to let the parent component use the HTML that TLayoutGroup generates, TLayoutGroup inherits the IWebContent interface from TWebControlGroup.


TLayoutGroup properties

TLayoutGroup	Alphabetically	Legend

Derived from TCustomLayoutGroup

Custom

DisplayColumns

Style

StyleRule

Derived from TWebControlGroup

WebFieldControls

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TLayoutGroup properties

TLayoutGroup	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

DisplayColumns

Name

Owner

Style

StyleRule

Tag

VCLComObject

WebFieldControls


TLayoutGroup methods

TLayoutGroup	Alphabetically

Derived from TCustomLayoutGroup

Create

Destroy

Derived from TWebControlGroup

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TLayoutGroup methods

TLayoutGroup	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebControlGroup


ELowCapacityError

Hierarchy	Properties	Methods	See also

ELowCapacityError is the exception class for when an attempt is made to allocate more memory than is available for the decision cube.

Unit

mxarrays

Description

ELowCapacityError is raised when the cache of a decision cube is too big. The memory available to the decision cube can be increased by changing the Capacity property of the decision cube or the memory demands of the decision cube can be reduced by deactivating some of the cube dimensions.


ELowCapacityError properties

ELowCapacityError	Alphabetically

Derived from Exception

HelpContext

Message


ELowCapacityError properties

ELowCapacityError	By object

HelpContext

Message


ELowCapacityError methods

ELowCapacityError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


ELowCapacityError methods

ELowCapacityError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


 TMidasPageProducer

Hierarchy	Properties	Methods	Events	See also

TMidasPageProducer assembles an HTML document that represents live database information from an application server.

Unit

dsprod

Description

Use TMidasPageProducer to create Web pages for a MIDAS Web application. These pages display database information from an application server and include data packets encoded in XML and javascript that lets Web browsers navigate that data, post changes, and apply updates back to the application server.

The MIDAS page producer is assigned as the Producer property of a Web action item or called from an OnAction event handler.

The MIDAS page producer creates its HTML document from a template. Unlike other page producers, the MIDAS page producer has a default template that coordinates several top-level declarations for the HTML document with content produced by other components. The other components that generate HTML content for the MIDAS page producer can be added at design time using the Web Page editor.


TMidasPageProducer properties

TMidasPageProducer	Alphabetically	Legend

Derived from TCustomMidasPageProducer

EnableXMLIslands

IncludePathURL

Styles

StylesFile

Derived from TPageItemsProducer

WebPageItems

Derived from TCustomPageProducer

HTMLDoc

HTMLFile

StripParamQuotes

Derived from TCustomContentProducer

Dispatcher

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TMidasPageProducer properties

TMidasPageProducer	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Dispatcher

EnableXMLIslands

HTMLDoc

HTMLFile

IncludePathURL

Name

Owner

StripParamQuotes

Styles

StylesFile

Tag

VCLComObject

WebPageItems


TMidasPageProducer events

TMidasPageProducer	Alphabetically	Legend

Derived from TCustomMidasPageProducer

OnAfterGetContent

OnAfterGetXMLData

OnBeforeGetContent

OnBeforeGetXMLData

Derived from TPageProducer

OnHTMLTag


TMidasPageProducer events

TMidasPageProducer	By object	Legend

OnAfterGetContent

OnAfterGetXMLData

OnBeforeGetContent

OnBeforeGetXMLData

OnHTMLTag


TMidasPageProducer methods

TMidasPageProducer	Alphabetically

Derived from TCustomMidasPageProducer

Content

Create

Destroy

FindXMLBroker

FindXMLBrokerName

GetXMLData

SetIncludePathURL

SetStyles

SetStylesFile

Derived from TCustomPageProducer

ContentFromStream

ContentFromString

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMidasPageProducer methods

TMidasPageProducer	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Content

ContentFromStream

ContentFromString

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FindXMLBroker

FindXMLBrokerName

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetXMLData

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

SetIncludePathURL

SetStyles

SetStylesFile

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomContentProducer

TCustomPageProducer

TPageProducer

TComponentsPageProducer

TPageItemsProducer

TCustomMidasPageProducer


TMtsAutoObject

Hierarchy	Properties	Methods	See also

TMtsAutoObject encapsulates the objects and interfaces of the MTS application server.

Unit

Mtsobj

Description

Use a TMtsAutoObject object as the central repository for all objects in an MTS-enabled application server.

MTS Automation objects are dual-interface Automation servers that implement the IObjectControl interface. MTS Automation objects are like any Automation server with additional features that encapsulate MTS services such as transaction support and security.

To create a TMtsAutomation object at design time, choose File|New, ActiveX tab, and select the MTS Automation wizard. The MTS Automation wizard then creates a new descendant that descends from TMtsAutoObject.


TMtsAutoObject properties

TMtsAutoObject	Alphabetically	Legend

Derived from TComObject

Controller

Factory

RefCount

ServerExceptionHandler


TMtsAutoObject properties

TMtsAutoObject	By object	Legend

Controller

Factory

RefCount

ServerExceptionHandler


TMtsAutoObject methods

TMtsAutoObject	Alphabetically

In TMtsAutoObject

DisableCommit

EnableCommit

IsCallerInRole

IsInTransaction

IsSecurityEnabled

SetAbort

SetComplete

Derived from TComObject

Create

CreateAggregated

CreateFromFactory

Destroy

Initialize

ObjAddRef

ObjQueryInterface

ObjRelease

SafeCallException

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMtsAutoObject methods

TMtsAutoObject	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateAggregated

CreateFromFactory

DefaultHandler

Destroy

DisableCommit

Dispatch

EnableCommit

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

Initialize

InitInstance

InstanceSize

IsCallerInRole

IsInTransaction

IsSecurityEnabled

MethodAddress

MethodName

NewInstance

ObjAddRef

ObjQueryInterface

ObjRelease

SafeCallException

SetAbort

SetComplete


TMtsAutoObject.DisableCommit

TMtsAutoObject	See also

Prevents clients from completing transactions.

procedure DisableCommit;

Description

Call DisableCommit to indicate that the MTS Automation object cannot complete its current transaction or release state information until it receives further method invocations from the client. After calling DisableCommit, the current transaction (if any) cannot be completed until the MTS Automation object calls EnableCommit or SetComplete.

With transactions that are started automatically when the MTS Automation object’s interface is called, DisableCommit is not necessary. These transactions are not committed until the MTS Automation object calls SetComplete. However, when the MTS Automation object is enlisted in a transaction that was started previously, the client controls the transaction and can attempt to commit it before the MTS Automation object has completed its part. Calling DisableCommit prevents the client from prematurely committing a transaction. If a client tries to commit a transaction after the MTS Automation object has called DisableCommit, the transaction aborts.

Tip: 	Call DisableCommit at the beginning of a method to protect your MTS Automation object from committing prematurely in the event of an unexpected return. If the method call finishes normally, calling EnableCommit or SetComplete reverses this affect and allows the transaction to complete.


TMtsAutoObject.EnableCommit

TMtsAutoObject	See also

Allows clients to complete transactions without releasing state information.

procedure EnableCommit;

Description

Call EnableCommit to indicate that the MTS Automation object can complete its current transaction without releasing state information. Unlike the SetComplete method (which also signals that the current transaction can be committed), EnableCommit does not allow MTS to deactivate the MTS Automation object. This lets the MTS Automation object preserve state information over multiple interface calls, while still allowing clients that have enlisted the object in a transaction to commit.

By default, transactions can be completed when an interface call ends, unless the DisableCommit method is called. There is no need to call EnableCommit unless the MTS Automation object has previously called DisableCommit.

Note:	Although EnableCommit permits the current transaction to be completed, it does not automatically commit the transaction. The client that enlisted the MTS Automation object must still explicitly commit that transaction. If MTS started the transaction automatically (because the MTS Automation object requires a transaction for its interface calls), the transaction is not committed until the data module calls SetComplete.


TMtsAutoObject.IsCallerInRole

TMtsAutoObject

Indicates whether the current client matches a particular security role.

function IsCallerInRole(const Role: WideString): Bool;

Description

MTS provides role-based security. Each level of access to your application server can be assigned a role. Using the MTS Explorer, administrators can prevent clients from using an interface based on their role. (This is called declarative security.) In addition, however, programs can provide more fine-grained security programmatically. To do this, use IsCallerInRole to provide access to blocks of code based on the caller’s security role.

IsCallerInRole checks whether the current client is part of the role named by the Role parameter. It returns True if the client matches the named role, and False otherwise. Use IsCallerInRole to prevent clients from invoking certain blocks of code if they do not have the appropriate security role.

Note:	MTS security is not available on servers running Windows95. If the MTS application is running on Windows95, IsCallerInRole always returns True . In addition, IsCallerInRole always returns True if the application is part of an MTS Library package (which runs in the client’s process space).


TMtsAutoObject.IsInTransaction

TMtsAutoObject	See also

Indicates whether the MTS Automation object is running in a transaction.

function IsInTransaction: Bool;

Description

Call IsInTransaction to determine whether the MTS Automation object is currently running in a transaction. For example, if the MTS Automation object requires a transaction, use IsInTransaction to check that this requirement has not been turned off by an administrator using the MTS Explorer, and to raise an exception if it has.

Note:	If IsInTransaction returns False, the EnableCommit and DisableCommit methods have no effect.


TMtsAutoObject.IsSecurityEnabled

TMtsAutoObject

Indicates whether security is enabled for the current MTS Automation object instance.

function IsSecurityEnabled: Bool;

Description

Call IsSecurityEnabled to determine whether the MTS Automation object is currently protected by MTS security services. MTS security is enabled unless the object is running in the client’s process. This can happen if the MTS Automation object is configured to run in the client’s process space by an administrator using the MTS Explorer, or if the client application is in the same MTS package as the MTS Automation object.

Note:	MTS security is not available for servers running on Windows95.


TMtsAutoObject.SetAbort

TMtsAutoObject

Allows the MTS Automation object to be deactivated and aborts any current transactions.

procedure SetAbort;

Description

Call SetAbort to indicate that any current transaction that includes the MTS Automation object to abort. If MTS started a transaction automatically, the transaction aborts when the current method call exits. If the MTS Automation object was enlisted in a pre-existing transaction, the client transaction will eventually fail. Usually, SetAbort is called in the except block of a try...except statement.

In addition to aborting any current transaction, SetAbort indicates that the MTS Automation object can be deactivated when the current interface call exits. This means that state information is not preserved for the next time and the client calls the Automation object’s interface. To prevent transactions from committing successfully without losing state information, use the DisableCommit method instead.

Tip: 	Call SetAbort at the beginning of a method to protect your MTS data module from committing prematurely in the event of an unexpected return. If the method call finishes normally, calling SetComplete reverses this affect and allows the transaction to complete.


TMtsAutoObject.SetComplete

TMtsAutoObject	See also

Indicates that the MTS Automation object has successfully completed its current task.

procedure SetComplete;

Description

Call SetComplete to indicate that the MTS Automation object no longer needs to maintain state information. After calling SetComplete, the MTS Automation object is deactivated when the current method call exits.

If the MTS Automation object is part of a transaction, SetComplete indicates that this part of the transaction can commit. If MTS started the transaction automatically when the client called the MTS Automation object’s methods, MTS tries to commit the transaction when the current method exits.

Note:	This transaction may still fail if the current transaction included another MTS object that called SetAbort or DisableCommit.


Accessibility

Read-only


Hierarchy

TObject

TComObject

TTypedComObject

TAutoObject


TMtsDataModule

Hierarchy	Properties	Methods	Events	See also

TMtsDataModule encapsulates the objects and interfaces of an MTS application server.

Unit

mtsrdm

Description

Use a TMtsDataModule object as the central repository for all objects in an MTS-enabled application server. MTS data modules can contain any nonvisual components. . Typically these are data access components, such as datasets and the provider components that handle communication between these datasets and client applications. MTS data modules can also contain other nonvisual components, such as TTimer, or TImageList.

MTS data modules are dual-interface Automation servers that implement the IAppServer interface. Connection components on client applications are designed to look for this interface. The methods in this interface, however, do not call the SetComplete method, so the MTS data module is not transactional. You may want to expand the MTS data module’s interface to provide alternate versions of these methods that use the MTS data module’s transaction.

The default interaction between a client dataset and an MTS data module does not rely on state information, so it is safe to use the MTS data module with just-in-time activation. However, you may need to provide a mechanism for communicating persistent state information to take advantage of some features such as incremental fetches.

To create an MTS data module at design time, choose File|New, and select MTS Data Module from the multitier page of the new items dialog. The MTS Data Module Wizard then creates a new descendant of TMtsDataModule that supports an interface that descends from IAppServer.


TMtsDataModule properties

TMtsDataModule	Alphabetically	Legend

In TMtsDataModule

AutoComplete

Derived from TDataModule

DesignOffset

DesignSize

OldCreateOrder

Derived from TRemoteDataModule

Providers

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TMtsDataModule properties

TMtsDataModule	By object	Legend

AutoComplete

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

DesignOffset

DesignSize

Name

OldCreateOrder

Owner

Providers

Tag

VCLComObject


TMtsDataModule.AutoComplete

TMtsDataModule	See also

Specifies whether the IAppServer methods are transactional.

property AutoComplete: Boolean;

Description

AutoComplete controls whether calls made using the IAppServer interface end in a call to SetComplete or SetAbort. By calling SetComplete or SetAbort, the MTS data module indicates that no state information needs to be preserved when the call exits. This allows any MTS transactions to complete (or roll back) and allows the MTS proxy to deactivate the MTS data module.

When AutoComplete is True, all IAppServer methods call SetComplete when they are done with two exceptions:

AS_ApplyUpdates calls SetAbort if an exception is raised or if the error count exceeds the specified maximum.

AS_DataRequest doesn’t call either SetComplete or SetAbort. You must add the appropriate call to the OnDataRequest event handler.

Set AutoComplete to False if the MTS data module needs to preserve state information (such as the current record in a dataset) after an IAppServer call exits. When AutoComplete is False, you must add your own interface methods that call SetComplete or SetAbort when the MTS data module can be safely deactivated.


TMtsDataModule events

TMtsDataModule	Alphabetically	Legend

In TMtsDataModule

OnActivate

OnDeactivate

Derived from TDataModule

OnCreate

OnDestroy


TMtsDataModule events

TMtsDataModule	By object	Legend

OnActivate

OnCreate

OnDeactivate

OnDestroy


TMtsDataModule.OnActivate

TMtsDataModule	See also 	Example

Occurs when the MTS proxy activates an instance of TMtsDataModule.

property OnActivate: TNotifyEvent;

Description

Write an OnActivate event handler to take specific action when the MTS proxy activates the MTS data module. This is the point when any database connections should be established. Database connections must not opened before the MTS data module is activated.

Note:	In traditional MTS programming, objects acquire their context object when they are activated. However, TMtsDataModule handles this task automatically.


TMtsDataModule.OnDeactivate

TMtsDataModule	See also 	Example

Occurs when the MTS proxy deactivates an instance of TMtsDataModule.

property OnDeactivate: TNotifyEvent;

Description

Write an OnDeactivate event handler to take specific action when the MTS proxy releases an instance of the MTS data module. Use this method to close any database connections that were opened when the MTS data module was activated. Database connections must not be left open after the MTS data module is deactivated.

Note:	In traditional MTS programming, objects release their context object when they are deactivated. However, TMtsDataModule handles this task automatically.


TMtsDataModule methods

TMtsDataModule	Alphabetically

In TMtsDataModule

Create

DisableCommit

EnableCommit

IsCallerInRole

IsInTransaction

IsSecurityEnabled

SetAbort

SetComplete

Derived from TRemoteDataModule

Destroy

Lock

RegisterProvider

Unlock

UnRegisterProvider

Derived from TDataModule

AfterConstruction

BeforeDestruction

CreateNew

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMtsDataModule methods

TMtsDataModule	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateNew

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableCommit

Dispatch

EnableCommit

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsCallerInRole

IsInTransaction

IsSecurityEnabled

Lock

MethodAddress

MethodName

NewInstance

RegisterProvider

RemoveComponent

SafeCallException

SetAbort

SetComplete

Unlock

UnRegisterProvider

UpdateAction


TMtsDataModule.Create

TMtsDataModule	See also

Creates an MTS data module instance.

constructor Create(AOwner: TComponent); override;

Description

Most applications do not need to call the constructor for TMtsDataModule.  Instead, add a remote data module to a server application using the MTS data module wizard on the multi-tier page of the new items dialog.

AOwner specifies the component that is responsible for freeing the remote data module (typically the application).


TMtsDataModule.DisableCommit

TBaseProvider	See also

Prevents clients from completing transactions.

procedure DisableCommit;

Description

Call DisableCommit to indicate that the MTS data module can't complete its current  transaction or release state information (properties) until it receives further method invocations from the client. After calling DisableCommit, the current transaction (if any) can’t be completed until the MTS data module calls EnableCommit or SetComplete.

With transactions that are started automatically when the MTS data module’s interface is called, DisableCommit is not necessary. These automatically generated transactions are not committed until the MTS data module calls SetComplete. However, when the MTS data module is enlisted in a transaction that was started previously, the client controls the transaction and can attempt to commit it before the MTS data module has completed its part. Calling DisableCommit prevents the client from prematurely committing a transaction. If a client tries to commit a transaction after the MTS data module has called DisableCommit, the transaction aborts.

Tip:	Call DisableCommit at the beginning of a method to protect your MTS data module from committing prematurely in the event of an unexpected return. If the method call finishes normally, calling EnableCommit or SetComplete reverses this affect and allows the transaction to complete.


TMtsDataModule.EnableCommit

TBaseProvider	See also

Allows clients to complete transactions without releasing state information.

procedure EnableCommit;

Description

Call EnableCommit to indicate that the MTS data module can complete its current transaction without releasing state information (properties). Unlike the SetComplete method (which also signals that the current transaction can be committed), EnableCommit does not allow MTS to deactivate the data module. This lets the MTS data module preserve state information over multiple interface calls, while still allowing clients that have enlisted the data module in a transaction to commit.

By default, transactions can be completed when interface calls finish, unless the DisableCommit method is called. There is no need to call EnableCommit unless the MTS data module has previously called DisableCommit.

Note:	Although EnableCommit permits the current transaction to be completed, it does not automatically commit the transaction. The client that enlisted the MTS data module in a transaction must still explicitly commit that transaction. If MTS started the transaction automatically (because the MTS data module requires a transaction for its interface calls), the transaction is not committed until the data module calls SetComplete.


TMtsDataModule.IsCallerInRole

TBaseProvider	See also

Indicates whether the current client fits into a particular security role.

function IsCallerInRole(const Role: WideString): Bool;

Description

MTS provides role-based security. Each level of access to the application server can be assigned a name, called a role. Using the MTS Explorer, administrators can prevent clients from using an interface based on their role. (This is called declarative security.) In addition, however, programs can provide more fine-grained security programmatically. To do this, use IsCallerInRole to provide access to blocks of code based on the caller’s security role.

IsCallerInRole checks whether the current client is part of the role named by the Role parameter. It returns True if the client fits the named role, and False otherwise. Use IsCallerInRole to prevent clients that do not have the appropriate security roles from invoking certain blocks of code.

Note:	MTS security is not available on servers running Windows95. If the application server is running on Windows95, IsCallerInRole always returns True. In addition, IsCallerInRole always returns True if the application server is part of an MTS Library package (which runs in the client’s process space).


TMtsDataModule.IsInTransaction

TBaseProvider	See also

Indicates whether the MTS data module is running in a transaction.

function IsInTransaction: Bool;

Description

Call IsInTransaction to determine whether the MTS data module is currently running in a transaction. For example, if the MTS data module requires a transaction, use IsInTransaction to check that this requirement has not been turned off using the MTS Explorer, and to raise an exception if it has.

Note:	If IsInTransaction returns False, the EnableCommit and DisableCommit methods have no effect.


TMtsDataModule.IsSecurityEnabled

TBaseProvider	See also

Indicates whether security is enabled for the current MTS data module instance.

function IsSecurityEnabled: Bool;

Description

Call IsSecurityEnabled to determine whether the MTS data module is currently protected by MTS security services. MTS security is enabled unless the object is running in the client's process. This can happen if an administrator using the MTS Explorer configures the MTS data module to run in the client’s process space (an MTS Library package), or if the client application is in the same MTS package as the MTS data module.

Note:	MTS security is not available for servers running on Windows95.


TMtsDataModule.SetAbort

TBaseProvider	See also 	Example

Allows the MTS data module to be deactivated and aborts any current transactions.

procedure SetAbort;

Description

Call SetAbort to indicate that any current transaction that includes the MTS data module should abort. If MTS started a transaction automatically (because the data module requires one), that transaction aborts when the current method call exits. If the MTS data module was enlisted in a pre-existing transaction, the client transaction will eventually fail. Usually, SetAbort is called in the except block of a try..except statement.

In addition to aborting any current transaction, SetAbort indicates that the MTS data module can be deactivated when the current interface call exits. This means that state information is not preserved for the next time the client calls the data module’s interface. To prevent transactions from committing successfully without losing state information, use the DisableCommit method instead.

Tip:	Call SetAbort at the beginning of a method to protect your MTS data module from committing prematurely in the event of an unexpected return. If the method call finishes normally, calling SetComplete reverses this affect and allows the transaction to complete.


TMtsDataModule.SetComplete

TBaseProvider	See also 	Example

Indicates that the MTS data module has successfully completed its current task.

procedure SetComplete;

Description

Call SetComplete to indicate that the MTS data module no longer needs to maintain state information. After calling SetComplete, the MTS data module is deactivated when the current method call exits.

If the MTS data module is part of a transaction, SetComplete indicates that this part of the transaction can commit. If MTS started the transaction automatically when the client called the MTS data module’s method (because the MTS data module requires a transaction), MTS tries to commit the transaction when the current method exits.

Note:	This transaction may still fail if the current transaction included another MTS object that called SetAbort or DisableCommit.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataModule

TRemoteDataModule


 TMidasConnection

Hierarchy	Properties	Methods	Events	See also

TMidasConnection handles a server connection for the client of a multi-tiered application.

Unit

MIDASCon

Description

TMidasConnection is provided for backward compatibility. When writing client applications that connect to application servers using DCOM, use TDCOMConnection instead. When writing client applications that connect to application servers using sockets, use TSocketConnection instead. When writing client applications that connect to application servers using HTTP, use TWebConnection instead.


TMidasConnection properties

TMidasConnection	Alphabetically	Legend

In TMidasConnection

ConnectType

ServerPort

UseBroker

Derived from TDCOMConnection

ComputerName

Derived from TCOMConnection

Connected

Derived from TDispatchConnection

AppServer

Connected

ObjectBroker

ServerGUID

ServerName

Derived from TCustomConnection

DataSetCount

DataSets

LoginPrompt

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TMidasConnection properties

TMidasConnection	By object	Legend

AppServer

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ComputerName

Connected

ConnectType

DataSetCount

DataSets

DesignInfo

LoginPrompt

Name

ObjectBroker

Owner

ServerGUID

ServerName

ServerPort

Tag

UseBroker

VCLComObject


TMidasConnection.ConnectType

TMidasConnection	See also

Specifies the protocol to use to establish the connection to the application server.

type TConnectType = (ctDCOM, ctSockets, ctOLEnterprise);

property ConnectType: TConnectType;

Description

Use ConnectType to specify the desired protocol for connecting with the application server. ConnectType can be one of the following values:

Value	Meaning

ctDCOM	TMidasConnection uses DCOM to connect server. The ServerName property specifies the GUID of the application server and the ComputerName property specifies the name of the server machine. Note that DCOM can result in a lot of extra network traffic and that not all Windows95 machines support DCOM.

ctSockets	TMidasConnection uses windows sockets to connect to the application server. The ServerName property specifies the GUID of the remote data module on the application server, the ComputerName property specifies the host name or IP address of the server application, and the ServerPort property specifies the port used by Scktsrvr.exe or ScktSrvc.exe on the server. Note that applications using sockets must run Scktsrver.exe or ScktSrvc.exe on the server machine to provide a listening socket.

ctOLEnterprise	TMidasConnection uses OLEnterprise to connect to the application server. The ServerName property specifies the GUID of the remote data module on the application server, and the ComputerName property specifies either the name of the server machine or the name of the OLEnterprise Business Object Broker (depending on the value of the UseBroker property). Note that OLEnterprise runtime must be installed on the client machine when using ctOLEnterprise.


TMidasConnection.ServerPort

TMidasConnection	See also

Specifies the port used by the listening socket on the server machine.

property ServerPort: Integer;

Description

When establishing connections to the application server using TCP/IP sockets, the application server must have a socket dispatcher listening on a predefined port for requests from client applications.  If the value of ConnectType is ctSockets, set ServerPort to the port number used by Scktsrvr.exe or ScktSrvc.exe on the server system. TMidasConnection attempts to connect to the application server by sending a message to the system specified by the ComputerName property at the port specified by ServerPort.

Note:	ServerPort has no effect if ConnectType is not ctSockets.


TMidasConnection.UseBroker

TMidasConnection	See also

Indicates whether an OLEnterprise connection should use the OLEnterprise Business Object Broker.

property UseBroker: Boolean;

Description

When establishing connections to the application server using OLEnterprise, UseBroker specifies whether the connection should use the Business Object Broker.  If UseBroker is True, TMidasConnection uses the Business Object Broker, and the ComputerName property specifies the name of the Business Object Broker.  If UseBroker is False, TMidasConnection uses OLEnterprise, but does not go through the Business Object Broker.  When UseBroker is False, ComputerName specifies the name of the OLEnterprise server.

For more information about using OLEnterprise, see the OLEnterprise documentation.

Note:	The value of UseBroker has no effect unless ConnectType is ctOLEnterprise.


TMidasConnection events

TMidasConnection	Alphabetically	Legend

Derived from TDispatchConnection

OnGetUserName

Derived from TCustomConnection

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnLogin


TMidasConnection events

TMidasConnection	By object	Legend

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnGetUserName

OnLogin


TMidasConnection methods

TMidasConnection	Alphabetically

In TMidasConnection

Create

Derived from TDispatchConnection

GetServer

Derived from TCustomConnection

Close

Destroy

Open

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMidasConnection methods

TMidasConnection	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetServer

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Open

RemoveComponent

SafeCallException

UpdateAction


TMidasConnection.Create

TMidasConnection	See also

Creates and initializes an instance of TMidasConnection.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TMidasConnection component at runtime.  TMidasConnection components placed in forms or data modules at design time are created automatically.

Create initializes the value of the ServerPort property to 211.  This is also the default port number for ScktSrvr.exe and ScktSrvc.exe.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomConnection

TCustomRemoteServer

TDispatchConnection

TCOMConnection

TDCOMConnection


TNextButton

Hierarchy	Properties	Methods	See also

TNextButton generates an HTML control that moves to the next record in an XML data packet.

Unit

MidItems

Description

Add TNextButton as the child of a TDataNavigator component (or a layout group that is a child of a TDataNavigator component) to enable an associated control to move to the next record in a dataset. The resulting HTML button’s action changes the current record displayed by the associated control.

Use the properties of TNextButton to customize the appearance of the button and associate it with a Web item. The associated Web item displays the records that the next button navigates.


TNextButton properties

TNextButton	Alphabetically	Legend

Derived from TDataSetButton

Caption

Derived from TXMLDisplayReferenceButton

XMLComponent

XMLUseParent

Derived from TWebButton

Custom

Style

StyleRule

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TNextButton properties

TNextButton	By object	Legend

Caption

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

XMLComponent

XMLUseParent


TNextButton methods

TNextButton	Alphabetically

In TNextButton

Create

Derived from TXMLDisplayReferenceButton

Destroy

Derived from TWebButton

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TNextButton methods

TNextButton	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TNextButton.Create

TNextButton	See also

Creates and initializes an instance of TNextButton.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TNextButton at runtime. Buttons added at design time using the Web Page editor are instantiated automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebButton

TXMLDisplayReferenceButton

TDataSetButton


TNextPageButton

Hierarchy	Properties	Methods	See also

TNextPageButton generates an HTML control that moves to the next set of records in an XML data packet.

Unit

MidItems

Description

Add TNextPageButton as the child of a TDataNavigator component (or a layout group that is a child of a TDataNavigator component) to enable the generated HTML form to display the next group of records in a dataset. If the button is associated with a grid (TDataGrid), the grid scrolls by the number of rows in the grid. If the button is associated with a collection of fields (TFieldGroup), the current record changes to the next record in the data packet.

Use the properties of TNextPageButton to customize the appearance of the button and associate it with a display component.


TNextPageButton properties

TNextPageButton	Alphabetically	Legend

Derived from TDataSetButton

Caption

Derived from TXMLDisplayReferenceButton

XMLComponent

XMLUseParent

Derived from TWebButton

Custom

Style

StyleRule

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TNextPageButton properties

TNextPageButton	By object	Legend

Caption

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

XMLComponent

XMLUseParent


TNextPageButton methods

TNextPageButton	Alphabetically

In TNextPageButton

Create

Derived from TXMLDisplayReferenceButton

Destroy

Derived from TWebButton

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TNextPageButton methods

TNextPageButton	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TNextPageButton.Create

TNextPageButton	See also

Creates and initializes an instance of TNextPageButton.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TNextPageButton at runtime. Buttons added at design time using the Web Page editor are instantiated automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebButton

TXMLDisplayReferenceButton

TDataSetButton


 TOLEnterpriseConnection

Hierarchy	Properties	Methods	Events	See also

TOLEnterpriseConnection is provided for backward compatibility with applications that connect to a MIDAS application server using OLEnterprise.

Unit

mconnect

Description

TOLEnterpriseConnection is used in the client portion of a multi-tiered database application to establish and maintain the connection between the client and a remote application server using OLEnterprise. This component is provided for backward compatibility.

TOLEnterpriseConnection establishes the initial connection between the client application and a remote application server using OLEnterprise. Once the connection is established, the client registers any or all of its client datasets with the remote server, and these client datasets use the IAppServer interface from the OLEnterprise connection component to communicate with providers on the application server, or to otherwise call the application server’s data module interface.

To connect to remote application servers using DCOM, use the TDCOMConnection component instead. To connect client applications to remote application servers using TCP/IP sockets, use TSocketConnection. To connect client applications to remote application servers using HTTP, use TWebConnection. To connect to remote application servers using CORBA, use the TCORBAConnection component.


TOLEnterpriseConnection properties

TOLEnterpriseConnection	Alphabetically	Legend

In TOLEnterpriseConnection

BrokerName

ComputerName

Derived from TCOMConnection

Connected

Derived from TDispatchConnection

AppServer

ServerGUID

ServerName

Derived from TCustomConnection

DataSetCount

DataSets

LoginPrompt

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TOLEnterpriseConnection properties

TOLEnterpriseConnection	By object	Legend

AppServer

BrokerName

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ComputerName

Connected

DataSetCount

DataSets

DesignInfo

LoginPrompt

Name

Owner

ServerGUID

ServerName

Tag

VCLComObject


TOLEnterpriseConnection.BrokerName

TOLEnterpriseConnection	See also

Specifies the name of the Business Object Broker that locates the application server.

property BrokerName: string;

Description

Use BrokerName to specify the OLEnterprise Business Object Broker with which the application server is registered. The Business Object Broker locates an available application server with the name specified by the ServerName property.

If you are not using the Business Object Broker, use the ComputerName property instead. You must specify a value for either BrokerName or ComputerName:

Note:	Setting the value of BrokerName changes the ComputerName property to blank, and vice versa.


TOLEnterpriseConnection.ComputerName

TOLEnterpriseConnection	See also

Specifies the name of the machine on which the application server is located.

property ComputerName: string;

Description

Use ComputerName to specify the machine where the application server resides if you are not using the Business Object Broker. If you are not using the Business Object Broker and ComputerName is blank (the default), TOLEnterpriseConnection assumes the application server can be found on the user’s machine or that the computer name can be derived from the system registry based on the DCOM configuration. If ComputerName is not blank, it overrides any system registry entries.

If you are using the Business Object Broker, use the BrokerName property instead. BrokerName and ComputerName are mutually exclusive: Setting the value of ComputerName changes the BrokerName property to blank, and vice versa.


TOLEnterpriseConnection events

TOLEnterpriseConnection	Alphabetically	Legend

Derived from TDispatchConnection

OnGetUserName

Derived from TCustomConnection

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnLogin


TOLEnterpriseConnection events

TOLEnterpriseConnection	By object	Legend

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnGetUserName

OnLogin


TOLEnterpriseConnection methods

TOLEnterpriseConnection	Alphabetically	Legend

In TOLEnterpriseConnection

DoConnect

Derived from TDispatchConnection

Create

GetServer

Derived from TCustomConnection

Close

Destroy

Open

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOLEnterpriseConnection methods

TOLEnterpriseConnection	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DoConnect

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetServer

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Open

RemoveComponent

SafeCallException

UpdateAction


TOLEnterpriseConnection.DoConnect

TOLEnterpriseConnection	See also

Establishes a connection to the application server.

procedure DoConnect; override;

Description

DoConnect is called when the Connected property is set to True. DoConnect obtains the interface of the remote data module on the application server using OLEnterprise runtime. This interface can then be used to obtain interfaces for the providers on the application server or to make interface calls to the remote data module.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomConnection

TCustomRemoteServer

TDispatchConnection

TCOMConnection


TPacketDataSet

Hierarchy	Properties	Methods	Events	See also

TPacketDataSet represents a data packet or delta packet in a multi-tiered application.

Unit

provider

Description

TPacketDataSet represents a data packet that a provider creates for a client dataset or a delta data packet that a client dataset sends to a provider. Provider components create instances of TPacketDataSet to represent data packets before they are sent to clients and to represent delta packets after they are received from clients.

TPacketDataSet provides a convenient way for providers and resolvers to work with data packets. As a descendant of TClientDataSet, TPacketDataSet allows providers and resolvers to use any of the standard dataset properties and methods to manipulate the data packet’s records. In addition, TPacketDataSet introduces new properties and methods that describe what information goes into the data packet or how updates should be applied.

Applications do not need to work directly with packet datasets. They are mainly of use to component writers who want to create custom provider components.


TPacketDataSet properties

TPacketDataSet	Alphabetically	Legend

In TPacketDataSet

NewValuesModified

StreamMetaData

UseCurValues

Derived from TClientDataSet

ActiveAggs

Aggregates

AggregatesActive

AppServer

CanModify

ChangeCount

CloneSource

CommandText

Data

DataSetField

DataSize

DataSource

Delta

FetchOnDemand

FileName

Filter

Filtered

FilterOptions

GroupingLevel

HasAppServer

IndexDefs

IndexFieldCount

IndexFieldNames

IndexFields

IndexName

KeyExclusive

KeyFieldCount

KeySize

LogChanges

MasterFields

MasterSource

PacketRecords

Params

ProviderName

ReadOnly

RecNo

RecordCount

RecordSize

RemoteServer

SavePoint

StatusFilter

StoreDefs

Derived from TDataSet

Active

AggFields

AutoCalcFields

BlockReadSize

Bof

Bookmark

Constraints

DefaultFields

Designer

Eof

FieldCount

FieldDefList

FieldDefs

FieldList

Fields

FieldValues

Found

Modified

Name

ObjectView

SparseArrays

State

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TPacketDataSet properties

TPacketDataSet	By object	Legend

Active

ActiveAggs

AggFields

Aggregates

AggregatesActive

AppServer

AutoCalcFields

BlockReadSize

Bof

Bookmark

CanModify

ChangeCount

CloneSource

CommandText

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

Data

DataSetField

DataSize

DataSource

DefaultFields

Delta

Designer

DesignInfo

Eof

FetchOnDemand

FieldCount

FieldDefList

FieldDefs

FieldList

Fields

FieldValues

FileName

Filter

Filtered

FilterOptions

Found

GroupingLevel

HasAppServer

IndexDefs

IndexFieldCount

IndexFieldNames

IndexFields

IndexName

KeyExclusive

KeyFieldCount

KeySize

LogChanges

MasterFields

MasterSource

Modified

Name

NewValuesModified

ObjectView

Owner

PacketRecords

Params

ProviderName

ReadOnly

RecNo

RecordCount

RecordSize

RemoteServer

SavePoint

SparseArrays

State

StatusFilter

StoreDefs

StreamMetaData

Tag

UseCurValues

VCLComObject


TPacketDataSet.NewValuesModified

TPacketDataSet 	See also

Indicates whether the NewValue property of any field in the current record has changed.

property NewValuesModified: Boolean;

Description

Read NewValuesModified to determine whether any fields in the current record were edited during the resolving process.


TPacketDataSet.StreamMetaData

TPacketDataSet	See also

Indicates whether metadata should be included in the data packet.

property StreamMetaData: Boolean;

Description

StreamMetaData reflects the MetaData parameter of the provider’s CreateDataPacket method. When StreamMetaData is True, metadata is included in the data packet. When StreamMetaData is False, the data packet contains records but no metadata.


TPacketDataSet.UseCurValues

TPacketDataSet	See also

Indicates that the CurValue property of fields in the dataset should be used instead of the OldValue property.

property UseCurValues: Boolean;

Description

UseCurValues is set during the resolving process when a record is corrected in an OnUpdateError event handler. This allows the resolver to re-apply a corrected record rather than using the originally provided values as the basis of an update.


TPacketDataSet events

TPacketDataSet	Alphabetically	Legend

Derived from TClientDataSet

AfterApplyUpdates

AfterExecute

AfterGetParams

AfterGetRecords

AfterRowRequest

BeforeApplyUpdates

BeforeExecute

BeforeGetParams

BeforeGetRecords

BeforeRowRequest

OnReconcileError

Derived from TDataSet

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TPacketDataSet events

TPacketDataSet	By object	Legend

AfterApplyUpdates

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterExecute

AfterGetParams

AfterGetRecords

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterRowRequest

AfterScroll

BeforeApplyUpdates

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeExecute

BeforeGetParams

BeforeGetRecords

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeRowRequest

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnReconcileError


TPacketDataSet methods

TPacketDataSet	Alphabetically

In TPacketDataSet

AssignCurValues

Create

CreateFromDelta

HasCurValues

HasMergeConflicts

InitAltRecBuffers

UpdateKind

Derived from TClientDataSet

AddIndex

AppendData

ApplyRange

ApplyUpdates

BookmarkValid

Cancel

CancelRange

CancelUpdates

CloneCursor

CompareBookmarks

ConstraintsDisabled

CreateBlobStream

CreateDataSet

DataRequest

DeleteIndex

Destroy

DisableConstraints

EditKey

EditRangeEnd

EditRangeStart

EmptyDataSet

EnableConstraints

Execute

FetchBlobs

FetchDetails

FetchParams

FindKey

FindNearest

GetCurrentRecord

GetGroupState

GetIndexInfo

GetIndexNames

GetNextPacket

GetOptionalParam

GotoCurrent

GotoKey

GotoNearest

LoadFromFile

LoadFromStream

Locate

Lookup

MergeChangeLog

Reconcile

RefreshRecord

RevertRecord

SaveToFile

SaveToStream

SetAltRecBuffers

SetKey

SetOptionalParam

SetProvider

SetRange

SetRangeEnd

SetRangeStart

UndoLastChange

UpdateStatus

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

CheckBrowseMode

ClearFields

Close

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBlobFieldData

GetBookmark

GetDetailDataSets

GetDetailLinkFields

GetFieldData

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsEmpty

IsLinkedTo

IsSequenced

Last

MoveBy

Next

Open

Post

Prior

Refresh

Resync

SetFields

Translate

UpdateCursorPos

UpdateRecord

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPacketDataSet methods

TPacketDataSet	By object

ActiveBuffer

AddIndex

AfterConstruction

Append

AppendData

AppendRecord

ApplyRange

ApplyUpdates

Assign

AssignCurValues

BeforeDestruction

BookmarkValid

Cancel

CancelRange

CancelUpdates

CheckBrowseMode

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClearFields

CloneCursor

Close

CompareBookmarks

ConstraintsDisabled

ControlsDisabled

Create

CreateBlobStream

CreateDataSet

CreateFromDelta

CursorPosChanged

DataRequest

DefaultHandler

Delete

DeleteIndex

Destroy

DestroyComponents

Destroying

DisableConstraints

DisableControls

Dispatch

Edit

EditKey

EditRangeEnd

EditRangeStart

EmptyDataSet

EnableConstraints

EnableControls

Execute

ExecuteAction

FetchBlobs

FetchDetails

FetchParams

FieldAddress

FieldByName

FindComponent

FindField

FindFirst

FindKey

FindLast

FindNearest

FindNext

FindPrior

First

Free

FreeBookmark

FreeInstance

FreeNotification

FreeOnRelease

GetBlobFieldData

GetBookmark

GetCurrentRecord

GetDetailDataSets

GetDetailLinkFields

GetFieldData

GetFieldList

GetFieldNames

GetGroupState

GetIndexInfo

GetIndexNames

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetNextPacket

GetOptionalParam

GetParentComponent

GotoBookmark

GotoCurrent

GotoKey

GotoNearest

HasCurValues

HasMergeConflicts

HasParent

InheritsFrom

InitAltRecBuffers

InitInstance

Insert

InsertComponent

InsertRecord

InstanceSize

IsEmpty

IsLinkedTo

IsSequenced

Last

LoadFromFile

LoadFromStream

Locate

Lookup

MergeChangeLog

MethodAddress

MethodName

MoveBy

NewInstance

Next

Open

Post

Prior

Reconcile

Refresh

RefreshRecord

RemoveComponent

Resync

RevertRecord

SafeCallException

SaveToFile

SaveToStream

SetAltRecBuffers

SetFields

SetKey

SetOptionalParam

SetProvider

SetRange

SetRangeEnd

SetRangeStart

Translate

UndoLastChange

UpdateAction

UpdateCursorPos

UpdateKind

UpdateRecord

UpdateStatus


TPacketDataSet.AssignCurValues

TPacketDataSet 	See also

Updates the current field value for each field in the packet dataset.

procedure AssignCurValues(Source: TDataSet); overload;

procedure AssignCurValues(const CurValues: Variant); overload;

Description

When a resolver component encounters an update error, it calls AssignCurValues to set the CurValue property of fields before triggering the OnUpdateError event handler.

If AssignCurValues is passed a dataset as the Source parameter, then for each field in the packet dataset, the CurValue property is set to the value of the field with the same name in the source dataset.

If AssignCurValues is passed a Variant array as the CurValues parameter, then each entry in the array is used to assign the CurValue property of a field in the packet dataset. CurValues can have one of two forms: an array of field values, or an array of Variant arrays, where each of those arrays has two elements: a field name and a value. In the first form, field values are assigned by position. In the second form, fields are located based on name and the CurValue property assigned accordingly.


TPacketDataSet.Create

TPacketDataSet	See also

Creates and initializes instance of TPacketDataSet.

constructor Create(AOwner: TComponent); override;

Description

Most applications do not need to create packet datasets because they are created by the provider components that use them.Create initializes the properties of the packet dataset.

AOwner is the component that is responsible for freeing the TPacketDataSet instance. If AOwner is nil, the application must explicitly free the packet data set object.


TPacketDataSet.CreateFromDelta

TPacketDataSet 	See also

Copies the data from another packet data set.

procedure CreateFromDelta(Source: TPacketDataSet);

Description

Applications should not need to call CreateFromDelta. This method is used internally when applying updates to create the error log of updates that could not be resolved on the server. This log of update errors is eventually returned to clients as the return value of the provider’s ApplyUpdates method.


TPacketDataSet.HasCurValues

TPacketDataSet	See also

Indicates whether the CurValue property is available for fields in the packet dataset.

function HasCurValues: Boolean);

Description

When an error occurs while applying an update record, resolver components attempt to locate the current record in the underlying database (or the dataset to which updates are applied.) This current record can then be used when trying to determine the cause of the update error. If the current record can be located, HasCurValues returns True and the fields in the packet dataset have their CurValue properties set from this record. If the record can’t be located (for example, if another user changed a key field value or deleted the record), then HasCurValues returns False and the CurValue property of packet dataset fields can’t be used.


TPacketDataSet.HasMergeConflicts

TPacketDataSet 	See also

Indicates whether a current record can be merged with client updates in a delta packet.

function HasMergeConflicts: Boolean);

Description

When resolving update errors in an OnUpdateError event handler, applications can specify that the updated record should be merged automatically with the current field values of the record. (To do this, set the Response parameter to rrMerge.) However, it is not always possible to merge client edits with the current record. If the client has changed field values that were also changed by other users, the merge will fail and HasMergeConflicts returns True.


TPacketDataSet.InitAltRecBuffers

TPacketDataSet 	See also

Fetches values for the CurValue, OldValue, and NewValue properties of fields.

procedure InitAltRecBuffers(CheckModified: Boolean = True);

Description

While applying updates, InitAltRecBuffers is called automatically to ensure that fields in the packet dataset have values for the CurValue, OldValue, and NewValue properties. The CheckModified parameter specifies whether the InitAltRecBuffers should check whether the current record has been modified when setting values. This check allows the packet dataset to reflect appropriate values when applying updates that are changed by an OnUpdateError event handler.


TPacketDataSet.UpdateKind

TPacketDataSet

Indicates the type of update the current record represents.

function UpdateKind: TUpdateKind;

Description

Call UpdateKind while applying updates to determine the type of update the current record represents. UpdateKind returns

ukInsert if the current record is a newly inserted record.

ukDelete if the current record represents a record that should be deleted.

ukModify if the current record represents updates to an existing record.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataSet

TPacketDataSet


TPageItemsProducer

Hierarchy	Properties	Methods	Events	See also

TPageItemsProducer maintains a list of Web item components for producing a string of HTML commands based on an input template.

Unit

PagItems

Description

Use TPageItemsProducer as the base class for components that convert an HTML template that includes content generated by other components into a string of HTML commands that can be interpreted by a client application such as a Web browser. HTML templates include HTML commands and HTML-transparent tags that are replaced with customized content by the page items producer in an OnHTMLTag event handler.

Page item producers differ from other page producer components in that they replace special HTML-transparent tags of the format

<#COMPONENT Name=WebContentComponent>

with the HTML produced by the component named WebContentComponent. WebContentComponent must have the same Owner as the page item producer and support the IWebContent interface, which the page item producer uses to obtain the replacement HTML for the COMPONENT tag.

TPageItemsProducer introduces the WebPageItems property to maintain a hierarchical list of these Web content components, where each component produces content for its parent component.


TPageItemsProducer properties

TPageItemsProducer	Alphabetically	Legend

In TPageItemsProducer

WebPageItems

Derived from TCustomPageProducer

HTMLDoc

HTMLFile

StripParamQuotes

Derived from TCustomContentProducer

Dispatcher

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TPageItemsProducer properties

TPageItemsProducer	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Dispatcher

HTMLDoc

HTMLFile

Name

Owner

StripParamQuotes

Tag

VCLComObject

WebPageItems


TPageItemsProducer.WebPageItems

TPageItemsProducer	See also

Maintains a list of components that generate HTML content for the producer.

property WebPageItems: TWebComponentList;

Description

WebPageItems lists the components that generate content for the page items producer. Each of these components supports the IWebContent interface, and can contain its own list of Web items that help it generate its content.

The type of items that can be added to the WebPageItems list are restricted by a protected method that is abstract in TPageItemsProducer. Descendant classes implement this protected method to indicate what types of items can be added to the list. For example, TMidasPageProducer limits the list to components that generate HTML forms (TWebForm descendants such as TQueryForm and TDataForm).

At design time, use the Web page editor to add components to the WebPageItems property.

Note:	Typically, WebPageItems lists all the components that generate content for the page items producer, in the order that the generated content appears in the final HTML document. However, the page items producer can transform COMPONENT tags in its template using components that are not in this list, as long as they have the same owner as the page items producer.


TPageItemsProducer events

TPageItemsProducer	Alphabetically	Legend

Derived from TPageProducer

OnHTMLTag


TPageItemsProducer events

TPageItemsProducer	By object	Legend

OnHTMLTag


TPageItemsProducer methods

TPageItemsProducer	Alphabetically

In TPageItemsProducer

Create

Destroy

Derived from TCustomPageProducer

Content

ContentFromStream

ContentFromString

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPageItemsProducer methods

TPageItemsProducer	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Content

ContentFromStream

ContentFromString

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TPageItemsProducer.Create

TPageItemsProducer

Creates and initializes an instance of TPageItemsProducer.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a page items producer at runtime.


TPageItemsProducer.Destroy

TPageItemsProducer	See also

Frees an instance of TPageItemsProducer.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead, call the Free method, which checks whether the TPageitemsProducer reference is not nil before calling Destroy.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomContentProducer

TCustomPageProducer

TPageProducer

TComponentsPageProducer


TPostButton

Hierarchy	Properties	Methods	See also

TPostButton generates an HTML control that posts changes to an XML delta packet.

Unit

MidItems

Description

Add TPostButton as the child of a TDataNavigator component (or a layout group that is a child of a TDataNavigator component) to enable the generated HTML form to commit the edits on the current record of an associated display control. The resulting HTML button’s action posts all edits to the current record to the emerging delta packet, which can then be submitted using an apply updates button.

Use the properties of TPostButton to customize the appearance of the button and associate it with a Web item that generates the display control.


TPostButton properties

TPostButton	Alphabetically	Legend

Derived from TDataSetButton

Caption

Derived from TXMLDisplayReferenceButton

XMLComponent

XMLUseParent

Derived from TWebButton

Custom

Style

StyleRule

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TPostButton properties

TPostButton	By object	Legend

Caption

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

XMLComponent

XMLUseParent


TPostButton methods

TPostButton	Alphabetically

In TPostButton

Create

Derived from TXMLDisplayReferenceButton

Destroy

Derived from TWebButton

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPostButton methods

TPostButton	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TPostButton.Create

TPostButton	See also

Creates and initializes an instance of TPostButton.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TPostButton at runtime. Buttons added at design time using the Web Page editor are instantiated automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebButton

TXMLDisplayReferenceButton

TDataSetButton


TPriorButton

Hierarchy	Properties	Methods	See also

TPriorButton generates an HTML control that moves to the previous record in an XML data packet.

Unit

MidItems

Description

Add TPriorButton as the child of a TDataNavigator component (or a layout group that is a child of a TDataNavigator component) to enable an associated control to move to the previous record in a dataset. The resulting HTML button’s action changes the current record displayed by the associated control.

Use the properties of TPriorButton to customize the appearance of the button and associate it with a Web item. The associated Web item displays the records that the prior button navigates.


TPriorButton properties

TPriorButton	Alphabetically	Legend

Derived from TDataSetButton

Caption

Derived from TXMLDisplayReferenceButton

XMLComponent

XMLUseParent

Derived from TWebButton

Custom

Style

StyleRule

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TPriorButton properties

TPriorButton	By object	Legend

Caption

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

XMLComponent

XMLUseParent


TPriorButton methods

TPriorButton	Alphabetically

In TPriorButton

Create

Derived from TXMLDisplayReferenceButton

Destroy

Derived from TWebButton

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPriorButton methods

TPriorButton	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TPriorButton.Create

TPriorButton	See also

Creates and initializes an instance of TPriorButton.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TPriorButton at runtime. Buttons added at design time using the Web Page editor are instantiated automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebButton

TXMLDisplayReferenceButton

TDataSetButton


TPriorPageButton

Hierarchy	Properties	Methods	See also

TPriorPageButton generates an HTML control that moves to the previous set of records in an XML data packet.

Unit

MidItems

Description

Add TPriorPageButton as the child of a TDataNavigator component (or a layout group that is a child of a TDataNavigator component) to enable the generated HTML form to display the previous group of records in a dataset. If the button is associated with a grid (TDataGrid), the grid scrolls by the number of rows in the grid. If the button is associated with a collection of fields (TFieldGroup), the current record changes to the previous record in the data packet.

Use the properties of TNextPageButton to customize the appearance of the button and associate it with a display component.


TPriorPageButton properties

TPriorPageButton	Alphabetically	Legend

Derived from TDataSetButton

Caption

Derived from TXMLDisplayReferenceButton

XMLComponent

XMLUseParent

Derived from TWebButton

Custom

Style

StyleRule

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TPriorPageButton properties

TPriorPageButton	By object	Legend

Caption

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

XMLComponent

XMLUseParent


TPriorPageButton methods

TPriorPageButton	Alphabetically

In TPriorPageButton

Create

Derived from TXMLDisplayReferenceButton

Destroy

Derived from TWebButton

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPriorPageButton methods

TPriorPageButton	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TPriorPageButton.Create

TPriorPageButton	See also

Creates and initializes an instance of TPriorPageButton.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TPriorPageButton at runtime. Buttons added at design time using the Web Page editor are instantiated automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebButton

TXMLDisplayReferenceButton

TDataSetButton


 TProvider

Hierarchy	Properties	Methods	Events	See also

TProvider provides data to and applies updates from a client dataset.

Unit

provider

Description

TProvider is provided for backward compatibility. It is identical to TDataSetProvider. New applications should use TDataSetProvider instead.


TProvider properties

TProvider	Alphabetically	Legend

Derived from TDataSetProvider

Constraints

DataSet

ResolveToDataSet

Derived from TBaseProvider

Options

Resolver

UpdateMode

Derived from TCustomProvider

Data

Exported

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TProvider properties

TProvider	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

Data

DataSet

DesignInfo

Exported

Name

Options

Owner

Resolver

ResolveToDataSet

Tag

UpdateMode

VCLComObject


TProvider events

TProvider	Alphabetically	Legend

Derived from TDataSetProvider

OnGetDataSetProperties

OnGetTableName

Derived from TBaseProvider

AfterUpdateRecord

BeforeUpdateRecord

OnGetData

OnUpdateData

OnUpdateError

Derived from TCustomProvider

AfterApplyUpdates

AfterExecute

AfterGetParams

AfterGetRecords

AfterRowRequest

BeforeApplyUpdates

BeforeExecute

BeforeGetParams

BeforeGetRecords

BeforeRowRequest

OnDataRequest


TProvider events

TProvider	By object	Legend

AfterApplyUpdates

AfterExecute

AfterGetParams

AfterGetRecords

AfterRowRequest

AfterUpdateRecord

BeforeApplyUpdates

BeforeExecute

BeforeGetParams

BeforeGetRecords

BeforeRowRequest

BeforeUpdateRecord

OnDataRequest

OnGetData

OnGetDataSetProperties

OnGetTableName

OnUpdateData

OnUpdateError


TProvider methods

TProvider	Alphabetically

Derived from TDataSetProvider

Create

Destroy

Derived from TCustomProvider

ApplyUpdates

DataRequest

Execute

GetParams

GetRecords

RowRequest

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TProvider methods

TProvider	By object

AfterConstruction

ApplyUpdates

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DataRequest

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Execute

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParams

GetParentComponent

GetRecords

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

RowRequest

SafeCallException

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomProvider

TBaseProvider

TDataSetProvider


TQueryButtons

Hierarchy	Properties	Methods	See also

TQueryButtons assembles the HTML generated by a set of TQueryButton descendants.

Unit

MidItems

Description

Add TQueryButtons as the child of a TQueryForm component (or a layout group that is a child of a TQueryForm component) to enable the generated HTML form to undo or submit changes made by end users. TQueryButtons generates HTML containing the controls generated by its children. These children must be descendants of TQueryButton, such as TSubmitQueryButton and TResetQueryButton.

In order to let other Web items to use the HTML that defines the organized collection of controls, TQueryButtons inherits the IWebContent interface from TWebControlGroup.

Use the properties of TQueryButtons to customize the appearance of the group of buttons.


TQueryButtons properties

TQueryButtons	Alphabetically	Legend

Derived from TCustomQueryButtons

Custom

Style

StyleRule

Derived from TWebControlGroup

WebFieldControls

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TQueryButtons properties

TQueryButtons	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

WebFieldControls


TQueryButtons methods

TQueryButtons	Alphabetically

Derived from TWebControlGroup

Create

Destroy

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TQueryButtons methods

TQueryButtons	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebControlGroup

TCustomQueryButtons


TQueryFieldGroup

Hierarchy	Properties	Methods	See also

TQueryFieldGroup arranges information on an HTML form as a set of labeled fields.

Unit

MidItems

Description

Add TQueryFieldGroup to a query form component (TQueryForm) or a layout group (TLayoutGroup) that is a child for a query form. TQueryFieldGroup generates the HTML to display information in labeled fields. By default, TQueryFieldGroup displays information about the parameters for an XML broker, but it can be used to display any application-defined named values.

TQueryFieldGroup maintains a list of Web items that generate the individual display fields. These Web items are restricted to the following classes: TQueryText, TQueryTextArea, TQuerySelectOptions, and TQueryRadioGroup. If the query field group displays parameter values, you can bind the query field group to an XML data packet or dataset field within an XML data packet. The Web items can then use that binding to determine the source of the parameters they display.

You can also use the properties of TQueryFieldGroup to affect the overall appearance of the set of fields.


TQueryFieldGroup properties

TQueryFieldGroup	Alphabetically	Legend

Derived from TCustomFieldGroup

Custom

Style

StyleRule

Derived from TXMLDisplayGroup

VisibleFields

XMLBroker

XMLDataSetField

Derived from TWebControlGroup

WebFieldControls

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TQueryFieldGroup properties

TQueryFieldGroup	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

VisibleFields

WebFieldControls

XMLBroker

XMLDataSetField


TQueryFieldGroup methods

TQueryFieldGroup	Alphabetically

Derived from TCustomFieldGroup

Create

Destroy

Derived from TWebControlGroup

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TQueryFieldGroup methods

TQueryFieldGroup	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebControlGroup

TXMLDisplayGroup


TQueryRadioGroup

Hierarchy	Properties	Methods	See also

TQueryRadioGroup creates an HTML radio group control to represent named parameter.

Unit

MidItems

Description

Add TQueryRadioGroup as the child of a TQueryFieldGroup component to add a radio group control that represents a parameter value. By default, the children of TQueryFieldGroup represent the parameters of an XML broker. However, TQueryRadioGroup can represent any named value that the MIDAS Web application uses.

Use the properties and methods of TQueryRadioGroup to

Specify the field or parameter whose value the radio group displays.

Specify the possible values from which the user can choose.

Initialize the value of the radio group.

Specify a caption that describes the value of the radio group.

Customize the appearance of the radio group.

Fit the radio group into the tab order of the generated HTML form.


TQueryRadioGroup properties

TQueryRadioGroup	Alphabetically	Legend

In TQueryRadioGroup

Text

Derived from TWebRadioGroupInput

DisplayColumns

DisplayWidth

ReadOnly

Derived from TWebListInput

DataSet

Items

ItemsField

Values

ValuesField

Derived from TWebDataInput

FieldName

ParamName

Derived from TWebDataDisplay

Caption

CaptionAttributes

CaptionPosition

Custom

Style

StyleRule

TabIndex

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TQueryRadioGroup properties

TQueryRadioGroup	By object	Legend

Caption

CaptionAttributes

CaptionPosition

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DataSet

DesignInfo

DisplayColumns

DisplayWidth

FieldName

Items

ItemsField

Name

Owner

ParamName

ReadOnly

Style

StyleRule

TabIndex

Tag

Text

Values

ValuesField

VCLComObject


TQueryRadioGroup.Text

TQueryRadioGroup	See also

Specifies the initial value of the radio group.

property Text: string;

Description

Use Text to initialize the value that appears in the generated radio group. This should be one of the values listed in the Items property or in the field referenced by the ItemsField property.


TQueryRadioGroup methods

TQueryRadioGroup	Alphabetically

In TQueryRadioGroup

IsQueryField

Derived from TWebRadioGroupInput

Create

Derived from TWebListInput

Destroy

Derived from TWebDataDisplay

GetParentComponent

HasParent

IsColumn

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TQueryRadioGroup methods

TQueryRadioGroup	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsColumn

IsQueryField

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TQueryRadioGroup.IsQueryField

TQueryRadioGroup	See also

Indicates whether the component generates a control that can appear in a query form.

class function IsQueryField: Boolean; override;

Description

Call IsQueryField to detemine whether a Web display component generates a control that represents a named value in a query form (TQueryForm). IsQueryField returns True, because TQueryRadioGroup is designed specifically for use by TQueryFieldGroup.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebDataDisplay

TWebDataInput

TWebListInput

TWebRadioGroupInput


TQuerySelectOptions

Hierarchy	Properties	Methods	See also

TQuerySelectOptions creates an HTML list control to represent a named parameter.

Unit

MidItems

Description

Add TQuerySelectOptions as the child of a TQueryFieldGroup component to add a list control that represents a parameter value. By default, the children of TQueryFieldGroup represent the parameters of an XML broker. However, TQuerySelectOptions can represent any named value that the MIDAS Web application uses.

Use the properties and methods of TQuerySelectOptions to

Specify the field or parameter whose value the list box displays.

Specify the possible values from which the user can choose.

Assign an initial value to the list box.

Specify a caption that describes the value of the list box.

Customize the appearance of the list box.

Fit the list box into the tab order of the generated HTML form.


TQuerySelectOptions properties

TQuerySelectOptions	Alphabetically	Legend

In TQuerySelectOptions

Text

Derived from TWebSelectOptionsInput

DisplayRows

Derived from TWebListInput

DataSet

Items

ItemsField

Values

ValuesField

Derived from TWebDataInput

FieldName

ParamName

Derived from TWebDataDisplay

Caption

CaptionAttributes

CaptionPosition

Custom

Style

StyleRule

TabIndex

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TQuerySelectOptions properties

TQuerySelectOptions	By object	Legend

Caption

CaptionAttributes

CaptionPosition

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DataSet

DesignInfo

DisplayRows

FieldName

Items

ItemsField

Name

Owner

ParamName

Style

StyleRule

TabIndex

Tag

Text

Values

ValuesField

VCLComObject


TQuerySelectOptions.Text

TQuerySelectOptions	See also

Specifies the initial value selected in the list box.

property Text: string;

Description

Use Text to initialize the value of the generated list control. Text should specify one of the values listed in the Items property or referenced by the ItemsField property.


TQuerySelectOptions methods

TQuerySelectOptions	Alphabetically

In TQuerySelectOptions

IsQueryField

Derived from TWebSelectOptionsInput

Create

Derived from TWebListInput

Destroy

Derived from TWebDataDisplay

GetParentComponent

HasParent

IsColumn

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TQuerySelectOptions methods

TQuerySelectOptions	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsColumn

IsQueryField

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TQuerySelectOptions.IsQueryField

TQuerySelectOptions	See also

Indicates whether the component generates a control that can appear in a query form.

class function IsQueryField: Boolean; override;

Description

Call IsQueryField to detemine whether a Web display component generates a control that represents a named value in a query form (TQueryForm). IsQueryField returns True, because TQuerySelectOptions is designed specifically for use by TQueryFieldGroup.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebDataDisplay

TWebDataInput

TWebListInput


TQueryText

Hierarchy	Properties	Methods	See also

TQueryText creates a single-line HTML input control to represent a named parameter.

Unit

MidItems

Description

Add TQueryText as the child of a TQueryFieldGroup component to add an edit control that represents a parameter value. By default, the children of TQueryFieldGroup represent the parameters of an XML broker. However, TQueryText can represent any named value that the MIDAS Web application uses.

Use the properties and methods of TQueryText to

Specify the field or parameter whose value the control displays.

Assign an initial value to the control.

Specify a caption that describes the value of the control.

Customize the appearance of the input control.

Fit the control into the tab order of the generated HTML form.


TQueryText properties

TQueryText	Alphabetically	Legend

In TQueryText

MaxWidth

Text

Derived from TWebTextInput

DisplayWidth

ReadOnly

Derived from TWebDataInput

FieldName

ParamName

Derived from TWebDataDisplay

Caption

CaptionAttributes

CaptionPosition

Custom

Style

StyleRule

TabIndex

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TQueryText properties

TQueryText	By object	Legend

Caption

CaptionAttributes

CaptionPosition

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

DisplayWidth

FieldName

MaxWidth

Name

Owner

ParamName

ReadOnly

Style

StyleRule

TabIndex

Tag

Text

VCLComObject


TQueryText.MaxWidth

TQueryText	See also

Limits the length of text users can type into the control.

property MaxWidth: Integer;

Description

Use MaxWidth to limit the length of strings (in characters) that users can type into the generated control.

Note:	MaxWidth has no effect on the size of the generated control. To limit the size of the control, use the DisplayWidth property.


TQueryText.Text

TQueryText	See also

Specifies the intial value of the generated control.

property Text: string;

Description

Use Text to initialize the value that appears in the generated display control.


TQueryText methods

TQueryText	Alphabetically

In TQueryText

IsQueryField

Derived from TWebTextInput

Create

Derived from TWebDataDisplay

Destroy

GetParentComponent

HasParent

IsColumn

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TQueryText methods

TQueryText	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsColumn

IsQueryField

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TQueryText.IsQueryField

TQueryText	See also

Indicates whether the component generates a control that can appear in a query form.

class function IsQueryField: Boolean; override;

Description

Call IsQueryField to detemine whether a Web display component generates a control that represents a named value in a query form (TQueryForm). IsQueryField returns True, because TQueryText is designed specifically for TQueryFieldGroup to use.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebDataDisplay

TWebDataInput

TWebTextInput


TQueryTextArea

Hierarchy	Properties	Methods	See also

TQueryTextArea creates a multi-line HTML input control to represent named parameter.

Unit

MidItems

Description

Add TQueryTextArea as the child of a TQueryFieldGroup component to add a multi-line edit control that represents a parameter value. By default, the children of TQueryFieldGroup represent the parameters of an XML broker. However, TQueryTextArea can represent any named value that the MIDAS Web client application uses.

Use the properties and methods of TQueryTextArea to

Specify the field or parameter whose value the control displays.

Assign an initial value to the control.

Specify a caption that describes the value of the control.

Customize the appearance of the control.

Fit the control into the tab order of the generated HTML form.


TQueryTextArea properties

TQueryTextArea	Alphabetically	Legend

In TQueryTextArea

Lines

Derived from TWebTextAreaInput

DisplayRows

DisplayWidth

ReadOnly

Wrap

Derived from TWebDataInput

FieldName

ParamName

Derived from TWebDataDisplay

Caption

CaptionAttributes

CaptionPosition

Custom

Style

StyleRule

TabIndex

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TQueryTextArea properties

TQueryTextArea	By object	Legend

Caption

CaptionAttributes

CaptionPosition

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

DisplayRows

DisplayWidth

FieldName

Lines

Name

Owner

ParamName

ReadOnly

Style

StyleRule

TabIndex

Tag

VCLComObject

Wrap


TQueryTextArea.Lines

TWebDataInput	See also

Specifies the initial value that appears in the multi-line edit control.

property Text: TStrings;

Description

Use Lines to initialize the value that appears in the generated display control.

Each string in the TStrings object designates a line in the text value. This may affect the formatting, depending on the value of Wrap.


TQueryTextArea methods

TQueryTextArea	Alphabetically

In TQueryTextArea

Create

Destroy

IsQueryField

Derived from TWebDataDisplay

GetParentComponent

HasParent

IsColumn

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TQueryTextArea methods

TQueryTextArea	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsColumn

IsQueryField

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TQueryTextArea.Create

TQueryTextArea	See also

Creates and initializes an instance of TQueryTextArea.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TQueryTextArea at runtime. TQueryTextArea components added at design time using the Web Page editor are instantiated automatically.


TQueryTextArea.Destroy

TQueryTextArea	See also

Frees an instance of TQueryTextArea.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, use the Free method, which checks that the component reference is not nil, and only then calls Destroy.


TQueryTextArea.IsQueryField

TQueryTextArea	See also

Indicates whether the component generates a control that can appear in a query form.

class function IsQueryField: Boolean; override;

Description

Call IsQueryField to detemine whether a Web display component generates a control that represents a named value in a query form (TQueryForm). IsQueryField returns True, because TQueryTextArea is designed specifically for TQueryFieldGroup to use.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebDataDisplay

TWebDataInput

TWebTextAreaInput


TQueryButton

Hierarchy	Properties	Methods	See also

TQueryButton is the base class for Web items that create HTML buttons that manage application-defined values.

Unit

MidItems

Description

Use TQueryButton as a base class for components that generate the HTML statements defining a specialized button control for managing the application-defined input controls. TQueryButton objects are used by TQueryForm, which organizes the generated buttons and the input controls they manipulate.

TQueryButton defines properties and methods for

Generating the HTML code to define the button control.

Specifying tag attributes of the HTML button control, including those defined by a style sheet.

Associating the button with a Query form whose controls it influences.

Fitting the component into a hierarchy of Web items, each of which generates part of a larger HTML document.

In order to allow other Web items to use the HTML generated by the button control, TQueryButton inherits support for the IWebContent interface from TWebButton.

Do not create instances of TQueryButton. TQueryButton relies on an abstract method to generate the HTML statements defining a button control. Trying to use an instance of TQueryButton will lead to an EAbstractError exception. Instead, create descendants of TQueryButton, such as TResetQueryButton or TSubmitQueryButton.


TQueryButton properties

TQueryButton	Alphabetically	Legend

In TQueryButton

Caption

XMLComponent

XMLUseParent

Derived from TWebButton

Custom

Style

StyleRule

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TQueryButton properties

TQueryButton	By object	Legend

Caption

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

XMLComponent

XMLUseParent


TQueryButton.Caption

TQueryButton	See also

Specifies the caption that appears on the button.

property Caption: string;

Description

Use Caption to specify the caption that appears on the generated HTML button. The value of Caption is used as the value of a VALUE parameter on the HTML INPUT tag generated to implement the button.


TQueryButton.XMLComponent

TQueryButton	See also

Associates the button with the query form whose display controls it influences.

property XMLComponent: TComponent;

Description

Set XMLComponent to specify the Web item that generates the form whose controls the query button influences. If this query form contains the TQueryButtons object that formats the query button with its siblings, you need not set the XMLComponent property. Instead, setting the XMLUseParent property to True (the default) sets XMLComponent to the Query form that contains the parent TQueryButtons object.


TQueryButton.XMLUseParent

TQueryButton	See also

Specifies whether the button is associated with its parent’s query form.

property XMLUseParent: Boolean;

Description

Use XMLUseParent to indicate how the query button determines the form whose controls it influences. When XMLUseParent is False, the XMLComponent property must be set to indicate the query form. When XMLUseParent is True, the button influences controls on the query form that contains its parent TQueryButtons component.


TQueryButton methods

TQueryButton	Alphabetically

In TQueryButton

Create

Derived from TWebButton

Destroy

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TQueryButton methods

TQueryButton	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TQueryButton.Create

TQueryButton	See also

Creates and initializes an instance of TQueryButton.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a dataset button at runtime. Buttons added at design time using the Web Page editor are instantiated automatically.

AOwner is the component that is responsible for freeing the query button. Typically, this is the Web module that contains the MIDAS page producer that uses the query button’s generated HTML.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebButton


TQueryForm

Hierarchy	Properties	Methods	See also

TQueryForm generates HTML forms for letting users enter application-defined values.

Unit

MidItems

Description

Add TQueryForm to the Web items of a MIDAS page producer to add an HTML form that displays application-defined values that users can view and edit. Query forms submit these values to the MIDAS Web application using a specified URL and method type.

TQueryForm generates the HTML FORM tag and assembles the HTML generated by its Web items. It restricts the Web items that generate the contents of the form to components that display application-defined values (TQueryFieldGroup), components that contain buttons to operate on those displays (TQueryButtons), and components that manage the layout of HTML controls (TLayoutGroup). At design time, you can add these Web items to the form using the Web page editor.


TQueryForm properties

TQueryForm	Alphabetically	Legend

Derived from TCustomQueryForm

Action

Method

Derived from TWebForm

Custom

Style

StyleRule

WebComponents

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TQueryForm properties

TQueryForm	By object	Legend

Action

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Method

Name

Owner

Style

StyleRule

Tag

VCLComObject

WebComponents


TCustomQueryForm methods

TCustomQueryForm	Alphabetically

Derived from TCustomQueryForm

AssignStrings

Create

Derived from TWebForm

Destroy

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomQueryForm methods

TCustomQueryForm	By object

AfterConstruction

Assign

AssignStrings

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


Description

Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebForm


 TRemoteServer

Hierarchy	Properties	Methods	Events	See also

TRemoteServer handles a remote server connection in a client application that is part of a multi-tiered application.

Unit

MIDASCon

Description

TRemoteServer is provided for backward compatibility. When writing client applications that connect to application servers using DCOM, use TDCOMConnection instead.


TRemoteServer properties

TRemoteServer	Alphabetically	Legend

Derived from TDCOMConnection

ComputerName

Derived from TCOMConnection

Connected

Derived from TDispatchConnection

AppServer

ObjectBroker

ServerGUID

ServerName

Derived from TCustomConnection

DataSetCount

DataSets

LoginPrompt

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TRemoteServer properties

TRemoteServer	By object	Legend

AppServer

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ComputerName

Connected

DataSetCount

DataSets

DesignInfo

LoginPrompt

Name

ObjectBroker

Owner

ServerGUID

ServerName

Tag

VCLComObject


TRemoteServer events

TRemoteServer	Alphabetically	Legend

Derived from TDispatchConnection

OnGetUserName

Derived from TCustomConnection

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnLogin


TRemoteServer events

TRemoteServer	By object	Legend

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnGetUserName

OnLogin


TRemoteServer methods

TRemoteServer	Alphabetically

Derived from TDCOMConnection

Create

Derived from TDispatchConnection

GetServer

Derived from TCustomConnection

Close

Destroy

Open

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TRemoteServer methods

TRemoteServer	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetServer

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Open

RemoveComponent

SafeCallException

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomConnection

TCustomRemoteServer

TDispatchConnection

TCOMConnection

TDCOMConnection


TRemoteDataModule

Hierarchy	Properties	Methods	Events	See also

TRemoteDataModule encapsulates the objects and interfaces of a MIDAS application server.

Unit

databkr

Description

Use a TRemoteDataModule object as the central repository for all objects in an application server. Remote data modules can contain any nonvisual components. Typically these are data access components, such as datasets and the provider components that handle communication between these datasets and client applications. Remote data modules can also contain other nonvisual components, such as TTimer, or TImageList.

Remote data modules are dual-interface Automation servers that implement the IAppServer interface. Connection components on client applications are designed to look for this interface.

At design time a TRemoteDataModule object provides a visual container into which a developer can place nonvisual components, set their properties, and write event handlers for them. In the unit file for the remote data module a developer can also code any business rules that are to be centralized in the middle tier of a multi-tiered application.

To create a remote data module at design time, choose File|New, and select Remote Data Module from the multi-tiered page of the new items dialog. The Remote Data Module Wizard then creates a new descendant of TRemoteDataModule that supports an interface that descends from IAppServer.


TRemoteDataModule properties

TRemoteDataModule	Alphabetically	Legend

In TRemoteDataModule

Providers

Derived from TDataModule

DesignOffset

DesignSize

OldCreateOrder

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TRemoteDataModule properties

TRemoteDataModule	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

DesignOffset

DesignSize

Name

OldCreateOrder

Owner

Providers

Tag

VCLComObject


TRemoteDataModule.Providers

TRemoteDataModule	See also

Lists the provider components that contained in the remote data module.

property Providers[const ProviderName: string]: TCustomProvider;

Description

Use Providers to access a provider component from the remote data module given its name. The remote data module uses Providers to locate the target of method calls made using the IAppServer interface.

If the value passed as is not one of the names returned by AS_GetProviderNames, or if the provider’s Exported property is False, reading Providers raises an exception.


TRemoteDataModule events

TRemoteDataModule	Alphabetically	Legend

Derived from TDataModule

OnCreate

OnDestroy


TRemoteDataModule events

TRemoteDataModule	By object	Legend

OnCreate

OnDestroy


TRemoteDataModule methods

TRemoteDataModule	Alphabetically	Legend

In TRemoteDataModule

AS_ApplyUpdates

AS_DataRequest

AS_Execute

AS_GetParams

AS_GetProviderNames

AS_GetRecords

AS_RowRequest

Create

Destroy

GetProvider

Lock

RegisterProvider

Unlock

UnRegisterProvider

UpdateRegistry

Derived from TDataModule

AfterConstruction

BeforeDestruction

CreateNew

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TRemoteDataModule methods

TRemoteDataModule	By object	Legend

AfterConstruction

AS_ApplyUpdates

AS_DataRequest

AS_Execute

AS_GetParams

AS_GetProviderNames

AS_GetRecords

AS_RowRequest

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateNew

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetProvider

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Lock

MethodAddress

MethodName

NewInstance

RegisterProvider

RemoveComponent

SafeCallException

Unlock

UnRegisterProvider

UpdateAction

UpdateRegistry


TRemoteDataModule.AS_ApplyUpdates

TRemoteDataModule	See also

Applies updates received from a client dataset using a specified provider.

function AS_ApplyUpdates(const ProviderName: WideString; Delta: OleVariant; MaxErrors: Integer; out ErrorCount: Integer; var OwnerData: OleVariant): OleVariant; safecall;

Description

AS_ApplyUpdates writes client updates to a dataset or database server. ProviderName specifies the name of the provider component that manages the update operation. Delta is a Variant containing the updated, inserted, and deleted records to write to the database. MaxErrors indicates the maximum number of errors to permit before stopping the update operation; ErrorCount indicates the actual number of errors encountered during the update operation. OwnerData is information supplied by the client application in a BeforeApplyUpdates event handler and returned to the client application in an AfterApplyUpdates event handler. It is passed to the provider’s BeforeApplyUpdates event handler and returned from the provider’s AfterApplyUpdates event handler.

AS_ApplyUpdates returns a Variant that is a data packet containing all records that could not be applied to the database.

Note:	Applications can only call the protected AS_ApplyUpdates method using the IAppServer interface. To apply updates directly in code from the application server, use the provider component’s ApplyUpdates method.


TRemoteDataModule.AS_DataRequest

TRemoteDataModule	See also

Generates an OnDataRequest event on the specified provider component.

function AS_DataRequest(const ProviderName: WideString; Data: OleVariant): OleVariant; safecall;

Description

Use AS_DataRequest to invoke an OnDataRequest event handler of the provider named by ProviderName. This method is provided to allow application developers to customize the communication between a client application and a provider component. There is no predefined meaning for the Data parameter or the return value.

Client applications must explicitly call DataRequest using the client dataset’s DataRequest method. Delphi does not call DataRequest automatically.

Note:	Applications can only call the protected AS_DataRequest method using the IAppServer interface.


TRemoteDataModule.AS_Execute

TRemoteDataModule	See also

Executes the query or stored procedure bound to a specified provider.

procedure AS_Execute(const ProviderName: WideString; const CommandText: WideString; var Params, OwnerData: OleVariant); safecall;

Description

Use AS_Execute to pass an execute command to a remote provider, using a specified set of parameters. AS_Execute calls the Execute method of the specified provider after assigning any parameters. Output parameters that result from executing a query or stored procedure are returned in the Params parameter.

Note:	Different types of provider interpret the Execute command in different ways. Some providers merely generate BeforeExecute and AfterExecute events, while others execute a query or stored procedure.

The ProviderName parameter specifies the name of the provider component associated with the query or stored procedure.

CommandText specifies an optional SQL statement that replaces the SQL of the provider’s query, or the name of a table or stored procedure that replaces the provider’s underlying database table or stored procedure. This parameter is ignored if the Options property does not include poAllowCommandText.

The Params parameter encodes any parameters expected by the query or stored procedure and returns any output parameters. To create a properly encoded value for Params from a TParams object, use the PackageParams method.

The OwnerData parameter contains custom information that appears as an argument to the provider’s BeforeExecute and AfterExecute event handlers. This information originates in a client dataset’s BeforeExecute event handler. The value returned in OwnerData is passed to the client dataset’s AfterExecute event handler.

Client applications must explicitly call AS_Execute through the client dataset’s Execute method. Delphi does not call AS_Execute automatically.

Note:	Applications can only call the protected AS_Execute method using the IAppServer interface. To execute a dataset in code from the application server, use the dataset component directly.


TRemoteDataModule.AS_GetParams

TRemoteDataModule	See also

Fetches current parameter values from the dataset bound to a specified provider.

function AS_GetParams(const ProviderName: WideString, var Ownerdata: OleVariant): OleVariant; safecall;

Description

Use AS_GetParams to retrieve the current parameter values from the dataset associated with a provider. The ProviderName parameter specifies the name of the provider component whose dataset has the parameters. The OwnerData represents custom information that originates in a client dataset’s BeforeGetParams event handler and returns information that is passed tot he client dataset’s AfterGetParams event handler.

AS_GetParams returns the parameters, encoded as a Variant array, or, if the provider does not support parameter fetching, AS_GetParams returns a Null Variant. Use the UnpackParams procedure to convert parameter values returned by AS_GetParams to a TParams object.

AS_GetParams should not be used to retrieve output parameters from stateless application servers, because parameter values may be changed by other applications. When writing a stateless application server, obtain output parameters using the AS_Execute method handler instead.

Note:	Applications can only call the protected AS_GetParams method using the IAppServer interface.


TRemoteDataModule.AS_GetProviderNames

TRemoteDataModule	See also

Returns a list of all the available providers on the remote data module.

function AS_GetProviderNames: OleVariant; safecall;

Description

Call AS_GetProviderNames for a list of all providers available from a remote data module. These values indicate the possible values for the ProviderName property of a client dataset that connects to the remote data module. When calling any of the remote data modules through the IAppServer method, pass one of these names to indicate the provider that is the target of the method call.

AS_GetProviderNames returns the names of the providers in a Variant array. Client datasets are associated with a provider by setting their ProviderName property to one of these names.

Warning:	AS_GetProviderNames returns a list that can include providers that are not exported. If a provider in the list has its Exported property set to False, trying to use that provider over an IAppServer interface results in an exception.

Note:	Applications can only call the protected AS_GetProviderNames method using the IAppServer interface.


TRemoteDataModule.AS_GetRecords

TRemoteDataModule	See also

Returns a data packet that contains the specified data.

function AS_GetRecords(const ProviderName: WideString, Count: Integer; out RecsOut: Integer; Options: Integer; const CommandText: WideString; var Params, OwnerData:OleVariant): OleVariant; safecall;

Description

Call AS_GetRecords to retrieve a specified number of records. AS_GetRecords returns the requested records, starting with the current record of the provider’s dataset. When working with a stateless remote data module, you may need to reposition the cursor or re-execute a query or stored procedure in the provider’s BeforeGetRecords event handler.

ProviderName gives the name of the provider component that provides the records.

Count indicates the number or type of records to retrieve. If Count is -1, all records are retrieved. If Count is 0, only metadata is retrieved. If Count is greater than 0, only Count records are retrieved.

RecsOut returns the actual number of records retrieved.

Options indicates what information should be added to the data packet in addition to data. It is an integer version of the TGetRecordOptions type. (An integer because the value must be compatible with a COM interface). To convert the TGetRecordOptions value to the appropriate integer, use the Ord function. For example:

Ord(grMetaData) + Ord(grXML)

CommandText specifies an optional SQL statement that replaces the SQL of the provider’s query, or the name of a table or stored procedure that replaces the provider’s underlying database table or stored procedure. This parameter is ignored if the Options property does not include poAllowCommandText.

Params is a Variant containing any parameters that should be passed to the provider’s dataset before it executes to generate the requested data. It returns any output parameters.

OwnerData contains custom information that is supplied by a client dataset’s BeforeGetRecords event handler. This information is passed to the provider’s BeforeGetRecords event handler. OwnerData returns information supplied by the provider’s AfterGetRecords event handler.

Records are returned as a data packet in a Variant.

Note:	Applications can only call the protected AS_GetRecords method using the IAppServer interface. To fetch records directly in code from the application server, use the provider component’s GetRecords method.


TRemoteDataModule.AS_RowRequest

TRemoteDataModule	See also

Returns information from a specified record of the provider’s dataset.

function AS_RowRequest(const ProviderName: WideString; Row: OleVariant; RequestType: Integer; var OwnerData: OleVariant): OleVariant; safecall;

Description

Client datasets call AS_RowRequest automatically to implement their FetchBlobs, FetchDetails , or RefreshRecord method.

The ProviderName parameter indicates the provider associated with the dataset from which information should be fetched.

The Row parameter is an OleVariant that describes the current record on the client dataset.

The RequestType parameter indicates the type of information required. It is an integer version of the TFetchOptions type. (An integer because the value must be compatible with a COM interface). To convert the TFetchOptions value to the appropriate integer, use the Ord function. For example:

Ord(foBlobs) + Ord(foDetails);

OwnerData contains custom information that is supplied by a client dataset’s BeforeRowRequest event handler. This information is passed to the provider’s BeforeRowRequest event handler. OwnerData returns custom information supplied by the provider’s AfterRowRequest event handler.

The requested data is returned as a delta packet.

Note:	Applications can only call the protected AS_RowRequest method using the IAppServer interface.


TRemoteDataModule.Create

TRemoteDataModule	See also

Creates a remote data module instance.

constructor Create(AOwner: TComponent); override;

Description

Most applications do not need to call the constructor for TRemoteDataModule.  Instead, add a remote data module to a server application using the remote data module wizard on the multi-tier page of the new items dialog.

AOwner specifies the component that is responsible for freeing the remote data module (typically the application).


TRemoteDataModule.Destroy

TRemoteDataModule	See also

Frees a remote data module instance.

destructor Destroy; override;

Description

Most applications do not need to call the destructor for TRemoteDataModule.  The remote data module is freed by its owner when the application shuts down.

If you must destroy a remote data module at runtime, call the Free method instead.


TRemoteDataModule.GetProvider

TRemoteDataModule	See also

Returns a registered provider component given its name.

function GetProvider(const ProviderName: string): TCustomProvider; virtual;

Description

GetProvider is the protected read implementation of the Providers property. ProviderName specifies the name of a provider that is returned. If ProviderName is not one of the names returned by AS_GetProviderNames, or if the provider’s Exported property is False, GetProvider raises an exception.


TRemoteDataModule.Lock

TRemoteDataModule	See also

Locks the remote data module so that it can’t be locked by other threads.

procedure Lock; virtual;

Description

Remote data modules use Lock internally to ensure that all IAppServer calls are thread-safe. When implementing a remote data module descendant that supports the free-threading model (including all multi-threaded CORBA data modules), call Lock before accessing any instance data, including the providers contained in the data module. When finished with the block of code that must be protected from thread conflicts, call the Unlock method to release the lock.

Lock uses a critical section to guard against thread conflicts. This means that any code which accesses the remote data module’s properties or contained objects must call Lock or it will introduce thread conflicts.


TRemoteDataModule.RegisterProvider

TRemoteDataModule	See also

Adds a provider to the list returned by AS_GetProviderNames.

procedure RegisterProvider(Value: TCustomProvider); virtual;

Description

Call RegisterProvider to make a provider available through the remote data module’s IAppServer interface. Pass a reference to the provider as the Value parameter. Once a provider is registered, its availability to client applications can be turned on or off using its Exported property. However, even the names of unexported providers are returned by AS_GetProviderNames.

There is no need to call RegisterProvider for providers that are added at design time or when the remote data module is assigned as an Owner in the provider’s constructor. These are registered automatically.

Before a registered provider is destroyed, it must be unregistered using the UnRegisterProvider method. Providers that have the remote data module as an Owner are unregistered automatically from their destructors.


TRemoteDataModule.Unlock

TRemoteDataModule	See also

Unlocks the remote data module after it was locked by a call to the Lock method.

procedure Unlock; virtual;

Description

Use Unlock to release the critical section that was entered by a call to the Lock method. Every call to the Lock method must be paired with a corresponding call to Unlock.


TRemoteDataModule.UnRegisterProvider

TRemoteDataModule	See also

Removes a provider from the list returned by AS_GetProviderNames.

procedure UnRegisterProvider(Value: TCustomProvider); virtual;

Description

Call UnRegisterProvider to remove a provider from the remote data module’s list of available providers. Pass a reference to the provider that should be removed as the Value parameter. When a provider is not registered, it is not returned by the AS_GetProviderNames method, which can be accessed through the IAppServer interface.

To temporarily disable a provider, use the provider’s Exported property. Unexported providers are listed by AS_GetProviderNames but can’t be accessed through any IAppServer method calls.

Before a registered provider is destroyed, it must be unregistered using the UnRegisterProvider method. Providers that have the remote data module as an Owner are unregistered automatically from their destructors.


TRemoteDataModule.UpdateRegistry

TRemoteDataModule	See also	Example

Registers the remote data module in the system registry as an automation server.

class procedure UpdateRegistry(Register: Boolean; const ClassID, ProgID: string); override;

Description

The protected UpdateRegistry is called automatically when you register or unregister the application server as an automation server.

The Register parameter is True when registering an application server, false when unregistering.

The ClassID and ProgID parameters specify the server’s ClassID and ProgID respectively.

Note:	If your application server pools remote data modules, you must override this method to call the global RegisterPooled procedure when the Register parameter is True and UnregisterPooled when the Register parameter is false.


Scope

Published

Accessibility

Read-only


Scope

Published


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TDataModule


TResetQueryButton

Hierarchy	Properties	Methods	See also

TResetQueryButton generates an HTML control that backs out changes to the values on a query form.

Unit

MidItems

Description

Add TResetQueryButton as the child of a TQueryButtons component (or a layout group that is a child of a TQueryButtons component) to enable the generated HTML form to undo edits made in the query form’s display fields. The resulting HTML button’s action backs out all edits to the values displayed on the query form.

Use the properties of TResetQueryButton to customize the appearance of the button.


TResetQueryButton properties

TResetQueryButton	Alphabetically	Legend

Derived from TQueryButton

Caption

Derived from TXMLDisplayReferenceButton

XMLComponent

XMLUseParent

Derived from TWebButton

Custom

Style

StyleRule

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TResetQueryButton properties

TResetQueryButton	By object	Legend

Caption

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

XMLComponent

XMLUseParent


TResetQueryButton methods

TResetQueryButton	Alphabetically

In TResetQueryButton

Create

Derived from TXMLDisplayReferenceButton

Destroy

Derived from TWebButton

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TResetQueryButton methods

TResetQueryButton	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TResetQueryButton.Create

TResetQueryButton	See also

Creates and initializes an instance of TResetQueryButton.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TResetQueryButton at runtime. Buttons added at design time using the Web Page editor are instantiated automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebButton

TXMLDisplayReferenceButton

TQueryButton


DisableSocketTransport procedure

See also	Example

Unregisters a remote data module so clients can’t access it using a Socket connection.

Unit

databkr

Category

MIDAS utilities

procedure DisableSocketTransport(const ClassID: string);

Description

The remote data module Wizard automatically adds a call to DisableSocketTransport to the overridden UpdateRegistry method of the new remote data module descendant. This removes the registry entries that Scktsrvr.exe uses to check whether clients can access the application server. The registry entries are added by a call to EnableSocketTransport (also added to UpdateRegistry).

To make an application server unavailable to Socket-based connections, remove these two calls from UpdateRegistry. The application server can still receive requests over connections formed using other protocols.

ClassID is the class ID of the remote data module. This value is passed as a parameter to the UpdateRegistry method that calls DisableSocketTransport.


DisableWebTransport procedure

See also	Example

Unregisters a remote data module so clients can’t access it using a Web connection.

Unit

databkr

Category

MIDAS utilities

procedure DisableWebTransport(const ClassID: string);

Description

The remote data module Wizard automatically adds a call to DisableWebTransport to the overridden UpdateRegistry method of the new remote data module descendant. This removes the registry entries that httpsrvr.dll uses to check whether clients can access the application server. The registry entries are added by a call to EnableWebTransport (also added to UpdateRegistry).

To make an application server unavailable to HTTP-based connections, remove these two calls from UpdateRegistry. The application server can still receive requests over connections formed using other protocols.

ClassID is the class ID of the remote data module. This value is passed as a parameter to the UpdateRegistry method that calls DisableSocketTransport.


EnableSocketTransport procedure

See also	Example

Registers a remote data module so clients can access it using a Socket connection.

Unit

databkr

Category

MIDAS utilities

procedure EnsableSocketTransport(const ClassID: string);

Description

The remote data module Wizard automatically adds a call to EnableSocketTransport to the overridden UpdateRegistry method of the new remote data module descendant. This adds the registry entries that Scktsrvr.exe uses to check whether clients can access the application server. The registry entries are removed by a call to EnableSocketTransport (also added to UpdateRegistry).

To make an application server unavailable to Socket-based connections, remove these two calls from UpdateRegistry. The application server can still receive requests over connections formed using other protocols.

ClassID is the class ID of the remote data module. This value is passed as a parameter to the UpdateRegistry method that calls EnableSocketTransport.


EnableWebTransport procedure

See also	Example

Registers a remote data module so clients can access it using a Web connection.

Unit

databkr

Category

MIDAS utilities

procedure EnableWebTransport(const ClassID: string);

Description

The remote data module Wizard automatically adds a call to EnableWebTransport to the overridden UpdateRegistry method of the new remote data module descendant. This adds the registry entries that httpsrvr.dll uses to check whether clients can access the application server. The registry entries are removed by a call to DisableWebTransport (also added to UpdateRegistry).

To make an application server unavailable to HTTP-based connections, remove these two calls from UpdateRegistry. The application server can still receive requests over connections formed using other protocols.

ClassID is the class ID of the remote data module. This value is passed as a parameter to the UpdateRegistry method that calls DisableSocketTransport.


RegisterPooled procedure

See also	Example

Registers a remote data module so that instances are pooled.

Unit

databkr

Category

MIDAS utilities

procedure RegisterPooled(const ClassID: string; Max, Timeout: Integer; Singleton: Boolean = False);

Description

To enable remote data module instances to be pooled, call RegisterPooled from the UpdateRegistry method of a TRemoteDataModule descendant. When data module instances are pooled, the server maintains a cache of remote data module instances. Each client request is serviced by the first available instance from that cache. Because instances are shared, the remote data module can’t rely on persistent state information.

ClassID is the class ID of the remote data module. This value is passed as a parameter to the UpdateRegistry method that calls RegisterPooled.

Max indicates the maximum number of instances in the pool. If client applications request more than this maximum number, the application server raises a “Server too busy” exception.

Timeout indicates the number of minutes a remote data module instance can sit idle in the object pool. If an instance receives no client requests for more than Timeout minutes, it is automatically freed. The server checks every 6 minutes, so an object may persist in an idle state up to 6 minutes longer than Timeout. Setting Timeout to 0 indicates an infinite timeout period (that is, unused objects are not freed until the application server shuts down).

Singleton indicates that all client calls go to the same remote data module instance. There is only a single instance rather than a pool of available instances. Only set Singleton to True if the remote data module is free-threaded.

Note:	When Singleton is True, the values of Max and Timeout are ignored because there is only one instance with no timeout period.


UnregisterPooled procedure

See also	Example

Removes the object pooling registry entries for a remote data module.

Unit

databkr

Category

MIDAS utilities

procedure UnregisterPooled(const ClassID: string);

Description

When remote data module instances are pooled, call UnregisterPooled from the UpdateRegistry method of a TRemoteDataModule descendant. This unregisters the object pooling at the same time the remote data module is unregistered as an automation server.

ClassID is the class ID of the remote data module. This value is passed as a parameter to the UpdateRegistry method that calls UnregisterPooled.


PackageParams function

See also

Converts a TParams object into an OleVariant that can be used in MIDAS applications.

Unit

dbclient

Category

MIDAS utilities

function PackageParams(Params: TParams; Types: TParamTypes = AllParamTypes): OleVariant;

Description

Client datasets use PackageParams to convert their Params property into the OleVariant that is expected by IAppServer methods that pass parameter values to or from the application server. Use PackageParams to encode parameter values when using the IAppServer interface directly rather than using the methods of TClientDataSet.

The Params parameter is a TParams object (usually the Params property of the source component) whose parameter values are to be encoded.

The Types parameter indicates which parameters from the Params parameter are to be included. This allows applications to include, for example, only input parameters if no others are needed.

PackageParams returns an OleVariant that encodes the parameter values as a Variant array.


UnpackParams procedure

See also

Converts an OleVariant that represents a set of parameters into a TParams object.

Unit

dbclient

Category

MIDAS utilities

procedure UnpackParams(const Source: OleVariant; Dest: TParams);

Description

Client datasets use UnpackParams update their Params property with parameter values received over an IAppServer interface. Use UnpackParams to decode parameter values when using the IAppServer interface directly rather than using the methods of TClientDataSet.

The Source parameter is an OleVariant that represents a set of parameter values. Parameter values can be encoded into this format using the PackageParams function.

The Dest parameter is a TParams object (usually the Params property of a destination component) that receives the parameter values.


SafeRef function

See also

Returns a reference to an MTS object that is safe to pass outside its context.

Unit

Mtx

Category

COM utilities

function SafeRef(const rid: TGUID; Unk: IUnknown): Pointer;

Description

SafeRef encapsulates the SafeRef MTS function that passes in a reference to the interface ID of the interface (rid) that the current object wants to pass to another object or client and a reference to an interface on the current object (Unk). It returns a pointer to the interface specified in the rid parameter that is safe to pass outside the current object's context.

When an MTS object wants to pass a self-reference to a client or another object (for example, for use as a callback), it should always call SafeRef first and then pass the reference returned by this call. An object should never pass a this pointer, or a self-reference obtained through an internal call to QueryInterface, to a client or to any other object. Once such a reference is passed outside the object's context, it is no longer a valid reference.

Calling SafeRef on a reference that is already safe returns the safe reference unchanged, except that the reference count on the interface is incremented.

When a client calls QueryInterface on a reference that is safe, MTS automatically ensures that the reference returned to the client is also a safe reference.

An object that obtains a safe reference must release the safe reference when it is finished with it.

Note:	Safe references have different pointer values than their unsafe counterparts. For example, this and the safe version of this do not have the same value. It is important to be aware of this when testing whether two pointers refer to the same object. Calling QueryInterface for IID_IUnknown on each of the pointers and comparing the value of the returned pointers may result in the wrong conclusion. It is possible that both pointers refer to the same object, but that one is a safe reference and the other is not. If both references are safe references, they can be compared in the usual way. This is only a consideration for MTS objects, because clients should never have access to unsafe references.


CreateSharedPropertyGroup function

See also

Returns the interface for a SharedPropertyGroup that allows MTS objects within a server process to share state.

Unit

Mtx

Category

COM utilities

function CreateSharedPropertyGroup(const Name: WideString): ISharedPropertyGroup;

Description

CreateSharedPropertyGroup returns an interface to a new shared property group. If a property group of the specified name exists, it returns a reference to the existing shared property group. Use this function to create and access the shared properties of a shared property group.

CreateSharedPropertyGroup sets up a SharedPropertyGroup with the default values of LockSetGet for locking (isolation) mode, and Process for release mode. LockSetGet locks a property during every get or set operation on a shared property, making each operation atomic. This ensures that two clients cannot read or write to the same property at the same time, but it does not prevent other clients from concurrently accessing other properties in the same group. The Process release mode ensures that the property group is not destroyed until the process in which it was created has terminated.  (Objects that hold references on a property group must still call Release on their references).

To override these defaults, call CreateSharedPropertyGroupManager and use the resulting interface to create a property group.

ISharedPropertyGroup has several methods that can be used to share state among multiple objects in a server process. See ISharedPropertyGroup in the MTS documentation for a list of methods.

By using shared property groups, you eliminate name collisions because they establish unique name spaces for the shared properties they contain. The Shared Property Manager also implements locks and semaphores to protect shared properties from simultaneous access, which could result in lost updates and could leave the properties in an unpredictable state.

Note:	Only objects running in the same process can share properties. If you want instances of different components to share properties, you have to install the components in the same MTS package. Because there is a risk that administrators will move components from one package to another, it's safest to limit the use of a shared property group to instances of components that are defined in the same DLL.


CreateSharedPropertyGroupManager function

See also

Returns an interface for a new shared property group manager that creates and coordinates shared properties of MTS objects.

Unit

Mtx

Category

COM utilities

function CreateSharedPropertyGroupManager: ISharedPropertyGroupManager;

Description

Call CreateSharedPropertyGroupManager before creating shared property groups if you are not using the CreateSharedPropertyGroup function. The ISharedPropertyGroupManager interface lets you create and access shared properties with more control that is provided by CreateSharedPropertyGroup.

By using shared property groups, you eliminate name collisions because they establish unique name spaces for the shared properties they contain. The Shared Property Manager also implements locks and semaphores to protect shared properties from simultaneous access, which could result in lost updates and could leave the properties in an unpredictable state.

For more information about the ISharedPropertyGroupManager interface, see the MTS documentation.


CreateTransactionContext function

See also	Example

Starts an MTS transaction.

Unit

Mtx

Category

COM utilities

function CreateTransactionContext: ITransactionContext;

Description

CreateTransactionContext allows client applications to control MTS transactions. CreateTransactionContext returns an interface to the new transaction context. Use this interface to enlist MTS server objects in the transaction, and to commit or roll back the transaction when done.


CreateTransactionContextEx function

See also	Example

Instantiates a TransactionContextEx object, which marks the beginning of a transaction.

Unit

Mtx

Category

COM utilities

function CreateTransactionContextEx: ITransactionContextEx;

Description

MTS base clients use CreateTransactionEx to combine the work of one or more MTS objects into an atomic transaction and to commit or abort the transaction. Clients initiate a transaction by instantiating a CreateTransactionEx object; they end a transaction by calling Complete or Abort on the object.

ITransactionContextEx exposes the following methods:

Method	Description

Abort	Aborts the work of all MTS objects participating in the current transaction. The transaction is completed on return from this method.

Commit	Attempts to commit the work of all MTS objects participating in the current transaction. If any of the MTS objects participating in the transaction call SetAbort or DisableCommit, or if a system error occurs, the transaction is aborted. Otherwise, the transaction is committed. In either case, the transaction is completed on return from this method.

CreateInstance	Instantiates another MTS object. If the component that provides the object is configured to support or require a transaction, then the new object runs under the transaction of the TransactionContextEx object.


TSubmitQueryButton

Hierarchy	Properties	Methods	See also

TSubmitQueryButton generates an HTML control that backs out changes to the values on a query form.

Unit

MidItems

Description

Add TSubmitQueryButton as the child of a TQueryButtons component (or a layout group that is a child of a TQueryButtons component) to enable the generated HTML form to send the values entered in the query form back to the Web application. When the user presses the generated button, the values in the query form are sent to the Web application, using the path info specified by the query form’s Action property.

Use the properties of TSubmitQueryButton to customize the appearance of the button.


TSubmitQueryButton properties

TSubmitQueryButton	Alphabetically	Legend

Derived from TQueryButton

Caption

Derived from TXMLDisplayReferenceButton

XMLComponent

XMLUseParent

Derived from TWebButton

Custom

Style

StyleRule

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TSubmitQueryButton properties

TSubmitQueryButton	By object	Legend

Caption

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

XMLComponent

XMLUseParent


TSubmitQueryButton methods

TSubmitQueryButton	Alphabetically

In TSubmitQueryButton

Create

Derived from TXMLDisplayReferenceButton

Destroy

Derived from TWebButton

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSubmitQueryButton methods

TSubmitQueryButton	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TSubmitQueryButton.Create

TSubmitQueryButton	See also

Creates and initializes an instance of TSubmitQueryButton.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TSubmitQueryButton at runtime. Buttons added at design time using the Web Page editor are instantiated automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebButton

TXMLDisplayReferenceButton

TQueryButton


 TSocketConnection

Hierarchy	Properties	Methods	Events	See also

TSocketConnection uses Windows sockets to manage the connection to an application server.

Unit

sconnect

Description

TSocketConnection is used in the client portion of a multi-tiered database application to establish and maintain the connection between the client and a remote application server. The Socket connection object can

Establish an initial connection to a remote application server.

Obtain an IAppServer for the application server.

Call into a separate COM object that encodes and decodes the content of messages.

Obtain a list of providers on the application server.

Drop the connection to the remote application server.

TSocketConnection establishes the initial connection between the client application and a remote application server using TCP/IP. To use TSocketConnection, the application server must be running ScktSrvr.exe.

Once the connection is established, the client registers any or all of its client datasets, and these client datasets use the IAppServer interface from the socket connection component to communicate with providers on the application server, or to otherwise call the application server’s data module interface.

To connect to remote application servers using DCOM, use the TDCOMConnection component instead. To connect to remote application servers using HTTP, use the TWebConnection component instead. To connect to remote application servers using CORBA, use the TCORBAConnection component.


TSocketConnection properties

TSocketConnection	Alphabetically	Legend

In TSocketConnection

Address

Host

InterceptGUID

Port

Derived from TStreamedConnection

SupportCallbacks

Derived from TDispatchConnection

AppServer

Connected

ObjectBroker

ServerGUID

ServerName

Derived from TCustomConnection

DataSetCount

DataSets

LoginPrompt

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TSocketConnection properties

TSocketConnection	By object	Legend

Address

AppServer

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Connected

DataSetCount

DataSets

DesignInfo

Host

InterceptGUID

LoginPrompt

Name

ObjectBroker

Owner

Port

ServerGUID

ServerName

SupportCallbacks

Tag

VCLComObject


TSocketConnection.Address

TSocketConnection	See also

Specifies the IP address of the server.

property Address: String;

Description

Use Address to specify the IP address of the application server to which the client application connects. In addition to the address, you must provide a value for the Port property so that the socket connection component can locate the listening socket on the server system.

Sockets require either an IP address or a Host name to locate the server system. You can use the Host property instead of the Address property to specify the server system using a host name. The Address and Host properties are mutually exclusive: Setting Address causes Host to be set to an empty string, and vice versa.

Note:	If the socket connection component uses an Object Broker, you do not need to specify the Address property. Instead, the Object Broker supplies an Address for a server that is located dynamically at runtime. Explicitly setting the Address property overrides the value supplied by the Object Broker, but such overridden values are not saved with the socket connection component.


TSocketConnection.Host

TSocketConnection	See also

Specifies the host name of the server.

property Host: String;

Description

Use Host to specify the host name of the server system to which the client application should connect. In addition to the host name, you must provide a value for the Port property so that the socket connection component can locate the listening socket on the server system.

Sockets require either a Host name or an IP address to locate the server system. You can use the Address property instead of the Host property to specify the server system using an IP address. The Host and Address properties are mutually exclusive: Setting Host causes Address to be set to an empty string, and vice versa.

Note:	If the socket connection component uses an Object Broker, you do not need to specify the Host property. Instead, the Object Broker supplies a host name for a server that is located dynamically at runtime. Explicitly setting the Host property overrides the value supplied by the Object Broker, but such overridden values are not saved with the socket connection component.


TSocketConnection.InterceptGUID

TSocketConnection	See also

Specifies the GUID of a COM object that manipulates interface calls before they are sent or after return values are received.

property InterceptGUID: string;

Description

Set InterceptGUID to the GUID of a COM object that intercepts socket connection messages before they are sent and after they are received. The COM object must implement the IDataIntercept interface. Use the IDataIntercept methods to manipulate the data that is communicated using the socket connection. For example, applications can use these methods to encrypt and decrypt data or to compress and decompress data.

When using InterceptGUID, the server must use the same COM object to undo the transformation performed by the socket connection component’s InterceptGUID. Set the server’s InterceptGUID to the same GUID using the Socket server dialog of ScktSrvr.exe.


TSocketConnection.Port

TSocketConnection	See also

Specifies the port number of the socket dispatcher application on the server system.

property Port: Integer;

Description

Use Port to specify the port that the socket dispatcher uses to listen for client connection requests. By default, Port is 211, which is the default port number of ScktSrvr.exe and ScktSrvc.exe (the two socket dispatcher applications provided with Delphi). Change the value of Port if the socket dispatcher is configured to use a different port.

Note:	If the socket connection component uses an Object Broker, you do not need to specify the Port property. Instead, the Object Broker supplies a port number for a server that is located dynamically at runtime. Explicitly setting the Port property overrides the value supplied by the Object Broker, but such overridden values are not saved with the socket connection component.


TSocketConnection events

TSocketConnection	Alphabetically	Legend

Derived from TDispatchConnection

OnGetUserName

Derived from TCustomConnection

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnLogin


TSocketConnection events

TSocketConnection	By object	Legend

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnGetUserName

OnLogin


TSocketConnection methods

TSocketConnection	Alphabetically	Legend

In TSocketConnection

Create

CreateTransport

DoConnect

Derived from TStreamedConnection

Destroy

Derived from TDispatchConnection

GetServer

Derived from TCustomConnection

Close

Open

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSocketConnection methods

TSocketConnection	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Create

CreateTransport

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DoConnect

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetServer

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Open

RemoveComponent

SafeCallException

UpdateAction


TSocketConnection.Create

TSocketConnection	See also

Creates and initializes an instance of TSocketConnection.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TSocketConnection object at runtime. Socket connection components added to forms or data modules at design time are created automatically.

Create overrides the inherited constructor to initialize the Port property to 211.


TSocketConnection.CreateTransport

TSocketConnection	See also

Returns an ITransport interface that can be used to connect to and communicate with the application server.

function CreateTransport: ITransport; virtual;

Description

Socket connection components use an ITransport interface to connect to and communicate with the application server. CreateTransport instantiates the internal helper object that connects to the socket dispatcher on the server and sends or receives messages. CreateTransport passes the values of the Host, Address and Port properties to this helper object and returns its ITransport interface.


TSocketConnection.DoConnect

TSocketConnection	See also

Connects to a remote application server.

procedure DoConnect; override;

Description

DoConnect is used internally to connect to the application server when the Connected property is set to True. If the Host or Address and Port properties are set, DoConnect uses these to locate the socket on the server machine. Otherwise, if the ObjectBroker property is set, it obtains these values from the object broker.

Once the server machine is located, DoConnect opens a connection.

Note:	When ObjectBroker is nil, the values of Host, Address, and Port are saved with the socket connection component. If ObjectBroker is not nil, these values are not saved from design time. However, once these values are set (either by values obtained from the Object Broker or by values specified in code at runtime), they are used every time a connection must be re-established. If these values subsequently fail, the socket connection component fetches new values from the Object Broker.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomConnection

TCustomRemoteServer

TDispatchConnection

TStreamedConnection


TSelectOptionsColumn

Hierarchy	Properties	Methods	See also

TSelectOptionsColumn creates an HTML list control to represent a field value in a data grid.

Unit

MidItems

Description

Add TSelectOptionsColumn as the child of a TDataGrid component to add a list control as the display control for a column. TSelectOptionsColumn represents the value of a field in the TDataGrid’s associated dataset.

Use the properties and methods of TSelectOptionsColumn to

Specify the field whose value the list box displays.

Specify the possible values for the field from which the user can choose.

Specify the caption that appears at the top of the column.

Customize the appearance of the list box.

Fit the list box into the tab order of the generated HTML form.


TSelectOptionsColumn properties

TSelectOptionsColumn	Alphabetically	Legend

Derived from TWebSelectOptionsInput

DisplayRows

Derived from TWebListInput

DataSet

Items

ItemsField

Values

ValuesField

Derived from TWebDataInput

FieldName

Derived from TWebDataDisplay

Caption

CaptionAttributes

Custom

Style

StyleRule

TabIndex

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TSelectOptionsColumn properties

TSelectOptionsColumn	By object	Legend

Caption

CaptionAttributes

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DataSet

DesignInfo

DisplayRows

FieldName

Items

ItemsField

Name

Owner

Style

StyleRule

TabIndex

Tag

Values

ValuesField

VCLComObject


TSelectOptionsColumn methods

TSelectOptionsColumn	Alphabetically

In TSelectOptionsColumn

IsColumn

Derived from TWebSelectOptionsInput

Create

Derived from TWebListInput

Destroy

Derived from TWebDataDisplay

GetParentComponent

HasParent

IsQueryField

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSelectOptionsColumn methods

TSelectOptionsColumn	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsColumn

IsQueryField

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TSelectOptionsColumn.IsColumn

TSelectOptionsColumn	See also

Indicates whether the component generates a control that can appear in the column of a data grid.

class function IsColumn: Boolean; override;

Description

Call IsColumn to detemine whether a Web display component generates a control that represents a column in a data grid (TDataGrid). IsColumn returns True, because TSelectOptionsColumn is designed specifically for TDataGrid to use.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebDataDisplay

TWebDataInput

TWebListInput


TServerItem

Hierarchy	Properties	Methods	See also

TServerItem describes an application server for a simple object broker.

Unit

objbrkr

Description

Use TServerItem to describe an application server to which client applications can connect. TSimpleObjectBroker maintains a list of these descriptions. Then, when a connection component needs to open a connection, it can use the information stored in a server item to identify an available application server.


TServerItem properties

TServerItem	Alphabetically	Legend

In TServerItem

ComputerName

DisplayName

Enabled

HasFailed

Port

Derived from TCollectionItem

Collection

ID

Index


TServerItem properties

TServerItem	By object	Legend

Collection

ComputerName

DisplayName

Enabled

HasFailed

ID

Index

Port


TServerItem.ComputerName

TServerItem	See also	Example

Identifies the machine where the application server resides.

property ComputerName: string;

Description

Set ComputerName to a string that identifies the machine where the application server resides. The value of this string depends on the type of connection component that requests this value from its object broker.

If the connection component is a TDCOMConnection object, ComputerName is the Windows computer name. (This value can be found in the Control panel under network settings.)

If the connection component is a TSocketConnection object, ComputerName is either the host name or IP address of the system running the application server. Socket connection components parse this string to determine which it is.


TServerItem.DisplayName

TServerItem	See also

Specifies the name of the server item as it appears in the collection editor.

property DisplayName: String;

Description

DisplayName is the string that represents the server item in the Collection editor. If the ComputerName property is set, DisplayName is the same as ComputerName. Otherwise, if DisplayName is not explicitly set, it is the name of the class (ServerItem) with a number appended to ensure uniqueness.


TServerItem.Enabled

TServerItem	See also	Example

Enables or disables the server item.

property Enabled: Boolean;

Description

Set Enabled to indicate whether the server should made available in the simple object broker. When Enabled is True, the ComputerName property can be supplied to connection components by the object broker’s GetComputerForGUID or GetComputerForProgID methods. When Enabled is False, the server item is not returned.

Note:	Even when the server item is disabled, it is still returned by TServerCollection’s FindServer method.


TServerItem.HasFailed

TServerItem	See also	Example

Indicates whether a connection attempt to the associated server machine has failed.

property HasFailed: Boolean;

Description

When connection components can’t successfully open a connection to an application server, they inform the object broker by calling SetConnectStatus. The simple object broker, in turn, records this fact by setting the HasFailed property to True.

When HasFailed is False, the ComputerName property can be supplied to connection components by the object broker’s GetComputerForGUID or GetComputerForProgID methods. When HasFailed is True, the server item is not returned.

Once a server has failed it is presumed to be down until the application explicitly resets the HasFailed property to False.

Do not use HasFailed to disable server items. Instead, use the Enabled property to disable servers for any reason other than a failed connection.

Note:	Even when HasFailed is True, the server item is still returned by TServerCollection’s FindServer method.


TServerItem.Port

TServerItem	See also

Specifies the port number for the associated server application.

property DataType: TFieldType;

Description

Read Port to obtain a port number when using the server item to supply information for connecting using TCP/IP. This value is returned by the GetPortForComputer method of the simple object broker.

By default, the value of Port is 211, which is the default port number for the socket dispatcher applications ScktSrvr.exe and ScktSrvc.exe. If the server listens on a different port, change this property to indicate the listening port.

Note:	Server items that supply a Port number should specify the server system’s IP address or host name as the value of ComputerName.


TServerItem methods

TServerItem	Alphabetically

In TServerItem

Create

Derived from TCollectionItem

Destroy

GetNamePath

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TServerItem methods

TServerItem	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TServerItem.Create

TServerItem	See also

Creates and initializes a TServerItem instance.

constructor Create(AOwner: TCollection); override;

Description

Do not call Create directly to add a new server item to a server collection. Instead, use the Add or Insert method of the TServerCollection object.

The AOwner parameter specifies the server collection that manages the newly created server item.

After calling the inherited constructor, Create initializes the Enabled property to True, the HasFailed property to False, and the Port property to 211.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem


TSmallIntArray

Hierarchy	Properties	Methods	See also

TSmallIntArray is a dynamically resizeable array of 16-bit integers.

Unit

mxarrays

Description

Use TSmallIntArray to represent an array of short integers when the number of elements in the array is unknown. For example, decision cubes use TSmallIntArray objects to represent the coordinates of a cell in the multidimensional cache of summary values.


TSmallIntArray properties

TSmallIntArray	Alphabetically	Legend

In TSmallIntArray

Items

Derived from TBaseArray

AutoSize

Capacity

CompareProc

Count

Duplicates

ItemSize

Limit

List

SortOrder


TSmallIntArray properties

TSmallIntArray	By object	Legend

AutoSize

Capacity

CompareProc

Count

Duplicates

Items

ItemSize

Limit

List

SortOrder


TSmallIntArray.Items

TSmallIntArray	See also

Lists the elements in the array.

property Items[ Index: Integer ]: SmallInt; default;

Description

Use Items to read or set the value of the element indicated by the Index parameter, where 0 specifies the first element in the array, 1 specifies the second parameter, and so on. Items is the default property for TSmallIntArray, which means the name of the Items property need not be included when using it. Thus, the line

FirstInt := SmallIntArray1.Items[0];

can be written

FirstInt := SmallIntArray1[0].


TSmallIntArray methods

TSmallIntArray	Alphabetically

In TSmallIntArray

Add

Assign

Create

GetItem

PutItem

Derived from TBaseArray

Clear

Delete

Destroy

Exchange

FindItem

IndexOf

Insert

InsertAt

RemoveItem

Sort

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TSmallIntArray methods

TSmallIntArray	By object

Add

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

Exchange

FieldAddress

FindItem

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetItem

GetNamePath

IndexOf

InheritsFrom

InitInstance

Insert

InsertAt

InstanceSize

MethodAddress

MethodName

NewInstance

PutItem

RemoveItem

SafeCallException

Sort


TSmallIntArray.Add

TSmallIntArray	See also

Adds a new element to the array.

function Add( Value: SmallInt ): Integer;

Description

Call Add to add an item to the end of an unsorted array, or to the appropriate position in a sorted array. To insert an element at a specified position within the array, use the Insert method instead.

Note:	Add assumes that sorted arrays are sorted in ascending order. To use Add on an array where SortOrder is TS_DESCENDING, temporarily change the CompareProc property to a function that multiplies the value returned by CompareProc by -1.


TSmallIntArray.Assign

TSmallIntArray	See also

Copies the Items property of another TSmallIntArray object.

procedure Assign( Source: TPersistent ); override;

Description

Call Assign to copy the array from another object. If the Source parameter is a TSmallIntArray object, Assign replaces the Items property with the array from the source array. Otherwise, Assign calls the inherited method which will assign values from any Source object that handles a TSmallIntArray in its AssignTo method.

Note:	Assign only changes the list of elements. It does not copy the AutoSize, Capacity, CompareProc, Duplicates, or SortOrder properties. If the AutoSize property is False, be sure that the value of Capacity is at least as big as the Count property of the source array. If the array is sorted, source items will appear in sorted order. If the Duplicates property is not dupAccept, duplicate elements will not be copied from the source array.


TSmallIntArray.Create
TSmallIntArray.CreateTSmallIntArray

TSmallIntArray	See also

Creates an instance of TSmallIntArray.

constructor Create( Itemcount, iSize: Integer ); virtual;

Description

Call Create to create and initialize a TSmallIntArray object. Create sets the Capacity property to Itemcount and ignores the iSize parameter.

Create also initializes the following properties:

•	ItemSize is set to 2 (the size of a small integer).

•	CompareProc is initialized to a function that returns the difference between two 16-bit integers.

•	AutoSize is set to True.

•	Count is set to 0.


TSmallIntArray.GetItem

TSmallIntArray	See also

Returns the integer at the indicated position.

function GetItem(Index: Integer): SmallInt;

Description

Call GetItem to obtain the value of an integer in the array. The Index parameter indicates the element of the array, where the first element has the index 0, the second element has the index 1, and so on.


TSmallIntArray.PutItem

TSmallIntArray	See also

Replaces the value of an element in the array.

procedure PutItem( Index: Integer; Value: SmallInt );

Description

Call PutItem to change the value of an integer to the value Value. Unlike the Insert method, PutItem does not add a new item to the array, but replaces the value of an existing element. The Index parameter indicates which element to change, where 0 specifies the first element, 1 specifies the second element, and so on.

Note:	Calling PutItem with Index set to the value of the Count property will add a new element to the end of the array. This is the only case where PutItem adds a new element instead of replacing an existing one.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TBaseArray


 TSimpleObjectBroker

Hierarchy	Properties	Methods	See also

TSimpleObjectBroker maintains a list of available application servers for a connection component.

Unit

objbrkr

Description

TSimpleObjectBroker maintains a list of servers, all of which run the application server for a multi-tiered application. When a connection component requests a server, the simple object broker passes the name of one of the available servers in the list. This process allows client applications to locate server systems dynamically at runtime. If there are redundant server systems, this allows client applications to continue functioning when a server goes down.

TSimpleObjectBroker can randomize the selection of servers from among the currently available servers in its list to provide a simple system of load balancing.


TSimpleObjectBroker properties

TSimpleObjectBroker	Alphabetically	Legend

In TSimpleObjectBroker

LoadBalanced

ServerData

Servers

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TSimpleObjectBroker properties

TSimpleObjectBroker	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

LoadBalanced

Name

Owner

ServerData

Servers

Tag

VCLComObject


TSimpleObjectBroker.LoadBalanced

TSimpleObjectBroker 	See also

Specifies how the simple object broker picks a server from its list.

property LoadBalanced: Boolean;

Description

Set LoadBalanced to True to indicate that the simple object broker should supply computer names randomly from the available servers listed in the Servers property. When LoadBalanced is False, GetComputerForGUID and GetComputerForProgID always return the first available server.

If the simple object broker is used by multiple connection components in the client application, it is preferable to set LoadBalanced to True in order to distribute the work among available servers.

When there is only a single connection component, there is no need to randomize the selection of servers, because only one connection will be used at a time. However, when deploying client applications, you may want to reorder the Servers list in the simple object broker for each client, so that different clients give preference to different servers.


TSimpleObjectBroker.ServerData

TSimpleObjectBroker 	See also	Example

Encapsulates the list of servers as an OleVariant.

property ServerData: OleVariant;

Description

Reading ServerData returns the value of the Servers property stored in Delphi’s internal component format. Writing ServerData sets the value of the Servers property from an OleVariant that was saved previously.

Use the ServerData property to provide a mechanism for loading and saving the list of servers represented by the Servers property. For example, An application can write the value of ServerData to an .ini file or the system registry. Later, it can read the value it saved as an OleVariant, and set ServerData to restore the Servers property to the value that was saved.

Note:	The implementation of ServerData uses the SaveToStream method to encode the Servers property as an OleVariant and the LoadFromStream method to decode that OleVariant and restore the Servers property.


TSimpleObjectBroker.Servers

TSimpleObjectBroker 	See also	Example

Maintains the list of servers that can be provided to connection components.

property Servers: TServerCollection;

Description

Use Servers to specify the list of servers that the simple object broker can return from the GetComputerForProgID and GetComputerForGUID methods.

Each item in the collection keeps track of whether the last connection attempt to that server was successful, and if not, the simple object broker ignores that server. In addition, individual servers in the collection can be disabled so that the simple object broker ignores them until they are re-enabled.


TSimpleObjectBroker methods

TSimpleObjectBroker	Alphabetically

In TSimpleObjectBroker

Create

Destroy

GetComputerForGUID

GetComputerForProgID

GetPortForComputer

LoadFromStream

SaveToStream

SetConnectStatus

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSimpleObjectBroker methods

TSimpleObjectBroker	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetComputerForGUID

GetComputerForProgID

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetPortForComputer

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

LoadFromStream

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

SaveToStream

SetConnectStatus

UpdateAction


TSimpleObjectBroker.Create

TSimpleObjectBroker 	See also

Creates and intializes a simple object broker.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a simple object broker at runtime.

After calling the inherited constructor, Create initializes the LoadBalanced property to False and creates the TServerCollection that implements the Servers property.


TSimpleObjectBroker.Destroy

TSimpleObjectBroker 	See also

Destroys an instance of TSimpleObjectBroker.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead, call Free, which verifies that the simple object broker is not nil, and only then calls Destroy.


TSimpleObjectBroker.GetComputerForGUID

TSimpleObjectBroker 	See also

Returns a string that identifies an available server machine.

function GetComputerForGUID(GUID: TGUID): string; override;

Description

Call GetComputerForGUID to obtain the name of an available server machine. The GUID parameter (which specifies the global unique identifier of the desired server interface) is ignored.

GetComputerForGUID returns the ComputerName property of an available server from the Servers property. If the LoadBalanced property is True, this server is chosen at random from available servers. If the LoadBalanced property is False, this server is the first available server listed in the Servers property. If no servers are available, GetComputerForGUID raises an EBrokerException exception.

A server is considered available if its Enabled property is True and its HasFailed property is False. The broker automatically sets HasFailed to False when it is notified of a connection failure for that server.


TSimpleObjectBroker.GetComputerForProgID

TSimpleObjectBroker 	See also

Returns a string that identifies an available server machine.

function GetComputerForProgID(const ProgID): string; override;

Description

Call GetComputerForProgID to obtain the name of an available server machine. The ProgID parameter (which specifies the desired server interface) is ignored.

TSimpleObjectBroker returns the ComputerName property of an available server from the Servers property. If the LoadBalanced property is True, this server is chosen at random from available servers. If the LoadBalanced property is False, this server is the first available server listed in the Servers property. If no servers are available, GetComputerForGUID raises an EBrokerException exception.

A server is considered available if its Enabled property is True and its HasFailed property is False. The broker automatically sets HasFailed to False when it is notified of a connection failure for that server.


TSimpleObjectBroker.GetPortForComputer

TSimpleObjectBroker	See also

Returns a port number for connecting to a specified remote server.

function GetPortForComputer(const ComputerName: string): Integer; virtual; abstract;

Description

Socket connection components call GetPortForComputer to get a value for their Port property. The ComputerName parameter specifies a Host name or IP address that was returned by GetComputerForGUID or GetComputerForProgID. This value is used to identify a server in the list maintained by the Servers property.


TSimpleObjectBroker.LoadFromStream

TSimpleObjectBroker	See also

Sets the value of the Servers property from a stream.

procedure LoadFromStream(Stream: TStream);

Description

Call LoadFromStream to load a list of available servers that has been previously saved using the SaveToStream method.


TSimpleObjectBroker.SaveToStream

TSimpleObjectBroker	See also

Saves the value of the Servers property to a stream.

procedure SaveToStream(Stream: TStream);

Description

Call SaveToStream to save the list of available servers. The servers can be restored later by calling the LoadFromStream method.


TSimpleObjectBroker.SetConnectStatus

TSimpleObjectBroker	See also

Records whether a connection was established to a specified server.

procedure SetConnectStatus(ComputerName: string; Success: Boolean); virtual; override;

Description

After calling GetComputerForGUID or GetComputerForProgID, connection components use the returned value to open a connection to the identified server. They then call SetConnectStatus to inform the broker of whether the connection was successfully opened.

SetConnectStatus sets the HasFailed property of the corresponding server to True if the connection was unsuccessful. It sets the HasFailed property to False if the connection was successful.

When the HasFailed property of a server is True, that server is ignored when the GetComputerForGUID or GetComputerForProgID method looks for available connections.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TCustomObjectBroker


TSQLResolver

Hierarchy	Properties	Methods	See also

TSQLResolver applies updates to a database server on behalf of a provider.

Unit

provider

Description

Provider components use TSQLResolver to apply updates from a client application directly to a database server when their ResolveToDataSet property is False. Otherwise, they use TDataSetResolver.

Do not create instances of TSQLResolver. Provider components create their own TSQLResolver objects for applying updates.


TSQLResolver properties

TSQLResolver	Alphabetically	Legend

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TSQLResolver properties

TSQLResolver	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TSQLResolver methods

TSQLResolver	Alphabetically

In TSQLResolver

Create

Destroy

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSQLResolver methods

TSQLResolver	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TSQLResolver.Create

TSQLResolver	See also

Creates and initializes an SQL resolver.

constructor Create(AProvider: TDataSetProvider); reintroduce;

Description

Provider components call Create when they need a resolver component for applying updates to a dataset. Most applications do not create resolver instances directly. Resolvers are designed to be created and used by providers, and can not function independently of a provider. Component writers generating custom providers descended from TDataSetProvider can create an SQLResolver component to generate SQL commands for applying updates and resolving update errors.

The AProvider parameter specifies the provider that creates and uses the resolver.


TSQLResolver.Destroy

TSQLResolver	See also

Destroys an instance of TSQLResolver.

destructor Destroy; override;

Description

Most applications should not delete instances of TSQLResolver. SQL resolvers are freed automatically by the provider components that use them.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TCustomResolver


TServerCollection

Hierarchy	Properties	Methods	See also

TServerCollection is a collection of TServerItem objects.

Unit

objbrkr

Description

TSimpleObjectBroker uses TServerCollection to represent the set of available application servers to which a client application can connect. Use the properties and methods of TServerCollection to manage the set of servers. For example, you can add items as new server systems come on line, disable server items when the corresponding system is temporarily out of commission, and so on.


TServerCollection properties

TServerCollection	Alphabetically	Legend

In TServerCollection

Items

Derived from TCollection

Count

ItemClass


TServerCollection properties

TServerCollection	By object	Legend

Count

ItemClass

Items


TServerCollection.Items

TServerCollection	See also

Lists the TServerItem objects in the collection.

property Items[Index: Integer]: TServerItem; default;

Description

Use Items to access individual TServerItem objects maintained by TServerCollection. Items is the default property of TServerCollection, so the name of the Items property can be left off when using this property. Thus the line

TSimpleObjectBroker1.Servers.Items[I].Enabled := False;

can be written

TSimpleObjectBroker.Servers[I].Enabled := False;


TServerCollection methods

TServerCollection	Alphabetically

In TServerCollection

Create

FindServer

GetBalancedName

GetNextName

Derived from TCollection

Add

Assign

BeginUpdate

Clear

Delete

Destroy

EndUpdate

FindItemID

GetNamePath

Insert

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TServerCollection methods

TServerCollection	By object

Add

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

FindItemID

FindServer

Free

FreeInstance

GetBalancedName

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetNextName

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TServerCollection.Create

TServerCollection	See also

Creates and initializes a TServerCollection object.

constructor Create(Owner: TComponent;

Description

Applications should not need to call the Create method directly.  The simple object broker that uses TServerCollection to manage its list of available servers creates this object from its own constructor.


TServerCollection.FindServer

TServerCollection	See also

Returns the server from the Items property array that has a specified computer name.

function FindServer(const ComputerName: string): TServerItem;

Description

Call FindServer to locate a server in the items property array given its ComputerName property. The ComputerName parameter specifies this computer name. Usually, this value is obtained by a previous call to GetBalancedName or GetNextName.

Note:	FindServer returns the first item it finds with the given ComputerName property. Unlike the GetBalancedName and GetNextName methods, it does not ignore servers that have failed or been disabled (HasFailed is True, or Enabled is False).


TServerCollection.GetBalancedName

TServerCollection	See also

Returns the ComputerName property of a randomly chosen server from the Items property array.

function GetBalancedName: string;

Description

Call GetBalancedName to get the name of an available server. Servers in the Items property array are considered available when no connection attempts have failed (HasFailed is False) and their Enabled property has not been set to False. GetBalancedName selects an available TServerItem at random from the Items property array and returns its ComputerName property.


TServerCollection.GetNextName

TServerCollection	See also

Returns the ComputerName property of an available server in the Items property array.

function GetNextName: string;

Description

Call GetNextName to get the name of an available server. Servers in the Items property array are considered available when no connection attempts have failed (HasFailed is False) and their Enabled property has not been set to False. GetNextName selects the first available TServerItem in the Items property array and returns its ComputerName property.

Note:	GetNextName always returns the same name as long as the servers’ HasFailed and Enabled properties do not change. To choose an available server at random, use GetBalancedName instead.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


TStatusColumn

Hierarchy	Properties	Methods	See also

TStatusColumn generates an HTML control that indicates whether a record in a data grid has been modified by the end user.

Unit

MidItems

Description

Add TStatusColumn as the child of a TDataGrid component to provide feedback about whether records in the grid have been modified. The generated control displays an M if the user has edited a record, an I if the user has inserted the record, and blank if the user has made no changes to the record.

Use the properties and methods of TStatusColumn to

Specify the caption that appears at the top of the column.

Customize the appearance of the control.

Fit the control into the tab order of the generated HTML form.


TStatusColumn properties

TStatusColumn	Alphabetically	Legend

Derived from TWebStatus

DisplayWidth

Derived from TWebDataDisplay

Caption

CaptionAttributes

CaptionPosition

Custom

Style

StyleRule

TabIndex

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TStatusColumn properties

TStatusColumn	By object	Legend

Caption

CaptionAttributes

CaptionPosition

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

DisplayWidth

Name

Owner

Style

StyleRule

TabIndex

Tag

VCLComObject


TStatusColumn methods

TStatusColumn	Alphabetically

In TStatusColumn

IsColumn

Derived from TWebStatus

Create

Identifier

Derived from TWebDataDisplay

Destroy

GetParentComponent

HasParent

IsQueryField

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStatusColumn methods

TStatusColumn	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

Identifier

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsColumn

IsQueryField

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TStatusColumn.IsColumn

TStatusColumn	See also

Indicates whether the component generates a control that can appear in the column of a data grid.

class function IsColumn: Boolean; override;

Description

Call IsColumn to detemine whether a Web item generates a control that represents a column in a data grid (TDataGrid). IsColumn returns True, because TStatusColumn is designed specifically for TDataGrid to use.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebDataDisplay

TWebStatus


TStreamedConnection

Hierarchy	Properties	Methods	Events	See also

TStreamedConnection is the base class for components that handle their own marshaling of interface calls when connecting to application servers.

Unit

sconnect

Description

Do not create instances of TStreamedConnection. Instead, instantiate a descendant of TStreamedConnection such as TSocketConnection or TWebConnection.

TStreamedConnection handles the marshaling of all COM data types so that the streamed connection component can generate, interpret, and respond to remote COM interface calls without using DCOM. It uses an ITransport interface to connect to application servers and to send and receive messages.

TStreamedConnection can’t actually connect to or communicate with an application server. Descendants of TStreamedConnection override the CreateTransport method to obtain an ITransport interface that enables these behaviors.

Interfaces

TStreamedConnection implements the ISendDataBlock interface.


TStreamedConnection properties

TStreamedConnection	Alphabetically	Legend

In TStreamedConnection

Handle

Interpreter

SupportCallbacks

Derived from TDispatchConnection

AppServer

Connected

ServerGUID

ServerName

Derived from TCustomConnection

DataSetCount

DataSets

LoginPrompt

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TStreamedConnection properties

TStreamedConnection	By object	Legend

AppServer

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Connected

DataSetCount

DataSets

DesignInfo

Handle

Interpreter

LoginPrompt

Name

Owner

ServerGUID

ServerName

SupportCallbacks

Tag

VCLComObject


TStreamedConnection.Handle

TStreamedConnection	See also

Provides access to an internal window handle that can receive messages from the transport layer.

type THandle = Integer;

property Handle: THandle;

Description

Streamed connection components perform all reading from and writing to the application server using a separate execution thread. This limits the impact that communication with the application server has on the speed of the client application, because execution does not need to wait while messages are marshaled and sent or received.

The internal thread that handles these communication tasks uses Windows messages to coordinate events. TStreamedConnection uses the Handle property to provide this internal thread with a window handle that it can use.


TStreamedConnection.Interpreter

TStreamedConnection	See also

Provides access to the helper object that marshals interface calls for the streamed connection.

property Interpreter: TDataBlockInterpreter;

Description

Streamed connection components use a data block interpreter internally to provide marshaling support.


TStreamedConnection.SupportCallbacks

TStreamedConnection	See also

Determines whether the streamed connection component can handle callbacks in the application server interface.

property SupportCallbacks: Boolean;

Description

Use SupportCallbacks to indicate whether the connection component can marshal callback functions in application server’s interface. When SupportCallbacks is True, the connection component can marshal calls from the application server to the client application over an interface supplied as a callback.

For TSocketConnection, callbacks are optional. Set SupportCallbacks to True if you are using callbacks as part of the application server’s interface. When SupportCallbacks is True, the socket connection component requires WinSock2. Set SupportCallbacks to False if you are not using callback functions and want to eliminate the dependency on WinSock2.

TWebConnection can’t support callback functions. It initializes SupportCallbacks to False in the constructor and never changes this value.


TStreamedConnection events

TStreamedConnection	Alphabetically	Legend

Derived from TDispatchConnection

OnGetUserName

Derived from TCustomConnection

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnLogin


TStreamedConnection events

TStreamedConnection	By object	Legend

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnGetUserName

OnLogin


TStreamedConnection methods

TStreamedConnection	Alphabetically	Legend

In TStreamedConnection

_AddRef

_Release

Create

CreateTransport

Destroy

DoConnect

DoDisconnect

DoError

GetServerList

InternalClose

InternalOpen

QueryInterface

Send

ThreadException

ThreadReceivedStream

WndProc

Derived from TDispatchConnection

GetServer

Derived from TCustomConnection

Close

Open

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStreamedConnection methods

TStreamedConnection	By object	Legend

_AddRef

_Release

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Create

CreateTransport

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DoConnect

DoDisconnect

DoError

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetServer

GetServerList

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

InternalClose

InternalOpen

MethodAddress

MethodName

NewInstance

Open

QueryInterface

RemoveComponent

SafeCallException

Send

ThreadException

ThreadReceivedStream

UpdateAction

WndProc


TStreamedConnection._AddRef

TStreamedConnection	See also

Increments an internal reference counter.

function _AddRef: Integer; stdcall;

Description

_AddRef implements the IUnknown interface method, AddRef, by incrementing an internal reference counter. The reference count is decreased by calling _Release.


TStreamedConnection._Release

TStreamedConnection	See also

Decrements an internal reference counter.

function _AddRef: Integer; stdcall;

Description

_Release implements the IUnknown interface method, Release, by decrementing an internal reference counter. The reference count is increased by calling _AddRef


TStreamedConnection.Create

TStreamedConnection	See also

Creates and initializes an instance of TStreamedConnection.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a streamed connection component at runtime. Connection components placed in forms or data modules at design time are instantiated automatically.

After calling the inherited constructor, Create instantiates the data block interpreter accessed by the Interpreter property.


TStreamedConnection.CreateTransport

TStreamedConnection	See also

Provides the backstop for a method that obtains an ITransport interface.

function CreateTransport: ITransport; virtual;

Description

Streamed connection components use an ITransport interface to connect to and communicate with the application server. As implemented in TStreamedConnection, CreateTransport always returns nil.

Descendants of TStreamedConnection override CreateTransport to obtain an ITransport  interface from a specialized helper object that connects to and communicates with the application server.

Component writers wanting to create connection components for specialized transport protocols need only override CreateTransport. Once the streamed connection has a working ITransport interface, all other functions of the connection component are handled automatically.


TStreamedConnection.Destroy

TStreamedConnection	See also

Disposes of a TStreamedConnection instance.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the streamed connection is not nil, and only then calls Destroy.

Destroy ensures that the connection to the server is closed. It then frees all resources and helper objects before calling the inherited destructor.


TStreamedConnection.DoConnect

TStreamedConnection	See also

Connects to an application server.

procedure DoConnect; override;

Description

DoConnect is called internally when the Connected property is set to True. DoConnect creates a separate thread for managing the connection so that communication with the application server does not block execution in the client application. Using the ITransport interface, DoConnect connects to the application server and sets the value of the AppServer property to its interface.

Note:	Descendants of TStreamedConnection should override CreateTransport rather than DoConnect to change the way the client application forms a connection to application servers.


TStreamedConnection.DoDisconnect

TStreamedConnection	See also

Disconnects from an application server.

procedure DoDisconnect; override;

Description

DoDisconnect is called internally when the Connected property is set to False. Using the ITransport interface, DoDisconnect drops the connection to the application server.


TStreamedConnection.DoError

TStreamedConnection	See also

Raises an exception for a specified exception object.

procedure DoError(E: Exception); virtual;

Description

TStreamedConnection uses a separate thread when making interface calls to the application server. When that thread encounters an exception, it sends a message to the Window handle specified by the Handle property. The connection component uses DoError to raise those exceptions.

Note:	DoError is called by the ThreadException method, which is the message handler for thread exceptions. It is also called when thread exception messages are taken from the message queue before they are received by the internal window procedure.


TStreamedConnection.GetServerList

TStreamedConnection	See also

Retrieves a list of registered data brokers from the remote server system.

function GetServerList: OleVariant; virtual;

Description

Call GetServerList to obtain a list of servers that are registered on the system to which the streamed connection communicates. GetServerList returns a Variant array or strings. Any of these strings can be used as a valid setting for the ServerName property.

At design time, TStreamedConnection uses the GetServerList method to populate the ServerName drop-down in the Object Inspector. Note that, unlike COM-based connection components (which populate that list with servers that are registered on the client machine), this results in a list of application servers that are registered on the server machine.


TStreamedConnection.InternalClose

TStreamedConnection	See also

Terminates a connection to the application server.

procedure InternalClose: OleVariant; virtual;

Description

Streamed connection components use InternalClose to handle the details of closing a connection to the application server. This method is called by the DoDisconnect method (which implements the Connected property) and at other times when the connection component must terminate a connection.


TStreamedConnection.InternalOpen

TStreamedConnection	See also

Opens a connection to the application server.

procedure InternalOpen: OleVariant; virtual;

Description

Streamed connection components use InternalOpen to handle the details of establishing a connection to the application server. This method is called by the DoConnect method (which implements the Connected property) and at other times when the connection component must establish a connection.


TStreamedConnection.QueryInterface

TStreamedConnection	See also

Implements the IUnknown QueryInterface method.

function QueryInterface(const IID: TGUID; out Obj): HResult; reintroduce; stdcall;

Description

QueryInterface returns a reference to the interface specified by the IID parameter as the Obj parameter. It the streamed connection supports the specified interface, QueryInterface returns 0. If the streamed connection does not support the interface, the Obj parameter is nil and QueryInterface returns E_NOINTERFACE.


TStreamedConnection.Send

TStreamedConnection	See also

Sends an interface call to the application server and returns the response.

function Send(const Data: IDataBlock; WaitForResult: Boolean): IDataBlock; stdcall;

Description

The data block interpreter (specified by the Interpreter property) calls Send to dispatch interface messages to the application server. It supplies an IDataBlock interface that encapsulates the interface from the application server.

Communication with the application server occurs on a separate thread. The WaitForResult parameter indicates whether execution on the main thread should halt until the interface call returns a result (WaitForResult = True), or whether the interface call can occur asynchronously (WaitForResult = False). If WaitForResult is True, Send returns an IDataBlock interface that supplies the result.


TStreamedConnection.ThreadException

TStreamedConnection	See also

Raises an exception for the thread that communicates with the application server.

procedure ThreadException(var Message: TMessage);

Description

TStreamedConnection uses a separate thread when making interface calls to the application server. When that thread encounters an exception, it sends a message to the Window handle specified by the Handle property. ThreadException is the message handler for that Windows message. It raises an exception in the main execution thread.


TStreamedConnection.ThreadReceivedStream

TStreamedConnection	See also

Handles callbacks from the application server.

procedure ThreadReceivedStream(var Message: TMessage);

Description

TStreamedConnection uses a separate thread for interface calls to and from the application server. When the application server calls a client application interface, that thread sends a message to the Window handle specified by the Handle property. ThreadReceivedStream is the message handler for the Windows message from the application server.

ThreadReceivedStream passes the interface call to the data block interpreter specified by the Interpreter property.


TStreamedConnection.WndProc

TStreamedConnection	See also

Dispatches messages from the transport layer.

procedure WndProc(var Message: TMessage);

Description

TStreamedConnection uses a separate thread for interface calls to and from the application server. That thread communicates with the streamed connection component by sending Windows messages to the handle specified by the Handle property. WndProc is the window procedure associated with that Window handle. It dispatches any messages that have message handlers such as ThreadException or ThreadReceivedStream. All other messages are ignored.


Scope

Published

Protected

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TStreamedConnection

TCustomRemoteServer

TDispatchConnection


TTextColumn

Hierarchy	Properties	Methods	See also

TTextColumn creates a single-line HTML input control to represent a field value in a data grid.

Unit

MidItems

Description

Add TTextColumn as the child of a TDataGrid component to add an edit control as the display control for a column. TTextColumn represents the value of a field in the TDataGrid’s associated dataset.

Use the properties and methods of TTextColumn to

Specify the field whose value the control displays.

Specify the caption that appears at the top of the column.

Customize the appearance of the edit control.

Fit the control into the tab order of the generated HTML form.


TTextColumn properties

TTextColumn	Alphabetically	Legend

Derived from TWebTextInput

DisplayWidth

ReadOnly

Derived from TWebDataInput

FieldName

Derived from TWebDataDisplay

Caption

CaptionAttributes

Custom

Style

StyleRule

TabIndex

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TTextColumn properties

TTextColumn	By object	Legend

Caption

CaptionAttributes

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

DisplayWidth

FieldName

Name

Owner

ReadOnly

Style

StyleRule

TabIndex

Tag

VCLComObject


TTextColumn methods

TTextColumn	Alphabetically

In TTextColumn

IsColumn

Derived from TWebTextInput

Create

Derived from TWebDataDisplay

Destroy

GetParentComponent

HasParent

IsQueryField

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTextColumn methods

TTextColumn	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsColumn

IsQueryField

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TTextColumn.IsColumn

TTextColumn	See also

Indicates whether the component generates a control that can appear in the column of a data grid.

class function IsColumn: Boolean; override;

Description

Call IsColumn to detemine whether a Web display component generates a control that represents a column in a data grid (TDataGrid). IsColumn returns True, because TTextColumn is designed specifically for TDataGrid to use.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebDataDisplay

TWebDataInput

TWebTextInput


TTextAreaColumn

Hierarchy	Properties	Methods	See also

TTextAreaColumn creates a multi-line HTML input control to represent a field value in a data grid.

Unit

MidItems

Description

Add TTextAreaColumn as the child of a TDataGrid component to add a multi-line edit control as the display control for a column. TTextAreaColumn represents the value of a field in the TDataGrid’s associated dataset.

Use the properties and methods of TTextAreaColumn to

Specify the field whose value the control displays.

Specify the caption that appears at the top of the column.

Customize the appearance of the control.

Fit the control into the tab order of the generated HTML form.


TTextAreaColumn properties

TTextAreaColumn	Alphabetically	Legend

Derived from TWebTextAreaInput

DisplayRows

DisplayWidth

ReadOnly

Wrap

Derived from TWebDataInput

FieldName

Derived from TWebDataDisplay

Caption

CaptionAttributes

Custom

Style

StyleRule

TabIndex

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TTextAreaColumn properties

TTextAreaColumn	By object	Legend

Caption

CaptionAttributes

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

DisplayRows

DisplayWidth

FieldName

Name

Owner

ReadOnly

Style

StyleRule

TabIndex

Tag

VCLComObject

Wrap


TTextAreaColumn methods

TTextAreaColumn	Alphabetically

IsColumn

Derived from TWebTextAreaInput

Create

Derived from TWebDataDisplay

Destroy

GetParentComponent

HasParent

IsQueryField

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTextAreaColumn methods

TTextAreaColumn	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsColumn

IsQueryField

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TTextAreaColumn.IsColumn

TTextAreaColumn	See also

Indicates whether the component generates a control that can appear in the column of a data grid.

class function IsColumn: Boolean; override;

Description

Call IsColumn to detemine whether a Web display component generates a control that represents a column in a data grid (TDataGrid). IsColumn returns True, because TTextAreaColumn is designed specifically for TDataGrid to use.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebDataDisplay

TWebDataInput

TWebTextAreaInput


TUndoButton

Hierarchy	Properties	Methods	See also

TUndoButton generates an HTML control that backs out changes to the current.

Unit

MidItems

Description

Add TUndoButton as the child of a TDataNavigator component (or a layout group that is a child of a TDataNavigator component) to enable the generated HTML form to undo edits made in an associated display control or controls. The resulting HTML button’s action backs out all edits to the current record.

Use the properties of TUndoButton to customize the appearance of the button and associate it with a Web item that generates the display controls.


TUndoButton properties

TUndoButton	Alphabetically	Legend

Derived from TDataSetButton

Caption

Derived from TXMLDisplayReferenceButton

XMLComponent

XMLUseParent

Derived from TWebButton

Custom

Style

StyleRule

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TUndoButton properties

TUndoButton	By object	Legend

Caption

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

XMLComponent

XMLUseParent


TUndoButton methods

TUndoButton	Alphabetically

In TUndoButton

Create

Derived from TXMLDisplayReferenceButton

Destroy

Derived from TWebButton

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TUndoButton methods

TUndoButton	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TUndoButton.Create

TUndoButton	See also

Creates and initializes an instance of TUndoButton.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TUndoButton at runtime. Buttons added at design time using the Web Page editor are instantiated automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebButton

TXMLDisplayReferenceButton

TDataSetButton


EUnsupportedTypeError

Hierarchy	Properties	Methods	See also

EUnsupportedTypeError is the exception class for failures that occur when adding dimensions to the cache of a decision cube.

Unit

mxarrays

Description

EUnsupportedTypeError is raised when an invalid field type is chosen as an active dimension in a decision cube. For example, making a dimension that corresponds to a BLOB field active raises an EUnsupportedTypeError.


EUnsupportedTypeError properties

EUnsupportedTypeError	Alphabetically

Derived from Exception

HelpContext

Message


EUnsupportedTypeError properties

EUnsupportedTypeError	By object

HelpContext

Message


EUnsupportedTypeError methods

EUnsupportedTypeError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EUnsupportedTypeError methods

EUnsupportedTypeError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


TUpdateTree

Hierarchy	Methods	See also

TUpdateTree stores information about a delta packet on behalf of a resolver.

Unit

provider

Description

When a client dataset applies its updates to the source dataset or database server, the provider that represents that dataset or server passes the updates to a resolver component. The resolver takes this delta data packet and builds a TUpdateTree to store the updates and information about them in a convenient form. In particular, the TUpdateTree structure allows a resolver to handle master/detail relationships (represented as nested dataset fields in the delta packet) so that updates are applied in the proper order.

Applications can’t use TUpdateTree directly. Most of the structured information about the delta packet is represented in protected properties that are only available to the resolver classes in the provider unit.


TUpdateTree methods

TUpdateTree	Alphabetically

In TUpdateTree

Create

Destroy

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TUpdateTree methods

TUpdateTree	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TUpdateTree.Create

TUpdateTree

Creates and initializes an instance of TUpdateTree.

constructor Create(AParent: TUpdateTree; AResolver: TCustomResolver);

Description

Applications do not need to call the TUpdateTree constructor. Update trees are created automatically by the resolver components that use them.

The AParent parameter specifies the TUpdateTree for the updates to a master table if this update tree represents a detail data set. If the TUpdateTree does not represent the updates to a detail dataset, AParent is nil.

The AResolver parameter specifies the resolver component that uses this update tree when applying updates. This parameter must be specified because the update tree calls some of this resolver’s methods.


TUpdateTree.Destroy

TUpdateTree 	See also

Destroys an instance of TUpdateTree.

destructor Destroy; override;

Description

Applications do not need to free TUpdateTree instances. Update trees are freed by the resolver components that use them.


Hierarchy

TObject


TValueArray

Hierarchy	Properties	Methods	See also

TValueArray is a dynamically resizeable array of 16-bit integers.

Unit

mxarrays

Description

Use TValueArray to represent an array of short integers when the number of elements in the array is unknown. For example, decision cubes use TValueArray objects to represent the coordinates of a cell in the multidimensional cache of summary values.


TValueArray properties

TValueArray	Alphabetically	Legend

Derived from TSmallIntArray

Items

Derived from TBaseArray

AutoSize

Capacity

CompareProc

Count

Duplicates

ItemSize

Limit

List

SortOrder


TValueArray properties

TValueArray	By object	Legend

AutoSize

Capacity

CompareProc

Count

Duplicates

Items

ItemSize

Limit

List

SortOrder


TValueArray methods

TValueArray	Alphabetically

Derived from TSmallIntArray

Add

Assign

Create

GetItem

PutItem

Derived from TBaseArray

Clear

Delete

Destroy

Exchange

FindItem

IndexOf

Insert

InsertAt

RemoveItem

Sort

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TValueArray methods

TValueArray	By object

Add

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

Exchange

FieldAddress

FindItem

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetItem

GetNamePath

IndexOf

InheritsFrom

InitInstance

Insert

InsertAt

InstanceSize

MethodAddress

MethodName

NewInstance

PutItem

RemoveItem

SafeCallException

Sort


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TBaseArray


TWebButton

Hierarchy	Properties	Methods	See also

TWebButton is the base class for Web items that create HTML button controls.

Unit

MidItems

Description

Use TWebButton as a base class for components that generate the HTML statements defining a specialized button control. TWebButton introduces the properties and methods for

Generating the HTML code to define the button control.

Defining a button caption.

Specifying tag attributes of the HTML button control, including those defined by a style sheet.

Fitting the component into a hierarchy of Web items, each of which generates part of a larger HTML document.

In order to allow other Web items to use the HTML generated by the button control, TWebButton implements the IWebContent interface.

Do not create instances of TWebButton. TWebButton relies on an abstract method to generate the HTML statements defining a button control. Trying to use an instance of TWebButton will lead to an EAbstractError exception. Instead, create descendants of TWebButton that represent buttons with specific purposes.


TWebButton properties

TWebButton	Alphabetically	Legend

In TWebButton

Caption

Custom

Style

StyleRule

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TWebButton properties

TWebButton	By object	Legend

Caption

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject


TWebButton.Caption

TWebButton	See also

Specifies the caption that appears on the button.

property Caption: string;

Description

Use Caption to specify the caption that appears on the generated HTML button. The value of Caption is used as the value of a VALUE parameter on the HTML INPUT tag generated to implement the button.


TWebButton.Custom

TWebButton	See also

Represents a tag option and its value in the generated INPUT tag.

property Custom: string;

Description

Use Custom to represent one or more options that qualify the INPUT tag generated by the Web button. Each option and its value has the form

OPTIONNAME=Value

The options specified by Custom should be separated by spaces. For example, to add an ALIGN option that aligns the caption and a TABINDEX tag to control tab order, set Custom to

ALIGN=TOP TABINDEX=2


TWebButton.Style

TWebButton	See also

Adds style attributes to the generated button control.

property Style: string;

Description

Use Style to add a STYLE option that qualifies the INPUT tag generated by the Web button. The Style option consists of one or more attribute descriptions such as

font-family: arial; font-weight: bold; font-size: 10px

These attributes are added to the generated INPUT tag as the value of a STYLE option.


TWebButton.StyleRule

TWebButton	See also

Applies a style in the page producer’s style sheet to the button.

property StyleRule: string;

Description

Use StyleRule to assign one of the user-defined styles in the HTML document’s style sheet to the generated button control. The value of StyleRule specifies one of the user-defined style names defined in the MIDAS page producer’s Styles or StylesFile property.

Note:	To apply a style definition that is not included in the style sheet, use the button’s Style property.


TWebButton methods

TWebButton	Alphabetically	Legend

In TWebButton

AddElements

Content

Create

Destroy

GetCaption

GetContainer

GetHTMLForm

GetIndex

GetLayoutAttributes

GetParentComponent

GetSubComponents

HasParent

ImplAddElements

ImplContent

ReadState

SetComponentList

SetContainer

SetIndex

SetParentComponent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWebButton methods

TWebButton	By object	Legend

AddElements

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Content

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetCaption

GetContainer

GetHTMLForm

GetIndex

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetLayoutAttributes

GetNamePath

GetParentComponent

GetSubComponents

HasParent

ImplAddElements

ImplContent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

ReadState

RemoveComponent

SafeCallException

SetComponentList

SetContainer

SetIndex

SetParentComponent

UpdateAction


TWebButton.AddElements

TWebButton	See also

Used internally to generate any javascript declarations needed by the button.

procedure AddElements(AddIntf: IAddScriptElements);

Description

The MIDAS page producer calls AddElements when it generates the block of javascript declarations in its HTML document. This method allows the generated button to call javascript methods when the user clicks it by ensuring that the required methods are declared.

AddElements calls on the virtual ImplAddElements method, which uses the provided interface to return javascript declarations. Each TWebButton descendant overrides ImplAddElements to add any declarations it needs.


TWebButton.Content

TWebButton	See also

Returns the HTML that defines the button control.

function Content(Options: TWebContentOptions; ParentLayout: TLayout): string;

Description

Content implements the IWebContent method of the same name. This method allows the Web button’s parent to extract the HTML defining the button.

Content calls the virtual ImplContent method to provide the content it returns. Each TWebButton descendant overrides ImplContent to generate the definition of its particular button control. The generated HTML can make use of any javascript declarations supplied by the AddElements method.

Options contains a set of flags that limit what can be included in the generated HTML.

ParentLayout specifies a helper object that the caller supplies for determining how the Web button should format the HTML control it generates.

Content returns a string of HTML defining the button control.


TWebButton.Create

TWebButton	See also

Creates and initializes an instance of TWebButton.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a Web button at runtime. Web buttons added at design time using the Web Page editor are instantiated automatically.


TWebButton.Destroy

TWebButton

Frees an instance of TWebButton.

destructor Destroy; override;

Description

Destroy removes the Web button from its parent’s list of components that generate HTML before freeing the button instance.


TWebButton.GetCaption

TWebButton	See also

Returns the value of the Caption property.

function GetCaption: string; virtual;

Description

GetCaption is the protected read implementation for the Caption property.


TWebButton.GetContainer

TWebButton	See also

Returns the component that uses the Web button to generate part of its own HTML..

function GetContainer: TWebComponentContainer;

Description

GetContainer implements the IWebComponent method of the same name. By implementing the IWebComponent interface, TWebButton can fit into a hierarchy of Web items, each of which generates part of a larger HTML document.

GetContainer returns the component that uses the HTML button which the TWebButton descendant generates.


TWebButton.GetHTMLForm

TWebButton	See also

Used internally to retrieve information about the HTML form in which the button control is defined.

function GetHTMLForm: IHTMLForm;

Description

TWebButton and its descendants use GetHTMLForm to obtain information about the form in which the generated button appears. This information is used to generate code for calling a form method when the user clicks the button.

GetHTMLForm walks up the hierarchy of Web items (using the GetParentComponent method) until it finds a component that can supply an interface for the HTML form.


TWebButton.GetIndex

TWebButton	See also

Returns the position of the button in its parent’s list of Web items.

function GetIndex: Integer;

Description

GetIndex implements the IWebComponent method of the same name. By implementing the IWebComponent interface, TWebButton can fit into a hierarchy of Web items, each of which generates part of a larger HTML document.

GetIndex returns the position of the button in its parent’s WebFieldControls property. The parent supplies this value using the SetIndex method.


TWebButton.GetLayoutAttributes

TWebButton	See also

Returns the layout object that specifies how the generated control should look.

function GetLayoutAttributes: TLayoutAttributes; virtual;

Description

GetLayoutAttributes is used internally by Web items to allow the layout object supplied by a parent (as a parameter to the Content method) to take into account layout properties of the child component.

As implemented by TWebButton, GetLayoutAttributes returns nil, because the layout of buttons does not make use of layout attributes.


TWebButton.GetParentComponent

TWebButton	See also

Returns the Web item that uses this component to generate HTML.

function GetParentComponent: TComponent; override;

Description

TWebButton overrides the GetParentComponent method that is introduced in TComponent for the streaming system that loads and saves VCL components. It returns the Web item that uses the HTML generated by the Web button when assembling its own portion of the HTML document.


TWebButton.GetSubComponents

TWebButton	See also

Returns any components that generate HTML for the Web button.

function GetSubComponents: TObject;

Description

GetSubComponents returns any Web items that generate HTML which the TWebButton descendant uses when creating its own content. This method is part of the mechanism that fits TWebButton into a hierarchy of Web items, each of which generates part of a larger HTML document.

As implemented in TWebButton, GetSubComponents returns nil, because TWebButton does not rely on any other Web items when generating its content.


TWebButton.HasParent

TWebButton	See also

Indicates whether the Web button generates its HTML on behalf of another component.

function HasParent: Boolean; override;

Description

TWebButton overrides the HasParent method that is introduced in TComponent for the streaming system that loads and saves VCL components. It returns True if there is a Web item that uses the HTML generated by the Web button when assembling its own portion of the HTML document.

If the Web button has a parent, that parent component is responsible for writing the Web button to a stream.


TWebButton.ImplAddElements

TWebButton	See also

Provides the underlying implementation for the AddElements method.

procedure ImplAddElements(AddIntf: IAddScriptElements); virtual;

Description

The AddElements method calls ImpleAddElements to add any javascript declarations by calling the AddIntf interface. These declarations allow the generated button to call javascript methods when the user clicks it by ensuring that the required methods are declared.

As implemented in TWebButton, ImplAddElements does nothing. TWebButton descendants override ImplAddElements to add any required declarations.


TWebButton.ImplContent

TWebButton	See also

Provides the underlying implementation for the Content method.

function Content(Options: TWebContentOptions; ParentLayout: TLayout): string; virtual; abstract;

Description

The Content method calls ImplContent to generate the HTML that defines the button control. TWebButton introduces ImplContent as an abstract method. TWebButton descendants must override ImplContent to generate the definition of their particular button control. The generated HTML can make use of any javascript declarations supplied by the AddElements method.

Options contains a set of flags that limit what can be included in the generated HTML.

ParentLayout specifies a helper object that the caller supplies for determining how the Web button should format the HTML control it generates.

ImplContent returns a string of HTML defining the button control.


TWebButton.ReadState

TWebButton	See also

Reads the component’s published properties, stored data, and owned components from a reader object.

procedure ReadState(Reader: TReader); override;

Description

ReadState is part of a sequence of calls used by the streaming system that loads and saves VCL components.  It reads the values of all the component's published properties, stored data, and owned components from the reader object passed in Reader. Do not call ReadState directly.

TWebButton overrides ReadState to obtain the TWebButton object’s parent component from the reader.

Note:	Any descendant classes overriding ReadState should end with a call to the inherited ReadState method.


TWebButton.SetComponentList

TWebButton	See also

Informs the component of the TWebComponentList object that contains it.

procedure SetComponentList(List: TObject);

Description

SetComponentList implements the IWebComponent method of the same name. By implementing the IWebComponent interface, TWebButton can fit into a hierarchy of Web items, each of which generates part of a larger HTML document.

SetComponentList saves a reference to the supplied list internally, so that it is available to the TWebButton component. This list is the TComponentList object that implement’s its parent’s WebFieldControls property.


TWebButton.SetContainer

TWebButton	See also

Informs the Web button of the component that uses it to generate part of its own HTML.

procedure SetContainer(Container: TWebComponentContainer);

Description

SetContainer implements the IWebComponent method of the same name. By implementing the IWebComponent interface, TWebButton can fit into a hierarchy of Web items, each of which generates part of a larger HTML document.

SetContainer stores a reference to the Web item passed as the Container parameter. This is the component that uses the TWebButton to generate part of its own HTML.


TWebButton.SetIndex

TWebButton	See also

Informs the Web button of where it falls in its parent’s list of Web items.

procedure SetIndex(Value: Integer);

Description

SetContainer implements the IWebComponent method of the same name. By implementing the IWebComponent interface, TWebButton can fit into a hierarchy of Web items, each of which generates part of a larger HTML document.

SetIndex stores a reference to where the TWebButton falls in its parent’s WebFieldControls property list.


TWebButton.SetParentComponent

TWebButton	See also

Stores the Web item that uses this component to generate HTML.

procedure SetParentComponent(AParent: TComponent); override;

Description

TWebButton overrides the SetParentComponent method that is introduced in TComponent for the streaming system that loads and saves VCL components. It sets the parent of the Web button to the component specified as the AParent parameter.


Scope

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent


TWebComponentList

Hierarchy	Properties	Methods	See also

TWebComponentList maintains a list of Web item components.

Unit

WebComp

Description

TWebComponentList provides the structure for the hierarchy of Web items that generate HTML documents in a MIDAS Web application. At the top of the hierarchy is a TMidasPageProducer component, which assembles an HTML document that displays data from an application server and allows Web browsers to navigate, edit, and update that data. To assemble this document, TMidasPageProducer uses a set of helper components, each of which generates a portion of the final HTML. Each of these components, in turn, uses one or more helper components to generate a portion of its HTML, and so on. Each component that uses helper components to generate HTML maintains a list of its helper components. That list is a TWebComponentList object.

Each component in the list must support the IWebComponent interface. TWebComponentList uses this interface to coordinate the objects it manages. In addition, the components in the list should support the IWebContent interface. IWebContent allows the parent component to extract HTML generated by its children.

Use the properties and methods of TWebComponentList to

Add or delete the components in the list.

Locate and access components in the list.

Rearrange components in the list.

Access the parent component that uses the list.


TWebComponentList properties

TWebComponentList	Alphabetically	Legend

In TWebComponentList

Count

ParentComponent

WebComponents


TWebComponentList properties

TWebComponentList	By object	Legend

Count

ParentComponent

WebComponents


TWebComponentList.Count

TWebComponentList	See also

Indicates the number of components in the list.

property Count: Integer;

Description

Read Count to determine the number of components in the WebComponents array. Count is a read-only property. To change the size of the WebComponents array, add or remove components using the Add and Remove methods.


TWebComponentList.ParentComponent

TWebComponentList	See also

Identifies the component that uses this Web component list to maintain its Web Items.

property ParentComponent: TComponent;

Description

Read ParentComponent to access the parent of the Web Items in the list. The value of ParentComponent is assigned in the constructor when the parent first instantiates the Web component list.


TWebComponentList.WebComponents

TWebComponentList	See also

Lists the Web items in the list.

property WebComponents[Index: Integer]: TComponent; default;

Description

Use WebComponents to access the Web components listed by TWebComponentList. Use WebComponents with the Count property to iterate through all of the components in the list. Use the Add or Remove method to add or remove components from the list.

WebComponents is the default property for TWebComponentList. This means that the property name can be omitted when accessing a component in the list. Thus, the line

WebItem := MidasPageProducer1.WebPageItems.WebComponents[0];

can be written

WebItem := MidasPageProducer1.WebPageItems[0];


TWebComponentList methods

TWebComponentList	Alphabetically

In TWebComponentList

Add

Clear

Create

Destroy

IndexOf

Remove

SetComponentIndex

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TWebComponentList methods

TWebComponentList	By object

Add

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

IndexOf

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Remove

SafeCallException

SetComponentIndex


TWebComponentList.Add

TWebComponentList	See also

Inserts a new component at the end of the list.

procedure Add(Component: TComponent);

Description

Call Add to insert a component at the end of the WebComponents array.

Add increments the Count property. After calling Add, the value of Count is one greater than the index of the inserted component in the WebComponents array. To move this component to another position, use the SetComponentIndex method.


TWebComponentList.Clear

TWebComponentList	See also

Deletes all components from the list.

procedure Clear;

Description

Call Clear to empty the WebComponents array and set Count to 0.


TWebComponentList.Create

TWebComponentList

Creates and initializes new TWebComponentList object.

constructor Create(AParentComponent: TComponent);

Description

Call Create to instantiate TWebComponentList at runtime. Most applications do not need to instantiate TWebComponentList. Instead, the Web items that use TWebComponentList to manage their own Web items instantiate a TWebComponentList from their constructors.


TWebComponentList.Destroy

TWebComponentList	See also

Frees an instance of TWebComponentList.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead, call Free. Free verifies that the TWebComponentList reference is not nil, and only then calls Destroy.

Destroy frees the memory used to store the list of WebComponents.

Note:	Destroy does not free the components in the list.


TWebComponentList.IndexOf

TWebComponentList	See also

Returns the index of a specified component in the WebComponents array.

function IndexOf(Component: TComponent): Integer;

Description

Call IndexOf to get the index for a component in the WebComponents array. Specify the desired component as the Component parameter.

The first component in the array has index 0, the second component has index 1, and so on. If a component is not in the list, IndexOf returns -1. If a component appears more than once in the array, IndexOf returns the index of the first appearance.


TWebComponentList.Remove

TWebComponentList	See also

Removes a component from the WebComponents array.

procedure Remove(Component: TComponent);

Description

Call Remove to remove a specific component from the WebComponents array. After a component is removed, all the WebComponents that follow it are moved up in index position and Count is reduced by one.


TWebComponentList.SetComponentIndex

TWebComponentList	See also

Moves a component to a new position in the WebComponents array.

procedure SetComponentIndex(Component: TComponent; Value: Integer);

Description

Call SetComponentIndex to move a component to a new position in the list. Component specifies the component to move. Value specifies the index it should have after it is moved. If Value is less than 0, the component is moved to the first position. If Value is greater than or equal to count, the component is moved to the last position.


Accessibility

Read-only


Hierarchy

TObject


 TWebConnection

Hierarchy	Properties	Methods	Events	See also

TWebConnection uses HTTP to manage the connection to an application server.

Unit

sconnect

Description

TWebConnection is used in the client portion of a multi-tiered database application to establish and maintain the connection between the client and a remote application server. The Web connection object can

Establish an initial connection to a remote application server.

Obtain an IAppServer for the application server.

Obtain a list of providers on the application server.

Drop the connection to the remote application server.

TWebConnection establishes the initial connection between the client application and a remote application server using HTTP. To use TWebConnection, you must have the following:

Wininet.dll must be installed on the client system. Wininet.dll is found in the Windows system directory if you have IE3 or higher installed.

The server system must have IIS version 4 or better or Netscape enterprise version 3.6 or better.

HTTPsrvr.dll must be installed with the Web server to which TWebConnection forms a connection. HTTPsrvr.dll launches the application server and marshals all calls to the application server interface. It ships with Delphi.

Once the connection is established, the client registers any or all of its client datasets, and these client datasets use the IAppServer interface from the socket connection component to communicate with providers on the application server, or to otherwise call the application server’s data module interface.

To connect to remote application servers using DCOM, use the TDCOMConnection component instead. To connect to remote application servers using TCP/IP, use the TSocketConnection component instead. To connect to remote application servers using CORBA, use the TCORBAConnection component.


TWebConnection properties

TWebConnection	Alphabetically	Legend

In TWebConnection

Agent

Password

Proxy

ProxyByPass

URL

UserName

Derived from TDispatchConnection

AppServer

Connected

ObjectBroker

ServerGUID

ServerName

Derived from TCustomConnection

DataSetCount

DataSets

LoginPrompt

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TWebConnection properties

TWebConnection	By object	Legend

Agent

AppServer

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Connected

DataSetCount

DataSets

DesignInfo

LoginPrompt

Name

ObjectBroker

Owner

Password

Proxy

ProxyByPass

ServerGUID

ServerName

Tag

URL

UserName

VCLComObject


TWebConnection.Agent

TWebConnection	See also

Provides the value of the User-Agent header for HTTP messages to the server.

property Agent: string;

Description

Use Agent to supply HTTP messages generated by the Web connection component with the name of your application. This name is included as a User-Agent header. The User-Agent header is an optional string that describes the application generating the HTTP message.


TWebConnection.Password

TWebConnection	See also

Specifies the password that allows the client application to log on to the application server.

property Password: string;

Description

When the Web connection component connects to the application server, it supplies the values of the UserName and Password properties so that it can log on to the host or proxy. The value of Password can be an empty string if neither the host nor proxy requires authentication.


TWebConnection.Proxy

TWebConnection	See also

Lists any proxy servers that are required to make the connection.

property Proxy: string;

Description

Use Proxy if the Web connection component can’t resolve the value of Host locally. If the server is registered locally, Proxy can be a null string. Otherwise, Proxy lists the host names of any proxy servers that can forward request messages on to the intended server machine.


TWebConnection.ProxyByPass

TWebConnection	See also

Lists the host names of locally registered servers that do not require a proxy.

property ProxyByPass: string;

Description

Use ProxyByPass to indicate any server systems to which the Web connection component can make a direct connection. When the Host property specifies a server in this list, the Web connection component makes a direct connection even if the Proxy property is specified.

When ProxyByPass is an empty string, the Web connection component checks the registry for any locally known servers and bypasses the proxy server if Host refers to a registered local server.


TWebConnection.URL

TWebConnection	See also

Specifies the Uniform Resource Locator for httpsrvr.dll on the server system.

property URL: string;

Description

Use URL to specify the Uniform Resource Locator that the Web connection component uses to locate httpsrvr.dll. This DLL, which ships with Delphi in the BIN directory, is deployed on the same machine as the Web server so that it can accept HTTP request messages and convert them into COM calls that communicate with the application server.

URL includes the protocol (http or https), host name, and scriptname for httpsrvr.dll. Typically, it has the form

http://MIDASHost.org/scripts/httpsrvr.dll

Note:	URL is a standard Uniform Resource Locator. As such, you can also use it to override the port associated with http (80) or https (443) if the Web server is configured differently. The port number follows the host name, preceded by a colon.


TWebConnection.UserName

TWebConnection	See also

Specifies the user name that allows the client application to log on to the application server.

property UserName: string;

Description

When the Web connection component connects to the application server on a local host or to the proxy server, it supplies the values of the UserName and Password properties so that it can log in. If neither the host nor the proxy server requires authentication, UserName can be an empty string.


TWebConnection events

TWebConnection	Alphabetically	Legend

Derived from TDispatchConnection

OnGetUserName

Derived from TCustomConnection

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnLogin


TWebConnection events

TWebConnection	By object	Legend

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnGetUserName

OnLogin


TWebConnection methods

TWebConnection	Alphabetically

In TWebConnection

Create

Destroy

Derived from TDispatchConnection

GetServer

Derived from TCustomConnection

Close

Open

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWebConnection methods

TWebConnection	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetServer

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Open

RemoveComponent

SafeCallException

UpdateAction


TWebConnection.Create

TWebConnection	See also

Creates and initializes an instance of TWebConnection.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TWebConnection object at runtime. Web connection components added to forms or data modules at design time are created automatically.

The AOwner parameter specifies the component (usually a form or data module) that is responsible for freeing the Web connection component.


TWebConnection.Destroy

TWebConnection

Destroys an instance of TWebConnection.destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, use the Free method, which checks that the Web connection is not nil before calling Destroy.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomConnection

TCustomRemoteServer

TDispatchConnection

TStreamedConnection


TWebContentOptions

Hierarchy	Properties	Methods	See also

TWebContentOptions controls what a Web item can include in its generated HTML.

Unit

WebComp

Description

Use TWebContentOptions to influence the HTML generated by a component that supports the IWebContent interface. Each TWebContentOptions represents a set of flags that are passed to the constructor.


TWebContentOptions properties

TWebContentOptions	Alphabetically	Legend

In TWebContentOptions

Flags


TWebContentOptions properties

TWebContentOptions	By object	Legend

Flags


TWebContentOptions.Flags

TWebContentOptions	See also

Lists the flags that indicate what type of generated HTML is permitted.

type

  TWebContentFlag = (coNoScript, coLocalPaths);

  TWebContentFlags = set of TWebContentFlag;

property Flags: TWebContentFlags;

Description

Read Flags to determine what types of HTML a Web item can generate. Flags is a set that contains zero or more of the following:

Value	Meaning

coNoScript	The generated HTML can’t contain any javascript.

coLocalPaths	The generated HTML can use local paths to included resources rather than requiring URLs. This option is for HTML documents that are only viewed on the same machine as the included resources.


TWebContentOptions methods

TWebContentOptions	Alphabetically

In TWebContentOptions

Create

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TWebContentOptions methods

TWebContentOptions	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TWebContentOptions.Create

TWebContentOptions	See also

Creates a new TWebContentOptions object.

constructor Create(AFlags: TWebContentFlags);

Description

Call Create to create a TWebContentOptions instance at runtime. Pass the flags that the object should represent as the value of the AFlags parameter. This value initializes the Flags property.


Accessibility

Read-only


Hierarchy

TObject


TWebControlGroup

Hierarchy	Properties	Methods	See also

TWebControlGroup is the base class for Web items that arrange HTML controls.

Unit

MidItems

Description

Use TWebControlGroup as a base class for components that generate organized portions of the HTML document containing one or more related HTML controls.  TWebControlGroup introduces the properties and methods for managing a collection of Web items that generate the HTML controls that make up the group.

In order to let other Web items to use the HTML that defines the organized collection of controls, TWebControlGroup implements the IWebContent interface.

Do not create instances of TWebControlGroup. TWebControlGroup manages the Web items that generate HTML defining controls, but does not combine the generated content into any content of its own. Instead, use a descendant of TWebControlGroup that generates the HTML for its set of specialized controls. These descendants include TDataNavigator, TQueryButtons, TDataGrid, TFieldGroup, and TQueryFieldGroup.


TWebControlGroup properties

TWebControlGroup	Alphabetically	Legend

In TWebControlGroup

WebFieldControls

DefaultWebComponents

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TWebControlGroup properties

TWebControlGroup	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DefaultWebComponents

DesignInfo

Name

Owner

Tag

VCLComObject

WebFieldControls


TWebControlGroup.DefaultWebComponents

TWebControlGroup	See also

Specifies the default value of the WebFieldControls property when that property is not explicitly set.

property DefaultWebComponents: TWebComponentList;

Description

Most TWebControlGroup descendants have a default set of values for the WebFieldControls property. For example, TDataNavigator has a default set of buttons and TFieldGroup defaults to a control for each field in the associated data packet. TWebControlGroup descendants that supply default sets of Web items store these default sets as the value of the protected DefaultWebComponents property. Then, if the value of WebFieldControls is not set, the TWebControlGroup descendant uses DefaultWebComponents instead.


TWebControlGroup.WebFieldControls

TWebControlGroup	See also

Lists the components that generate HTML controls for the Web control group.

property WebFieldControls: TWebComponentList;

Description

WebFieldControls lists the components that generate the related HTML controls that the Web control group assembles into a single unit. Each of these components supports the IWebContent interface, and some can contain their own list of Web items that help them generate their content.

The type of items that can be added to the WebFieldControls list are restricted by the CanAddClass method. TWebControlGroup does not restrict the items in the list at all, but descendant classes add restrictions to limit the list to related types of controls. For example, TDataNavigator limits the list to button generators that are descendants of TDataSetButton or TXMLButton.

At design time, add components to the WebFieldControls property by bringing up the Web page editor for the containing MidasPageProducer component. Select the Web control group in the editor, and use the editor to add child controls.


TWebControlGroup methods

TWebControlGroup	Alphabetically	Legend

In TWebControlGroup

AddElements

CanAddClass

Content

Create

Destroy

GetChildren

GetComponentList

GetContainer

GetDefaultComponentList

GetIndex

GetLayoutAttributes

GetParentComponent

GetSubComponents

HasParent

ImplAddElements

ImplCanAddClass

ImplContent

ImplGetSubComponents

ReadState

SetChildOrder

SetComponentList

SetContainer

SetIndex

SetParentComponent

SetWebParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWebControlGroup methods

TWebControlGroup	By object	Legend

AddElements

AfterConstruction

Assign

BeforeDestruction

CanAddClass

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Content

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetChildren

GetComponentList

GetContainer

GetDefaultComponentList

GetIndex

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetLayoutAttributes

GetNamePath

GetParentComponent

GetSubComponents

HasParent

ImplAddElements

ImplCanAddClass

ImplContent

ImplGetSubComponents

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

ReadState

RemoveComponent

SafeCallException

SetChildOrder

SetComponentList

SetContainer

SetIndex

SetParentComponent

SetWebParent

UpdateAction


TWebControlGroup.AddElements

TWebControlGroup	See also

Used internally to generate any javascript declarations needed by the group of controls.

procedure AddElements(AddIntf: IAddScriptElements);

Description

The MIDAS page producer calls AddElements when it generates the block of javascript declarations in its HTML document. This method allows the generated group of controls to use javascript classes and methods.

AddElements calls on the virtual ImplAddElements method, which uses the provided interface to return javascript declarations. Each TWebControlGroup descendant overrides ImplAddElements to add any declarations it needs.


TWebControlGroup.CanAddClass

TWebControlGroup	See also

Specifies whether a Web item of a specified type can be added to the WebFieldControls property list.

type TClass = class of TObject;

function CanAddClass(AParent: TComponent; AClass: TClass): Boolean;

Description

The Web page editor calls CanAddClass to determine what Web items can be added to supply content for the TWebControlGroup descendant. CanAddClass calls the virtual ImplCanAddClass method to determine whether a class of Web item is valid.

AParent is the TWebControlGroup descendant to whose WebFieldControls property the Web item will be added.

AClass is the class of the proposed child Web item.

CanAddClass returns True if the TWebControlGroup descendant can use content generated by a component of type AClass, False otherwise.


TWebControlGroup.Content

TWebControlGroup	See also

Returns the HTML that defines the group of HTML controls.

function Content(Options: TWebContentOptions; ParentLayout: TLayout): string;

Description

Content implements the IWebContent method of the same name. This method allows the TWebControlGroup object’s parent to extract the HTML that defines and lays out a set of controls.

Content calls the virtual ImplContent method to provide the HTML it returns. Each TWebControlGroup descendant overrides ImplContent to generate its particular group of controls. The generated HTML can make use of any javascript declarations supplied by the AddElements method.

Options contains a set of flags that limit what can be included in the generated HTML.

ParentLayout specifies a helper object that the caller supplies for determining how the component should format the HTML it generates.

Content returns a string of HTML defining the group of controls.


TWebControlGroup.Create

TWebControlGroup	See also

Creates and initializes an instance of TWebControlGroup.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TWebControlGroup at runtime. TWebControlGroup descendants added at design time using the Web Page editor are instantiated automatically.


TWebControlGroup.Destroy

TWebControlGroup

Frees an instance of TWebControlGroup.

destructor Destroy; override;

Description

Destroy removes the Web control group from its parent’s list of components that generate HTML before freeing its own resources.


TWebControlGroup.GetChildren

TWebControlGroup	See also

Executes a callback for each component in the WebFieldControls property list.

procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;

Description

TWebControlGroup overrides the GetChildren method that is introduced in TComponent for the streaming system that loads and saves VCL components. It executes the Proc procedure for each child component listed in the WebFieldControls property so that it is loaded and saved with the TWebControlGroup component.


TWebControlGroup.GetComponentList

TWebControlGroup	See also

Returns the value of the WebFieldControls property.

function GetComponentList: TObject;

Description

Children of TWebControlGroup call GetComponentList to access the TWebComponentList object that implements the WebFieldControls property.


TWebControlGroup.GetContainer

TWebControlGroup	See also

Returns the Web item that uses TWebControlGroup to generate a group of HTML controls.

function GetContainer: TWebComponentContainer;

Description

GetContainer implements the IWebComponent method of the same name. By implementing the IWebComponent interface, TWebControlGroup can fit into a hierarchy of Web items, each of which generates part of a larger HTML document.

GetContainer returns the Web item that uses the HTML returned by the Content method. Typically, this is a TDataForm or TQueryForm component, but it may also be a TWebControlGroup descendant such as TLayoutGroup.


TWebControlGroup.GetDefaultComponentList

TWebControlGroup	See also

Returns the value of the DefaultWebComponents property.

function GetDefaultComponentList: TObject;

Description

GetDefaultComponentList is used internally to retrieve a default value for the WebFieldControls property. Most TWebControlGroup descendants create a set of default Web items which generate the controls in the group. These may generate, for example, all the fields in a dataset or all the possible buttons in a button group.

GetDefaultComponentList returns a TWebComponentList object containing the default Web items.


TWebControlGroup.GetIndex

TWebControlGroup	See also

Returns the position of the TWebControlGroup component in its parent’s list of Web items.

function GetIndex: Integer;

Description

GetIndex implements the IWebComponent method of the same name. By implementing the IWebComponent interface, TWebControlGroup can fit into a hierarchy of Web items, each of which generates part of a larger HTML document.

GetIndex returns the position of the TWebControlGroup component in its parent’s WebPageItems property. The parent supplies this value using the SetIndex method.


TWebControlGroup.GetLayoutAttributes

TWebControlGroup	See also

Returns an object that specifies how the generated group of controls should look.

function GetLayoutAttributes: TLayoutAttributes; virtual;

Description

GetLayoutAttributes is used internally by Web items to allow the layout object supplied by a parent (as a parameter to the Content method) to take into account layout properties of the child component.

As implemented by TWebControlGroup, GetLayoutAttributes returns nil, because TWebControlGroup descendants not make use of layout attributes.


TWebControlGroup.GetParentComponent

TWebControlGroup	See also

Returns the Web item that uses this component to generate HTML.

function GetParentComponent: TComponent; override;

Description

TWebControlGroup overrides the GetParentComponent method that is introduced in TComponent for the streaming system that loads and saves VCL components. It returns the Web item that uses the HTML generated by the Web control group when assembling its own portion of the HTML document.


TWebControlGroup.GetSubComponents

TWebControlGroup	See also

Returns the value of the WebFieldControls property.

function GetSubComponents: TObject;

Description

GetSubComponents returns the TWebControlGroup’s list of Web items that it uses to generate HTML content. This method is part of the mechanism that fits TWebControlGroup into a hierarchy of Web items, each of which generates part of a larger HTML document.


TWebControlGroup.HasParent

TWebControlGroup	See also

Indicates whether the Web control group generates its HTML on behalf of another component.

function HasParent: Boolean; override;

Description

TWebControlGroup overrides the HasParent method that is introduced in TComponent for the streaming system that loads and saves VCL components. It returns True if there is a Web item that uses the HTML generated by the Web control group when assembling its own portion of the HTML document.

If the Web control group has a parent, that parent component is responsible for writing the Web control group to a stream.


TWebControlGroup.ImplAddElements

TWebControlGroup	See also

Provides the underlying implementation for the AddElements method.

procedure ImplAddElements(AddIntf: IAddScriptElements); virtual;

Description

The AddElements method calls ImpleAddElements to add any javascript declarations by calling the AddIntf interface. These declarations allow the generated display control to call javascript methods in response to user events by ensuring that the required methods are declared.

As implemented in TWebControlGroup, ImplAddElements does nothing. TWebControlGroup descendants override ImplAddElements to add any required declarations.


TWebControlGroup.ImplCanAddClass

TWebControlGroup	See also

Provides the underlying implementation for the CanAddClass method.

type TClass = class of TObject;

function ImplCanAddClass(AParent: TComponent; AClass: TClass): Boolean; virtual;

Description

The CanAddClass method calls ImpleCanAddClass to detemine whether the TWebControlGroup descendant can add a component of type AClass to its WebComponents property list. AParent is the TWebControlGroup instance to which the component will be added.

In TWebControlGroup, ImplCanAddClass always returns True. TWebControlGroup descendants override ImplCanAddClass to indicate what types of Web Items they can use when generating their HTML content.


TWebControlGroup.ImplContent

TWebControlGroup	See also

Provides the underlying implementation for the Content method.

function ImplContent(Options: TWebContentOptions; ParentLayout: TLayout): string; virtual;

Description

The Content method calls ImplContent to generate the group of HTML controls. As implemented in TWebControlGroup, ImplContent returns an empty string. TWebControlGroup descendants override it to generate HTML for the group of controls.

Options contains a set of flags that limit what can be included in the generated HTML.

ParentLayout specifies a helper object that the caller supplies for determining how the TWebControlGroup should format the HTML controls it generates.

ImplContent returns the generated HTML.


TWebControlGroup.ImplGetSubComponents

TWebControlGroup	See also

Provides the underlying implementation for the GetSubComponents method.

function  function ImplGetSubComponents: TObject; virtual;

Description

The GetSubComponents method calls ImplGetSubComponents to retrieve the value of WebFieldControls as a TObject. TWebControlGroup descendants override this method if the list is not simply the value of WebFieldControls. For example, some TWebControlGroup descendants supply a default value (DefaultWebComponents) when the WebFieldControls property list is empty.

ImplGetSubComponents returns the TWebComponentList object that contains all sub items of the Web control group.


TWebControlGroup.ReadState

TWebControlGroup	See also

Reads the component’s published properties, stored data, and owned components from a reader object.

procedure ReadState(Reader: TReader); override;

Description

ReadState is part of a sequence of calls used by the streaming system that loads and saves VCL components.  It reads the values of all the component's published properties, stored data, and owned components from the reader object passed in Reader. Do not call ReadState directly.

TWebControlGroup overrides ReadState to obtain the TWebControlGroup object’s parent component from the reader.

Note:	Any descendant classes overriding ReadState should end with a call to the inherited ReadState method.


TWebControlGroup.SetChildOrder

TWebControlGroup	See also

Positions a child component in the WebFieldControls property.

procedure SetChildOrder(Child: TComponent; Order: Integer); override;

Description

SetChildOrder is part of the streaming system that loads and saves VCL components. It positions a newly loaded child component in the WebFieldControls property list.


TWebControlGroup.SetComponentList

TWebControlGroup	See also

Informs the TWebControlGroup component of the TWebComponentList object that contains it.

procedure SetComponentList(List: TObject);

Description

SetComponentList implements the IWebComponent method of the same name. By implementing the IWebComponent interface, TWebControlGroup can fit into a hierarchy of Web items, each of which generates part of a larger HTML document.

SetComponentList saves a reference to the supplied list internally, so that it is available to the TWebControlGroup component. This list is the TWebComponentList object that implement’s its parent’s WebComponents or WebFieldControls property.


TWebControlGroup.SetContainer

TWebControlGroup	See also

Informs the TWebControlGroup component of the Web item that uses it to generate HTML.

procedure SetContainer(Container: TWebComponentContainer);

Description

SetContainer implements the IWebComponent method of the same name. By implementing the IWebComponent interface, TWebControlGroup can fit into a hierarchy of Web items, each of which generates part of a larger HTML document.

SetContainer stores a reference to the Web item passed as the Container parameter. This is the Web item that uses the TWebControlGroup to generate a group of HTML controls.


TWebControlGroup.SetIndex

TWebControlGroup	See also

Informs the TWebControlGroup component of where it falls in its parent’s list of Web items.

procedure SetIndex(Value: Integer);

Description

SetIndex implements the IWebComponent method of the same name. By implementing the IWebComponent interface, TWebControlGroup can fit into a hierarchy of Web items, each of which generates part of a larger HTML document.

SetIndex stores a reference to where the TWebControlGroup falls in its parent’s list or Web items.


TWebControlGroup.SetParentComponent

TWebControlGroup	See also

Stores the Web item that uses this component to generate HTML.

procedure SetParentComponent(AParent: TComponent); override;

Description

TWebControlGroup overrides the SetParentComponent method that is introduced in TComponent for the streaming system that loads and saves VCL components. It sets the parent of the TWebControlGroup component to the component specified as the AParent parameter.


TWebControlGroup.SetWebParent

TWebControlGroup	See also

Stores the Web item that uses this component to generate HTML.

procedure SetWebParent(Value: TComponent);

Description

SetWebParent adds the TWebControlGroup component to the list of Web items maintained byValue. If the TWebControlGroup is already in another component’s list of Web items, SetWebParent first removes the TWebControlGroup component from that list before adding it to the list belonging to Value.


Scope

Published

Protected

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent


TWebDataDisplay

Hierarchy	Properties	Methods	See also

TWebDataDisplay is the base class for Web items that create HTML display controls.

Unit

MidItems

Description

Use TWebDataDisplay as a base class for components that generate HTML controls which display information in a MIDAS Web application. TWebDataDisplay descendants generate the individual controls that are organized by TDataGrid, TFieldGroup, or TQueryFieldGroup.

TWebDataDisplay introduces the properties and methods for

Generating a caption that describes the information displayed.

Customizing the appearance of the control that displays information.

Fitting the control into the tab order of the generated HTML form.

Fitting the component into a hierarchy of Web items that collectively generate the content of an HTML document.

In order to let other Web items to use the HTML control it generates, TWebDataDisplay implements the IWebContent interface.

Do not create instances of TWebDataDisplay. TWebDataDisplay relies on an abstract method for generating the display control. Trying to use TWebDataDisplay results in an EAbstractError exception. Instead, use a descendant of TWebDataDisplay that generates an HTML control of the desired type.


TWebDataDisplay properties

TWebDataDisplay	Alphabetically	Legend

In TWebDataDisplay

Caption

CaptionAttributes

CaptionPosition

Custom

LayoutAttributes

Style

StyleRule

TabIndex

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TWebDataDisplay properties

TWebDataDisplay	By object	Legend

Caption

CaptionAttributes

CaptionPosition

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

LayoutAttributes

Name

Owner

Style

StyleRule

TabIndex

Tag

VCLComObject


TWebDataDisplay.Caption

TWebDataDisplay	See also

Specifies the text of a label that indicates what information the generated control displays.

property Caption: string;

Description

Use Caption to specify the text of the control’s label.


TWebDataDisplay.CaptionAttributes

TWebDataDisplay	See also

Customizes the appearance of the generated control’s label.

property CaptionAttributes: TCaptionAttributes;

Description

Use CaptionAttributes to customize the appearance of the control’s label. CaptionAttributes defines a set of options that are added to an HTML SPAN tag surrounding the value of the Caption property.


TWebDataDisplay.CaptionPosition

TWebDataDisplay	See also

Specifies where the label appears relative to the generated display control.

type TCaptionPosition = (capLeft, capRight, capAbove, capBelow);

property CaptionPosition: TCaptionPosition;

Description

Use CaptionPosition to indicate where the label should appear relative to the control that displays information. CaptionPosition has one of the following values:

Value	Meaning

capLeft	The caption appears to the left of the display control.

capRight	The caption appears to the right of the display control.

capAbove	The caption appears above the display control.

capBelow	The caption appears below the display control.

Note:	CaptionPosition has no effect on column controls. The position of column labels is always in the table header.


TWebDataDisplay.Custom

TWebDataDisplay	See also

Represents a tag option and its value in the tag for the display control.

property Custom: string;

Description

TWebDataDisplay descendants generate different HTML tags to generate the control that displays information. Use Custom to add options that qualify the tag. Each option and its value has the form

OPTIONNAME=Value

The options specified by Custom should be separated by spaces. For example, to provide an INPUT control with an accelerator key and align text to the bottom, you can set Custom to

ACCESSKEY=A ALIGN=BOTTOM

Note:	To add custom options to the control’s label, use the CaptionAttributes property instead.


TWebDataDisplay.LayoutAttributes

TWebDataDisplay	See also

Encodes attributes that describe how the generated control should look.

property LayoutAttributes: TLayoutAttributes;

Description

LayoutAttributes is used internally by Web items to allow the layout object supplied by a parent (as a parameter to the Content method) to take into account layout properties of the child component.

LayoutAttributes encodes the information in the CaptionPosition and CaptionAttributes properties. Some descendant classes add information from the Style and StyleRule properties as well.


TWebDataDisplay.Style

TWebDataDisplay	See also

Adds style attributes to the generated display control.

property Style: string;

Description

Use Style to specify display characteristics that affect the generated control. The Style option consists of one or more attribute descriptions such as

font-family: arial; font-weight: bold; font-size: 10px

These attributes are added to the HTML tag that generates the control as the value of a STYLE option.

Note:	To add style attributes to the control’s label, use the CaptionAttributes property instead.


TWebDataDisplay.StyleRule

TWebDataDisplay	See also

Applies a style in the page producer’s style sheet to the generated display control.

property StyleRule: string;

Description

Use StyleRule to assign one of the user-defined styles in the HTML document’s style sheet to the generated display control. The value of StyleRule specifies one of the user-defined style names defined in the MIDAS page producer’s Styles or StylesFile property.

To apply a style definition that is not included in the style sheet, use the Style property instead.

Note:	To apply a style to the control’s label, use the CaptionAttributes property instead.


TWebDataDisplay.TabIndex

TWebDataDisplay

Determines the position of the generated control in the HTML form’s tab order.

property TabIndex: Integer;

Description

Use TabIndex to control the order that focus moves between controls when the end-user presses the Tab key. TabIndex specifies the position of the control in the tab order. If TabIndex is less than 0, the HTML tag’s TABINDEX option is not set.


TWebDataDisplay methods

TWebDataDisplay	Alphabetically	Legend

In TWebDataDisplay

Content

ControlContent

Create

Destroy

EventContent

FormatCaption

GetCaption

GetContainer

GetHTMLControlName

GetHTMLForm

GetIndex

GetLayoutAttributes

GetParentComponent

GetXmlDisplayName

HasParent

ImplContent

ImplGetHTMLControlName

IsColumn

IsQueryField

LabelContent

ReadState

SetCaption

SetCaptionAttributes

SetComponentList

SetContainer

SetIndex

SetParentComponent

SetWebParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWebDataDisplay methods

TWebDataDisplay	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Content

ControlContent

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

EventContent

ExecuteAction

FieldAddress

FindComponent

FormatCaption

Free

FreeInstance

FreeNotification

FreeOnRelease

GetCaption

GetContainer

GetHTMLControlName

GetHTMLForm

GetIndex

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetLayoutAttributes

GetNamePath

GetParentComponent

GetXmlDisplayName

HasParent

ImplContent

ImplGetHTMLControlName

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsColumn

IsQueryField

LabelContent

MethodAddress

MethodName

NewInstance

ReadState

RemoveComponent

SafeCallException

SetCaption

SetCaptionAttributes

SetComponentList

SetContainer

SetIndex

SetParentComponent

SetWebParent

UpdateAction


TWebDataDisplay.Content

TWebDataDisplay	See also

Returns the HTML that defines the display control.

function Content(Options: TWebContentOptions; ParentLayout: TLayout): string;

Description

Content implements the IWebContent method of the same name. This method allows the TWebDataDisplay component’s parent to extract the HTML defining the display control.

Content calls the virtual ImplContent method to provide the HTML content that it returns. Each TWebDataDisplay descendant overrides ImplContent to generate the definition of its particular control.

Options contains a set of flags that limit what can be included in the generated HTML.

ParentLayout specifies a helper object that the caller supplies for determining how the component should format the HTML control it generates.

Content returns a string of HTML defining the display control.


TWebDataDisplay.ControlContent

TWebDataDisplay	See also

Returns the HTML that defines the display control (without its caption).

function ControlContent(Options: TWebContentOptions): string; virtual; abstract;

Description

ControlContent is used internally to generate the HTML for the display control. This method does not generate any HTML for the control’s label, which is handled separately by the FormatCaption method.

TWebDataDisplay introduces ControlContent as an abstract method. Descendant classes override this method to generate the appropriate type of display component.

Options contains a set of flags that limit what can be included in the generated HTML.

ControlContent returns a string of HTML defining the display control.


TWebDataDisplay.Create

TWebDataDisplay	See also

Creates and initializes an instance of TWebDataDisplay.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TWebDataDisplay at runtime. TWebDataDisplay descendants added at design time using the Web Page editor are instantiated automatically.


TWebDataDisplay.Destroy

TWebDataDisplay	See also

Frees an instance of TWebDataDisplay.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, use the Free method, which checks that the component is not nil, and only then calls Destroy.


TWebDataDisplay.EventContent

TWebDataDisplay	See also

Returns the tag options that indicate how the control responds to defined events.

function EventContent(Options: TWebContentOptions): string; virtual;

Description

EventContent is used internally when generating the HTML for the display control. It generates the javascript calls that respond to defined user events. The resulting string is added to the options of the HTML tag that defines the control.

As implemented in TWebDataDisplay, EventContent returns an empty string. Descendant classes override this method to generate the appropriate javascript calls.

Options contains a set of flags that limit what can be included in the generated HTML.

EventContent returns a string of HTML listing the events followed by the javascript calls that handle them.


TWebDataDisplay.FormatCaption

TWebDataDisplay	See also

Returns the HTML for the display control’s caption.

function FormatCaption: string; virtual;

Description

FormatCaption generates the HTML for the display control’s caption, using the attributes specified by the CaptionAttributes property. FormatCaption returns the resulting string of HTML.

In addition, FormatCaption encodes the layout properties of the caption and the value of the CaptionPosition property into the LayoutAttributes property. The TWebDataDisplay component uses this value later to lay out the control and its caption appropriately.


TWebDataDisplay.GetCaption

TWebDataDisplay	See also

Returns the value of the Caption property.

function GetCaption: string; virtual;

Description

GetCaption is the protected read implementation for the Caption property.


TWebDataDisplay.GetContainer

TWebDataDisplay	See also

Returns the component that uses TWebDataDisplay to generate part of its own HTML..

function GetContainer: TWebComponentContainer;

Description

GetContainer implements the IWebComponent method of the same name. By implementing the IWebComponent interface, TWebDataDisplay can fit into a hierarchy of Web items, each of which generates part of a larger HTML document.

GetContainer returns the component that uses the HTML display control which the TWebDataDisplay descendant generates.


TWebDataDisplay.GetHTMLControlName

TWebDataDisplay	See also

Returns the name that other components can use to refer to the generated display control.

function GetHTMLControlName: string;

Description

GetHTMLControlName returns the name of the generated control. This value is assigned to a NAME option on the generated HTML tag.

GetHTMLControlName returns the value supplied by the ImplGetHTMLControlName method. Unlike GetHTMLControlName, ImplGetHTMLControlName is a virtual method that descendants can override to supply a name in class-specific ways.


TWebDataDisplay.GetHTMLForm

TWebDataDisplay	See also

Used internally to retrieve information about the HTML form in which the display control is defined.

function GetHTMLForm: IHTMLForm;

Description

TWebDataDisplay and its descendants use GetHTMLForm to obtain information about the form in which the generated display control appears. This information is used to generate code for calling form methods in response to user events.

GetHTMLForm walks up the hierarchy of Web items (using the GetParentComponent method) until it finds a component that can supply an interface for the HTML form.


TWebDataDisplay.GetIndex

TWebDataDisplay	See also

Returns the position of the TWebDataDisplay component in its parent’s list of Web items.

function GetIndex: Integer;

Description

GetIndex implements the IWebComponent method of the same name. By implementing the IWebComponent interface, TWebDataDisplay can fit into a hierarchy of Web items, each of which generates part of a larger HTML document.

GetIndex returns the position of the TWebDataDisplay component in its parent’s WebFieldControls property. The parent supplies this value using the SetIndex method.


TWebDataDisplay.GetLayoutAttributes

TWebDataDisplay	See also

Returns the value of the LayoutAttributes property.

function GetLayoutAttributes: TLayoutAttributes; virtual;

Description

GetLayoutAttributes is used internally by Web items to allow the layout object supplied by a parent (as a parameter to the Content method) to take into account layout properties of the child component.

GetLayoutAttributes returns the value of the LayoutAttributes property.


TWebDataDisplay.GetParentComponent

TWebDataDisplay	See also

Returns the Web item that uses this component to generate HTML.

function GetParentComponent: TComponent; override;

Description

TWebDataDisplay overrides the GetParentComponent method that is introduced in TComponent for the streaming system that loads and saves VCL components. It returns the Web item that uses the HTML generated by the Web data display component when assembling its own portion of the HTML document.


TWebDataDisplay.GetXmlDisplayName

TWebDataDisplay	See also

Returns the name of the javascript object that uses TWebDataDisplay to generate one of its display controls.

function GetHTMLControlName: string;

Description

GetXmlDisplayName returns the name of the javascript object that groups the set of display controls which includes this TWebDataDisplay descendant’s generated control. The javascript object is generated by a TDataGrid or TFieldGroup component, and provides the display component’s link to its XML data packet. Typically, the TDataGrid or TFieldGroup component is the parent of the TWebDataDisplay component, but it may be higher in the parent hierarchy if the application uses layout groups.


TWebDataDisplay.HasParent

TWebDataDisplay	See also

Indicates whether the component generates its display control on behalf of another component.

function HasParent: Boolean; override;

Description

TWebDataDisplay overrides the HasParent method that is introduced in TComponent for the streaming system that loads and saves VCL components. It returns True if there is a Web item that uses the generated display control when assembling its own portion of the HTML document.

If the Web data display component has a parent, that parent component is responsible for writing it to a stream.


TWebDataDisplay.ImplContent

TWebDataDisplay	See also

Provides the underlying implementation for the Content method.

function Content(Options: TWebContentOptions; ParentLayout: TLayout): string; virtual;

Description

The Content method calls ImplContent to generate the HTML that defines the display control and its label. ImplContent formats the caption and combines this HTML with the results of the ControlContent method. ControlContent is an abstract method in TWebDataDisplay. TWebDataDisplay descendants override it to generate the definition of their particular display control.

Options contains a set of flags that limit what can be included in the generated HTML.

ParentLayout specifies a helper object that the caller supplies for determining how the TWebDataDisplay should format the HTML control it generates.

ImplContent returns a string of HTML defining the display control.


TWebDataDisplay.ImplGetHTMLControlName

TWebDataDisplay	See also

Returns the name that other components can use to refer to the generated display control.

function ImplGetHTMLControlName: string; virtual;

Description

ImplGetHTMLControlName returns the name of the generated control. This value is assigned to a NAME option on the generated HTML tag.

ImplGetHTMLControlName returns the value of the Name property. TWebDataDisplay descendants can override this method to return a more meaningful value such as the name of the field or parameter displayed in the control.


TWebDataDisplay.IsColumn

TWebDataDisplay	See also

Indicates whether the component generates the controls that appear in the column of a data grid.

class function IsColumn: Boolean; virtual;

Description

Call IsColumn to detemine whether a TWebDataDisplay descendant generates the controls that appear in a single column of a data grid. As implemented in TWebDataDisplay, IsColumn returns False. Descendant classes that generate controls for the columns of a data grid override this method to return True.


TWebDataDisplay.IsQueryField

TWebDataDisplay	See also

Indicates whether the component generates the controls that appear in a query form.

class function IsQueryField: Boolean; virtual;

Description

Call IsQueryField to detemine whether a TWebDataDisplay descendant generates the controls that represent a named value in a query form (TQueryForm). As implemented in TWebDataDisplay, IsQueryField returns False. Descendant classes that generate controls for a TQueryFieldGroup component override this method to return True.


TWebDataDisplay.LabelContent

TWebDataDisplay	See also

Returns the HTML for the display control’s caption.

function LabelContent: string; virtual;

Description

The ImplContent method calls LabelContent to provide the HTML for the label of the generated display control. LabelContent calls the FormatCaption method to produce this HTML and returns the resulting string.


TWebDataDisplay.ReadState

TWebDataDisplay	See also

Reads the component’s published properties, stored data, and owned components from a reader object.

procedure ReadState(Reader: TReader); override;

Description

ReadState is part of a sequence of calls used by the streaming system that loads and saves VCL components.  It reads the values of all the component's published properties, stored data, and owned components from the reader object passed in Reader. Do not call ReadState directly.

TWebDataDisplay overrides ReadState to obtain the TWebDataDisplay object’s parent component from the reader.

Note:	Any descendant classes overriding ReadState should end with a call to the inherited ReadState method.


TWebDataDisplay.SetCaption

TWebDataDisplay	See also

Sets the value of the Caption property.

procedure SetCaption(const Value: string);

Description

SetCaption is the protected write implementation for the Caption property.


TWebDataDisplay.SetCaptionAttributes

TWebDataDisplay	See also

Sets the value of the CaptionAttributes property.

procedure SetCaptionAttributes(const Value: TCaptionAttributes;);

Description

SetCaptionAttributes is the protected write implementation for the CaptionAttributes property.


TWebDataDisplay.SetComponentList

TWebDataDisplay	See also

Informs the component of the TWebComponentList object that contains it.

procedure SetComponentList(List: TObject);

Description

SetComponentList implements the IWebComponent method of the same name. By implementing the IWebComponent interface, TWebDataDisplay can fit into a hierarchy of Web items, each of which generates part of a larger HTML document.

SetComponentList saves a reference to the supplied list internally, so that it is available to the TWebDataDisplay component. This list is the TComponentList object that implement’s its parent’s WebFieldControls property.


TWebDataDisplay.SetContainer

TWebDataDisplay	See also

Informs the TWebDataDisplay component of the component that uses it to generate part of its own HTML.

procedure SetContainer(Container: TWebComponentContainer);

Description

SetContainer implements the IWebComponent method of the same name. By implementing the IWebComponent interface, TWebDataDisplay can fit into a hierarchy of Web items, each of which generates part of a larger HTML document.

SetContainer stores a reference to the Web item passed as the Container parameter. This is the component that uses the TWebDataDisplay to generate part of its own HTML.


TWebDataDisplay.SetIndex

TWebDataDisplay	See also

Informs the TWebDataDisplay component of where it falls in its parent’s list of Web items.

procedure SetIndex(Value: Integer);

Description

SetIndex implements the IWebComponent method of the same name. By implementing the IWebComponent interface, TWebDataDisplay can fit into a hierarchy of Web items, each of which generates part of a larger HTML document.

SetIndex stores a reference to where the TWebDataDisplay falls in its parent’s WebFieldControls property list.


TWebDataDisplay.SetParentComponent

TWebDataDisplay	See also

Stores the Web item that uses this component to generate HTML.

procedure SetParentComponent(AParent: TComponent); override;

Description

TWebDataDisplay overrides the SetParentComponent method that is introduced in TComponent for the streaming system that loads and saves VCL components. It sets the parent of the TWebDataDisplay component to the component specified as the AParent parameter.


TWebDataDisplay.SetWebParent

TWebDataDisplay	See also

Stores the Web item that uses this component to generate HTML.

procedure SetWebParent(Value: TComponent);

Description

SetWebParent adds the TWebDataDisplay component to the WebFieldControls property of Value. If the TWebDataDisplay is already in another component’s list of Web items, SetWebParent first removes the TWebDataDisplay component from that list before adding it to the list belonging to Value.


Scope

Published

Protected

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent


TWebDataInput

Hierarchy	Properties	Methods	See also

TWebDataInput is the base class for Web items that create HTML display controls for entering information.

Unit

MidItems

Description

Use TWebDataInput as a base class for components that generate HTML controls which display information in a MIDAS Web application and into which users can enter values. TWebDataInput descendants generate controls that are organized by TDataGrid, TFieldGroup, or TQueryFieldGroup.

TWebDataInput defines or inherits properties and methods for

Generating a caption that describes the information displayed.

Customizing the appearance of the control that displays information.

Specifying a field or parameter whose value the control displays.

Fitting the control into the tab order of the generated HTML form.

Fitting the component into a hierarchy of Web items that collectively generate the content of an HTML document.

In order to let other Web items to use the HTML control it generates, TWebDataInput inherits the IWebContent interface from TWebDataDisplay.

Do not create instances of TWebDataInput. TWebDataInput relies on an abstract method for generating the display control. Trying to use TWebDataInput results in an EAbstractError exception. Instead, use a descendant of TWebDataInput that generates an HTML control of the desired type.


TWebDataInput properties

TWebDataInput	Alphabetically	Legend

In TWebDataInput

FieldName

ParamName

Derived from TWebDataDisplay

Caption

CaptionAttributes

Custom

Style

StyleRule

TabIndex

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TWebDataInput properties

TWebDataInput	By object	Legend

Caption

CaptionAttributes

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

FieldName

Name

Owner

ParamName

Style

StyleRule

TabIndex

Tag

VCLComObject


TWebDataInput.FieldName

TWebDataInput	See also

Specifies the name of the field whose value the generated control represents.

property FieldName: string;

Description

Use FieldName to bind the Web data input component to a field in the XML data packet. When the display control represents a field value, this is the field whose value is displayed and edited using the control. When the display control represents a parameter value, this is a field that is used to filter records that appear in data packets.

The dataset that contains the field is identified by the XMLBroker and XMLDataSetField properties of the Web item that acts as a parent to the Web data input component.


TWebDataInput.ParamName

TWebDataInput	See also

Specifies the name of the parameter whose value the generated control represents.

property ParamName: string;

Description

Use ParamName to bind the Web data input component to a parameter in the XML data packet or supply an application-specific name to the value for this control.  ParamName is only used when the IsQueryField method returns True. By default, the controls in a query form represent parameter values. However, they can be used to represent any named value.

If ParamName identifies one of the parameters of an XML broker, the XML broker property of the parent Web item identifies the broker that uses the parameter.


TWebDataInput methods

TWebDataInput	Alphabetically

In TWebDataInput

Derived from TWebDataDisplay

Create

Destroy

GetParentComponent

HasParent

IsColumn

IsQueryField

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWebDataInput methods

TWebDataInput	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsColumn

IsQueryField

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


Scope

Published

Protected

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TWebDataDisplay


TWebDispatch

Hierarchy	Properties	Methods	See also

TWebDispatch describes the HTTP messages to which an auto-dispatching component responds.

Unit

XMLbroker

Description

TWebDispatch implements the WebDispatch property of an auto-dispatching component such as TXMLBroker. It specifies the path info portion of the URL for messages directed at the component, the type of messages to which the component can respond, and allows an application to disable the auto-dispatching so that it does not respond directly to HTTP messages from a Web browser.


TWebDispatch properties

TWebDispatch	Alphabetically	Legend

In TWebDispatch

Enabled

Mask

MethodType

PathInfo


TWebDispatch properties

TWebDispatch	By object	Legend

Enabled

Mask

MethodType

PathInfo


TWebDispatch.Enabled

TWebDispatch	See also

Indicates whether the Web dispatcher passes requests to the object using the TWebDispatch object.

property Enabled: Boolean;

Description

Set Enabled to indicate whether the object using the Web dispatcher responds directly to HTTP request messages. By default, Enabled is True, but an application may disable the auto-dispatching of a component because

The application responds to request messages using an action item on the Web dispatcher rather than using the auto-dispatch feature of the component that uses TWebDispatch as its WebDispatch property. Action items give you greater control over the order in which the dispatcher passes a request message on for handling, and let you embed the default action of the auto-dispatching component with other actions performed by the action item.

The application uses other features of the auto-dispatching component but does not want it to respond to HTTP request messages. For example, a Web client may include an XML broker to provide data packets that appear in the generated HTML pages, but not allow Web browsers to apply updates. When Enabled is False, the Web dispatcher does not pass update messages on to the XML broker.


TWebDispatch.Mask

TWebDispatch	See also

Provides a mask object for comparing the PathInfo property with another path.

property Mask: TMask;

Description

Use Mask to compare the PathInfo property with the path portion of a URL. Mask is a TMask object that represents the string specified by PathInfo.


TWebDispatch.MethodType

TWebDispatch	See also

Specifies the type of HTTP request methods the auto-dispatching object knows how to service.

property MethodType: TMethodType;

Description

Set MethodType to indicate the types of requests that are serviced by the auto-dispatching component. The Web dispatcher forwards an HTTP request message to the auto-dispatching component when MethodType matches the MethodType of the request message. (The PathInfo properties must also match).


TWebDispatch.PathInfo

TWebDispatch	See also

Indicates the path portion of the Uniform Resource Identifier (URI) for which the auto-dispatching component handles requests.

property PathInfo: string;

Description

Set PathInfo to the path portion of the URI for the target of any request messages serviced by the auto-dispatching component that uses TWebDispatch. The Web dispatcher matches components to request messages by comparing PathInfo with the path portion of the URI specified as the target of the request. If the PathInfo properties match, and the MethodType matches, the Web dispatcher invokes the auto-dispatching object so that it can respond to the message.


TWebDispatch methods

TWebDispatch	Alphabetically

In TWebDispatch

Create

Destroy

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TWebDispatch methods

TWebDispatch	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TWebDispatch.Create

TWebDispatch

Creates and initializes an instance of TWebDispatch.

constructor Create(AComponent: TComponent);

Description

The TWebDispatch constructor is called from the constructor of the auto-dispatching component that uses it to implement its WebDispatch property. The AComponent parameter specifies the auto-dispatching component that uses the TWebDispatch instance.


TWebDispatch.Destroy

TWebDispatch

Destroys an instance of TWebDispatch.

destructor Destroy; override;

Description

Do not call Destroy. The TWebDispatch instance is freed by the auto-dispatching component that uses it.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent


TWebForm

Hierarchy	Properties	Methods	See also

TWebForm is the base class for Web items that create HTML forms.

Unit

MidItems

Description

Use TWebForm as a base class for components that generate the HTML statements defining a form that is contained in an HTML document. The list of Web items that generate content for a MIDAS page producer can only contain descendants of TWebForm.

In order to allow other the MIDAS page producer to use the HTML generated by the TWebForm descendant, TWebForm implements the IWebContent interface.

Do not create instances of TWebForm. TWebForm relies on an abstract method to generate the HTML form. Trying to use an instance of TWebForm leads to an EAbstractError exception. Instead, create descendants of TWebForm such a TDataForm or TQueryForm.


TWebForm properties

TWebForm	Alphabetically	Legend

In TWebForm

Custom

Style

StyleRule

VisibleFields

WebComponents

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TWebForm properties

TWebForm	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

VisibleFields

WebComponents


TWebForm.Custom

TWebForm	See also

Represents a tag option and its value in the generated FORM tag.

property Custom: string;

Description

Use Custom to represent one or more options that qualify the FORM tag generated by the TWebForm descendant. Each option and its value has the form

OPTIONNAME=Value

The options specified by Custom should be separated by spaces. For example, to specify that the form includes files with the text it submits and indicate that the page returned after submitting the form goes into a separate window, use a Custom value such as the following:

ENCTYPE="multipart/form-data" TARGET="ResultFrame"


TWebForm.Style

TWebForm	See also

Adds style attributes to the generated form.

property Style: string;

Description

Use Style to add a STYLE option that qualifies the FORM tag generated by the TWebForm descendant. The Style option consists of one or more attribute descriptions such as

font-family: arial; font-weight: bold; font-size: 10px

These attributes are added to the generated FORM tag as the value of a STYLE option.


TWebForm.StyleRule

TWebForm	See also

Applies a style in the page producer’s style sheet to the button.

property StyleRule: string;

Description

Use StyleRule to assign one of the user-defined styles in the HTML document’s style sheet to the generated form. The value of StyleRule specifies one of the user-defined style names defined in the MIDAS page producer’s Styles or StylesFile property.

Note:	To apply a style definition that is not included in the style sheet, use the Style property.


TWebForm.VisibleFields

TWebForm	See also

Lists the Web items whose generated content appears in the HTML form.

property VisibleFields: TWebComponentList;

Description

VisibleFields is used internally when assembling the HTML form from the HTML generated by the form’s Web items. For TWebForm, the value of VisibleFields is always the same as WebComponents.

Override GetVisibleFields in a descendant class to provide a default set of that appear when the WebComponents property is not set.


TWebForm.WebComponents

TWebForm	See also

Maintains a list of components that generate HTML content for the TWebForm descendant.

property WebComponents: TWebComponentList;

Description

WebComponents lists the components that generate content for the Web form. Each of these components supports the IWebContent interface, and some can contain their own list of Web items that help them generate their content.

The type of items that can be added to the WebComponents list are restricted by the protected CanAddClass method. Descendant classes override this method to indicate what types of items can be added to the list. For example, TQueryForm limits the list to components that display or manipulate named values (TQueryButtons, TQueryFields) or layout groups that manage the layout of those items (TLayoutGroup).

At design time, add components to the WebComponents property by bringing up the Web page editor for the containing MidasPageProducer component. Select the TWebForm descendant in the editor, and use the editor to add child controls.


TWebForm methods

TWebForm	Alphabetically	Legend

In TWebForm

AddElements

CanAddClass

Content

Create

Destroy

GetChildren

GetComponentList

GetContainer

GetDefaultComponentList

GetHTMLFormName

GetHTMLFormVarName

GetIndex

GetLayoutAttributes

GetParentComponent

GetSubComponents

GetVisibleFields

HasParent

ImplAddElements

ImplCanAddClass

ImplContent

ReadState

SetChildOrder

SetComponentList

SetContainer

SetIndex

SetParentComponent

SetWebParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWebForm methods

TWebForm	By object	Legend

AddElements

AfterConstruction

Assign

BeforeDestruction

CanAddClass

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Content

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetChildren

GetComponentList

GetContainer

GetDefaultComponentList

GetHTMLFormName

GetHTMLFormVarName

GetIndex

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetLayoutAttributes

GetNamePath

GetParentComponent

GetSubComponents

GetVisibleFields

HasParent

ImplAddElements

ImplCanAddClass

ImplContent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

ReadState

RemoveComponent

SafeCallException

SetChildOrder

SetComponentList

SetContainer

SetIndex

SetParentComponent

SetWebParent

UpdateAction


TWebForm.AddElements

TWebForm	See also

Used internally to generate any javascript declarations needed by the form.

procedure AddElements(AddIntf: IAddScriptElements);

Description

The MIDAS page producer calls AddElements when it generates the block of javascript declarations in its HTML document. This method allows the generated form to use javascript classes and methods.

AddElements calls on the virtual ImplAddElements method, which uses the provided interface to return javascript declarations. Each TWebForm descendant overrides ImplAddElements to add any declarations it needs.


TWebForm.CanAddClass

TWebForm	See also

Specifies whether a Web item of a specified type can be added to the WebComponents property list.

type TClass = class of TObject;

function CanAddClass(AParent: TComponent; AClass: TClass): Boolean;

Description

The Web page editor calls CanAddClass to determine what Web items can be added to supply content for the TWebForm descendant. CanAddClass calls the virtual ImplCanAddClass method to determine whether a class of Web item is valid.

AParent is the TWebForm descendant to whose WebComponents property the Web item will be added.

AClass is the class of the proposed child Web item.

CanAddClass returns True if the Web form can use content generated by a component of type AClass, False otherwise.


TWebForm.Content

TWebForm	See also

Returns the HTML that defines the HTML form.

function Content(Options: TWebContentOptions; ParentLayout: TLayout): string;

Description

Content implements the IWebContent method of the same name. This method allows the page producer to extract the HTML defining the form.

Content calls the virtual ImplContent method to provide the HTML form it returns. Each TWebForm descendant overrides ImplContent to generate its particular HTML form. The generated HTML can make use of any javascript declarations supplied by the AddElements method.

Options contains a set of flags that limit what can be included in the generated HTML.

ParentLayout specifies a helper object that the caller supplies for determining how the component should format the HTML form it generates.

Content returns a string of HTML defining the form.


TWebForm.Create

TWebForm	See also

Creates and initializes an instance of TWebForm.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TWebForm descendant at runtime. TWebForm descendants added at design time using the Web Page editor are instantiated automatically.


TWebForm.Destroy

TWebForm

Frees an instance of TWebForm.

destructor Destroy; override;

Description

Destroy removes the form generator from its parent’s list of components that generate HTML before freeing the TWebForm instance.


TWebForm.GetChildren

TWebForm	See also

Executes a callback for each component in the WebComponents property list.

procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;

Description

TWebForm overrides the GetChildren method that is introduced in TComponent for the streaming system that loads and saves VCL components. It executes the Proc procedure for each child component listed in the WebComponents property so that it is loaded and saved with the TWebForm component.


TWebForm.GetComponentList

TWebForm	See also

Returns the value of the WebComponents property.

function GetComponentList: TObject;

Description

Children of TWebForm call GetComponentList to access the TWebComponentList object that implements the WebComponents property.


TWebForm.GetContainer

TWebForm	See also

Returns the page producer that uses TWebForm to generate a form on its HTML document.

function GetContainer: TWebComponentContainer;

Description

GetContainer implements the IWebComponent method of the same name. By implementing the IWebComponent interface, TWebForm can fit into a hierarchy of Web items, each of which generates part of a larger HTML document.

GetContainer returns the page producer that generates the HTML document that contains the generated HTML form.


TWebForm.GetDefaultComponentList

TWebForm	See also

Returns the default value of the WebComponents property.

function GetDefaultComponentList: TObject;

Description

GetDefaultComponentList is used internally to retrieve a default value for the WebComponents property. As implemented in TWebForm, GetDefaultComponentList returns nil because the WebComponents property in TWebForm has no default value.


TWebForm.GetHTMLFormName

TWebForm	See also

Returns the name of the generated HTML form.

function GetHTMLFormName: string;

Description

TWebForm uses GetHTMLFormName internally to specify the NAME option of the generated form and to declare a javascript variable that references the form.

GetHTMLFormName returns the value of the Name property.


TWebForm.GetHTMLFormVarName

TWebForm	See also

Returns the name of the javascript variable that refers to the generated form.

function GetHTMLFormVarName: string;

Description

TWebForm uses GetHTMLFormVarName internally to declare a javascript variable that references the form. GetHTMLFormVarName returns the value of the Name property.


TWebForm.GetIndex

TWebForm	See also

Returns the position of the TWebForm component in its parent’s list of Web items.

function GetIndex: Integer;

Description

GetIndex implements the IWebComponent method of the same name. By implementing the IWebComponent interface, TWebForm can fit into a hierarchy of Web items, each of which generates part of a larger HTML document.

GetIndex returns the position of the TWebForm component in its parent’s WebPageItems property. The parent supplies this value using the SetIndex method.


TWebForm.GetLayoutAttributes

TWebForm	See also

Returns the object that specifies how the generated form should look.

function GetLayoutAttributes: TLayoutAttributes; virtual;

Description

GetLayoutAttributes is used internally by Web items to allow the layout object supplied by a parent (as a parameter to the Content method) to take into account layout properties of the child component.

As implemented by TWebForm, GetLayoutAttributes returns nil, because the layout at the form level does not make use of layout attributes.


TWebForm.GetParentComponent

TWebForm	See also

Returns the page producer that uses this component to generate an HTML form.

function GetParentComponent: TComponent; override;

Description

TWebForm overrides the GetParentComponent method that is introduced in TComponent for the streaming system that loads and saves VCL components. It returns the MIDAS page producer that uses this TWebForm descendant for generating an HTML form.


TWebForm.GetSubComponents

TWebForm	See also

Returns the value of the WebComponents property.

function GetSubComponents: TObject;

Description

GetSubComponents returns the TWebForm’s list of Web items that it uses to generate HTML content. This method is part of the mechanism that fits TWebForm into a hierarchy of Web items, each of which generates part of a larger HTML document.


TWebForm.GetVisibleFields

TWebForm	See also

Returns the value of the VisibleFields property.

function GetVisibleFields: TWebComponentList;

Description

GetVisibleFields is the protected read implementation of the VisibleFields property.


TWebForm.HasParent

TWebForm	See also

Indicates whether the TWebForm descendant generates its HTML on behalf of another component.

function HasParent: Boolean; override;

Description

TWebForm overrides the HasParent method that is introduced in TComponent for the streaming system that loads and saves VCL components. It returns True if there is a MIDAS page producer that uses this TWebForm descendant to generate an HTML form.

If the Web form has a parent, that parent component is responsible for writing the Web form to a stream.


TWebForm.ImplAddElements

TWebForm	See also

Provides the underlying implementation for the AddElements method.

procedure ImplAddElements(AddIntf: IAddScriptElements); virtual;

Description

The AddElements method calls ImpleAddElements to add any javascript declarations by calling the AddIntf interface. These declarations allow the generated display control to call javascript methods in response to user events by ensuring that the required methods are declared.

As implemented in TWebForm, ImplAddElements does nothing. TWebForm descendants can override ImplAddElements to add any required declarations.


TWebForm.ImplCanAddClass

TWebForm	See also

Provides the underlying implementation for the CanAddClass method.

type TClass = class of TObject;

function ImplCanAddClass(AParent: TComponent; AClass: TClass): Boolean; virtual; abstract;

Description

The CanAddClass method calls ImpleCanAddClass to detemine whether the TWebForm descendant can add a component of type AClass to its WebComponents property list. AParent is the TWebForm instance to which the component will be added.

In TWebForm, ImplCanAddClass is abstract. TWebForm descendants must override ImplCanAddClass to indicate what types of Web Items they can use when generating their HTML forms.


TWebForm.ImplContent

TWebForm	See also

Provides the underlying implementation for the Content method.

function Content(Options: TWebContentOptions; ParentLayout: TLayout): string; virtual; abstract;

Description

The Content method calls ImplContent to generate the HTML form. ImplContent is an abstract method in TWebForm. TWebForm descendants override it to generate the HTML form.

Options contains a set of flags that limit what can be included in the generated HTML.

ParentLayout specifies a helper object that the caller supplies for determining how the TWebForm should format the HTML control it generates.

ImplContent returns an HTML form definition.


TWebForm.ReadState

TWebForm	See also

Reads the component’s published properties, stored data, and owned components from a reader object.

procedure ReadState(Reader: TReader); override;

Description

ReadState is part of a sequence of calls used by the streaming system that loads and saves VCL components.  It reads the values of all the component's published properties, stored data, and owned components from the reader object passed in Reader. Do not call ReadState directly.

TWebForm overrides ReadState to obtain the TWebForm object’s parent component from the reader.

Note:	Any descendant classes overriding ReadState should end with a call to the inherited ReadState method.


TWebForm.SetChildOrder

TWebForm	See also

Positions a child component in the WebComponents property.

procedure SetChildOrder(Child: TComponent; Order: Integer); override;

Description

SetChildOrder is part of the streaming system that loads and saves VCL components. It positions a newly loaded child component in the WebComponents property list.


TWebForm.SetComponentList

TWebForm	See also

Informs the TWebForm component of the TWebComponentList object that contains it.

procedure SetComponentList(List: TObject);

Description

SetComponentList implements the IWebComponent method of the same name. By implementing the IWebComponent interface, TWebForm can fit into a hierarchy of Web items, each of which generates part of a larger HTML document.

SetComponentList saves a reference to the supplied list internally, so that it is available to the TWebForm component. This list is the TWebComponentList object that implement’s its parent’s WebPageItems property.


TWebForm.SetContainer

TWebForm	See also

Informs the TWebForm component of the page producer that uses it to generate an HTML form.

procedure SetContainer(Container: TWebComponentContainer);

Description

SetContainer implements the IWebComponent method of the same name. By implementing the IWebComponent interface, TWebForm can fit into a hierarchy of Web items, each of which generates part of a larger HTML document.

SetContainer stores a reference to the Web item passed as the Container parameter. This is the page producer that uses the TWebForm to generate an HTML form.


TWebForm.SetIndex

TWebForm	See also

Informs the TWebForm component of where it falls in its parent’s list of Web items.

procedure SetIndex(Value: Integer);

Description

SetIndex implements the IWebComponent method of the same name. By implementing the IWebComponent interface, TWebForm can fit into a hierarchy of Web items, each of which generates part of a larger HTML document.

SetIndex stores a reference to where the TWebForm falls in its parent’s WebPageItems property list.


TWebForm.SetParentComponent

TWebForm	See also

Stores the page producer that uses this component to generate HTML.

procedure SetParentComponent(AParent: TComponent); override;

Description

TWebForm overrides the SetParentComponent method that is introduced in TComponent for the streaming system that loads and saves VCL components. It sets the parent of the TWebForm component to the component specified as the AParent parameter.


TWebForm.SetWebParent

TWebForm	See also

Stores the Web item that uses this component to generate HTML.

procedure SetWebParent(Value: TComponent);

Description

SetWebParent adds the TWebForm component to the WebPageItems property of Value. If the TWebForm is already in another producer’s list of Web items, SetWebParent first removes the TWebForm component from that list before adding it to the list belonging to Value.


Scope

Published

Protected

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent


TWebListInput

Hierarchy	Properties	Methods	See also

TWebListInput is the base class for Web items that create HTML display controls which present a fixed set of possible values.

Unit

MidItems

Description

Use TWebListInput as a base class for components that generate HTML controls for displaying a fixed set of possible values from which a user can choose. TWebListInput descendants generate controls that are organized by TDataGrid, TFieldGroup, or TQueryFieldGroup.

TWebListInput defines or inherits properties and methods for

Specifying a field or parameter whose value the control displays.

Specifying the possible values from which the user can choose.

Generating a caption that describes the information displayed.

Customizing the appearance of the control that displays information.

Fitting the control into the tab order of the generated HTML form.

Fitting the component into a hierarchy of Web items that collectively generate the content of an HTML document.

In order to let other Web items to use the HTML control it generates, TWebListInput inherits the IWebContent interface from TWebDataDisplay.

Do not create instances of TWebListInput. Instead, use a descendant of TWebListInput such as TFieldRadioGroup, TQueryRadioGroup, TFieldSelectOptions, TQuerySelectOptions, or TSelectOptionsColumn.


TWebListInput properties

TWebListInput	Alphabetically	Legend

In TWebListInput

DataSet

Items

ItemsField

Values

ValuesField

Derived from TWebDataInput

FieldName

Derived from TWebDataDisplay

Caption

CaptionAttributes

Custom

Style

StyleRule

TabIndex

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TWebListInput properties

TWebListInput	By object	Legend

Caption

CaptionAttributes

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DataSet

DesignInfo

FieldName

Items

ItemsField

Name

Owner

Style

StyleRule

TabIndex

Tag

Values

ValuesField

VCLComObject


TWebListInput.DataSet

TWebListInput	See also

Specifies a dataset that supplies the possible values listed in the generated control.

property DataSet: TDataSet;

Description

Use DataSet to specify a dataset from which the component can extract the selections that appear to the user and the underlying values they represent. The ItemsField property specifies the field in this dataset that lists the selections that appear in the generated control. The ValuesField property specifies the field in this dataset that lists the corresponding values that are assigned to the control.

Note:	If the list of possible values is not available in a dataset, use the Items and Values properties instead to list the selections that appear to the user and the underlying values they represent.


TWebListInput.Items

TWebListInput	See also

Lists the possible selections that appear in the generated control.

property Items: TStrings;

Description

Use Items to supply a list of possible selections to the generated control. The end-user can choose from these selections to assign a value to the generated control. The value that is assigned comes from the corresponding entry in the Values property.

Note:	To use a dataset to supply items and values, rather than explicitly listing them in the Items and Values properties, use the DataSet, ItemsField, and ValuesField properties.


TWebListInput.ItemsField

TWebListInput	See also

Indicates which field in DataSet supplies the possible selections for the generated control.

property ItemsField: string;

Description

Use ItemsField to specify which field in the dataset specified by the DataSet property contains selections that appear in the generated control. The end-user can choose from these selections to assign a value to the generated control. The value that is assigned comes from the field specified by the ValuesField property.

Note:	If the list of possible values is not available in a dataset, use the Items and Values properties instead to list the selections that appear to the user and the underlying values they represent.


TWebListInput.Values

TWebListInput	See also

Lists the possible values that can be assigned to the control.

property Values: TStrings;

Description

Use Values to supply a list of possible values for the generated control. When the end-user chooses one of the selections listed by the Items property, the control is assigned the corresponding value in the Values property.

Note:	To use a dataset to supply items and values, rather than explicitly listing them in the Items and Values properties, use the DataSet, ItemsField, and ValuesField properties.


TWebListInput.ValuesField

TWebListInput	See also

Indicates which field in DataSet supplies the possible values for the generated control.

property ValuesField: string;

Description

Use ValuesField to specify which field in the dataset specified by the DataSet property contains values that can be assigned to the generated control. When the end-user selects the corresponding value form the ItemsField field, the control gets the value in the ValuesField field.

Note:	If the list of possible values is not available in a dataset, use the Items and Values properties instead to list the selections that appear to the user and the underlying values they represent.


TWebListInput methods

TWebListInput	Alphabetically

In TWebListInput

Create

Destroy

Derived from TWebDataDisplay

GetParentComponent

HasParent

IsColumn

IsQueryField

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWebListInput methods

TWebListInput	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsColumn

IsQueryField

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TWebListInput.Create

TWebListInput	See also

Creates and initializes an instance of TWebListInput.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TWebListInput at runtime. TWebListInput descendants added at design time using the Web Page editor are instantiated automatically.


TWebListInput.Destroy

TWebListInput	See also

Frees an instance of TWebListInput.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, use the Free method, which checks that the component is not nil, and only then calls Destroy.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebDataDisplay

TWebDataInput


TWebRadioGroupInput

Hierarchy	Properties	Methods	See also

TWebRadioGroupInput is the base class for Web items that create HTML radio group controls.

Unit

MidItems

Description

Use TWebRadioGroupInput as a base class for components that generate HTML radio groups that represent field or parameter values. TWebRadioGroupInput descendants generate controls that are organized by TFieldGroup or TQueryFieldGroup.

TWebRadioGroupInput defines or inherits properties and methods for

Specifying a field or parameter whose value the radio group displays.

Specifying the possible values from which the user can choose.

Generating a caption that describes the information displayed.

Customizing the appearance of the radio group.

Fitting the radio group into the tab order of the generated HTML form.

Fitting the component into a hierarchy of Web items that collectively generate the content of an HTML document.

In order to let other Web items to use the HTML control it generates, TWebRadioGroupInput inherits the IWebContent interface from TWebDataDisplay.

Do not create instances of TWebRadioGroupInput. Instead, use a descendant of TWebRadioGroupInput such as TFieldRadioGroup or TQueryRadioGroup.


TWebRadioGroupInput properties

TWebRadioGroupInput	Alphabetically	Legend

In TWebRadioGroupInput

DisplayColumns

DisplayWidth

ReadOnly

Derived from TWebListInput

DataSet

Items

ItemsField

Values

ValuesField

Derived from TWebDataInput

FieldName

Derived from TWebDataDisplay

Caption

CaptionAttributes

Custom

Style

StyleRule

TabIndex

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TWebRadioGroupInput properties

TWebRadioGroupInput	By object	Legend

Caption

CaptionAttributes

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DataSet

DesignInfo

DisplayColumns

DisplayWidth

FieldName

Items

ItemsField

Name

Owner

ReadOnly

Style

StyleRule

TabIndex

Tag

Values

ValuesField

VCLComObject


TWebRadioGroupInput.DisplayColumns

TWebRadioGroupInput	See also

Specifies the number of radio buttons that appear in each row of the control.

property DisplayColumns: Integer;

Description

Use DisplayColumns to specify how many radio buttons can appear in a single line of the radio group. If DisplayColumns is less than the number of items, the radio group displays its buttons in multiple rows.


TWebRadioGroupInput.DisplayWidth

TWebRadioGroupInput	See also

Specifies the width of the radio group, in characters.

property DisplayWidth: Integer;

Description

Use DisplayWidth to limit the width of the generated control. TWebRadioGroup generates an INPUT tag of type RADIO to implement the radio group. DisplayWidth is added as a WIDTH option.


TWebRadioGroupInput.ReadOnly

TWebRadioGroupInput	See also

Indicates whether end-users can use the generated control to set values.

property ReadOnly: Boolean;

Description

Use ReadOnly to indicate whether users can change the value displayed by the radio group. TWebRadioGroup generates an INPUT tag of type RADIO to implement the radio group. ReadOnly is added as a READONLY option.


TWebRadioGroupInput methods

TWebRadioGroupInput	Alphabetically

In TWebRadioGroupInput

Create

Derived from TWebListInput

Destroy

Derived from TWebDataDisplay

GetParentComponent

HasParent

IsColumn

IsQueryField

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWebRadioGroupInput methods

TWebRadioGroupInput	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsColumn

IsQueryField

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TWebRadioGroupInput.Create

TWebRadioGroupInput	See also

Creates and initializes an instance of TWebRadioGroupInput.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TWebRadioGroupInput at runtime. TWebRadioGroupInput descendants added at design time using the Web Page editor are instantiated automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebDataDisplay

TWebDataInput

TWebListInput


TWebSelectOptionsInput

Hierarchy	Properties	Methods	See also

TWebSelectOptionsInput is the base class for Web items that create HTML list controls.

Unit

MidItems

Description

Use TWebSelectOptionsInput as a base class for components that generate HTML list controls that represent field or parameter values. TWebSelectOptionsInput descendants generate controls that are organized by TDataGrid, TFieldGroup, or TQueryFieldGroup.

TWebSelectOptionsInput defines or inherits properties and methods for

Specifying a field or parameter whose value the list box displays.

Specifying the possible values from which the user can choose.

Generating a caption that describes the information displayed.

Customizing the appearance of the list box.

Fitting the list box into the tab order of the generated HTML form.

Fitting the component into a hierarchy of Web items that collectively generate the content of an HTML document.

In order to let other Web items to use the HTML control it generates, TWebSelectOptionsInput inherits the IWebContent interface from TWebDataDisplay.

Do not create instances of TWebSelectOptionsInput. Instead, use a descendant of TWebSelectOptionsInput such as TFieldSelectOptions, TQuerySelectOptions, or TSelectOptionsColumn.


TWebSelectOptionsInput properties

TWebSelectOptionsInput	Alphabetically	Legend

In TWebSelectOptionsInput

DisplayRows

Derived from TWebListInput

DataSet

Items

ItemsField

Values

ValuesField

Derived from TWebDataInput

FieldName

Derived from TWebDataDisplay

Caption

CaptionAttributes

Custom

Style

StyleRule

TabIndex

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TWebSelectOptionsInput properties

TWebSelectOptionsInput	By object	Legend

Caption

CaptionAttributes

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DataSet

DesignInfo

DisplayRows

FieldName

Items

ItemsField

Name

Owner

Style

StyleRule

TabIndex

Tag

Values

ValuesField

VCLComObject


TWebSelectOptionsInput.DisplayRows

TWebSelectOptionsInput	See also

Specifies the number of rows that appear in the generated list box.

property DisplayRows: Integer;

Description

Use DisplayRows to specify how many rows appear in the generated list control. If DisplayRows is less than the number of items, the generated list displays only DisplayRows options at one time, but can scroll to display the hidden items. If DisplayRows is 1, the generated control becomes a drop-down list box.


TWebSelectOptionsInput methods

TWebSelectOptionsInput	Alphabetically

In TWebSelectOptionsInput

Create

Derived from TWebListInput

Destroy

Derived from TWebDataDisplay

GetParentComponent

HasParent

IsColumn

IsQueryField

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWebSelectOptionsInput methods

TWebSelectOptionsInput	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsColumn

IsQueryField

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TWebSelectOptionsInput.Create

TWebSelectOptionsInput	See also

Creates and initializes an instance of TWebSelectOptionsInput.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TWebSelectOptionsInput at runtime. TWebSelectOptionsInput descendants added at design time using the Web Page editor are instantiated automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebDataDisplay

TWebDataInput

TWebListInput


TWebStatus

Hierarchy	Properties	Methods	See also

TWebStatus is the base class for Web items that indicate the status of records in an XML data packet.

Unit

MidItems

Description

Use TWebStatus as a base class for components that generate HTML controls which indicate whether records have been inserted or modified by the user. TWebStatus descendants generate controls that are added to TDataGrid or TFieldGroup to provide feedback about modifications to the underlying XML data packet.

TWebStatus defines or inherits properties and methods for

Generating a caption that describes the information displayed.

Customizing the appearance of the control.

Fitting the control into the tab order of the generated HTML form.

Fitting the component into a hierarchy of Web items that collectively generate the content of an HTML document.

In order to let other Web items to use the HTML control it generates, TWebStatus inherits the IWebContent interface from TWebDataDisplay.

Do not create instances of TWebStatus. Instead, use a descendant of TWebStatus such as TFieldStatus or TStatusColumn.


TWebStatus properties

TWebStatus	Alphabetically	Legend

In TWebStatus

DisplayWidth

Derived from TWebDataDisplay

Caption

CaptionAttributes

CaptionPosition

Custom

Style

StyleRule

TabIndex

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TWebStatus properties

TWebStatus	By object	Legend

Caption

CaptionAttributes

CaptionPosition

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

DisplayWidth

Name

Owner

Style

StyleRule

TabIndex

Tag

VCLComObject


TWebStatus.DisplayWidth

TWebStatus

Specifies the width, in characters, of the generated HTML control.

property DisplayWidth: Integer;

Description

Use DisplayWidth to control the width of the HTML control that displays record status information. By default, DisplayWidth is 1 because the TWebStatus control values are one character (M for modified or I for inserted).


TWebStatus methods

TWebStatus	Alphabetically

In TWebStatus

Create

Identifier

Derived from TWebDataDisplay

Destroy

GetParentComponent

HasParent

IsColumn

IsQueryField

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWebStatus methods

TWebStatus	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

Identifier

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsColumn

IsQueryField

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TWebStatus.Create

TWebStatus	See also

Creates and initializes an instance of TWebStatus.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TWebStatus at runtime. TWebStatus descendants added at design time using the Web Page editor are instantiated automatically.


TWebStatus.Identifier

TWebStatus

Returns the name under which record status information is stored in the XML data packet.

class function Identifier: string;

Description

Call Identifier to determine the name of the pseudo-field in the XML data packet that stores the status information displayed by the generated control.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebDataDisplay


TWebTextAreaInput

Hierarchy	Properties	Methods	See also

TWebTextAreaInput is the base class for Web items that create HTML multi-line text controls.

Unit

MidItems

Description

Use TWebTextAreaInput as a base class for components that generate HTML controls for displaying a field or parameter value in a multi-line text control. TWebTextAreaInput descendants generate controls that are organized by TDataGrid, TFieldGroup, or TQueryFieldGroup.

TWebTextAreaInput defines or inherits properties and methods for

Specifying a field or parameter whose value the control displays.

Generating a caption that describes the information displayed.

Customizing the appearance of the control that displays information.

Fitting the control into the tab order of the generated HTML form.

Fitting the component into a hierarchy of Web items that collectively generate the content of an HTML document.

In order to let other Web items to use the HTML control it generates, TWebTextAreaInput inherits the IWebContent interface from TWebDataDisplay.

Do not create instances of TWebTextAreaInput. Instead, use a descendant of TWebTextAreaInput such as TFieldTextArea, TQueryTextArea, or TTextAreaColumn.


TWebTextAreaInput properties

TWebTextAreaInput	Alphabetically	Legend

In TWebTextAreaInput

DisplayRows

DisplayWidth

ReadOnly

Wrap

Derived from TWebDataInput

FieldName

Derived from TWebDataDisplay

Caption

CaptionAttributes

Custom

Style

StyleRule

TabIndex

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TWebTextAreaInput properties

TWebTextAreaInput	By object	Legend

Caption

CaptionAttributes

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

DisplayRows

DisplayWidth

FieldName

Name

Owner

ReadOnly

Style

StyleRule

TabIndex

Tag

VCLComObject

Wrap


TWebTextAreaInput.DisplayRows

TWebTextAreaInput	See also

Specifies the height of the generated control.

property DisplayRows: Integer;

Description

Use DisplayRows to indicate the desired height of the generated HTML control. DisplayRows specifies the number of lines of text that can be displayed in the control. This value is assigned to the ROWS option of the generated TEXTAREA tag.


TWebTextAreaInput.DisplayWidth

TWebTextAreaInput	See also

Specifies the horizontal size of the generated control.

property DisplayWidth: Integer;

Description

Use DisplayWidth to indicate the desired width of the generated HTML control. DisplayWidth specifies the number of characters that can be displayed in one line of the control. This value is assigned to the COLS option of the generated TEXTAREA tag.


TWebTextAreaInput.ReadOnly

TWebTextAreaInput

Indicates whether end-users can use the generated control to set values.

property ReadOnly: Boolean;

Description

Use ReadOnly to indicate whether users can change the value displayed by the generated control. This value determines whether there is a READONLY option added to the generated TEXTAREA tag.


TWebTextAreaInput.Wrap

TWebTextAreaInput	See also

Specifies how the generated control treats lines that are longer than the display width.

type TTextAreaWrap = (wrOff, wrPhysical, wrVirtual);

property Wrap: TTextAreaWrap;

Description

Use Wrap to specify how the generated control formats lines that are longer than the number of characters specified by DisplayWidth. TWebTextAreaInput uses Wrap to add a WRAP option to the generated TEXTAREA tag.

Wrap can have any of the following values:

Value	WRAP option value	Meaning

wrOff	OFF	The control does not wrap long lines. Only newline characters that are part of the text string cause the lines in the control to wrap.

wrPhysical	PHYSICAL	The control formats its text value by wrapping long lines so that no text is hidden. The control inserts carriage returns into the text string.

wrVirtual	VIRTUAL	The control formats its text value by wrapping long lines so that no text is hidden but does not change the actual value of the text string.


TWebTextAreaInput methods

TWebTextAreaInput	Alphabetically

In TWebTextAreaInput

Create

Derived from TWebDataDisplay

Destroy

GetParentComponent

HasParent

IsColumn

IsQueryField

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWebTextAreaInput methods

TWebTextAreaInput	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsColumn

IsQueryField

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TWebTextAreaInput.Create

TWebTextAreaInput	See also

Creates and initializes an instance of TWebTextAreaInput.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TWebTextAreaInput at runtime. TWebTextAreaInput descendants added at design time using the Web Page editor are instantiated automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebDataDisplay

TWebDataInput


TWebTextInput

Hierarchy	Properties	Methods	See also

TWebTextInput is the base class for Web items that create HTML single-line text controls.

Unit

MidItems

Description

Use TWebTextInput as a base class for components that generate HTML controls for displaying a field or parameter value as a single-line text string. TWebTextInput descendants generate controls that are organized by TDataGrid, TFieldGroup, or TQueryFieldGroup.

TWebTextInput defines or inherits properties and methods for

Specifying a field or parameter whose value the control displays.

Generating a caption that describes the information displayed.

Customizing the appearance of the control that displays information.

Fitting the control into the tab order of the generated HTML form.

Fitting the component into a hierarchy of Web items that collectively generate the content of an HTML document.

In order to let other Web items to use the HTML control it generates, TWebTextInput inherits the IWebContent interface from TWebDataDisplay.

Do not create instances of TWebTextInput. Instead, use a descendant of TWebTextInput such as TFieldText, TQueryText, or TTextColumn.


TWebTextInput properties

TWebTextInput	Alphabetically	Legend

In TWebTextInput

DisplayWidth

ReadOnly

Derived from TWebDataInput

FieldName

Derived from TWebDataDisplay

Caption

CaptionAttributes

Custom

Style

StyleRule

TabIndex

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TWebTextInput properties

TWebTextInput	By object	Legend

Caption

CaptionAttributes

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

DisplayWidth

FieldName

Name

Owner

ReadOnly

Style

StyleRule

TabIndex

Tag

VCLComObject


TWebTextInput.DisplayWidth

TWebTextInput

Specifies the horizontal size of the generated control.

property DisplayWidth: Integer;

Description

Use DisplayWidth to indicate the desired width of the generated HTML control. DisplayWidth specifies the number of characters that can be displayed in the control.

Note:	DisplayWidth controls the size of the generated control, not the size of the text that users can enter. If the user enters a string longer than DisplayWidth characters, the text scrolls in the control.


TWebTextInput.ReadOnly

TWebTextInput

Indicates whether end-users can use the generated control to set values.

property ReadOnly: Boolean;

Description

Use ReadOnly to indicate whether users can change the value displayed by the generated control.


TWebTextInput methods

TWebTextInput	Alphabetically

In TWebTextInput

Create

Derived from TWebDataDisplay

Destroy

GetParentComponent

HasParent

IsColumn

IsQueryField

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWebTextInput methods

TWebTextInput	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsColumn

IsQueryField

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TWebTextInput.Create

TWebTextInput	See also

Creates and initializes an instance of TWebTextInput.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TWebTextInput descendant at runtime. TWebTextInput descendants added at design time using the Web Page editor are instantiated automatically.


TWebTextInput.Destroy

TWebTextInput	See also

Frees an instance of TWebTextInput.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, use the Free method, which checks that the component is not nil, and only then calls Destroy.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebDataDisplay

TWebDataInput


 TXMLBroker

Hierarchy	Properties	Methods	Events	See also

TXMLBroker fetches XML data packets from an application server and applies XML updates to the application server.

Unit

xmlbrokr

Description

Use TXMLBroker in an application that is simultaneously a MIDAS client and a Web server application. This class servers two major functions:

It fetches XML data packets from the application server using the IAppServer interface.

It receives HTTP messages from Web browsers that contain XML delta packets and applies them to the application server.

Add a TXMLBroker object to a Web module to make database information supplied by a provider on the application server available as XML. A MIDAS page producer in the same Web module uses this XML to build HTML pages that represent that database information.

The XML broker automatically registers itself with the Web module (or Web dispatcher) as an auto-dispatching object. This means that the Web module or Web dispatcher forwards all incoming HTTP messages directed to the XML broker without requiring the use of Web action items.

These incoming messages are assumed to be update messages created by the browser in response to HTML generated by a TApplyUpdatesButton component. The XML broker automatically applies the delta packet (the content of the HTTP request message) to the application server, and passes any update errors to a separate content producer, which can generate a response message.


TXMLBroker properties

TXMLBroker	Alphabetically	Legend

In TXMLBroker

AppServer

Connected

HasAppServer

MaxErrors

MaxRecords

Notify

NotifyCount

Params

ProviderName

ReconcileProducer

RemoteServer

WebDispatch

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TXMLBroker properties

TXMLBroker	By object	Legend

AppServer

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Connected

DesignInfo

HasAppServer

MaxErrors

MaxRecords

Name

Notify

NotifyCount

Owner

Params

ProviderName

ReconcileProducer

RemoteServer

Tag

VCLComObject

WebDispatch


TXMLBroker.AppServer

TXMLBroker	See also

Provides access to the interface the XML broker uses to communicate with the application server.

property AppServer: IAppServer;

Description

Use AppServer to communicate with the providers that supply data to and resolve updates for the XML broker. If the providers are on a remote application server, AppServer has the same value as the AppServer property of the connection component. If the XML broker uses a provider in the same process space, AppServer is the interface to an internally created object that dispatches IAppServer calls to the local provider.

Applications don’t need to work directly with the IAppServer interface. The properties and methods of the XML broker are automatically translated into IAppServer calls as needed.


TXMLBroker.Connected

TXMLBroker	See also

Determines whether the XML broker has an active connection to the provider that supplies its data and applies its updates.

property Connected: Boolean;

Description

Use Connected to determine whether the XML broker can supply XML data packets and apply updates. If the XML broker uses a provider on an application server, setting Connected to True sets the Connected property of the connection component to True. If the XML broker uses a local provider component, setting Connected to True causes the XML broker to generate an internal object that communicates with the provider using the IAppServer interface. Thus, the value of Connected indicates whether an IAppServer interface is available for communicating with a provider, and so the value of Connected is the same as the value of HasAppServer.

You can’t set Connected to True unless the XML broker has a provider to which it can connect. Trying to set Connected to True before the ProviderName property is set or a local provider is assigned using the SetProvider method causes the XML broker to raise an exception.

Note:	In the Web Page editor, default fields or parameter values may not appear if the associated XML broker is not connected.


TXMLBroker.HasAppServer

TXMLBroker	See also

Indicates whether the XML broker has an IAppServer interface for communicating with its provider.

property HasAppServer: Boolean;

Description

Read HasAppServer to determine whether the XML broker can get its data from an IAppServer interface. When HasAppServer is True, the XML broker can interact with its provider through the IAppServer interface.

Use HasAppServer to check whether the XML broker is connected rather than reading the AppServer property. Reading AppServer causes the XML broker to obtain an IAppServer interface if it does not already have one.


TXMLBroker.MaxErrors

TXMLBroker	See also

Specifies the maximum number of update errors allowed before aborting an update operations.

property MaxErrors: Integer;

Description

Set MaxErrors to indicate the maximum number of errors that the associated provider should allow before prematurely stopping an update operation. Set MaxErrors to –1 to indicate that there is no limit to the number of errors.


TXMLBroker.MaxRecords

TXMLBroker	See also

Specifies the maximum number of records that can appear in XML data packets.

property MaxRecords: Integer;

Description

Set MaxRecords to limit the size of XML data packets retrieved from the associated provider.

When MaxRecords is –1, XML data packets contain all the records in the provider’s dataset.

When MaxRecords is 0, XML data packets contain only metadata.

When MaxRecords is greater than 0, XML data packets contain up to MaxRecords records, depending on the number of records in the provider’s dataset.

Tip:	Because an InternetExpress application sends the entire data packet to client applications, it is important to limit the size of data packets. Otherwise, the time to download web pages containing data packets can be prohibitively long.

Note:	When limiting the number of records that appear in data packets, you may need to fetch several data packets before all data is returned. Because MIDAS Web applications are always stateless, you will need to supply information about what record should start the next data packet as the OwnerData parameter of GetXMLRecords or RequestRecords. You can use a query form to obtain information about the last record seen by a particular Web client.


TXMLBroker.Notify

TXMLBroker	See also

Lists the objects that are notified when any properties affecting the XML broker’s connection to its provider change.

property Notify[Index: Integer]: TObject;

Description

Read Notify to access the objects that respond when the XML broker’s connection to its provider changes. These objects are sent a notification when the ProviderName, AppServer, or RemoteServer property changes.

Most applications do not need to use the Notify property. It allows the Web page editor to remain synchronized with property changes made at design time.


TXMLBroker.NotifyCount

TXMLBroker	See also

Indicates the number of objects in the Notify property list.

property NotifyCount: Integer;

Description

NotifyCount specifies the number of objects listed in the Notify property.


TXMLBroker.Params

TXMLBroker	See also	Example

Contains parameter values that are sent to or retrieved from the application server.

property Params: TXMLParams;

Description

Use Params to specify parameter values that should be passed to a source dataset on the application server. These parameter values are used in one of two ways:

If the associated provider represents a query or stored procedure, they supply parameter values that the application server uses when executing the query or stored procedure.

If the associated provider represents a table, they limit the records that are sent in data packets so that they only include records where each field with the same name as a parameter has the same value as the parameter.

After the application specifies parameters (at design time or runtime), they are sent to the application server automatically when the XML broker fetches data.

To send parameter values to a query or stored procedure, add a parameter object (TParam) to Params for every parameter on the query or stored procedure for which you want to supply a value. Assign each parameter object the same Name, DataType, and ParamType as the corresponding parameter on the query or stored procedure. These values are automatically encoded and sent to the application server when the XML broker fetches data.

To send parameter values to a table, add a parameter object for each field in the table that is used to limit the values sent in data packets. Assign each parameter object the same Name and DataType as the corresponding field component on the table. These parameter values are automatically sent when the client dataset fetches data, and the records returned in data packets from the application server only contain records that match the assigned value on the corresponding fields.

Tip:	You can assign parameter values from the content fields supplied to a request message by TSubmitQueryButton using the AssignStrings method of Params.

Note:	To initialize Params so that it reflects the parameters of a query or stored procedure on an application server, call the FetchParams method.


TXMLBroker.ProviderName

TXMLBroker	See also

Specifies the name of a registered provider from the application server.

property ProviderName: string;

Description

Use ProviderName to specify the provider with which to communicate on the server (or in the same Web module). This property is passed as a parameter to IAppServer interface calls when the XML broker fetches data or applies updates. If an application server contains multiple provider objects, an XML broker can set ProviderName to any of them once the connection component establishes a connection to the application server.

If the connection component is a Web connection or socket connection, or if the application server is registered on the client system (using TRegsvr.exe), ProviderName can be set from a drop-down in the Object Inspector once the RemoteServer property is set.

Note:	ProviderName can also be used to link the XML broker to a provider in the same process space, as long as the provider component has the same Owner as the XML broker. If the local provider component has a different Owner, use the SetProvider method instead.


TXMLBroker.ReconcileProducer

TXMLBroker	See also

Specifies the producer that generates response message content when an update generates errors.

property ReconcileProducer: TCustomContentProducer;

Description

Use ReconcileProducer to specify the component that generates the content of response messages to update requests when the update operation generated errors.

When the XML broker applies updates, the application server returns a delta packet containing all records that could not be updated because of errors. The XML broker can attempt to respond to those errors or generate its own response message using the OnGetErrorResponse event. However, unless the OnGetErrorResponse event handler generates an HTML document to be sent in the response message and indicates that the update is completely handled, the XML broker must still generate a response to the update operation. To do so, it calls the Content method of the ReconcileProducer to generate the content of the response message.

Tip:	The Reconcile producer will probably need information about the update errors that the application server returned. You can provide it with this information either by initializing the Reconcile producer in an OnGetErrorResponse event handler or by having the Reconcile producer call the GetErrors method.

Note:	If there is no ReconcileProducer assigned and an update generates errors, the XML broker raises an exception unless the OnGetErrorResponse event handler generates a response message.

Tip:	The InetXCustom demo contains a TReconcilePageProducer component that you can use as the value of the ReconcileProducer property or as the basis of your own reconcile producer.


TXMLBroker.RemoteServer

TXMLBroker	See also

Specifies the connection component that this XML broker uses to connect to an application server.

property RemoteServer: TCustomRemoteServer;

Description

Use RemoteServer to specify the connection component that establishes a connection to the remote application server. The connection component obtains an IAppServer interface for data exchange and maintains the interface of the remote data module on the application server.

If a Web application uses more than connection component, the application can change which connection an XML broker uses by changing the value for this property.


TXMLBroker.WebDispatch

TXMLBroker	See also

Lets the Web dispatcher identify what HTTP messages should be forwarded to the XML broker.

property WebDispatch: TWebDispatch;

Description

Use WebDispatch to specify the HTTP messages to which the XML broker responds. Typically, these originate from a button added to HTML forms by TApplyUpdatesButton.

The TWebDispatch object that implements WebDispatch includes properties that let you specify the path portion of URLs to which the XML broker responds, as well as the types of messages it accepts (typically post messages). You can also use this property to disable the XML broker so that the Web dispatcher does not send it any HTTP messages. When the XML broker is disabled in this way, it can still provide XML data packets to a MIDAS page producer, but any update messages must be handled by a Web action item.


TXMLBroker events

TXMLBroker	Alphabetically	Legend

In TXMLBroker

AfterDispatch

BeforeDispatch

OnGetErrorResponse

OnGetResponse

OnRequestRecords

OnRequestUpdate


TXMLBroker events

TXMLBroker	By object	Legend

AfterDispatch

BeforeDispatch

OnGetErrorResponse

OnGetResponse

OnRequestRecords

OnRequestUpdate


TXMLBroker.AfterDispatch

TXMLBroker	See also

Occurs after the XML broker generates the content of a response message.

property AfterDispatch: THTTPMethodEvent;

Description

Write an AfterDispatch event handler to perform any final actions before sending a response back to the Web browser that sent the XML broker an update message. Usually by the time AfterDispatch occurs, the XML broker has already applied the updates and generated the response message (using the ReconcileProducer or one of the events that occurs when the XML broker receives an update request).


TXMLBroker.BeforeDispatch

TXMLBroker	See also

Occurs when the XML broker receives an HTTP request message.

property BeforeDispatch: THTTPMethodEvent;

Description

Write a BeforeDispatch event handler to initialize the response to an update request or to handle any messages sent to the XML broker that are not update requests. If the event handler completely handles the request, filling out the response object so that it is ready to send, it should set the Handled parameter to True, thereby preventing the XML broker from applying the updates.

Unless the BeforeDispatch event handler sets the Handled parameter to True, the XML broker receives an OnRequestUpdate event after the BeforeDispatch event handler exits. After the OnRequestUpdate event, the XML broker applies the updates to the application server and generates the contents of the response based on whether there were any update errors. Finally, the XML broker receives an AfterDispatch event where it can perform any final changes to the response message before it is sent back to the Web browser.

If the BeforeDispatch event handler sets the Handled parameter to True, the XML broker receives an AfterDispatch event, but does not attempt to apply updates from the request message or receive any of the events that accompany that process.


TXMLBroker.OnGetErrorResponse

TXMLBroker	See also

Occurs when there are errors applying updates to the application server.

type TGetErrorResponseEvent = procedure (Sender: TObject; ErrorCount: Integer; XMLErrors: string; Request: TWebRequest; Response: TWebResponse; var Handled: Boolean) of object;

property OnGetErrorResponse: TGetErrorResponseEvent;

Description

Write an OnGetErrorResponse event handler to generate the response message after an update request encountered errors or to initialize a ReconcileProducer before it generates the response.

The Sender parameter is the XML broker that applied updates to the application server and received back a delta packet of update errors.

ErrorCount is the number of update errors found by the application server before it halted the update operation.

XMLErrors is a string of XML returned by the application server. It is a delta packet containing all the updates that could not be applied.

Request is the original request message that contains the delta packet of updates from the Web browser.

Response is the emerging response message that will be sent to the Web browser in response to the update request. Fill in the properties of this object to generate a response (such as an error message or a reconcile form) that indicates the errors in XMLErrors.

Handled indicates whether the event handler completed filling out Response. Set Handled to True if the event handler completes the response for the Web browser. Leave Handled as False if ReconcileProducer should generate the content of Response.

Note:	If the OnGetErrorResponse event handler does not set Handled to True and there is no ReconcileProducer, the XML broker raises an exception.


TXMLBroker.OnGetResponse

TXMLBroker	See also

Occurs when there are no errors applying updates to the application server.

type TGetResponseEvent = procedure (Sender: TObject; Request: TWebRequest; Response: TWebResponse; var Handled: Boolean) of object;

property OnGetResponse: TGetResponseEvent;

Description

Write an OnGetResponse event handler to edit the response message after an update request is successfully applied.

The Sender parameter is the XML broker that applied updates to the application server with no errors.

Request is the original request message that contains the delta packet of updates from the Web browser.

Response is the emerging response message that will be sent to the Web browser in response to the update request. Fill in the properties of this object to generate a response (such as refreshing the data).

Handled indicates whether the event handler completed filling out Response. Set Handled to True if the event handler completes the response for the Web browser. Leave Handled as False if the XML broker should send a redirect response that sends the browser back to the page that generated the update request.


TXMLBroker.OnRequestRecords

TXMLBroker	See also	Example

Occurs when the XML broker needs to fetch a data packet from its associated provider.

type TRequestRecordsEvent = procedure (Sender: TObject; Request: TWebRequest; out RecCount: Integer; var OwnerData: OleVariant; var Records: string) of object;

property OnRequestRecords: TRequestRecordsEvent;

Description

Write an OnRequestRecords event handler to provide an alternate mechanism for providing XML data packets or to perform other actions whenever the XML broker needs to fetch an XML data packet. For example, the OnRequestRecords event handler might call GetXMLRecords to fetch an XML data packet from the application server and then edit its contents.

OnRequestRecords occurs when the MIDAS page producer requests an XML data packet (usually in response to a request message) or when the application calls the XML broker’s RequestRecords method.

The Sender parameter is the object that originates the request (usually a MIDAS page producer).

Request is the request message that prompted the request for an XML data packet. This value may be nil if the request did not arise from a MIDAS page producer or if  the MIDAS page producer is not processing a request message.

OwnerData contains an application-defined variant that is sent to the provider’s BeforeGetRecords event handler. The MIDAS page producer that is requesting records or the caller of RequestRecords may initialize this value. OwnerData can be used to pass persistent state information to a stateless application server (for example, the first record that should appear in the data packet when MaxRecords is greater than 0).

Records optionally returns an XML data packet as a string. If Records is an empty string on exit from the event handler, the XML broker automatically fetches the XML data packet from its associated provider. Otherwise, the XML broker uses the value of Records as the new XML data packet.


TXMLBroker.OnRequestUpdate

TXMLBroker	See also

Occurs immediately before the XML broker applies updates to the application server.

type TRequestUpdateEvent = procedure (Sender: TObject; Request: TWebRequest; Response: TWebResponse; var Handled: Boolean) of object;

property OnRequestUpdate: TRequestUpdateEvent;

Description

Write an OnRequestUpdate event handler to provide an alternate mechanism for applying updates to the application server. For example, the OnRequestUpdate event handler might call GetDelta to extract the delta packet from the request message and then preprocess the XML string before applying the updates with a call to ApplyXMLUpdates.

OnRequestUpdate occurs immediately after the BeforeDispatch event or when the application calls the XML broker’s RequestUpdate method.

The Sender parameter is the object that received the update request (the XML broker or a Web action item).

Request is the request message that contains the updates to be applied. The XML delta packet can be extracted from this request object using the GetDelta method.

Response is the emerging response message that will be sent back to the Web browser that generated the update request. The event handler can set properties on this response object to partially or completely specify the message will be returned to the Web browser.

Handled indicates whether the event handler applied the updates. If Handled is True on exit from the event handler, the XML broker does not apply the updates, does not receive an OnGetResponse or OnGetErrorResponse event, and does not call on the ReconcileProducer to generate a response message. (It does still receive an AfterDispatch event). If Handled is False on exit from the event handler, the XML broker proceeds to apply the updates contained in the request message and receives all the associated events.

Note:	If the event handler applies the updates, it must also generate the response message.


TXMLBroker methods

TXMLBroker	Alphabetically

In TXMLBroker

AddNotify

ApplyXMLUpdates

Create

Destroy

FetchParams

GetDelta

GetErrorCount

GetErrors

GetXMLRecords

HTMLSubmitFormName

MasterRowSetVarName

RemoveNotify

RequestRecords

RequestUpdate

RowSetVarName

SetProvider

SubmitFormVarName

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TXMLBroker methods

TXMLBroker	By object

AddNotify

AfterConstruction

ApplyXMLUpdates

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FetchParams

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetDelta

GetErrorCount

GetErrors

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetXMLRecords

HasParent

HTMLSubmitFormName

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MasterRowSetVarName

MethodAddress

MethodName

NewInstance

RemoveComponent

RemoveNotify

RequestRecords

RequestUpdate

RowSetVarName

SafeCallException

SetProvider

SubmitFormVarName

UpdateAction


TXMLBroker.AddNotify

TXMLBroker	See also

Adds an object to the Notify property list.

procedure AddNotify(ANotify: TObject);

Description

Call AddNotify to add an object to the list maintained by the Notify property. Each object in this list is notified every time a property that affects the metadata of the XML broker’s data packets changes. These include changes to the RemoteServer, AppServer, and ProviderName properties.

ANotify specifies the object that wants to be notified of property changes. This object must support the INotifyConnectionChange interface, which the XML broker uses to notify it of changes.


TXMLBroker.ApplyXMLUpdates

TXMLBroker	See also

Sends an XML delta packet of updated, inserted, and deleted records to the provider on the application server for writing to the database.

function ApplyXMLUpdates(const Delta: string; out ErrorCount: Integer): string;

Description

Call ApplyXMLUpdates to send the updates in the XML delta packet specified by Delta to the application server. ApplyXMLUpdates is used internally (by the RequestUpdate method) to apply updates in an XML delta packet and retrieve a delta packet containing any failed updates.

Delta is the XML delta packet that contains the insertions, deletions and modifications from a Web browser. Typically, it is retrieved from an HTTP request message using the GetDelta method.

ErrorCount returns the number of errors encountered on the application server before it terminated the update operation. If ErrorCount is 0, all updates were applied successfully. ErrorCount can not exceed the value of MaxErrors.

ApplyXMLUpdates returns an XML delta packet containing all updates that were not successfully applied.  If ErrorCount is 0, this is an empty string.


TXMLBroker.Create

TXMLBroker	See also

Creates a new TXMLBroker object.

constructor Create(AOwner: TComponent); override;

Description

Most applications do not need to call the XML broker constructor. Typically the XML broker is added to a Web module at design time, so that the constructor is called automatically.

 The Owner parameter specifies the component (usually the Web module) that is responsible for freeing the XML broker.


TXMLBroker.Destroy

TXMLBroker	See also

Frees the memory associated with the TXMLBroker object.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead,call Free, which verifies that the XML broker is not nil before calling Destroy.


TXMLBroker.FetchParams

TXMLBroker	See also	Example

Retrieves parameter values from the application server.

function FetchParams; virtual;

Description

Call FetchParams to initialize the Params property with the current parameter values on the application server. FetchParams does nothing unless the provider component on the application server can supply parameter values.

Warning:	if the XML broker uses a stateless application server, other clients can change the values returned by FetchParams at any time.


TXMLBroker.GetDelta

TXMLBroker	See also

Extracts an XML delta packet from an HTTP request message.

function GetDelta(Request: TWebRequest): string;

Description

Call GetDelta to obtain the XML delta packet contained in the content of the request message specified by Request. This value can be used to apply the updates from the request message by calling ApplyXMLUpdates.


TXMLBroker.GetErrorCount

TXMLBroker	See also

Returns the number of errors in the delta packet returned by GetErrors.

function GetErrorcount: Integer;

Description

Call GetErrorCount to determine the number errors included in the XML delta packet that the application server returns when an update operation causes errors.


TXMLBroker.GetErrors

TXMLBroker	See also

Returns the XML delta packet (if any) that describes the errors that occurred when applying updates.

function GetErrors: string;

Description

Call GetErrors to obtain the XML delta packet returned by the application server when an update operation included some errors.

Note:	See the template err.html (included with Delphi in the WebMidas directory) for one possible use for the XML delta packet of errors. In err.html, the string returned by GetErrors should replace the <#XMLEMBED_VAR_ERR> tag.


TXMLBroker.GetXMLRecords

TXMLBroker	See also

Retrieves an XML data packet from the application server.

function GetXMLRecords(var RecsOut: Integer; var OwnerData: OleVariant; XMLOptions: TXMLOptions): string;

Description

Call GetXMLRecords to obtain the XML data packet from the application server. GetXMLRecords calls the interface specified by AppServer, requesting an XML data packet with at most MaxRecords records. It returns the resulting XML data packet in a form that is ready for insertion into an HTML document.

RecsOut returns the number of records in the XML data packet.

On entry, OwnerData contains an application-defined value that is passed to the provider’s BeforeGetRecords event handler. OwnerData returns an application-defined value that is set by the provider’s AfterGetRecords event handler. Typically, this parameter is used to transmit persistent state information to and from a stateless application server.

XMLOptions is a set of flags that indicate how the broker should format the XML data packet after it is retrieved from the application server.

GetXMLRecords returns the formatted XML data packet.

Note:	Unlike the RequestRecords method, GetXMLRecords bypasses the OnRequestRecords event.


TXMLBroker.HTMLSubmitFormName

TXMLBroker	See also

Returns the name of the HTML form that submits updates to the XML broker.

function HTMLSubmitFormName: string;

Description

When the MIDAS page producer assembles an HTML document that uses the XML data packets managed by the XML broker, it declares an HTML form that submits the updates to the XML broker. HTMLSubmitFormName is the name of that HTML form.

The HTML form named by this return value sends the HTTP request messages containing an XML delta packet of updates to be applied.


TXMLBroker.MasterRowSetVarName

TXMLBroker	See also

Returns the name of the javascript variable for the XML broker’s dataset.

function MasterRowSetVarName(Path: TStrings): string;

Description

When the MIDAS page producer assembles an HTML document that uses the XML data packets managed by the XML broker, it declares a javascript variable of type RowSet for the javascript object that represents the XML broker’s dataset. When the variable is first declared, the MIDAS page producer calls MasterRowSetVarName.

Path is a set of variable names for all the master datasets for which the XML broker’s dataset is a detail set. These names come from previous calls to the MasterRowSetVarName method of their XML brokers. The last string in Path refers to the XML broker’s dataset itself.

MasterRowSetVarName returns the name of the XML broker, qualified by all strings in Path except for the last one, which is assumed to refer to the XML broker’s dataset. Thus, to change the name of the generated variable for an XML broker’s dataset, change the Name property of the XML broker.

Note:	To retrieve the name of the XML broker preceded by all the datasets in Path, use the RowSetVarName method instead.


TXMLBroker.RemoveNotify

TXMLBroker	See also

Removes an object to the Notify property list.

procedure RemoveNotify(ANotify: TObject);

Description

Call RemoveNotify to remove an object from the list maintained by the Notify property. Each object in this list is notified every time a property that affects the metadata of the XML broker’s data packets changes.


TXMLBroker.RequestRecords

TXMLBroker	See also

Returns an XML data packet from the application server.

function RequestRecords(Sender: TObject; Request: TWebRequest; out RecCount: Integer; var OwnerData: OleVariant; XMLOptions: TXMLOptions): string; virtual;

Description

Call RequestRecords to obtain a current XML data packet, while first allowing the OnRequestRecords event handler to customize it. After generating the OnRequestRecords event, RequestRecords fetches the XML data packet by calling GetXMLRecords, unless the event handler supplies the XML data packet first.

Sender is the object that is requesting the XML data packet (usually a MIDAS page producer).

Request describes an HTTP request message that originated the need for an XML data packet. Typically, this is a request message for which the MIDAS page producer is creating a response.

RecCount returns the number of records in the XML data packet.

On entry, OwnerData contains an application-defined value that is passed to the OnRequestRecords event handler, and then forwarded (with any changes provided by the event handler) to the provider’s BeforeGetRecords event handler. OwnerData returns an application-defined value that is set by the provider’s AfterGetRecords event handler. Typically, this parameter is used to transmit persistent state information to and from a stateless application server.

XMLOptions is a set of flags indicating how the XML broker should format the XML data packet that the application server or OnRequestRecords event handler supplies.

RequestRecords returns the XML data packet.


TXMLBroker.RequestUpdate

TXMLBroker	See also

Responds to an HTTP update request.

function RequestUpdate(Sender: TObject; Request: TWebRequest; Response: TWebResponse): Boolean; virtual;

Description

Call RequestUpdate when using a Web action item to respond to update requests from a Web browser. When using a Web action item to respond to update requests, instead of letting the XML broker receive the update requests directly, you should set the Enabled property of the WebDispatch to False.

RequestUpdate generates an OnRequestUpdate event, to allow the event handler to apply the updates in the HTTP request message and generate a response. If the OnRequestUpdate event handler does not handle the message, RequestUpdate applies the updates using the ApplyXMLUpdates method. Finally, if there are no update errors, RequestUpdate generates an OnGetResponse event. If there were update errors, RequestResponse generates an OnGetErrorResponse event and (if the event handler does not generate a response) assigns the content of ReconcileProducer to the response message. If there are update errors and the response is not completed by an event handler or the ReconcileProducer, the XML broker raises an exception.

Sender is the object that received the request message.

Request describes an HTTP request message that contains the updates that need to be applied.

Response is the emerging response object that should be completed by RequestUpdate so that the XML broker can send it back to the Web browser.

RequestUpdate returns True if the response message is ready to send back to the Web browser, False if it still needs more processing.


TXMLBroker.RowSetVarName

TXMLBroker	See also

Returns the name of the javascript variable for the XML broker’s dataset.

function RowSetVarName(Path: TStrings): string;

Description

When the MIDAS page producer assembles an HTML document that uses the XML data packets managed by the XML broker, it declares a javascript variable of type RowSet for the javascript object that represents the XML broker’s dataset. When the MIDAS page producer needs to determine whether a RowSet variable was already declared, it looks up the variable name by calling RowSetVarName.

Path is a set of variable names for all the master datasets for which the XML broker’s dataset is a detail set.

RowSetVarName returns the name of the XML broker, qualified by all strings in Path.

Note:	Variable names are assigned for an XML broker’s dataset using the MasterRowSetVarName method.


TXMLBroker.SetProvider

TXMLBroker	See also

Associates the XML broker with a provider in the same process space.

procedure SetProvider(Provider: TComponent);

Description

Use SetProvider to specify a local provider component that provides data to and applies updates from the XML broker. The XML broker communicates with this provider using the IAppServer interface specified by the AppServer property.

Do not use SetProvider for remote providers on an application server. If the provider is not in the same process space as the XML broker, use the ProviderName property.

The Provider parameter must be a descendant of TCustomProvider. Otherwise, SetProvider raises an exception.


TXMLBroker.SubmitFormVarName

TXMLBroker	See also

Returns the name of the variable that refers to the HTML form named by HTMLSubmitFormName.

function HTMLSubmitFormName: string;

Description

When the MIDAS page producer assembles an HTML document that uses the XML data packets managed by the XML broker, it declares an HTML form that submits the updates to the XML broker. In addition, it declares a variable that refers to that form. SubmitFormVarName is the name of that variable.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TXMLButton

Hierarchy	Properties	Methods	See also

TXMLButton is the base class for Web items that create HTML buttons that perform some action with the XML data packet.

Unit

MidItems

Description

Use TXMLButton as a base class for components that generate the HTML statements defining a specialized button control for manipulating an XML data packet.  TXMLButton defines properties and methods for

Generating the HTML code to define the button control.

Associating the button with an XML broker that fetches the XML data packet and responds to update messages.

Specifying tag attributes of the HTML button control, including those defined by a style sheet.

Fitting the component into a hierarchy of Web items, each of which generates part of a larger HTML document.

In order to allow other Web items to use the HTML generated by the button control, TXMLButton inherits support for the IWebContent interface from TWebButton.

Do not create instances of TXMLButton. TXMLButton relies on an abstract method to generate the HTML statements defining a button control. Trying to use an instance of TXMLButton will lead to an EAbstractError exception. Instead, create descendants of TXMLButton, such as TApplyUpdatesButton.


TXMLButton properties

TXMLButton	Alphabetically	Legend

In TXMLButton

Caption

XMLBroker

XMLUseParent

Derived from TWebButton

Custom

Style

StyleRule

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TXMLButton properties

TXMLButton	By object	Legend

Caption

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

XMLBroker

XMLUseParent


TXMLButton.Caption

TXMLButton	See also

Specifies the caption that appears on the button.

property Caption: string;

Description

Use Caption to specify the caption that appears on the generated HTML button. The value of Caption is used as the value of a VALUE parameter on the HTML INPUT tag generated to implement the button.


TXMLButton.XMLBroker

TXMLButton	See also

Associates the XML button with an XML broker.

property XMLBroker: TXMLBroker;

Description

Set XMLBroker to specify the XML broker whose data packets the XML button manipulates.

When XML buttons are used by TDataNavigator, the data navigator already establishes a connection (indirectly) to an XML broker. If the XML button uses this same XML broker, you do not need to set the XMLBroker property. Instead, setting the XMLUseParent property to True (the default) automatically associates the XML button with the same broker as the one associated with the navigator.


TXMLButton.XMLUseParent

TXMLButton	See also

Specifies whether the XML button is associated with its parent’s XML broker.

property XMLUseParent: Boolean;

Description

Use XMLUseParent to indicate how the XML button determines the XML broker whose data packets it manipulates. When XMLUseParent is False, the XMLBroker property must be set to indicate the XML broker. When XMLUseParent is True, the XML broker associated with the XML button’s parent determines the associated XML broker.

The XML button’s parent is the Web item (typically TDataNavigator) that uses the XML button to assemble its own HTML content. The parent’s associated broker may be defined through an indirect association. For example, the data navigator acts on another component, such as a field group, which has an associated broker.

If the parent does not have an associated XML broker, setting XMLUseParent to True sets the XMLBroker property to nil.


TXMLButton methods

TXMLButton	Alphabetically

In TXMLButton

Create

Destroy

Derived from TWebButton

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TXMLButton methods

TXMLButton	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TXMLButton.Create

TXMLButton	See also

Creates and initializes an instance of TXMLButton.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate an XML button at runtime. Web buttons added at design time using the Web Page editor are instantiated automatically.


TXMLButton.Destroy

TXMLButton

Frees an instance of TXMLButton.

destructor Destroy; override;

Description

Destroy removes the XML button from its parent’s list of components that generate HTML before freeing the button instance.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebButton


TXMLDisplayGroup

Hierarchy	Properties	Methods	See also

TXMLDisplayGroup is the base class for Web items that arrange a set of special-purpose controls in an HTML form.

Unit

MidItems

Description

Use TXMLDisplayGroup as a base class for Web items that generate the HTML to arrange a collection of HTML controls. Each TXMLDisplayGroup object maintains a list of Web items that display information in the final HTML document. The XML display group arranges the controls that these items generate.

If the controls generated for TXMLDisplayGroup by its Web items represent database information, you can bind the XML display group to an XML data packet or dataset field within an XML data packet. The Web items can use that binding to determine the source of the data they display.

In order to let other Web items use the HTML that the TXMLDisplayGroup object generates, TXMLDisplayGroup inherits the IWebContent interface from TWebControlGroup.

Do not create instances of TXMLDisplayGroup. TXMLDisplayGroup manages the Web items that generate display controls, but does not produce any content. Instead, use a descendant of TXMLDisplayGroup that generates the HTML for its set of specialized controls such as TDataGrid, TFieldGroup or TQueryFieldGroup.


TXMLDisplayGroup properties

TXMLDisplayGroup	Alphabetically	Legend

In TXMLDisplayGroup

VisibleFields

XMLBroker

XMLDataSetField

Derived from TWebControlGroup

WebFieldControls

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TXMLDisplayGroup properties

TXMLDisplayGroup	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject

VisibleFields

WebFieldControls

XMLBroker

XMLDataSetField


TXMLDisplayGroup.VisibleFields

TXMLDisplayGroup	See also

Indicates the controls displayed by the HTML that the XML display group generates.

property VisibleFields: TWebComponentList;

Description

Use VisibleFields to access the components that generate HTML controls for the XML display group. If a set of Web items is explicitly assigned to the WebFieldControls property, VisibleFields has the same value as WebFieldControls. Otherwise, VisibleFields represents a set of default Web items that generate display controls for all the fields or parameters of the associated dataset or dataset field.

When no Web items are assigned to WebFieldControls, the default Web items in the VisibleFields list are specific to the TXMLDisplayGroup descendant.


TXMLDisplayGroup.XMLBroker

TXMLDisplayGroup	See also

Binds the XML display group to an XML broker that represents a dataset.

property XMLBroker: TXMLBroker;

Description

Most XML display groups contain controls that represent database information. TDataGrid and TFieldGroup represent the fields from a dataset. By default, TQueryFieldGroup represents the parameter values for a query or stored procedure or field values that filter a table. XMLBroker indicates the XML broker component that fetches XML data packets for the dataset whose values the controls display.

If the controls arranged by TXMLDisplayGroup represent the data from a dataset nested within the XML broker’s data packet, use the XMLDataSetField to indicate which dataset field to use from the data packet associated with XMLBroker.


TXMLDisplayGroup.XMLDataSetField

TXMLDisplayGroup	See also

Binds the XML display group to a nested dataset from the XML data packet.

property XMLDataSetField: string;

Description

Most XML display groups contain controls that represent database information. TDataGrid and TFieldGroup represent the fields from a dataset. By default, TQueryFieldGroup represents the parameter values for a query or stored procedure or field values that filter a table. If the database information comes from the dataset represented by an XML broker’s data packet, XMLDataSetField is an empty string and the XML broker property fully describes the dataset. However, if the database information comes from a nested detail set, XMLDataSetField indicates what detail dataset to use from the data packet associated with XMLBroker.

Specify the name of the dataset field as the value of XMLDataSetField. If the XML display group is bound to the detail set of a detail set, you can use periods to qualify dataset field names. Thus, for example, if XMLBroker represents a customer dataset with a nested Orders dataset field that has its own nested LineItems field, you can bind the XML display group to the LineItems dataset by setting XMLDataSetField to

Orders.LineItems


TXMLDisplayGroup methods

TXMLDisplayGroup	Alphabetically

In TXMLDisplayGroup

Create

Destroy

Derived from TWebControlGroup

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TXMLDisplayGroup methods

TXMLDisplayGroup	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TXMLDisplayGroup.Create

TXMLDisplayGroup	See also

Creates and initializes an instance of TXMLDisplayGroup.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TXMLDisplayGroup at runtime. TXMLDisplayGroup components added at design time using the Web Page editor are instantiated automatically.


TXMLDisplayGroup.Destroy

TXMLDisplayGroup	See also

Frees an instance of TXMLDisplayGroup.

Description

Do not call Destroy directly. Instead, call Free, which checks that the object is not nil before calling Destroy.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebControlGroup


TXMLDisplayReferenceButton

Hierarchy	Properties	Methods	See also

TXMLDisplayReferenceButton is the base class for Web items that generate HTML buttons for influencing controls that display data.

Unit

MidItems

Description

Use TXMLDisplayReferenceButton as a base class for components that generate the HTML statements defining a specialized button control for working with a data display control in the Web page produced by TMidasPageProducer.

TXMLDisplayReferenceButton defines properties and methods for

Generating the HTML code to define the button.

Associating the button with another Web item that generates a data display control.

Specifying tag attributes of the HTML button control, including those defined by a style sheet.

Fitting the component into a hierarchy of Web items, each of which generates part of a larger HTML document.

In order to allow other Web items to use the HTML generated by the button control, TXMLDisplayReferenceButton inherits support for the IWebContent interface from TWebButton.

Do not create instances of TXMLDisplayReferenceButton. TXMLDisplayReferenceButton relies on an abstract method to generate the HTML statements defining a button control. Trying to use an instance of TXMLDisplayReferenceButton leads to an EAbstractError exception. Instead, create descendants of TXMLDisplayReferenceButton, such as TPostButton, TInsertButton, and so on.


TXMLDisplayReferenceButton properties

TXMLDisplayReferenceButton	Alphabetically	Legend

In TXMLDisplayReferenceButton

XMLComponent

XMLUseParent

Derived from TWebButton

Caption

Custom

Style

StyleRule

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TXMLDisplayReferenceButton properties

TXMLDisplayReferenceButton	By object	Legend

Caption

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Custom

DesignInfo

Name

Owner

Style

StyleRule

Tag

VCLComObject

XMLComponent

XMLUseParent


TXMLDisplayReferenceButton.XMLComponent

TXMLDisplayReferenceButton	See also

Associates the button with the component that generates the display control it influences.

property XMLComponent: TComponent;

Description

Set XMLComponent to specify the Web item that generates a display control that the button influences.

Note:	Typically, descendants of TXMLDisplayReferenceButton are used by a descendant of TXMLDisplayReferenceGroup, which has its own XMLComponent property. If the button influences this same component, you need not set the XMLComponent property. Instead, setting the XMLUseParent property to True (the default) sets XMLComponent to the value of the parent’s XMLComponent property.


TXMLDisplayReferenceButton.XMLUseParent

TXMLDisplayReferenceButton	See also

Specifies whether the button is associated with its parent’s display object.

property XMLUseParent: Boolean;

Description

Use XMLUseParent to indicate how the dataset button determines the component that it influences. When XMLUseParent is False, the XMLComponent property must be set to indicate the display component. When XMLUseParent is True, the button influences the component specified by its parent’s XMLComponent property.

The button’s parent is the Web item that uses the button to assemble its own HTML content (typically a TDataNavigator or TQueryButtons object). If the parent does not have an associated display component, setting XMLUseParent to True sets the XMLComponent property to nil.


TXMLDisplayReferenceButton methods

TXMLDisplayReferenceButton	Alphabetically

In TXMLDisplayReferenceButton

Create

Destroy

Derived from TWebButton

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TXMLDisplayReferenceButton methods

TXMLDisplayReferenceButton	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TXMLDisplayReferenceButton.Create

TXMLDisplayReferenceButton	See also

Creates and initializes an instance of TXMLDisplayReferenceButton.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a dataset button at runtime. Buttons added at design time using the Web Page editor are instantiated automatically.


TXMLDisplayReferenceButton.Destroy

TXMLDisplayReferenceButton

Frees an instance of TXMLDisplayReferenceButton.

destructor Destroy; override;

Description

Destroy removes the button from its parent’s list of components that generate HTML.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebButton


TXMLDisplayReferenceGroup

Hierarchy	Properties	Methods	See also

TXMLDisplayReferenceGroup is the base class for Web items that arrange a set of button controls that influence a control that displays data.

Unit

MidItems

Description

Use TXMLDisplayReferenceGroup as a base class for Web items that generate the HTML to arrange a collection of button controls. Each TXMLDisplayGroup object has an associated Web item that generates controls that display data in the final HTML document. The buttons arranged by TXMLDisplayReferenceGroup manipulate the information the display controls show.

In order to let other Web items use the HTML that the TXMLDisplayReferenceGroup object generates, TXMLDisplayReferenceGroup inherits the IWebContent interface from TWebControlGroup.

Do not create instances of TXMLDisplayReferenceGroup. TXMLDisplayReferenceGroup manages the Web items that generate buttons and the association to a display generator, but does not produce any content. Instead, use a descendant of TXMLDisplayReferenceGroup that generates the HTML for its set of specialized buttons such as TDataNavigator or TQueryButtons.


TXMLDisplayReferenceGroup properties

TXMLDisplayReferenceGroup	Alphabetically	Legend

In TXMLDisplayReferenceGroup

XMLComponent

Derived from TWebControlGroup

WebFieldControls

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TXMLDisplayReferenceGroup properties

TXMLDisplayReferenceGroup	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject

WebFieldControls

XMLComponent


TXMLDisplayReferenceGroup.XMLComponent

TXMLDisplayReferenceGroup	See also

Associates the group with a component that generates HTML display controls.

property XMLComponent: TComponent;

Description

Use XMLComponent to associate the group of buttons with a Web item that generates the display controls those buttons influence. Typical values of XMLComponent are TFieldGroup or TDataGrid.

If all the buttons arranged by the TXMLDisplayReferenceGroup object operate on the same set of display controls, it is most efficient to specify the Web item generating these controls as the value of XMLComponent. Then, each button uses this value to determine its associated display controls when its XMLUseParent property is True. Any buttons that do not operate on the display controls generated by XMLComponent can set their own XMLComponent property to another Web item.


TXMLDisplayReferenceGroup methods

TXMLDisplayReferenceGroup	Alphabetically

In TXMLDisplayReferenceGroup

Create

Destroy

Derived from TWebControlGroup

GetParentComponent

HasParent

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TXMLDisplayReferenceGroup methods

TXMLDisplayReferenceGroup	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TXMLDisplayReferenceGroup.Create

TXMLDisplayReferenceGroup	See also

Creates and initializes an instance of TXMLDisplayReferenceGroup.

constructor Create(AOwner: TComponent); override;

Description

Call TXMLDisplayReferenceGroup to instantiate TXMLDisplayReferenceGroup at runtime. TXMLDisplayReferenceGroup components added at design time using the Web Page editor are instantiated automatically.


TXMLDisplayReferenceGroup.Destroy

TXMLDisplayReferenceGroup	See also

Frees an instance of TXMLDisplayReferenceGroup.

Description

Do not call Destroy directly. Instead, call Free, which checks whether the object is not nil before calling Destroy.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TWebControlGroup


TXMLParams

Hierarchy	Properties	Methods	See also

TXMLParams manages a list of parameters for an XML broker.

Unit

Xmlbrokr

Description

XML brokers use TXMLParams to manage a list of parameters that it passes to a provider on the application server. These parameters supply values to a query or stored procedure on the application server, or limit the records provided from a table on the application server.

Use the properties and methods of TXMLParams to:

Access a specific parameter.

Add or delete parameters from the list.

Get or set the values of individual parameters.

Assign parameter values from a list such as the one supplied in a request message from a Web browser.

Compare parameters.

Iterate through all parameters.

Copy a set of parameters to another parameter list.


TXMLParams properties

TXMLParams	Alphabetically	Legend

Derived from TParams

Items

ParamValues

Derived from TCollection

Count

ItemClass


TXMLParams properties

TXMLParams	By object	Legend

Count

ItemClass

Items

ParamValues


TXMLParams methods

TXMLParams	Alphabetically

In TXMLParams

AssignStrings

Derived from TParams

AddParam

AssignValues

Create

CreateParam

FindParam

GetParamList

IsEqual

ParamByName

ParseSQL

RemoveParam

Derived from TCollection

Add

Assign

BeginUpdate

Clear

Delete

Destroy

EndUpdate

FindItemID

GetNamePath

Insert

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TXMLParams methods

TXMLParams	By object

Add

AddParam

AfterConstruction

Assign

AssignStrings

AssignValues

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

CreateParam

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

FindItemID

FindParam

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParamList

InheritsFrom

InitInstance

Insert

InstanceSize

IsEqual

MethodAddress

MethodName

NewInstance

ParamByName

ParseSQL

RemoveParam

SafeCallException


TXMLParams.AssignStrings

TXMLParams	See also	Example

Assigns values to the parameters from a list of name/value pairs.

procedure AssignStrings(Value: TStrings);

Description

Use AssignStrings to update the values of the parameters in the Items list to match the values in the list specified by Value. For each string in Value of the form Name=Value, AssignStrings locates the parameter (if any) that has the same name as the name portion of the string. It then assigns the Value portion of the string as the parameter’s value.

AssignStrings makes it very convenient to assign parameter values that are received as the content of a request message. In particular, TSubmitQueryButton generates an HTML control that sends the values in an HTML query form to the Web application. If the query form displays parameter values that should be sent to a provider on the application server, you can call AssignStrings with the ContentFields property of that Web request message.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection

TParams


TADOBlobStream

Hierarchy	Properties	Methods	See also

TADOBlobStream is a stream object that reads from and writes to field objects that represent Binary large object (BLOB) fields.

Unit

ADOdb

Description

Use TADOBlobStream to access or modify the value of a BLOB or memo field in an ADO dataset. BLOB fields are represented by TBlobField objects and descendants of TBlobField such as TGraphicField and TMemoField.

TADOBlobStream allows objects that have no specialized knowledge of how data is stored in a BLOB field (raw binary data) to read or write such data by employing the uniform stream interface.

To use an ADO BLOB stream, create an instance of TADOBlobStream, use the methods of the stream to read or write the data, and then free the BLOB stream. Do not use the same instance of TADOBlobStream to access data from more than one record. Instead, create a new TADOBlobStream object every time you need to read or write BLOB data on a new record.

Use the Read method to copy the data from BLOB field object to a PChar (or comparable) buffer. Use the Write method to copy from buffer to BLOB field object. When reading data from the BLOB field object, use the Size property to determine the volume of the field’s contents and to allocate the correct amount of space in memory for the receiving buffer.


TADOBlobStream properties

TADOBlobStream	Alphabetically	Legend

Derived from TCustomMemoryStream

Memory

Derived from TStream

Position

Size


TADOBlobStream properties

TADOBlobStream	By object	Legend

Memory

Position

Size


TADOBlobStream methods

TADOBlobStream	Alphabetically

In TADOBlobStream

Create

Destroy

Truncate

Write

Derived from TMemoryStream

Clear

LoadFromFile

LoadFromStream

SetSize

Derived from TCustomMemoryStream

Read

SaveToFile

SaveToStream

Seek

Derived from TStream

CopyFrom

FixupResourceHeader

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TADOBlobStream methods

TADOBlobStream	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

CopyFrom

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

FixupResourceHeader

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

Read

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

SafeCallException

SaveToFile

SaveToStream

Seek

SetSize

Truncate

Write

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader


TADOBlobStream.Create

TADOBlobStream	See also

Creates a new TADOBlobStream object.

constructor Create(Field: TBlobField; Mode: TBlobStreamMode);

Description

Call Create to obtain an instance of TADOBlobStream for reading from or writing to a specific BLOB field object.

Create links the TADOBlobStream to the field object specified by the Field parameter. Mode specifies whether the BLOB stream will be used to read data (bmRead), write data (bmWrite) or modify data (bmReadWrite).


TADOBlobStream.Destroy

TADOBlobStream	See also

Destroys an instance of TADOBlobStream.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the TADOBlobStream reference is not nil before calling Destroy.

Destroy a TADOBlobStream object when it is no longer needed to store or write data. Destroy calls Clear to free the memory buffer before calling the inherited destructor.

Destroy performs the following tasks:

Sets the field’s data.

Changes the field object’s Modified property to True.

Triggers a field change event in the field’s dataset object.

Calls the inherited destructor.


TADOBlobStream.Truncate

TADOBlobStream	See also

Discards all data in the BLOB field from the current position on.

procedure Truncate;

Description

Use Truncate to limit the size of the data in the BLOB field. Calling Truncate when the current position is 0 will clear the contents of the BLOB field. If Position is other than zero, data is cleared from the point to the end of the field's data for the current record.

Note:	Do not call Truncate when the TADOBlobStream was created in bmRead mode.


TADOBlobStream.Write

TADOBlobStream	See also

Writes data from a memory buffer to a BLOB field object.

function Write(const Buffer; Count: Longint): Longint; override;

Description

Use Write to copy data from a PChar (or comparable) buffer in memory to the BLOB field object. Write copies data from the buffer to the current position in the BLOB field object (current position indicated by the Position property). Write copies the number of bytes specified in Count or the number of bytes remaining in the memory buffer (counting from the current position to the end), whichever is less. Write can be called multiple times during the lifetime of a TADOBlobStream, each call copying less than the total number of bytes to be copied.

Count represents the maximum number of bytes to copy in a single call to Write. Count may be less than, the same as, or greater than the number of bytes actually contained in the memory buffer. If Count is greater than the actual number of bytes present or remaining in the memory buffer, copying stops at the last byte. No penalty is incurred on exceptions generated by specifying a number greater than the actual size of the contents.

Write updates the Size property to Position + Count, and sets the Position property to the new value of Size. Thus, any data that was stored in the memory stream in the Count bytes after the current position is lost when calling Write.

After successful execution, Write returns the number of bytes copied to the BLOB field object. If the return value is less than Count, the most likely reason is that the end of the buffer was reached prior to copying the specified number of bytes.

var

  P: PChar;

  S: Integer;

  BS: TADOBlobStream;

begin

  if not (ADOTable1.State in [dsEdit, dsInsert]) then

    ADOTable1.Edit;

  BS := TADOBlobStream.Create(TMemoField(ADOTable1.Fields[1]), bmWrite);

  try

    S := Memo1.GetTextLen;

    Inc(S);

    P := AllocMem(S);

    FillChar(P^, S, #0);

    Memo1.GetTextBuf(P, S);

    BS.Write(P^, S);

  finally

    BS.Free;

    FreeMem(P, S);

  end;

end;


Accessibility

Read-only


Hierarchy

TObject

TStream

TCustomMemoryStream

TMemoryStream


TADOCommand

Hierarchy	Properties	Methods	See also

TADOCommand represents an ADO command object.

Unit

ADOdb

Description

The TADOCommand class is the VCL representation of the ADO Command object. Use a TADOCommand for issuing commands against a data store accessed through an ADO (ActiveX Data Objects) provider.

TADOCommand is most often used for executing data definition language (DDL) SQL commands or to execute a stored procedure that does not return a result set. For those SQL statements that do return a result set, a TADODataSet, TADOQuery, or TADOStoredProc is better suited to the task. The Execute method is, however, capable of returning a recordset. A separate ADO dataset component must be supplied to use that recordset, though.

The TADOCommand component executes the command specified in its CommandText property. One command may be executed at a time. Parameters, if the command includes them, are specified in its Parameters property. The command is executed by a call to the Execute method.

A TADOCommand object can either use a TADConnection object to connect to a data store (through its Connection property) or connect directly to the data store if the connection information is specified in the ConnectionString property.

As a close representation of the ADO Command object, many of its properties and methods have the same name as those of the ADO Command object and serve the same purpose. For example, the CommandType property and Execute methods are the same in both the TADOCommand component and ADO Command object. For additional information on a given property or method beyond that provided in the Delphi help, see the corresponding topic in the Microsoft Data Access SDK help. While the implementation of the Command object in Delphi may remain the same, subsequent versions of ADO may introduce changes in internal functionality. These changes would be reflected in the SDK help.


TADOCommand properties

TADOCommand	Alphabetically	Legend

In TADOCommand

CommandObject

CommandText

CommandTimeout

CommandType

Connection

ConnectionString

Name

ParamCheck

Parameters

Prepared

Properties

States

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TADOCommand properties

TADOCommand	By object	Legend

CommandObject

CommandText

CommandTimeout

CommandType

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Connection

ConnectionString

DesignInfo

Owner

Name

ParamCheck

Parameters

Prepared

Properties

States

Tag

VCLComObject


TADOCommand.CommandObject

TADOCommand	See also

Provides direct access to the ADO command object.

property CommandObject: _Command;

Description

Use CommandObject to get direct access to the ADO command object the command component represents. This direct access reference allows an application to use properties and methods of the underlying command object. Accessing the underlying command object is especially useful for utilizing properties and methods of the command object not surfaced in TADOCommand.

Note:	Use of CommandObject to directly access the underlying ADO command object requires a good working knowledge of ADO objects in general and the ADO command object in specific. It is not recommended that you use the command object directly unless familiar with command object operations. Consult the Microsoft Data Store SDK help for specific information on using ADO command objects.


TADOCommand.CommandText

TADOCommand	See also

Specifies command to be executed.

property CommandText: WideString;

Description

Use CommandText to specify the command to execute using the ADO command component. CommandText is a textual representation of the command such as an SQL statement, a table name, or the name of a stored procedure to execute.

ADOCommand1.CommandText := 'DROP TABLE Employee1986';

If the command includes parameters, as might be the case with an SQL statement or stored procedure, access the them through the command component’s Parameters property.


TADOCommand.CommandTimeout

TADOCommand	See also

Specifies amount of time to attempt execution of a command.

property CommandTimeout: Integer;

Description

Use CommandTimeout to specify the amount of of time that expires before an attempt to execute a command is considered unsuccessful. Measured in seconds, the default value for CommandTimeout is 30.

If a command is successfully executed prior to the expiration of the seconds specified, CommandTimeout has no effect.


TADOCommand.CommandType

TADOCommand	See also

Specifies the type of command to execute.

property CommandType: TCommandType;

Description

Set CommandType to indicate the type of command that is contained in the CommandText property. The value in CommandType should agree with that of CommandText. For instance, if CommandText is the name of a table, CommandType should be cmdTable or cmdTableDirect.

The default value of CommandType is cmdUnknown. While CommandType may be left as cmdUnknown for all commands, better performance will be realized if CommandType is used to explicitly indicate the type of the command. When the type cmdUnknown is used, ADO must evaluate the command to determine its type, which slows the operation.

Note:	The TCommandType constants cmdTable, cmdTableDirect, and cmdOpenFile are not for use with commands executed from a TADOCommand component.


TADOCommand.Connection

TADOCommand	See also

Specifies ADO connection component to use.

property Connection: TADOConnection;

Description

Set Connection to specify the TADOConnection the command component uses to connect to the data store.

ADOCommand1.Connection := ADOConnection1;

Note:	the connection of an ADO command component to a data store can either be through a TADOConnection specified in the Connection property or directly through the connection string specified in ConnectionString. These two means for connecting to a data store are mutually exclusive.


TADOCommand.ConnectionString

TADOCommand	See also

Specifies the connection information for the database.

property ConnectionString: WideString;

Description

Set ConnectionString to specify the information needed to connect the command component to the data store. The value used for ConnectionString consists of one or more arguments ADO uses to establish the connection. Specify multiple arguments as a list with individual arguments separated by semi-colons.

ADOCommand1.ConnectionString := 'Provider=YourProviderName;Remote Server=YourServerName;

At design-time, select from the list of available ADO database connections invoked from the Object Inspector.

A connection string may be saved to file for later use. Specify only the name of such a file in ConnectionString to reuse a saved connection string.

The connection string may also contain login information such as user ID and password, for automated logins.

ADO supports the following four arguments for connection strings. Any other arguments (such as a user ID and password) are not processed by ADO and simply passed on to the provider.

Argument	Meaning

Provider	The name of the provider to use for the connection.

File name	The name of a file containing connection information.

Remote Provider	The name of the provider to use for a client-side connection.

Remote Server	The path name of the server to use for a client-side connection.

Note:	the connection of an ADO command component to a database can either be through a TADOConnection specified in the Connection property or directly through the connection string specified in ConnectionString. These two means for connecting to a database are mutually exclusive.

Note:	After opening a connection, the contents of ConnectionString may be changed by ADO. One example of this behavior is when ADO-defined arguments are mapped to their provider equivalents.


TADOCommand.ExecuteOptions

TADOCommand

Specifies the characteristics of a command execution.

property ExecuteOptions: TExecuteOptions;

Description

Set ExecuteOptions to control the characteristics of a command executed from the ADO dataset component.


TADOCommand.Name

TADOCommand

Specifies the name of the ADO command object as referenced by other components.

type TComponentName: String;

property Name: TComponentName;

Description

Use Name to change the name of an ADO command object to reflect its purpose in the current application. By default, Delphi assigns sequential names based on the type of the component, such as ' ADOCommand1', ADOCommand2', and so on.

Note:	The Name method also provides for doing late bound executes from the connection. See the Microsoft Data Access Components SDK for more information.


TADOCommand.ParamCheck

TADOCommand	See also

Specifies whether the parameter list for an ADO command component is regenerated if the SQL changes at runtime.

property ParamCheck: Boolean;

Description

Set ParamCheck to specify whether or not the Parameters property is initialized using ":Param" style parameters in an SQL statement specified in the CommandText property. If the SQL statement in CommandText only contains "?" style parameters, the Parameters property will only be initialized if the OLE DB provider returns parameter information for an SQL command. Otherwise, the parameters must be explicitly created using the TParameters.CreateParameter method.

When ParamCheck is True, a parameter is generated for each ":Param" style parameter in the SQL statement.

The default value of ParamCheck is True.

This property is useful for data definition language (DDL) statements that contain parameters as part of the DDL statement and that are not parameters for the ADO command component. For example, the DDL statement to create a stored procedure may contain parameter statements that are part of the stored procedure. Set ParamCheck to False to prevent these parameters from being mistaken for parameters of the ADO command component executing the DDL statement.


TADOCommand.Parameters

TADOCommand	See also

Contains the parameters for an ADO command object’s SQL statement.

property Parameters: TParameters;

Description

Access Parameters at runtime to view and set parameter names, values, and data types dynamically (at design time use the collection editor for the Parameters property to set parameter information). Parameters is a zero-based array of TParameter parameter records. Index specifies the array element to access.

Note:	Parameters is only applicable when the ADO command object issues an SQL statement or executes a stored procedure (the CommandType is cmdText or cmdStoredProc) and parameters are actually used in the SQL statement or stored procedure.


TADOCommand.Prepared

TADOCommand	See also

Specifies whether the command is prepared before execution.

property Prepared: WordBool;

Description

Set Prepared before calling the Execute method to specify whether ADO prepares the command. If Prepared is set to True and the command component is connected to a data store, ADO prepares the command before executing it. If Prepared is set to False, ADO does not prepare the command.

The default value of Prepared is False.


TADOCommand.Properties

TADOCommand

Properties is the implementation of the Properties Collection object.

property Properties: Properties

Description

Use Properties to get direct access to the ADO Properties Collection for the ADO Command object the ADO command component represents. A Properties Collection object is a container for one or more Property objects. Each Property object corresponds to a characteristic of an ADO object, here an ADO Command object.

Note:	Use of Properties to directly access the underlying ADO Properties Collection object requires a good working knowledge of ADO objects in general and ADO Properties Collection objects in specific. Consult the Microsoft Data Store SDK help for specific information on using ADO Properties Collection objects.


TADOCommand.States

TADOCommand	See also

Indicates the current state of the ADO command component.

property States: TObjectStates;

Description

Read States at runtime to determine the activity being performed, if any, by the command component at a specific point in time. Activity status includes the command component connecting to a data store, executing a command, fetching rows for a recordset, sitting idle but open, and sitting idle and closed.


TADOCommand methods

TADOCommand	Alphabetically

In TADOCommand

Assign

Cancel

Create

Destroy

Execute

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Derived from TButton

UseRightToLeftAlignment


TADOCommand methods

TADOCommand	By object

AfterConstruction

Assign

BeforeDestruction

Cancel

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Execute

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TADOCommand.Assign

TADOCommand

Makes one ADO command component a duplicate of another.

procedure Assign(Source: TPersistent); override;

Description

Call Assign to copy the property values from one ADO command object to the properties of the current ADO command object.

Source is the ADO command object from which property values are copied. Source must be another TADOCommand object or an instance of a descendant class.

ADOCommand1.Assign(ADOCommand2);

Assign copies the values of the following properties specific to ADO command objects:

Connection, if assigned; otherwise the ConnectionString property is copied.

CommandText.

CommandTimeout.

CommandType.

Prepared.

Parameters.


TADOCommand.Cancel

TADOCommand	See also

Halts execution of an ADO command.

procedure Cancel;

Description

Call Cancel abort the execution of a command executed by the command component. To use Cancel to abort a command, the command by have been executed asynchronously (the eoAsyncExecute TExecuteOption must have been used). If the command is not asynchronous an exception is raised. Use the command component’s ExecuteOptions to specify that a command is executed asynchronously.

Note:	To successfully cancel a command, Cancel must be called before the number of seconds specified in CommandTimeout have expired.


TADOCommand.Create

TADOCommand	See also

Constructs an instance of an ADO command component.

constructor Create(AOwner: TComponent); override;

Description

Use Create to programmatically instantiate an ADO command component. Command components added in the form designer are created automatically.

Create

•	Calls its inherited Create method.

•	Initializes the CommandObject property.

•	Initializes the Parameters property.

•	Sets the ParamCheck property to True.


TADOCommand.Destroy

TADOCommand	See also

Destroys the command component.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free.  Free verifies that the command component is not nil, and only then calls Destroy.

Destroy performs the following tasks:

Destroys the command object in the CommandObject property.

Destroys the parameter collection in the Parameters property.

Calls the inherited destructor.


TADOCommand.Execute

TADOCommand	See also

Causes the ADO command object’s command to be executed.

function Execute: _RecordSet; overload;

function Execute(const Parameters: OleVariant): _Recordset; overload;

function Execute(var RecordsAffected: Integer; var Parameters: OleVariant; ExecuteOptions: TExecuteOptions = []): _RecordSet; overload;

Description

Call Execute to immediately execute the command specified in the CommandText property.

RecordsAffected indicates the number of records, if the command operates on data, that are affected by the command after execution.

Parameters is a collection of parameters for the command, unnecessary if the command does not use any parameters.

ExecuteOptions is a TExecuteOptions value that specifies the characteristics of the command execution.

When a command is executed that creates a recordset, Execute returns the recordset and it must be accessed through an ADO dataset component. To do this, assign the return value of Execute directly to the recordset property of an ADO data set component. For example:

ADODataSet1.RecordSet := ADOCommand1.Execute;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TADOConnection

Hierarchy	Properties	Methods	Events	See also

TADOConnection is provides a connection to an ADO data store.

Unit

ADOdb

Description

The TADOConnection class encapsulates the ADO connection object. Use a TADOConnection for connecting to ADO data stores. The connection provided by a single TADOConnection component can be shared by multiple ADO command and dataset components through their Connection properties.

TADOConnection allows you to control the attributes and conditions of a connection to a data store. Use the properties of TADOConnection to control such attributes as record locking scheme (optimistic versus pessimistic), cursor type, cursor location, isolation level, and connection timeout. Methods are also provided for implementing transactions that cover data changes by associated dataset components, retrieving the names of tables in the connection's database, and for retrieving the names of stored procedures in the database.


TADOConnection properties

TADOConnection	Alphabetically	Legend

In TADOConnection

Attributes

CommandCount

Commands

CommandTimeout

Connected

ConnectionObject

ConnectionString

ConnectionTimeout

ConnectOptions

CursorLocation

DataSetCount

DataSets

DefaultDatabase

Errors

InTransaction

IsolationLevel

Mode

Properties

Provider

State

Version

Derived from TCustomConnection

LoginPrompt

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TADOConnection properties

TADOConnection	By object	Legend

Attributes

CommandCount

Commands

CommandTimeout

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Connected

ConnectionObject

ConnectionString

ConnectionTimeout

ConnectOptions

CursorLocation

DataSetCount

DataSets

DefaultDatabase

DesignInfo

Errors

InTransaction

IsolationLevel

LoginPrompt

Mode

Owner

Properties

Provider

State

Tag

VCLComObject

Version


TADOConnection.Attributes

TADOConnection 	See also

Specifies automated transaction behavior.

property Attributes: TXactAttributes;

Description

Set Attributes to specify whether a connection object performs retaining commits or retaining aborts. The two behaviors are set independent of each other.

Attributes may contain one of the two TXactAttribute values (xaCommitRetaining and xaAbortRetaining), both values, or neither value.

ADOConnection1.Attributes := [xaCommitRetaining, xaAbortRetaining];


TADOConnection.CommandCount

TADOConnection	See also

Indicates the number of command components associated with the connection component..

property CommandCount: Integer

Description

Read CommandCount to determine the number of command components associated with the connection component. A command component is associated with a connection component iif its Connection property is set to the connection component.

CommandCount can be used as the basis for a loop to access each command component using the Commands property. For example, to execute all of the TADOCommand components connected through the TADOConnection component ADOConnection1:

var

  i: Integer;

begin

  for i := 0 to (ADOConnection1.CommandCount – 1) do

    ADOConnection1.Commands[i].Execute;

end;


TADOConnection.Commands

TADOConnection	See also

Provides an indexed array of all active commands for a connection component.

property Commands[Index: Integer]: TADOCommand

Description

Use Commands to access active command components associated with a connection component. An active command component is one that is currently open.

Commands connected through an ADO connection object can be accessed in sequence through the Commands property in a loop based on CommandCount. For example, to execute all of the TADOCommand components connected through the TADOConnection component ADOConnection1:

var

  i: Integer;

begin

  for i := 0 to (ADOConnection1.CommandCount – 1) do

    ADOConnection1.Commands[i].Execute;

end;


TADOConnection.CommandTimeout

TADOConnection	See also

Specifies amount of time to attempt execution of a command.

property CommandTimeout: Integer;

Description

Use CommandTimeout to specify the amount of of time that expires before an attempt to execute a command is considered unsuccessful. Measured in seconds, the default value for CommandTimeout is 30.

If a command successfully executed prior to the expiration of the seconds specified in CommandTimeout, this property has no effect. If execution of a command has not been successfully completed before the time has elapsed, the command is canceled.


TADOConnection.Connected

TADOConnection	See also

Specifies whether or not a connection is active.

property Connected: Boolean;

Description

Set Connected to True to establish a connection to an ADO data store without opening a dataset. Set Connected to False to close a connection. The default value for Connected is False.

An application can check Connected to determine the current status of a connection. If Connected is True, the connection is active; if False, and the KeepConnection property is also False, then the connection is inactive.

Connected can also be used in a program to determine the success of a call to the Open method (a True value in Connected) or the Close method (a False value).

with ADOConnection1 do begin

  Open;

  if Connected then

    { connection successful }

  else

    { connection unsuccessful };

end;


TADOConnection.ConnectionObject

TADOConnection	See also

Provides direct access to the ADO connection object.

property ConnectionObject: _Connection;

Description

Use ConnectionObject to get direct access to the ADO connection object the connection component represents. This direct access reference allows an application to use properties and methods of the underlying connection object. Accessing the underlying connection object is especially useful for utilizing properties and methods of the connection object not surfaced in TADOConnection.

Note:	Use of ConnectionObject to directly access the underlying ADO connection object requires a good working knowledge of ADO objects in general and the ADO connection object in specific. It is not recommended that you use the connection object directly unless familiar with connection object operations. Consult the Microsoft Data Store SDK help for specific information on using ADO connection objects.


TADOConnection.ConnectionString

TADOConnection	See also

Specifies the connection information for the data store.

property ConnectionString: WideString;

Description

Set ConnectionString to specify the information needed to connect the ADO connection component to the data store. The value used for ConnectionString consists of one or more arguments ADO uses to establish the connection. Specify multiple arguments as a list with individual arguments separated by semi-colons.

ADOConnection1.ConnectionString := 'Provider=ProviderRef;Remote Server=ServerRef';

At design-time, select from the list of available ADO database connections invoked from the Object Inspector.

A connection string may be saved to file for later use. Specify only the name of such a file in ConnectionString to reuse a saved connection string.

The connection string may also contain login information such as user ID and password, for automated logins.

When explicitly passing login information through either the Open method or the ConnectionString, the LoginPrompt property should be set to False to prevent an unnecessary login dialog.

ADO supports the following four arguments for connection strings. Any other arguments (such as a user ID and password) are not processed by ADO and simply passed on to the provider.

Argument	Meaning
Provider	The name of the provider to use for the connection.
File name	The name of a file containing connection information.
Remote Provider	The name of the provider to use for a client-side connection.
Remote Server	The path name of the server to use for a client-side connection.
Note:	After opening a connection, the contents of ConnectionString may be changed by ADO. One example of this behavior is when ADO-defined arguments are mapped to their provider equivalents.


TADOConnection.ConnectionTimeout

TADOConnection	See also

Specifies amount of time to attempt a connection.

property ConnectionTimeout: Integer;

Description

Use CommandTimeout to specify the amount of time that expires before an attempt to make a connection is considered unsuccessful. Measured in seconds, the default value for CommandTimeout is 15.

If a connection is successfully made prior to the expiration of the seconds specified or the Cancel method is called, ConnectionTimeout has no effect. If the specified time expires and a connection has not been successfully made, the attempt is terminated and an exception is raised.


TADOConnection.ConnectOptions

TADOConnection	See also

Specifies whether a connection is synchronous or asynchronous.

TConnectOption = (coConnectUnspecified, coAsyncConnect);

property ConnectOptions: TConnectOption;

Description

Set ConnectOptions to specify whether the connection established by the TADOConnection is synchronous or asynchronous. The default value for ConnectOptions is coConnectUnspecified.

An application will typically use the default of a synchronous connection (coConnectUnspecified). Typically an asynchronous is only really needed to compensate for a slow server.


TADOConnection.CursorLocation

TADOConnection

Specifies whether cursors for the connection is client-side or server-side.

property CursorLocation: TCursorLocation;

Description

Use CursorLocation to indicate whether the cursors that use the connection object to connect to the ADO datastore use a client-side or server-side cursor library. CursorLocation only affects connections opened after the property is set. The default value for CursorLocation is clUserClient.

A client-side cursor offers more flexibility. All data is retrieved to the local machine and then operated on there, allowing operations not normally supported by servers like sorting and resorting the data and additional filtering. SQL statements are executed at the server, so for  statements that restrict the result set with a WHERE clause, oly the reduced result set is retrieved to a local cursor.

A server-side cursor offers less flexibility, but may be more advantageous (or necessary) for large result sets. Using a server-side cursor becomes necessary when the sheer size of a result set exceeds the available disk space that would be needed to create the client-side cursor. Also, many servers only support unidirectional cursors. This would preclude moving the record pointer in the dataset backward (even one record) through the result set.


TADOConnection.DataSetCount

TADOConnection	See also

Indicates the number of active datasets associated with the connection component.

property DataSetCount: Integer;

Description

Read DataSetCount to determine the number of currently active datasets associated with the connection component. As datasets are opened and closed this value changes appropriately.

DataSetCount can be used as the basis for a loop to access each connected dataset using the DataSets property.

var

  i: Integer;

begin

  for i := 0 to (ADOConnection1.DataSetCount – 1) do

    ListBox1.Items.Add(ADOConnection1.DataSets[i].Name)

end;


TADOConnection.DataSets

TADOConnection	See also

Provides an indexed array of all active datasets for a connection component.

property DataSets[Index: Integer]: TCustomADODataSet

Description

Use DataSets to access active datasets associated with a connection component. An active dataset is one that is currently open.

Datasets connected through an ADO connection object can be accessed in sequence through the DataSets property in a loop based on DataSetCount.

var

  i: Integer;

begin

  for i := 0 to (ADOConnection1.DataSetCount – 1) do

    ListBox1.Items.Add(ADOConnection1.DataSets[i].Name)

end;


TADOConnection.DefaultDatabase

TADOConnection	See also

Indicates the database the ADO connection uses by default.

property DefaultDatabase: WideString;

Description

Set DefaultDatabase to indicate the database the ADO connection objects uses if the connection to the database specified in ConnectionString is unavailable, the connection cannot be made, or the database is not specified in the connection string.

Note:	If a default database is specified in the ConnectionString property, it has precedence over the value in DefaultDatabase. The DefaultDatabase value is automatically changed to the database specified in ConnectionString when the connection component is opened.


TADOConnection.Errors

TADOConnection

Errors is the implementation of the Errors Collection.

property Errors: Errors;

Description

Use Errors to get direct access to the ADO Errors Collection for the ADO Connection object the TADOConnection component represents. This direct access reference allows an application to use properties and methods of the underlying Errors Collection object. Accessing the underlying connection object is especially useful for utilizing properties and methods of the Errors Collection not surfaced in TADOConnection.

The Errors Collection object of a Connection object contains the errors generated by the provider. For each provider error, one or more ADO Error objects are placed in the Errors Collection. Error objects represent individual errors from the provider and are not ADO-specific. On a subsequent error, the Errors Collection is cleared of any Error objects and new Error objects are inserted for the current error.

Note:	Use of Errors to directly access the underlying ADO Errors Collection object requires a good working knowledge of ADO objects in general and ADO Errors Collection objects in specific. It is not recommended that you use the Errors Collection object directly unless familiar with connection object operations. Consult the Microsoft Data Store SDK help for specific information on using ADO Errors Collection objects.


TADOConnection.InTransaction

TADOConnection	See also

Indicates whether a transaction is in progress.

property InTransaction: Boolean

Description

Read InTransaction at runtime to determine whether a transaction is currently active for the ADO connection component. If the connection component is currently in a transaction, InTransaction contains a True value. If no transaction is currently active it contains False.

A transaction is will be active if the BeginTrans method has been called to initiate a transaction but that transaction has not either been consumated by calling CommitTrans or canceled by calling the RollbackTrans method. Use the InTransaction property to prevent calling BeginTrans when a transaction has already been initiated for the connection component.


TADOConnection.IsolationLevel

TADOConnection

Specifies the transaction isolation level for transactions.

property IsolationLevel: TIsolationLevel;

Description

Use IsolationLevel to specify the transaction isolation level for a connection. The transaction isolation level determines how a transaction interacts with other simultaneous transactions when they work with the same tables, and how much a transaction sees of the work performed by other transactions. The default value for IsolationLevel is ilCursorStability.

Set IsolationLevel to a valid TIsolationLevel value prior to starting a new transaction. Read IsolationLevel after the transaction has been activated to determine the actual transaction isolation level used. It is possible that a server will force an isolation level other than that requested if the level requested is not supported.

Below are the four supported transaction levels and the transaction phenomena that may occur under each. Dirty reads occur when a transaction reads data that has not yet been committed. Nonrepeatable reads occur when a transaction reads the same row twice and the data is different each time. Phantoms are rows that match the criteria used to compose a result set, but that are not initially visible.

Isolation Level	Dirty Reads	Nonrepeatable Reads	Phantoms

Read uncommitted	Yes	Yes	Yes

Read committed	Yes	Yes

Repeatable read	Yes

Serializable


TADOConnection.Mode

TADOConnection

Indicate the persimissions available to a connection.

property Mode: TConnectMode;

Description

Read Mode to determine the permissions available to the connection after the connection has been activated. The permissions expressed in Mode govern the types of operations (such as reading and writing) can be performed through the connection. They also control how these operations are affected by and affect other concurrent users.


TADOConnection.Properties

TADOConnection

Properties is the implementation of the Properties Collection object.

property Provider: WideString;

Description

Use Properties to get direct access to the ADO Properties Collection for the ADO Connection object the ADO connection component represents. A Properties Collection object is a container for one or more Property objects. Each Property object corresponds to a characteristic of an ADO object, here an ADO Connection object.

Note:	Use of Properties to directly access the underlying ADO Properties Collection object requires a good working knowledge of ADO objects in general and ADO Properties Collection objects in specific. Consult the Microsoft Data Store SDK help for specific information on using ADO Properties Collection objects.


TADOConnection.Provider

TADOConnection	See also

Specifies the provider for the ADO connection.

property Provider: WideString;

Description

Set Provider to indicate the provider the ADO connection object uses.

The provider a connection is to use can also be specified in the string entered in ConnectionString. If Provider is left blank and the provider specified through ConnectionString, when the connection is activated the Provider property is automatically set indicating the provider used.


TADOConnection.State

TADOConnection	See also

Indicates the current state of the ADO connection.

property State: TObjectStates;

Description

Read State at runtime to determine the activity being performed, if any, by the connection at a specific point in time. Activity status includes the command component connecting to a data store, executing a connection, fetching rows for a recordset, sitting idle but open, and sitting idle and closed.


TADOConnection.Version

TADOConnection	See also

Indicates the version of ADO used.

property Version: WideString;

Description

Read Version at runtime to determine the version of ADO used. Some versions of ADO do not support all possible features, so querying Version is important when using features only supported in later versions.


TADOConnection events

TADOConnection	Alphabetically

In TADOConnection

OnBeginTransComplete

OnCommitTransComplete

OnConnectComplete

OnDisconnect

OnExecuteComplete

OnInfoMessage

OnRollbackTransComplete

OnWillConnect

OnWillExecute

Derived from TCustomConnection

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnLogin


TADOConnection events

TADOConnection	By object

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnBeginTransComplete

OnCommitTransComplete

OnConnectComplete

OnDisconnect

OnExecuteComplete

OnInfoMessage

OnLogin

OnRollbackTransComplete

OnWillConnect

OnWillExecute


TADOConnection.OnBeginTransComplete

TADOConnection	See also

Occurs after beginning a transaction.

TBeginTransCompleteEvent = procedure(Connection: TADOConnection; TransactionLevel: Integer; const Error: Error; var EventStatus: TEventStatus) of object;

property OnBeginTransComplete: TBeginTransCompleteEvent read FOnBeginTransComplete write FOnBeginTransComplete;

Description

Write an OnBeginTransComplete event handler to take specific action after an attempt to begin a transaction has successfully completed. The OnBeginTransComplete event fires after the corresponding operation (initiation of a transaction) has executed at the ADO Connection object. Calling the BeginTrans method will lead to this event occurring.

TransactionLevel is the new transaction level from the call to the BeginTrans method.

Error is an ADO Error object. See the Microsoft Data Access SDK for more information on using ADO Error objects. The Error parameter is only set if an error occurred during execution of the operation that triggered the event. In this case, the EventStatus parameter will contain the indicating value esErrorsOccured.

The EventStatus value (ADO EventStatusEnum) indicates the success or failure of the execution of the operation that triggered the event.


TADOConnection.OnCommitTransComplete

TADOConnection	See also

Occurs after committing a transaction.

TConnectErrorEvent = procedure(Connection: TADOConnection; Error: Error; var EventStatus: TEventStatus) of object;

property OnCommitTransComplete: TConnectErrorEvent read FOnCommitTransComplete write FOnCommitTransComplete;

Description

Write an OnCommitTransComplete event handler to take specific action after an attempt to commit a transaction has successfully completed. The OnCommitTransComplete event fires after the corresponding operation (committing a transaction) has executed at the ADO Connection object. Calling the CommitTrans method will lead to this event occurring.

Error is an ADO Error object. See the Microsoft Data Access SDK for more information on using ADO Error objects. The Error parameter is only set if an error occurred during execution of the operation that triggered the event. In this case, the EventStatus parameter will contain the indicating value esErrorsOccured.

The EventStatus value (ADO EventStatusEnum) indicates the success or failure of the execution of the operation that triggered the event.


TADOConnection.OnConnectComplete

TADOConnection	See also

Occurs after starting a connection.

TConnectErrorEvent = procedure(Connection: TADOConnection; Error: Error; var EventStatus: TEventStatus) of object;

property OnConnectComplete: TConnectErrorEvent read FOnConnectComplete write FOnConnectComplete;

Description

Write an OnConnectComplete event handler to take specific action after an attempt to connect to a database has successfully completed and the connection has started. The OnConnectComplete event fires after the corresponding operation (establishing a connection) has executed at the ADO Connection object. Calling the Open method or setting the Connected property to True will lead to this event occurring.

Error is an ADO Error object. See the Microsoft Data Access SDK for more information on using ADO Error objects. The Error parameter is only set if an error occurred during execution of the operation that triggered the event. In this case, the EventStatus parameter will contain the indicating value esErrorsOccured.

The EventStatus value (ADO EventStatusEnum) indicates the success or failure of the execution of the operation that triggered the event.


TADOConnection.OnDisconnect

TADOConnection	See also

Occurs after a connection is terminated.

TDisconnectEvent = procedure(Connection: TADOConnection; var EventStatus: TEventStatus) of object;

property OnDisconnect: TDisconnectEvent read FOnDisconnect write FOnDisconnect;

Description

Write an OnDisconnect event handler to take specific action after a connection to a database is terminated. The OnDisconnect event fires after the corresponding operation (ending a connection) has executed at the ADO Connection object. Calling the Close method or setting the Connected property to False will lead to this event occurring.

Error is an ADO Error object. See the Microsoft Data Access SDK for more information on using ADO Error objects. The Error parameter is only set if an error occurred during execution of the operation that triggered the event. In this case, the EventStatus parameter will contain the indicating value esErrorsOccured.

The EventStatus value (ADO EventStatusEnum) indicates the success or failure of the execution of the operation that triggered the event.


TADOConnection.OnExecuteComplete

TADOConnection	See also

Occurs after a command is executed.

TExecuteCompleteEvent = procedure(Connection: TADOConnection; RecordsAffected: Integer; const Error: Error; var EventStatus: TEventStatus; const Command: _Command; const Recordset: _Recordset) of object;

property OnExecuteComplete: TExecuteCompleteEvent read FOnExecuteComplete write FOnExecuteComplete;

Description

Write an OnExecuteComplete event handler to take specific action after the ADO connection object has successfully executed a command. The OnExecuteComplete event fires after the corresponding operation (executing an ADO command) has completed execution at the ADO Connection object. Calling the Execute method will lead to this event occurring.

Connection indicates the TADOConnection component executing the ADO command.

RecordsAffected indicated the number of rows in the table that were affected by the execution of the command. For instance, if the command deletes rows in a table, RowsAfftected indicates how many rows were deleted (possibly less than all rows if a WHERE clause is used in the command).

Error is an ADO Error object. See the Microsoft Data Access SDK for more information on using ADO Error objects. The Error parameter is only set if an error occurred during execution of the operation that triggered the event. In this case, the EventStatus parameter will contain the indicating value esErrorsOccured.

The EventStatus value (ADO EventStatusEnum) indicates the success or failure of the execution of the operation that triggered the event.

Command is the ADO Command object executing the command. If no Command object was used, this parameter contains a nil value.

Recordset is an ADO Recordset object containing the result set for the command. Recordset only contains an ADO Recordset object if the command was a SELECT statement, otherwise it contains a nil value.


TADOConnection.OnInfoMessage

TADOConnection	See also

Occurs when information messages are received from the data store connection.

TInfoMessageEvent = procedure(Connection: TADOConnection; const Error: Error; var EventStatus: TEventStatus) of object;

property OnInfoMessage: TInfoMessageEvent read FOnInfoMessage write FOnInfoMessage;

Description

Write an OnInfoMessage event handler to take specific action after an information message is received from a database connection. This event occurs when a connection event successfully completes and additional information is returned by the provider.

Error is an ADO Error object. See the Microsoft Data Access SDK for more information on using ADO Error objects. The Error parameter is only set if an error occurred during execution of the operation that triggered the event. In this case, the EventStatus parameter will contain the indicating value esErrorsOccured.

The EventStatus value (ADO EventStatusEnum) indicates the success or failure of the execution of the operation that triggered the event.


TADOConnection.OnRollbackTransComplete

TADOConnection	See also

Occurs after rolling back a transaction.

TConnectErrorEvent = procedure(Connection: TADOConnection; Error: Error; var EventStatus: TEventStatus) of object;

property OnRollbackTransComplete: TConnectErrorEvent read FOnRollbackTransComplete write FOnRollbackTransComplete;

Description

Write an OnRollbackTransComplete event handler to take specific action after an attempt to roll back a transaction has successfully completed. The OnRollbackTransComplete event fires after the corresponding operation (rolling back a transaction) has executed at the ADO Connection object. Calling the RollbackTrans method will lead to this event occurring.

Error is an ADO Error object. See the Microsoft Data Access SDK for more information on using ADO Error objects. The Error parameter is only set if an error occurred during execution of the operation that triggered the event. In this case, the EventStatus parameter will contain the indicating value esErrorsOccured.

The EventStatus value (ADO EventStatusEnum) indicates the success or failure of the execution of the operation that triggered the event.


TADOConnection.OnWillConnect

TADOConnection	See also

Occurs after a request to start a connection.

TWillConnectEvent = procedure(Connection: TADOConnection; var ConnectionString, UserID, Password: WideString; var ConnectOptions: TConnectOption; var EventStatus: TEventStatus) of object;

property OnWillConnect: TWillConnectEvent read FOnWillConnect write FOnWillConnect;

Description

Write an OnWillConnect event handler to take specific action before a connection starts and after the provider indicates the connection attempt can be made. The OnWillConnect event fires after the corresponding operation (requesting a connection attempt) has executed at the ADO Connection object. Calling the Open method or setting the Connected property to True will lead to this event occurring.

Connection indicates the TADOConnection component attempting the connection.

ConnectionString contains the connection information for the pending connection.

UserID contains the user identification for the pending connection.

Password contains the password for the pending connection.

ConnectionOptions contains the TConnectOption value that describes how the provider is to evaluate the connection string for the pending connection.

The EventStatus value (ADO EventStatusEnum) indicates the success or failure of the execution of the operation that triggered the event. In a handler for this event, set this parameter to esCancel to request cancellation of the pending connection operation.


TADOConnection.OnWillExecute

TADOConnection	See also

Occurs after a database server signals acceptance of a command execution.

TWillExecuteEvent = procedure(Connection: TADOConnection; var CommandText: WideString; var CursorType: TCursorType; var LockType: TADOLockType; var ExecuteOptions: TExecuteOptions; var EventStatus: TEventStatus; const Command: _Command; const Recordset: _Recordset) of object;

property OnWillExecute: TWillExecuteEvent read FOnWillExecute write FOnWillExecute;

Description

Write an OnWillExecute event handler to take specific action before a command is executed. The OnWillExecute event fires after the corresponding operation (requesting a command execution) has executed at the ADO Connection object. Calling the Execute method will lead to this event occurring.

Error is an ADO Error object. See the Microsoft Data Access SDK for more information on using ADO Error objects. The Error parameter is only set if an error occurred during execution of the operation that triggered the event. In this case, the EventStatus parameter will contain the indicating value esErrorsOccured.

The EventStatus value (ADO EventStatusEnum) indicates the success or failure of the execution of the operation that triggered the event. In a handler for this event, set this parameter to esCancel to request cancellation of the pending command execution.


TADOConnection methods

TADOConnection	Alphabetically

In TADOConnection

BeginTrans

Cancel

CloseDataSets

CommitTrans

Create

Destroy

Execute

GetProcedureNames

GetTableNames

Open

OpenSchema

RollbackTrans

Derived from TCustomConnection

Close

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TADOConnection methods

TADOConnection	By object

AfterConstruction

Assign

BeforeDestruction

BeginTrans

Cancel

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

CloseDataSets

CommitTrans

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Execute

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetProcedureNames

GetTableNames

HasParent

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Open

OpenSchema

RemoveComponent

RollbackTrans

SafeCallException

UpdateAction


TADOConnection.BeginTrans

TADOConnection	See also

Initiates a new transaction in the associated database.

function BeginTrans: Integer;

Description

Call BeginTrans to start a new transaction in the data store the ADO connection component is connected to.

BeginTrans returns a value of type Integer, indicating the nesting level of the new transaction.

A successful execution of BeginTrans triggers an OnBeginTransComplete event and sets the InTransaction property to True.

Note:	The ADO connection object must have an active connection before BeginTrans can be used.


TADOConnection.Cancel

TADOConnection	See also

Aborts an attempt to connect to a data store.

procedure Cancel;

Description

Call Cancel to abort an attempt to connect to an ADO data store. To use cancel, the connection attempted must be asynchronous (the ConnectOptions property must be set to coAsyncConnect).

Cancel must be used after an attempt to connect is initiated by calling the Open method (or setting Connected to True) and before the connection has been successfully made or has timed out.


TADOConnection.CloseDataSets

TADOConnection	See also

Closes all datasets associated with the ADO connection object component without disconnecting from the database.

procedure CloseDataSets(All: Boolean = True);

Description

Call CloseDataSets to close all dataset components associated with the ADO connection object. CloseDataSets deactivates the dataset components without also closing the database connection.

ADOConnection1.CloseDataSets(False);

Set the All parameter to specify that client side recordset also be closed. If All is set to True (the default), all datasets are closed. If All is set to False, all datasets are closed except those with recordsets located on the client side (the CursorLocation property of a dataset is clUseClient).


TADOConnection.CommitTrans

TADOConnection	See also

Commits an open transaction.

procedure CommitTrans;

Description

Call CommitTrans to save any changes made during the current transaction and to end the transaction.

A successful execution of CommitTrans triggers an OnCommitTransComplete event and sets the InTransaction property to False.


TADOConnection.Create

TADOConnection	See also

Constructs an instance of the button control and initializes its values.

constructor Create(AOwner: TComponent); override;

Description

Use Create to programmatically instantiate an ADO connection. ADO connections added in the form designer are created automatically.

Create

•	Calls its inherited Create method.

•	Initializes its connection interface.

•	Initializes is list of associated datasets.


TADOConnection.Destroy

TADOConnection	See also

Destroys the bitmap button object.

destructor Destroy; override;

Description

Do not call Destroy directly in an application.  Instead, call Free. Free verifies that the ADO connection is not nil, and only then calls Destroy.

Destroy performs the following tasks:

Closes the connection.

Destroys its list of associated datasets.

Checks for unprocessed connection events.

Destroys its connection interface.

Calls the inherited destructor.


TADOConnection.Execute

TADOConnection	See also

Executes a command.

function Execute(const CommandText: WideString; ExecuteOptions: TExecuteOptions = []): _RecordSet; overload;

procedure Execute(const CommandText: WideString; var RecordsAffected: Integer; ExecuteOptions: TExecuteOptions = [eoExecuteNoRecords]); overload;

Description

Call Execute to execute a command using the ADO connection object.

CommandText is the command to execute.

ExecuteOptions is a TExecuteOptions value that specifies the characteristics of the command execution.

Execute returns a recordset if the command executed is one that generates a recordset.

RecordsAffected indicates the number of records, if the command operates on data, that are affected by the command after execution.


TADOConnection.GetFieldNames

TADOConnection	See also

Populates a string list with the names of fields in a table.

procedure GetFieldNames(const TableName: String; List: TStrings);

Description

Call GetFieldNames to retrieve a list of fields in a table. The names of the fields are put into the already-existing string list object specified in the List parameter. Specify the table for which to retrieve the names of fields in the TableName property.

ADOConnection1.GetFieldNames('Employee', ListBox1.Items);


TADOConnection.GetProcedureNames

TADOConnection	See also

Populates a string list with the names of stored procedures in the database.

procedure GetProcedureNames(List: TStrings);

Description

Call GetProcedureNames to retrieve a list of stored procedures in the associated database. The names of the stored procedures are put into the already-existing string list object specified in the List parameter.

ADOConnection1.GetProcedureNames(ListBox1.Items);

Note: any contents already in the target string list object are eliminated and overwritten by the data produces by GetProcedureNames.


TADOConnection.GetTableNames

TADOConnection	See also

Populates a string list with the names of tables in the database.

procedure GetTableNames(List: TStrings; SystemTables: Boolean = False);

Description

Call GetTableNames to retrieve a list of tables in the associated database.

List is the already-existing string list object into which the tables names are put.

Set SystemTables to indicate whether the list of table names should include the database’s system tables.

ADOConnection1.GetTableNames(ListBox2.Items, False);

Note: any contents already in the target string list object are eliminated and overwritten by the data produces by GetTableNames.


TADOConnection.Open

TADOConnection	See also

Initiates a connection to a database.

procedure Open; overload;

procedure Open(const UserID: WideString; const Password: WideString); overload;

Description

Call Open to initiate a connection to the database specified in the ConnectionString property.

UserID and Password parameters for Open can be optionally used to pass the user ID and login password to the database server at the same time the request is made to connect.

ADOConnection1.Open('Joe Sixpack', 'SecretWord');

Alternately, this login information may be passed in the value in ConnectionString.

When explicitly passing login information through either the Open method or the ConnectionString, the LoginPrompt property should be set to False to prevent an unnecessary login dialog.


TADOConnection.OpenSchema

TADOConnection	See also

Retrieves schema information from the connection’s provider.

procedure OpenSchema(const Schema: TSchemaInfo; const Restrictions: OleVariant; const SchemaID: OleVariant; DataSet: TADODataSet);

Description

Call OpenSchema to open a connection and retrieve schema information from the associated provider. OpenSchema retrieves the schema information in the form of a recordset that can then be accessed through an ADO dataset component.

The Schema parameter is the type of schema information to retrieve, or in ADO terms, the query type.

SchemaID is the GUID for a provider-schema schema query not defined by the OLE DB specification. This parameter is required if the Schema parameter is set to siProviderSpecific, otherwise it is not used.

DataSet is the ADO dataset component (such as a TADOTable) into the Recordset property of which the schema information is retrieved and through which the information is subsequently accessed. After OpenSchema loads the ADO dataset component with the schema information, use the standard navigation methods like First and Next to traverse the rows of data. Use the Fields property or the FieldByName method of the dataset component to read the value of any one column. Alternately, the schema data may be displayed using visual data-aware controls and a TDataSource.


TADOConnection.RollbackTrans

TADOConnection	See also

Rolls back an active transaction.

procedure RollbackTrans;

Description

Call RollbackTrans to cancel any changes made during the current transaction and to end the transaction.

A successful execution of RollbackTrans triggers an OnRollbackTransComplete event and sets the InTransaction property to True.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomConnection


 TADODataSet

Hierarchy	Properties	Methods	Events	See also

TADODataSet represents a dataset retrieved from an ADO data store.

Unit

ADOdb

Description

TADODataSet is the most generic of the ADO dataset components. TADODataSet is capable of retrieving a result set from one or more tables in an ADO data store. The retrieval can be either directly from a table or from one or more tables through an SQL statement.

Connect a TADODataSet to a data store before using it to retrieve a dataset. Do this with a connection string in its ConnectionString property or with a connection already established by a TADOConnection component specified in the Connection property.

Use the TADODataSet component's CommandText property to retrieve the dataset, specifying either a table name or an SQL statement (SELECT only). TADODataSet is not capable of issuing Data Manipulation Language (DML) SQL statements that do not return result sets (like DELETE, INSERT, and UPDATE). For this use a component like TADOCommand or TADOQuery.


TADODataSet properties

TADODataSet	Alphabetically	Legend

In TADODataSet

RDSConnection

Derived from TCustomADODataSet

BlockReadSize

CacheSize

CanModify

CommandText

CommandTimeout

CommandType

Connection

ConnectionString

CursorLocation

CursorType

DesignerData

EnableBCD

ExecuteOptions

Filter

Filtered

FilterGroup

IndexFieldCount

IndexFields

LockType

MarshalOptions

MaxRecords

ParamCheck

Parameters

Prepared

Properties

RecNo

RecordCount

RecordSet

RecordSetState

RecordSize

RecordStatus

Sort

Derived from TDataSet

Active

ActiveRecord

AggFields

AutoCalcFields

BlobFieldCount

Bof

Bookmark

BookmarkSize

BufferCount

Buffers

CalcBuffer

CalcFieldsSize

Constraints

CurrentRecord

DataSetField

DataSource

DefaultFields

Designer

Eof

FieldCount

FieldDefList

FieldDefs

FieldList

FieldNoOfs

Fields

FieldValues

FilterOptions

Found

InternalCalcFields

Modified

Name

NestedDataSetClass

NestedDataSets

ObjectView

Reserved

SparseArrays

State

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TADODataSet properties

TADODataSet	By object	Legend

Active

ActiveRecord

AggFields

AutoCalcFields

BlobFieldCount

BlockReadSize

Bof

Bookmark

BookmarkSize

BufferCount

Buffers

CacheSize

CalcBuffer

CalcFieldsSize

CanModify

CommandText

CommandTimeout

CommandType

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Connection

ConnectionString

Constraints

CurrentRecord

CursorLocation

CursorType

DataSetField

DataSource

DefaultFields

Designer

DesignerData

DesignInfo

EnableBCD

Eof

ExecuteOptions

FieldCount

FieldDefList

FieldDefs

FieldList

FieldNoOfs

Fields

FieldValues

Filter

Filtered

FilterGroup

FilterOptions

Found

IndexFieldCount

IndexFields

InternalCalcFields

LockType

MarshalOptions

MaxRecords

Modified

Name

NestedDataSetClass

NestedDataSets

ObjectView

Owner

ParamCheck

Parameters

Prepared

Properties

RDSConnection

RecNo

RecordCount

RecordSet

RecordSetState

RecordSize

RecordStatus

Reserved

Sort

SparseArrays

State

Tag

VCLComObject


TADODataSet.RDSConnection

TADODataSet	See also

Specifies the RDS connection component to use.

property RDSConnection: TRDSConnection

Description

Use RDSConnection to specify the RDS connection component to use to obtain the recordset when the TADODataSet is opened. This property is mutually exclusive of the Connection property. If the TADODataSet uses RDSConnection to connect to the default RDS DataFactory, then the ConnectionString property should also be set with the connection information required by the DataFactory. The CommandText property should either specify the name of a property on the associated business object or be an SQL query.


TADODataSet events

TADODataSet	Alphabetically

Derived from TCustomADODataSet

OnEndOfRecordset

OnFetchComplete

OnFetchProgress

OnFieldChangeComplete

OnMoveComplete

OnRecordChangeComplete

OnRecordsetChangeComplete

OnWillChangeField

OnWillChangeRecord

OnWillChangeRecordset

OnWillMove

Derived from TDataSet

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TADODataSet events

TADODataSet	By object

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnEndOfRecordset

OnFetchComplete

OnFetchProgress

OnFieldChangeComplete

OnFilterRecord

OnMoveComplete

OnNewRecord

OnPostError

OnRecordChangeComplete

OnRecordsetChangeComplete

OnWillChangeField

OnWillChangeRecord

OnWillChangeRecordset

OnWillMove


TADODataSet methods

TADODataSet	Alphabetically

In TADODataSet

CreateDataSet

GetIndexNames

Derived from TCustomADODataSet

BookmarkValid

CancelBatch

CancelUpdates

Clone

CompareBookmarks

Create

CreateBlobStream

DeleteRecords

Destroy

FilterOnBookmarks

GetBlobFieldData

GetFieldData

IsSequenced

LoadFromFile

Locate

Lookup

Next

Requery

SaveToFile

Seek

Supports

UpdateBatch

UpdateStatus

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

Cancel

CheckBrowseMode

ClearFields

Close

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetCurrentRecord

GetDetailDataSets

GetDetailLinkFields

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsEmpty

IsLinkedTo

Last

MoveBy

Next

Open

Post

Prior

Refresh

Resync

SetFields

Translate

UpdateCursorPos

UpdateRecord

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TADODataSet methods

TADODataSet	By object

ActiveBuffer

AfterConstruction

Append

AppendRecord

Assign

BeforeDestruction

BookmarkValid

Cancel

CancelBatch

CancelUpdates

CheckBrowseMode

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClearFields

Clone

Close

CompareBookmarks

ControlsDisabled

Create

CreateBlobStream

CreateDataSet

CursorPosChanged

DefaultHandler

Delete

DeleteRecords

Destroy

DestroyComponents

Destroying

DisableControls

Dispatch

Edit

EnableControls

ExecuteAction

FieldAddress

FieldByName

FilterOnBookmarks

FindComponent

FindField

FindFirst

FindLast

FindNext

FindPrior

First

Free

FreeBookmark

FreeInstance

FreeNotification

FreeOnRelease

GetBlobFieldData

GetBookmark

GetCurrentRecord

GetDetailDataSets

GetDetailLinkFields

GetFieldData

GetFieldList

GetFieldNames

GetIndexNames

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GotoBookmark

HasParent

InheritsFrom

InitInstance

Insert

InsertComponent

InsertRecord

InstanceSize

IsEmpty

IsLinkedTo

IsSequenced

Last

LoadFromFile

Locate

Lookup

MethodAddress

MethodName

MoveBy

NewInstance

Next

NextRecordset

Open

Post

Prior

Refresh

RemoveComponent

Requery

Resync

SafeCallException

SaveToFile

Seek

SetFields

Supports

Translate

UpdateAction

UpdateBatch

UpdateCursorPos

UpdateRecord

UpdateStatus


TADODataSet.CreateDataSet

TADODataSet

Creates the recordset for an ADO dataset.

procedure CreateDataSet;

Description

Applications should not need to call CreateDataSet themselves. CreateDataSet is called automatically by an ADO dataset to create its recordset.


TADODataSet.GetIndexNames

TADOConnection	See also

Retrieves a list of available indexes for a table.

procedure GetIndexNames(List: TStrings);

Description

Call GetIndexNames to retrieve a list of all available indexes for a table. GetIndexNames fills a string list object (such as a TStringList) with the names of the index for the table represented by the TADODataSet component (and only that table). Any previous contents in the string list object are completely overwritten by the new information.

List is the string list object, created and maintained by the application, into which the index names are retrieved. This string list object must be created prior to the call to GetIndexNames.

The command line below fills the Items property of a TListBox with the names of indexes for the table represented by ADODataSet1.

ADODataSet1.GetIndexNames(ListBox1.Items);


Scope

Protected

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TDataSet

TCustomADODataSet


 TADOQuery

Hierarchy	Properties	Methods	Events	See also

TADOQuery provides the means for issuing SQL against an ADO data store.

Unit

ADOdb

Description

Use TADOQuery to access one or more tables in a data store using SQL statements.

Retrieve data from tables in an ADO data store using SELECT statements. Perform actions on tables and other metadata objects in an ADO data store with statements like INSERT, DELETE, UPDATE, ALTER TABLE, and CREATE TABLE. Execute stored procedures.


TADOQuery properties

TADOQuery	Alphabetically	Legend

In TADOQuery

DataSource

RowsAffected

SQL

Derived from TCustomADODataSet

BlockReadSize

CacheSize

CanModify

CommandText

CommandTimeout

CommandType

Connection

ConnectionString

CursorLocation

CursorType

DesignerData

EnableBCD

ExecuteOptions

Filter

Filtered

FilterGroup

IndexFieldCount

IndexFields

LockType

MarshalOptions

MaxRecords

ParamCheck

Parameters

Prepared

Properties

RecNo

RecordCount

RecordSet

RecordSetState

RecordSize

RecordStatus

Sort

Derived from TDataSet

Active

ActiveRecord

AggFields

AutoCalcFields

BlobFieldCount

Bof

Bookmark

BookmarkSize

BufferCount

Buffers

CalcBuffer

CalcFieldsSize

Constraints

CurrentRecord

DataSetField

DefaultFields

Designer

Eof

FieldCount

FieldDefList

FieldDefs

FieldList

FieldNoOfs

Fields

FieldValues

FilterOptions

Found

InternalCalcFields

Modified

Name

NestedDataSetClass

NestedDataSets

ObjectView

Reserved

SparseArrays

State

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TADOQuery properties

TADOQuery	By object	Legend

Active

ActiveRecord

AggFields

AutoCalcFields

BlobFieldCount

BlockReadSize

Bof

Bookmark

BookmarkSize

BufferCount

Buffers

CacheSize

CalcBuffer

CalcFieldsSize

CanModify

CommandText

CommandTimeout

CommandType

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Connection

ConnectionString

Constraints

CurrentRecord

CursorLocation

CursorType

DataSetField

DataSource

DefaultFields

Designer

DesignerData

DesignInfo

EnableBCD

Eof

ExecuteOptions

FieldCount

FieldDefList

FieldDefs

FieldList

FieldNoOfs

Fields

FieldValues

Filter

Filtered

FilterGroup

FilterOptions

Found

IndexFieldCount

IndexFields

InternalCalcFields

LockType

MarshalOptions

MaxRecords

Modified

Name

NestedDataSetClass

NestedDataSets

ObjectView

Owner

ParamCheck

Parameters

Prepared

Properties

RecNo

RecordCount

RecordSet

RecordSetState

RecordSize

RecordStatus

Reserved

RowsAffected

Sort

SparseArrays

SQL

State

Tag

VCLComObject


TADOQuery.DataSource

TADOQuery	See also

Specifies the data source component from which to extract current field values to use in same-name parameters in the ADO query’s SQL statement.

property DataSource: TDataSource;

Description

Set DataSource to automatically fill parameters in a query with fields values from another dataset. Parameters that have the same name as fields in the other dataset are filled with the field values. Parameters with names that are not the same as fields in the other dataset do not automatically get values, and must be programmatically set. For example, if the SQL property of the TADOQuery contains the SQL statement below and the dataset referenced through DataSource has a Custno field, the value from the current record in that other dataset is used in the CustNo parameter.

SELECT *

FROM Orders O

WHERE (O.CustNo = :CustNo)

DataSource must point to a TDataSource component linked to another dataset component; it cannot point to this query component. The dataset specified in DataSource must be created, populated, and opened before attempting to bind parameters. Parameters are bound by setting the ADO query’s Prepared property to True prior to executing the query. If the SQL statement used by a query does not contain parameters, or all parameters are bound by the application using the Parameters property or the ParamByName method, DataSource need not be assigned. The example below shows setting the DataSource property of ADOQuery2 to the data source for ADOQuery1, preparing ADOQuery2, and activating ADOQuery2.

with ADOQuery2 do begin

  DataSource := DataSource1;

  Prepared := True;

  Open;

end;

If the SQL statement in the TADOQuery is a SELECT query, the query is executed using the new field values each time the record pointer in the other dataset is changed. It is not necessary to call the Open method of the TADOQuery each time. This makes using the DataSource property to dynamically filter a query result set useful for establishing Master-Detail relationships. Set the DataSource property in the Detail query to the TDataSource component for the Master dataset.

If the SQL statement uses other than a SELECT query (such as INSERT or UPDATE), the parameters with the same name as fields in the other dataset still get values, but the query must be explicitly executed each time the other dataset’s record pointer moves. For example, the SQL statement below uses the INSERT statement and has the parameters Custno and CompanyName.

INSERT INTO Customer

(CustNo, Company)

VALUES (:CustNo, :CompanyName)

Another dataset, ADOQuery1 and DataSource1, has a CustNo field but no CompanyName field. If this dataset is used through the DataSource property, the CompanyName parameter must be programmatically assigned a value. Because ADOQuery1 has a CustNo field and ADOQuery1 is referenced through the DataSource property, the CustNo parameter automatically receives a value.

with ADOQuery2 do begin

  DataSource := DataSource1;

  ParamByName('CompanyName').AsString := Edit1.Text;

  Prepared := True;

  ExecSQL;

end;

If the SQL statement contains parameters with the same name as fields in the other dataset, do not manually set values for these parameters. Any values programmatically set, such as by using the Parameters property or the ParamByName method, will be overridden with automatic values. Parameters of other names must be programmatically given values. These parameters are unaffected by setting DataSource.

DataSource can be set at runtime or at design-time using the Object Inspector. At design-time, select the desired TDataSource from the drop-down list or type in the name.


TADOQuery.RowsAffected

TADOQuery	See also

Returns the number of rows operated upon by the latest query execution.

property RowsAffected: Integer;

Description

Inspect RowsAffected to determine how many rows were updated or deleted by the last query operation. If no rows were updated or deleted, RowsAffected has a value of zero. RowsAffected will have a value of –1 if the execution of the SQL statement could not be executed due to an error condition. This latter situation would typically follow the raising of an exception.


TADOQuery.SQL

TADOQuery	See also

Contains the text of the SQL statement to execute for the ADO query.

property SQL: TStrings;

Description

Use SQL to provide the SQL statement that an ADO query component executes when its ExecSQL or Open method is called.

The SQL statement provided to the SQL property may contain replaceable parameters, following standard ADO syntax conventions. Parameters are created and stored in the Parameters property.

At design-time, edit the SQL statement using the property editor invoked by clicking the ellipsis button of the property in the Object Inspector. At runtime, use properties and methods of string list objects to clear the current contents, add new contents, or to modify existing contents.

with ADOQuery1 do begin

  with SQL do begin

    Clear;

    Add('SELECT EmpNo, LastName, FirstName, HireDate');

    Add('FROM Employee');

  end;

  Open;

end;

Note:	Delphi does not evaluate the SQL sent to the database via a TADOQuery component. The SQL used must be valid for the particular database type accessed via ADO. Any error messages passed back to the application will have originated at the ADO or database level, and so will have error codes and messages specific to those systems.


TADOQuery events

TADOQuery	Alphabetically

Derived from TCustomADODataSet

OnEndOfRecordset

OnFetchComplete

OnFetchProgress

OnFieldChangeComplete

OnMoveComplete

OnRecordChangeComplete

OnRecordsetChangeComplete

OnWillChangeField

OnWillChangeRecord

OnWillChangeRecordset

OnWillMove

Derived from TDataSet

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TADOQuery events

TADOQuery	By object

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnEndOfRecordset

OnFetchComplete

OnFetchProgress

OnFieldChangeComplete

OnFilterRecord

OnMoveComplete

OnNewRecord

OnPostError

OnRecordChangeComplete

OnRecordsetChangeComplete

OnWillChangeField

OnWillChangeRecord

OnWillChangeRecordset

OnWillMove


TADOQuery methods

TADOQuery	Alphabetically

In TADOQuery

Create

Destroy

ExecSQL

Derived from TCustomADODataSet

BookmarkValid

CancelBatch

CancelUpdates

Clone

CompareBookmarks

CreateBlobStream

DeleteRecords

FilterOnBookmarks

GetBlobFieldData

GetFieldData

IsSequenced

LoadFromFile

Locate

Lookup

NextRecordset

SaveToFile

Seek

Supports

UpdateBatch

UpdateStatus

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

Cancel

CheckBrowseMode

ClearFields

Close

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetCurrentRecord

GetDetailDataSets

GetDetailLinkFields

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsEmpty

IsLinkedTo

Last

MoveBy

Next

Open

Post

Prior

Refresh

Resync

SetFields

Translate

UpdateCursorPos

UpdateRecord

UpdateStatus

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TADOQuery methods

TADOQuery	By object

ActiveBuffer

AfterConstruction

Append

AppendRecord

Assign

BeforeDestruction

BookmarkValid

Cancel

CancelBatch

CancelUpdates

CheckBrowseMode

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClearFields

Clone

Close

CompareBookmarks

ControlsDisabled

Create

CreateBlobStream

CursorPosChanged

DefaultHandler

Delete

DeleteRecords

Destroy

DestroyComponents

Destroying

DisableControls

Dispatch

Edit

EnableControls

ExecSQL

ExecuteAction

FieldAddress

FieldByName

FilterOnBookmarks

FindComponent

FindField

FindFirst

FindLast

FindNext

FindPrior

First

Free

FreeBookmark

FreeInstance

FreeNotification

FreeOnRelease

GetBlobFieldData

GetBookmark

GetCurrentRecord

GetDetailDataSets

GetDetailLinkFields

GetFieldData

GetFieldList

GetFieldNames

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GotoBookmark

HasParent

InheritsFrom

InitInstance

Insert

InsertComponent

InsertRecord

InstanceSize

IsEmpty

IsLinkedTo

IsSequenced

Last

LoadFromFile

Locate

Lookup

MethodAddress

MethodName

MoveBy

NewInstance

Next

NextRecordset

Open

Post

Prior

Refresh

RemoveComponent

Resync

SafeCallException

SaveToFile

Seek

SetFields

Supports

Translate

UpdateAction

UpdateBatch

UpdateCursorPos

UpdateRecord

UpdateStatus


TADOQuery.Create

TADOQuery	See also

Creates an instance of a TADOQuery component.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate an ADO query component at runtime. Query components placed in forms or data modules at design time are created automatically.


TADOQuery.Destroy

TADOQuery	See also

Destroys the TADOQuery instance.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Usually destruction of ADO query components is handled automatically by Delphi. If an application creates its own instances of a query, and does not assign an Owner that is responsible for freeing the dataset, then the application should call Free, which checks that the query is not nil before calling Destroy.


TADOQuery.ExecSQL

TADOQuery	See also

Executes the SQL statement for the ADO query.

function ExecSQL: Integer;

Description

Call ExecSQL to execute the SQL statement currently assigned to the SQL property. Use ExecSQL to execute queries that do not return a cursor to data (such as INSERT, UPDATE, DELETE, and CREATE TABLE).

Note:	For SELECT statements, call Open instead of ExecSQL or set the Active property to True.

Provide any input parameters in the Parameters property. At design-time, a developer can provide parameters using the Parameters Editor. At runtime an application must access the Parameters property directly, identifying particular parameters by their ordinal position in the SQL statement.

To speed performance, an application should ordinarily prepare the query by setting the Prepared property to True before calling ExecSQL for the first time.


Scope

Protected

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TDataSet

TCustomADODataSet


 TADOStoredProc

Hierarchy	Properties	Methods	Events	See also

TADOStoredProc encapsulates a stored procedure in an ADO database.

Unit

ADOdb

Description

Use a TADOStoredProc object when a client application must use a stored procedure in a database. A stored procedure is a grouped set of statements, stored as part of a database’s metadata (just like tables, indexes, and domains), that performs a frequently-repeated, database-related task on the server and passes results to the client.

Note:	Not all database servers support stored procedures. See a specific server’s documentation to determine if it supports stored procedures.

Many stored procedures require a series of input arguments, or parameters, that are used during processing. TADOStoredProc provides a Parameters property that enables an application to set these parameters before executing the stored procedure.

TADOStoredProc reuses the Parameters property to hold the results returned by a stored procedure. Parameters is a collection of TParameter objects, each representing an individual parameter for the stored procedure. Depending on server implementation, a stored procedure can return either a single set of values, or a result set similar to the result set returned by a query.


TADOStoredProc properties

TADOStoredProc	Alphabetically	Legend

In TADOStoredProc

ProcedureName

Derived from TCustomADODataSet

BlockReadSize

CacheSize

CanModify

CommandText

CommandTimeout

CommandType

Connection

ConnectionString

CursorLocation

CursorType

DesignerData

EnableBCD

ExecuteOptions

Filter

Filtered

FilterGroup

IndexFieldCount

IndexFields

LockType

MarshalOptions

MaxRecords

ParamCheck

Parameters

Prepared

Properties

RecNo

RecordCount

RecordSet

RecordSetState

RecordSize

RecordStatus

Sort

Derived from TDataSet

Active

ActiveRecord

AggFields

AutoCalcFields

BlobFieldCount

Bof

Bookmark

BookmarkSize

BufferCount

Buffers

CalcBuffer

CalcFieldsSize

Constraints

CurrentRecord

DataSetField

DataSource

DefaultFields

Designer

Eof

FieldCount

FieldDefList

FieldDefs

FieldList

FieldNoOfs

Fields

FieldValues

FilterOptions

Found

InternalCalcFields

Modified

Name

NestedDataSetClass

NestedDataSets

ObjectView

Reserved

SparseArrays

State

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TADOStoredProc properties

TADOStoredProc	By object	Legend

Active

ActiveRecord

AggFields

AutoCalcFields

BlobFieldCount

BlockReadSize

Bof

Bookmark

BookmarkSize

BufferCount

Buffers

CacheSize

CalcBuffer

CalcFieldsSize

CanModify

CommandText

CommandTimeout

CommandType

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Connection

ConnectionString

Constraints

CurrentRecord

CursorLocation

CursorType

DataSetField

DataSource

DefaultFields

Designer

DesignerData

DesignInfo

EnableBCD

Eof

ExecuteOptions

FieldCount

FieldDefList

FieldDefs

FieldList

FieldNoOfs

Fields

FieldValues

Filter

Filtered

FilterGroup

FilterOptions

Found

IndexFieldCount

IndexFields

InternalCalcFields

LockType

MarshalOptions

MaxRecords

Modified

Name

NestedDataSetClass

NestedDataSets

ObjectView

Owner

ParamCheck

Parameters

Prepared

ProcedureName

Properties

RecNo

RecordCount

RecordSet

RecordSetState

RecordSize

RecordStatus

Reserved

Sort

SparseArrays

State

Tag

VCLComObject


TADOStoredProc.ProcedureName

TADOStoredProc	See also

Indicates the stored procedure used by the TADOStoredProc.

property ProcedureName: WideString;

Description

Set ProcedureName to specify the stored procedure in an ADO database with which the TADOStoredProc is associated.

At design-time, the property editor displays a list of available stored procedures. This list is only possible when a valid connection can be established between the stored procedure component and a database.

At runtime, set the ProcedureName property using a WideString (or comparable) value. The value used must be a valid name for a stored procedure in the associated database.


TADOStoredProc events

TADOStoredProc	Alphabetically

Derived from TCustomADODataSet

OnEndOfRecordset

OnFetchComplete

OnFetchProgress

OnFieldChangeComplete

OnMoveComplete

OnRecordChangeComplete

OnRecordsetChangeComplete

OnWillChangeField

OnWillChangeRecord

OnWillChangeRecordset

OnWillMove

Derived from TDataSet

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TADOStoredProc events

TADOStoredProc	By object

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnEndOfRecordset

OnFetchComplete

OnFetchProgress

OnFieldChangeComplete

OnFilterRecord

OnMoveComplete

OnNewRecord

OnPostError

OnRecordChangeComplete

OnRecordsetChangeComplete

OnWillChangeField

OnWillChangeRecord

OnWillChangeRecordset

OnWillMove


TADOStoredProc methods

TADOStoredProc	Alphabetically

In TADOStoredProc

Create

Derived from TCustomADODataSet

BookmarkValid

CancelBatch

CancelUpdates

Clone

CompareBookmarks

CreateBlobStream

DeleteRecords

Destroy

FilterOnBookmarks

GetBlobFieldData

GetFieldData

IsSequenced

LoadFromFile

Locate

Lookup

NextRecordset

SaveToFile

Seek

Supports

UpdateBatch

UpdateStatus

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

Cancel

CheckBrowseMode

ClearFields

Close

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetCurrentRecord

GetDetailDataSets

GetDetailLinkFields

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsEmpty

IsLinkedTo

Last

MoveBy

Next

Open

Post

Prior

Refresh

Resync

SetFields

Translate

UpdateCursorPos

UpdateRecord

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TADOStoredProc methods

TADOStoredProc	By object

ActiveBuffer

AfterConstruction

Append

AppendRecord

Assign

BeforeDestruction

BookmarkValid

Cancel

CancelBatch

CancelUpdates

CheckBrowseMode

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClearFields

Clone

Close

CompareBookmarks

ControlsDisabled

Create

CreateBlobStream

CursorPosChanged

DefaultHandler

Delete

DeleteRecords

Destroy

DestroyComponents

Destroying

DisableControls

Dispatch

Edit

EnableControls

ExecuteAction

FieldAddress

FieldByName

FilterOnBookmarks

FindComponent

FindField

FindFirst

FindLast

FindNext

FindPrior

First

Free

FreeBookmark

FreeInstance

FreeNotification

FreeOnRelease

GetBlobFieldData

GetBookmark

GetCurrentRecord

GetDetailDataSets

GetDetailLinkFields

GetFieldData

GetFieldList

GetFieldNames

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GotoBookmark

HasParent

InheritsFrom

InitInstance

Insert

InsertComponent

InsertRecord

InstanceSize

IsEmpty

IsLinkedTo

IsSequenced

Last

LoadFromFile

Locate

Lookup

MethodAddress

MethodName

MoveBy

NewInstance

Next

NextRecordset

Open

Post

Prior

Refresh

RemoveComponent

Resync

SafeCallException

SaveToFile

Seek

SetFields

Supports

Translate

UpdateAction

UpdateBatch

UpdateCursorPos

UpdateRecord

UpdateStatus


TADOStoredProc.Create

TADOStoredProc	See also

Creates an instance of a TADOStoredProc component.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate an ADO stored procedure component at runtime. Stored procedure components placed in forms or data modules at design time are created automatically.

Create

Calls its inherited Create method.

Sets the CommandType property to cmdStoredProc.


TADOStoredProc.ExecProc

TADOStoredProc	See also

Executes the stored procedure on the server.

procedure ExecProc;

Description

Call ExecProc to execute a stored procedure. Before calling ExecProc:

1	Provide any input parameters in the Parameters property. At design-time, a developer can provide parameters using the Parameters Editor. At runtime an application must access the Parameters property directly.

2	Set the Prepared property to True to bind the parameters.

If a stored procedure returns output parameters, they are stored in the Parameters property when ExecProc returns control to the application. An application can access the output parameters using the Parameters property and identifying the particular parameter by its number.

Tip:	If an application is only interested in the result set returned by a stored procedure, call Open method for the TADOStoredProc component or set its Active property to True.


Scope

Protected

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TDataSet

TCustomADODataSet


 TADOTable

Hierarchy	Properties	Methods	Events	See also

TADOTable is a dataset component that encapsulates a table accessed through an ADO data store.

Unit

ADOdb

Description

Use TADOTable to access data in a single database table using ADO. TADOTable provides direct access to every record and field in an underlying database table. An ADO table component can also work with a subset of records within a database table using ranges and filters.


TADOTable properties

TADOTable	Alphabetically	Legend

In TADOTable

IndexFieldNames

MasterFields

MasterSource

ReadOnly

TableDirect

TableName

Derived from TCustomADODataSet

BlockReadSize

CacheSize

CanModify

CommandText

CommandTimeout

CommandType

Connection

ConnectionString

CursorLocation

CursorType

DesignerData

ExecuteOptions

Filter

Filtered

FilterGroup

IndexFieldCount

IndexFields

LockType

MarshalOptions

MaxRecords

ParamCheck

Parameters

Prepared

Properties

RecNo

RecordCount

RecordSet

RecordSetState

RecordSize

RecordStatus

Sort

Derived from TDataSet

Active

ActiveRecord

AggFields

AutoCalcFields

BlobFieldCount

Bof

Bookmark

BookmarkSize

BufferCount

Buffers

CalcBuffer

CalcFieldsSize

Constraints

CurrentRecord

DataSetField

DataSource

DefaultFields

Designer

Eof

FieldCount

FieldDefList

FieldDefs

FieldList

FieldNoOfs

Fields

FieldValues

FilterOptions

Found

InternalCalcFields

Modified

Name

NestedDataSetClass

NestedDataSets

ObjectView

Reserved

SparseArrays

State

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TADOTable properties

TADOTable	By object	Legend

Active

ActiveRecord

AggFields

AutoCalcFields

BlobFieldCount

BlockReadSize

Bof

Bookmark

BookmarkSize

BufferCount

Buffers

CacheSize

CalcBuffer

CalcFieldsSize

CanModify

CommandText

CommandTimeout

CommandType

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Connection

ConnectionString

Constraints

CurrentRecord

CursorLocation

CursorType

DataSetField

DataSource

DefaultFields

Designer

DesignerData

DesignInfo

Eof

ExecuteOptions

FieldCount

FieldDefList

FieldDefs

FieldList

FieldNoOfs

Fields

FieldValues

Filter

Filtered

FilterGroup

FilterOptions

Found

IndexFieldCount

IndexFieldNames

IndexFields

InternalCalcFields

LockType

MarshalOptions

MasterFields

MasterSource

MaxRecords

Modified

Name

NestedDataSetClass

NestedDataSets

ObjectView

Owner

Parameters

Prepared

Properties

ReadOnly

RecNo

RecordCount

RecordSet

RecordSetState

RecordSize

RecordStatus

Reserved

Sort

SparseArrays

State

TableDirect

TableName

Tag

VCLComObject


TADOTable.IndexFieldNames

TADOTable	See also

Lists the columns to use as an index for a table.

property IndexFieldNames: String;

Description

Use IndexFieldNames as an alternative method of specifying the index to use for a table. In IndexFieldNames specify the name of each column to use as an index for a table. Ordering of column names is significant. Separate names with semicolon. There need not be an index in existence based on the specified columns.


TADOTable.MasterFields

TADOTable	See also

Specifies field or fields on which a Master-Detail link is based.

property MasterFields: String;

Description

Use MasterFields after setting the MasterSource property to specify the names of one or more fields to use in establishing a Master-Detail relationship between this table and the one associated with the TDataSource specified in MasterSource.

ADOTable2.MasterSource := DataSource1;

ADOTable2.MasterFields := 'CustID'

MasterFields is a string containing one or more field names in the master table. When the tables are related based on two fields, separate field names with semicolons.

ADOTable2.MasterSource := DataSource1;

ADOTable2.MasterFields := 'CustID;SaleDate'

Each time the current record in the master table changes, the new values in those fields are used to select corresponding records in this table for display.

Note:	At design time, use the Field Link designer to establish the master-detail relationship between two tables.


TADOTable.MasterSource

TADOTable	See also

Specifies the data source component used for a Master-Detail relationship.

property MasterSource: TDataSource;

Description

Use MasterSource to specify the name of the data source component whose DataSet property identifies a dataset to use as a Master table in establishing a Master-Detail relationship between this table and another one.

After setting the MasterSource property, specify which fields to use in the master table by setting the MasterFields property. At runtime each time the current record in the master table changes, the new values in those fields are used to select corresponding records in this table for display.

ADOTable2.MasterSource := DataSource1;

ADOTable2.MasterFields := 'CustID'

Note:	At design time choose an available data source from the MasterSource property’s drop-down list in the Object Inspector.


TADOTable.ReadOnly

TADOTable	See also

Specifies whether the data retrieved is read-only.

property ReadOnly: Boolean

Description

Use the ReadOnly property to prevent users from updating, inserting, or deleting data through the TADOTable. By default, ReadOnly is False, meaning users can alter a table’s data.


TADOTable.TableDirect

TADOTable

Specifies how the table is referenced.

property TableDirect: Boolean read GetTableDirect write SetTableDirect default False;

Description

Set TableDirect to specify whether the table is accessed simply via its name or whether a background SQL statement is used. Not all providers support accessing a table by its name and require that this access be done with a SELECT statement. If TableDirect is True the data retrieval request uses a background SQL statement and all columns are simply returned. If it is False, the TADOTable component creates a SELECT statement to retrieve the table's data. The default value of TableDirect is False.


TADOTable.TableName

TADOTable	See also

Indicates the base table operated on.

property TableName: WideString;

Description

Use TableName to specify the base table in a database on which the ADO table component operates. Data is retrieved from and changes written to this base table.

Before setting or changing the value of TableName, you should deactivate the ADO table component by calling its Close method or setting its Active property to False.

At design-time, if a valid connection to a database can be established, the Object Inspector provides a drop-down list of names of available tables.


TADOTable events

TADOTable	Alphabetically

Derived from TCustomADODataSet

OnEndOfRecordset

OnFetchComplete

OnFetchProgress

OnFieldChangeComplete

OnMoveComplete

OnRecordChangeComplete

OnRecordsetChangeComplete

OnWillChangeField

OnWillChangeRecord

OnWillChangeRecordset

OnWillMove

Derived from TDataSet

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TADOTable events

TADOTable	By object

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnEndOfRecordset

OnFetchComplete

OnFetchProgress

OnFieldChangeComplete

OnFilterRecord

OnMoveComplete

OnNewRecord

OnPostError

OnRecordChangeComplete

OnRecordsetChangeComplete

OnWillChangeField

OnWillChangeRecord

OnWillChangeRecordset

OnWillMove


TADOTable methods

TADOTable	Alphabetically

In TADOTable

Create

Destroy

GetIndexNames

In TCustomADODataSet

BookmarkValid

CancelBatch

CancelUpdates

Clone

CompareBookmarks

CreateBlobStream

DeleteRecords

FilterOnBookmarks

GetBlobFieldData

GetFieldData

IsSequenced

LoadFromFile

Locate

Lookup

NextRecordset

SaveToFile

Seek

Supports

UpdateBatch

UpdateStatus

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

Cancel

CheckBrowseMode

ClearFields

Close

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetCurrentRecord

GetDetailDataSets

GetDetailLinkFields

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsEmpty

IsLinkedTo

Last

MoveBy

Next

Open

Post

Prior

Refresh

Resync

SetFields

Translate

UpdateCursorPos

UpdateRecord

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TADOTable methods

TADOTable	By object

ActiveBuffer

AfterConstruction

Append

AppendRecord

Assign

BeforeDestruction

BookmarkValid

Cancel

CancelBatch

CancelUpdates

CheckBrowseMode

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClearFields

Clone

Close

CompareBookmarks

ControlsDisabled

Create

CreateBlobStream

CursorPosChanged

DefaultHandler

Delete

DeleteRecords

Destroy

DestroyComponents

Destroying

DisableControls

Dispatch

Edit

EnableControls

ExecuteAction

FieldAddress

FieldByName

FilterOnBookmarks

FindComponent

FindField

FindFirst

FindLast

FindNext

FindPrior

First

Free

FreeBookmark

FreeInstance

FreeNotification

FreeOnRelease

GetBlobFieldData

GetBookmark

GetCurrentRecord

GetDetailDataSets

GetDetailLinkFields

GetFieldData

GetFieldList

GetFieldNames

GetIndexNames

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GotoBookmark

HasParent

InheritsFrom

InitInstance

Insert

InsertComponent

InsertRecord

InstanceSize

IsEmpty

IsLinkedTo

IsSequenced

Last

LoadFromFile

Locate

Lookup

MethodAddress

MethodName

MoveBy

NewInstance

Next

NextRecordset

Open

Post

Prior

Refresh

RemoveComponent

Resync

SafeCallException

SaveToFile

Seek

SetFields

Supports

Translate

UpdateAction

UpdateBatch

UpdateCursorPos

UpdateRecord

UpdateStatus


TADOTable.Create

TADOTable	See also

Creates an instance of a TADOTable component.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate an ADO table component at runtime. Table components placed in forms or data modules at design time are created automatically.

Create

Calls its inherited Create method.

Sets the CommandType property to cmdTable.


TADOTable.Destroy

TADOTable	See also

Destroys the TADOTable instance.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Usually destruction of ADO table components is handled automatically by Delphi. If an application creates its own instances of a table, and does not assign an Owner that is responsible for freeing the dataset, then the application should call Free, which checks that the table component is not nil before calling Destroy.

Destroy performs the following tasks:

Closes the dataset.

Calls the inherited destructor.


TADOTable.GetIndexNames

TADOConnection

Retrieves a list of available indexes for a table.

procedure GetIndexNames(List: TStrings);

Description

Call GetIndexNames to retrieve a list of all available indexes for a table. GetIndexNames fills a string list object (such as a TStringList) with the names of the index for the table represented by the TADOTable component (and only that table). Any previous contents in the string list object are completely overwritten by the new information.

List is the string list object, created and maintained by the application, into which the index names are retrieved. This string list object must be created prior to the call to GetIndexNames.

The command line below fills the Items property of a TListBox with the names of indexes for the table represented by ADOTable1.

ADOTable1.GetIndexNames(ListBox1.Items);


Scope

Protected

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TDataSet

TCustomADODataSet


TCommandType type

See also

TCommandType values designate the type of a command.

Unit

ADOdb

type TCommandType = (cmdUnknown, cmdText, cmdTable, cmdStoredProc, cmdFile, cmdTableDirect);

Description

Use TCommandType values to specify the type for a command contained in the CommandText property of an ADO component capable of issuing commands.

The constants that make up the TCommandType type correspond directly to the ADO CommandTypeEnum constants. These constants are used in the CommandType property of ADO Command objects. For additional information on these ADO constants and their effects, see the Microsoft Data Access SDK help in the topic for the CommandType property of the ADO Command object.

TCommandType consists of the seven constants summarized in the following table:

Command type	Meaning

cmdUnknown	The type of command in the CommandText property is not known.

cmdText	CommandText is a textual definition of a command or stored procedure call; data returned by an internal SQL statement.

cmdTable	CommandText is the name of a table.

cmdStoredProc	CommandText is the name of a stored procedure.

cmdFile	CommandText is the name of a saved recordset file.

cmdTableDirect	CommandText is the name of a table; all columns are returned.

Note:	The TCommandType constants cmdTable, cmdTableDirect, and cmdOpenFile are not for use with commands executed from a TADOCommand component.


TConnectMode type

See also

TConnectMode values indicate the persimissions available to a connection.

Unit

ADOdb

type TConnectMode = (cmUnknown, cmRead, cmWrite, cmReadWrite, cmShareDenyRead, cmShareDenyWrite, cmShareExclusive, cmShareDenyNone);

Description

Use TConnectMode values to determine the permissions available to a connection and thus what type of data operations can be performed through that connection.

TConnectMode constants correspond directly to the ConnectModeEnum values for the Mode property of the ADO Connection object. The TConnectMode constants have the same effect on a TADOConnection component as the ConnectModeEnum values have on the Connection object. These values are discussed in the Microsoft Data Access SDK help.

TConnectMode consists of the eight constants summarized in the following table:

Connect Mode	Meaning

cmUnknown	The permissions have not yet been set for the connection or cannot be determined.

cmRead	Read-only permissions are available to the connection.

cmWrite	Write-only permissions are available to the connection.

cmReadWrite	Read/write permissions are available to the connection.

cmShareDenyRead	Prevents others from opening connections with read permissions.

cmShareDenyWrite	Prevents others from opening connection with write permissions.

cmShareExclusive	Prevents others from opening connection.

cmShareDenyNone	Prevents others from opening connection with any permissions.


TCursorLocation type

See also

TCursorLocation values specify whether to use client-side or server-side cursor library.

Unit

ADOdb

type TCursorLocation = (clUseServer, clUseClient);

Description

Use TCursorLocation values when determining a cursor location to specify whether to use a client-side or server-side cursor library. The value clUseServer indicates a server-side cursor library is used and clUseClient that a client-side cursor is used.

The TCursorLocation constants correspond to the Long value in the CursorLocation property of ADO Connection and Recordset objects. The ADO constants are adUseNone, adUseClient, and adUseServer. The Delphi values clUseServer and clUseClient have the same effect as the ADO values adUseClient and adUseServer. See the Microsoft Data Access SDK help for information on these values and their effects.


TCursorOption, TCursorOptions type

See also

TCursorOptions values indicate the functionality a recordset provides.

Unit

ADOdb

type

  TCursorOption = (coHoldRecords, coMovePrevious, coAddNew, coDelete, coUpdate, coBookmark, coApproxPosition, coUpdateBatch, coResync, coNotify, coFind , coSeek, coIndex);

  TCursorOptions = set of TCursorOption;

Description

TCursorOptions values are individual options the Supports method checks for. Include one or more of these values as a set for the CursorOptions parameter of Supports.

The constants of the TCursorOptions type correspond directly with the CursorOptions parameter of the Supports method of the ADO Recordset object. See the Microsoft Data Access SDK help for information on these values and their effects.

TCursorOptions consists of the eleven constants summarized in the following table:

Cursor Option	Meaning

coHoldRecords	More records can be retrieved or the position of the next retrieve can be changed without committing pending changes.

coMovePrevious	The pointer in the ADO Recordset object can be moved backwards without using bookmarks.

coAddNew	The recordset supports adding new records.

coDelete	The recordset supports deleting existing records.

coUpdate	The recordset supports modifying existing records.

coBookmark	The Bookmark property of the Recordset object can be used to move to or access specific records.

coApproxPosition	The recordset supports use of the RecNo property of the ADO dataset component.

coUpdateBatch	Batch updating (using the UpdateBatch and CancelBatch methods) can be used to transmit changes to the provider in groups.

coResync	The data in the cursor can be updated with the Resync method.

coNotify	The recordset supports notifications and returns events.

coFind	The Locate method can be used with the ADO dataset component.

coSeek	The Seek method can be used to search for a row in a dataset.

coIndex	The IndexName property of the ADO dataset component can be used to specify an index.


TCursorType type

See also

TCursorType valies indicate the type of cursor to use for a recordset.

Unit

ADOdb

type TCursorType = (ctUnspecified, ctOpenForwardOnly, ctKeyset, ctDynamic, ctStatic);

Description

Use TCursorType values to indicate the type of cursor to use when a recordset is opened.

The constants of TCursorType correspond with the CursorTypeEnum values for the CursorType property of the ADO recordset object. See the Microsoft Data Access SDK help for information on these values and their effects.

TCursorType consists of the five constants summarized in the following table:

Cursor Type	Meaning

ctUnspecified	A specific cursor type has not yet been specified.

ctOpenForwardOnly	Forward-only cursor in which you can only scroll forward; better performance because only requires single through recordset.

ctKeyset	Keyset cursor; records added by other users are not visible; records deleted by other users are inaccessible.

ctDynamic	Dynamic cursor; data modifications, deletions, and insertions by other users are visible; scrolling forward and back allowed.

ctStatic	Static cursor; static copy of records; data changes by other users not visible; used mostly for reporting.

Note:	Only ctStatic is supported if the CursorLocation property of the ADO dataset component is set to clUseClient.

Note:	If the requested cursor type is not supported by the provider, the provider may return another cursor type. This alternate cursor type is reflected in the CursorType property after the recordset is opened.


TExecuteOptions type
TExecuteOption, TExecuteOptions type

See also

TExecuteOptions values specify the characteristics of an execution operation.

Unit

ADOdb

type

  TExecuteOption = (eoAsyncExecute, eoAsyncFetch, eoAsyncFetchNonBlocking, eoExecuteNoRecords);

  TExecuteOptions = set of TExecuteOption;

Description

When executing a command or connection using a method, use TExecuteOptions values to specify the characteristics of the execution operation. When reacting to a command or connection execution in an event handler, read the execute options parameter to determine the options already established for the connection triggering the event.

TExecuteOptions consists of the five constants summarized in the following table:

Execute Option	Meaning

eoAsyncExecute	The command is executed asynchronously.

eoAsyncFetch	The command fetches remaining rows after the initial quantity specified in the Cache property asynchronously.

eoAsyncFetchNonBlocking	Execution is performed without blocking the thread.

eoExecuteNoRecords	A command or stored procedure that does not return. If any rows are retrieved, they are discarded and not returned.


TEventReason type

See also

TEventReason values indicate the reason an event occurred.

Unit

ADOdb

type

 TEventReason = (erAddNew, erDelete, erUpdate, erUndoUpdate, erUndoAddNew, erUndoDelete, erRequery, erResynch, erClose, erMove, erFirstChange, erMoveFirst, erMoveNext, erMovePrevious, erMoveLast);

Description

Use TEventReason values to determine the reason an event has occurred.

TEventReason consists of the five constants summarized in the following table:

Execute Option	Meaning

erAddNew	A new row was added.

erDelete	An existing row was deleted.

erUpdate	An existing row was modified with new values.

erUndoUpdate	An update operation was canceled.

erUndoAddNew	A row insert operation was canceled.

erUndoDelete	A row delete operation was canceled.

erRequery	The recordset was refreshed with the Requery method.

erResynch	The recordset was resynchronized with the Resynch method.

erClose	The recordset was closed.

erMove	The recordset's row pointer moved.

erFirstChange	Equivalent to the ADO value ad.

erMoveFirst	The recordset's row pointer moved to the first row.

erMoveNext	The recordset's row pointer moved to the next row.

erMovePrevious	The recordset's row pointer moved to the previous row.

erMoveLast	The recordset's row pointer moved to the last row.


TEventStatus type

See also

TEventStatus values indicate the success or failure of an operation.

Unit

ADOdb

type

  TEventStatus = (esOK, esErrorsOccured, esCantDeny, esCancel, esUnwantedEvent);

Description

Read TEventStatus values to determine the success or failure status of an operation that triggers an event. A TEventStatus value is passed to the handler for every event of the TADOConnection and TCustomADODataSet descendant. Each TEventStatus is directly equivalent to the ADO value with a similar name.

In some cases, the event handler status parameter may be assigned a value to alter the outcome of the occurrence that triggered the event. These cases are documented in the help topics for individual connection and dataset component events.

The EventStatus parameter of associated event handlers surfaces the ADO adStatus parameter of its events, which is of ADO type EventStatusEnum. If the operation executed without problem, the TEventStatus value returned is esOK. If the operation did not execute without problem, one of the other values is returned. For instance, esErrorOccured is returned when the operation failed because of one or more error conditions.

TEventStatus consists of the five constants summarized in the following table:

Execute Option	Meaning

esOK	Operation executed without problem.

esErrorsOccured	An error occurred during execution of the operation.

esCantDeny	A pending connection operation cannot be canceled. (Connection events only.).

esCancel	A pending connection has been canceled before it became active. (Connection events only.)

esUnwantedEvent	Set by the ADO method, prevents subsequent notification of the event.


TADOLockType type

See also

TADOLockType specifies the types of locks used.

Unit

ADOdb

type TADOLockType = (ltUnspecified, ltReadOnly, ltPessimistic, ltOptimistic, ltBatchOptimistic);

Description

Use TADOLockType with execution methods to specify the types of record locks used during editing. Lock type values allow you to specify whether the locking scheme used for a recordset is optimistic or pessimistic. To use a specific locking scheme, the provider and database type must support that locking scheme. Use ltUnspecified to have the provider use the default locking scheme. Use the LockType ltBatchOptimistic to open a recordset in batch update mode.

In addition to use as command execution method parameters, TADOLockType values are passed as var parameters to event handlers related to execution. This value indicates the lock type already in use when the execution was initiated. The LockType parameter of the TADOConnection.OnWillExecute event is an example of this.

The constants that make up the TADOLockType type correspond directly to the LockTypeEnum values with similar names. These values are discussed in the Microsoft Data Access SDK help, in the topic for the LockType property of the ADO Recordset object. See the SDK for additional information on the ADO constants and their effects.

TADOLockType consists of the five constants summarized in the following table:

Lock Type	Meaning

ltUnspecified	A specific lock type has not been specified or determined.

ltReadOnly	Read-only; the current execution cannot modify data.

ltPessimistic	Pessimistic locks; locks instantiated on a record-by-record basis when edit mode is applied to a record.

ltOptimistic	Optimistic locks; locked are initiated on a record-by-record basis, but only when updates are applied and a record is being updated.

ltBatchOptimistic	Optimistic batch updates; used for batch update mode rather than immediate update mode.


TIsolationLevel type

See also

TIsolationLevel values specify the level of isolation for a connection.

Unit

ADOdb

type TIsolationLevel = (ilUnspecified, ilChaos, ilReadUncommitted, ilBrowse, ilCursorStability, ilReadCommitted, ilRepeatableRead, ilSerializable, ilIsolated);

Description

Use TIsolationLevel values to specify the transaction isolation level for a connection.

Note:	it is possible that a server will force an isolation level other than that requested.

The constants that make up the TIsolationLevel type correspond directly to the ADO IsolationLevelEnum values with the same names. These values are discussed in the Microsoft Data Access SDK help, in the topic for the IsolationLevel property of the ADO Connection object. See the SDK for additional information on the ADO constants and their effects.

The constants that make up the TADOLockType type correspond directly to the LockTypeEnum values with similar names and have the same effects. These values are discussed in the Microsoft Data Access SDK help, in the topic for the LockType property of the ADO Recordset object. See the SDK for additional information on the ADO constants and their effects.

TIsolationLevel consists of the nine constants summarized in the following table:

Isolation Level	Meaning

ilUnspecified	Server is using a an isolation level other than what was requested and the specific isolation level cannot be determined.

ilChaos	Changes from more highly isolated transactions cannot be overwritten by the current connection.

ilReadUncommitted	Uncommitted changes in other transactions are visible.

ilBrowse	Uncommitted changes in other transactions are visible.

ilCursorStability	Changes from other transactions only visible after being committed.

ilReadCommitted	Changes from other transactions only visible after being committed.

ilRepeatableRead	Changes made in other transactions not visible, but requerying can retrieve new recordsets.

ilSerializable	Transactions conducted in isolation from other transactions.

ilIsolated	Transactions conducted in isolation from other transactions.

Note:	The constants ilSerializable and ilIsolated have the same effects. These two Delphi constants parallel the ADO constants adXactSerializable and adXactIsolated, which have the same effects.


TObjectStates type
TObjectState, TObjectStates type

See also

TObjectStates values indicate the current state of an ADO object.

Unit

ADOdb

type

  TObjectState = (stClosed, stOpen, stConnecting, stExecuting, stFetching);

  TObjectStates = set of TObjectState;

Description

Use TObjectStates values to determine the current activity status of a connection or recordset.

The constants that make up the TObjectStates type correspond directly to the similarly named constants used for the State property of the ADO Connection, Command, and Recordset objects. For additional information on these ADO constants and their effects, see the Microsoft Data Access SDK help in the topic for the State property.

TObjectStates consists of the five constants summarized in the following table:

Object State	Meaning

stClosed	Connection object is inactive and not connected to a database.

stOpen	Connection object is inactive, but connected to a database.

stConnecting	Connection object is in the process of connecting to a database.

stExecuting	Connection object is currently executing.

stFetching	Connection object is retrieving data from the database.


TParameterAttributes type
TParameterAttribute, TParameterAttributes type

See also

TParameterAttributes values indicate the types of values a parameter can accept.

Unit

ADOdb

type

  TParameterAttribute = (paSigned, paNullable, paLong);

  TParameterAttributes = set of TParameterAttribute;

Description

Use TParameterAttributes values to specify the characteristics of a parameter that control the types of values a parameter can accept.

The constants that make of the TParameterAttributes type correspond to the ADO ParameterAttributesEnum values of similar names. For instance, the TParameterAttributes type constant paSigned corresponds to the ADO constant adParamSigned. For additional information on these ADO constants and their effects, see the Microsoft Data Access SDK help in the topic for the Attributes property of the ADO Parameter object.

TParameterAttributes consists of the three constants summarized in the following table:

Parameter Attribute	Meaning

psSigned	The parameter accepts signed values.

psNullable	The parameter accepts NULL values.

psLong	The parameter accepts long binary data.


TParameterDirection type

See also

TParameterDirection specifies the direction of a parameter.

Unit

ADOdb

type TParameterDirection = (pdUnknown, pdInput, pdOutput, pdInputOutput, pdReturnValue);

Description

Use a TParameterDirection value to specify whether a parameter is an input parameter, an output parameter, both, or conveys a return value.

The constants that make up the TParameterDirection type correspond directly to the ADO ParameterDirectionEnum constants with similar names used for the Direction property of the ADO Parameter object. For instance, the constant pdInput corresponds to the ADO constant adParamInput. For additional information on these ADO constants and their effects, see the Microsoft Data Access SDK help in the topic for the Direction property of the ADO Parameter object.

TParameterDirection consists of the five constants summarized in the following table:

Parameter Direction	Meaning

pdUnknown	Parameter direction is unknown or cannot be determined.

pdInput	Parameter can only be used to convey data to a stored procedure or SQL statement.

pdOutput	Parameter can only be used to convey data from a stored procedure or SQL statement.

pdInputOutput	Parameter can be used to convey data to or from a stored procedure or SQL statement.

pdReturnValue	Parameter is used to convey a return value.


TPersistFormat type

See also

TPersistFormat values indicate the format for a saved recordset.

Unit

ADOdb

type TPersistFormat = (pfADTG, pfXML);

Description

Use TPersistFormat values to specify the format in which recordsets are saved to file. The value pfADTG indicates the file is saved in ADTG (Advanced Data Tablegram) format. The value pfXML saves the recordset in XML format (requires ADO 2.1 and above).

The constants that make up the TPersistFormat type correspond directly to the ADO PersistFormatEnum constants adPersistADTG and adPersistXML. PersistFormatEnum constants are used in the PersistFormat parameter of the Save method of the ADO Recordset object. For additional information on these ADO constants and their effects, see the Microsoft Data Access SDK help in the topic for the Direction property of the ADO Parameter object.


TRecordStatusSet type
TRecordStatus, TRecordStatusSet type

See also

TRecordStatusSet values indicate the status of the current record relative to batch updates or other bulk operations

Unit

ADOdb

type

  TRecordStatus = (rsOK, rsNew, rsModified, rsDeleted, rsUnmodified, rsInvalid, rsMultipleChanges, rsPendingChanges, rsCanceled, rsCantRelease, rsConcurrencyViolation, rsIntegrityViolation, rsMaxChangesExceeded, rsObjectOpen, rsOutOfMemory, rsPermissionDenied, rsSchemaViolation, rsDBDeleted);

  TRecordStatusSet = set of TRecordStatus;

Description

Use TRecordStatusSet values to determine the status of the current row.

The constants that make up the TRecordStatus type correspond directly to the ADO RecordStatusEnum values used for the Status property of the ADO Recordset object. For additional information on these ADO constants and their effects, see the Microsoft Data Access SDK help in the topic for the Status property of the ADO Recordset object.

A TRecordStatusSet value may contain any one or more of the following constants:

Record Status Set Constant	Meaning

rsOK	The row was successfully updated

rsNew	The row is a new insert.

rsModified	The row has been modified.

rsDeleted	The row has been deleted.

rsUnmodified	The row has not been modified since being retrieved.

rsInvalid	The row was not saved due because the bookmark was invalid.

rsMultipleChanges	The row was not saved because it would have affected multiple rows.

rsPendingChanges	The row was not saved because it refers to a pending insert.

rsCanceled	The row was not saved because the operation was canceled.

rsCantRelease	The new row was not saved because of existing row locks.

rsConcurrencyViolation	The row was not saved because optimistic concurrency was in use.

rsIntegrityViolation	The row was not saved because the user violated integrity constraints.

rsMaxChangesExceeded	The row was not saved because there were too many pending changes.

rsObjectOpen	The row was not saved because of a conflict with an open storage object.

rsOutOfMemory	The row was not saved because the computer has run out of memory.

rsPermissionDenied	The row was not saved because the user has insufficient permissions.

rsSchemaViolation	The row was not saved because it violates the structure of the underlying database.

rsDBDeleted	The row has already been deleted from the data source.


TSchemaInfo type

See also

TSchemaInfo values indicate the type of schema information to retrieve.

Unit

ADOdb

type

TSchemaInfo = (siAsserts, siCatalogs, siCharacterSets, siCollations, siColumns, siCheckConstraints, siConstraintColumnUsage, siConstraintTableUsage, siKeyColumnUsage, siReferentialConstraints, siTableConstraints, siColumnsDomainUsage, siIndexes, siColumnPrivileges, siTablePrivileges, siUsagePrivileges, siProcedures, siSchemata, siSQLLanguages, siStatistics, siTables, siTranslations, siProviderTypes, siViews, siViewColumnUsage, siViewTableUsage, siProcedureParameters, siForeignKeys, siPrimaryKeys, siProcedureColumns, siDBInfoKeywords, siDBInfoLiterals, siCubes, siDimensions, siHierarchies, siLevels, siMeasures, siProperties, siMembers, siProviderSpecific);

Description

Use TSchemaInfo values to specify the type of schema information to retrieve from a provider.

The constants that make up the TSchemaInfo type correspond directly to the ADO constants used for the QueryType parameter for the OpenSchema method of the ADO Connection object. For additional information on these ADO constants and their effects, see the Microsoft Data Access SDK help in the topic for the OpenSchema method of the ADO Connection object.

A TSchemaInfo value may be any of the constants below:

Schema Parameter Value	ADO Criteria Values

siProviderSpecific	The provider defines its own nonstandard schema queries outside those listed below.

siAsserts	CONSTRAINT_CATALOG
CONSTRAINT_SCHEMA
CONSTRAINT_NAME

siCatalogs	CATALOG_NAME

siCharacterSets	CHARACTER_SET_CATALOG
CHARACTER_SET_SCHEMA
CHARACTER_SET_NAME

siCollations	COLLATION_CATALOG
COLLATION_SCHEMA
COLLATION_NAME

siColumns	TABLE_CATALOG
TABLE_SCHEMA
TABLE_NAME
COLUMN_NAME

siCheckConstraints	CONSTRAINT_CATALOG
CONSTRAINT_SCHEMA
CONSTRAINT_NAME

siConstraintColumnUsage	TABLE_CATALOG
TABLE_SCHEMA
TABLE_NAME
COLUMN_NAME

siConstraintTableUsage	TABLE_CATALOG
TABLE_SCHEMA
TABLE_NAME

siKeyColumnUsage	CONSTRAINT_CATALOG
CONSTRAINT_SCHEMA
CONSTRAINT_NAME
TABLE_CATALOG
TABLE_SCHEMA
TABLE_NAME
COLUMN_NAME

siReferentialContraints	CONSTRAINT_CATALOG
CONSTRAINT_SCHEMA
CONSTRAINT_NAME

siTableConstraints	CONSTRAINT_CATALOG
CONSTRAINT_SCHEMA
CONSTRAINT_NAME
TABLE_CATALOG
TABLE_SCHEMA
TABLE_NAME
CONSTRAINT_TYPE

siColumnsDomainUsage	DOMAIN_CATALOG
DOMAIN_SCHEMA
DOMAIN_NAME
COLUMN_NAME

siIndexes	TABLE_CATALOG
TABLE_SCHEMA
INDEX_NAME
TYPE
TABLE_NAME

siColumnPrivileges	TABLE_CATALOG
TABLE_SCHEMA
TABLE_NAME
COLUMN_NAME
GRANTOR
GRANTEE

siTablePrivileges	TABLE_CATALOG
TABLE_SCHEMA
TABLE_NAME
GRANTOR
GRANTEE

siUsagePrivileges	OBJECT_CATALOG
OBJECT_SCHEMA
OBJECT_NAME
OBJECT_TYPE
GRANTOR
GRANTEE

siProcedures	PROCEDURE_CATALOG
PROCEDURE_SCHEMA
PROCEDURE_NAME
PARAMTER_TYPE

siSchemata	CATALOG_NAME
SCHEMA_NAME
SCHEMA_OWNER

siSQLLanguages	None.

siStatistics	TABLE_CATALOG
TABLE_SCHEMA
TABLE_NAME

siTables	TABLE_CATALOG
TABLE_SCHEMA
TABLE_NAME
TABLE_TYPE

siTranslations	TRANSLATION_CATALOG
TRANSLATION_SCHEMA
TRANSLATION_NAME

siProviderTypes	DATA_TYPE
BEST_MATCH

siViews	TABLE_CATALOG
TABLE_SCHEMA
TABLE_NAME

siViewColumnUsage	VIEW_CATALOG
VIEW_SCHEMA
VIEW_NAME

siViewTableUsage	VIEW_CATALOG
VIEW_SCHEMA
VIEW_NAME

siProcedureParameters	PROCEDURE_CATALOG
PROCEDURE_SCHEMA
PROCEDURE_NAME
PARAMTER_NAME

siForeignKeys	PK_TABLE_CATALOG
PK_TABLE_SCHEMA
PK_TABLE_NAME
FK_TABLE_CATALOG
FK_TABLE_SCHEMA
FK_TABLE_NAME

siPrimaryKeys	PK_TABLE_CATALOG
PK_TABLE_SCHEMA
PK_TABLE_NAME

siProcedureColumns	PROCEDURE_CATALOG
PROCEDURE_SCHEMA
PROCEDURE_NAME
COLUMN_NAME

siDBInfoKeywords	(Defined in OLE DB, but not supported by ADO.)

siDBInfoLiterals	(Defined in OLE DB, but not supported by ADO.)

siCubes	(Defined in OLE DB, but not supported by ADO.)

siDimensions	(Defined in OLE DB, but not supported by ADO.)

siHierarchies	(Defined in OLE DB, but not supported by ADO.)

siLevels	(Defined in OLE DB, but not supported by ADO.)

siMeasures	(Defined in OLE DB, but not supported by ADO.)

siProperties	(Defined in OLE DB, but not supported by ADO.)

siMembers	(Defined in OLE DB, but not supported by ADO.)


TXactAttribute type
TXactAttribute, TXactAttributes type

See also

TXactAttribute values specify automated transaction behavior.

Unit

ADOdb

type

  TXactAttribute = (xaCommitRetaining, xaAbortRetaining);

  TXactAttributes = set of TXactAttribute;

Description

Use TXactAttribute to specify how the committing and aborting of a connection component’s transactions is handled. A property of type TXactAttribute may contain one TXactAttribute constant, both, or none.

An xaCommitRetaining value specifies that the connection performs retaining commits. Committing a transaction automatically starts a new transaction.

An xaAbortRetaining value specifies that the connection performs retaining aborts. Rolling back a transaction automatically starts a new transaction.

The constants that make up the TXactAttributes type correspond directly to the ADO XactAttributeEnum constants adXactCommitRetaining and adXactAbortRetaining. These ADO constants are in the Attributes property of the ADO Connection object. For additional information on these ADO constants and their effects, see the Microsoft Data Access SDK help in the topic for the Attributes property of the ADO Connection object.


TCustomADODataSet

Hierarchy	Properties	Methods	Events	See also

TCustomADODataSet is the virtualized base class for all ADO dataset components.

Unit

ADOdb

Description

TCustomADODataSet encapsulates a set of properties, events, and methods for working with data accessed through an ADO (ActiveX Data Objects) provider. TCustomADODataSet is the base class from which all ADO dataset components descend. Applications should never instantiate TCustomADODataSet objects. Instead, instantiate an object from one of the descendant classes: TADODataSet, TADOTable, TADOQuery, or TADOStoredProc.

Some of the properties, events, and methods in TCustomADODataSet are abstract. Abstract declarations are declarations without implementations. At the TCustomADODataSet level they cannot be used or accessed. Developers must use or derive descendants of TCustomADODataSet that declare and implement these abstract methods. Many of the other TCustomADODataSet methods are declared and implemented in TCustomADODataSet as virtual methods, but the implementations are merely stubs that are reimplemented in descendants such as TADODataSet, TADOQuery, TADOStoredProc, and TADOTable.


TCustomADODataSet properties

TCustomADODataSet	Alphabetically	Legend

In TCustomADODataSet

BlockReadSize

CacheSize

CanModify

CommandText

CommandTimeout

CommandType

Connection

ConnectionString

CursorLocation

CursorType

DesignerData

EnableBCD

ExecuteOptions

Filter

Filtered

FilterGroup

IndexFieldCount

IndexFields

LockType

LockType

MarshalOptions

MaxRecords

ParamCheck

Parameters

Prepared

Properties

RecNo

RecordCount

RecordSet

RecordSetState

RecordSize

RecordStatus

Sort

Derived from TDataSet

Active

ActiveRecord

AggFields

AutoCalcFields

BlobFieldCount

Bof

Bookmark

BookmarkSize

BufferCount

Buffers

CalcBuffer

CalcFieldsSize

Constraints

CurrentRecord

DataSetField

DataSource

DefaultFields

Designer

Eof

FieldCount

FieldDefList

FieldDefs

FieldList

FieldNoOfs

Fields

FieldValues

FilterOptions

Found

InternalCalcFields

Modified

Name

NestedDataSetClass

NestedDataSets

ObjectView

Reserved

SparseArrays

State

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomADODataSet properties

TCustomADODataSet	By object	Legend

Active

ActiveRecord

AggFields

AutoCalcFields

BlobFieldCount

BlockReadSize

Bof

Bookmark

BookmarkSize

BufferCount

Buffers

CacheSize

CalcBuffer

CalcFieldsSize

CanModify

CommandText

CommandTimeout

CommandType

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Connection

ConnectionString

Constraints

CurrentRecord

CursorLocation

CursorType

DataSetField

DataSource

DefaultFields

Designer

DesignerData

DesignInfo

EnableBCD

Eof

ExecuteOptions

FieldCount

FieldDefList

FieldDefs

FieldList

FieldNoOfs

Fields

FieldValues

Filter

bmc publishd.bmp}	Filtered

FilterGroup

FilterOptions

Found

IndexFieldCount

IndexFields

InternalCalcFields

LockType

Modified

Name

NestedDataSetClass

NestedDataSets

ObjectView

Owner

MarshalOptions

MaxRecords

ParamCheck

Parameters

Prepared

Properties

RecNo

RecordCount

RecordSet

RecordSetState

RecordSize

RecordStatus

Reserved

Sort

SparseArrays

State

Tag

VCLComObject


TCustomADODataSet.BlockReadSize

TCustomADODataSet	See also

Determines how many record buffers are read in each block.

property BlockReadSize: Integer;

Description

Set BlockReadSize when to scan through the entire dataset quickly without updating data-aware controls. When BlockReadSize is greater than zero and Next is called, data-aware controls are not updated and data events are not triggered. Set BlockReadSize to zero to disable block read mode. The dataset State is dsBlockRead when BlockReadSize is greater than zero.


TCustomADODataSet.CacheSize

TCustomADODataSet	See also

Specifies the size of the cache for the dataset.

property CacheSize: Integer;

Description

Set CacheSize to control how many rows the dataset’s recordset keeps in its buffer and how many to retrieve at one time into local memory. For example, if CacheSize is set to 20, when the dataset is first activated the associated provider retrieves the first 20 rows into local memory. As the row pointer is moved through this recordset, the provider retrieves the data from the local memory buffer. If the dataset’s row pointer moves beyond the last of these 20 buffered rows, the provider retrieves the next 20.

CacheSize represents the maximum number of rows to retrieve. So if the number of rows remaining to be retrieved is less than CacheSize, the remaining rows are retrieved and no exception is raised.

The default value of CacheSize is 1.


TCustomADODataSet.CanModify

TCustomADODataSet	See also

Indicates whether the underlying recordset permits write access to data.

property CanModify: Boolean;

Description

Read CanModify to determine whether the underlying recordset is updatable. If CanModify is True, the recordset can be modified. If CanModify is False, the recordset is read-only.

CanModify is set automatically when an ADO dataset is activated. Criteria that determine whether a record set is updatable or read-only are specific to ADO. The Supports method of the ADO recordset object is used to query ADO as to whether the cursor supports the adUpdate parameter for Supports.

if ADOTable1.CanModify then

  ADOTable1.Edit

else

  ShowMessage('Recordset is read-only!');


TCustomADODataSet.CommandText

TCustomADODataSet	See also

Specifies a command to be executed.

property CommandText: WideString;

Description

Use CommandText to specify the command to execute using the ADO command component. CommandText is a textual representation of the command such as an SQL statement, a table name, or the name of a stored procedure to execute. The command specified in CommandText is executed when the dataset’s Open method is called.

If the command includes parameters, as might be the case with an SQL statement or stored procedure, access them through the command component’s Parameters property.

with ADODataSet1 do begin

  CommandType := cmdText;

  CommandText := 'SELECT * FROM CustomerTable';

  Open;

end;

Note:	ADO dataset components are typically used for operating on recordsets, and so the contents of the CommandText property will usually be one that returns a result set. For commands that only perform an action and do not result in the creation of a recordset, use the TADOCommand component.


TCustomADODataSet.CommandTimeout

TCustomADODataSet	See also

Specifies amount of time to attempt execution of a command.

property CommandTimeout: Integer;

Description

Use CommandTimeout to specify the amount of of time that expires before an attempt to execute a command is considered unsuccessful. Measured in seconds, the default value for CommandTimeout is 30.

If a command is successfully executed prior to the expiration of the seconds specified, CommandTimeout has no effect.


TCustomADODataSet.CommandType

TCustomADODataSet	See also

Specifies the type of command to execute.

property CommandType: TCommandType;

Description

Set CommandType to indicate the type of command that is contained in the CommandText property. The value in CommandType should agree with that of CommandText. For instance, if CommandText is the name of a table, CommandType should be cmdTable or cmdTableDirect.

The default value of CommandType is cmdUnknown. While CommandType may be left as cmdUnknown for all commands, better performance will be realized if CommandType is used to explicitly indicate the type of the command. When the type cmdUnknown is used, ADO must evaluate the command to determine its type, which slows the operation.

with ADODataSet1 do begin

  CommandType := cmdText;

  CommandText := 'SELECT * FROM CustomerTable';

  Open;

end;


TCustomADODataSet.Connection

TCustomADODataSet	See also

Specifies the ADO connection component to use.

property Connection: TADOConnection;

Description

Use Connection to specify an ADO connection object to use to connect to an ADO data store.

At design-time, select from the list of available TADOConnection objects (if any have been added to the application) invoked from the Object Inspector.

At runtime, set Connection to reference an existing TADOConnection object.

ADOTable1.Connection := ADOConnection1;

Note:	a connection to an ADO database can be established either using a separate TADOConnection object (configured to connect to the database) or directly with a valid entry in the ConnectionString property.


TCustomADODataSet.ConnectionString

TCustomADODataSet	See also

Specifies the connection information for the data store.

property ConnectionString: WideString;

Description

Set ConnectionString to specify the information needed to connect the ADO dataset component to the data store. The value used for ConnectionString consists of one or more arguments ADO uses to establish the connection. Specify multiple arguments as a list with individual arguments separated by semi-colons.

ADOQuery1.ConnectionString := 'Provider=ProviderRef;Remote Server=ServerRef';

At design-time, select from the list of available ADO database connections invoked from the Object Inspector.

A connection string may be saved to file for later use. Specify only the name of such a file in ConnectionString to reuse a saved connection string.

The connection string may also contain login information such as user ID and password, for automated logins.

ADO supports the following four arguments for connection strings. Any other arguments (such as a user ID and password) are not processed by ADO and simply passed on to the provider.

Argument	Meaning

Provider	The name of the provider to use for the connection.

File name	The name of a file containing connection information.

Remote Provider	The name of the provider to use for a client-side connection.

Remote Server	The path name of the server to use for a client-side connection.

Note:	After opening a connection, the contents of ConnectionString may be changed by ADO. One example of this behavior is when ADO-defined arguments are mapped to their provider equivalents.


TCustomADODataSet.CursorLocation

TCustomADODataSet	See also

Specifies whether the cursor for the connection is client-side or server-side.

property CursorLocation: TCursorLocation;

Description

Use CursorLocation to indicate whether the cursors that use the connection object to connect to the ADO datastore use a client-side or server-side cursor library. CursorLocation only affects connections opened after the property is set. The default value for CursorLocation is clUserClient.

A client-side cursor offers more flexibility. All data is retrieved to the local machine and then operated on there, allowing operations not normally supported by servers like sorting and resorting the data and additional filtering. SQL statements are executed at the server, so for statements that restrict the result set with a WHERE clause, only the reduced result set is retrieved to a local cursor.

A server-side cursor offers less flexibility, but may be more advantageous (or necessary) for large result sets. Using a server-side cursor becomes necessary when the sheer size of a result set exceeds the available disk space that would be needed to create the client-side cursor. Also, many servers only support unidirectional cursors. This would preclude moving the record pointer in the dataset backward (even one record) through the result set.


TCustomADODataSet.CursorType

TCustomADODataSet	See also

Specifies type of cursor an ADO dataset uses.

property CursorType: TCursorType;

Description

Set CursorType to indicate the type of cursor the ADO dataset uses for the recordset when it is opened. CursorType must be set prior to activating the dataset component. Among other cursor aspects, CursorType affects directional scrolling through a recordset and the visibility of changes made by other users.

The default value of CursorType is ctKeyset.


TCustomADODataSet.DesignerData

TCustomADODataSet	See also

Points to the binary data stream that represents an SQL query statement or result set.

property DesignerData: String

Description

Do not access SQLBinary in an application. It is an internal binary data stream used by the query component to communicate directly with ADO. To access or set the SQL statement that this query component executes, use the SQL property (for TADOQuery) or CommandText (for other SQL-using components).


TCustomADODataSet.EnableBCD

TCustomADODataSet	See also

Specifies whether to treat numeric fields as floating-point or BCD.

property EnableBCD: Boolean;

Description

Use the EnableBCD property to specify how fields are mapped to field classes. If EnableBCD is True, (the default value) adDecimal and adNumeric fields are mapped to the TBCDField class when field objects are created. If EnableBCD is False, the fields are mapped to the TFloatField class.

EnableBCD determines whether numeric and decimal fields are translated as floating-point values or binary coded decimal (BCD) values. BCD values eliminate the rounding errors associated with floating point math (such as a 3 * (2/3) resulting in 2.00000000001).

If persistent field objects are used (such as those created using the Fields Editor), the field class associated with a given field can contradict the setting of EnableBCD. Three numeric fields in the same table could, for instance, each be represented by a TFloatField, a TBCDField, and a TVariantField – regardless of the value in EnableBCD. Select field classes on a field-by-field basis for greater flexibility.

Note:	For numeric values with more than 4 digits to the right of the decimal place, use of TFloatField is generally better. This is because TBCDField uses the currency data type that has a fixed scale of 4 decimal places.

Note:	For fields with very large numbers of more than 19 significant digits, you can use TVariantField type persistent field objects. The TFloatField and TBCDField classes lack sufficient capacity for fields of this size. TVariantField allows the getting and setting of the field data as strings, preventing without loss of data due to insufficient capacity. However, arithmetic operations cannot be performed on numbers accessed through a TVariantField object.


TCustomADODataSet.ExecuteOptions

TCustomADODataSet	See also

Specifies the characteristics of a command execution.

property ExecuteOptions: TExecuteOptions;

Description

Set ExecuteOptions to control the characteristics of a command (a data retrieval operation) executed from the ADO dataset component.


TCustomADODataSet.Filter

TCustomADODataSet	See also

Specifies the text of the current filter for a dataset.

property Filter: String;

Description

Use Filter to specify a dataset filter. When filtering is applied to a dataset, only those records that meet a filter’s conditions are available to an application. Filter contains the string that describes the filter condition. For example, the following filter condition displays only those records where the State field is 'CA' or 'MA':

State = 'CA' or State = 'MA'

When a filter is set, Blank records do not appear unless explicitly included in the filter.  For example:

State <> 'CA' or State = NULL

When a field name contains spaces, you must enclose the field name in brackets. For example:

[Home State] = 'CA' or [Home State] = 'MA'

Filter expressions on remote SQL tables and on client datasets support field comparisons. For example:

Field1 > Field2

The FilterOptions property controls case sensitivity and filtering on partial comparisons.

Tip:	Applications can set Filter at runtime to change the filtering condition for a dataset at (for example, in response to user input).

Note: include a space between comparison values and comparison operators in filter expressions. For instance, ensure that there is a space after the field name and before the operator.


TCustomADODataSet.Filtered

TCustomADODataSet	See also

Specifies whether or not filtering is active for a dataset.

property Filtered: Boolean;

Description

Check Filtered to determine whether or not dataset filtering is in effect. If Filtered is True, then filtering is active.

To apply filter conditions specified in the Filter property or the OnFilterRecord event handler, set Filtered to True.

Note:	When filtering is enabled, user edits to a record may mean that the record no longer meets a filter’s test condition. The next time an attempt is made to the read the record from the dataset while the filter is in effect, the record is not visible. If that happens, the next record that passes the filter condition becomes the active record.


TCustomADODataSet.FilterGroup

TCustomADODataSet	See also

Filters a recordset based on row update status.

TFilterGroup = (fgUnassigned, fgNone, fgPendingRecords, fgAffectedRecords, fgFetchedRecords, fgPredicate, fgConflictingRecords);

property FilterGroup: TFilterGroup

Description

Use FilterGroup to filter the recordset displayed with an ADO dataset component. The filter requires the dataset be in update batch mode and the rows are filtered based on the update status of individual rows. Set FilterGroup to a TFilterGroup constant to filter the dataset to show just the rows that match that batch update status. For instance, set FilterGroup to fgPendingRecords to show just the rows that have been modified since the last update application.

if (ADODataSet1.LockType = ltBatchOptimistic) then begin

  ADODataSet1.Filtered := True;

  ADODataSet1.FilterGroup := fgPendingRecords;

end;

To use FilterGroup to filter based on the update status of rows, ensure that the LockType property is set to ltBatchOptimistic (a prerequisite for batch updating) and the Filtered property is set to True. In a filtered dataset, check the update status of individual rows using the RecordStatus property.

The TFilterGroup type consists of the following constants:

Filter group type	Meaning

fgUnassigned	Specifies that no filtering is in effect. This constant is used internally by the ADO dataset component.

fgNone	Removes any current filtering and all rows are visible. Can also be done by setting the Filtered property to False.

fgPendingRecords	Filters to show just the rows that have been changed and the changes have not been applied (UpdateBatch method) or canceled (CancelBatch).

fgAffectedRecords	Filters to show just the rows affected by the last update.

fgFetchedRecords	Filters to show just the rows in the current update cache. This is the results of the last call to retrieve rows from the database.

fgPredicate	Filters to show just deleted rows.

fgConflictingRecords	Filters to show just the rows that had changes made to them, but could not be applied due to errors on the apply attempt.


TCustomADODataSet.IndexFieldCount

TCustomADODataSet	See also

Indicates the number of fields that comprise the current key.

property IndexFieldCount: Integer;

Description

Examine IndexFieldCount to determine the number of fields that comprise the current key. For indexes based on a single column, IndexFieldCount returns 1. For multi-column indexes, IndexFieldCount indicates the number of fields upon which the index is based.


TCustomADODataSet.IndexFields

TCustomADODataSet	See also

Retrieves or sets a field for an index.

property IndexFields[Index: Integer]: TField;

Description

IndexFields provides a zero-based array of field objects, each of which corresponds to a field in the current index. Index is an ordinal value indicating the position of a field in the index. The first field in the index is IndexFields[0], the second is IndexFields[1], and so on.


TCustomADODataSet.LockType

TCustomADODataSetSee also

Specifies the lock type to use when opening a dataset.

property LockType: TADOLockType;

Description

Use LockType to specify the lock type to use when opening a dataset. LockType determines whether the row locking scheme for a recordset will be pessimistic, optimistic, or read-only. To be effective, LockType must be set prior to activating the ADO dataset component.

The default value of LockType is ltOptimistic.

Use the LockType ltBatchOptimistic to open a dataset in batch update mode.


TCustomADODataSet.MarshalOptions

TCustomADODataSet

Specifies which records are marshaled back to the server.

TMarshalOption = (moMarshalAll, moMarshalModifiedOnly);

property MarshalOptions: TMarshalOption

Description

Use MarshalOptions when the dataset component uses a client-side cursor and data changes are to be sent back to the server. MarshalOptions specifies which records in the local recordset are sent to the middle tier or server. A value of moMarshalAll results in all records in the local recordset being packaged and sent back. A value of moMarshalModifiedOnly sends back only those records that have actually been changed in the local recordset The default value for MarshalOptions is moMarshalAll.


TCustomADODataSet.MaxRecords

TCustomADODataSet

Specifies how many rows to return in a result set.

property MaxRecords: Integer

Description

Use MaxRecords to limit the number of rows returned by the ADO dataset component. Set MaxRecords to indicate the maximum number. The default value for MaxRecords is 0 (zero), which places no limits on the result set.


TCustomADODataSet.ParamCheck

TCustomADODataSet	See also

Specifies whether the parameter list for an ADO dataset component is regenerated if the SQL changes at runtime.

property ParamCheck: Boolean;

Description

Set ParamCheck to specify whether or not the Parameters property is initialized using ":Param" style parameters in an SQL statement specified in the CommandText property. If the SQL statement in CommandText only contains "?" style parameters, the Parameters property will only be initialized if the OLE DB provider returns parameter information for an SQL command. Otherwise, the parameters must be explicitly created using the TParameters.CreateParameter method.

When ParamCheck is True, a parameter is generated for each ":Param" style parameter in the SQL statement.

The default value of ParamCheck is True.

This property is useful for data definition language (DDL) statements that contain parameters as part of the DDL statement and that are not parameters for the ADO dataset component. For example, the DDL statement to create a stored procedure may contain parameter statements that are part of the stored procedure. Set ParamCheck to False to prevent these parameters from being mistaken for parameters of the ADO dataset component executing the DDL statement.


TCustomADODataSet.Parameters

TCustomADODataSet	See also

Contains the collection of parameters for an SQL statement.

property Parameters: TParameters;

Description

At design-time, use Parameters to access the parameters for the SQL statement used by the ADO component. Use the properties and methods of Parameters to set and get individual parameter values or to set or inspect parameter attributes.

At runtime, use the Parameters property editor to access the collection of parameters.


TCustomADODataSet.Prepared

TCustomADODataSet	See also

Specifies whether the command is prepared before execution.

property Prepared: Boolean;

Description

Set Prepared before calling the Open method to specify whether ADO prepares the command used to create the dataset’s recordset. If Prepared is set to True and the dataset component is connected to a data store, ADO prepares the command before executing it. If Prepared is set to False, ADO does not prepare the command.

The default value of Prepared is False.


TCustomADODataSet.Properties

TCustomADODataSet

Properties is the implementation of the Properties Collection object.

property Properties: Properties

Description

Use Properties to get direct access to the ADO Properties Collection for the ADO Recordset object the ADO dataset component represents. A Properties Collection object is a container for one or more Property objects. Each Property object corresponds to a characteristic of an ADO object, here an ADO Recordset object.

Note:	Use of Properties to directly access the underlying ADO Properties Collection object requires a good working knowledge of ADO objects in general and ADO Properties Collection objects in specific. Consult the Microsoft Data Store SDK help for specific information on using ADO Properties Collection objects.


TCustomADODataSet.RecNo

TCustomADODataSet	See also

Indicates ordinal position of the active record in the recordset.

property RecNo: Integer;

Description

Read RecNo at runtime to determine the ordinal position of the active record within the dataset’s recordset. The dataset must be active for RecNo to have a valid value. When a dataset component is active, RecNo will be a number between one and the total number of rows in the recordset (reflected in the RecordCount property).

The value of Recno for a given row in a recordset is relative to the rows that precede the current row. Thus, if a check of RecNo for a row indicates 10 and then a preceding row is deleted, a subsequent inspection of RecNo will show a new position of 9.

In the example below, the RecNo and RecordCount properties of a TCustomDataSet descendant are used to display the current record's number and the total number of records in a TStatusBar component. This would be done in a handler for the AfterScroll event of the ADO dataset component so that it is updated after each row pointer movement.

StatusBar1.Panels[0].Text := 'Record ' + IntToStr(TCustomADODataSet(DataSet).RecNo) + ' of ' + IntToStr(TCustomADODataSet(DataSet).RecordCount);

Set RecNo at runtime to move the record pointer to the record at the specified absolute position within the recordset. Use the value of the RecordCount property to determine the maximum number to which RecNo can be set. For example, going to the last row using RecNo:

ADOTable1.RecNo := ADOTable1.RecordCount;

Note:	The number of rows indicated might be less than the total number of rows in a table. This can happen when the rows retrieved as a recordset for a dataset component are a conditional subset of the table.


TCustomADODataSet.RecordCount

TCustomADODataSet	See also

Indicates the total number of records in the recordset.

property RecordCount: Integer;

Description

Examine RecordCount to determine the total number of records in the recordset of the dataset component. Applications might use this property with RecNo to iterate through all the records in a dataset, though typically record iteration is handled with calls to First, Last, MoveBy, and Prior using Eof and Bof to set the limits of row traversing.

The dataset component must be active for RecordCount to provide a valid number. Should ADO not be able to determine that actual number of rows, RecordCount will return a value of negative one (-1).

In the example below, the RecNo and RecordCount properties of a TCustomDataSet descendant are used to display the current record's number and the total number of records in a TStatusBar component. This would be done in a handler for the AfterScroll event of the ADO dataset component so that it is updated after each row pointer movement.

StatusBar1.Panels[0].Text := 'Record ' + IntToStr(TCustomADODataSet(DataSet).RecNo) + ' of ' + IntToStr(TCustomADODataSet(DataSet).RecordCount);

Note:	The number of rows indicated might be less than the total number of rows in a table. This can happen when the rows retrieved as a recordset for a dataset component are a conditional subset of the table.


TCustomADODataSet.RecordSet

TCustomADODataSet	See also

Provides direct access to the ADO recordset object.

property RecordSet: _RecordSet;

Description

RecordSet is the interface through which the records of an ADO dataset are accessed.

Use RecordSet to get direct access to the ADO recordset object the dataset component represents. This direct access reference allows an application to use properties and methods of the underlying recordset object. Accessing the underlying recordset object is especially useful for utilizing properties and methods of the recordset object not surfaced in ADO dataset components.

Ordinarily, an application would seldom need to access the underlying recordset object directly. One situation that would use such access is directing the recordset produced by the execution of a TADOCommand component. In these situations, assign the recordset returned by the TADOCommand.Execute method directly to the RecordSet property.

ADODataSet1.RecordSet := ADOCommand1.Execute;

Note:	Use of CommandObject to directly access the underlying ADO command object requires a good working knowledge of ADO objects in general and the ADO command object in specific. It is not recommended that you use the command object directly unless familiar with command object operations. Consult the Microsoft Data Store SDK help for specific information on using ADO command objects.


TCustomADODataSet.RecordSetState

TCustomADODataSet	See also

Indicates the current state of the ADO dataset component.

property RecordSetState: TObjectStates;

Description

Read States at runtime to determine the activity being performed, if any, by the dataset component at a specific point in time. Activity status includes the dataset component connecting to a data store, executing a command, fetching rows for a recordset, sitting idle but open, and sitting idle and closed.


TCustomADODataSet.RecordSize

TCustomADODataSet	See also

Indicates the size of a record in the dataset.

property RecordSize: Word;

Description

RecordSize is an abstract property that is redeclared and implemented in descendant objects derived from TCustomADODataSet. For TCustomADODataSet, RecordSize is meaningless and always returns a value of 0 (zero).


TCustomADODataSet.RecordStatus

TCustomADODataSet	See also

Indicates the status of the current row.

property RecordStatus: TRecordStatusSet

Description

Read RecordStatus to determine the status of the current row relative to batch updates or other bulk operations. Among other record state aspects, RecordStatus indicates whether the current record is new, modified, deleted, or unmodified. RecordStatus will also give an indication why a row is not saved when modifying, adding, or deleting data.

Note:	RecordStatus only provides meaningful information if the dataset is opened in batch update mode.


TCustomADODataSet.Sort

TCustomADODataSet	See also

Specifies the sort order of the recordset.

property Sort: WideString;

Description

Set Sort to establish or change the list of fields on which the recordset is sorted. Set sort to the name of a single field or to a comma-separated list of fields. Each field may optionally be followed by the keyword ASCENDING or DESCENDING to specify a sort direction for the field. If one of these keywords is not used, the default sort direction for the field is ascending. Set Sort to an empty string to reset the recordset to the sort order originally used when the recordset’s data was first retrieved.

ADOQuery1.Sort := 'LastName ASC, DateDue DESC'

Read Sort to determine the field (or fields) on which the recordset is sorted.

Note:	If the cursor is client-side (the dataset component’s CursorLocation property or that of an associated TADOConnection component is clUseClient) and no index already exists matching the requested field sort order, a temporary index is created. Resetting the sort order by setting Sort to an empty string automatically deletes the temporary index.


TCustomADODataSet events

TCustomADODataSet	Alphabetically

In TCustomADODataSet

OnEndOfRecordset

OnFetchComplete

OnFetchProgress

OnFieldChangeComplete

OnMoveComplete

OnRecordChangeComplete

OnRecordsetChangeComplete

OnWillChangeField

OnWillChangeRecord

OnWillChangeRecordset

OnWillMove

Derived from TDataSet

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TCustomADODataSet events

TCustomADODataSet	By object

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnEndOfRecordset

OnFetchComplete

OnFetchProgress

OnFieldChangeComplete

OnFilterRecord

OnMoveComplete

OnNewRecord

OnPostError

OnRecordChangeComplete

OnRecordsetChangeComplete

OnWillChangeField

OnWillChangeRecord

OnWillChangeRecordset

OnWillMove


TCustomADODataSet.OnEndOfRecordset

TCustomADODataSet

Occurs when moving a recordset's row pointer past the last row.

TEndOfRecordsetEvent = procedure (DataSet: TCustomADODataSet; var MoreData: WordBool; var EventStatus: TEventStatus) of object;

property OnEndOfRecordset: TEndOfRecordsetEvent;

Description

Write an OnEndOfRecordset event handler to take specific action after an attempt to move to a row past the end of the recordset. No Delphi row navigation methods should trigger this event due to the effects of the Eof property. This event should only be triggered by internal recordset navigation operations or by direct access to the Recordset object (through the dataset component's Recordset property).

DataSet is the ADO dataset component that triggered the OnEndOfRecordset event. This dataset component also contains the recordset in question.

MoreData is a Boolean value indicating more unfetched rows beyond the last row fetched prior to the OnEndOfRecordset event.

The EventStatus value (ADO EventStatusEnum) indicates the success or failure of the execution of the operation that triggered the event.

Note: A Recordset object's row pointer is distinct from the record pointer of its ADO dataset component. It is possible that the ADO Recordset object will generate row movement events without the ADO dataset component generating a BeforeScroll or AfterScroll event. A couple reasons for this are background updating and resynchronizing of the records as data is changed. The OnEndOfRecordset event is purely a Recordset object event and independent of any dataset component record navigation events.


TCustomADODataSet.OnFetchComplete

TCustomADODataSet	See also

Occurs after records have been retrieved into the recordset.

TRecordsetEvent = procedure(DataSet: TCustomADODataSet; const Error: Error; var EventStatus: TEventStatus) of object;

property OnFetchComplete: TRecordsetEvent;

Description

Write an OnFetchComplete event handler to take specific action after all of the rows from an asynchronous data retrieval operation have been returned to the recordset. Calling the dataset component's Open method or setting its Active property to True will lead to this event occurring.

DataSet is the ADO dataset component that triggered the OnFetchComplete event. This dataset component also contains the recordset in question.

Error is an ADO Error object. See the Microsoft Data Access SDK for more information on using ADO Error objects. The Error parameter is only set if an error occurred during execution of the operation that triggered the event. In this case, the EventStatus parameter will contain the value esErrorsOccured.

The EventStatus value (ADO EventStatusEnum) indicates the success or failure of the execution of the operation that triggered the event.


TCustomADODataSet.OnFetchProgress

TCustomADODataSet	See also

Occurs ...

TFetchProgressEvent = procedure(DataSet: TCustomADODataSet; Progress, MaxProgress: Integer; var EventStatus: TEventStatus) of object;

property OnFetchProgress: TFetchProgressEvent

Description

Write an OnFetchProgress event handler to take specific action during an asynchronous data retrieval operation. The OnFetchProgess event fires periodically during the data retrieval to provide indications of its progress. Create a handler for this event to react to this periodic notification, such as providing the user with a visual indication of the progress of the data retrieval.

DataSet is the ADO dataset component that triggered the OnFetchProgess event. This dataset component also contains the recordset in question.

Progress is the number of records that have been received since the data fetching operation began.

MaxProgress is the total number of records to be retrieved by the operation.

Progress and MaxProgress used together to get percent complete. For example, Progress divided by MaxProgress and multiplied by 100 yields the percent completion of the data fetching.

procedure TForm1.ADODataSet1FetchProgress(DataSet: TCustomADODataSet; Progress, MaxProgress: Integer; var EventStatus: TEventStatus);

begin

  Caption := 'Percent complete: ' +

    IntToStr(Trunc(Progress / MaxProgress * 100)) + '%';

  Application.ProcessMessages;

end;


TCustomADODataSet.OnFieldChangeComplete

TCustomADODataSet	See also

Occurs after a field has changed.

TFieldChangeCompleteEvent = procedure(DataSet: TCustomADODataSet; const FieldCount: Integer; const Fields: OleVariant; const Error: Error; var EventStatus: TEventStatus) of object;

property OnFieldChangeComplete: TFieldChangeCompleteEvent

Description

Write an OnFieldChangeComplete event handler to take specific action before a pending operation changes the value of one or more ADO Field objects in the Recordset object. (The term "Field object" as used here refers to the ADO Field object, not VCL persistent field objects that descend from TField.)

DataSet is the ADO dataset component that triggered the OnFieldChangeComplete event. This dataset component also contains the recordset in question.

FieldCount is the number of ADO Field objects in the Fields parameter.

Fields is an array of Variants representing the ADO Field objects about to be changed by the operation. See the Microsoft Data Access SDK for more information on using ADO Field objects.

Error is an ADO Error object. See the Microsoft Data Access SDK for more information on using ADO Error objects. The Error parameter is only set if an error occurred during execution of the operation that triggered the event. In this case, the EventStatus parameter will contain the value esErrorsOccured.

The EventStatus value (ADO EventStatusEnum) indicates the success or failure of the execution of the operation that triggered the event.

Note: A Recordset object's Field objects are distinct from the VCL field objects of its ADO dataset component. The OnFieldChangeComplete event is purely a Recordset object event and independent of any VCL field change events.


TCustomADODataSet.OnMoveComplete

TCustomADODataSet	See also

Occurs after the row pointer in a recordset has moved.

TRecordsetErrorEvent = procedure(DataSet: TCustomADODataSet; const Reason: TEventReason; const Error: Error; var EventStatus: TEventStatus) of object;

property OnMoveComplete: TRecordsetErrorEvent

Description

Write an OnMoveComplete event handler to take specific action after the row pointer has moved in the dataset component's Recordset object. Calls to the First, Last, Next, Prior, MoveBy, Insert, Delete, Post, Requery, and Resynch methods can lead to the firing of this event. Setting or getting a bookmark can also trigger the event.

DataSet is the ADO dataset component that triggered the OnMoveComplete event. This dataset component also contains the recordset in question.

Reason indicates the type of move that triggered the event. While the TEventReason type contains more constants, the value of Reason for an OnMoveComplete event is limited to: erRequery, erMove, erMoveFirst, erMoveNext, erMovePrevious, and erMoveLast.

Error is an ADO Error object. See the Microsoft Data Access SDK for more information on using ADO Error objects. The Error parameter is only set if an error occurred during execution of the operation that triggered the event. In this case, the EventStatus parameter will contain the value esErrorsOccured.

The EventStatus value (ADO EventStatusEnum) indicates the success or failure of the execution of the operation that triggered the event.

Note: A Recordset object's row pointer is distinct from the record pointer of its ADO dataset component. It is possible that the ADO Recordset object will generate row movement events without the ADO dataset component generating a BeforeScroll or AfterScroll event. A couple reasons for this are background updating and resynchronizing of the records as data is changed. The OnMoveComplete event is purely a Recordset object event and independent of any dataset component record navigation events.


TCustomADODataSet.OnRecordChangeComplete

TCustomADODataSet	See also

Occurs after one or more records in the recordset change.

TRecordChangeCompleteEvent = procedure(DataSet: TCustomADODataSet; const Reason: TEventReason; const RecordCount: Integer; const Error: Error; var EventStatus: TEventStatus) of object;

property OnRecordChangeComplete: TRecordChangeCompleteEvent

Description

Write an OnRecordChangeComplete event handler to take specific action after one or more rows in the dataset component's Recordset object have changed.

DataSet is the ADO dataset component that triggered the OnRecordChangeComplete event. This dataset component also contains the recordset in question.

Reason indicates the type of change that triggered the event. While the TEventReason type contains more constants, the value of Reason for an OnRecordChangeComplete event is limited to: erAddNew, erDelete, erUpdate, erUndoUpdate, erUndoAddNew, erUndoDelete, and erFirstChange.

RecordCount is the number of records that were changed.

Error is an ADO Error object. See the Microsoft Data Access SDK for more information on using ADO Error objects. The Error parameter is only set if an error occurred during execution of the operation that triggered the event. In this case, the EventStatus parameter will contain the value esErrorsOccured.

The EventStatus value (ADO EventStatusEnum) indicates the success or failure of the execution of the operation that triggered the event.

Note: The OnRecordChangeComplete event is purely a Recordset object event and independent of any VCL data change events.


TCustomADODataSet.OnRecordsetChangeComplete

TCustomADODataSet	See also

Occurs after the recordset has changed.

TRecordsetErrorEvent = procedure(DataSet: TCustomADODataSet; const Reason: TEventReason; const Error: Error; var EventStatus: TEventStatus) of object;

property OnRecordsetChangeComplete: TRecordsetErrorEvent

Description

Write an OnRecordsetChangeComplete event handler to take specific action after the dataset component's Recordset object has changed.

DataSet is the ADO dataset component that triggered the OnRecordsetChangeComplete event. This dataset component also contains the recordset in question.

Reason indicates the type of change that triggered the event. While the TEventReason type contains more constants, the value of Reason for an OnRecordsetChangeComplete event is limited to: erAddNew, erDelete, erUpdate, erUndoUpdate, erUndoAddNew, erUndoDelete, and erFirstChange.

Error is an ADO Error object. See the Microsoft Data Access SDK for more information on using ADO Error objects. The Error parameter is only set if an error occurred during execution of the operation that triggered the event. In this case, the EventStatus parameter will contain the value esErrorsOccured.

The EventStatus value (ADO EventStatusEnum) indicates the success or failure of the execution of the operation that triggered the event. EventStatus will be esOK if the operation that triggered the event executed without error, esErrorsOccured if error occurred during execution of that operation, or esCancel if the operation was canceled.

Note: The OnRecordsetChangeComplete event is purely a Recordset object event and independent of any VCL data change events.


TCustomADODataSet.OnWillChangeField

TCustomADODataSet	See also

Occurs before a field is changed.

TWillChangeFieldEvent = procedure(DataSet: TCustomADODataSet; const FieldCount: Integer; const Fields: OleVariant; var EventStatus: TEventStatus) of object;

property OnWillChangeField: TWillChangeFieldEvent

Description

Write an OnWillChangeField event handler to take specific action before a pending operation changes the value of one or more ADO Field objects in the Recordset object. (The term "Field object" as used here refers to the ADO Field object, not VCL persistent field objects that descend from TField.)

DataSet is the ADO dataset component that triggered the OnWillChangeField event. This dataset component also contains the recordset in question.

FieldCount is the number of ADO Field objects in the Fields parameter.

Fields is an array of Variants representing the ADO Field objects about to be changed by the operation. See the Microsoft Data Access SDK for more information on using ADO Field objects.

The EventStatus value (ADO EventStatusEnum) indicates the success or failure of the execution of the operation that triggered the event.

Note: A Recordset object's Field objects are distinct from the VCL field objects of its ADO dataset component. The OnWillChangeField event is purely a Recordset object event and independent of any VCL field change events.


TCustomADODataSet.OnWillChangeRecord

TCustomADODataSet	See also

Occurs before a record in the recordset is changed.

TWillChangeRecordEvent = procedure(DataSet: TCustomADODataSet; const Reason: TEventReason; const RecordCount: Integer; var EventStatus: TEventStatus) of object;

property OnWillChangeRecord: TWillChangeRecordEvent

Description

Write an OnWillChangeRecord event handler to take specific action just before a pending operation changes a row in the dataset component's recordset object.

DataSet is the ADO dataset component that triggered the OnWillChangeRecord event. This dataset component also contains the recordset in question.

Reason indicates the type of change that triggered the event. While the TEventReason type contains more constants, the value of Reason for an OnWillChangeRecord event is limited to: erAddNew, erDelete, erUpdate, erUndoUpdate, erUndoAddNew, erUndoDelete, and erFirstChange.

RecordCount is the number of records that were changed.

The EventStatus value (ADO EventStatusEnum) indicates the success or failure of the execution of the operation that triggered the event.

Note: The OnWillChangeRecord event is purely a Recordset object event and independent of any VCL data change events.


TCustomADODataSet.OnWillChangeRecordset

TCustomADODataSet	See also

Occurs before the recordset has changed.

TRecordsetReasonEvent = procedure(DataSet: TCustomADODataSet; const Reason: TEventReason; var EventStatus: TEventStatus) of object;

property OnWillChangeRecordset: TRecordsetReasonEvent

Description

Write an OnWillChangeRecordset event handler to take specific action before the dataset component's Recordset object is changed.

DataSet is the ADO dataset component that triggered the OnWillChangeRecordset event. This dataset component also contains the recordset in question.

Reason indicates the type of change that triggered the event. While the TEventReason type contains more constants, the value of Reason for an OnWillChangeRecordset event is limited to: erAddNew, erDelete, erUpdate, erUndoUpdate, erUndoAddNew, erUndoDelete, and erFirstChange.

The EventStatus value (ADO EventStatusEnum) indicates the success or failure of the execution of the operation that triggered the event. EventStatus will be esOK if the operation that triggered the event executed without error, esErrorsOccured if error occurred during execution of that operation, or esCancel if the operation was canceled.

Note: The OnWillChangeRecordset event is purely a Recordset object event and independent of any VCL data change events.


TCustomADODataSet.OnWillMove

TCustomADODataSet	See also

Occurs before the row pointer in a recordset is moved.

TRecordsetReasonEvent = procedure(DataSet: TCustomADODataSet; const Reason: TEventReason; var EventStatus: TEventStatus) of object;

property OnWillMove: TRecordsetReasonEvent

Description

Write an OnWillMove event handler to take specific action before an attempt to move the row pointer in the dataset component's Recordset object. Calls to the First, Last, Next, Prior, MoveBy, Insert, Delete, Post, Requery, and Resynch methods can lead to the firing of this event. Setting or getting a bookmark can also trigger the event.

DataSet is the ADO dataset component that triggered the OnWillMove event. This dataset component also contains the recordset in question.

Reason indicates the type of move that triggered the event. While the TEventReason type contains more constants, the value of Reason for an OnWillMove event is limited to: erRequery, erMove, erMoveFirst, erMoveNext, erMovePrevious, and erMoveLast.

The EventStatus value (ADO EventStatusEnum) indicates the success or failure of the execution of the operation that triggered the event.

Note: A Recordset object's row pointer is distinct from the record pointer of its ADO dataset component. It is possible that the ADO Recordset object will generate row movement events without the ADO dataset component generating a BeforeScroll or AfterScroll event. A couple reasons for this are background updating and resynchronizing of the records as data is changed. The OnWillMove event is purely a Recordset object event, and independent of any dataset component record navigation events.


TCustomADODataSet methods

TCustomADODataSet	Alphabetically

In TCustomADODataSet

BookmarkValid

CancelBatch

CancelUpdates

Clone

CompareBookmarks

Create

CreateBlobStream

DeleteRecords

Destroy

FilterOnBookmarks

GetBlobFieldData

GetFieldData

IsSequenced

LoadFromFile

Locate

Lookup

NextRecordset

Requery

SaveToFile

Seek

Supports

UpdateBatch

UpdateStatus

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

Cancel

CheckBrowseMode

ClearFields

Close

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetCurrentRecord

GetDetailDataSets

GetDetailLinkFields

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsEmpty

IsLinkedTo

IsSequenced

Last

MoveBy

Next

Open

Post

Prior

Refresh

Resync

SetFields

Translate

UpdateCursorPos

UpdateRecord

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomADODataSet methods

TCustomADODataSet	By object

ActiveBuffer

AfterConstruction

Append

AppendRecord

Assign

BeforeDestruction

BookmarkValid

Cancel

CancelBatch

CancelUpdates

CheckBrowseMode

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClearFields

Clone

Close

CompareBookmarks

ControlsDisabled

Create

CreateBlobStream

CursorPosChanged

DefaultHandler

Delete

DeleteRecords

Destroy

DestroyComponents

Destroying

DisableControls

Dispatch

Edit

EnableControls

ExecuteAction

FieldAddress

FieldByName

FilterOnBookmarks

FindComponent

FindField

FindFirst

FindLast

FindNext

FindPrior

First

Free

FreeBookmark

FreeInstance

FreeNotification

FreeOnRelease

GetBlobFieldData

GetBookmark

GetCurrentRecord

GetDetailDataSets

GetDetailLinkFields

GetFieldData

GetFieldList

GetFieldNames

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GotoBookmark

HasParent

InheritsFrom

InitInstance

Insert

InsertComponent

InsertRecord

InstanceSize

IsEmpty

IsLinkedTo

IsSequenced

Last

LoadFromFile

Locate

Lookup

MethodAddress

MethodName

MoveBy

NewInstance

Next

NextRecordset

Open

Post

Prior

Refresh

RemoveComponent

Requery

Resync

SafeCallException

SaveToFile

Seek

SetFields

Supports

Translate

UpdateAction

UpdateBatch

UpdateCursorPos

UpdateRecord

UpdateStatus


TCustomADODataSet.BookmarkValid

TCustomADODataSet	See also

Tests the validity of a specified bookmark.

function BookmarkValid(Bookmark: TBookmark): Boolean; override;

Description

Call BookmarkValid to determine if a specified bookmark is currently assigned a value. BookmarkValid returns True if a bookmark is valid. Otherwise, it returns False.

Bookmark specifies the bookmark to test.


TCustomADODataSet.CancelBatch

TCustomADODataSet	See also

Cancels a pending batch update.

TAffectRecords = (arCurrent, arFiltered, arAll, arAllChapters);

procedure CancelBatch(AffectRecords: TAffectRecords = arAll);

Description

Call CancelBatch to cancel any pending updates in a recordset that has been opened in batch update mode. CancelBatch may be called without error when there are no pending updates, but this has no effect.

CancelBatch is not applicable to recordsets in immediate update mode. Calling CancelBatch for such recordsets without the arCurrent constant will raise an exception.

The default AffectsRecords parameter value is arAll.

The AffectRecords parameter may be any one of the following TAffectRecords values:

Option	Meaning

arCurrent	Only the updates for the current row are applied.

arFiltered	Only updates for rows matching the current filter are applied.

arAll	Updates for all rows are applied.

arAllChapters	Update affects all chapters (ADO chapters)

Note: To use batch updating, the CursorType property of the dataset component must be either ctKeySet (the default) or ctStatic and the LockType property must be ltBatchOptimistic.


TCustomADODataSet.CancelUpdates

TCustomADODataSet

Cancels pending updates.

procedure CancelUpdates;

Description

Call CancelUpdates to cancel any pending updates to the underlying table(s) and revert field values to their original values (the values present since the last applied update, if any).


TCustomADODataSet.Clone

TCustomADODataSet	See also

Duplicates another dataset in the calling component

procedure Clone(Source: TCustomADODataSet; LockType: TLockType = ltUnspecified);

Description

Call Clone to make the recordset of the calling ADO dataset component a duplicate of the recordset active in another TCustomADODataSet descendant component. If the attempt to clone a recordset is successful, the current ADO dataset component’s recordset will be the same as that in the other dataset. If unsuccessful, the recordset is set to nil and an EADOError exception raised.

LockType specifies the lock type to use when opening the clone recordset. By default, LockType is ltUnspecified.


TCustomADODataSet.CompareBookmarks

TCustomADODataSet	See also

Compares two bookmarks.

function CompareBookmarks(Bookmark1, Bookmark2: TBookmark): Integer; override;

Description

Call CompareBookmarks to compare one bookmark to another. CompareBookmarks returns an integer value indicating the difference between the two bookmarks. CompareBookmarks returns a 0 (zero) if the two bookmarks are the same, a –1 (negative one) if bookmark one is less than bookmark two, or a 1 (positive one) if bookmark one is greater than bookmark two. CompareBookmarks also returns a zero if one of the two bookmarks is nil.

Bookmark1 and Bookmark2 are the two TBookmark values to compare.


TCustomADODataSet.Create

TCustomADODataSet	See also

Creates an instance of a TCustomADODataSet component.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate an ADO dataset component at runtime. TCustomADODataSet contains abstract methods, and is not intended to be used in applications. Instead, applications instantiate dataset descendants such as TADODataSet, TADOTable, TADOQuery, or TADOStoredProc.

Create

Calls its inherited Create method.

Sets the CursorType property of the dataset to ctKeyset.

Sets the LockType property of the dataset to ltOptimistic.

Sets the CacheSize property of the dataset to 1 (one).

Sets the CommandType property of the dataset to cmdText.

Sets the ObjectView property of the dataset to True.


TCustomADODataSet.CreateBlobStream

TCustomADODataSet	See also

Creates a blob stream for a Binary large object (BLOB) field in the dataset.

function CreateBlobStream(Field: TField; Mode: TBlobStreamMode): TStream; override;

Description

Call CreateBlobStream to obtain a stream for reading and writing the value of the field specified by the Field parameter.

Field is a string containing the name of the BLOB (or comparable type) field in the recordset.

Mode indicates whether the stream will be used for reading the field’s value (bmRead), writing the field’s value (bmWrite), or both (bmReadWrite).


TCustomADODataSet.Destroy

TCustomADODataSet	See also

Destroys the TCustomADODataSet instance.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Usually destruction of datasets is handled automatically by Delphi. If an application creates its own instances of a dataset, however, and does not assign an Owner that is responsible for freeing the dataset, then the application should call Free, which verifies that the dataset reference is not nil before calling Destroy.

Destroy performs the following tasks:

Closes the dataset.

Disconnects from the associated database.

Calls the inherited destructor.


TCustomADODataSet.DeleteRecords

TCustomADODataSet	See also

Deletes one or more records in the recordset.

TAffectRecords = (arCurrent, arFiltered, arAll, arAllChapters);

procedure DeleteRecords(AffectRecords: TAffectRecords = arAll);

Description

Use DeleteRecords to delete one or more records from the recordset the ADO dataset component represents.

If the recordset does not support record deletions, an exception is raised. Use the Supports method to determine whether the recordset supports deleting records.

If the recordset was opened in batch update mode, the records are only marked for deletion. Apply the batch deletions by calling the UpdateBatch method. If the recordset is not in batch update mode, the records are immediately removed from the base table.

AffectRecords is a TAffectRecords constant that determines which records are deleted by DeleteRecords. The default value for the AffectRecords parameter is arAll, which causes all records in the recordset to be deleted.

Option	Meaning

arCurrent	Only the deletes the current record.

arFiltered	Only deletes records accessible through the current filter.

arAll	Deletes all records in the recordset.

arAllChapters	Deletes records in all chapters (ADO chapters)


TCustomADODataSet.FilterOnBookmarks

TCustomADODataSet	See also

Filters a data set to just rows with pre-defined bookmarks.

procedure FilterOnBookmarks(Bookmarks: array of const);

Description

Use FilterOnBookmarks to filter an ADO dataset to display only those data rows for which a bookmark has been defined. To successfully use FilterOnBookmark, you must have already defined at least one valid bookmark in the dataset.

procedure TForm1.Button1Click(Sender: TObject);

var

  BM1, BM2: TBookmarkStr;

begin

  with ADODataSet1 do begin

    BM1 := Bookmark;

    MoveBy(3);

    BM2 := Bookmark;

    FilterOnBookmarks([BM1, BM2]);

  end;

end;

When FilterOnBookmarks is called, the Filter property is automatically cleared, the FilterGroup property is set to fgUnassigned, and the Filtered property is set to True.


TCustomADODataSet.GetBlobFieldData

TCustomADODataSet	See also

Retrieves the current value of a field into a buffer.

function GetBlobFieldData(FieldNo: Integer; var Buffer: TBlobByteData): Integer; override;

Description

Most applications do not need to call GetBlobFieldData, this method being used internally by descendants of TCustomADODataSet. GetBlobFieldData reads blob data from the field specified by FieldNo into a Buffer. The buffer is a dynamic array of bytes, so that it can grow to accommodate the size of the BLOB data. GetBlobFieldData returns the size of the buffer.


TCustomADODataSet.GetFieldData

TCustomADODataSet	See also

Retrieves the current value of a field into a buffer.

function GetFieldData(Field: TField; Buffer: Pointer): Boolean; override;

Description

Most applications do not need to call GetFieldData. TField objects call this method to implement their GetData method.

The Field or FieldNo parameter indicates the field whose data should be fetched. Field specifies the component itself, while FieldNo indicates its field number.

Buffer is a memory buffer with sufficient space to accept the value of the field as it exists in the database (unformatted and untranslated). GetFieldData returns a value that indicates whether the data was successfully fetched.

GetFieldData returns a boolean value indicating whether the operation was successful.


TCustomADODataSet.IsSequenced

TCustomADODataSet

Indicates whether the underlying database table uses record numbers to indicate the order of records.

function IsSequenced: Boolean; override;

Description

Use IsSequenced to determine whether the underlying database table supports sequence numbers, or whether these are computed by the dataset component. When IsSequenced returns True, applications can safely use the RecNo property to navigate to records in the dataset.


TCustomADODataSet.LoadFromFile

TCustomADODataSet	See also

Loads a recordset from a file.

procedure LoadFromFile(const FileName: WideString);

Description

Call LoadFromFile to load the recordset for the calling ADO dataset component from a file. If the loading operation fails, the current recordset is neutralized (set to nil), the dataset component remains inactive, and an EOleException exception is raised. If the attempt to load data from a file is successful, the ADO dataset component is automatically activated and the data made available.

FileName is a string containing the name of the file.

LoadFromFile closes the dataset component before loading the recordset from the file specified in FileName.


TCustomADODataSet.Locate

TCustomADODataSet	See also

Searches the dataset for a specified record and makes that record the current record.

function Locate(const KeyFields: String; const KeyValues: Variant; Options: TLocateOptions): Boolean; override;

Description

Call Locate to search a recordset for a specific row and make it the current row.

KeyFields is a string containing a semicolon-delimited list of field names on which to search.

KeyValues is a variant that specifies the values to match in the key fields. If KeyFields lists a single field, KeyValues specifies the value for that field on the desired row. To specify multiple search values, pass a variant array as KeyValues, or construct a variant array on the fly using the VarArrayOf routine. For example:

with ADOTable1 do

  Locate('Company;Contact;Phone', VarArrayOf(['Sight Diver', 'P', '408-431-1000']), [loPartialKey]);

Options is a set that optionally specifies additional search latitude when searching on string fields. If Options contains the loCaseInsensitive setting, then Locate ignores case when matching fields. If Options contains the loPartialKey setting, then Locate allows partial-string matching on strings in KeyValues. If Options is an empty set, or if KeyFields does not include any string fields, Options is ignored.

Locate returns True if it finds a matching row, and makes that row the current one. Otherwise Locate returns False.


TCustomADODataSet.Lookup

TCustomADODataSet	See also

Retrieves field values from a row that matches specified search values.

function Lookup(const KeyFields: String; const KeyValues: Variant; const ResultFields: String): Variant; override;

Description

Call Lookup to retrieve values for specified fields from a row that matches search criteria. KeyFields is a string containing a semicolon-delimited list of field names on which to search.

KeyValues is a variant array containing the values to match in the key fields. To specify multiple search values, pass KeyValues as a variant array as an argument, or construct a variant array on the fly using the VarArrayOf routine.

ResultFields is a string containing a semicolon-delimited list of field names whose values should be returned from the matching row.

Lookup returns a variant array containing the values from the fields specified in ResultFields.


TCustomADODataSet.NextRecordset

TCustomADODataSet

Provides access to a secondary recordset.

function NextRecordset(var RecordsAffected: Integer): _Recordset;

Description

Call NextRecordset in situations where multiple recordsets are returned to provide access to the second (and subsequent) recordsets. The ADO Recordset object returned by NextRecordSet must be assigned to the Recordset property of an ADO dataset component, such as TADODataSet, to be accessible.

…

var

  Rows: Integer;

begin

  ADODataSet1.RecordSet := ADOQuery1.NextRecordset

  …

end;

RecordsAffected is the number of rows in the returned recordset.


TCustomADODataSet.Requery

TCustomADODataSet	See also

Refreshes the recordset.

procedure Requery(Options: TExecuteOptions = []);

Description

Call Requery to refresh the recordset. Requery updates the recordset by re-executing the original command or SQL statement that produced the recordset.

The effects of Requery are the same as calling the dataset component’s Close method and then its Open method. However, there are circumstances when one means of refreshing the recordset is better than the other. The values in properties like CursorLocation, CursorType, and LockType cannot be changed while the recordset is open, so Requery can only refresh the recordset using the existing values in these properties. To refresh the recordset using different values for these properties, effect the refresh using the Close and Open methods.

Options is a TExecuteOptions value that specifies the characteristics of the command execution effected by the requery that produces the recordset for the dataset.


TCustomADODataSet.SaveToFile

TCustomADODataSet	See also

Saves a recordset to a file.

procedure SaveToFile(const FileName: String = ''; Format: TPersistFormat = pfADTG);

Description

Call SaveToFile to save the current recordset to a file. If the destination file already exists, it is overwritten.

FileName is a string containing the name of the destination file. This file remains open from the first call to SaveToFile until the dataset is closed. This file can be read by other applications while it is open, but they cannot write to the file.

Format specifies the file format for the saved recordset. By default, Format is pfADTG (Advanced Data Tablegram format).

Note:	Microsoft recommends using a client-side cursor (the dataset is opened with a CursorLocation property value of clUseClient). This way, if the provider used does not support saving the recordset the client cursor will provide the necessary functionality.


TCustomADODataSet.Seek

TCustomADODataSet	See also

Searches for a record using the current index.

TSeekOption = (soFirstEQ, soLastEQ, soAfterEQ, soAfter, soBeforeEQ, soBefore);

function Seek(const KeyValues: Variant; SeekOption: TSeekOption = soFirstEQ): Boolean;

Description

Call Seek to find a record with a specified value (or values) in the field (or fields) on which the current index is based. An index must be active to use Seek. The field used for the search is that of the currently active index. Seek moved the record pointer of the dataset based on the success of the search. If the search finds a record, the record pointer is moved to that record. If Seek does not find a record matching the value in KeyValues using the comparison method specified in SeekOption, the record pointer is positioned to the end of the dataset. Seek returns a boolean value reflecting the success of the search: True if a record was found or False if no record was found.

SuccessVar := ADODataSet1.Seek('Jones', soFirstEQ);

If the current index is based on more than one field, search values supplied in the Seek method must be for all fields sequentially from left to right in the index expression. That is, if the index is based on three fields, the search can be on the first field, the first and second fields, or on the first and second and third fields. It cannot be based only on the third field or on a combination of the first and third fields. To search based on multiple fields, pass a variant array to the Seek method.

KeyValues is the value to search for or multiple values if the index is based on multiple fields.

ADODataSet1.Seek(VarArrayOf([90030, 90020]), soFirstEQ);

SeekOption specifies the type of comparison made in determining whether the search was successful. SeekOption can be one of the six constants:

Seek Option	Meaning

soFirstEQ	Record pointer positioned at the first matching record, if one is found, or at the end of the dataset if one is not found.

soLastEQ	Record pointer positioned at the last matching record, if one is found, or at the end of the dataset if one is not found.

soAfterEQ	Record pointer positioned at matching record, if found, or just after where that matching record would have been found.

soAfter	Record pointer positioned just after where a matching record would have been found.

soBeforeEQ	Record pointer positioned at matching record, if found, or just before where that matching record would have been found.

soBefore	Record pointer positioned just before where a matching record would have been found.


TCustomADODataSet.Supports

TCustomADODataSet

Indicates whether a recordset supports certain types of operations.

function Supports(CursorOptions: TCursorOptions): Boolean;

Description

Call Supports to determine whether the active recordset supports the cursor operations specified in CursorOptions. Supports will indicate the active recordset, as defined, will support such cursor functionality as adding new rows, using ADO bookmarks, deleting rows, and updating rows. Other cursor functionality can be specified.

CursorOptions specifies one or more TCursorOptions cursor operations.

If the recordset is active Supports returns a boolean whether the specified cursor operations are supported by the recordset. If all specified cursor operations are supported, Supports returns True, otherwise Supports returns False (one or more of the specified cursor operations are not supported by the recordset).


TCustomADODataSet.UpdateBatch

TCustomADODataSet	See also

Writes pending batch updates to disk.

TAffectRecords = (arCurrent, arFiltered, arAll, arAllChapters);

procedure UpdateBatch(AffectRecords: TAffectRecords = arAll);

Description

Call UpdateBatch to write any pending updates to disk for a recordset that is in batch update mode to the associated database.

The AffectRecords parameter may be any one of the following TAffectRecords values:

Option	Meaning

arCurrent	Only the updates for the current row are applied.

arFiltered	Only updates for rows matching the current filter are applied.

arAll	Updates for all rows are applied.

arAllChapters	Update affects all chapters (ADO chapters)

Note: To use batch updating, the CursorType property of the dataset component must be either ctKeySet (the default) or ctStatic and the LockType property must be ltBatchOptimistic.


TCustomADODataSet.UpdateStatus

TCustomADODataSet	See also

Indicates the update status of the current record.

function UpdateStatus: TUpdateStatus; override;

Description

Call UpdateStatus for recordsets opened in batch update mode to determine the update status of the currently active record. UpdateStatus only provides useful information when the recordset has been opened in batch update mode. Otherwise there cannot be any unapplied updates.

Note: To use batch updating, the CursorType property of the dataset component must be either ctKeySet (the default) or ctStatic and the LockType property must be ltBatchOptimistic.


Scope

Protected

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TDataSet


EADOError

Hierarchy	Properties	Methods	See also

EADOError is the exception class for database errors generated by ADO databases.

Unit

ADOdb

Description

An EADOError exception is raised when a component detects a database error. Use EADOError in an exception handling block or to create a database exception.


EADOError properties

EADOError	Alphabetically

Derived from Exception

HelpContext

Message


EADOError properties

EADOError	By object

HelpContext

Message


EADOError methods

EADOError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelpException_CreateResHelp>Main

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EADOError methods

EADOError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EDatabaseError


TParameter

Hierarchy	Properties	Methods	See also

TParameter represents a parameter.

Unit

ADOdb

Description

Use the properties and methods of a TParameter to set or get the value of a parameter used in an ADO query, stored procedure, dataset, or command component. Objects that use parameters create TParameter objects to represent those parameters and use a TParameters collection to organize and opperate on the TParameter objects. For example, TParameters are used by TADOQuery objects and TADOStoredProc components (in their Parameters properties).


TParameter properties

TParameter	Alphabetically	Legend

In TParameter

Attributes

DataType

Direction

DisplayName

Name

NumericScale

ParameterObject

Parameters

Precision

Properties

Size

Value

Derived from TCollectionItem

Collection

ID

Index


TParameter properties

TParameter	By object	Legend

Attributes

Collection

DataType

Direction

DisplayName

ID

Index

Name

NumericScale

ParameterObject

Parameters

Precision

Properties

Size

Value


TParameter.Attributes

TParameter

Specifies the attributes of a parameter.

property Attributes: TParameterAttributes;

Description

Set Attributes to specify the attributes of a parameter, thus controlling the type of values a parameter will accept. By default, Attributes is assigned no value at all. Attributes may be set to any one or a combination of the three value TParameterAttributes constants: psSigned, psNullable, and psLong.


TParameter.DataType

TParameter	See also

Indicates the type of value the parameter represents.

property DataType: TDataType;

Description

Set DataType to reflect the data type of the value the parameter represents. The default value of DataType is ftUnknown.

Read DataType to discover the type of data that was assigned to the parameter. Each possible value of DataType corresponds to a type of table field.

ADOStoredProc1.Parameters.Items[0].DataType := ftString;


TParameter.Direction

TParameter	See also

Indicates the type of parameter.

property Direction: TParameterDirection;

Description

Set Direction to indicate the type of parameter the TParameter object represents. A parameter can be one of the types: input, output, input-output, or return value. Assign a type of pdUnknown when the actual type of the parameter is not known at the time. The default value of Direction is pdInput.


TParameter.DisplayName

TParameter	See also

The name displayed in the collection editor.

property DisplayName: String;

Description

DisplayName is the string that represents the item in the collection editor. When the item is selected in the collection editor, the DisplayName can also appear in the Object Inspector as the value of another property. By default, DisplayName contains the same value as the Name property.


TParameter.Name

TParameter	See also

Identifies the TParameter object.

property Name: WideString;

Description

Use Name to identify a particular parameter within a TParameters object.

Note:	Name is the name of the TParameter object, not the name of the parameter it represents in a query or stored procedure.


TParameter.NumericScale

TParameter	See also

Specifies the number of decimal places for the parameter.

property NumericScale: Byte;

Description

Set NumericScale to indicate the maximum number of characters that can appear to the right of the decimal place in the parameter's value. (The Precision property controls the total number of digits allowed.) By default, NumericScale is zero.


TParameter.ParameterObject

TParameter

Provides direct access to the ADO Parameter object.

property ParameterObject: _Parameter;

Description

Use ParameterObject to gain direct access to the ADO Parameter object that corresponds to the Delphi parameter object. Using this reference, you can access properties and call methods of the ADO Parameter object.

Under ordinary circumstances it should not be necessary to use the ADO Parameter directly in an application. This property is provided for the instances where a property or method of the ADO Parameter is needed but not implemented in the Delphi parameter object. You should be familiar with ADO objects before attempting to use them directly. Consult the Microsoft Data Access SDK for more specific information on ADO objects and their properties and methods.


TParameter.Parameters

TParameter	See also

Provides a reference to the TParameters container.

property Parameters: TParameters;

Description

Use Parameters to get a reference to the TParameters object in which the TParameter object is contained.


TParameter.Precision

TParameter	See also

Specifies the number of digits allowed for a numeric parameter.

property Precision: Byte;

Description

Set Precision to indicate the maximum number of digits allowed in the parameter, including both significant and fractional. (The NumericScale property controls the total number of decimal digits allowed.) By default, Precision is zero.


TParameter.Properties

TParameter

Provides read-only access to the Properties property of the ADO Parameter object.

property Properties: Properties;

Description

Read Properties to get the values of the Properties property of the ADO Parameter object that corresponds to the Delphi parameter object.

Note:	Directly accessing the underlying ADO Parameter object requires a good working knowledge of ADO objects in general and the ADO Parameter object in specific. It is not recommended that you use the Parameter object directly unless familiar with Parameter object operations. Consult the Microsoft Data Store SDK help for specific information on using ADO Parameter objects.


TParameter.Size

TParameter	See also

Specifies the size of a string type parameter.

property Size: Integer;

Description

Set Size to indicate the maximum number of characters the parameter may contain. By default, Size is zero.

Note:	Size only pertains to string type parameters (like CHAR and VARCHAR). For numeric type parameters, use the NumericScale and Precision properties. For other column types, Size should remain set to zero.


TParameter.Value

TParameter	See also

Represents the value of the parameter as a Variant.

property Value: OleVariant;

Description

Use Value in generic code that manipulates the values of parameters without needing to know the field type the parameters represent.


TParameter methods

TParameter	Alphabetically

In TParameter

AppendChunk

Assign

LoadFromFile

LoadFromStream

In TCollectionItem

Create

Destroy

GetNamePath

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TParameter methods

TParameter	By object

AfterConstruction

AppendChunk

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

SafeCallException


TParameter.AppendChunk

TParameter	See also

Adds data to a parameter.

procedure AppendChunk(Val: OleVariant);

Description

Call AppendChunk to put data into or add data to a parameter's value. Use AppendChunk to insert binary or text data into a parameter.

AppendChunk may be used to pass all of the data at one time or in pieces using multiple calls to the method. The first call to AppendChunk overwrites any existing data in the parameter. If the data is being passed in its entirety using one call to AppendChunk, no further action takes place. If data is passed in multiple calls, the data passed in Val in each subsequent call to AppendChunk is appended to data previously passed.

Val is the data to pass to the parameter.

Note: The Attributes property must contain paLong to use AppendChunk.


TParameter.Assign

TParameter	See also

Copies the properties and value of one TParameter object to another.

procedure Assign(Source: TPersistent); override;

Description

Call Assign to make one TParameter an exact clone of another. Assign copies the values of the Attributes, DataType, Direction, Name, NumericScale, Precision, Size, and Value properties from the parameter object specified in Source to the calling parameter object.

ADOStoredProc1.Parameters[0].Assign(ADOStoredProc2.Parameters.Items[0]);

Assign may be used with various types of sources: another TParameter, a field in a table, a string list object (most often for a memo type parameter), or a TBitmap (for BLOB type fields), a TPicture (for BLOB type fields). In the example below, Assign is used to give a value for a memo type parameter from a string list object (the Lines property of a TMemo).

ADOStoredProc1.Parameters[1].Assign(Memo1.Lines);


TParameter.LoadFromFile

TParameter	See also

Loads the value of a parameter from a file.

procedure LoadFromFile(const FileName: String; DataType: TDataType);

Description

Call LoadFromFile to copy the contents of a file into a parameter.

FileName is a String containing the name of the file from which to copy data.

DataType is the field data type the loaded data is to be treated as.


TParameter.LoadFromStream

TParameter	See also

Loads the value of a parameter from a memory stream.

procedure LoadFromStream(Stream: TStream; DataType: TDataType);

Description

Call LoadFromStream to copy the contents of a memory stream into a parameter.

Stream is a reference to the memory stream from which to copy data.

DataType is the field data type the loaded data is to be treated as.

var

  MS: TMemoryStream;

begin

  MS := TMemoryStream.Create;

  try

    … fill memory stream with data …

    ADOQuery1.Parameters[4].LoadFromStream(MS);

  finally

  if assigned(MS) then

    MS.Free;

  end;

end;


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem


TParameters

Hierarchy	Properties	Methods	See also

TParameters manages a collection of parameters.

Unit

ADOdb

Description

Use TParameters to manage a collection of TParameter objects for an object that uses field parameters. For example, TADOStoredProc objects and TADOQuery objects use TParameters objects (in properties named Parameters) to create and access their parameters.

Use the properties and methods of TParameters to:

Access a specific parameter.

Add or delete field parameters from the list.

Get or set the values of individual parameters.

Compare collections of parameters.

Iterate through all parameters.

Copy a collection of parameters to another parameter collection.


TParameters properties

TParameters	Alphabetically	Legend

Derived from TParameters

Command

Items

ParameterCollection

ParamInfoAvailable

ParamValues

Derived from TCollection

Count

ItemClass


TParameters properties

TParameters	By object	Legend

Command

Count

ItemClass

Items

ParameterCollection

ParamInfoAvailable

ParamValues


TParameters.Command

TParameters	See also

Indicates the associated ADO command object.

property Command: TADOCommand;

Description

Read Command to get a reference to the ADO command object associated with the ADO dataset object that contains the TParameters object.


TParameters.Items

TParameters	See also

Contains the collection of parameters.

property Items[Index: Integer]: TParameter;

Description

Items is a collection of TParameter objects. Each TParameter object in the collection represents an individual parameter. Use Items to access a particular parameter.

Index indicates the specific parameter to access. Index is an Integer identifying the parameter’s position in the collection of parameters, in the range 0 to Count - 1.


TParameters.ParameterCollection

TParameters	See also

Encapsulates the ADO Parameters Collection object.

property ParameterCollection: Parameters;

Description

Use Properties to get direct access to the ADO Parameters Collection for the ADO Recordset object with which the TParameters is associated. A Parameters Collection object contains al of the ADO Parameters objects for a command. A Parameters Collection contains one or more ADO Parameter objects.

Note:	Use of ParameterCollection to directly access the underlying ADO Parameters Collection object requires a good working knowledge of ADO objects in general and ADO Parameters Collection objects in specific. Consult the Microsoft Data Store SDK help for specific information on using ADO Parameters Collection objects.


TParameters.ParamInfoAvailable

TParameters	See also

Indicates whether the provider supports CheckParamInfoAvailability.

property ParamInfoAvailable: Boolean;

Description

Indicates whether the provider supports the GetParameterInfo procedure CheckParamInfoAvailability.


TParameters.::ParamValues
TParameters.ParamValues

TParameters	See also

Retrieves the value of one or more parameters.

property ParamValues[const ParamName: String]: Variant;

Description

Use ParamValues to get or set the individual values of parameters identified by name.

ParamName is a String containing the names of the individual parameters of interest. If ParamValues is used to access more than one parameter, the names are separated by semicolons (;).

Setting ParamValues sets the Value property for each parameter listed in the ParamName string. Specify the values as Variants, in order, in a variant array.

Getting ParamValues retrieves a variant array of variants, each of which represents the value of one of the named parameters.

If ParamName includes a name that does not match any of the field parameters in Items, an exception is raised.

Note:	ParamValues operates with the names of parameters as they appear in an SQL statement or stored procedure, not the Name property of TParameter objects. The two should not be confused.


TParameters methods

TParameters	Alphabetically

In TParameters

AddParameter

AppendParameters

AssignValues

CreateParameter

FindParam

GetParamList

IsEqual

ParamByName

ParseSQL

Refresh

Derived from TOwnedCollection

Create

Derived from TCollection

Add

Assign

BeginUpdate

Clear

Delete

Destroy

EndUpdate

FindItemID

GetNamePath

Insert

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TParameters methods

TParameters	By object

Add

AddParameter

AfterConstruction

AppendParameters

Assign

AssignValues

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

CreateParameter

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

FindItemID

FindParam

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParamList

InheritsFrom

InitInstance

Insert

InstanceSize

IsEqual

MethodAddress

MethodName

NewInstance

ParamByName

ParseSQL

Refresh

SafeCallException


TParameters.AddParameter

TParameters	See also

Adds a parameter to the collection.

function AddParameter: TParameter;

Description

Call AddParameter to create a single empty TParameter object and add it to the TParameters collection. All properties of the newly added TParameter object are either at their default value or are empty.

ADOStoredProc1.AddParameter


TParameters.AppendParameters

TParameters	See also

Encapsulates the Append method of ADO ParameterCollection objects.

procedure AppendParameters;

Description

AppendParameters is used internally by the TParameters component to add ADO Parameter objects to the ADO ParameterCollection underlying the TParameters. Each Parameter object so added corresponds to a TParameter component subordinate to the TParameters.


TParameters.AssignValues

TParameters	See also

Assigns parameter values from another parameters collection.

procedure AssignValues(Value: TParams);

Description

Call AssignValues to assign the values of parameters in the calling TParameters object using the values in another TParameters.

ADOQuery1.Parameters.Assign(ADOQuery2.Parameters);

Each parameter with the same name as a parameter in the source TParameters specified in Value is assigned the value from the source parameter. Parameters in the calling TParameters object that do not exist in the source TParameters object are unaffected. Parameters that only exist in the source TParameters are not subsequently created in the calling TParameters object. For example if the calling TParameters has parameters named Parm1 and Parm2 and the source TParameters has Parm2 and Parm3:

•	Parm1 in the calling TParameters is unaffected.

•	Parm2 gets the value of Parm2 in the source TParameters.

•	No Parm3 is created in the calling TParameters.


TParameters.CreateParameter

TParameters	See also

Adds a parameter to the collection.

function CreateParameter(const Name: WideString; DataType: TDataType; Direction: TParameterDirection; Size: Integer; Value: OleVariant): TParameter;

Description

Call CreateParameter to create a single TParameter object and add it to the TParameters collection. Property values for the newly added TParameter object are supplied via CreateParameter parameters.

Name is a WideString value containing the name of the newly created TParameter object.

DataType is a TDataType value indicating the data type of the parameter the new TParameter object represents.

Direction is a TParameterDirection value indicating the parameter type. A parameter represented by a TParameter may be any one of: input, output, input-output, return value. Designate a parameter as unknown if the parameter type is not know at the time the TParameter is created.

Size is an Integer value indicating the maximum size of the parameter’s value.

Value is an OleVariant containing the parameter’s value. A value need not be passed for Value when the TParameter is created. It can be assigned later. If no value is assigned at this time, pass a nil for Value.

ADOStoredProc1.CreateParameter('Parm1', ftString, pdInput, 10, nil);


TParameters.FindParam

TParameters	See also

Locates the parameter with a given name.

function FindParam(const Value: String): TParam;

Description

Use FindParam method to find a parameter with the name specified in Value. If a match is found, FindParam returns a reference to the TParameter object (assignment-compatible with TParam objects) for the parameter of the specified name. Otherwise, it returns nil. Use this method rather than a direct reference to the Items property to avoid depending on the order of the entries.

To locate more than one parameter at a time, by name, use the GetParamList method instead. To get only the value of a named parameter, use the ParamValues property.

Note:	FindParam operates with the name of a parameter as it appears in an SQL statement or stored procedure, not the Name property of a TParameter object. The two ways of referring to a parameter should not be confused.


TParameters.GetParamList

TParameters	See also

Fills a TList object with names of available parameters.

procedure GetParamList(List: TList; const ParamNames: String);

Description

Use GetParamList to obtain a subset of the parameters in the TParameters collection that have been identified by name.

ParamNames is a string giving the names of all field parameters of interest. Multiple parameter names are separated by semicolons (;).

List is the TList object into which the parameters names are placed. GetParamList adds the field parameters to List in the order they appear in ParamNames. If ParamNames includes a name that does not match any of the field parameters in Items, an exception is raised.

Note:	GetParamList operates with the names of parameters as they appear in an SQL statement or stored procedure, not the Name property of TParameter objects. The two ways of referring to a parameter should not be confused.


TParameters.IsEqual

TParameters	See also

Indicates whether two TParameters objects have identical contents.

function IsEqual(Value: TParams): Boolean;

Description

Use IsEqual to compare the contents of two TParameters objects. IsEqual returns True if the parameter collection specified in Value exactly matches the calling parameter collection. To match, each parameter collection must have the same number of TParameter objects, in the same order, which match on name, datatype, parameter type, and value.

if (ADOQuery1.Parameters.IsEqual(ADOQuery2.Parameters) then

  { do one thing }

else

  { do something else };


TParameters.ParamByName

TParameters	See also

Locates the parameter with a given name.

function ParamByName(const Value: WideString): TParameter;

Description

Use ParamByName method to find a parameter with the name specified in Value. If a match is found, ParamByName returns a reference to the corresponding TParameter object. Otherwise, the TParameter reference is nil and an exception is raised. Use this method rather than a direct reference to the Items property to avoid depending on the order of the entries.

To locate a parameter by name without raising an exception if the parameter is not found, use the FindParam method.

To locate more than one parameter at a time, by name, use the GetParamList method instead. To get only the value of a named parameter, use the ParamValues property.

Note:	ParamByName operates with the name of a parameter as it appears in an SQL statement or stored procedure, not the Name property of a TParameter object. The two ways of referring to a parameter should not be confused.


TParameters.ParseSQL
TParameters.::ParseSQL

TParameters	See also

Parses an SQL statement for parameters and TParameter objects.

function ParseSQL(SQL: String; DoCreate: Boolean): String;

Description

Call ParseSQL to parse an SQL statement for parameters. For each parameter found in the SQL statement, a TParameter object is added to the calling TParameters object using the name of the parameter in the SQL statement.

SQL is a String containing the SQL statement to parse.

DoCreate indicates whether to clear all existing parameter definitions before parsing the SQL statement.

ParseSQL returns a String containing…

ADOQuery1.Parameters.ParseSQL(ADOQuery1.Text, True);


TParameters.Refresh

TParameters	See also

Refreshes a parameter collection.

procedure Refresh;

Description

Call Refresh to ensure a parameter collection has the most up to date information on available parameters.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection

TOwnedCollection


 TRDSConnection

Hierarchy	Properties	Methods	Events	See also

TRDSConnection is the VCL implementation of an RDS DataSpace object.

Unit

ADOdb

Description

The TRDSConnection class exposes the functionality of the RDS DataSpace object. RDS DataSpace objects manage the marshaling of data when a Recordset object is passed from one process or machine to another. Use TRDSConnection when building multi-tier applications using business objects (Application Servers).

Use a TRDSConnection component in the place of a TADOConnection. Associate the TRDSComponent with the TADODataSet component using the latter's RDSConnection property.

By default, an RDS connection component is configured to work with the RDS DataFactory object. The DataFactory object can be used when you do not require a specialized business object. When using a DataFactory object, the ConnectionString and CommandText properties of the TADODataSet are passed to the Query method of the DataFactory object. When using a business object, the CommandText property should contain the name of a property of the business object which will return a Recordset that can be used by the TADODataSet. A value for the ConnectionString property is not required when using a business object.


TRDSConnection properties

TRDSConnection	Alphabetically	Legend

In TRDSConnection

AppServer

ComputerName

DataSpaceObject

InternetTimeout

ServerName

Derived from TCustomConnection

Connected

DataSetCount

DataSets

LoginPrompt

StreamedConnected

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomConnection properties

TCustomConnection	By object	Legend

AppServer

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ComputerName

Connected

DataSetCount

DataSets

DataSpaceObject

DesignInfo

InternetTimeout

LoginPrompt

Name

Owner

ServerName

StreamedConnected

Tag

VCLComObject


TRDSConnection.AppServer

TRDSConnection	See also

AppServer is a reference to the application server communication interface.

property AppServer: OleVariant;

Description

Read AppServer to…

Use AppServer to get direct access to the interface the client dataset uses to communicate with the application server. Use this property if you need to access additional properties or methods of the business object not related to Recordsets.


TRDSConnection.ComputerName

TRDSConnection	See also

Specifies the source of a business object.

property ComputerName: WideString

Description

Use ComputerName to specify the source of a business object to use through the TRDSConnection component. If left blank, the business object is loaded from the local machine.

Several protocols are supported for creating the business object: HTTP, HTTPS, and DCOM. For business objects created with HTTP and HTTPS, ComputerName is a string containing a Universal Resource Identifier (URL) identifying the Internet Information Server (IIS) Web server where an instance of the server business object is created. For DCOM, ComputerName is the name of the machine.


TRDSConnection.DataSpaceObject

TRDSConnection	See also

DataSpaceObject is an interface for the RDS DataSpace object.

DataSpaceObject: DataSpace

Description

Use DataSpaceObject to get direct access to the RDS DataSpace object the RDS connection component represents. This direct access reference allows an application to use properties and methods of the underlying DataSpace object. Accessing the underlying DataSpace object is especially useful for utilizing properties and methods of the DataSpace object not surfaced in TRDSConnection.

Note:	Use of DataSpaceObject to directly access the underlying RDS DataSpace object requires a good working knowledge of ADO objects in general and the RDS DataSpace object in specific. It is not recommended that you use the DataSpace object directly unless familiar with DataSpace object operations. Consult the Microsoft Data Store SDK help for specific information on using RDS DataSpace objects.


TRDSConnection.InternetTimeout

TRDSConnection	See also

Specifies the amount of time before a request times out.

property InternetTimeout: Integer

Description

Use InternetTimeout to specify the amount of time (measured in milliseconds) after which a request times out. InternetTimeout only applies to requests sent with the HTTP and HTTPS protocols. The default value for InternetTimeout is zero.

In a multi-tier environment, requests for data may take several minutes to execute. InternetTimeout can be used to specify a longer timeout period for long-running requests.


TRDSConnection.ServerName

TRDSConnection	See also

Specifies the business object.

property ServerName: WideString

Description

Use ServerName to specify the ProgID of the business object to instantiate. The default value is that in the RDSServer.DataFactory property. This is the ProgID of the RDS DataFactory object. The DataFactory allows for execution of queries against any datasource. See the Microsoft Data Store SDK help for more information on the DataFactory object.


TRDSConnection events

TRDSConnection	Alphabetically

Derived from TCustomConnection

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnLogin


TRDSConnection events

TRDSConnection	By object

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnLogin


TRDSConnection methods

TRDSConnection	Alphabetically	Legend

In TRDSConnection

Create

Destroy

GetRecordset

In TCustomConnection

Close

DoConnect

DoDisconnect

GetConnected

GetDataSet

GetDataSetCount

Loaded

Open

RegisterClient

SendConnectEvent

SetConnected

UnRegisterClient

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TRDSConnection methods

TRDSConnection	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DoConnect

DoDisconnect

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetConnected

GetDataSet

GetDataSetCount

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetRecordset

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Loaded

MethodAddress

MethodName

NewInstance

Open

RegisterClient

RemoveComponent

SafeCallException

SendConnectEvent

SetConnected

UnRegisterClient

UpdateAction


TRDSConnection.Create

TRDSConnection	See also

Creates an instance of TRDSConnection.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate an RDS connection component at runtime. The Owner parameter specifies another component (usually a form or data module) that is responsible for freeing the RDS connection component.

Create

•	Calls its inherited Create method.

•	Associates the RDS connection component to the default DataFactory.


TRDSConnection.Destroy

TRDSConnection	See also

Destroys the instance of a connection component.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free, which verifies that the TRDSConnection reference is not nil before calling Destroy

Destroy closes all active datasets and closes its connection before freeing all internal resources.

Destroy performs the following tasks:

Clears refs.

Frees its data space object.

Calls the inherited destructor.


TRDSConnection.GetRecordset

TRDSConnection	See also

Retrieves a recordset.

function GetRecordset(const CommandText: WideString; ConnectionString: WideString = ''): _Recordset;

Description

Call GetRecordset to retrieve a Recordset object from a business object. GetRecordSet is called automatically by the TADODataSet associated with the RDS connection component.

When using a business object, only the CommandText parameter should be passed a value. This is the Name property of the business object which returns the Recordset object. When GetRecordset is called by the TADODataSet component, the value used for the CommandText parameter is the value in the CommandText property of the ADO dataset component.

When using a DataFactory, the CommandText parameter is a query command (SQL statement) to execute and the ConnectionString specifies the information needed to establish the connection. When GetRecordset is called by the ADO dataset component, the value used for the ConnectionString parameter is the value in the ConnectionString property of the ADO dataset component.

ADODataSet1.CommandText := 'SELECT * FROM Employee';

ADODataSet1.RecordSet := RDSConnection1.GetRecordset(ADODataSet1.CommandText, '');


Scope

Published

Protected

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TCustomConnection


TAbstractSocket

Hierarchy	Properties	Methods	See also

TAbstractSocket is the abstract base class for all socket components.

Unit

scktcomp

Description

TAbstractSocket introduces properties and methods to enable an application to work with Windows sockets. A Windows socket encapsulates a set of communication protocols to allow the application to connect to other machines for reading or writing information. Windows sockets provide connections based on the TCP/IP protocol. They also allow connections that use the Xerox Network System (XNS), Digital’s DECnet protocol, or Novell’s IPX/SPX family. Sockets allow an application to form connections to other machines without being concerned with the details of the actual networking software.

The properties of TAbstractSocket describe the IP address of the socket and service it provides or seeks. Not all descendants of TAbstractSocket use all of these properties. For example, server sockets do not surface the IP address because it is read implicitly from the system running the application.

Do not create instances of TAbstractSocket. Use a descendant of TAbstractSocket to add the ability to communicate with other machines to an application. To create a socket that initiates the connection with another machine, use TClientSocket. To create a socket that responds to requests for connections from other machines, use TServerSocket.


TAbstractSocket properties

TAbstractSocket	Alphabetically	Legend

In TAbstractSocket

Active

Address

Host

Port

Service

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TAbstractSocket properties

TAbstractSocket	By object	Legend

Active

Address

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Host

Name

Owner

Port

Service

Tag

VCLComObject


TAbstractSocket.Active

TAbstractSocket	See also	Example

Indicates whether the socket connection is open and available for communication with other machines.

property Active: Boolean;

Description

Before attempting to use or change the socket connection, read Active to determine whether the connection is open and ready. For client sockets, setting Active opens or shuts down a socket connection to another machine. For server sockets, setting Active opens or shuts down a listening connection that makes the socket available for client requests.

At design time, set Active to True to make the socket open a connection when the application starts running. At runtime, use the Open or Close method to open or close the connection.


TAbstractSocket.Address

TAbstractSocket	See also

Specifies the IP address of the server system.

property Address: string;

Description

Address is a string of four numeric (byte) values in the standard internet dot notation, such as

123.197.1.2

For client sockets, set Address to the IP address of the server to which the socket should connect. When the connection is opened, the value of Address is bound to the connection.

If the socket specifies the Host property, the address for the connection is taken from the IP address associated with Host, rather than the value of Address. Specifying the server system by giving the IP address is faster, because the socket doesn’t need to search for the IP address associated with the host name before it can locate the server system.

A single system may support more than one IP address.

Note:	Trying to change Address when the connection is open will raise an ESocketError exception.


TAbstractSocket.Host

TAbstractSocket	See also

Specifies an alias for the IP address of the server system.

property Host: string;

Description

Host is a string containing the domain name and service of a particular system, such as

http://www.wSite.Com

For client sockets, set Host to the system with which the client socket should form a connection. When the socket opens a connection, it looks up the IP address for the server socket using the value of Host.

Some servers change the system or IP address that is associated with a particular host name. Using a host name allows the client socket to find the abstract site represented by the host name, even when it has moved to a new IP address.

If Host is set, it takes precedence over the Address property when looking up the address of the server.

Note:	Trying to change Host when the connection is open will raise an ESocketError exception.


TAbstractSocket.Port

TAbstractSocket	See also

Specifies the ID number that identifies the server socket connection.

property Port: Integer;

Description

Port numbers allow a single system, identified by the Host or Address property, to host multiple connections simultaneously. Many values of Port are associated by convention with a particular service such as ftp or http.

For server sockets, Port is the ID of the connection on which the server socket listens for client requests. Server sockets generally set Port to a predefined value which clients can use to initiate connections.

For client sockets, Port is the ID of the desired server connection. The value of Port is usually associated with the service the client wishes to use on the server application.

Note:	Trying to change Port when the connection is open will raise an ESocketError exception.


TAbstractSocket.Service

TAbstractSocket	See also

Specifies the name of the service for which the socket connection is used.

property Service: string;

Description

Use Service to identify the use of the connection. Windows provides a number of standard service names such as ftp, http, finger, and time. Servers can specify additional services and their associated ports in a SERVICES file. For more information, see the Microsoft documentation for Windows sockets.

Certain port numbers are reserved for specific values of service. Thus, Service provides a more meaningful way to specify the server Port to use for the socket connection. For server sockets, using Service rather than Port ensures that the server will listen for TCP/IP requests on the appropriate port.

Note:	Trying to change Service when the connection is open will raise an ESocketError exception.


TAbstractSocket methods

TAbstractSocket	Alphabetically	Legend

In TAbstractSocket

Close

DoActivate

Error

Event

InitSocket

Loaded

Open

SetActive

SetAddress

SetHost

SetPort

SetService

Derived from TComponent

Create

Destroy

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TAbstractSocket methods

TAbstractSocket	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DoActivate

Error

Event

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InitSocket

InsertComponent

InstanceSize

Loaded

MethodAddress

MethodName

NewInstance

Open

RemoveComponent

SafeCallException

SetActive

SetAddress

SetHost

SetPort

SetService

UpdateAction


TAbstractSocket.Close

TAbstractSocket	See also

Shuts down the socket connection.

procedure Close;

Description

Call Close to shut down the socket connection. Close sets the Active property to False.

For client sockets, Close terminates the connection to the server. For server sockets, Close shuts down the connection so that the server socket is no longer listening for client requests.


TAbstractSocket.DoActivate

TAbstractSocket	See also

Provides the abstract prototype of a method to open or close the socket connection.

procedure DoActivate(Value: Boolean); virtual; abstract;

Description

Descendants of TAbstractSocket override DoActivate to provide a method that initiates or terminates the socket connection. The steps that need to be taken to open or close a connection depend on whether the socket is a client socket or a server socket.


TAbstractSocket.Error

TAbstractSocket	See also

Provides the abstract prototype of a method that responds to error conditions.

type TErrorEvent = {eeGeneral, eeSend, eeReceive, eeConnect, eeDisconnect, eeAccept)};

procedure Error(Socket: TCustomWinSocket; ErrorEvent: TErrorEvent; var ErrorCode: Integer); virtual; abstract;

Description

Descendants of TAbstractSocket must override the abstract Error method to provide a response when socket errors occur. Applications cannot call Error. The Windows socket object that encounters the error condition calls Error automatically.

The Socket parameter indicates the Windows socket object that encounters the error condition.

The ErrorEvent parameter indicates what the socket was trying to do when the error occurred. It has one of the following values:

Value	Meaning

eeGeneral	The socket received an error message that does not fit into any of the following categories.

eeSend	An error occurred when trying to write to the socket connection.

eeReceive	An error occurred when trying to read from the socket connection.

eeConnect	For client sockets, this indicates that the client socket can’t locate the server, or that a problem on the server prevents the opening of a connection. For server sockets, this indicates that a client connection request that has already been accepted could not be completed.

eeDisconnect	An error occurred when trying to close a connection.

eeAccept	For server sockets only, this indicates that a problem occurred when trying to accept a client connection request.

The ErrorCode parameter is the error code received by the Windows socket object. Setting this value to 0 in the Error method prevents the socket from raising an exception. For information on possible error codes, see the Microsoft documentation on Windows sockets.


TAbstractSocket.Event

TAbstractSocket	See also

Provides the abstract prototype of a method that responds when specific socket events occur.

procedure Event(Socket: TCustomWinSocket; SocketEvent: TSocketEvent); virtual; abstract;

Description

Descendants of TAbstractSocket must override the abstract Event method to provide a response to calls that arise during the normal functioning of the socket. Applications cannot call Event. The Windows socket object calls Event at appropriate times.

The Socket parameter indicates the Windows socket object that calls Event to indicate when specific events occur.

The SocketEvent parameter indicates the event that occurred. It has one of the following values:

Value	Meaning

seLookup	(client sockets only) The Windows socket object is about to locate the server socket. Changing the properties of the client socket has no effect at this point, but changes to the Windows socket object specified by the Socket parameter will affect the attempted connection.

seConnecting	(client sockets only) The server socket has been located but the connection isn’t completed. This is the first opportunity to obtain the actual server port and IP address used for the connection, which may differ from those of the listening socket contacted initially.

seConnect	The socket connection has just been established. This is the point when a socket starts reading or writing over the connection.

seListen	(server sockets only) The Windows socket object has been initialized and is about to open a listening connection. Changing the properties of the server socket has no effect at this point, but changes to the Windows socket object specified by the Socket parameter will the listening connection.

seAccept	(server sockets only) A client connection request has just been accepted. This is the first opportunity to obtain the port and IP address of the individual client connection.

seWrite	The socket is ready for information to be written.

seRead	The socket is receiving information from a socket on the other end of the connection.


TAbstractSocket.InitSocket

TAbstractSocket	See also

Tells a Windows socket object to call the Error and Event methods.

procedure InitSocket(Socket: TCustomWinSocket);

Description

Applications cannot call this protected method. InitSocket is called automatically by the socket’s constructor, immediately after the Windows socket object is created. It allows the socket component to respond to events on the Windows socket object by assigning an OnErrorEvent handler that calls Error and an OnSocketEvent handler that calls Event.

The Socket parameter specifies the Windows socket object that passes events on to the socket component.


TAbstractSocket.Loaded

TAbstractSocket	See also

Opens or closes the socket connection when the socket is loaded from a file, depending on the saved value of the Active property.

procedure Loaded; override;

Description

Applications cannot call this protected method. Loaded is called automatically after the socket component has been loaded from a stream. Loaded overrides the default method to implement the value of the Active property that was saved with the socket component.


TAbstractSocket.Open

TAbstractSocket	See also

Opens the socket connection.

procedure Open;

Description

Call Open to initiate the socket connection. Open sets the Active property to True.

For client sockets, Open locates and connects to a server. For server sockets, Open opens the socket connection in a listening mode, but does not complete the connection to a client socket.


TAbstractSocket.SetActive

TAbstractSocket	See also

Sets the Active property.

procedure SetActive(Value: Boolean);

Description

SetActive is the protected implementation of the Active property. SetActive calls the DoActivate method to open or close the socket connection.


TAbstractSocket.SetAddress

TAbstractSocket	See also

Sets the Address property.

procedure SetAddress(Value: string);

Description

SetAddress is the protected implementation of the Address property. SetAddress raises an ESocketError exception if an attempt is made to set the Address property when the socket connection is open.


TAbstractSocket.SetHost

TAbstractSocket	See also

Sets the Host property.

procedure SetHost(Value: string);

Description

SetHost is the protected implementation of the Host property. SetHost raises an ESocketError exception if an attempt is made to set the Host property when the socket connection is open.


TAbstractSocket.SetPort

TAbstractSocket	See also

Sets the Port property.

procedure SetPort(Value: Integer);

Description

SetPort is the protected implementation of the Port property. SetPort raises an ESocketError exception if an attempt is made to set the Port property when the socket connection is open.


TAbstractSocket.SetService

TAbstractSocket	See also

Sets the Service property.

procedure SetService(Value: string);

Description

SetService is the protected implementation of the Service property. SetService raises an ESocketError exception if an attempt is made to set the Service property when the socket connection is open.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent


TActiveForm

Hierarchy	Properties	Methods	Events	See also

TActiveForm is the base class for a VCL Form exposed as an ActiveX control. TActiveForm represents a form that is created via a class factory and used as an ActiveX control in ActiveX host applications.

Unit

axctrls

Description

A TActiveForm object is used to create a form ActiveX control that can be displayed and run from within Web browsers. This object is created by TActiveFormControl. It is a descendant of this class that you design in the Form Designer when you create an ActiveForm.


TActiveForm properties

TActiveForm	Alphabetically	Legend

In TActiveForm

ActiveFormControl

Derived from TCustomActiveForm

AxBorderStyle

Derived from TCustomForm

Active

ActiveControl

ActiveOleControl

BorderStyle

Canvas

ClientRect

Designer

DropTarget

Floating

FormState

HelpFile

KeyPreview

Menu

ModalResult

OldCreateOrder

OleFormObject

Parent

PixelsPerInch

PrintScale

Scaled

Visible

WindowState

Derived from TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

BevelEdges

BevelInner

BevelKind

BevelOuter

BevelWidth

BorderWidth

Brush

ClientOrigin

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

AutoSize

BiDiMode

BoundsRect

Caption

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TActiveForm properties

TActiveForm	By object	Legend

Action

Active

ActiveControl

ActiveFormControl

ActiveOleControl

Align

Anchors

AutoScroll

AutoSize

AxBorderStyle

BevelEdges

BevelInner

BevelKind

BevelOuter

BevelWidth

BiDiMode

BorderStyle

BorderWidth

BoundsRect

Brush

Canvas

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

Designer

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DropTarget

Enabled

Floating

FloatingDockSiteClass

Font

FormState

Handle

Height

HelpContext

HelpFile

Hint

HorzScrollBar

HostDockSite

KeyPreview

Left

LRDockWidth

Menu

ModalResult

Name

OldCreateOrder

OleFormObject

Owner

Parent

ParentWindow

PixelsPerInch

PopupMenu

PrintScale

Scaled

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

VertScrollBar

Visible

VisibleDockClientCount

Width

WindowProc

WindowState


TActiveForm.ActiveFormControl
TActiveForm.::ActiveFormControl

TActiveForm

Pointer to the ActiveFormControl object.

property ActiveFormControl: TActiveFormControl;

Description

Use ActiveFormControl to access the object that implements all the ActiveX interfaces for this ActiveForm. ActiveFormControl creates the TActiveForm object.


TActiveForm events

TActiveForm	Alphabetically	Legend

Derived from TCustomForm

OnActivate

OnCreate

OnDeactivate

OnDestroy

OnPaint

Derived from TWinControl

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnMouseDown

OnMouseMove

OnMouseUp


TActiveForm events

TActiveForm	By object	Legend

OnActivate

OnClick

OnCreate

OnDblClick

OnDeactivate

OnDestroy

OnDragDrop

OnDragOver

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnPaint


TActiveForm methods

TActiveForm	Alphabetically

Derived from TCustomActiveForm

Create

WantChildKey

Derived from TCustomForm

AfterConstruction

BeforeDestruction

Close

CloseQuery

CreateNew

DefaultHandler

DefocusControl

Destroy

Dock

FocusControl

GetFormImage

Hide

IsShortCut

MouseWheelHandler

Print

Release

SendCancelMode

SetFocus

SetFocusedControl

Show

ShowModal

Derived from TScrollingWinControl

DisableAutoRange

EnableAutoRange

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollbar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TActiveForm methods

TActiveForm	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

Close

CloseQuery

ContainsControl

ControlAtPos

Create

CreateNew

CreateParented

CreateParentedControl

DefaultHandler

DefocusControl

Destroy

DestroyComponents

Destroying

DisableAlign

DisableAutoRange

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EnableAutoRange

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

FocusControl

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetFormImage

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

IsShortCut

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Print

Realign

Refresh

Release

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendCancelMode

SendToBack

SetBounds

SetFocus

SetFocusedControl

SetTextBuf

Show

ShowModal

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollbar

WantChildKey


Description

Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TScrollingWinControl

TCustomForm

TCustomActiveForm


TAdapterNotifier

Hierarchy	Properties	Methods	See also

TAdapterNotifier provides the binding between a Delphi type object and comparable OLE type object.

Unit

axctrls

Description

Descendants of TCustomAdapter use TAdapterNotifier to bind Delphi objects with corresponding OLE objects. For example, TFontAdapter uses TAdapterNotifier to bind a TFont object with an OLE font object.


TAdapterNotifier properties

TAdapterNotifier	Alphabetically	Legend

Derived from TInterfacedObject

RefCount


TAdapterNotifier properties

TAdapterNotifier	By object	Legend

RefCount


TAdapterNotifier methods

TAdapterNotifier	Alphabetically

In TAdapterNotifier

Create

Derived from TInterfacedObject

AfterConstruction

BeforeDestruction

NewInstance

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

SafeCallException


TAdapterNotifier methods

TAdapterNotifier	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TAdapterNotifier.Create

TAdapterNotifier	See also

Creates an instance of a TAdapterNotifier object.

constructor Create(Adapter: TCustomAdapter);

Description

You would normally never create an object of this class.  TAdapterNotifier objects are created by and bound to a descendant of TCustomAdapter.


Accessibility

Read-only


Hierarchy

TObject

TInterfacedObject


TActiveFormControl

Hierarchy	Properties	Methods	See also

A COM object which provides the interfaces necessary to support an ActiveX control.

Unit

axctrls

Description

TActiveFormControl acts as the bridge between a Delphi form and the ActiveX control API. It is a descendant of TActiveXControl which implements the necessary interfaces for an ActiveX control. It forwards the appropriate information to the ActiveForm.

This object is used internally by the DAX framework. Normally, you would not create an instance of this class.


TActiveFormControl properties

TActiveFormControl	Alphabetically	Legend

Derived from TActiveXControl

ClientSite

Control

InPlaceSite

Derived from TComObject

Controller

Factory

RefCount

ServerExceptionHandler


TActiveFormControl properties

TActiveFormControl	By object	Legend

ClientSite

Control

Controller

Factory

InPlaceSite

RefCount

ServerExceptionHandler


TActiveFormControl methods

TActiveFormControl	Alphabetically

In TActiveFormControl

FreeOnRelease

InitializeControl

Invoke

ObjQueryInterface

Derived from TActiveXControl

Destroy

Initialize

PropChanged

PropRequestEdit

Derived from TComObject

Create

CreateAggregated

CreateFromFactory

ObjAddRef

ObjRelease

SafeCallException

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TActiveFormControl methods

TActiveFormControl	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateAggregated

CreateFromFactory

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

Initialize

InitializeControl

InitInstance

InstanceSize

Invoke

MethodAddress

MethodName

NewInstance

ObjAddRef

ObjQueryInterface

ObjRelease

PropChanged

PropRequestEdit

SafeCallException


TActiveFormControl.FreeOnRelease

TActiveFormControl

Supports the IVCLComObject interface.

procedure FreeOnRelease;

Description

FreeOnRelease exists solely to support the IVCLComObject and is not implemented.


TActiveFormControl.InitializeControl

TActiveFormControl

Creates the TActiveForm instance and establishes a link between itself and the TActiveForm referenced by the control properties.

procedure InitializeControl; override;

Description

InitializeControl also instructs the TActiveForm object to perform any of its own initialization.


TActiveFormControl.Invoke

TActiveFormControl

Implements the OLE Automation IDispatch Invoke function.

function Invoke(DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult; override;

Description

Call Invoke to access the property or method specified by the DispID parameter. The Flags parameter indicates whether the DispID refers to method (DISPATCH_METHOD), a property value that is being read (DISPATCH_PROPERTYGET), or a property value that is being set (DISPATCH_PROPERTYPUT or DISPATCH_PROPERTYPUTREF).  The Params and ExcepInfo parameters hold parameters and exception information, respectively, and depend on the property or method identified by the DispID parameter.

Invoke returns S_OK if it is successful.  Otherwise, it returns an error code defined by the IDispatch interface.


TActiveFormControl.ObjQueryInterface

TActiveFormControl	See also

The ObjQueryInterface method takes an interface ID (the IID parameter) and returns the requested COM interface on the object.

function ObjQueryInterface(const IID: TGUID; out Obj): HResult; override;

Description

The ObjQueryInterface method forwards the call first to the associated TActiveForm object if it supports the requested interface, otherwise it queries its own interface.


Accessibility

Read-only


Hierarchy

TObject

TComObject

TTypedComObject

TAutoObject

TActiveXControl


TActiveFormFactory

Hierarchy	Properties	Methods	See also

The ActiveFormFactory object is the class factory for TActiveForm.

Unit

axctrls

Description

The ActiveFormFactory object is the class factory resposible for creating instances of the TActiveFormControl object and therefore TActiveForm object.

The ActiveForm wizard adds an ActiveForm factory object in the initialization section of the unit that defines the ActiveForm.


TActiveFormFactory properties

TActiveFormFactory	Alphabetically	Legend

Derived from TActiveXControlFactory

MiscStatus

ToolboxBitmapID

WinControlClass

Derived from TAutoObjectFactory

DispIntfEntry

DispTypeInfo

EventIID

EventTypeInfo

Derived from TComObjectFactory

ClassID

ClassName

ComClass

ComServer

Description

ErrorIID

Instancing

LicString

ProgID

ShowErrors

SupportsLicensing

ThreadingModel


TActiveFormFactory properties

TActiveFormFactory	By object	Legend

ClassID

ClassName

ComClass

ComServer

Description

DispIntfEntry

DispTypeInfo

ErrorIID

EventIID

EventTypeInfo

Instancing

LicString

MiscStatus

ProgID

ShowErrors

SupportsLicensing

ThreadingModel

ToolboxBitmapID

WinControlClass


TActiveFormFactory methods

TActiveFormFactory	Alphabetically

In TActiveFormFactory

GetIntfEntry

Derived from TActiveXControlFactory

AddVerb

Create

Destroy

UpdateRegistry

Derived from TTypedComObjectFactory

ClassInfo

GetInterfaceTypeInfo

Derived from TComObjectFactory

CreateComObject

RegisterClassObject

Derived from TObject

AfterConstruction

BeforeDestruction

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TActiveFormFactory methods

TActiveFormFactory	By object

AddVerb

AfterConstruction

BeforeDestruction

ClassInfo

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateComObject

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetInterfaceTypeInfo

GetIntfEntry

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RegisterClassObject

SafeCallException

UpdateRegistry


TActiveFormFactory.GetIntfEntry

TActiveFormFactory	See also

Retrieves a pointer to the dispatch interface.

function GetIntfEntry(Guid: TGUID): PInterfaceEntry; override;

Description

The GetIntfEntry method obtains an interface, if it exists, from the TActiveForm class. This is an internal method of the DAX framework.


Accessibility

Read-only


Hierarchy

TObject

TComObjectFactory

TTypedComObjectFactory

TAutoObjectFactory

TActiveXControlFactory


TAggregatedObject

Hierarchy	Properties	Methods	See also

TAggregatedObject provides the functionality for an inner object of an aggregate by implementing the IUnknown methods to delegate to the controlling IUnknown.

Unit

axctrls

Description

An aggregated COM object is an object composed of several COM objects. Each object implements its own behavior and interfaces, but all of the objects share the same reference count, which is that of the controller object. In the container pattern, the controller is the container object.

TAggregatedObject does not itself support any interfaces. However, as is typical of an aggregate, it does implement the methods of IUnknown, which are used by the objects it contains. TAggregatedObject, therefore, serves as a base for classes that implement interfaces for creating objects that are part of an aggregate.

In the Delphi class hierarchy, TAggregatedObject is used as a base for classes that create contained objects and connecting objects. Using TAggregatedObject ensures that calls to the IUknown methods delegate to the controlling IUnknown of the aggregate.

The controlling IUknown is specified in the constructor for TAggregatedObject and is indicated by the Controller property.

For more information about aggregation, controlling objects, and interfaces, see the Inside OLE, second edition, by Kraig Brockschmidt, the Microsoft Web site, or the Windows SDK Help.


TAggregatedObject properties

TAggregatedObject	Alphabetically	Legend

In TAggregatedObject

Controller


TAggregatedObject properties

TAggregatedObject	By object	Legend

Controller


TAggregatedObject.Controller

TAggregatedObject	See also

Provides access to the IUnknown of the aggregate.

property Controller: IUnknown;

Description

Controller is the IUnknown interface reference of the aggregate. TAggregatedObject is used as part of an aggregate that has a single controlling IUnknown. The IUnknown methods that are implemented in aggregated objects are delegated to the Controller.

When the aggregated object is created, its constructor is passed a controlling IUnknown. Controller is initialized to this IUnknown in the constructor.


TAggregatedObject methods

TAggregatedObject	Alphabetically

In TAggregatedObject

Create

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TAggregatedObject methods

TAggregatedObject	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TAggregatedObject.Create

TAggregatedObject	See also

Instantiates an aggregated object.

constructor Create(Controller: IUnknown);

Description

Call Create to instantiate an aggregated object at runtime.

Create allocates memory for an aggregated object and sets the Controller property to the Controller parameter passed to it. The Controller is the controlling IUnknown of the aggregate. All other interfaces implemented in the aggregate will delegate the IUnknown method calls to this Controller.


Accessibility

Read-only


Hierarchy

TObject


TWebActionItem

Hierarchy	Properties	Methods	Events	See also

TWebActionItem allows a Web server application to create and send responses to HTTP request messages.

Unit

httpapp

Description

Use TWebActionItem to assemble the response to a particular type of HTTP request message in a Web server application. Each action item is specific to a particular URI path and HTTP request method.

The web dispatcher chooses an appropriate action item to handle an HTTP request message by

 	matching the path portion of the URI requested by the Web client with the PathInfo property in the TWebActionItem object

matching the method requested by the Web client with the method type the action item knows how to handle.

An action item handles an HTTP request message automatically using an associated content producer or using its OnAction event handler. The OnAction event handler can read the request message and assemble a response by setting the properties of a TWebResponse object. It can tell the TWebResponse object to send the response message back to the Web client, or allow the TWebApplication object to send the message after other action items have had a chance to add to the response.


TWebActionItem properties

TWebActionItem	Alphabetically	Legend

In TWebActionItem

Default

DisplayName

Enabled

MethodType

Name

PathInfo

Producer

Derived from TCollectionItem

Collection

ID

Index


TWebActionItem properties

TWebActionItem	By object	Legend

Collection

Default

DisplayName

Enabled

ID

Index

MethodType

Name

PathInfo

Producer


TWebActionItem.Default

TWebActionItem	See also

Indicates whether the action item should handle any request that is not handled by another available action item.

property Default: Boolean;

Description

Set Default to True to make this action item the default action in the list of action items maintained by the TWebDispatcher object. TWebDispatcher attempts to match HTTP request messages to action items by matching the MethodType and PathInfo of the target URI. If no match can be found, the TWebDispatcher invokes the default action item, regardless of its MethodType or PathInfo properties.

When an action item is chosen as the default action item, the value of its Enabled property is ignored. Thus, if an action item sets Enabled to False and Default to True, TWebDispatcher will first look for a match with any other action item, even if the PathInfo and MethodType of the default action item match the request perfectly. Then, only after all other action items have been rejected, TWebDispatcher selects the default action item. If the default action item is enabled, it may be selected before all other action items have been considered because the MethodType and PathInfo match the request.

The default action item must be prepared to generate a response to any HTTP request, for any MethodType and PathInfo. This may consist of simply setting a response status code of 404 (the URI could not be matched) or 405 (the requested method is not supported).

Setting Default to True sets the Default property of the previous default action item to False.


TWebActionItem.DisplayName

TWebActionItem	See also

Names an individual action item within a collection of action items.

property DisplayName: string;

Description

Use DisplayName to specify a particular action item in the list of action items maintained by the TCustomWebDispatcher object. When setting the DisplayName property, the new value must not match the DisplayName of any other action item in the list maintained by the TCustomWebDispatcher object. Trying to set the DisplayName to a DisplayName that is already in use raises an exception.


TWebActionItem.Enabled

TWebActionItem	See also

Indicates whether the action item can respond to HTTP request messages that match its MethodType and PathInfo properties.

property Enabled: Boolean;

Description

Set Enabled to False to disable an action item. TWebDispatcher will ignore disabled action items when it looks for an action item to handle a request.

When an action item is chosen as the default action item, the value of its Enabled property is ignored. Thus, if an action item sets Enabled to False and Default to True, TWebDispatcher will first look for a match with any other action item, even if the PathInfo and MethodType of the default action item match the request perfectly. Then, only after all other action items have been rejected, the TWebDispatcher selects the default action item. If the default action item is enabled, it may be selected before all other action items have been considered because the MethodType and PathInfo match the request.


TWebActionItem.MethodType

TWebActionItem	See also

Specifies the type of HTTP request methods the action item knows how to service.

property MethodType: TMethodType;

Description

Set MethodType to indicate the types of requests that are serviced by the action item. TWebDispatcher chooses an action item to handle an HTTP request message when the MethodType of the action item matches the MethodType of the request message. (The PathInfo properties must also match).

Add action items with MethodType set to mtAny to the end of the Actions list of the TWebDispatcher object. That way, any action item that exactly matches a request with a MethodType of mtGet, mtHead, mtPost, or mtPut will be chosen before the mtAny value is matched to the request.


TWebActionItem.Name

TWebActionItem	See also

Identifies an individual action item when it is referenced from other objects.

property Name: string;

Description

Use Name to uniquely specify an individual action item in code anywhere in the application. For action items, Name is equivalent to the DisplayName property. Therefore, when setting the Name property, the new value must not match the DisplayName of any other action item in the list maintained by TCustomWebDispatcher. Trying to set the Name to a DisplayName that is already in use raises an exception.


TWebActionItem.PathInfo

TWebActionItem	See also

Indicates the path portion of the Uniform Resource Identifier (URI) for which the action item handles requests.

property PathInfo: string;

Description

Set PathInfo to the path portion of the URI for the target of any request messages serviced by the action item. TWebDispatcher matches action items to request messages by comparing PathInfo with the path portion of the URI specified as the target of the request. If the PathInfo properties match, and the MethodType matches, TWebDispatcher invokes the action item to respond to the request message.

If the action item has an associated content producer, the value of PathInfo is the name of the producer unless it is explicitly changed.


TWebActionItem.Producer

TWebActionItem	See also

Specifies a content producer that generates the content of response messages when the action item executes.

property Producer: TCustomContentProducer;

Description

Set Producer to associate the action item with a content producer. If Producer is not nil, then when the web dispatcher passes a request message to the action item, the action item sets the Content property of the response message to the value returned by the producer’s Content method. After the content producer has assigned the response’s Content property, the action item receives an OnAction event, where it can optionally set other response properties or send the response message.

If Producer is nil, the action item must use the OnAction event handler to influence the response message.

Note:	Each content producer can be associated with only one action item at a time. Setting the Producer property of one action item causes the Web dispatcher that manages that item to check whether any other action item has its Producer property set to the same component. If another action item was associated with the same producer, its Producer property is changed to nil.


TWebActionItem events

TWebActionItem	Alphabetically	Legend

In TWebActionItem

OnAction


TWebActionItem events

TWebActionItem	By object	Legend

OnAction


TWebActionItem.OnAction

TWebActionItem	See also 	Example

Occurs when TWebDispatcher matches the action item to a newly-arrived HTTP request message.

property OnAction: THTTPMethodEvent;

Description

Write an OnAction event handler to respond to HTTP request messages that match the MethodType and PathInfo properties. OnAction occurs immediately after the response message’s Content property has been initialized by the action item’s Producer property (if Producer is set).

In an OnAction event handler, read Request and perform the requested Method if possible. Set the properties of the Response parameter as appropriate. If the OnAction event handler does not service the response, or if it only partially handles the request and must let another action item finish the response, set the Handled parameter to False.

An OnAction event handler can call the SendRedirect or SendResponse method of Response to send the HTTP response message to the Web client. If the OnAction event handler does not send the response, the Web application will send it after all action items have finished filling in the Response.

Tip:	The OnAction event handler can use descendants of TCustomContentProducer to help assemble the contents of the response message.


TWebActionItem methods

TWebActionItem	Alphabetically

In TWebActionItem

AssignTo

Create

Destroy

Derived from TCollectionItem

GetNamePath

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TWebActionItem methods

TWebActionItem	By object

AfterConstruction

Assign

AssignTo

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TWebActionItem.AssignTo

TWebActionItem	See also

Copies the properties of the action item to another action item.

procedure AssignTo(Dest: TPersistent); override;

Description

To assign the value of one action item to another, use the Assign method of the target action item.

AssignTo enables the Assign method of a target action item to copy the properties of a source action item. AssignTo copies the values of the Default, Enabled, MethodType and PathInfo properties to the Dest parameter if it is an action item. If Dest is not an action item, AssignTo calls the inherited method.


TWebActionItem.Create

TWebActionItem	See also

Creates an instance of TWebActionItem.

constructor Create(Collection: TCollection); override;

Description

Call Create to create a TWebActionItem object at runtime. Action items created in the action editor at design time are instantiated automatically.

After calling the inherited constructor, Create initializes the Enabled property to True, and sets the action item so that it will match any HTTP request targeted to a URI with an empty PathInfo.


TWebActionItem.Destroy

TWebActionItem	See also

Destroys an instance of TWebActionItem.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Action items are destroyed when the TWebActionItems object that manages them calls the Free method.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TCollectionItem


TWebActionItems

Hierarchy	Properties	Methods	See also

TWebActionItems is a collection of TWebActionItem objects.

Unit

httpapp

Description

TCustomWebDispatcher uses TWebActionItems to store and manipulate the individual action items it manages. TWebActionItems provides properties and events to

Add new action items to the collection.

Copy the list of action items from another TWebActionItems.

Get the attributes of specified action items in the collection.

Empty the collection of action items.


TWebActionItems properties

TWebActionItems	Alphabetically	Legend

In TWebActionItems

Items

WebDispatcher

Derived from TCollection

Count

ItemClass


TWebActionItems properties

TWebActionItems	By object	Legend

Count

ItemClass

Items

WebDispatcher


TWebActionItems.Items

TWebActionItems	See also

Lists the TWebActionItem objects stored by this TWebActionItems object.

property Items[Index: Integer]: TWebActionItem; default;

Description

Use Items to get access to the individual action items stored by the TWebActionItems object. Items is an indexed array, where the first action item has index 0, the second action item has index 1, and so on. Use Items with the Count property to iterate over all the action items in the collection.


TWebActionItems.WebDispatcher

TWebActionItems

Provides access to the dispatcher that uses TWebActionItems to store and manipulate its action items.

property WebDispatcher: TCustomWebDispatcher;

Description

Read WebDispatcher to get access to the dispatcher object that uses the collection of action items to respond to HTTP request messages.


TWebActionItems methods

TWebActionItems	Alphabetically

In TWebActionItems

Add

Create

Derived from TCollection

Assign

BeginUpdate

Clear

Delete

Destroy

EndUpdate

FindItemID

GetNamePath

Insert

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TWebActionItems methods

TWebActionItems	By object

Add

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

FindItemID

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TWebActionItems.Add

TWebActionItems	See also

Adds a new action item to the end of the collection.

function Add: TWebActionItem;

Description

Call Add to add an action item to the collection of action items managed by the dispatcher. The new item is added to the end of the Items array. Add returns the action item so that its properties can be set to specify its use.

Because the dispatcher looks through the action items in order when it tries to find an action item to handle an HTTP request message, add any action items that preprocess HTTP requests first. Then add the most specific action items. This way, more general action items will not be matched to request messages before a closer match can be found.


TWebActionItems.Create

TWebActionItems	See also

Creates an instance of TWebActionItems.

type TCollectionItemClass = class of TCollectionItem;

constructor Create(WebDispatcher: TCustomWebDispatcher; ItemClass: TCollectionItemClass);

Description

Do not call the constructor for TWebActionItems. TWebActionItems is tailored to work with TCustomWebDispatcher. The TCustomWebDispatcher object creates TWebActionItems in its own constructor.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


TAppletApplication

Hierarchy	Properties	Methods	See also

TAppletApplication is a singleton class that may contain multiple AppletModules.

Unit

CtlPanel

Description

TAppletApplication is a container for AppletModules.  A global Application variable of type TAppletApplication is declared in the CtlPanel unit.


TAppletApplication properties

TAppletApplication	Alphabetically	Legend

In TAppletApplication

ControlPanelHandle

ModuleCount

Modules

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TAppletApplication properties

TAppletApplication	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ControlPanelHandle

DesignInfo

ModuleCount

Modules

Name

Owner

Tag

VCLComObject


TAppletApplication.ControlPanelHandle

TAppletApplication

This is the window handle to the controlling application.

type THandle = Integer;

property ControlPanelHandle: THandle;

Description

ControlPanelHandle is the handle to the Control Panel or the controlling application (the application which invoked the CplApplet function).


TAppletApplication.ModuleCount

TAppletApplication	See also

Indicates the number of AppletModules available.

property ModuleCount: Integer;

Description

ModuleCount is the number of AppletModules that are available to the controlling application from this AppletApplication.


TAppletApplication.Modules

TAppletApplication	See also

A list of the AppletModules available.

property Modules[Index: Integer]: TAppletModule;

Description

Modules is a list of the AppletModules that are available to the AppletApplication.


TAppletApplication events

TAppletApplication	Alphabetically

Derived from TAppletApplication

OnCount

OnExit

OnInit

OnSetup


TAppletApplication events

TAppletApplication	By object

OnCount

OnExit

OnInit

OnSetup


TAppletApplication.OnCount

TAppletApplication

Occurs when a count of the AppletModules is requested.

type TCountEvent = procedure (Sender: TObject; var AppCount: Integer) of object;

property OnCount: TCountEvent;

Description

The OnCount event occurs when the Application receives a CPL_GETCOUNT message from the controlling application.  It must return the number of AppletModules that are available from this application.  The default is to return ModuleCount, but it may be overridden by changing the value of AppCount;


TAppletApplication.OnExit

TAppletApplication

Occurs when the Application should unload.

type TExitEvent = TNotifyEvent;

property OnExit: TExitEvent;

Description

The OnExit event occurs when the Application receives a CPL_EXIT message from the controlling application.  This is a recommended spot to do non-applet specific clean-up.


TAppletApplication.OnInit

TAppletApplication

Occurs when the Application is first initialized.

type TInitEvent = procedure (Sender: TObject; var AppInitOK: Boolean) of object;

property OnInit: TInitEvent;

Description

The OnInit event occurs when the Application receives a CPL_INIT message from the controlling application. The application must return either a True or False to determine whether the controlling application should attempt to continue loading this module. The default is to return True, but this value may be overridden by assigning a value to AppInitOk.


TAppletApplication.OnSetup

TAppletApplication

Occurs when the applet is invoked from the command line during system installation.

type TSetupEvent = TNotifyEvent;

property OnSetup: TSetupEvent;

Description

This event occurs when the CPL_SETUP message is received from the controlling application. This message is only sent when an applet is invoked from the Command line during system installation.


TAppletApplication methods

TAppletApplication	Alphabetically

In TAppletApplication

Create

CreateForm

Destroy

Initialize

Run

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign


TAppletApplication methods

TAppletApplication	By object

Assign

Create

CreateForm

Destroy

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

Initialize

InsertComponent

RemoveComponent

Run

SafeCallException

UpdateAction


TAppletApplication.Create

TAppletApplication

Instantiates a TAppletApplication object.

constructor Create(AOwner: TComponent); override;

Description

Applications do not need to call the constructor directly. TAppletApplication is instantiated by selecting File | New from the menu of the IDE main window and selecting Applet Application in the New Items dialog. An Application variable of type TAppletApplication is declared and initialized as the instance of the application.


TAppletApplication.CreateForm

TAppletApplication

Creates the Applet object or objects for the applet application.

procedure CreateForm(InstanceClass: TComponentClass; var Reference); virtual;

Description

Do not call CreateForm in an application. Delphi’s module manager calls CreateForm internally to register the applet objects with the applet application.

CreateForm instantiates a TApplet object for each applet contained in the applet application. CreateForm is called automatically, for the first applet module, when the applet application is first created. Subsequently, CreateForm is called for each new applet module added to the application. To add a new applet module, select File | New from the menu of the IDE main window and choose Applet Module in the New Items dialog.


TAppletApplication.Destroy

TAppletApplication	See also

Disposes of an instance of a TAppletApplication object.

destructor Destroy; override;

Description

You do not need to call the destructor directly. TAppletApplication is destroyed when your application closes.

The destructor frees the memory associated with sub-objects.


TAppletApplication.Initialize

TAppletApplication

Sets the initial state of the application and hides any associated MainForm.

procedure Initialize; virtual;

Description

Initialize follows the standard (default) VCL application initialization process.


TAppletApplication.Run

TAppletApplication

Sets the Applications Exception handler.

procedure Run; virtual;

Description

  The Run method of TappletApplication sets the Applications Exception handler.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


TAppletModule

Hierarchy	Properties	Methods	See also

TAppletModule is an encapsulation of a Control Panel Applet.

Unit

CtlPanel

Description

TAppletModule encapsulates the functionality of a Control Panel Applet.


TAppletModule properties

TAppletModule	Alphabetically	Legend

In TAppletModule

AppletIcon

Caption

Data

Help

ResidIcon

ResidInfo

ResidName

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject

Derived from TDataModule

DesignOffset

DesignSize

OldCreateOrder


TAppletModule properties

TAppletModule	By object	Legend

AppletIcon

Caption

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Data

DesignInfo

DesignOffset

DesignSize

Help

Name

OldCreateOrder

Owner

ResidIcon

ResidInfo

ResidName

Tag

VCLComObject


TAppletModule.AppletIcon

TAppletModule	See also

Indicates the icon for the current AppletModule.

property AppletIcon: TIcon;

Description

AppletIcon contains the icon that is associated with the current Applet Module.


TAppletModule.Caption

TAppletModule

Indicates  the caption of the applet module.

property Caption: string;

Description

Caption is the string that shows in the Control Panel under the icon of the Applet.


TAppletModule.Data

TAppletModule

Indicates user-defined data.

property Data: LongInt;

Description

Data is a user defined value that is passed to the controlling application on the OnInquire/OnNewInquire events.


TAppletModule.Help

TAppletModule

Indicates a help string.

property Help: string;

Description

Help is the string that is visible in the status bar of the Control Panel when a particular Applet is selected.


TAppletModule.ResidIcon

TAppletModule

Indicates the resource ID of the icon associated with the applet module.

property ResidIcon: Integer;

 Description

ResidIcon is the resource ID of the icon associated with the applet module.  This property is mutually exclusive with the AppletIcon property.


TAppletModule.ResidInfo

TAppletModule

Indicates the resource ID of the help string.

property ResidInfo: Integer;

Description

ResidInfo is the resource ID of the help string associated with the applet module.  This property is mutually exclusive with the Help property.


TAppletModule.ResidName

TAppletModule

Indicates the resource ID of the caption string.

property ResidName: Integer;

Description

ResidName is the resource ID of the caption string associated with the applet module.  This property is mutually exclusive with the Caption property.


TAppletModule events

TAppletModule	Alphabetically

Derived from TAppletModule

OnActivate

OnInquire

OnNewInquire

OnStartWParms

OnStop

Derived from TDataModule

OnCreate

OnDestroy


TAppletModule events

TAppletModule	By object

OnActivate

OnCreate

OnDestroy

OnInquire

OnNewInquire

OnStartWParms

OnStop


TAppletModule.OnActivate

TAppletModule

Occurs when the applet’s icon is double clicked.

type TActivateEvent = procedure (Sender: TObject; Data: LongInt) of object;

property OnActivate: TActivateEvent read fOnActivate write fOnActivate;

Description

OnActivate is invoked when the Applet icon is double clicked in the Control Panel.  Sender is the Applet Module which was clicked and Data is the value that was set in the Inquire events.


TAppletModule.OnInquire

TAppletModule

Occurs when the AppletModule is queried for its information.

type TInquireEvent = procedure (Sender: TObject; var idIcon: Integer; var idName: Integer; var idInfo: Integer; var lData: Integer) of object;

property OnInquire: TInquireEvent;

Description

OnInquire occurs when the controlling application requests each applets information such as its icon, caption, Help and Data values.  This event populates a structure with the resource ID’s which are changed in this event (such as idIcon, idName, idInfo and ldata).  These values default to the corresponding module properties.


TAppletModule.OnNewInquire

TAppletModule

Occurs when the AppletModule is queried for its information.

type TNewInquireEvent = procedure (Sender: TObject; var lData: Integer; var hIcon: HICON; var AppletName: string; var AppletInfo: string) of object;

property OnNewInquire: TNewInquireEvent;

Description

OnNewInquire occurs when the controlling application requests each applets information such as its Icon, Caption, Help, and Data Values.  This event populates a structure with the values that are changed in this event (such as hIcon, AppletName, AppletInfo, and ldata).  HIcon defaults to the handle of the AppletIcon property.  AppletName defaults to Caption, AppletInfo defaults to Help, and lData defaults to the Data property of the AppletModule.


TAppletModule.OnStartWParms

TAppletModule

Occurs when the AppletModule is invoked from RunDLL.

type StartWParmsEvent  = procedure (Sender: TObject; Params: string) of object;

property OnStartWParms: TStartWParmsEvent read fOnStartWParms write fOnStartWParms;

Description

OnStartWParms parallels the OnActivate event.  Where it differs is that the invocation is coming from RunDLL.  Params may contain extra directions for execution.


TAppletModule.OnStop

TAppletModule

Occurs when the AppletModule is requested to shutdown.

type TStopEvent = procedure (Sender: TObject; Data: LongInt) of object;

property OnStop: TStopEvent;

Description

Write an OnStop event handler to perform Applet-specific clean-up. OnStop occurs when the applet module receives a request to shutdown.

Data is the value that was initialized in OnInquire/OnNewInquire.


TAppletModule methods

TAppletModule	Alphabetically

In TAppletModule

Create

Destroy

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TDataModule

AfterConstruction

BeforeDestruction

CreateNew

Derived from TPersistent

Assign


TAppletModule methods

TAppletModule	By object

AfterConstruction

Assign

BeforeDestruction

Create

CreateNew

Destroy

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction


TAppletModule.Create

TAppletModule

Instantiates a TAppletModule object.

constructor Create(AOwner: TComponent); override;

Description

Create constructs a TAppletModule instance and adds itself to the list of Modules in the TAppletApplication specified as the value of AOwner.


TAppletModule.Destroy

TAppletModuleSee also

Disposes of an instance of a TAppletModule object.

destructor Destroy; override;

Description

The destructor destroys the specified instance of a TAppletModule and removes it from the list of applet modules in the owning TAppletApplication.

Typically, applications do not call Destroy, because the owning TAppletApplication is responsible for freeing them. However, if an Owner is not specified, do not call Destroy directly. Rather, call the Free method.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TDataModule


TWebApplication

Hierarchy	Properties	Methods	See also

TWebApplication encapsulates a Web server application.

Unit

Webbroker

Description

TWebApplication provides the fundamental behavior of a Web server application. TWebApplication provides methods to create TWebRequest and TWebResponse objects that represent HTTP request messages and their responses, pass these objects to the dispatcher so that the response can be filled in, and send the response back to the Web client.

Each Web server project automatically declares an Application variable of type TWebApplication as the instance of the application. For CGI applications, this variable is initialized to a TCGIApplication object in the CGIApp unit. For ISAPI applications, this variable is initialized to a TISAPIApplication object in the ISAPIApp unit.

The Application variable is added to a project by selecting File | New from the menu of the Delphi main window and selecting Web Server Application in the New Items dialog. Do not add the Forms unit to the uses list of the project, because that unit declares a conflicting Application variable of type TApplication. In addition, do not add the ISAPIApp unit to a CGI application or the CGIApp unit to an ISAPI or NSAPI application. The CGIApp unit and the ISAPIApp unit each create the initial instance of the Application variable. Including both units in the uses list causes the memory for the object created in the first unit to be lost.


TWebApplication properties

TWebApplication	Alphabetically	Legend

In TWebApplication

ActiveCount

CacheConnections

InactiveCount

MaxConnections

Title

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TWebApplication properties

TWebApplication	By object	Legend

ActiveCount

CacheConnections

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

InactiveCount

MaxConnections

Name

Owner

Tag

Title

VCLComObject


TWebApplication.ActiveCount

TWebApplication	See also

Indicates the number of active connections currently being serviced by the application.

property ActiveCount: Integer;

Description

Use ActiveCount to monitor the number of HTTP request messages the application is servicing at any one time. Over time, this value provides an indication of the optimal value for the MaxConnections property.

Each time an ISAPI application receives an HTTP request message, it generates a new instance of the Web module. After the response is returned to the Web client, the Web module is either destroyed or deactivated and cached for later reuse. Each active Web module resides in a separate execution thread.

ActiveCount is the number of Web modules currently in use. InactiveCount is the number of deactivated Web modules cached for later reuse. MaxConnections is the maximum number of Web modules that can be active at any time. ActiveCount can never exceed MaxConnections.

Note:	ActiveCount is only meaningful for ISAPI applications. Each CGI application handles only a single request message.


TWebApplication.CacheConnections

TWebApplication	See also

Determines whether the Web modules used by the application are cached for re-use.

property CacheConnections: Boolean;

Description

Each time an ISAPI or NSAPI application receives an HTTP request message, it spawns a thread to handle the request and creates a new Web module that contains instances of all the objects used in the Web application. To improve performance, these Web modules can be saved in a cache when the thread associated with the HTTP request message finishes executing.

Set CacheConnections to True to have the Web application save inactive Web modules in a cache. Caching the Web modules speeds performance as new instances of the Web module and its contents do not need to be created every time a request message is received. Set CacheConnections to False to have the Web application create a new Web module for every request thread. Recreating the Web module ensures that changes made to the module or its contents when servicing the last request do not cause unexpected behavior the next time the module is activated.

Note:	CacheConnections is only relevant to ISAPI and NSAPI Web applications.


TWebApplication.InactiveCount

TWebApplication	See also

Indicates the number of Web modules cached for later reuse.

property InactiveCount: Integer;

Description

Use InactiveCount to monitor the number of unused Web modules. Over time, this value provides an indication of the optimal value for the MaxConnections property.

When CacheConnections is True, each time an ISAPI application receives an HTTP request message, it reactivates one of the inactive Web modules. The application generates a new instance of the Web module if InactiveCount is 0. After the response is returned to the Web client, the Web module is deactivated again, and counted by the InactiveCount property.

When CacheConnections is False, a new Web module is created for each HTTP request message and destroyed when the response is returned. InactiveCount is always 0 when CacheConnections is False.

Note:	InactiveCount is only meaningful for ISAPI applications. Each CGI application handles only a single request message, so there is no need to cache unused data modules.


TWebApplication.MaxConnections

TWebApplication	See also

Specifies the maximum number of request messages the application can handle at any one time.

property MaxConnections: Integer;

Description

Set MaxConnections to adjust the number of HTTP request messages the application can handle simultaneously. Use the ActiveCount and InactiveCount properties to get a sense of the frequency and duration of request messages. Then set MaxConnections so that it is high enough to avoid exceptions when the application runs out of Web modules, but low enough not to degrade performance too severely by running too many simultaneous threads.

If a request message is received when ActiveCount is already at MaxConnections, the application raises an exception.

Note:	MaxConnections is only meaningful for ISAPI applications. Each CGI application handles only a single request message.


TWebApplication.Title

TWebApplication	See also

Contains the text that appears below the icon representing the application when it is minimized.

property Title: string;

Description

Use the Title property to modify the name of this text string appearing below the icon of the application. The default value is taken from the DLL/EXE filename at run-time.

Do not confuse Title with the Name property. Name is the identifier for the Web application when it is referred to in code.


TWebApplication methods

TWebApplication	Alphabetically	Legend

In TWebApplication

ActivateWebModule

Create

CreateForm

DeactivateWebModule

Destroy

DoHandleException

HandleRequest

Initialize

Run

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWebApplication methods

TWebApplication	By object	Legend

ActivateWebModule

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateForm

DeactivateWebModule

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DoHandleException

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HandleRequest

HasParent

InheritsFrom

Initialize

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

Run

SafeCallException


TWebApplication.ActivateWebModule

TWebApplication	See also

Activates a Web module for the application and returns it.

function ActivateWebModule: TDataModule;

Description

ActivateWebModule is called internally when the application receives an HTTP request message. If the InactiveCount property is greater than zero, a cached Web module is reactivated. Otherwise, a new instance of the Web module is created.

Before ActivateWebModule is called, the CreateForm method must be called to register the data module.

A Web application object contains only a single Web module. Usually, that Web module is a TWebModule object, but it may also be an ordinary data module that contains a TWebDispatcher object. If there is no Web module associated with the Web application, ActivateWebModule raises an exception. If the ActiveCount property is already at MaxConnections when ActivateWebModule is called, ActivateWebModule raises an exception.


TWebApplication.Create

TWebApplication	See also

Creates an instance of TWebApplication.

constructor Create(AOwner: TComponent); override;

Description

Do not call Create. The single Web application object named Application is instantiated automatically when the CGIApp unit or the ISAPIApp unit is included in the uses list of the project.

Create allocates the helper objects used by TWebApplication.


TWebApplication.CreateForm

TWebApplication	See also

Registers the single Web module with the Web application.

procedure CreateForm(InstanceClass: TComponentClass; var Reference); virtual;

Description

Do not call CreateForm in an application. Delphi’s module manager calls CreateForm internally to register the Web module for the Web application.

CreateForm registers the class of the Web module for the application. The Web module object is created later when the ActivateWebModule method is called for the first time.


TWebApplication.DeactivateWebModule

TWebApplication	See also

Deactivates the Web module of the application.

procedure DeactivateWebModule(DataModule: TDataModule);

Description

Do not call DeactivateWebModule directly. The Web application calls DeactivateWebModule internally after handling an HTTP request message. When CacheConnections is True, the Web module remains inactive until the next request message is received. When CacheConnections is False, the runtime instance of the Web module is destroyed.


TWebApplication.Destroy

TWebApplication	See also

Destroys an instance of TWebApplication.

destructor Destroy; override;

Description

Never call the Destroy or Free method. The application is freed automatically when the application stops running.

Destroy frees the helper objects that were created at startup, as well as all Web modules created by the application.


TWebApplication.DoHandleException

TWebApplication	See also

Provides the interface for a method that handles exceptions raised within the application.

procedure DoHandleException(E: Exception); dynamic;

Description

The DoHandleException method for TWebApplication discards all exceptions. Descendants of TWebApplication can override this method to provide special responses when exceptions occur within the application.


TWebApplication.HandleRequest

TWebApplication	See also

Responds to an HTTP request message received by the server.

function HandleRequest(Request: TWebRequest; Response: TWebResponse): Boolean;

Description

When a descendant of TWebApplication receives an HTTP request message, it creates a TWebRequest object to represent the message, and a TWebResponse message to match the request. It then calls HandleRequest, passing those objects as the Request and Response parameters.

HandleRequest activates the Web module associated with the Web application. It then passes the request and response objects to the dispatcher, so that it can dispatch the request to the appropriate action items. When the dispatcher returns, HandleRequest checks whether the response was handled but not sent, and if not, sends it. Finally, HandleRequest deactivates the data module.

HandleRequest returns a Boolean value indicating whether the request message was handled and sent.


TWebApplication.Initialize

TWebApplication	See also

Introduces an interface for a method that initializes the application.

procedure Initialize; virtual;

Description

The Initialize method for TWebApplication does nothing. Initialize is the first method called for every Delphi project. Descendants of TWebApplication that must perform any initialization before the application starts running override this method for that purpose.

Note:	Although Initialize is the first method called in the project source code, it is not the first code that is executed in an application.


TWebApplication.Run

TWebApplication	See also

Executes the Web application.

procedure Run; virtual;

Description

When creating a new project, Delphi automatically creates a main program block in the project file that calls the Run method. When the application is executed, the application’s Run method is called.

The Run method for TWebApplication sets up the default error handler and shut down sequence for the application. Descendants of TWebApplication override the Run method to receive HTTP request messages, create the TWebRequest and TWebResponse objects for incoming requests, and call the HandleRequest method to process those requests.


Scope

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent


TAutoObject

Hierarchy	Properties	Methods	See also

TAutoObject is a CoClass that supports the IDispatch interface, and that can be used as a base class for ActiveX Automation servers.

Unit

comobj

Description

TAutoObject is used as a base class for VCL ActiveX control classes and provides support for ActiveX Automation objects.

To create a new Automation object, use the Automation wizard. The steps for creating an Automation object are covered in depth in the Developer’s Guide or in the online document, Developing COM-based applications.

By implementing the IDispatch interface, TAutoObject encapsulates the following functionality:

•	Provides access to properties and methods exposed by an object by calling a method or by accessing a property of a specified dispatch interface (dispinterface), given any necessary parameters.

•	Converts text names of properties and methods (including their arguments) to their corresponding DISPIDs which identify them.

•	Determines whether there is type information available for this dispatch interface.

•	Retrieves the type information for a specified dispatch interface.

TAutoObject requires a type library because it supports dual interfaces, and because it inherits the IProvideClassInfo interface support which requires a type library. TAutoObject has a class factory. For creating automation objects that are used internally and do not need a class factory, use TAutoIntfObject as a base class.

Implemented methods of IDispatch

GetIDsOfNames, GetTypeInfo, GetTypeInfoCount, and Invoke.


TAutoObject properties

TAutoObject	Alphabetically	Legend

In TAutoObject

AutoFactory

EventSink

Derived from TComObject

Controller

Factory

RefCount

ServerExceptionHandler


TAutoObject properties

TAutoObject	By object	Legend

AutoFactory

Controller

EventSink

Factory

RefCount

 	ServerExceptionHandler


TAutoObject.AutoFactory

TAutoObject

The class factory that created this TAutoObject.

property AutoFactory: TAutoObjectFactory;

Description

Factory is the class factory that is used to instantiate a TAutoObject instance.


TAutoObject.EventSink

TAutoObject

The client’s event sink interface through which the client receives events from a server.

property EventSink: IUnknown;

Description

An EventSink is the mechanism through which a client listens for events from an Automation server.

Not all Automation interfaces expose events. The Automation wizard exposes the interface’s events when you set the option, Generate Event Support Code. Event sets are defined as a dispinterface. This allows a container to implement, at compile time, a sink object whose IDispatch can handle any arbitrary dispinterface at run time. The container uses the object's type information to display a list of events to the user or developer, allowing that person to assign actions to those events. The sink maps an event dispID to some action to execute—it does not need to know the semantics of the event itself.


TAutoObject methods

TAutoObject	Alphabetically

In TAutoObject

In TAutoObject

EventConnect

EventSinkChanged

GetIDsOfNames

GetTypeInfo

GetTypeInfoCount

Initialize

Invoke

Derived from TComObject

Create

CreateAggregated

CreateFromFactory

Destroy

ObjAddRef

ObjQueryInterface

ObjRelease

SafeCallException

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TAutoObject methods

TAutoObject	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateAggregated

CreateFromFactory

DefaultHandler

Destroy

Dispatch

EventConnect

EventSinkChanged

FieldAddress

Free

FreeInstance

GetIDsOfNames

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetTypeInfo

GetTypeInfoCount

InheritsFrom

Initialize

InitInstance

InstanceSize

Invoke

MethodAddress

MethodName

NewInstance

ObjAddRef

ObjQueryInterface

ObjRelease

SafeCallException


TAutoObject.EventConnect

TAutoObject

Queries the interface Sink parameter and saves the EventSink.

function EventConnect: Integer;

Description

EventConnect sets the EventSink property by querying the interface Sink parameter that is passed in for events. This method is called only if you set the Generate Event Support Code option of the Automation wizard.


TAutoObject.EventSinkChanged

TAutoObject

TBS.

EventSinkChanged(const EventSink: IUnknown); virtual;

Description

The Automation wizard overrides this method when you set the option, Generate Event Support Code.


TAutoObject.GetIDsOfNames

TAutoObject	See also

Maps a single member and an optional set of argument names to a corresponding set of integer dispatch identifiers (dispIDs).

type HResult = Longint;

function GetIDsOfNames(const IID: TGUID; Names: Pointer; NameCount, LocaleID: Integer; DispIDs: Pointer): HResult; stdcall;

Description

GetIDsOfNames implements the IDispatch interface GetIDsOfNames method. For components that support interfaces, GetIDsOfNames calls this method for the interface supported by the component, passing the specified parameters. The returned value can be used on subsequent calls to the Invoke method.


TAutoObject.GetTypeInfo

TAutoObject	See also

Retrieves the type information for an object.

type HResult = Longint;

function GetTypeInfo(Index, LocaleID: Integer; out TypeInfo): HResult; stdcall;

Description

GetTypeInfo implements the IDispatch interface GetTypeInfo method. For components that support interfaces, GetTypeInfo calls the GetTypeInfo method for the interface supported by the component, passing it the specified parameters.  Use the returned value to get the type information for an interface implemented by the component.


TAutoObject.GetTypeInfoCount

TAutoObject	See also

Returns the number of type information interfaces that an object provides (either 0 or 1).

type HResult = Longint;

function GetTypeInfoCount(out Count: Integer): HResult; stdcall;

Description

GetTypeInfoCount implements the IDispatch interface GetTypeInfoCount method. For components that support interfaces, GetTypeInfoCount calls this method for the interface supported by the component. The out parameter points to a location that receives the number of type information interfaces provided by the object. If the object provides type information, this number is 1; otherwise the number is 0.


TAutoObject.Initialize

TAutoObject

Provides an interface to a method that initializes the Automation object.

procedure Initialize; override;

Description

Initialize currently does nothing. Descendant Automation objects can override Initialize to provide some post-creation initialization of the object.


TAutoObject.Invoke

TAutoObject	See also

Provides access to Automation properties and methods exposed by an object that supports the IDispatch interface.

type HResult = Longint;

function Invoke(DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult; stdcall;

Description

Invoke implements the IDispatch interface Invoke method. Invoke is the standard mechanism for accessing the exposed properties and methods of an Automation object. For components that support interfaces, Invoke calls the Invoke method for the interface supported by the component, passing it the parameters specified by the function.


Accessibility

Read-only


Hierarchy

TObject


TAutoObjectFactory

Hierarchy	Properties	Methods	See also

TAutoObjectFactory is the class factory for TAutoObject.

Unit

comobj

Description

TAutoObjectFactory creates instances of the TAutoObject class, and has methods that manage the functionality of all of the instances of the automation objects it creates.

An Automation object is a COM object, which means that the module in which it is implemented must provide a factory object so that the system can create the Automation object.

TAutoObjectFactory inherits support for the IClassFactory and IClassFactory2 interfaces.

For more information about COM factories, see TComObjectFactory.

To add an Automation object factory to your program, create the factory object in the initialization section of the unit that defines the Automation object.


TAutoObjectFactory properties

TAutoObjectFactory	Alphabetically	Legend

In TAutoObjectFactory

DispIntfEntry

DispTypeInfo

EventIID

EventTypeInfo

Derived from TComObjectFactory

ClassID

ClassName

ComClass

ComServer

Description

ErrorIID

Instancing

LicString

ProgID

ShowErrors

SupportsLicensing

ThreadingModel


TAutoObjectFactory properties

TAutoObjectFactory	By object	Legend

ClassID

ClassName

ComClass

ComServer

Description

DispIntfEntry

DispTypeInfo

ErrorIID

EventIID

EventTypeInfo

Instancing

LicString

ProgID

ShowErrors

SupportsLicensing

ThreadingModel


TAutoObjectFactory.DispIntfEntry

TAutoObjectFactory	See also

Contains the entry for the dispatch interface implemented by the OLE Automation object created by the factory.

property DispIntfEntry: PInterfaceEntry;

Description

DispIntfEntry is initialized in the constructor. It indicates the entry for a dispatch interface.


TAutoObjectFactory.DispTypeInfo

TAutoObjectFactory

Returns an ITypeInfo interface reference to the type information for the dispinterface implemented by the OLE Automation object.

property DispTypeInfo: ITypeInfo;

Description

DispTypeInfo is used to provide type information on the OLE Automation object created by the factory.


TAutoObjectFactory.EventIID

TAutoObjectFactory	See also

Specifies the GUID for the control’s events interface.

property EventIID: TGUID;

Description

EventIID is used internally to create a connection between the control and the events interface.


TAutoObjectFactory.EventTypeInfo

TAutoObjectFactory	See also

Provides an interface to the type information object for the object’s events interface.

property EventTypeInfo: ITypeInfo;

Description

Use this property to obtain type information for the object’s events interface.


TAutoObjectFactory methods

TAutoObjectFactory	Alphabetically

In TAutoObjectFactory

Create

GetIntfEntry

Derived from TTypedComObjectFactory

ClassInfo

GetInterfaceTypeInfo

UpdateRegistry

Derived from TComObjectFactory

CreateComObject

Destroy

RegisterClassObject

Derived from TObject

AfterConstruction

BeforeDestruction

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TAutoObjectFactory methods

TAutoObjectFactory	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateComObject

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetInterfaceTypeInfo

GetIntfEntry

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RegisterClassObject

SafeCallException

UpdateRegistry


TAutoObjectFactory.Create

TAutoObjectFactory	See also

Instantiates a TAutoObjectFactory object.

constructor Create(ComServer: TComServerObject; AutoClass: TAutoClass; const ClassID: TGUID; Instancing: TClassInstancing;
ThreadingModel: TThreadingModel = tmSingle);

Description

Create allocates memory for a TAutoObjectFactory object and calls the inherited Create, passing it the same parameters. Then it initializes the DispIntfEntry and DispTypeInfo properties, raising an EOleError exception on error. The Create sets the ErrorIID property to point to DispIntfEntry.

Class factories should be instantiated in the initialization section of the unit that includes the code for the CoClass they instantiate. Factories are automatically available when the server is loaded.


TAutoObjectFactory.GetIntfEntry

TAutoObjectFactory	See also

Returns the entry for a specific interface implemented in a class.

function GetIntfEntry(Guid: TGUID): PInterfaceEntry; virtual;

Description

GetIntfEntry calls the GetInterfaceEntry method for the CoClass associated with the class factory.

GetIntfEntry returns the entry for the interface, specified by the IID parameter, in the class. GetIntfEntry is used internally. It is rarely called directly.

One use for this method is to describe to OLE how to automatically dispatch calls to a dual-IDispatch interface. An interface type name, such as IUnknown, can be supplied as the IID parameter since the compiler will replace the interface with the associated GUID.


Accessibility

Read-only


Hierarchy

TObject

TComObjectFactory

TTypedComObjectFactory


TAutoIntfObject

Hierarchy	Properties	Methods	See also

TAutoIntfObject supports the IDispatch and ISupportErrorInfo interfaces.

Unit

comobj

Description

TAutoIntfObject is used internally by objects that support dispatch interfaces. By implementing the IDispatch interface, TAutoIntfObject encapsulates the functionality of an Automation object.

TAutoIntfObject does not have a class factory, so it can only be instantiated by calling the constructor. Objects that are externally instantiated typically have a class factory so that they can be instantiated in a standard way.

TAutoIntfObject supports OLE exception handling through its implementation of the ISupportErrorInfo interface.

TAutoIntfObject is similar to TAutoObject in that both classes implement the IDispatch and (directly or indirectly) ISupportErrorInfo interfaces and both require a type library to support dual interfaces. TAutoIntfObject differs from TAutoObject in that it does not have a class factory.

Implemented methods of IDispatch

GetIDsOfNames, GetTypeInfo, GetTypeInfoCount, Invoke.


TAutoIntfObject properties

TAutoIntfObject	Alphabetically	Legend

In TAutoIntfObject

DispIID

DispIntfEntry

DispTypeInfo

Derived from TInterfacedObject

RefCount


TAutoIntfObject properties

TAutoIntfObject	By object	Legend

DispIID

DispIntfEntry

DispTypeInfo

RefCount


TAutoIntfObject.DispIID

TAutoIntfObject

DispIID is the dispatch identifier.

property DispIID: TGUID;

Description

DispIID is used for exception handling.


TAutoIntfObject.DispIntfEntry

TAutoIntfObject	See also

DispIntfEntry contains the entry for the dispatch interface implemented by the automation object.

property DispIntfEntry: PInterfaceEntry;

Description

DispIntfEntry is initialized in the constructor. DispIntfEntry returns the entry for a dispatch interface.


TAutoIntfObject.DispTypeInfo

TAutoIntfObject

DispTypeInfo returns an ITypeInfo interface reference to the type information for the dispinterface implemented by the automation object.

property DispTypeInfo: ITypeInfo;

Description

DispTypeInfo is used to provide type information on the automation object.


TAutoIntfObject methods

TAutoIntfObject	Alphabetically

In TAutoIntfObject

Create

SafeCallException

Derived from TInterfacedObject

BeforeDestruction

AfterConstruction

NewInstance

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName


TAutoIntfObject methods

TAutoIntfObject	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TAutoIntfObject.Create

TAutoIntfObject

Create instantiates an automation interface object.

constructor Create(const TypeLib: ITypeLib; const DispIntf: TGUID);

Description

Do not create instances of TAutoIntfObject. It is intended for internal use only. Create allocates memory for an automation interface object, verifies that a type library exists, and initializes the DispIntfEntry property.


TAutoIntfObject.SafeCallException

TAutoIntfObject

SafeCallException is used for OLE exception handling.

function SafeCallException(ExceptObject: TObject; ExceptAddr: Pointer): HResult; override;

Description

SafeCallException prevents an exception from escaping its scope. Any exceptions raised must also be handled within the method.

The implementation of a safecall method guarantees that no exceptions escape by enclosing the body of the method in an implied try...except block.

Note:	SafeCallException calls the global routine HandleSafeCallException, which provides a standard way of handling this behavior. Methods of a CoClass that supports OLE exception handling (that implements the ISupportErrorInfo interface) are affected by this function. If those CoClass methods use the safecall calling convention, they are modified to return an HRESULT. Procedures will return an HRESULT, and functions will pass their usual result value as the last (out) parameter, and will return an HRESULT instead. The method is enclosed in a try...finally block, after which the HRESULT is returned, and the environment is set up so that the ISupportErrorInfo implementation will work correctly.


Accessibility

Read-only


Hierarchy

TObject

TInterfacedObject


TActiveXControl

Hierarchy	Properties	Methods	See also

TActiveXControl is an abstract class that provides the functionality to embed a VCL control into an ActiveX Container window.

Unit

axctrls

Description

TActiveXControl defines the core behavior and interfaces required of an ActiveX control and connects that behavior to any VCL control derived from TWinControl.  This allows the control to be embedded in any ActiveX container, including Internet Explorer, Visual Basic, PowerBuilder, Paradox, Borland C++, IntraBuilder and, of course, Delphi.

To create a new ActiveX control class, use the ActiveX control wizard.  The steps for building an ActiveX control are covered in the Developer’s Guide or in the online help document, Developing COM-based applications.

The TActiveXControl class is derived from TAutoObject, therefore the object resulting is a COM object that supports COM-based Automation, a type library, and has a factory.  In addition, TActiveXControl implements the following behaviors:

embedding in a container (site)

in-place activation

persistence

events

property pages

property browsing

TActiveXControl is an abstract class, and so cannot be instantiated.  Instead, you must derive a new class from TActiveXControl to implement an ActiveX control. This derived class is called an implementation class.  An implementation class derived from TActiveXControl normally implements an automation interface as well, to specify the object’s properties and methods.

Ordinarily, you do not create an instance of an implementation class directly.  Instead, you create a factory object in the initialization section of the unit that contains the class declaration.  The factory object will then create the ActiveX control object when asked to by the system.

Interfaces

In addition to the interfaces inherited from TAutoObject, TActiveXControl implements the following interfaces:

IPersistStreamInit	IPersistPropertyBag	IOleInPlaceActiveObject

IPersistStorage	IViewObject	IObjectSafety

IOleObject	IViewObject2	ISimpleFrameSite

IOleControl	IPerPropertyBrowsing

IOleInPlaceObject	ISpecifyPropertyPages

Note:	See the DelCtrls demo in ..\ActiveX\Delctrls for an example of using VCL components as ActiveX controls.


TActiveXControl properties

TActiveXControl	Alphabetically	Legend

In TActiveXControl

ClientSite

Control

InPlaceSite

Derived from TComObject

Controller

Factory

RefCount

ServerExceptionHandler


TActiveXControl properties

TActiveXControl	By object	Legend

ClientSite

Control

Controller

Factory

InPlaceSite

RefCount

ServerExceptionHandler


TActiveXControl.ClientSite

TActiveXControl	See also

Contains a pointer to the client site for the container on which the ActiveX control resides.

property ClientSite: IOleClientSite;

Description

ClientSite contains an interface pointer to the object’s client site. Within a compound document, each embedded object has its own client site. The client site is the place where it is displayed and through which it retrieves information about its storage, user interface, and other resources.

Use this property when you need to get client site information from the container.


TActiveXControl.Control

TActiveXControl

Indicates the VCL implementation of the ActiveX control.

property Control: TWinControl;

Description

Control is the VCL control derived from TWinControl that implements the ActiveX control.


TActiveXControl.InPlaceSite

TActiveXControl	See also

Contains a pointer to the site interface for the container on which the ActiveX control resides.

property InPlaceSite: IOleInPlaceSite;

Description

InPlaceSite contains an interface pointer to the container’s IOleInPlaceSite interface when the container supports embedding and in-place activation.  Use this interface to access the windows that contain the activeX object (both the Frame window and the immediate container, or site, window).


TActiveXControl methods

TActiveXControl	Alphabetically	Legend

In TActiveXControl

Destroy

Initialize

ObjQueryInterface

PropChanged

PropRequestEdit

Derived from TComObject

Create

CreateAggregated

CreateFromFactory

ObjAddRef

ObjRelease

SafeCallException

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TActiveXControl methods

TActiveXControl	By object	Legend

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateAggregated

CreateFromFactory

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

Initialize

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ObjAddRef

ObjQueryInterface

ObjRelease

PropChanged

PropRequestEdit

SafeCallException


TActiveXControl.Destroy

TActiveXControl	See also

Destroys an instance of TActiveXControl.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the ActiveX control reference is not nil before calling Destroy. Destroy frees the resources used to turn the Control into an active X control. It does not destroy the object referenced by the Control property.


TActiveXControl.Initialize

TActiveXControl	See also

Creates the class factory and connection object for the TActiveXControl.

procedure Initialize; override;

Description

The Initialize method creates the class factory object and creates and encapsulates the VCL control.


TActiveXControl.ObjQueryInterface

TActiveXControl	See also

Returns a requested COM interface on the object.

function ObjQueryInterface(const IID: TGUID; out Obj): HResult; override;

Description

ObjQueryInterface attempts to locate the interface specified by the IID parameter, and returns it in the Obj parameter. If the requested interface is found and returned, ObjQueryInterface returns S_OK.


TActiveXControl.PropChanged

TActiveXControl

Generates an OnChanged event.

procedure PropChanged(const PropertyName: WideString); overload;

procedure PropChanged(DispID: TDispID); overload;

Description

Call PropChanged when the property specified by the DispID (or PropertyName) parameter changes. PropChanged generates an OnChanged event using the IPropertyNotifySink interface.

When possible, call this procedure with the DispID rather than the PropertyName because it is more efficient. Calling PropChanged with the PropertyName first looks up the DispID from the given PropertyName before generating the event.


TActiveXControl.PropRequestEdit

TActiveXControl

Indicates whether a specified property can be changed.

function PropRequestEdit(const PropertyName: WideString): Boolean; overload;

function PropRequestEdit(DispID: TDispID): Boolean; overload;

Description

Call PropRequestEdit to determine whether the property specified by the DispID (or PropertyName) parameter can be edited. PropRequestEdit uses the IPropertyNotifySink interface to determine whether the property can be changed, and returns True if it can.

When possible, call this function with the DispID rather than the PropertyName because it is more efficient. Calling PropRequestEdit with the PropertyName first looks up the DispID from the given PropertyName before generating the event.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TComObject

TTypedComObject

TAutoObject


TActiveXControlFactory

Hierarchy	Properties	Methods	See also

TActiveXControlFactory is the factory class for ActiveX control objects.

Unit

axctrls

Description

The TActiveXControlFactory class is a factory for ActiveX controls, which are implemented using the TActiveXControl abstract class.

The ActiveX Control wizard adds an ActiveX control factory object in the initialization section of the unit that defines the TActiveXControl object.


TActiveXControlFactory properties

TActiveXControlFactory	Alphabetically	Legend

In TActiveXControlFactory

MiscStatus

ToolboxBitmapID

WinControlClass

Derived from TAutoObjectFactory

DispIntfEntry

DispTypeInfo

EventIID

EventTypeInfo

Derived from TComObjectFactory

ClassID

ClassName

ComClass

ComServer

Description

ErrorIID

Instancing

LicString

ProgID

ShowErrors

SupportsLicensing

ThreadingModel


TActiveXControlFactory properties

TActiveXControlFactory	By object	Legend

ClassID

ClassName

ComClass

ComServer

Description

DispIntfEntry

DispTypeInfo

ErrorIID

EventIID

EventTypeInfo

Instancing

LicString

MiscStatus

ProgID

ShowErrors

SupportsLicensing

ThreadingModel

ToolboxBitmapID

WinControlClass


TActiveXControlFactory.MiscStatus

TActiveXControlFactory

Represents a set of status bits that are stored in the registry.

property MiscStatus: Integer;

Description

MiscStatus is stored in a registry entry under the CLSID entry for the class. This entry provides information about the ActiveX server to a container. The entry contains a set of binary flags for which ActiveX defines specific meanings. This entry is not required.

The following table lists the status bits that ActiveX control containers must recognize and support. For each status bit, it indicates whether container support is required for the feature and includes a brief description.

Status bit	Container support	Description

ACTIVATEWHENVISIBLE	yes	Indicates that the object should be activated when it becomes visible, even if it isn’t UI-active.

IGNOREACTIVATEWHENVISIBLE	no	Needed for inactive and windowless control support.

INSIDEOUT	no	Indicates that the object should be activated inside-out (it can be in-place active as well as UI-active.) Usually used with embedded compound documents rather than with controls.

INVISIBLEATRUNTIME	yes	Designates a control that should be visible at design-time, but not at run-time.

ALWAYSRUN	yes	Indicates that the object should always be in the running state and that the default handler should not delay the loading of the object until the last possible moment.

ACTSLIKEBUTTON	no	Indicates that the object has button-like behavior. This allows the container to ask the control to draw itself as the default button or as a normal button.

ACTSLIKELABEL	no	Indicates that the object behaves like a label. This allows the container to handle the control properly when its label gets focus.

NOUIACTIVATE	yes	Indicates that the control has no user interface to activate.

ALIGNABLE	no	Indicates that the control can be aligned by the user.

SIMPLEFRAME	no	Indicates that the control is a simple holder for other controls.

SETCLIENTSITEFIRST	no	Indicates that the control needs to access the client site very early in its creation.

IMEMODE	no	Indicates that the control supports an Input Method Editor (IME) for entering extended characters. Typically, a container that supports IME provides the control with an extended IMEMode property.


TActiveXControlFactory.ToolboxBitmapID

TActiveXControlFactory	See also

Designates the resource identifier of the ActiveX control.

property ToolboxBitmapID: Integer;

Description

Use ToolboxBitmapID to obtain the resource ID of the bitmap that is used to represent the control on a design palette.


TActiveXControlFactory.WinControlClass

TActiveXControlFactory	See also

WinControlClass is the class of the VCL control that implements the Windows behavior for the ActiveX control.

type TWinControlClass = class of TWinControl;

property WinControlClass: TWinControlClass;

Description

The factory object keeps a reference to the VCL control’s class information so that it can ask the class object to manufacture a VCL control when the ActiveX control is created.


TActiveXControlFactory methods

TActiveXControlFactory	Alphabetically

In TActiveXControlFactory

AddVerb

Create

Destroy

UpdateRegistry

Derived from TAutoObjectFactory

GetIntfEntry

Derived from TTypedComObjectFactory

ClassInfo

GetInterfaceTypeInfo

Derived from TComObjectFactory

CreateComObject

RegisterClassObject

Derived from TObject

AfterConstruction

BeforeDestruction

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TActiveXControlFactory methods

TActiveXControlFactory	By object

AddVerb

AfterConstruction

BeforeDestruction

ClassInfo

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateComObject

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetInterfaceTypeInfo

GetIntfEntry

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RegisterClassObject

SafeCallException

UpdateRegistry


TActiveXControlFactory.AddVerb

TActiveXControlFactory	See also

AddVerb adds a verb to the object’s list of supported verbs.

procedure AddVerb(Verb: Integer; const VerbName: string);

Description

Use AddVerb to add a verb that host applications can apply to the ActiveX control.  In the Verb parameter, pass a number to identify the verb.  User-defined verbs are normally small positive numbers.

In the VerbName parameter, pass the text to display when presenting the user with a choice of verbs.  In some ActiveX (formerly called OLE) containers, the verb text is displayed in a popup menu when the user right-clicks on a control.

Placing an ampersand (&) before a character in this string causes the character to be displayed underlined in a pop-up menu.

ActiveX defines the following commonly used verbs:

VerbName	Verb

OLEIVERB_PRIMARY	0

OLEIVERB_SHOW	–1

OLEIVERB_OPEN	–2

OLEIVERB_HIDE	–3

OLEIVERB_UIACTIVATE	–4

OLEIVERB_INPLACEACTIVATE	–5

OLEIVERB_DISCARDUNDOSTATE	–6

OLEIVERB_PROPERTIES	–7


TActiveXControlFactory.Create

TActiveXControlFactory	See also

Creates and initializes a new TActiveXControlFactory object.

constructor Create(ComServer: TComServerObject; ActiveXControlClass: TActiveXControlClass; WinControlClass: TWinControlClass; const ClassID: TGUID; ToolboxBitmapID: Integer; const LicStr: string; MiscStatus: Integer); ThreadingModel: TThreadingModel;

Description

The ComServer parameter is a pointer to the COM server object for the module containing the property page factory. This is normally a global variable, ComServer, declared in the ComServ unit.

The ActiveXControlClass parameter is the class object for the controller object that implements the ActiveX control. This object should be derived from TActiveXControl.

The WinControlClass parameter is the class object for the VCL control class that implements the Windows behavior of the control. This object should be derived from TWinControl.

The ClassID parameter is the GUID of the ActiveX control. Each COM object should have a unique GUID.

LicStr is the license string for controls created with this factory. LicStr is empty if controls created with this factory are unlicensed. MiscStatus are the status bits that are stored in the registry.

ThreadingModel specifies how calls to the created ActiveX control are serialized. This determines the value of the ThreadingModel property.


TActiveXControlFactory.Destroy

TActiveXControlFactory	See also

Frees the instance of the TActiveXControlFactory.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Factory objects are destroyed automatically when the server shuts down.


TActiveXControlFactory.UpdateRegistry

TActiveXControlFactory	See also

UpdateRegistry adds or removes registry entries for the object.

procedure UpdateRegistry(Register: Boolean); override;

Description

This method is called to add or remove the control from the system registry.  The default behavior of this method is to add normal ActiveX control registry keys, server file information, and type library information to the registry.  It also adds the verbs added with the AddVerb method.

If the Register parameter is True, the control should add its keys to the system registry.  If it is False, the control should remove its keys from the registry.

Override this method if you want your control to store more information in the registry than the base implementation stores.  If you override this method, be sure to call the inherited implementation in the correct order.  When adding registry entries (that is, Register is True), call the inherited method before adding custom entries.  When removing registry entries (that is, Register is False), call the inherited method after removing the custom entries.


Accessibility

Read-only


Hierarchy

TObject

TComObjectFactory

TTypedComObjectFactory

TAutoObjectFactory


TActiveXPropertyPageFactory

Hierarchy	Properties	Methods	See also

TActiveXPropertyPageFactory implements a COM factory for an ActiveX property page.

Unit

axctrls

Description

A property page is a COM object, which means the module it is implemented in must provide a factory so that the system can create the object. TActiveXPropertyPageFactory is a factory for ActiveX property pages, which are implemented by subclassing TPropertyPage.

For more information about COM factories, see TComObjectFactory.

To add a property page factory to a program, create the factory object in the initialization section of the unit that defines the property page form.


TActiveXPropertyPageFactory properties

TActiveXPropertyPageFactory	Alphabetically	Legend

Derived from TComObjectFactory

ClassID

ClassName

ComClass

ComServer

Description

ErrorIID

Instancing

LicString

ProgID

ShowErrors

SupportsLicensing

ThreadingModel


TActiveXPropertyPageFactory properties

TActiveXPropertyPageFactory	By object	Legend

ClassID

ClassName

ComClass

ComServer

Description

ErrorIID

Instancing

LicString

ProgID

ShowErrors

SupportsLicensing

ThreadingModel


TActiveXPropertyPageFactory methods

TActiveXPropertyPageFactory	Alphabetically

In TActiveXPropertyPageFactory

Create

Derived from TComObjectFactory

CreateComObject

Destroy

RegisterClassObject

UpdateRegistry

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TActiveXPropertyPageFactory methods

TActiveXPropertyPageFactory	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateComObject

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RegisterClassObject

SafeCallException

UpdateRegistry


TActiveXPropertyPageFactory.Create

TActiveXPropertyPageFactory	See also

Creates a property page factory and binds that factory to property page class.

constructor Create(ComServer: TComServerObject;ActiveXControlClass: TActiveXControlClass; WinControlClass: TWinControlClass; const ClassID: TGUID; ToolboxBitmapID: Integer);

Description

The ComServer parameter is a pointer to the COM server object for the ActiveX library.  This is normally the global variable, ComServer, declared in the ComServ unit.

The PropertyPageClass parameter is the class object of the property page’s implementing class.  The implementing class must be derived form TPropertyPage.  This class implements the form that is to appear in the property dialog.

The ClassID parameter is a GUID that identifies the property page’s class.  Each property page should have its own GUID.  See the Developer’s Guide for information on how to create a GUID.


Accessibility

Read-only


Hierarchy

TObject

TComObjectFactory


TActiveXPropertyPage

Hierarchy	Properties	Methods	See also

TActiveXPropertyPage represents a COM object that provides the interfaces for supporting an ActiveX property page.

Unit

axctrls

Description

This class is used internally by the TPropertyPage control to provide a bridge between a Delphi form and the ActiveX property page API.


TActiveXPropertyPage properties

TActiveXPropertyPage	Alphabetically	Legend

InTActiveXPropertyPage

PropertyPageImpl

Derived from TComObject

Controller

Factory

RefCount

ServerExceptionHandler


TActiveXPropertyPage properties

TActiveXPropertyPage	By object	Legend

Controller

Factory

PropertyPageImpl

RefCount

ServerExceptionHandler


TActiveXPropertyPage.PropertyPageImpl

TActiveXPropertyPage

The implementation of the COM server portion of the COM object.

property PropertyPageImpl: TPropertyPageImpl;

Description

PropertyPageImpl is the COM server portion of the implementation of the IPropertyPage interface. Applications do not create the TPropertyPageImpl objects; they are created automatically when the user creates an ActiveX control object by using the ActiveX control or ActiveForms wizard.

TActiveXPropertyPage implements the COM server portion of the COM object while TPropertyPageImpl implements the  property page portion.


TActiveXPropertyPage methods

TActiveXPropertyPage	Alphabetically

In TActiveXPropertyPage

Destroy

Initialize

Derived from TComObject

Create

CreateAggregated

CreateFromFactory

ObjAddRef

ObjQueryInterface

ObjRelease

SafeCallException

Derived from TObject

AfterConstruction

BeforeDestruction

ClassName

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TActiveXPropertyPage methods

TActiveXPropertyPage	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateAggregated

CreateFromFactory

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

Initialize

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ObjAddRef

ObjQueryInterface

ObjRelease

SafeCallException


TActiveXPropertyPage.Destroy

TActiveXPropertyPage	See also

Frees the instance of the TActiveXPropertyPage.

destructor Destroy; override;

Description

Do not call Destroy directly in an application.  Instead, call Free. Free checks that the TPropertyPage reference is not nil before calling Destroy.


TActiveXPropertyPage.Initialize

TActiveXPropertyPage 	See also

Initializes the instance of a TActiveXPropertyPage descendant.

procedure Initialize; override;

Description

Override the Initialize method to initialize an instance of a TPropertyPage descendant before it is used.


Accessibility

Read-only


Hierarchy

TObject

TComObject


TCGIApplication

Hierarchy	Properties	Methods	See also

TCGIApplication encapsulates a CGI server application.

Unit

cgiapp

Description

TCGIApplication provides the fundamental behavior of a CGI server application. TCGIApplication starts running when the CGI server receives an HTTP request message. It creates TCGIRequest and TCGIResponse objects to represent the request message and any response that should be sent in return, passes these to the dispatcher so that the response can be filled in, and sends the response if it was not already sent by a TWebActionItem.

Each CGI server project automatically declares an Application variable of type TCGIApplication as the instance of the application. This declaration overrides the Application variable declared in the Forms unit if the CGIApp unit is declared last in the uses list of the project file. Every CGI server application must include the CGIApp unit.

To work with an ISAPI or NSAPI server, use the TISAPIApplication object instead.


TCGIApplication properties

TCGIApplication	Alphabetically	Legend

Derived from TWebApplication

ActiveCount

CacheConnections

InactiveCount

MaxConnections

Title

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCGIApplication properties

TCGIApplication	By object	Legend

ActiveCount

CacheConnections

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

InactiveCount

MaxConnections

Name

Owner

Tag

Title

VCLComObject


TCGIApplication methods

TCGIApplication	Alphabetically

In TCGIApplication

Run

Derived from TWebApplication

Create

CreateForm

Destroy

Initialize

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCGIApplication methods

TCGIApplication	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateForm

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

Initialize

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

Run

SafeCallException


TCGIApplication.Run

TCGIApplication	See also

Run executes the CGI application in response to an HTTP request message.

procedure Run; override;

Description

When creating a new project, Delphi automatically creates a main program block in the project file that calls the Run method. When the application is started in response to an HTTP request message, the CGI application’s Run method is called.

After calling the inherited Run method to set up the default error handler and shut down sequence for the application, TCGIApplication.Run creates the appropriate request and response objects for the HTTP request message that started the CGI application. Run calls the HandleRequest method to pass the request and response on to the dispatcher where the response is filled out and sent. Finally, Run frees the request and response objects.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TWebApplication


TCGIRequest

Hierarchy	Properties	Methods	See also

TCGIRequest represents client request information that is passed to a CGI Web server application.

Unit

cgiapp

Description

Use TCGIRequest to interpret an HTTP request to a CGI server application.

CGI application objects create TCGIRequest objects to capture client requests. The properties of TCGIRequest are obtained from the Web server. The CGI application uses TCGIRequest objects to create corresponding TCGIResponse objects. The TWebDispatcher for the application then invokes the TWebActionItem that is associated with the path portion of the URL of the TCGIRequest object.


TCGIRequest properties

TCGIRequest	Alphabetically	Legend

In TCGIRequest

Accept

Authorization

CacheControl

Connection

Content

ContentEncoding

ContentLength

ContentType

ContentVersion

Cookie

Date

DerivedFrom

Expires

From

Host

IfModifiedSince

Method

PathInfo

PathTranslated

ProtocolVersion

Query

Referer

RemoteAddr

RemoteHost

ScriptName

ServerPort

Title

URL

UserAgent

Derived from TWebRequest

ContentFields

CookieFields

MethodType

QueryFields


TCGIRequest properties

TCGIRequest	By object	Legend

Accept

Authorization

CacheControl

Connection

Content

ContentEncoding

ContentFields

ContentLength

ContentType

ContentVersion

Cookie

CookieFields

Date

DerivedFrom

Expires

From

Host

IfModifiedSince

Method

MethodType

PathInfo

PathTranslated

ProtocolVersion

Query

QueryFields

Referer

RemoteAddr

RemoteHost

ScriptName

ServerPort

Title

URL

UserAgent


TCGIRequest.Accept

TCGIRequest	See also

Represents the value of the Accept header of the HTTP request message.

property Accept: string;

Description

Read Accept to determine the media types the Web client can accept in response to the request. Not every HTTP request message has an Accept header. If the Accept property is not set, then any media type is potentially acceptable in the response.

Accept headers usually indicate that the response should be limited to a small set of desired types. For example, a Web client requesting an audio response might produce a TCGIRequest object with Accept set to the following string:

audio/*; q=0.2, audio/basic

This request indicates that the preferred response media type is audio/basic, but that any audio type is acceptable if it is the best available after an 80% mark-down in quality.

For information on the format of Accept headers, see the current Internet standards documentation.


TCGIRequest.Authorization

TCGIRequest	See also	Example

Represents the value of the Authorization header of the HTTP request message.

property Authorization: string;

Description

Read Authorization to check whether the client that sent the request message has provided the correct authentication information. Authorization allows the CGI application to provided limited access to the resource specified by the URL property.

For more information about HTTP authentication schemes, see the Internet standards documentation.


TCGIRequest.CacheControl

TCGIRequest 	See also

Represents the value of the Cache-Control header of the HTTP request message.

property CacheControl: string;

Description

Read CacheControl to determine any Web client directives that must be obeyed by all caching mechanisms along the request/response chain. The CacheControl directives of the HTTP request do not need to apply to the corresponding response.

The HTTP 1.1 standard defines the following directives for CacheControl:

Value	Meaning

no-cache.	The request may not be cached. The Web server validates the request before the TCGIRequest object is created

max-age=ss	The request is considered invalid if it is older than ss seconds. This directive takes precedence over the Expires property, even if Expires is more restrictive. Invalid requests are validated by the Web server before the TCGIRequest object is created.

max-stale or max-stale=ss	The client is willing to accept a response that has exceeded its expiration time. The max-stale directive can optionally specify the number of seconds by which the response can exceed its expiration time.

min-fresh=ss	The client is not willing to accept a response that expires in less than ss seconds.

no-store	The request contains sensitive information and may not be stored on any permanent medium such as a back-up tape. If the request is stored temporarily in a file, the file must be deleted.


TCGIRequest.Connection

TCGIRequest	See also

Represents the value of the Connection header of the HTTP request message.

property Connection: string;

Description

Read Connection to determine the options requested by the Web client for its connection to the server application. The HTTP 1.1 standard specifies only one value for the Connection header. If the value of Connection is close, then the connection should be closed after the completion of the response.


TCGIRequest.Content

TCGIRequest	See also

Represents the unparsed contents of the HTTP request message.

property Content: string;

Description

Use Content to read the contents of an HTTP request message that is sending information to the server. The value of Content depends on the Method of the HTTP request. When the Method is POST, Content is the unparsed string giving the values to be posted with their associated fields. When the Method is PUT, Content is the value that should replace the URL given by the URL property.

Tip:	When the Method is POST, the parsed version of the post request is available in the ContentFields property.

Note:	If the content of a message is particularly large, it is transferred in chunks. In this case, the Content property does not contain the entire message content. To read the rest of the content, use the ReadClient method.


TCGIRequest.ContentEncoding

TCGIRequest	See also

Represents the value of the Content-Encoding header of the HTTP request message.

property ContentEncoding: string;

Description

Read ContentEncoding to determine what encoding mechanisms, if any, have been applied to the Content of the HTTP request. The encoding mechanisms are listed, separated by commas, in the order in which they are applied by the Web client. Typically, ContentEncoding indicates a compression method or an encoding scheme used to transfer extended ASCII characters over the net.

Reverse the ContentEncoding mechanisms to decode the Content into the form indicated by the ContentType property.


TCGIRequest.ContentLength

TCGIRequest	See also

Represents the value of the Content-Length header of the HTTP request message.

property ContentLength: Integer;

Description

Read the ContentLength property to determine the length of the Content property. ContentLength allows an application to determine the end of the Content property when the ContentType is not text/html. A ContentLength of 0 indicates that the length of the Content property is not determined, either because the request does not include any Content, or because the Web client did not know the length.

Note:	The length of the Content may be less than ContentLength when the Content is passed by chunked transfer coding.


TCGIRequest.ContentType

TCGIRequest	See also

Represents the value of the Content-Type header of the HTTP request message.

property ContentType: string;

Description

Read ContentType to determine the media type of the Content of the HTTP request message. The ContentType is a string of the form Type/SubType.

Most HTTP requests do not require any Content at all. For most requests with a Method that requires a value for Content, the ContentType is text/html. However, HTTP requests for server-specific values of Method can use any media type appropriate to the request.


TCGIRequest.ContentVersion

TCGIRequest	See also

Represents the value of the Content-Version header of the HTTP request message.

property ContentVersion: string;

Description

Read ContentVersion to determine the version of the Content of the HTTP request message. Most HTTP requests do not require any Content at all. When the Method requires a value for Content, the ContentVersion may be set to indicate the version of the source of that content. The format of the ContentVersion depends on the ContentType of the request.


TCGIRequest.Cookie

TCGIRequest	See also

Represents the value of the Cookie header of the HTTP request message.

property Cookie: string;

Description

Use Cookie to read the “cookie” strings provided in the Web client request. Cookie strings are generally used to track state information in a Web application. Usually the value is passed on from a cookie header sent in a previous response message.

Cookie is the unparsed value of the Cookie header. The Cookie header can include multiple fields separated by semicolons (;). Use the CookieFields property to work with the Cookie header on a field-by-field basis.


TCGIRequest.Date

TCGIRequest 	See also

Represents the value of the Date header of the HTTP request message.

property Date: TDateTime;

Description

Read Date to determine the date and time at which the HTTP request message originated. Date can be used to determine whether the Content of the request is still valid. The value of Date is translated into local time as specified in the Windows Control Panel from the time units set by the Web client.

For example, if an HTTP request message specifies a MethodType of mtPost, and Date is older than the most recent values of the fields that are being posted, the server application may return a status code that indicates an error rather than overwriting more recent values.

Date is represented using the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since Dec. 30 1899. The fractional part of a TDateTime value is the fraction of a 24-hour day that has elapsed.


TCGIRequest.DerivedFrom

TCGIRequest	See also

Represents the value of the Derived-From header of the HTTP request message.

property DerivedFrom: string;

Description

Read DerivedFrom to determine the URI where the value of Content originated. DerivedFrom is only meaningful when the request includes a Content property and the Content did not originate with the Web client.


TCGIRequest.Expires

TCGIRequest 	See also

Represents the value of the Expires header of the HTTP request message.

property Expires: TDateTime;

Description

Use Expires to determine whether the request is “stale”. Expires is the date and time at which the request becomes invalid. The value of Expires is translated into local time as specified in the Windows Control Panel from the time units set by the Web client.

If the request has a CacheControl value with a max-age directive, the max-age directive overrides the value of Expires.

Expires is represented using the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since Dec. 30 1899. The fractional part of a TDateTime value is the fraction of a 24-hour day that has elapsed.


TCGIRequest.From

TCGIRequest	See also

Represents the value of the From header of the HTTP request message.

property From: string;

Description

Read From to determine the Internet e-mail address of the human user for whom the Web client sent the HTTP request message. This value can be used for logging purposes, or to contact the originator of the request if problems occur.


TCGIRequest.Host

TCGIRequest	See also

Represents the value of the Host header of the HTTP request message.

property Host: string;

Description

Read Host to determine the Internet host and port number of resource being requested. For example, if the client request specifies the following URL:

http://www.TSite.com/art/gallery.dll/mammals?animal=dog&color=black

The value of Host would be

www.TSite.com

The value of Host can be used to differentiate between internally ambiguous URLs, such as the root “/” URL of a server for multiple host names on a single IP address.


TCGIRequest.IfModifiedSince

TCGIRequest 	See also

Represents the value of the If-Modified-Since header of the HTTP request message.

property IfModifiedSince: TDateTime;

Description

Read IfModifiedSince on a request with a MethodType of mtGet to determine whether the request is conditional. If the information requested by the Web client was not modified since the time indicated by IfModifiedSince, the response should be a not modified error rather than the information indicated by the URL property.

The value of IfModifiedSince is given according to the local clock as specified in the Windows Control Panel, not the clock of the Web client.

IfModifiedSince is represented using the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since Dec. 30 1899. The fractional part of a TDateTime value is the fraction of a 24-hour day that has elapsed.


TCGIRequest.Method

TCGIRequest	See also

Represents the value of the Method header of the HTTP request message.

property Method: string;

Description

Read Method to determine the method that is requested by the Web client. The HTTP 1.1 standard defines the following methods:

Value	Meaning

OPTIONS	A request for information about available communication options.

GET	A request for the information identified by the URL property.

HEAD	A request for information about the properties of the HTTP response, but not for the content of the response.

POST	A request for the server application to post the data included in the Content property, as appropriate.

PUT	A request for the server application to replace the resource indicated by the URL property with the data included in the Content property.

DELETE	A request for the server application to delete or hide the resource identified by the URL property.

TRACE	A request for the server application to send a loop-back to confirm receipt of the request.

The Method property may indicate any other method that the Web client requests of the server. If the Method can’t be matched to the Allow property of a TCGIResponse object, the request can’t be serviced.

The MethodType property indicates whether the value of Method is GET, HEAD, POST, PUT, or one of the other strings. When possible, use MethodType instead of the Method property to save the overhead of string comparison.

Note:	A Web server application need not service all method types. However, there must be a response for the GET and HEAD method requests.


TCGIRequest.PathInfo

TCGIRequest	See also

Indicates the value of the path information (if any) of the URL specified in the HTTP request message.

property PathInfo: string;

Description

Read PathInfo to determine the path on the server machine where the target of the request is found. For example, given this URL:

http://www.TSite.com/art/gallery.dll/mammals?animal=dog&color=black

and assuming that the /gallery.dll part is the Web server application, the PathInfo portion is:

/mammals

The TWebDispatcher object uses the PathInfo to identify the appropriate TWebActionItem for servicing the request message.


TCGIRequest.PathTranslated

TCGIRequest	See also

Represents a translation of the PathInfo property to a fully qualified path on the Web server.

property PathTranslated: string;

Description

Use PathTranslated to refer to the location of the target of the request in an HTTP response.


TCGIRequest.ProtocolVersion

TCGIRequest	See also

Indicates the version number of the HTTP protocol specified in the initial header of the HTTP request message.

property ProtocolVersion: string;

Description

Use ProtocolVersion to determine the protocol used by the Web client when generating the HTTP request message.

Some properties of the HTTP request may be interpreted differently depending on the ProtocolVersion. For example, if ProtocolVersion is 1.0, then the connection should not be considered persistent, even if the Connection property does not specify the close option.


TCGIRequest.Query

TCGIRequest	See also

Indicates the value of the query information (if any) of the URL specified in the HTTP request message.

property Query: string;

Description

Read Query to determine the details of a query specified in the URL of the Web client request. For example, given this URL:

http://www.TSite.com/art/gallery.dll/mammals?animal=dog&color=black

and assuming that the /gallery.dll part is the Web server application, the Query portion is:

animal=dog&color=black

Query is the unparsed query portion of the URL. The query may include multiple fields separated by ampersands (&). Use the QueryFields property to work with the query on a field-by-field basis.


TCGIRequest.Referer

TCGIRequest	See also

Represents the value of the Referer header of the HTTP request message.

property Referer: string;

Description

Read Referer to determine the URI of the resource where the HTTP request message originated. Referer allows the server application to generate back-links to the source of the request. If Referer is a partial URI, it should be interpreted as a relative path to the URL property.

The Referer property is not set when the URL of the HTTP request was obtained from a source that does not have its own URI, such as input from the user keyboard.


TCGIRequest.RemoteAddr

TCGIRequest	See also

Indicates the remote IP address of the client associated with the HTTP request message.

property RemoteAddr: string;

Description

Read RemoteAddr to obtain the IP address of the source of the Web client request.


TCGIRequest.RemoteHost

TCGIRequest	See also

Indicates the fully qualified reverse domain lookup of the client associated with the HTTP request message.

property RemoteHost: string;

Description

Use RemoteHost to compose URI values for back-links to the source of the request when the Referer property is not specified. RemoteHost does not include any path information.


TCGIRequest.ScriptName

TCGIRequest	See also

Indicates the value of the script information (if any) of the URL specified in the HTTP request message.

property ScriptName: string;

Description

Read ScriptName to determine the full path to the Web server application specified by the client request. For example, given this URL:

http://www.TSite.com/art/gallery.dll/mammals?animal=dog&color=black

and assuming that the /gallery.dll part is the Web server application, the ScriptName portion is:

/art/gallery


TCGIRequest.ServerPort

TCGIRequest	See also

Indicates the number of the port on the Web server that receives the HTTP request message.

property ServerPort: Integer;

Description

Read ServerPort to determine the number of the port used in the connection to the Web server. The Host property will include the ServerPort if it is specified as part of the URL for the client request.


TCGIRequest.Title

TCGIRequest	See also

Represents the value of the Title header of the HTTP request message.

property Title: string;

Description

Read Title to determine the Title of the information requested in the Web client request.


TCGIRequest.URL

TCGIRequest	See also

Indicates the Uniform Resource Identifier (URI) specified by the HTTP request message to identify the target of the request.

property URL: string;

Description

Use the URL property to identify the resource the Web client identifies as the target of the request message. URL may be an HTML page to return, a resource to be created or deleted, or an object that provides some other service for the Web client.

The TCGIRequest object parses the URL into its constituent parts, yielding the Host property, the ScriptName property, the PathInfo property, and the Query property.

Note:	Usually the URL property is a Uniform Resource Locator (URL) that can be parsed into host, script, path, and query portions. However, it is possible for HTTP request messages to specify the target in more general terms, as a Uniform Resource Identifier (URI).


TCGIRequest.UserAgent

TCGIRequest	See also

Represents the value of the User-Agent header of the HTTP request message.

property UserAgent: string;

Description

Read UserAgent to obtain information about the user agent originating the client request. Use the UserAgent information for statistical purposes, for tracing protocol violations, and for tailoring responses to known limitations of specific applications that generate client requests. The UserAgent string contains one or more descriptors, in order of significance. Each descriptor gives the name of the product or application that generated the request, or a comment about the user agent.


TCGIRequest methods

TCGIRequest	Alphabetically	Legend

In TCGIRequest

Create

GetDateVariable

GetFieldByName

GetIntegerVariable

GetStringVariable

ReadClient

ReadString

TranslateURI

WriteClient

WriteString

Derived from TWebRequest

Destroy

ExtractContentFields

ExtractCookieFields

ExtractFields

ExtractQueryFields

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCGIRequest methods

TCGIRequest	By object	Legend

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

ExtractContentFields

ExtractCookieFields

ExtractFields

ExtractQueryFields

FieldAddress

Free

FreeInstance

GetDateVariable

GetFieldByName

GetIntegerVariable

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetStringVariable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadClient

ReadString

SafeCallException

TranslateURI

WriteClient

WriteString


TCGIRequest.Create

TCGIRequest	See also

Creates an instance of TCGIRequest.

constructor Create;

Description

Applications shouldn’t need to directly instantiate a CGI request object. The TCGIApplication object creates a TCGIRequest object whenever it receives a client request.


TCGIRequest.GetDateVariable

TCGIRequest	See also

Extracts a date value from the internal table of HTTP header variables.

function GetDateVariable(Index: Integer): TDateTime; override;

Description

GetDateVariable reads date-time values from the header strings of the HTTP request message. The CGI request object uses GetDateVariable to access the properties that represent dates from the HTTP request headers.


TCGIRequest.GetFieldByName

TCGIRequest	See also

Returns the value of the HTTP header variable specified by the Name parameter.

function GetFieldByName(const Name: string): string; override;

Description

Use GetFieldByName to read the value of an HTTP header variable that is not surfaced as one of the properties of TCGIRequest. For information on possible HTTP request header variables, see the current Internet standards documents.


TCGIRequest.GetIntegerVariable

TCGIRequest	See also

Extracts an integer value from the internal table of HTTP header variables.

function GetIntegerVariable(Index: Integer): Integer; override;

Description

GetIntegerVariable reads integer values from the header strings of the HTTP request message. The CGI request object uses GetIntegerVariable to access the properties that represent integers from the HTTP request headers.


TCGIRequest.GetStringVariable

TCGIRequest	See also

Extracts a string value from the internal table of HTTP header variables.

function GetStringVariable(Index: Integer): string; override;

Description

GetStringVariable reads string values from the header strings of the HTTP request message. The CGI request object uses GetStringVariable to access the properties that represent strings from the HTTP request headers.


TCGIRequest.ReadClient

TCGIRequest	See also

Reads Count bytes from the HTTP request into Buffer.

function ReadClient(var Buffer; Count: Integer): Integer; override;

Description

Use ReadClient to load a chunk of information from the contents of an HTTP request into a buffer. ReadClient allows the server application to get the next chunk of information when the content of the request message is too large for the Content property. ReadClient returns the number of bytes actually read. If no more content is available, ReadClient returns -1.


TCGIRequest.ReadString

TCGIRequest	See also

Reads Count bytes from the HTTP request into a string.

function ReadString(Count: Integer): string; override;

Description

Use ReadString to load the next chunk of content information form the HTTP request into a string. ReadString allows the server application to get the next chunk of information when the content of the request message is too large for the Content property.


TCGIRequest.TranslateURI

TCGIRequest	See also

Takes the place of a method for translating URIs into a format usable by the server.

function TranslateURI(const URI: string): string; override;

Description

TranslateURI is used with HTTP request objects to translate the URI specified in a client request into a format that can be used by the server application. As CGI applications work directly with URI values, no translation is necessary.


TCGIRequest.WriteClient

TCGIRequest	See also

Writes Count bytes from Buffer back to the HTTP client.

function WriteClient(var Buffer; Count: Integer): Integer; override;

Description

Use WriteClient to write the contents of a response back to the Web client.  Most applications do not need to use the WriteClient method, because the CGI application object automatically sends the TCGIResponse object back to the client.


TCGIRequest.WriteString

TCGIRequest	See also

Writes the string AString back to the HTTP client.

function WriteString(const AString: string): Boolean; virtual; override;

Description

Use WriteString to write the contents of a response back to the Web client.  Most applications will not need to use WriteString, because the CGI application object automatically sends the TCGIResponse object back to the client.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TWebRequest


TCGIResponse

Hierarchy	Properties	Methods	See also

TCGIResponse represents HTTP messages sent by a CGI application in response to an HTTP request message.

Unit

cgiapp

Description

Use TCGIResponse to specify the response to an HTTP request message in a CGI application.

The CGI application creates a TCGIResponse object based on the TCGIRequest object for an incoming web client request message. The TWebDispatcher for the application then passes the TCGIResponse object to the TWebActionItem associated with the TCGIRequest object. The TWebActionItem sets the properties of the TCGIResponse object.


TCGIResponse properties

TCGIResponse	Alphabetically	Legend

In TCGIResponse

Allow

Content

ContentEncoding

ContentLength

ContentType

ContentVersion

Date

DerivedFrom

Expires

LastModified

Location

LogMessage

Realm

ReasonString

Server

StatusCode

Title

Version

WWWAuthenticate

Derived from TWebResponse

ContentStream

Cookies

CustomHeaders

HTTPRequest


TCGIResponse properties

TCGIResponse	By object	Legend

Allow

Content

ContentEncoding

ContentLength

ContentStream

ContentType

ContentVersion

Cookies

CustomHeaders

Date

DerivedFrom

Expires

HTTPRequest

LastModified

Location

LogMessage

Realm

ReasonString

Server

StatusCode

Title

Version

WWWAuthenticate


TCGIResponse.Allow

TCGIResponse	See also

Lists the HTTP request methods that the application can service.

property Allow: string;

Description

Use Allow to indicate what type of request methods the server application can respond to for the URL specified in the HTTPRequest. Allow is a string of method names, separated by commas. The method names can include any pre-defined methods from the HTTP standard, or any additional methods implemented by the server application. At a minimum, the TCGIResponse object must allow GET and HEAD requests.


TCGIResponse.Content

TCGIResponse	See also 	Example

Contains the information sent to the web client in response to an HTTP request message.

property Content: string;

Description

Use Content to send requested information to the web client. Not every HTTP request message requires content to be returned. For example, responses to requests with a Method of OPTIONS, HEAD, POST, PUT, DELETE, or TRACE should not include any Content. In all these cases, the response information is contained entirely in the response header, which is built from the other properties of the TCGIResponse object.

The response content can be a string of HTML commands, the name of an HTML file, graphic content such as a bit-stream, or any other MIME content type.

Note:	If the ContentStream property is set, it supersedes the value of the Content property. If both Content and ContentStream are set, the web client is sent the value of the ContentStream, not the value of the Content property.


TCGIResponse.ContentEncoding

TCGIResponse	See also

Lists the mechanisms, if any, that are used to encode the content of the HTTP response message.

property ContentEncoding: string;

Description

Set ContentEncoding when the value of the Content has been encoded before it is sent to the web client. The encoding mechanisms are listed in the order in which they are applied, separated by commas. Typically, ContentEncoding indicates a compression method or an encoding method used to transfer extended-ascii characters over the net.


TCGIResponse.ContentLength

TCGIResponse	See also

Specifies the length, in bytes, of the Content property.

property ContentLength: Integer;

Description

Set ContentLength to the length of the Content property, if it is known. If the length of the Content property is unknown, or if the HTTP response message does not include any content, set ContentLength to 0. Web clients use the ContentLength when reading the contents of the HTTP response message.

If the contents of the response message are taken from a stream, the value of ContentLength is set from the stream.


TCGIResponse.ContentType

TCGIResponse	See also	Example

Specifies the value of the media type of the Content of the HTTP response message.

property ContentType: string;

Description

Set ContentType to indicate the media type of the Content of the HTTP response message. The value of ContentType must specify a valid MIME content type. The ContentType string has the form Type/SubType.

For example, if the response message sends a string of HTML commands to the web client in response to a GET request, the ContentType is text/html.

Note:	If the HTTP request message includes an Accept header, ContentType should be one of the content types listed in the TCGIRequest.Accept property.


TCGIResponse.ContentVersion

TCGIResponse	See also

Represents the version associated with the Content of the HTTP response message.

property ContentVersion: string;

Description

Use ContentVersion to specify a version associated with the Content of the HTTP response. The meaning of ContentVersion depends on the type of information that is sent in the HTTP response. For example, if the Content of the HTTP response has a ContentType of text/html, ContentVersion would be the version of HTML used.

Server applications that introduce meanings for the ContentVersion property should document the interpretation they assign to ContentVersion.


TCGIResponse.Date

TCGIResponse	See also

Indicates the time and date when the HTTP response message is sent to the web client.

property Date: TDateTime;

Description

Set Date to the current date and time immediately before sending the HTTP response message to the web client. The Web client uses Date to determine the age of the information returned.

Date is represented using the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since Dec. 30 1899. The fractional part of a TDateTime value is the fraction of a 24-hour day that has elapsed.


TCGIResponse.DerivedFrom

TCGIResponse	See also

Specifies the URI of the resource where the Content of the HTTP response originated.

property DerivedFrom: string;

Description

Set DerivedFrom to the URI where the value of Content originates. It is especially important to set DerivedFrom when the Content of the HTTP response did not originate from the resource indicated by the URL property of the HTTP request message.


TCGIResponse.Expires

TCGIResponse	See also

Specifies the date and time after which the Content of the HTTP response message should be considered invalid.

property Expires: TDateTime;

Description

Set Expires when the Content of the HTTP response message contains information that may become invalid with the passage of time. Setting an Expires value does not imply that the information or its source will necessarily change or cease to exist when the Expires date and time is reached. Web clients are simply warned to check the freshness of the information after the Expires date and time.

The value of Expires is specified in Greenwich Mean Time.

Expires is represented using the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since Dec. 30 1899. The fractional part of a TDateTime value is the fraction of a 24-hour day that has elapsed.


TCGIResponse.LastModified

TCGIResponse	See also

Indicates the date and time that the value of the Content property was last updated.

property LastModified: TDateTime;

Description

Set LastModified to indicate the last time the Content of the HTTP response was modified. This allows web clients to determine whether their local version of that information is up-to-date. When the HTTP request is a HEAD message, this may allow the web client and server to skip a potentially expensive transfer of information.

The value of LastModified is specified in the local time of the machine. The HTTP response message translates this value to the date encoding used by HTTP.

LastModified is represented using the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since Dec. 30 1899. The fractional part of a TDateTime value is the fraction of a 24 hour day that has elapsed.


TCGIResponse.Location

TCGIResponse	See also

Specifies the URI of a resource the web client should point to for the completion of its request.

property Location: string;

Description

Set Location when the HTTPResponse created a new resource in response to the HTTP request message, or when the servicing of the response must be delegated to another URI than the one specified in the HTTP request message.


TCGIResponse.LogMessage

TCGIResponse	See also

Describes the HTTP response message for event logging purposes.

property LogMessage: string;

Description

Set LogMessage to a description of the action carried out by the TWebActionItem object that services this HTTP response. Usually, LogMessage includes the URI that handled the HTTP request message, along with date and time information.


TCGIResponse.Realm

TCGIResponse	See also

Indicates the set of protected-access URIs that includes the URL specified by the HTTP request message.

property Realm: string;

Description

Set Realm when the HTTP response message returns 401 (Unauthorized) or 402 (Payment required). Realm is the name of a set of URIs that require a password or payment before the web client can access them. All the URIs in the realm, including the URL specified in the HTTP request message, are made available as soon as the web client provides the password or payment for the realm. The server application should keep track, internally, of the passwords or payments the client has provided, using the client information provided by the THTTPRequest object.


TCGIResponse.ReasonString

TCGIResponse	See also

Indicates the status of the response to the web client request.

property ReasonString: string;

Description

Set ReasonString to inform the human web client of the success or failure of the HTTP request message. Each reason string is associated with a 3-digit status code whose value indicates the status of the response. The HTTP standard defines a number of stock status codes and corresponding reason strings. In addition, server applications can define new reason strings and associate them with unused status codes.


TCGIResponse.Server

TCGIResponse	See also

Provides information about the software used by the server application to handle the request.

property Server: string;

Description

Set Server to a string giving the name and version number of the application that provides the Content of the HTTP response message. The value of Server can contain multiple product identifiers and comments, listed in order of significance and separated by spaces. Product identifiers take the form Product Name/Version Number.


TCGIResponse.StatusCode

TCGIResponse	See also

Indicates the status of the response to the HTTP request message as a 3-digit integer.

property StatusCode: Integer;

Description

Set StatusCode to inform the web client the status of the HTTP request message. Status codes are standard return values that can be interpreted by all web clients. Each status code has a corresponding reason string that provides a human web client with a more understandable indication of the status.

The following tables lists the available status codes and their corresponding reason strings.

StatusCode	ReasonString

100	Continue

101	Switching Protocols

200	OK

201	Created

202	Accepted

203	Non-Authoritative Information

204	No Content

205	Reset Content

206	Partial Content

300	Multiple Choices

301	Moved Permanently

302	Moved Temporarily

303	See Other

304	Not Modified

305	Use Proxy

400	Bad Request

401	Unauthorized

402	Payment Required

403	Forbidden

404	Not Found

405	Method Not Allowed

406	Not Acceptable

407	Proxy Authentication Required

408	Request Time-out

409	Conflict

410	Gone

411	Length Required

412	Precondition Failed

413	Request Entity Too Large

414	Request-URI Too Large

415	Unsupported Media Type

500	Internal Server Error

501	Not Implemented

502	Bad Gateway

503	Service Unavailable

504	Gateway Time-out

505	HTTP Version not supported

Status codes not in the table can be created by the server application. When creating a new status code, the most significant digit should indicate the class of response, as follows:

•	1xx: Informational (request received, continuing process)

•	2xx: Success (request received, understood, and accepted)

•	3xx: Redirection (further action needed to complete the request)

•	4xx: Client Error (request contains bad syntax or cannot be serviced)

•	5xx: Server Error (server failed to handle a valid request)


TCGIResponse.Title

TCGIResponse	See also

Specifies a title for the Content of the HTTP response message.

property Title: string;

Description

Set the Title property to add a Title header to the HTTP response message. Title is an optional application-specific title associated with the information included in the message.


TCGIResponse.Version

TCGIResponse	See also

Indicates the HTTP protocol version number that the web client is using.

property Version: string;

Description

Read Version to ensure that the properties set in the TCGIResponse object will be understood by the web client. The value of Version is taken from the ProtocolVersion property of the HTTPRequest property.

For more information on the different HTTP protocol versions, see the Internet standards documentation available on the home page of the World Wide Web Consortium <http://www.w3.org>.


TCGIResponse.WWWAuthenticate

TCGIResponse	See also

Lists one or more comma-separated challenges when the request fails with StatusCode 401 (Unauthorized).

property WWWAuthenticate: string;

Description

Set WWWAuthenticate when the HTTP request fails because it requires access to a URI in a realm for which the web client has not provided a password. WWWAuthenticate consists of an authentication scheme name, followed by a comma-separated list of parameter/value pairs that specify the parameters to the authentication scheme. The first parameter/value pair indicates the realm.

For more information about HTTP authentication schemes, see the Internet standards documentation.


TCGIResponse methods

TCGIResponse	Alphabetically	Legend

In TCGIResponse

Create

GetContent

GetDateVariable

GetIntegerVariable

GetLogMessage

GetStatusCode

GetStringVariable

SendRedirect

SendResponse

SendStream

Sent

SetContent

SetDateVariable

SetIntegerVariable

SetLogMessage

SetStatusCode

SetStringVariable

Derived from TWebResponse

Destroy

GetCustomHeader

SetCookieField

SetCustomHeader

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCGIResponse methods

TCGIResponse	By object	Legend

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetContent

GetCustomHeader

GetDateVariable

GetIntegerVariable

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetLogMessage

GetStatusCode

GetStringVariable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

SendRedirect

SendResponse

SendStream

Sent

SetContent

SetCookieField

SetCustomHeader

SetDateVariable

SetIntegerVariable

SetLogMessage

SetStatusCode

SetStringVariable


TCGIResponse.Create

TCGIResponse	See also

Creates an instance of TCGIResponse to represent the response to the HTTPRequest parameter.

constructor Create(HTTPRequest: TWebRequest);

Description

Applications shouldn’t need to call Create to instantiate a CGI response object. The TCGIApplication object creates a TCGIResponse for each TCGIRequest it creates.


TCGIResponse.GetContent

TCGIResponse	See also

Reads the value of the Content property.

function GetContent: string; override;

Description

GetContent is the protected access function for the Content property.


TCGIResponse.GetDateVariable

TCGIResponse	See also

Extracts a date from the internal table of HTTP header variables.

function GetDateVariable(Index: Integer): TDateTime; override;

Description

The CGI response object uses GetDateVariable to access the properties that represent dates.


TCGIResponse.GetIntegerVariable

TCGIResponse	See also

Extracts an integer value from the internal table of HTTP header variables.

function GetIntegerVariable(Index: Integer): Integer; override;

Description

The CGI response object uses GetIntegerVariable to access the properties that represent integers.


TCGIResponse.GetLogMessage

TCGIResponse	See also

Reads the value of the LogMessage property.

function GetLogMessage: string; override;

Description

GetLogMessage is the protected access function for LogMessage property.


TCGIResponse.GetStatusCode

TCGIResponse	See also

Reads the value of the StatusCode property.

function GetStatusCode: Integer; override;

Description

GetStatusCode is the protected access function for the StatusCode property.


TCGIResponse.GetStringVariable

TCGIResponse	See also

Extracts a string value from the internal table of HTTP header variables.

function GetStringVariable(Index: Integer): string; override;

Description

The CGI response object uses GetStringVariable to access the properties that represent strings.


TCGIResponse.SendRedirect

TCGIResponse	See also

Sends the response with a StatusCode of 301 (Moved Permanently) and with Location set to the URI parameter.

procedure SendRedirect(const URI: string); override;

Description

Call SendRedirect to redirect the web client request to another URI that is the proper target of the request. SendRedirect does the same thing as setting the StatusCode to 301, the Location to URI, and calling SendResponse.


TCGIResponse.SendResponse

TCGIResponse	See also	Example

Sends the CGI response message to the web client.

procedure SendResponse; override;

Description

Call SendResponse after setting the properties of the CGI response object to specify the response that should be sent to the web client. If the request should be redirected to another URI, it is more efficient to call SendRedirect.


TCGIResponse.SendStream

TCGIResponse	See also

Sends the CGI response message with the contents set to the contents of AStream.

procedure SendStream(AStream: TStream); override;

Description

Only call SendStream after first calling SendResponse. Unlike SendStream, SendResponse fills the header of the HTTP response message, based on the properties of the TCGIResponse object. If SendResponse has not been called first to set the header of the HTTP response message, set the ContentStream property to AStream, and call SendResponse.


TCGIResponse.Sent

TCGIResponse	See also

Indicates whether the CGI response message has already been sent.

function Sent: Boolean; override;

Description

Sent returns True if the SendRedirect or SendStream method has been called. TCGIApplication calls Sent so that it knows when to send unsent responses to the web client.


TCGIResponse.SetContent

TCGIResponse	See also

Sets the Content property.

procedure SetContent(const Value: string); override;

Description

SetContent is the protected method used by CGI response objects to set the Content property.


TCGIResponse.SetDateVariable

TCGIResponse	See also

Sets a date-time valued HTTP header property.

procedure SetDateVariable(Index: Integer; const Value: TDateTime); override;

Description

SetDateVariable writes date-time to the internal table used to store HTTP header variables. The CGI response object uses SetDateVariable to set the properties that represent dates.


TCGIResponse.SetIntegerVariable

TCGIResponse	See also

Sets an integer valued HTTP header property.

procedure SetIntegerVariable(Index: Integer; Value: Integer); override;

Description

SetIntegerVariable writes integer values to the internal table used to store HTTP header variables. The CGI response object uses SetIntegerVariable to set the properties that represent integers.


TCGIResponse.SetLogMessage

TCGIResponse	See also

Sets the value of the LogMessage property.

procedure SetLogMessage(const Value: string); virtual; abstract;

Description

SetLogMessage is the protected method used by CGI response objects to set the LogMessage property.


TCGIResponse.SetStatusCode

TCGIResponse	See also

Sets the StatusCode property.

procedure SetStatusCode(Value: Integer); override;

Description

SetStatusCode is the protected method used by CGI response objects to set the StatusCode property.


TCGIResponse.SetStringVariable

TCGIResponse	See also

Sets a string valued HTTP header property.

procedure SetStringVariable(Index: Integer; const Value: string); override;

Description

SetStringVariable writes string values to the internal table used to store HTTP header variables. The CGI response object uses SetStringVariable to set the properties that represent strings.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TWebResponse


TWinCGIRequest

Hierarchy	Properties	Methods	See also

TWinCGIRequest represents client request information that is passed to a Windows hosted CGI Web server application.

Unit

cgiapp

Description

Use TWinCGIRequest to interpret a client request to a Windows hosted CGI Web server application.

CGI application objects create TWinCGIRequest objects to capture client requests. The properties of the TWinCGIRequest objects are obtained from the Web server. The CGI application uses TWinCGIRequest objects to create corresponding TWinCGIResponse objects. The TWebDispatcher object for the application then invokes the TWebActionItem that is associated with the path portion of the URL of the TWinCGIRequest object.


TWinCGIRequest properties

TWinCGIRequest	Alphabetically	Legend

In TWinCGIRequest

Accept

Authorization

CacheControl

Connection

Content

ContentEncoding

ContentType

ContentVersion

Cookie

DerivedFrom

From

Host

Method

PathInfo

PathTranslated

ProtocolVersion

Query

Referer

RemoteAddr

RemoteHost

ScriptName

Title

URL

UserAgent

Derived from TCGIRequest

ContentLength

Date

Expires

IfModifiedSince

ServerPort

Derived from TWebRequest

ContentFields

CookieFields

MethodType

QueryFields


TWinCGIRequest properties

TWinCGIRequest	By object	Legend

Accept

Authorization

CacheControl

Connection

Content

ContentEncoding

ContentFields

ContentLength

ContentType

ContentVersion

Cookie

CookieFields

Date

DerivedFrom

Expires

From

Host

IfModifiedSince

Method

MethodType

PathInfo

PathTranslated

ProtocolVersion

Query

QueryFields

Referer

RemoteAddr

RemoteHost

ScriptName

ServerPort

Title

URL

UserAgent


TWinCGIRequest.Accept

TWinCGIRequest	See also

Represents the value of the Accept header of the HTTP request message.

property Accept: string;

Description

Read Accept to determine the media types the Web client can accept in response to the request. Not every HTTP request message has an Accept header. If the Accept property is not set, then any media type is potentially acceptable in the response.

Accept headers usually indicate that the response should be limited to a small set of desired types. For example, a Web client requesting an audio response might produce a TWinCGIRequest object with Accept set to the following string:

audio/*; q=0.2, audio/basic

This request indicates that the preferred response media type is audio/basic, but that any audio type is acceptable if it is the best available after an 80% mark-down in quality.

For information on the format of Accept headers, see the current Internet standards documentation.


TWinCGIRequest.Authorization

TWinCGIRequest	See also	Example

Represents the value of the Authorization header of the HTTP request message.

property Authorization: string;

Description

Read Authorization to check whether the client that sent the request message has provided the correct authentication information. Authorization allows the CGI application to provided limited access to the resource specified by the URL property.

For more information about HTTP authentication schemes, see the Internet standards documentation.


TWinCGIRequest.CacheControl

TWinCGIRequest 	See also

Represents the value of the Cache-Control header of the HTTP request message.

property CacheControl: string;

Description

Read CacheControl to determine any Web client directives that must be obeyed by all caching mechanisms along the request/response chain. The CacheControl directives of the HTTP request do not need to apply to the corresponding HTTP response.

The HTTP 1.1 standard defines the following directives for CacheControl:

Value	Meaning

no-cache	The request may not be cached. The Web server validates the request before the TWinCGIRequest object is created.

no-store	The request contains sensitive information and may not be stored on any permanent medium such as a back-up tape. If the request is stored temporarily in a file, the file must be deleted.

max-age=ss	The request is considered invalid if it is older than ss seconds. This directive takes precedence over the Expires property, even if Expires is more restrictive. Invalid requests are validated by the Web server before the TWinCGIRequest object is created.

max-stale or max-stale=ss	The client is willing to accept a response that has exceeded it’s expiration time. The max-stale directive can optionally specify the number of seconds by which the response can exceed it’s expiration time.

min-fresh=ss	The client is not willing to accept a response that expires in less than ss seconds.


TWinCGIRequest.Connection

TWinCGIRequest	See also

Represents the value of the Connection header of the HTTP request message.

property Connection: string;

Description

Read Connection to determine the options requested by the Web client for its connection to the server application. The HTTP 1.1 standard specifies only one value for the Connection header. If the value of Connection is close, then the connection should be closed after the completion of the response.


TWinCGIRequest.Content

TWinCGIRequest	See also

Represents the unparsed contents of the HTTP request message.

property Content: string;

Description

Use Content to read the contents of an HTTP request message that is sending information to the server. The value of Content depends on the Method of the HTTP request. When the Method is POST, Content is the unparsed string giving the values to be posted with their associated fields. When the Method is PUT, Content is the value that should replace the URL given by the URL property.

Tip:	When the Method is POST, the parsed version of the post request is available in the ContentFields property.

Note:	If the content of a message is particularly large, it is transferred in chunks. In this case, the Content property does not contain the entire message content. To read the rest of the content, use the ReadClient method.


TWinCGIRequest.ContentEncoding

TWinCGIRequest	See also

Represents the value of the Content-Encoding header of the HTTP request message.

property ContentEncoding: string;

Description

Read ContentEncoding to determine what encoding mechanisms, if any, have been applied to the Content of the HTTP request. The encoding mechanisms are listed in the order in which they were applied by the Web client, separated by commas. Typically, ContentEncoding indicates a compression method or an encoding scheme used to transfer extended-ascii characters over the net.

Reverse the ContentEncoding mechanisms to decode the Content into the form indicated by the ContentType property.


TWinCGIRequest.ContentType

TWinCGIRequest	See also

Represents the value of the Content-Type header of the HTTP request message.

property ContentType: string;

Description

Read ContentType to determine the media type of the Content of the HTTP request message. The ContentType is a string of the form Type/SubType.

Most HTTP requests do not require any Content at all. For most requests with a Method that requires a value for Content, the ContentType is text/html. However, HTTP requests for server-specific values of Method can use any media type appropriate to the request.


TWinCGIRequest.ContentVersion

TWinCGIRequest	See also

Represents the value of the Content-Version header of the HTTP request message.

property ContentVersion: string;

Description

Read ContentVersion to determine the version of the Content of the HTTP request message. Most HTTP requests do not require any Content at all. When the Method requires a value for Content, the ContentVersion may be set to indicate the version of the source of that content. The format of the ContentVersion depends on the ContentType of the request.


TWinCGIRequest.Cookie

TWinCGIRequest	See also

Represents the value of the Cookie header of the HTTP request message.

property Cookie: string;

Description

Use Cookie to read the “cookie” strings provided in the Web client request. Cookie strings are generally used to track state information in a Web application. Usually the value is passed on from a cookie header sent in a previous response message.

Cookie is the unparsed value of the Cookie header. The Cookie header can include multiple fields separated by semicolons (;). Use the CookieFields property to work with the Cookie header on a field-by-field basis.


TWinCGIRequest.DerivedFrom

TWinCGIRequest	See also

Represents the value of the Derived-From header of the HTTP request message.

property DerivedFrom: string;

Description

Read DerivedFrom to determine the URI where the value of Content originated. DerivedFrom is only meaningful when the request includes a Content property and the Content did not originate with the Web client.


TWinCGIRequest.From

TWinCGIRequest	See also

Represents the value of the From header of the HTTP request message.

property From: string;

Description

Read From to determine the Internet e-mail address of the human user for whom the Web client sent the HTTP request message. This value can be used for logging purposes, or to contact the originator of the request if problems occur.


TWinCGIRequest.Host

TWinCGIRequest	See also

Represents the value of the Host header of the HTTP request message.

property Host: string;

Description

Read Host to determine the Internet host and port number of resource being requested. For example, if the client request specifies the following URL:

http://www.TSite.com/art/gallery.dll/mammals?animal=dog&color=black

The value of Host would be

www.TSite.com

The value of Host can be used to differentiate between internally-ambiguous URLs, such as the root “/” URL of a server for multiple host names on a single IP address.


TWinCGIRequest.Method

TWinCGIRequest	See also

Represents the value of the Method header of the HTTP request message.

property Method: string;

Description

Read Method to determine the method that is requested by the Web client. The HTTP 1.1 standard defines the following methods

Value	Meaning

OPTIONS	A request for information about available communication options.

GET	A request for the information identified by the URL property.

HEAD	A request for information about the properties of the HTTP response, but not for the content of the response.

POST	A request for the server application to post the data included in the Content property, as appropriate.

PUT	A request for the server application to replace the resource indicated by the URL property with the data included in the Content property.

DELETE	A request for the server application to delete or hide the resource identified by the URL property.

TRACE	A request for the server application to send a loop-back to confirm receipt of the request.

The Method property may indicate any other method that the Web client requests of the server. If the Method can’t be matched to the Allow property of a TCGIResponse object, the request can’t be serviced.

The MethodType property indicates whether the value of Method is GET, HEAD, POST, PUT, or one of the other strings. When possible, use MethodType instead of the Method property, to save the overhead of string comparison.

Note:	A CGI application does not need to service all method types. However, there must be a response for the GET and HEAD method requests.


TWinCGIRequest.PathInfo

TWinCGIRequest	See also

Represents the value of the path information (if any) of the URL specified in the HTTP request message.

property PathInfo: string;

Description

Read PathInfo to determine the path on the server machine where the target of the request is found. For example, given this URL:

http://www.TSite.com/art/gallery.dll/mammals?animal=dog&color=black

and assuming that the /gallery.dll part is the Web server application, the PathInfo portion is:

/mammals

The TWebDispatcher object uses the PathInfo to identify the appropriate TWebActionItem for servicing the request message.


TWinCGIRequest.PathTranslated

TWinCGIRequest	See also

Represents a translation of the PathInfo property to a fully qualified path on the Web server.

property PathTranslated: string;

Description

Use PathTranslated to refer to the location of the target of the request in an HTTP response.


TWinCGIRequest.ProtocolVersion

TWinCGIRequest	See also

Represents the version number of the HTTP protocol specified in the initial header of the HTTP request message.

property ProtocolVersion: string;

Description

Use ProtocolVersion to determine the protocol used by the Web client when generating the HTTP request message.

Some properties of the HTTP request may be interpreted differently depending on the ProtocolVersion. For example, if ProtocolVersion is 1.0, then the connection should not be considered persistent, even if the Connection property does not specify the close option.


TWinCGIRequest.Query

TWinCGIRequest	See also

Represents the value of the query information (if any) of the URL specified in the HTTP request message.

property Query: string;

Description

Read Query to determine the details of a query specified in the URL of the Web client request. For example, given this URL:

http://www.TSite.com/art/gallery.dll/mammals?animal=dog&color=black

and assuming that the /gallery.dll part is the Web server application, the Query portion is:

animal=dog&color=black

Query is the unparsed query portion of the URL. The query may include multiple fields separated by ampersands (&). Use the QueryFields property to work with the query on a field-by-field basis.


TWinCGIRequest.Referer

TWinCGIRequest	See also

Represents the value of the Referer header of the HTTP request message.

property Referer: string;

Description

Read Referer to determine the URI of the resource where the HTTP request message originated. Referer allows the server application to generate back-links to the source of the request. If Referer is a partial URI, it should be interpreted as a relative path to the URL property.

The Referer property is not set when the URL of the HTTP request was obtained from a source that does not have its own URI, such as input from the user keyboard.


TWinCGIRequest.RemoteAddr

TWinCGIRequest	See also

Indicates the remote IP address of the client associated with the HTTP request message.

property RemoteAddr: string;

Description

Read RemoteAddr to obtain the IP address of the source of the Web client request.


TWinCGIRequest.RemoteHost

TWinCGIRequest	See also

Indicates the fully qualified reverse domain look-up of the client associated with the HTTP request message.

property RemoteHost: string;

Description

Use RemoteHost to compose URI values for back-links to the source of the request when the Referer property is not specified. RemoteHost does not include any path information.


TWinCGIRequest.ScriptName

TWinCGIRequest	See also

Indicates the value of the script information (if any) of the URL specified in the HTTP request message.

property ScriptName: string;

Description

Read ScriptName to determine the full path to the Web server application specified by the client request. For example, given this URL:

http://www.TSite.com/art/gallery.dll/mammals?animal=dog&color=black

and assuming that the /gallery.dll part is the Web server application, the ScriptName portion is:

/art/gallery


TWinCGIRequest.Title

TWinCGIRequest	See also

Represents the value of the Title header of the HTTP request message.

property Title: string;

Description

Read Title to determine the Title of the information requested in the Web client request.


TWinCGIRequest.URL

TWinCGIRequest	See also

Indicates the Uniform Resource Identifier (URI) specified by the HTTP request message to identify the target of the request.

property URL: string;

Description

Use the URL property to identify the resource the Web client identifies as the target of the request message. URL may be an HTML page to return, a resource to be created or deleted, or an object that provides some other service for the Web client.

The TWinCGIRequest object parses the URL into its constituent parts, yielding the Host property, the ScriptName property, the PathInfo property, and the Query property.

Note:	Usually the URL property is a Uniform Resource Locator (URL) that can be parsed into host, script, path, and query portions. However, it is possible for HTTP request messages to specify the target in more general terms, as a Uniform Resource Identifier (URI).


TWinCGIRequest.UserAgent

TWinCGIRequest	See also

Represents the value of the User-Agent header of the HTTP request message.

property UserAgent: string;

Description

Read UserAgent to obtain information about the user agent originating the client request. Use the UserAgent information for statistical purposes, for tracing protocol violations, and for tailoring responses to known limitations of specific applications that generate client requests. The UserAgent string contains one or more descriptors, in order of significance. Each descriptor gives the name of the product or application that generated the request, or a comment about the user agent.


TWinCGIRequest methods

TWinCGIRequest	Alphabetically	Legend

In TWinCGIRequest

Create

Destroy

GetFieldByName

GetStringVariable

ReadClient

ReadString

TranslateURI

WriteClient

WriteString

Derived from TWebRequest

ExtractContentFields

ExtractCookieFields

ExtractFields

ExtractQueryFields

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TWinCGIRequest methods

TWinCGIRequest	By object	Legend

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

ExtractContentFields

ExtractCookieFields

ExtractFields

ExtractQueryFields

FieldAddress

Free

FreeInstance

GetFieldByName

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetStringVariable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadClient

ReadString

SafeCallException

TranslateURI

WriteClient

WriteString


TWinCGIRequest.Create
TWinCGIRequest.CreateTWinCGIRequest	See also

Creates an instance of TWinCGIRequest.

constructor Create;

Description

Applications shouldn’t need to call Create to instantiate a CGI request object. The TCGIApplication object creates a TWinCGIRequest object whenever it receives a client request.


TWinCGIRequest.Destroy

TWinCGIRequest	See also

Destroys an instance of TWinCGIRequest.

destructor Destroy; override;

Description

Do not call Destroy. TCGIApplication destroys the TWinCGIRequest object after it is processed by calling the Free method.

Destroy frees the internal structures used to manage the HTTP header variables.


TWinCGIRequest.GetFieldByName

TWinCGIRequest	See also

Returns the value of the HTTP header variable specified by the Name parameter.

function GetFieldByName(const Name: string): string; override;

Description

Use GetFieldByName to read the value of an HTTP header variable that is not surfaced as one of the properties of TCGIRequest. For information on possible HTTP request header variables, see the current Internet standards documents.


TWinCGIRequest.GetStringVariable

TWinCGIRequest	See also

Extracts a string value from the internal table of HTTP header variables.

function GetStringVariable(Index: Integer): string; override;

Description

GetStringVariable reads string values from the header strings of the HTTP request message. The CGI request object uses GetStringVariable to access the properties that represent strings from the HTTP request headers.


TWinCGIRequest.ReadClient

TWinCGIRequest	See also

Reads Count bytes from the HTTP request into Buffer.

function ReadClient(var Buffer; Count: Integer): Integer; override;

Description

Use ReadClient to load a chunk of information from the contents of an HTTP request into a buffer. ReadClient allows the server application to get the next chunk of information when the content of the request message is too large for the Content property. ReadClient returns the number of bytes actually read. If no more content is available, ReadClient returns -1.


TWinCGIRequest.ReadString

TWinCGIRequest	See also

Reads Count bytes from the HTTP request into a string.

function ReadString(Count: Integer): string; override;

Description

Use ReadString to load the next chunk of content information form the HTTP request into a string. ReadString allows the server application to get the next chunk of information when the content of the request message is too large for the Content property.


TWinCGIRequest.TranslateURI

TWinCGIRequest	See also

Serves as a placeholder for a method that translates URIs for the server.

function TranslateURI(const URI: string): string; override;

Description

TranslateURI is used with HTTP request objects to translate the URI specified in a client request into a format that can be used by the server application. As CGI applications work directly with URI values, no translation is necessary.


TWinCGIRequest.WriteClient

TWinCGIRequest	See also

Writes Count bytes from Buffer back to the HTTP client.

function WriteClient(var Buffer; Count: Integer): Integer; override;

Description

Use WriteClient to write the contents of a response back to the Web client.


TWinCGIRequest.WriteString

TWinCGIRequest	See also

Writes the string AString back to the HTTP client.

function WriteString(const AString: string): Boolean; virtual; abstract;

Description

Use WriteString to write the contents of a response back to the Web client.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TWebRequest

TCGIRequest


TWinCGIResponse

Hierarchy	Properties	Methods	See also

TWinCGIResponse represents HTTP messages sent by a Windows hosted CGI application in response to an HTTP request message.

Unit

cgiapp

Description

Use TWinCGIResponse to specify the response to an HTTP request message.

A CGI application creates a TWinCGIResponse object based on the TWinCGIRequest object for an incoming web client request message. The Web dispatcher for the application then passes the TWinCGIResponse object to the TWebActionItem associated with the TWinCGIRequest object. The TWebActionItem sets the properties of the TWinCGIResponse object.


TWinCGIResponse properties

TWinCGIResponse	Alphabetically	Legend

Derived from TCGIResponse

Allow

Content

ContentEncoding

ContentLength

ContentType

ContentVersion

Date

DerivedFrom

Expires

LastModified

Location

LogMessage

Realm

ReasonString

Server

StatusCode

Title

Version

WWWAuthenticate

Derived from TWebResponse

ContentStream

Cookies

CustomHeaders

HTTPRequest


TWinCGIResponse properties

TWinCGIResponse	By object	Legend

Allow

Content

ContentEncoding

ContentLength

ContentStream

ContentType

ContentVersion

Cookies

CustomHeaders

Date

DerivedFrom

Expires

HTTPRequest

LastModified

Location

LogMessage

Realm

ReasonString

Server

StatusCode

Title

Version

WWWAuthenticate


TWinCGIResponse methods

TWinCGIResponse	Alphabetically

Derived from TWebResponse

Destroy

GetCustomHeader

SetCookieField

SetCustomHeader

Derived from TCGIResponse

Create

SendRedirect

SendResponse

SendStream

Sent

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TWinCGIResponse methods

TWinCGIResponse	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetCustomHeader

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

SendRedirect

SendResponse

SendStream

Sent

SetCookieField

SetCustomHeader


Accessibility

Read-only


Hierarchy

TObject

TWebResponse

TCGIResponse


TCookieCollection

Hierarchy	Properties	Methods	See also

TCookieCollection is a collection of TCookie objects.

Unit

httpapp

Description

Use TCookieCollection to represent all the Cookie headers of an HTTP response message.  Each Cookie header is represented by a single TCookie object.  A Cookie header includes a named field with an associated value, of the form Name=Value, plus a number of other, standard fields that specify the destination of the cookie, when the cookie is valid, and so on.  Web clients pass Cookie headers on to the destinations specified by the fields of the Cookie header.


TCookieCollection properties

TCookieCollection	Alphabetically	Legend

In TCookieCollection

Items

WebResponse

Derived from TCollection

Count

ItemClass


TCookieCollection properties

TCookieCollection	By object	Legend

Count

ItemClass

Items

WebResponse


TCookieCollection.Items

TCookieCollection	See also

Provides indexed access to the TCookie objects in the collection.

property Items[Index: Integer]:TCookie; default;

Description

Use Items to access the properties of the TCookie objects maintained by TCookieCollection. Items is the default property of TCookieCollection, so the name of the Items property can be left off when using this property. Thus the line

FirstCookie := TISAPIResponse1.Cookies.Items[0];

can be written

FirstCookie := TISAPIResponse1.Cookies[0];


TCookieCollection.WebResponse

TCookieCollection

Indicates the TWebResponse object that uses the cookie collection to represent all of its Cookie headers.

property WebResponse: TWebResponse;

Description

Read WebResponse to access the response object that is using the cookie collection.  The response object is a descendant of TWebResponse, either TISAPIResponse, TCGIResponse, or TWinCGIResponse, depending on the type of Web server application.

Use the properties of the response object to obtain information about the other headers in the response message or the content of the response message.  Many applications use this information to determine what field values to specify as Cookie headers.


TCookieCollection methods

TCookieCollection	Alphabetically

In TCookieCollection

Add

Create

Derived from TCollection

Assign

BeginUpdate

Clear

Delete

Destroy

EndUpdate

FindItemID

GetNamePath

Insert

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCookieCollection methods

TCookieCollection	By object

Add

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

FindItemID

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCookieCollection.Add

TCookieCollection	See also	Example

Creates a new TCookie object and adds it to the end of the Items property array.

function Add: TCookie;

Description

Call Add to add a new Cookie header to the set of cookie headers sent with the Web response message.  Use Add when adding a Cookie header whose fields will be set at a later time. If the values of the TCookie properties are known at the time of creation, use the SetCookieField method of the Web response object instead.


TCookieCollection.Create

TCookieCollection

Creates and initializes a TCookieCollection object.

constructor Create(WebResponse: TWebResponse; ItemClass: TCollectionItemClass);

Description

Applications should not need to call the Create method directly.  The Web response object that uses the cookie collection to represent its Cookie headers creates the TCookieCollection object from its own constructor.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


 TClientSocket

Hierarchy	Properties	Methods	Events	See also

TClientSocket manages socket connections for a TCP/IP client.

Unit

scktcomp

Description

Add a TClientSocket object to a form or data module to turn an application into a TCP/IP client. TClientSocket specifies a desired connection to a TCP/IP server, manages the connection when it is open, and terminates the connection when the application is through.

Note:	See the CHAT demo for an example of how to use TClientSocket.


TClientSocket properties

TClientSocket	Alphabetically	Legend

In TClientSocket

ClientType

Socket

Derived from TAbstractSocket

Active

Address

Host

Port

Service

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TClientSocket properties

TClientSocket	By object	Legend

Active

Address

ClientType

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Host

Name

Owner

Port

Service

Socket

Tag

VCLComObject


TClientSocket.ClientType

TClientSocket	See also

Specifies whether the client socket reads and writes information asynchronously over the socket connection.

type TClientType = (ctNonBlocking, ctBlocking);

property ClientType: TClientType;

Description

Set ClientType to ctNonBlocking to enable the client socket to respond to asynchronous reading and writing events. When ClientType is ctNonBlocking, execution is not blocked by reading and writing over the socket connection. OnRead or OnWrite events occur when the socket needs to read or write over the connection.

Set ClientType to ctBlocking to force all reading and writing to occur synchronously. It is a good idea to include the client socket object in a thread if the ClientType is ctBlocking, so that I/O does not block all execution within the client application.

When ClientType is ctBlocking, use a TWinSocketStream object for reading and writing. TWinSocketStream prevents the application from hanging indefinitely if a problem occurs while reading or writing. It also can wait for the socket connection to indicate its readiness for reading.

Use a non-blocking socket when the socket needs to synchronize reading and writing with server sockets.


TClientSocket.Socket

TClientSocket 	Example

Describes the client endpoint of the Windows client socket connection.

property Socket: TClientWinSocket;

Description

Use Socket to

Determine the address and port of both the client and server sockets that are bound to the connection.

Read or write information through the socket connection.

Determine what server notifications the client will respond to.

Obtain the Windows socket handle for making Windows socket API calls.


TClientSocket events

TClientSocket	Alphabetically	Legend

Derived from TCustomSocket

OnConnect

OnConnecting

OnDisconnect

OnError

OnLookup

OnRead

OnWrite


TClientSocket events

TClientSocket	By object	Legend

OnConnect

OnConnecting

OnDisconnect

OnError

OnLookup

OnRead

OnWrite


TClientSocket methods

TClientSocket	Alphabetically

In TClientSocket

Create

Destroy

Derived from TAbstractSocket

Close

Open

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TClientSocket methods

TClientSocket	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Open

RemoveComponent

SafeCallException

UpdateAction


TClientSocket.Create

TClientSocket	See also

Creates an instance of TClientSocket.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize a client socket component at runtime. TClientSocket objects placed at design time are created automatically.

After calling the inherited constructor, Create

Allocates the TClientWinSocket object that describes the client endpoint of the Windows socket connection.

Initializes the event and error dispatchers for the client socket.


TClientSocket.Destroy

TClientSocket	See also

Destroys an instance of TClientSocket.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the client socket is not nil, and only then calls Destroy.

Destroy frees the TClientWinSocket object that describes the client endpoint of the Windows socket connection.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TAbstractSocket

TCustomSocket


TClientWinSocket

Hierarchy	Properties	Methods	Events	See also

TClientWinSocket describes the client endpoint of a Windows socket connection.

Unit

scktcomp

Description

Client socket components use TClientWinSocket to manage the Windows socket API calls for a TCP/IP client application. TClientWinSocket differs from its immediate ancestor TCustomWinSocket only in that it introduces a ClientType property to distinguish blocking from non-blocking client sockets.


TClientWinSocket properties

TClientWinSocket	Alphabetically	Legend

In TClientWinSocket

ClientType

Derived from TCustomWinSocket

Addr

ASyncStyles

Connected

Data

Handle

LocalAddress

LocalHost

LocalPort

LookupState

RemoteAddr

RemoteAddress

RemoteHost

RemotePort

SocketHandle


TClientWinSocket properties

TClientWinSocket	By object	Legend

Addr

ASyncStyles

ClientType

Connected

Data

Handle

LocalAddress

LocalHost

LocalPort

LookupState

RemoteAddr

RemoteAddress

RemoteHost

RemotePort

SocketHandle


TClientWinSocket.ClientType

TClientWinSocket	See also

Specifies whether the client Windows socket reads and writes information asynchronously over the socket connection.

type TClientType = (ctNonBlocking, ctBlocking);

property ClientType: TClientType;

Description

Client socket components set ClientType to reflect their own ClientType property. When ClientType is ctNonBlocking, the client Windows socket responds to asynchronous reading and writing events, and execution is not blocked by reading and writing over the connection. OnSocketEvent events occur when the socket needs to read or write over the connection.

When ClientType is ctBlocking, all reading and writing occur synchronously. It is a good idea to perform all reading and writing in a separate thread if ClientType is ctBlocking. Reading and writing in a separate thread ensures that these operations do not block all execution within the client application.

When ClientType is ctBlocking, use a TWinSocketStream object for reading and writing. TWinSocketStream times out so that the application does not hang when a problem occurs while reading or writing. TWinSocketStream also provides a method to wait, before reading, until the socket connection is ready to send information.

Use a non-blocking socket when the socket needs to synchronize reading and writing with server sockets.


TClientWinSocket events

TClientWinSocket	Alphabetically

Derived from TCustomWinSocket

OnErrorEvent

OnSocketEvent


TClientWinSocket events

TClientWinSocket	By object

OnErrorEvent

OnSocketEvent


TClientWinSocket methods

TClientWinSocket	Alphabetically

In TClientWinSocket

Connect

Derived from TCustomWinSocket

Accept

Close

Create

Destroy

Disconnect

Listen

Lock

LookupName

LookupService

Open

Read

ReceiveBuf

ReceiveLength

ReceiveText

SendBuf

SendStream

SendStreamThenDrop

SendText

Unlock

Write

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TClientWinSocket methods

TClientWinSocket	By object

Accept

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Connect

Create

DefaultHandler

Destroy

Disconnect

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

Listen

Lock

LookupName

LookupService

MethodAddress

MethodName

NewInstance

Open

Read

ReceiveBuf

ReceiveLength

ReceiveText

SafeCallException

SendBuf

SendStream

SendStreamThenDrop

SendText

Unlock

Write


TClientWinSocket.Connect

TClientWinSocket	See also

Responds to connection notifications.

procedure Connect(Socket: TSocket); virtual;

Description

Applications can not call this protected method. Connect is called in response to notifications that the client socket has successfully completed a connection to a server socket. The Socket parameter is the Windows socket handle for the socket that receives the notification.

Connect generates an OnSocketEvent event with the SocketEvent parameter set to seConnect. Socket components assign an OnSocketEvent event handler that responds to this event by generating an OnConnect event on the socket component.

Note:	Connect is only called if the ASyncStyles property includes asConnect.


Accessibility

Read-only


Hierarchy

TObject

TCustomWinSocket


TContainedObject

Hierarchy	Properties	Methods	See also

TContainedObject implements the IUnknown interface as an inner object in an aggregate.

Unit

axctrls

Description

TContainedObject is implemented according to the rules that apply for objects that can be aggregates (inner or contained objects). It can be used as a base for classes that create inner, or contained, objects of an aggregate. Use TComObject or its descendants to instantiate an outer object that supports aggregation.

The following implementation rules for aggregatable (inner or contained) objects are supported by TContainedObject:

•	When an object of its type is created, the creation succeeds only for a requested interface of type IUnknown.

•	The IUnknown methods AddRef and Release delegate to the controlling IUnknown.

•	QueryInterface is implemented, in TContainedObject, only for interfaces implemented in the contained object.

•	The reference count on the inner object is incremented in the containing object.

In the Delphi class hierarchy, TContainedObject is used as a base class for a connection point which must be an inner object in an aggregate.

Note:	An aggregated COM object is an object that is composed of several COM objects. Each object implements its own behavior and interfaces, but all of the objects share the same reference count, which is that of the controller object. In the container pattern, the controller is the container object.

For more information about aggregation, controlling objects, and interfaces, see the Inside OLE, second edition, by Kraig Brockschmidt, the Microsoft Web site, or the Windows SDK Help.


TContainedObject properties

TContainedObject	Alphabetically	Legend

Derived from TAggregatedObject

Controller


TContainedObject properties

TContainedObject	By object	Legend

Controller


TContainedObject methods

TContainedObject	Alphabetically

Derived from TAggregatedObject

Create

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TContainedObject methods

TContainedObject	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Accessibility

Read-only


Hierarchy

TObject

TAggregatedObject


TComClassManager

Hierarchy	Methods	See also

TComClassManager is the class type of the ComClassManager variable in the ComObj unit.

Unit

comobj

Description

An instance of TComClassManager is returned by the ComClassManager function in the ComObj unit. This instance of TComClassManager manages the class factory objects owned by COM servers.

TComClassManager is a class designed for internal use to keep track of class factories.

For all servers linked to the module containing this unit, the manager returned by ComClassManager maintains a list of pointers to the class factory objects. This list is updated by the individual COM servers, which add class factories objects when they are created and delete them when they are destroyed. The ComClass manager has methods that are used to manipulate class factories based upon their associated servers. These methods process iterative actions on factories or return factories based upon the class object type they create.


TComClassManager methods

TComClassManager	Alphabetically

In TComClassManager

Create

Destroy

ForEachFactory

GetFactoryFromClass

GetFactoryFromClassID

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TComClassManager methods

TComClassManager	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

ForEachFactory

Free

FreeInstance

GetFactoryFromClass

GetFactoryFromClassID

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TComClassManager.Create

TComClassManager	See also

Creates an instance of the TcomClassManager class.

constructor Create;

Description

Do not create instances of TComClassManager. Instead, use the ComClassManager function to obtain a reference to the global COM class manager.


TComClassManager.Destroy

TComClassManagerl	See also

Destroys an instance of TComClassManager.

destructor Destroy; override;

Description

Do not destroy the COM class manager. This is a global instance that is managed by Delphi.


TComClassManager.ForEachFactory

TComClassManager	See also

Processes iterative actions on factories associated with a given server.

type TFactoryProc = procedure(Factory: TComObjectFactory) of object;

procedure ForEachFactory(ComServer: TComServerObject; FactoryProc: TFactoryProc;

Description

ForEachFactory is used to process an action, specified by the FactoryProc parameter, on all class factories in the factory list that are owned by the ComServer specified by the ComServer parameter.

ForEachFactory is used internally by the COM server to:

Destroy factories when the associated COM server unloads.

Have factories register their class objects in the system registry, when the associated COM server initializes.

Have the factories update the system registry when necessary.

TFactoryProc is the method-pointer type of the FactoryProc parameter of ForEachProperty. TFactoryProc defines a method that takes a class factory as a parameter.


TComClassManager.GetFactoryFromClass

TComClassManager	See also

Returns the class factory for a given COM class.

function GetFactoryFromClass(ComClass: TClass): TComObjectFactory;

Description

GetFactoryFromClass is used internally by Delphi to obtain the correct class factory in order to create instances of a specified COM object.

GetFactoryFromClass returns the class factory associated with the COM class specified by the ComClass parameter. If no such class factory is found in the list maintained by the ComClass manager, an EOleError exception is raised indicating that the class factory for the specifed COM class is not in the current list.


TComClassManager.GetFactoryFromClassID

TComClassManager	See also

Returns the class factory for a given COM class identifier.

function GetFactoryFromClassID(const ClassID: TGUID): TComObjectFactory;

Description

GetFactoryFromClassID is used internally by DllGetClassObject to obtain a reference to the IClassFactory interface of the corresponding class factory object for a given class object specified by the ClassID parameter.

GetFactoryFromClassID returns the class factory associated with the COM class specified by the ClassID parameter. If the class cannot be found, GetFactoryFromClassID returns nil.


Hierarchy

TObject


TComObjectFactory

Hierarchy	Properties	Methods	See also

TComObjectFactory is the type of the class factory object used to instantiate a TComObject class.

Unit

comobj

Description

TComObjectFactory supports the IUknown, IClassFactory, and IClassFactory2 interfaces. The IClassFactory interface is implemented by class objects associated with class identifiers (CLSIDs) for the classes that they instantiate. IClassFactory must be implemented for every object definition, so that objects of that type can be created. The IClassFactory2 interface is implemented by class factories for classes that need support for licensing.

Class factories instantiate the COM classes specified by a registered class identifier (CLSID). Class factory objects are created automatically by the COM servers that contain the code for the class objects and their associated classes. When a class factory is created, the CLSID is specified in a parameter to the constructor of the class factory object. This CLSID indicates the type of object for which the class factory creates instances.

Class factory objects can also be externally instantiated by directly calling the Windows API function CoCreateClassObject. The functions CreateComObject or CreateOleObject can also be called to instantiate a COM class. These functions indirectly use class factories to instantiate the classes. When creating multiple instances of a class that has a CLSID, however, it is more efficient to instantiate a class factory, obtain a pointer to its IClassFactory interface, and use its methods as needed.

Class factories are managed on the server by a global class manager accessed using the ComClassManager function. This class manager maintains a list of class factories through which the factories are manipulated, usually according to the COM server that owns them.

Interfaces implemented

IUnknown, IClassFactory, IClassFactory2


TComObjectFactory properties

TComObjectFactory	Alphabetically	Legend

In TComObjectFactory

ClassID

ClassName

ComClass

ComServer

Description

ErrorIID

Instancing

LicString

ProgID

ShowErrors

SupportsLicensing

ThreadingModel


TComObjectFactory properties

TComObjectFactory	By object	Legend

ClassID

ClassName

ComClass

ComServer

Description

ErrorIID

Instancing

LicString

ProgID

ShowErrors

SupportsLicensing

ThreadingModel


TComObjectFactory.ClassID

TComObjectFactory	See also

Specifies the class identifier (CLSID) for the COM class that the particular instance of the factory can instantiate.

property ClassID: TGUID;

Description

ClassID is used to identify the COM class that the factory can instantiate for this factory instance. It is as a used by other methods to identify this class.

ClassID is initialized, in the class factory constructor, to the CLSID that is passed to the constructor. ClassID is also used in the UpdateRegistry method when the COM server’s initialize is called.


TComObjectFactory.ClassName

TComObjectFactory	See also

Specifies the name of the class that the class factory instantiates.

property ClassName: string;

Description

ClassName is the name identifying the COM class that the class factory instantiates.

ClassName is initialized, in the class factory constructor, to the class name that is passed to the constructor.


TComObjectFactory.ComClass

TComObjectFactory	See also

Specifies the class type that the factory instantiates.

property ComClass: TClass;

Description

ComClass is used by the class manager’s GetFactoryFromClass method. This method checks the ComClass of each class factory on the server, against the class passed to it, in order to return the class factory that creates objects of that type. It is also used by the CreateComObject method to create the correct COM class.

ComClass is initialized, in the class factory constructor, to the COM class type that is passed to the constructor.


TComObjectFactory.ComServer

TComObjectFactory	See also

Specifies the COM server that owns the class factory.

property ComServer: TComServerObject;

Description

ComServer indicates the COM server that contains the class factory object. It is used by the class manager methods to process actions on specific factories based upon which server owns them.

The class manager’s ForEachFactory is a general purpose method that uses ComServer to check the server ComServer of each factory in the class manager’s factory list. ForEachFactory then calls the factory procedure passed as a parameter to it, for each of the factories of that particular COM server.

ComServer is also used in the COM class’s CreateFromFactory constructor to call the COM server’s CountObject method. This increments the object count on the server when the class factory instantitates its class type.

ComServer is initialized in the class factory constructor to the server that is passed to its constructor.


TComObjectFactory.Description

TComObjectFactory	See also

Describes the class object.

property Description: string;

Description

Description is used in the registration database, when the class factory is registered, to describe the class object.

Description is initialized, in the class factory constructor, to the Description parameter that is passed to the constructor. This description is retrieved from the type library.


TComObjectFactory.ErrorIID

TComObjectFactory	See also

Indicates the interface of the CoClass in which an error occurred.

property ErrorIID: TGUID;

Description

Use ErrorIID to determine the interface in which an error occurred.  For most CoClasses, this is the primary interface for that CoClass, as indicated in the type library.


TComObjectFactory.Instancing

TComObjectFactory	See also

Indicates the process space of COM object instances.

property Instancing: TClassInstancing;

Description

Instancing determines the process space in which the factory can create COM objects and whether the factory can create multiple instances within a single process space. Instancing is initialized in the class factory constructor to the Instancing parameter that is passed to the constructor.


TComObjectFactory.LicString

TComObjectFactory

Contains licensing information about the object.

property LicString: WideString;

Description

LicString is used to validate whether the user has valid access to the object for development. LicString can be any string defined by the developer who is optionally licensing the object.


TComObjectFactory.ProgID

TComObjectFactory	See also

Specifies the name of the class factory.

property ProgID: string;

Description

ProgID is the programmatic identifier that specifies the vendor, component, and version of the class factory object.

Every object class that can be inserted into an OLE container has ProgID.


TComObjectFactory.ShowErrors

TComObjectFactory

Indicates whether the COM object factory displays a message box when exceptions are raised.

property ShowErrors: Boolean;

Description

When ShowErrors is True, exceptions that are raised when trying to create a COM object are caught and a message box appears to describe the error. When ShowErrors is False, the exception is not caught by the COM object factory.


TComObjectFactory.SupportsLicensing

TComObjectFactory

Indicates whether the object being instantiated supports licensing.

property SupportsLicensing: Boolean;

Description

SupportsLicensing is used to determine whether a user has valid access to the object.


TComObjectFactory.ThreadingModel

TComObjectFactory	See also

Indicates the type of thread support provided by objects that the factory creates.

property ThreadingModel: TThreadingModel;

Description

The threading model of a factory is initialized in the constructor. The factory uses this value to indicate how COM should serialize calls to the objects that it creates. Use this value to determine the type of thread support you must provide in the implementation of the associated COM object.


TComObjectFactory methods

TComObjectFactory	Alphabetically

In TComObjectFactory

Create

CreateComObject

Destroy

RegisterClassObject

UpdateRegistry

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TComObjectFactory methods

TComObjectFactory	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateComObject

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RegisterClassObject

SafeCallException

UpdateRegistry


TComObjectFactory.Create

TComObjectFactory	See also

Instantiates a class factory object.

constructor Create(ComServer: TComServerObject; ComClass: TComClass; const ClassID: TGUID; Instancing: TClassInstancing; ThreadingModel: TThreadingModel = tmSingle);

Description

Create instantiates a class factory, usually when the server is loaded. Class factories should be instantiated in the initialization section of the unit that includes their associated server, so that they are automatically available when the server is loaded.

Create allocates memory for a class factory object, and adds the object to the class factory list managed by the ComClassManager. Then Create initializes the following properties with values passed to it:

Sets ComServer to the ComServer parameter.

Sets ComClass to the ComClass parameter.

Sets ClassID to the ClassID parameter.

Sets ClassName to the ClassName parameter.

Sets Description to the Description parameter.

Sets Instancing to the Instancing parameter.

Sets ThreadingModel to the ThreadingModel parameter.

Sets ErrorIID to IUnknown.


TComObjectFactory.CreateComObject

TComObjectFactory	See also

Instantiates a TComObject object.

Function CreateComObject(const Controller: IUnknown): TComObject; virtual

Description

CreateComObject is the method that instantiates the class type for which TComObjectFactory is the class factory. CreateComObject calls the CreateFromFactory constructor of the TComObject class to create a COM object. CreateComObject passes itself as the Factory parameter to CreateFromFactory.

CreateComClass creates a COM object based upon the value of the ComClass property. ComClass is the class identifier (CLSID) used by other applications to identify the COM class for which they request an object instance.


TComObjectFactory.Destroy

TComObjectFactory	See also

Disposes of an instance of a class factory.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Class factories are automatically destroyed when their corresponding servers are unloaded.


TComObjectFactory.RegisterClassObject

TComObjectFactory	See also

Registers the COM class associated with the factory object.

procedure RegisterClassObject;

Description

RegisterClassObject registers an EXE class object with OLE so other applications can connect to it. EXE object applications should call RegisterClassObject on startup. It can also be used to register internal objects for use by the same EXE or other code (such as DLLs) that the EXE uses.

If RegisterClassObject is not successful, an EOleSysError is raised with the following error code possibilities:

Value	Meaning

E_INVALIDARG	One or more the arguments are invalid.

E_OUTOFMEMORY	Not enough memory.

E_UNEXPECTED	An unexpected error occurred.

CO_E_OBJISREG 	The class was already registered in the class object table.

Only EXE object applications call RegisterClassObject. Object handlers or DLL object applications do not call this function. Instead, they must implement and export the DllGetClassObject function.

At startup, a multiple-use EXE object application must create a class object (with the IClassFactory interface on it), and call RegisterClassObject to register the class object. Object applications that support several different classes (such as multiple types of embeddable objects) must allocate and register a different class object for each.

Multiple registrations of the same class object are independent and do not produce an error. Each subsequent registration yields a unique key.


TComObjectFactory.UpdateRegistry

TComObjectFactory	See also

Registers COM objects created by the factory.

procedure UpdateRegistry(Register: Boolean); virtual;

Description

UpdateRegistry is called for EXEs when the EXE is run, and for DLLs or EXEs when the routines are called to specifically register or unregister the server.


Accessibility

Read-only


Hierarchy

TObject


TComObject

Hierarchy	Properties	Methods	See also

TComObject is the base class for creating simple COM classes, such as those used for creating Shell extensions.

Unit

comobj

Description

TComObject is a COM object that supports the IUnknown and ISupportErrorInfo interfaces. TComObject provides the implementation for simple COM objects that have:

A class identifier (CLSID) for external instantiation using a class factory.

Optional support for aggregation implemented through the IUknown methods.

Support for the SafeCall calling convention and OLE exception-handling by implementing IProvideErrorInfo.

Support for the the IErrorInfo mechanism.

TComObject can be used as a base class for creating classes for COM objects that must have a class identifier (CLSID). CLSIDs are used to register the class in the database registry and to externally instantiate the class using a class factory. The class factory for TComObject is TComObjectFactory. The class factory properties provide information about TComObject class, such as its name, description, CLSID, and so on. The TComObjectFactory methods are used to register the TComObject class in the registry and to instantiate it.

TComObject can be instantiated either as a single COM object, or as part of an aggregate. The IUnknown methods are implemented in TComObject to support aggregation by appropriately delegating to the controlling IUnknown interface when the instantiated COM object is the inner object of an aggregate. Consequently, for all interfaces that are implemented by the inner COM object, its reference count will not be directly affected when an interface reference is created.

TComObject supports the ISupportErrorInfo interface which allows OLE Automation controllers to query whether an error object will be available, and ensures that error information can be propagated correctly up the call chain. By implementing the ISupportErrorInfo interface method, InterfaceSupportsErrorInfo, TComObject supports the IErrorInfo mechanism, thereby providing support for OLE exception-handling and the safecall calling convention. The information available through the IErrorInfo interface is used for SafeCall error handling.

Using TComObject will not require the instantiated object to have a type library.

Implemented methods of ISupportErrorInfo

InterfaceSupportsErrorInfo method


TComObject properties

TComObject	Alphabetically	Legend

In TComObject

Controller

Factory

RefCount

ServerExceptionHandler


TComObject properties

TComObject	By object	Legend

Controller

Factory

RefCount

ServerExceptionHandler


TComObject.Controller

TComObject	See also

Specifies the controlling IUnknown interface that controls interfaces within an aggregate object.

property Controller: IUnknown;

Description

Controller is the controlling IUnknown interface for the inner object in an aggregate. The QueryInterface, AddRef, and Release methods of all other interfaces of the inner object (except IUnknown) must delegate to the controlling IUnknown. Because of this delegation, the inner object’s reference count is not affected when these methods are called.

Controller is nil if the object is not part of an aggregate. If Controller is non-nil, the object is part of an aggregate, and Controller is the controlling interface.


TComObject.Factory

TComObject	See also

Specifies the class factory object for the TComObject class.

property Factory: TComObjectFactory;

Description

Factory is the class factory which is used to instantiate a TComObject.


TComObject.RefCount

TComObject	See also

Indicates the number of references to the COM object that are currently in use.

property RefCount: Integer;

Description

RefCount is used to determine when the object can be destroyed. RefCount is the number of references to interfaces implemented by the COM object. When RefCount is zero, the object can be is destroyed.

RefCount is automatically incremented when references to interfaces implemented by the COM object are created, and is automatically decremented when those references are destroyed. RefCount is usually incremented by the IUnknown AddRef method and decremented by the IUnknown method, Release.

RefCount can be artificially incremented when a new object is created which may be passed as a function parameter. In this case, RefCount should not be zero, and should be incremented prior to the function call and decremented when the function returns. The CreateFromFactory method artificially increments and decrements RefCount for this reason.


TComObject.ServerExceptionHandler

TComObject	See also	Example

Provides access to the SafeCall exception notification process.

property ServerExceptionHandler: IServerExceptionHandler;

Description

The ServerExceptionHandler property provides a way for you to access the SafeCall exception notification process so that you can log or reroute those notifications to an external monitor. The monitor can be another object within the same COM server module, or it could be on a different machine entirely.

For example, server exception handlers could be implemented to:

Log COM server exceptions to the NT system event log

Write exceptions to a text file

Send email to an administrator

Alert support personnel through a pager

The ServerExceptionHandler property is useful for administering remote servers, particularly if a server is physically unreachable. For example, when an exception is raised in a COM object, if the server application is a VCL forms-based application (not just a DLL), then the VCL default exception handler may show a message box on the server. No client requests on that COM object instance can be serviced until the message box is closed. By reporting the exception to an event log, others can see the information from any remote location, as long as the remote users have access rights on the server.

Tip: 	The ServerExceptionHandler property would be particularly useful for COM objects (either stand-alone or those running in the MTS environment), that are used in active server pages. You can use the ServerExceptionHandler property to write exception information in HTML or in any other format you desire.


TComObject methods

TComObject	Alphabetically

In TComObject

Create

CreateAggregated

CreateFromFactory

Destroy

Initialize

ObjAddRef

ObjQueryInterface

ObjRelease

SafeCallException

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TComObject methods

TComObject	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateAggregated

CreateFromFactory

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

Initialize

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ObjAddRef

ObjQueryInterface

ObjRelease

SafeCallException


TComObject.Create

TComObject	See also

Instantiates a COM object that is not part of an aggregate.

constructor Create;

Description

Call Create to instantiate a COM object that is not part of an aggregate, at runtime.

Create allocates memory for a COM object, and then directly calls the CreateFromFactory constructor, passing it nil as the Controller parameter to indicate that the COM object is not being created as part of an aggregate.


TComObject.CreateAggregated

TComObject	See also

Instantiates a COM object that is part of an aggregate.

constructor CreateAggregated(const Controller: IUnknown);

Description

Call CreateAggregated to instantiate a COM object that is part of an aggregate by passing it the IUnknown control object as the Controller parameter.

CreateAggregated allocates memory for a COM object and then calls the CreateFromFactory constructor. Because the newly instantiated COM object is part of an aggregate, CreateAggregated passes Controller to CreateFromFactory as its Controller parameter. Controller also becomes the value of the Controller property of the COM object.


TComObject.CreateFromFactory

TComObject	See also

Instantiates a COM object and initializes its values.

constructor CreateFromFactory(Factory: TComObjectFactory; const Controller: IUnknown);

Description

Call Create to instantiate a COM object that is not part of an aggregate, at runtime.

Create allocates memory for a COM object, and then initializes the following properties:

Sets RefCount to 1, as a means of artificial reference counting in the case that the newly created object has a zero reference count and is passed as a parameter.

Sets Factory to the Factory parameter, which is the instance of the class factory responsible for creating the object.

Sets Controller to the Controller parameter, which is either a control object, if the object is part of an aggregate, or nil if it is not.

Calls on the COM server to increment the reference count of objects dependent on it.

Calls Initialize.

Decrements the RefCount that was artificially incremented.


TComObject.Destroy

TComObject	See also

Disposes of an instance of a COM object.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the COM object is not nil before it calls Destroy.

Destroy checks to see if the Factory property is nil. If it is nil, then Destroy passes False to the CountObject method of the Factory object’s ComServer, allowing the DLL (server) to be unloaded if no more objects are dependent upon the server.


TComObject.Initialize

TComObject	See also

Provides an interface to a method that initializes the COM object.

procedure Initialize; virtual;

Description

Initialize currently does nothing. Descendant COM objects can override Initialize to provide some post-creation initialization of the object.


TComObject.ObjAddRef

TComObject

Implements the AddRef method of the IUnknown interface.

function ObjAddRef: Integer; virtual; stdcall;

Description

QueryInterface is used as the implementation of the IUnknown QueryInterface method when the COM object (TComObject) is not part of an aggregate.


TComObject.ObjQueryInterface

TComObject

Implements the QueryInterface method of the IUnknown interface.

Function ObjQueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall;

Description

QueryInterface queries whether the COM object supports a given interface specified by the IID parameter. QueryInterface is used as the implementation of the IUnknown QueryInterface method when the COM object (TComObject) is not part of an aggregate.


TComObject.ObjRelease

TComObject

Implements the Release method of the IUnknown interface.

function ObjRelease: Integer; virtual; stdcall;

Description

QueryInterface is used as the implementation of the IUnknown QueryInterface method when the COM object (TComObject) is not part of an aggregate.


TComObject.SafeCallException

TComObject

Handles OLE exceptions.

function SafeCallException(ExceptObject: TObject; ExceptAddr: Pointer): HResult; override;

Description

SafeCallException prevents an exception from being raised to escape its scope. Any exceptions raised must also be handled within the method.

The implementation of a safecall method guarantees that no exceptions are raised by enclosing the statement part of the method in an implied try...except block.

Note:	SafeCallException calls the global routine HandleSafeCallException, which provides a standard way of handling this behavior. Methods of a CoClass that supports OLE exception handling (that implements the ISupportErrorInfo interface) are affected by this function. If those CoClass methods use the safecall calling convention, they are modified to return an HRESULT. Procedures will return an HRESULT, and functions will pass their usual result value as the last (out) parameter, and will return an HRESULT instead. The method is enclosed in a try...finally block, after which the HRESULT is returned, and the environment is set up so that the ISupportErrorInfo implementation will work correctly.


Accessibility

Read-only


Hierarchy

TObject


TComponentFactory

Hierarchy	Properties	Methods

TComponentFactory is the class factory for creating instances of Delphi components that support interfaces.

Unit

vclcom

Description

TComponentFactory creates instances of component classes that implement interfaces. TComponentFactory supports the IClassFactory interface and inherits support for the IClassFactory2 interface.

Note:	These components are actually created as contained objects of an automation object (aggregate).


TComponentFactory properties

TComponentFactory	Alphabetically	Legend

Derived from TAutoObjectFactory

DispIntfEntry

DispTypeInfo

Derived from TComObjectFactory

ClassID

ClassName

ComClass

ComServer

Description

ErrorIID

Instancing

LicString

ProgID

ShowErrors

SupportsLicensing

ThreadingModel


TComponentFactory properties

TComponentFactory	By object	Legend

ClassID

ClassName

ComClass

ComServer

Description

DispIntfEntry

DispTypeInfo

ErrorIID

Instancing

LicString

ProgID

ShowErrors

SupportsLicensing

ThreadingModel


TComponentFactory methods

TComponentFactory	Alphabetically

In TComponentFactory

Create

Derived from TAutoObjectFactory

GetIntfEntry

Derived from TTypedComObjectFactory

ClassInfo

GetInterfaceTypeInfo

UpdateRegistry

Derived from TComObjectFactory

CreateComObject

Destroy

RegisterClassObject

Derived from TObject

AfterConstruction

BeforeDestruction

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TComponentFactory methods

TComponentFactory	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassNameIs

ClassParent

ClassType

CleanupInstance

CreateComObject

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetInterfaceTypeInfo

GetIntfEntry

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RegisterClassObject

SafeCallException

UpdateRegistry


TComponentFactory.Create

TComponentFactory	See also

Instantiates an instance of a TComponentFactory object.

constructor Create(ComServer: TComServerObject; ComponentClass: TComponentClass; const ClassID: TGUID; Instancing: TClassInstancing; ThreadingModel: TThreadingModel = tmSingle);

Description

Create allocates memory for a TComponentFactory object, and calls the inherited Create, passing its parameters in the same order. The ComponentClass parameter is passed cast as a TAutoClass and passed to the AutoClass parameter.

Accessibility

Read-only


Hierarchy

TObject

TComObjectFactory

TTypedComObjectFactory

TAutoObjectFactory


TComServer

Hierarchy	Properties	Methods	Events	See also

TComServer is the class type of the ComServ variable that is declared and instantiated in the ComServ unit.

Unit

comserv

Description

TComServer is the class type used for a COM server, which is a module that contains COM or OLE class definitions. That module can be either an in-process server (DLL) or a local server (EXE).

TComServer properties contain all necessary information about the server, such as its type library, name, Help file, and so on. They also indicate when and how the server should be loaded and unloaded.

TComServer methods are used

To access TComServer properties.

To create associated class factories to instantiate the COM and OLE classes based upon their class identifier (CLSID).

To update the registry database with information about the COM and OLE classes.

TComServer is the type of ComServ variable that is automatically instantiated in the ComServ unit. Each module that is created as a server for COM objects has its own instance of ComServ.

To manage its class factories, the ComServer uses a TComClassManager object, which is accessed using the ComClassManager function in the ComObj unit. The class factories are used primarily by calls to TComClassManager methods.

Note:	The ComServ unit declares and implements global routines that must be exported by each in-process server. These routines automatically handle the registering, unregistering, and unloading of the COM server.


TComServer properties

TComServer	Alphabetically	Legend

In TComServer

HelpFileName

IsInprocServer

ObjectCount

ServerFileName

ServerKey

ServerName

StartMode

StartSuspended

TypeLib


TComServer properties

TComServer	By object	Legend

HelpFileName

IsInprocServer

ObjectCount

ServerFileName

ServerKey

ServerName

StartMode

StartSuspended

TypeLib


TComServer.HelpFileName

TComServer

Specifies the name of the Help file associated with the module.

property HelpFileName: string;

Description

Use HelpFileName to find the name of the Help file used for the COM server.


TComServer.IsInprocServer

TComServer	See also

Indicates whether the COM server is an in-process server.

property IsInprocServer: Boolean;

Description

InProcServer indicates whether the COM server is an in-process server, meaning that it is running the same process space as the object’s container. The value of this property is set in the COM server’s constructor and is determined by the IsLibrary variable.

Delphi assumes that all OLE automation servers in DLLs are in-process servers, and that those in applications are not.


TComServer::ObjectCount
TComServer.ObjectCount

TComServer	See also

Indicates how many objects are currently dependent upon the server.

property ObjectCount: Integer;

Description

ObjectCount indicates when the server can be unloaded. ObjectCount contains the number of objects that are currently dependent upon the server.

ObjectCount is incremented when new objects are created from class factories, and is decremented when objects are destroyed.

When ObjectCount is zero the server can be unloaded. At this time, code written for the OnLastRelease event handler can process special actions after the last object is released and before the server shuts down.


TComServer.ServerFileName

TComServer	See also

Specifies the complete path and file name of the COM server.

property ServerFileName: string;

Description

ServerFileName contains the module name of the COM server. This name includes the path and extension of the file name for the module.


TComServer.ServerKey

TComServer

Indicates whether the COM server is an in-process server (DLL) or whether it is a local server (EXE).

property ServerKey: string;

Description

ServerKey contains the string 'InprocServer32' if the server is a DLL and 'LocalServer32' if the server is an EXE.


TComServer::ServerName
TComServer.ServerName

TComServer	See also

Specifies the name of the file for the server.

property ServerName: string;

Description

ServerName contains the file name, excluding the path and extension, of the COM server.


TComServer.StartMode

TComServer	See also

Indicates why the COM server was started.

type TStartMode = (smStandalone, smAutomation, smRegServer, smUnregServer);

property StartMode: TStartMode;

Description

StartMode indicates the reason a COM server was started: as a stand-alone, as an interactive application, as an embedded object, or for registration or unregistration with the system Registry.

TStartMode is the type of the StartMode property, indicating the different reasons why an OLE automation server can be started.

The following table explains each of the possible start-mode values and the command-line switch that corresponds to each.

Start mode	Switch	Meaning

smAutomation	embedding	The application was started by Windows in response to a request from an automation controller.

smRegServer	regserver	The application was started only to add the server to the system registry.

smStandalone	---	The user started the application as a stand-alone, interactive application.

smUnregServer	unregserver	The application was started only to remove the server from the system registry.


TComServer.StartSuspended

TComServer	See also

Indicates whether the COM server should register the class factory in a suspended state.

property StartSuspended: Boolean;

Description

StartSuspended is a Boolean property that indicates whether the COM server should register the class factory in a suspended state to prevent COM from trying to create an instance of a COM object while the server application is still loading.

This is primarily for internal use.


TComServer.TypeLib

TComServer

Provides access to the type library associated with the COM server.

property TypeLib: ITypeLib;

Description

Use TypeLib to access the type library for the COM server. TypeLib is a reference to an ITypeLib interface.


TComServer events

TComServer	Alphabetically

In TComServer

OnLastRelease


TComServer events

TComServer	By object

OnLastRelease


TComServer.OnLastRelease

TComServer	See also

Occurs when the last object using the server is released.

type TLastReleaseEvent = procedure(var Shutdown: Boolean) of object;

property OnLastRelease: TLastReleaseEvent;

Description

Use OnLastRelease to write a handler to process some action after the last object using the server is released, and just before the server shuts down. ShutDown indicates whether the server should be unloaded.

TLastReleaseEvent is the type of the OnLastRelease event. Shutdown indicates whether the server will shut down after processing the OnLastRelease event.


TComServer methods

TComServer	Alphabetically

In TComServer

Create

Destroy

Initialize

LoadTypeLib

SetServerName

UpdateRegistry

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TComServer methods

TComServer	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

Initialize

InitInstance

InstanceSize

LoadTypeLib

MethodAddress

MethodName

NewInstance

SafeCallException

SetServerName

UpdateRegistry


TComServer.Create

TComServer	See also

Creates a COM server object.

constructor Create;

Description

Applications do not need to call the constructor for TComServer.  An instance of TComServer is automatically created as the ComServ variable in modules that are servers for COM objects.

Create allocates memory for a COM server object, and initializes its IsInprocServer and StartMode properties. It is not necessary to directly call the constructor to create a COM server object. A global ComServer variable is declared in the ComServ unit and is instantiated in the initialization section.


TComServer.Destroy

TComServer	See also

Destroys an instance of a COM server object.

destructor Destroy; override;

Description

It is not necessary to directly call Free (or Destroy) to destroy a COM server object. The global ComServ variable, declared in the ComServ unit, is automatically created and destroyed in the initialization and finalization sections.

Destroy destroys the COM server object and calls the ComClassManager to free, from the list it maintains, each of the class factories that the server owns.


TComServer.Initialize

TComServer	See also

Updates the registry and registers the class objects.

procedure Initialize;

Description

Initialize updates the registry if the server was not started only to remove the server from the system registry. Then, if the server was started as an interactive stand-alone application, or in response to a request from an automation controller, Initialize calls on each class factory owned by the server, to register its class object in the system registry.


TComServer.LoadTypeLib

TComServer	See also

Loads the type library for the server.

procedure LoadTypeLib;

Description

LoadTypeLib loads the type library for the server. If the type library is not already loaded when LoadTypeLib is called, it also registers the type library.

If LoadTypeLib is not successful, it raises an EOleSysError indicating the error code. The possible error codes are as follows:

Error code	Meaning

E_OUTOFMEMORY	Out of memory.

E_INVALIDARG	One or more of the arguments is invalid.

TYPE_E_IOERROR	The function could not write to the file.

TYPE_E_INVALIDSTATE	The type library could not be opened.

TYPE_E_INVDATAREAD	The function could not read from the file.

TYPE_E_UNSUPFORMAT	The type library has an older format.

TYPE_E_UNKNOWNLCID	The LCID could not be found in the OLE support DLLs.

TYPE_E_CANTLOADLIBRARY	The type library or DLL could not be loaded.

Other return codes	All FACILITY_STORAGE errors may be returned.


TComServer::SetServerName
TComServer.SetServerName

TComServer	See also

Sets the ServerName property.

procedure SetServerName(const Name: string);

Description

Call SetServerName to provide a name for the server. If the server has an associated type library (the TypeLib property is nil), SetServerName does nothing, because the name for the server must match the name specified in the type library.


TComServer.UpdateRegistry

TComServer	See also

Registers information on classes implemented in the COM server.

procedure UpdateRegistry(Register: Boolean);

Description

UpdateRegistry updates the registry to reflect the current status of the COM server. Accordingly, UpdateRegistry either registers or unregisters the type library information and the CLSIDs associated with the class factories instantiated by the COM server.

The global functions that register and unregister the server call UpdateRegistry. UpdateRegistry is also called by the Initialize method.


Accessibility

Read-only


Hierarchy

TObject

TComServerObject


TComServerObject

Hierarchy	Properties	Methods	See also

TComServerObject is the abstract base class for TComServer.

Unit

comobj

Description

TComServerObject is used as a base class for the TComServer class. All of its methods are abstract and protected. The TComServerObject introduces protected abstract methods that are overridden in descendant classes as accessor functions for its properties. These methods are implemented in the TComServer class. All of the properties of TComServerObject are read-only.

To use a COM server object, include the ComServ unit in the project. This unit automatically instantiates the descendant TComServer class and assigns that object to the ComServ variable in the ComServ unit.


TComServerObject properties

TComServerObject	Alphabetically	Legend

In TComServerObject

HelpFileName

ServerFileName

ServerKey

ServerName

StartSuspended

TypeLib


TComServerObject properties

TComServerObject	By object	Legend

HelpFileName

ServerFileName

ServerKey

ServerName

StartSuspended

TypeLib


TComServerObject.HelpFileName

TComServerObject

Specifies the name of the Help file associated with the module.

property HelpFileName: string;

Description

The abstract accessor methods for HelpFileName are overridden in descendant classes.


TComServerObject.ServerFileName

TComServerObject	See also

Specifies the complete path and filename of the COM server.

property ServerFileName: string;

Description

The abstract accessor methods for ServerFileName are overridden in descendant classes.


TComServerObject.ServerKey

TComServerObject

Indicates whether the COM server is an in-process server or whether it is a local server.

property ServerKey: string;

Description

The abstract accessor methods for ServerKey are overridden in descendant classes.


TComServerObject.ServerName

TComServerObject	See also

Specifies the name of the executable file for the server.

property ServerName: string;

Description

The abstract accessor methods for ServerName are overridden in descendant classes.


TComServerObject.StartSuspended

TComServerObject	See also

Specifies whether the server started in a suspended state.

property StartSuspended: Boolean;

Description

StartSuspended specifies whether the server started in a suspended state.


TComServerObject.TypeLib

TComServerObject

Provides access to the type library associated with the COM server.

property TypeLib: ITypeLib;

Description

The abstract accessor methods for TypeLib are overridden in descendant classes.


TComServerObject methods

TComServerObject	Alphabetically

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TComServerObject methods

TComServerObject	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Accessibility

Read-only


Hierarchy

TObject


TConnectionPoints

Hierarchy	Properties	Methods

TConnectionPoints implements a container for connection points.

Unit

axctrls

Description

TConnectionPoints lets an object indicate the existence of outgoing interfaces.

The IConnectionPointContainer interface is implemented on a connectable object to indicate the existence of the outgoing interfaces. It provides access to an enumerator sub-object with the IEnumConnectionPoints interface.

It also provides access to all the connection point sub-objects, each of which implements the IConnectionPoint interface. The IConnectionPoint interface provides access to an enumerator sub-object with the IEnumConnections interface.

TConnectionPoints objects are used to obtain access to:

An enumerator sub-object with the IEnumConnectionPoints interface. The IEnumConnectionPoints interface can be used to enumerate connection points for each outgoing IID.

Connection point sub-objects with the IConnectionPoint interface for each outgoing IID. Through the IConnectionPoint interface, a client starts or terminates an advisory loop with the connectable object and the client's own sink. The client can also use the IConnectionPoint interface to obtain an enumerator object with the IEnumConnections interface to enumerate the connections that it knows about.

The IConnectionPoint and IConnectionPointContainer interfaces are used for OLE event handling. Because the ActiveX wizard automatically sets up events for a control, users only need to use these interfaces directly when they wish to modify the standard VCL implementation or to add events to a non-ActiveX control automation server.

Interface implemented

IConnectionPointContainer


TConnectionPoints properties

TConnectionPoints	Alphabetically	Legend

In TConnectionPoints

ControllerTConnectionPoints_Controller>Main


TConnectionPoints properties

TConnectionPoints	By object	Legend

Controller


TConnectionPoints.Controller

TConnectionPoints	See also

Provides access to the IUnknown of the connection points.

property Controller: IUnknown;

Description

Controller is the IUnknown interface reference of the connection points object. TConnectionPoints aggregates several sub-objects that share this interface as a single controlling IUnknown. The IUnknown methods implemented in the sub-objects delegate to this Controller.

When the TConnectionPoints object is created, its constructor is passed a controlling IUnknown. Controller is initialized to this IUnknown in the constructor.


TConnectionPoints methods

TConnectionPoints	Alphabetically

In TConnectionPoints

Create

CreateConnectionPoint

Destroy

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TConnectionPoints methods

TConnectionPoints	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateConnectionPoint

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TConnectionPoints.Create

TConnectionPoints	See also

Instantiates a connection points object.

constructor Create(const AController: IUnknown);

Description

It is not necessary to call Create directly. It is used internally by other objects to create the connection points object.

Create allocates memory for a connection points object and initializes the Controller property using the AController parameter.  Then it creates a list for the individual connection point objects that it will contain.


TConnectionPoints.CreateConnectionPoint

TConnectionPoints	See also

Instantiates a connection point object.

 type

TConnectionKind = (dkSingle, dkMulti);

  TConnectEvent = procedure(const Sink: Iunknown; Connecting: Boolean) of object;

function CreateConnectionPoint(const IID: TGUID; Kind: TConnectionKind; OnConnect: TConnectEvent): ConnectionPoint;

Description

CreateConnectionPoint is automatically called when an ActiveX control is initialized. CreateConnectionPoint creates and returns a connection point object. It passes to the connection point constructor:

•	Itself as the connection point container.

•	IID as the GUID or interface identifier of the outgoing interface managed by this connection point.

•	OnConnect as the connection event used in the IConnectionPoint Advise method.

TConnectEvent is a pointer to a procedure for the OnConnect event of the connection point object being created.  TConnectionKind is a type indicating whether there are multiple connections to that connection point.


TConnectionPoints.Destroy

TConnectionPointsSee also

Destroys an instance of a connection points object.

destructor Destroy; override;

Description

Destroy is called automatically. It is not necessary for the user to dispose of the connection points object. Destroy frees the list of connection point objects that was created in the constructor.


Accessibility

Read-only


Hierarchy

TObject


TConnectionPoint

Hierarchy	Properties	Methods	See also

TConnectionPoint is the class used to create connection point objects for connection point containers.

Unit

axctrls

Description

TConnectionPoint is a class that implements the IConnectionPoint interface. It is used to create objects that are connection points for connectable objects. Connectable objects support the following features:

Outgoing interfaces, such as event sets.

The ability to enumerate the IIDs of the outgoing interfaces.

The ability to connect and disconnect sinks to the object for those outgoing IIDs.

The ability to enumerate the connections that exist to a particular outgoing interface.

The IConnectionPoint and IConnectionPointContainer interfaces are used for OLE event handling. Because the Delphi ActiveX wizard automatically sets up events for a control, users will only need to use these interfaces directly when they wish to modify the standard VCL implementation or to add events to a non-ActiveX control automation server.

Implemented methods of IConnectionPoint

GetConnectionInterface, GetConnectionPointContainer, Advise, Unadvise, EnumConnections


TConnectionPoint properties

TConnectionPoint	Alphabetically	Legend

In TConnectionPoint

SinkList

Derived from TAggregatedObject

Controller


TConnectionPoint properties

TConnectionPoint	By object	Legend

Controller

SinkList


TConnectionPoint.SinkList

TConnectionPoint

Lists the sinks for the outgoing interfaces maintained by the connection point.

property SinkList: TList;

Description

SinkList lists the sinks managed by the connection point. Each item in the list can be cast to an IUnknown and used to access the outgoing interface.


TConnectionPoint methods

TConnectionPoint	Alphabetically

In TConnectionPoint

Create

Destroy

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TConnectionPoint methods

TConnectionPoint	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TConnectionPoint.Create

TConnectionPoint	See also

Instantiates a connection point object.

type

  TConnectionKind = (dkSingle, dkMulti);

  TConnectEvent = procedure(const Sink: Iunknown; Connecting: Boolean) of object;

constructor Create(Container: TConnectionPoints; const IID: TGUID; OnConnect: TConnectEvent);

Description

Create is called automatically by the connection point container’s CreateConnectionPoint method, to instantiate a connection point object. This occurs when an ActiveX control is initialized.

Create allocates memory for a connection point object and calls the inherited Create, passing it the Container’s controlling IUnknown. Container is a connection point container object. Create adds the connection point object to the Container. Then it sets the

IID as the GUID or interface identifier of the outgoing interface managed by this connection point.

IKind, indicating whether it is a single or multiple connection to that point.

OnConnect as the connection event used in the IConnectionPoint Advise method.

TConnectEvent points to a procedure for the OnConnect event of the connection point. TConnectionKind is a type indicating whether there are multiple connections to the connection point.


TConnectionPoint.Destroy

TConnectionPoint	See also

Destroys the instance of a connection point object.

destructor Destroy; override;

Description

It is not necessary to explicitly free the connection point object. Connection point objects are automatically destroyed. If the connection point container object is not nil, Destroy calls on it to remove the connection point object from it.


Accessibility

Read-only


Hierarchy

TObject

TAggregatedObject

TContainedObject


 TControlBar

Hierarchy	Properties	Methods	Events	See also

TControlBar manages the layout of toolbar components.

Unit

Extctrls

Description

Use TControlBar as a docking site for toolbar components. Control bars contain child controls (usually TToolBar objects) that can be moved and resized independently. As with a cool bar, each child control resides on its own individual band that the user positions by dragging its sizing grip.


TControlBar properties

TControlBar	Alphabetically	Legend

Derived from TCustomControlBar

AutoDock

AutoDrag

Picture

RowSize

RowSnap

Derived from TCustomControl

Canvas

Derived from TWinControl

BevelEdges

BevelInner

BevelKind

BevelOuter

BevelWidth

BorderWidth

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DockSite

DoubleBuffered

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

AutoSize

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TControlBar properties

TControlBar	By object	Legend

Action

Align

Anchors

AutoDock

AutoDrag

AutoSize

BevelEdges

BevelInner

BevelKind

BevelOuter

BevelWidth

BiDiMode

BorderWidth

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DockSite

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

Picture

PopupMenu

RowSize

RowSnap

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TControlBar events

TControlBar	Alphabetically	Legend

Derived from TCustomControlBar

OnBandDrag

OnBandInfo

OnBandMove

OnBandPaint

OnPaint

Derived from TWinControl

OnDockDrop

OnDockOver

OnEnter

OnExit

OnGetSiteInfo

OnUnDock

Derived from TControl

OnCanResize

OnClick

OnConstrainedResize

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock

OnStartDrag


TControlBar events

TControlBar	By object	Legend

OnBandDrag

OnBandInfo

OnBandMove

OnBandPaint

OnCanResize

OnClick

OnConstrainedResize

OnContextPopup

OnDblClick

OnDockDrop

OnDockOver

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnGetSiteInfo

OnMouseDown

OnMouseMove

OnMouseUp

OnPaint

OnResize

OnStartDock

OnStartDrag

OnUnDock


TControlBar methods

TControlBar	Alphabetically

Derived from TCustomControlBar

Create

Destroy

StickControls

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TControlBar methods

TControlBar	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

StickControls

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomControlBar


TCookie

Hierarchy	Properties	Methods	See also

TCookie represents a Cookie header in an HTTP response message.

Unit

httpapp

Description

Use TCookie to specify the cookie header that should be sent with a response message when responding to an HTTP request message. Cookie headers contain state information that the Web client passes on to other locations on the internet or intranet.


TCookie properties

TCookie	Alphabetically	Legend

In TCookie

Domain

Expires

HeaderValue

Name

Path

Secure

Value

Derived from TCollectionItem

Collection

DisplayName

ID

Index


TCookie properties

TCookie	By object	Legend

Collection

DisplayName

Domain

Expires

HeaderValue

ID

Index

Name

Path

Secure

Value


TCookie.Domain

TCookie	See also

Specifies the Domain field of the cookie header.

property Domain: string;

inDescription

Use Domain to limit the recipients of the cookie header to certain domains. The Web client will only send this cookie on to URIs in the specified domain.  To limit the recipients to certain paths within the specified domain, use the Path property.


TCookie.Expires

TCookie	See also	Example

Specifies when the cookie is no longer valid.

property Expires: TDateTime;

Description

Set Expires to the date and time after which the Web client should not send the cookie on with HTTP messages.


TCookie.HeaderValue

TCookie	See also

Specifies the Cookie header string that represents this TCookie object.

property HeaderValue: string;

Description

Read HeaderValue to determine the Cookie header that is added to the HTTP response message for this TCookie object. HeaderValue combines the information specified by the Name and Value properties into a single Name=Value field, and then adds the Domain, Path, Expires, and Secure fields based on the values of the properties with the corresponding names.


TCookie.Name

TCookie	See also	Example

Specifies the name of the custom field represented by this Cookie header.

property Name: string;

}Description

Set Name to the name that identifies the use of the Value property in the Cookie header. The Value property is combined with the Name property into a string of the form Name=Value.  This string appears as one of the fields in the Cookie header represented by the HeaderValue property.


TCookie.Path

TCookie	See also

Identifies the paths of URLs to which the Cookie should be sent.

property StartValue: string;

Description

Use Path to limit the recipients of the cookie header to certain paths. The Web client will only send this cookie header on to URLs with the specified path.  To limit the recipients to certain domains, use the Domain property.


TCookie.Secure

TCookie	Example

Determines whether the Web client must use a secure connection to pass on the Cookie header.

property Secure: Boolean;

Description

Set Secure to True if the Web client must use a secure connection when sending the Cookie header.  Secure connections are connections where messages may not be stored on any permanent medium such as a back-up tape. If the message is stored temporarily in a file, the file must be deleted.

Set Secure to False if it does not matter whether the Cookie header is sent using a secure connection.


TCookie.Value

TCookie	See also	Example

Specifies the value of the Cookie header field named by the Name property.

property Value: string;

Description

Set Value to the value associated with the field named by the Name property. The Value property is combined with the Name property into a string of the form Name=Value.  This string appears as one of the fields in the Cookie header represented by the HeaderValue property.


TCookie methods

TCookie	Alphabetically

In TCookie

AssignTo

Create

Derived from TCollectionItem

Destroy

GetNamePath

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCookie methods

TCookie	By object

AfterConstruction

Assign

AssignTo

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCookie.AssignTo

TCookie	See also

Copies the properties of the TCookie object to another TCookie object.

procedure AssignTo(Dest: TPersistent); override;

Description

Do not call the AssignTo method for TCookie.  Instead, call the Assign method of the destination object.  The Assign method of the destination object calls the AssignTo method if it does not contain code for copying the properties of a TCookie object.  If the destination object is a TCookie object, AssignTo copies the Name, Value, Domain, Path, Expires, and Secure properties so the destination cookie generates the same Cookie header string.


;TCookie.Create
TCookie.Create

TCookie	See also

Creates an instance of TCookie.

constructor Create(Collection: TCollection); override;

Description

It is seldom necessary to call the constructor for TCookie directly.  Instead, create TCookie objects indirectly by calling the Add method of TCookieCollection.

After calling the inherited constructor, Create initializes the Expires property to indicate no expiration date.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem


TCustomPageProducer

Hierarchy	Properties	Methods	See also

TCustomPageProducer is the base class for objects that produce a string of HTML commands based on an input template.

Unit

httpapp

Description

Use TCustomPageProducer as a base class when defining an object that converts an HTML template into a string of HTML commands which can be interpreted by a client application such as a Web browser. HTML templates include HTML commands and HTML-transparent tags that are replaced with customized content by the page producer.


TCustomPageProducer properties

TCustomPageProducer	Alphabetically	Legend

In TCustomPageProducer

HTMLDoc

HTMLFile

StripParamQuotes

Derived from TCustomContentProducer

Dispatcher

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomPageProducer properties

TCustomPageProducer	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Dispatcher

HTMLDoc

HTMLFile

Name

Owner

StripParamQuotes

Tag

VCLComObject


TCustomPageProducer.HTMLDoc

TCustomPageProducer	See also

Specifies the HTML template used to generate the value returned by the Content method.

property HTMLDoc: TStrings;

Description

Set HTMLDoc to a set of strings that make up the HTML template. Each string is a sequence of one or more HTML commands or HTML-transparent tags. An HTML-transparent tag has the form

<#TagName Param1=Value1 Param2=Value2 ...>

A pound sign (#) immediately follows the opening angle bracket (<) with no spaces separating it from the angle bracket. The pound sign identifies the string to the page producer as an HTML-transparent tag. The tag name immediately follows the pound sign with no spaces separating it from the pound sign. The page producer converts the entire HTML-transparent tag into true HTML commands based on the value of the tag name. Following the tag name, the HTML-transparent tag can optionally include parameters that specify details of the conversion to be performed. Each parameter is of the form ParamName=Value, where there is no space between the parameter name, the equals symbol (=) and the value. Each parameter is delimited by white space.

The angle brackets (< >) make the tag transparent to HTML browsers that do not recognize the #TagName construct.

The Content method converts HTMLDoc into a final HTML string by calling the HandleTag method to convert each HTML-transparent tag in HTMLDoc.

Note:	Setting HTMLDoc clears the HTMLFile property.


TCustomPageProducer.HTMLFile

TCustomPageProducer	See also

Specifies the name of a file that contains the HTML template used to generate the value returned by the Content method.

property HTMLFile: TFileName;

Description

Set HTMLFile to the name of the file that contains an HTML template. The HTML template is a sequence of HTML commands and HTML-transparent tags. An HTML-transparent tag has the form

<#TagName Param1=Value1 Param2=Value2 ...>

A pound sign (#) immediately follows the opening angle bracket (<) with no spaces separating it from the angle bracket. The pound sign identifies the string to the page producer as an HTML-transparent tag. The tag name immediately follows the pound sign with no spaces separating it from the pound sign. The page producer converts the entire HTML-transparent tag into true HTML commands based on the value of the tag name. Following the tag name, the HTML-transparent tag can optionally include parameters that specify details of the conversion to be performed. Each parameter is of the form ParamName=Value, where there is no space between the parameter name, the equals symbol (=) and the value. Each parameter is delimited by white space.

The angle brackets (< >) make the tag transparent to HTML browsers that do not recognize the #TagName construct.

The Content method converts the HTML template into a final HTML string by calling the HandleTag method to convert each HTML-transparent tag in HTMLFile.

Note:	Setting HTMLFile clears the HTMLDoc property.

Note:	When distributing applications that contain page producers which use the HTMLFile property, be sure to distribute the file along with the application. Also, be sure that the value of HTMLFile does not include a hard-coded path name that will not be available on the user’s disk.


TCustomPageProducer.StripParamQuotes

TCustomPageProducer	See also

Specifies whether to strip quotation marks when extracting the parameters from an HTML-transparent tag.

property StripParamQuotes: Boolean;

Description

Set StripParamQuotes to indicate whether the page producer should strip quotation marks from the parameters of HTML-transparent tags before handling the tags. By setting StripParamQuotes to True, the page producer compensates for HTML editors that automatically insert quotation marks around the values of tag options. If you do not use an HTML editor that inserts quotes around tag options when creating the value of HTMLDoc or HTMLFile, StripParamQuotes can be left as False.

Once the parameter values have been extracted from the HTML-transparent tag, the page producer passes them to the HandleTag method. Typically, HandleTag then passes these parameters to an OnHTMLTag event handler.


TCustomPageProducer methods

TCustomPageProducer	Alphabetically	Legend

In TCustomPageProducer

Content

ContentFromStream

ContentFromString

Create

Destroy

HandleTag

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomPageProducer methods

TCustomPageProducer	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Content

ContentFromStream

ContentFromString

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HandleTag

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TCustomPageProducer.Content

TCustomPageProducer	See also	Example

Returns the HTML code produced by the HTML page producer.

function Content: string; override;

Description

Call Content to get the HTML commands that result from converting the HTML template. Content reads the template from HTMLDoc or HTMLFile, depending on which property is set. Content replaces each HTML-transparent tag in the HTML template with the code returned by the HandleTag method.


TCustomPageProducer.ContentFromStream

TCustomPageProducer	See also

Returns the HTML code that results from converting an HTML template that is read from a stream.

function ContentFromStream(Stream: TStream): string; override;

Description

Call ContentFromStream to convert an HTML template that can be read from a stream. The HTML template is a sequence of HTML commands and HTML-transparent tags. ContentFromStream replaces each HTML-transparent tag in the HTML template read from the stream with a string returned by the HandleTag method.


TCustomPageProducer.ContentFromString

TCustomPageProducer	See also	Example

Returns the HTML code that results from converting the string S.

function ContentFromString(const S: string): string; override;

Description

Call ContentFromString to convert a string that consists of an HTML template. An HTML template is a sequence of HTML commands and HTML-transparent tags. ContentFromString replaces each HTML-transparent tag in the HTML template with a string returned by the HandleTag method.


TCustomPageProducer.Create

TCustomPageProducer	See also

Creates an instance of TCustomPageProducer.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of  TCustomPageProducer. After calling the inherited constructor, Create allocates the TStrings object that implements the HTMLDoc property.


TCustomPageProducer.Destroy

TCustomPageProducer	See also

Destroys an instance of TCustomPageProducer.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the page producer reference is not nil, and only then calls Destroy.

Destroy frees the TStrings object implements the HTMLDoc property before calling the inherited destructor.


TCustomPageProducer.HandleTag

TCustomPageProducer	See also

Converts an HTML-transparent tag into one or more HTML commands or HTML-transparent tags.

function HandleTag(const TagString: string; TagParams: TStrings): string; virtual;

Description

Applications can’t call this protected method directly. HandleTag is called by the Content method, the ContentFromStream method, or the ContentFromString method to convert the HTML-transparent tags in an HTML template. Each HTML-transparent tag has the form

<#TagName Param1=Value1 Param2=Value2 ...>

A pound sign (#) immediately follows the opening angle bracket (<) with no spaces separating it from the angle bracket. The tag name immediately follows the pound sign with no spaces separating it from the pound sign. Following the tag name, the HTML-transparent tag can optionally include parameters that specify details of the conversion to be performed. Each parameter is of the form ParamName=Value, where there is no space between the parameter name, the equals symbol (=) and the value. Each parameter is delimited by white space.

The TagString parameter is the tag name portion of the HTML-transparent tag with the pound sign stripped off. The TagParams parameter is the parameter portion of the HTML-transparent tag. HandleTag returns the HTML-transparent tag with the parameters stripped off. Web browsers that read the resulting HTML will ignore the string returned from HandleTag.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TCustomContentProducer


TCriticalSection

Hierarchy	Methods	See also

TCriticalSection allows a single thread in a multi-threaded application to temporarily block the execution of all other threads.

Unit

syncobjs

Description

Use TCriticalSection to safeguard operations that may be disrupted if another thread executes before the operation is completed. Critical sections work like gates that allow only a single thread to enter at a time. Because they block the execution of all other threads, overusing critical sections can seriously interfere with performance.

Critical sections must be global in scope so that they are available to all threads. In every thread, any action that could interfere with the operations safeguarded by the critical section should only take place after calling the Acquire or Enter method.  Threads that do not use the critical section for relevant operations can introduce bugs.


TCriticalSection methods

TCriticalSection	Alphabetically

In TCriticalSection

Acquire

Create

Destroy

Enter

Leave

Release

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCriticalSection methods

TCriticalSection	By object

Acquire

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

Enter

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

Leave

MethodAddress

MethodName

NewInstance

Release

SafeCallException


TCriticalSection.Acquire

TCriticalSection	See also

Binds the critical section to the calling thread.

procedure Acquire; override;

Description

Call Acquire to block all other threads from acquiring this critical section until the Release or Leave method is called. Acquire does the same thing as the Enter method.


TCriticalSection.Create

TCriticalSection	See also

Creates an instance of TCriticalSection.

constructor Create;

Description

Call Create to create and initialize an instance of TCriticalSection. A TCriticalSection object can be created for a single object that contains thread-sensitive code, or as a global object to be shared by several threads.


TCriticalSection.Destroy

TCriticalSection	See also

Destroys an instance of TCriticalSection.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TCriticalSection object is not nil, and only then calls Destroy.


TCriticalSection.Enter

TCriticalSection	See also

Blocks other threads when the calling thread enters a thread-sensitive section.

procedure Enter;

Description

Call Enter to block all other threads from entering code protected by this critical section until the Leave or Release method is called. Enter calls the Acquire method to bind the critical section to the calling thread.


TCriticalSection.Leave

TCriticalSection	See also

Allows other threads to use the critical section.

procedure Leave;

Description

Call Leave at the end of a thread-sensitive section of code. Each call to Leave should be balanced by a call to Enter or Acquire at the beginning of the thread-sensitive section. Leave calls Release to allow other threads to acquire the critical section.


TCriticalSection.Release

TCriticalSection	See also

Allows other threads to use the critical section.

procedure Release; override;

Description

Call Release when the thread no longer needs to block other threads from executing code that is protected by this critical section. Each call to Release should be balance by an earlier call to Acquire or Enter that blocked other threads from executing. Release does the same thing as the Leave method.


Hierarchy

TObject

TSynchroObject


TCustomServerSocket

Hierarchy	Properties	Methods	Events	See also

TCustomServerSocket is the base class for all server socket components.

Unit

scktcomp

Description

TCustomServerSocket introduces new properties and events specific to the functions of a TCP/IP server.

Do not create instances of TCustomServerSocket. Use TCustomServerSocket as a base class when declaring server socket objects that listen for connection requests from other machines.


TCustomServerSocket properties

TCustomServerSocket	Alphabetically	Legend

In TCustomServerSocket

ServerType

ThreadCacheSize

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomServerSocket properties

TCustomServerSocket	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

ServerType

Tag

ThreadCacheSize

VCLComObject


TCustomServerSocket.ServerType

TCustomServerSocket	See also

Specifies whether each connection accepted by the server socket is non-blocking, or if it is automatically given a separate execution thread.

type TServerType = (stNonBlocking, stThreadBlocking);

property ServerType: TServerType;

Description

Set ServerType to stThreadBlocking to automatically spawn a new thread for each socket connection accepted by the server socket. When ServerType is stThreadBlocking, the execution of the connection thread is suspended while reading or writing until all information has been transferred over the connection. The thread for each connection generates OnClientRead or OnClientWrite events when the server socket needs to read or write.

Set ServerType to stNonBlocking to handle all reading and writing over the socket connections asynchronously. When ServerType is stNonBlocking, all client connections are handled in a single execution thread by default. OnClientRead or OnClientWrite events occur when the client socket on the other end of one of the connections tries to send or receive information over the connection.

Use a non-blocking socket when the socket needs to synchronize reading and writing with client sockets.

Note:	When ServerType is stThreadBlocking, it is important that the OnClient... event handlers contain thread-safe code.


TCustomServerSocket.ThreadCacheSize

TCustomServerSocket	See also

Specifies the maximum number of threads that can be reused for new client connections.

property ThreadCacheSize: Integer;

Description

When ServerType is stThreadBlocking, each new connection that is accepted by the server socket is given a separate execution thread. In order to improve performance, server sockets store these threads in a cache rather than freeing them when the connection is closed. New connections can then reuse threads from the cache, rather than requiring the socket server to create a new thread every time a connection is accepted.

Set ThreadCacheSize to specify the number of threads that are cached for re-use. The ideal value for ThreadCacheSize depends on the number and frequency of client socket requests received by the server socket. If ThreadCacheSize is too low, the server socket will spend more time freeing and creating threads when client connections are accepted. If ThreadCacheSize is too high, the server socket may unnecessarily lock up the memory for threads that are never reused.


TCustomServerSocket events

TCustomServerSocket	Alphabetically	Legend

In TCustomServerSocket

OnClientConnect

OnClientDisconnect

OnClientError

OnClientRead

OnClientWrite

OnGetSocket

OnGetThread

OnThreadEnd

OnThreadStart


TCustomServerSocket events

TCustomServerSocket	By object	Legend

OnClientConnect

OnClientDisconnect

OnClientError

OnClientRead

OnClientWrite

OnGetSocket

OnGetThread

OnThreadEnd

OnThreadStart


TCustomServerSocket.OnClientConnect

TCustomServerSocket	See also

Occurs when a client socket completes a connection accepted by the server socket.

property OnClientConnect: TSocketNotifyEvent;

Description

Write an OnClientConnect event handler to take specific action when a client socket completes the socket connection to the server socket. For example, the socket may start reading or writing over the connection in an OnClientConnect event handler.

The order of server socket events leading up to OnClientConnect is as follows:

1	An OnListen event occurs just before the server socket is opened for listening.

2	The server socket receives client requests in a listening queue. The server socket accepts one of those requests, and receives a Windows socket handle for the new socket connection.

3	The server socket generates an OnGetSocket event, passing in the Windows socket handle. If a TServerClientWinSocket object for the server endpoint of the new connection is not created in an OnGetSocket event handler, the server socket creates one. The TServerWinSocket object continues to listen for other clients.

4	An OnAccept event occurs, using the new TServerClientWinSocket object.

5	If ServerType is stThreadBlocking and no thread is available in the cache, an OnGetThread event occurs. If the OnGetThread event handler does not create a thread, the server socket creates a TServerClientThread.

6	If ServerType is stThreadBlocking, an OnThreadStart event occurs as the thread begins execution.

7	The client completes the connection to the TServerClientWinSocket object and an OnClientConnect event occurs.

Note:	If ServerType is stThreadBlocking, make sure that all code in an OnClientConnect event handler is thread-safe. Use the GetClientThread method of the Sender parameter to access thread-specific information.

Note:	The OnClientConnect event handler for TServerSocket is also set when setting the OnClientConnect event handler of the associated TServerWinSocket.


TCustomServerSocket.OnClientDisconnect

TCustomServerSocket	See also

Occurs when one of the connections to a client socket is closed.

property OnClientDisconnect: TSocketNotifyEvent;

Description

Write an OnClientDisconnect event handler to take specific action when the connection to a client socket is ending. The termination of a client connection does not close the server socket. The server socket remains open and listening for client requests on its listening connection.

The TServerClientWinSocket that describes the server endpoint of the client connection is freed after OnClientDisconnect. If ServerType is stThreadBlocking, OnThreadEnd occurs after OnClientDisconnect.

Note:	If ServerType is stThreadBlocking, make sure that all code in an OnClientDisconnect event handler is thread-safe. Use the GetClientThread method of the Sender parameter to access thread-specific information.

Note:	The OnClientDisconnect event handler for TServerSocket is also set when setting the OnClientDisconnect event handler of the associated TServerWinSocket.


TCustomServerSocket.OnClientError

TCustomServerSocket	See also

Occurs when there is a failure in establishing, using, or terminating the socket connection to an individual client socket.

property OnClientError: TSocketErrorEvent;

Description

Write an OnClientError event handler to respond to errors that arise with a connection to an individual client. Set the ErrorCode parameter to 0 if the OnClientError event handler successfully deals with the error condition to prevent an ESocketError from being raised.

Note:	If ServerType is stThreadBlocking, make sure that all code in an OnClientError event handler is thread-safe. Use the GetClientThread method of the Sender parameter to access thread-specific information.

Note:	The OnClientError event handler for TServerSocket is also set when setting the OnClientError event handler of the associated TServerWinSocket.


TCustomServerSocket.OnClientRead

TCustomServerSocket	See also

Occurs when the server socket should read information from a client socket.

property OnClientRead: TSocketNotifyEvent;

Description

Write an OnClientRead event handler to read from the socket connection. If the ServerType property is stThreadBlocking, use a TWinSocketStream object to prevent problems that arise while reading from causing the execution thread to hang indefinitely. Otherwise, use the methods of the Socket parameter to perform the actual reading.

Note:	If ServerType is stThreadBlocking, make sure that all code in an OnClientRead event handler is thread-safe. Use the GetClientThread method of the Sender parameter to access thread-specific information.


TCustomServerSocket.OnClientWrite

TCustomServerSocket	See also

Occurs when the server socket should write information to a client socket.

property OnClientWrite: TSocketNotifyEvent;

Description

Write an OnClientWrite event handler to write to the socket connection. If the ServerType property is stThreadBlocking, use a TWinSocketStream object to prevent problems that arise while writing from causing the execution thread to hang indefinitely. Otherwise, use the methods of the Socket parameter to perform the actual writing.

Note:	If ServerType is stThreadBlocking, make sure that all code in an OnClientWrite event handler is thread-safe. Use the GetClientThread method of the Sender parameter to access thread-specific information.


TCustomServerSocket.OnGetSocket

TCustomServerSocket	See also

Occurs when the server socket needs to create a new TServerClientWinSocket object to represent the server endpoint of a connection to a client socket.

type

  TGetSocketEvent = procedure (Sender: TObject; Socket: TSocket; var ClientSocket: TServerClientWinSocket) of object;

property OnGetSocket: TGetSocketEvent;

Description

Write an OnGetSocket event handler to create a specialized descendant of TServerClientWinSocket for the server socket component to use. Return the new TServerClientWinSocket object in the ClientSocket parameter. The Sender parameter is the TServerWinSocket object that describes the server endpoint of the listening connection.


TCustomServerSocket.OnGetThread

TCustomServerSocket	See also

Occurs when the server socket needs to create a new execution thread for a connection to a client socket.

type TGetThreadEvent = procedure (Sender: TObject; ClientSocket: TServerClientWinSocket; var SocketThread: TServerClientThread) of object;

property OnGetThread: TGetThreadEvent;

Description

Write an OnGetThread event handler to create a specialized descendant of TServerClientThread for the connection to the client socket. Return the new TServerClientThread object in the SocketThread parameter.

Most applications that use thread-blocking server components will want to provide an OnGetThread event handler and implement a TServerClientThread that handles its own reading and writing in a thread-safe manner rather than relying on the default TServerClientThread which triggers OnClientRead and OnClientWrite events. This is because the OnClientRead and OnClientWrite event handlers reside on the server socket, which is in global memory.

The Sender parameter is the TServerWinSocket object that describes the server endpoint of the listening connection. The ClientSocket parameter is the TServerClientWinSocket object that describes the server endpoint of the connection to the client socket that is about to be formed.


TCustomServerSocket.OnThreadEnd

TCustomServerSocket	See also

Occurs when a client socket connection is terminated and the associated thread finishes execution.

type TThreadNotifyEvent = procedure (Sender: TObject; Thread: TServerClientThread) of object;

property OnThreadEnd: TThreadNotifyEvent;

Description

Write an OnThreadEnd to take specific action when the thread for a client connection finishes execution. OnThreadEnd occurs after the OnClientDisconnect event.

The Sender parameter is the TServerWinSocket that describes the server endpoint of the listening connection. The Thread parameter is the thread that is finishing up.


TCustomServerSocket.OnThreadStart

TCustomServerSocket	See also

Occurs when the execution thread for a connection to a client socket starts up.

type TThreadNotifyEvent = procedure (Sender: TObject; Thread: TServerClientThread) of object;

property OnThreadStart: TThreadNotifyEvent;

Description

Write an OnThreadStart to initialize the TServerClientThread for the connection to a single client socket. The Sender parameter is the TServerWinSocket that describes the server endpoint of the listening connection. The Thread parameter is the thread that is about to start execution.


TCustomServerSocket methods

TCustomServerSocket	Alphabetically	Legend

In TCustomServerSocket

Destroy

DoActivate

GetGetSocketEvent

GetGetThreadEvent

GetOnClientError

GetOnClientEvent

GetOnThreadEnd

GetOnThreadStart

GetServerType

GetThreadCacheSize

SetGetSocketEvent

SetGetThreadEvent

SetOnClientError

SetOnClientEvent

SetOnThreadEnd

SetOnThreadStart

SetServerType

SetThreadCacheSize

Derived from TAbstractSocket

Close

Open

Derived from TComponent

Create

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomServerSocket methods

TCustomServerSocket	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DoActivate

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetGetSocketEvent

GetGetThreadEvent

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetOnClientError

GetOnClientEvent

GetOnThreadEnd

GetOnThreadStart

GetParentComponent

GetServerType

GetThreadCacheSize

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Open

RemoveComponent

SafeCallException

SetGetSocketEvent

SetGetThreadEvent

SetOnClientError

SetOnClientEvent

SetOnThreadEnd

SetOnThreadStart

SetServerType

SetThreadCacheSize

UpdateAction


TCustomServerSocket.Destroy

TCustomServerSocket	See also

Destroys an instance of TCustomServerSocket.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the server socket is not nil, and only then calls Destroy.

Destroy frees the TServerWinSocket object that describes the server endpoint of the listening connection.


TCustomServerSocket.DoActivate

TCustomServerSocket	See also

Opens or Closes the socket connection.

procedure DoActivate(Value: Boolean); override;

Description

DoActivate provides the underlying implementation of the Open and Close methods. When Value is True, DoActivate opens a listening connection to accept connection requests. When Value is False, DoActivate terminates the current listening connection and any connections to client sockets.


TCustomServerSocket.GetGetSocketEvent

TCustomServerSocket	See also

Returns the OnGetSocket event handler.

type TGetSocketEvent = procedure (Sender: TObject; Socket: TSocket; var ClientSocket: TServerClientWinSocket) of object;

function GetGetSocketEvent: TGetSocketEvent;

Description

Applications cannot call this protected method. GetGetSocketEvent returns the OnGetSocket event handler of the TServerWinSocket object that describes the server endpoint of the listening connection.


TCustomServerSocket.GetGetThreadEvent

TCustomServerSocket	See also

Returns the OnGetThread event handler.

type TGetThreadEvent = procedure (Sender: TObject; ClientSocket: TServerClientWinSocket; var SocketThread: TServerClientThread) of object;

function GetGetThreadEvent: TGetThreadEvent;

Description

Applications cannot call this protected method. GetGetThreadEvent returns the OnGetThread event handler of the TServerWinSocket object that describes the server endpoint of the listening connection.


TCustomServerSocket.GetOnClientError

TCustomServerSocket	See also

Returns the OnClientError event handler.

function GetOnClientError: TSocketErrorEvent;

Description

Applications cannot call this protected method. GetOnClientError returns the OnClientError event handler of the TServerWinSocket object that describes the server endpoint of the listening connection.


TCustomServerSocket.GetOnClientEvent

TCustomServerSocket	See also

Provides indexed access to the various event handlers that respond to client events.

function GetOnClientEvent(Index: Integer): TSocketNotifyEvent;

Description

Applications can’t call this protected method. It is used internally to implement the event handlers that respond to client events.


TCustomServerSocket.GetOnThreadEnd

TCustomServerSocket	See also

Returns the OnThreadEnd event handler.

type TThreadNotifyEvent = procedure (Sender: TObject; Thread: TServerClientThread) of object;

function GetOnThreadEnd: TThreadNotifyEvent;

Description

Applications cannot call this protected method. GetOnThreadEnd returns the OnThreadEnd event handler of the TServerWinSocket object that describes the server endpoint of the listening connection.


TCustomServerSocket.GetOnThreadStart

TCustomServerSocket	See also

Returns the OnThreadStart event handler.

type TThreadNotifyEvent = procedure (Sender: TObject; Thread: TServerClientThread) of object;

function GetOnThreadStart: TThreadNotifyEvent;

Description

Applications cannot call this protected method. GetOnThreadStart returns the OnThreadStart event handler of the TServerWinSocket object that describes the server endpoint of the listening connection.


TCustomServerSocket.GetServerType

TCustomServerSocket	See also

Returns the ServerType property.

type TServerType = (stNonBlocking, stThreadBlocking);

function GetServerType: TServerType;

Description

Applications cannot call this protected method. GetServerType returns the value of the ServerType property of the TServerWinSocket object that describes the server endpoint of the listening connection.


TCustomServerSocket.GetThreadCacheSize

TCustomServerSocket	See also

Returns the value of the ThreadCacheSize property.

function GetThreadCacheSize: Integer;

Description

Applications cannot call this protected method. GetThreadCacheSize returns the value of the ThreadCacheSize property of the TServerWinSocket object that describes the server endpoint of the listening connection.


TCustomServerSocket.SetGetSocketEvent

TCustomServerSocket	See also

Sets the OnGetSocket event handler.

type TGetSocketEvent = procedure (Sender: TObject; Socket: TSocket; var ClientSocket: TServerClientWinSocket) of object;

procedure SetGetSocketEvent(Value: TGetSocketEvent);

Description

Applications cannot call this protected method. SetGetSocketEvent sets the OnGetSocket event handler of the TServerWinSocket object that describes the server endpoint of the listening connection. Server socket objects use TServerWinSocket to implement their OnGetSocket event.


TCustomServerSocket.SetGetThreadEvent

TCustomServerSocket	See also

Sets the OnGetThread event handler.

type TGetThreadEvent = procedure (Sender: TObject; ClientSocket: TServerClientWinSocket; var SocketThread: TServerClientThread) of object;

procedure SetGetThreadEvent(Value: TGetThreadEvent);

Description

Applications cannot call this protected method. SetGetThreadEvent sets the OnGetThread event handler of the TServerWinSocket object that describes the server endpoint of the listening connection. Server socket objects use TServerWinSocket to implement their OnGetThread event.


TCustomServerSocket.SetOnClientError

TCustomServerSocket	See also

Sets the OnClientError event handler.

procedure SetOnClientError(Value: TSocketErrorEvent);

Description

Applications cannot call this protected method. SetOnClientError sets the OnClientError event handler of the TServerWinSocket object that describes the server endpoint of the listening connection. Server socket objects use TServerWinSocket to implement their OnClientError event.


TCustomServerSocket.SetOnClientEvent

TCustomServerSocket	See also

Sets the client event handlers of the associated TServerWinSocket object.

procedure SetOnClientEvent(Index: Integer; Value: TSocketNotifyEvent);

Description

Applications cannot call this protected method. SetOnClientEvent sets the various event handlers that respond to events from the server endpoint of a client connection. Server socket components use TServerWinSocket to implement these events.


TCustomServerSocket.SetOnThreadEnd

TCustomServerSocket	See also

Sets the OnThreadEnd event handler.

type TThreadNotifyEvent = procedure (Sender: TObject; Thread: TServerClientThread) of object;

procedure SetOnThreadEnd(Value: TThreadNotifyEvent);

Description

Applications cannot call this protected method. SetOnThreadEnd sets the OnThreadEnd event handler of the TServerWinSocket object that describes the server endpoint of the listening connection. Server socket objects use TServerWinSocket to implement their OnThreadEnd event.


TCustomServerSocket.SetOnThreadStart

TCustomServerSocket	See also

Sets the OnThreadStart event handler.

type TThreadNotifyEvent = procedure (Sender: TObject; Thread: TServerClientThread) of object;

procedure SetOnThreadStart(Value: TThreadNotifyEvent);

Description

Applications cannot call this protected method. SetOnThreadStart sets the OnThreadEnd event handler of the TServerWinSocket object that describes the server endpoint of the listening connection. Server socket objects use TServerWinSocket to implement their OnThreadEnd event.


TCustomServerSocket.SetServerType

TCustomServerSocket	See also

Sets the ServerType property.

type TServerType = (stNonBlocking, stThreadBlocking);

procedure SetServerType(Value: TServerType);

Description

Applications cannot call this protected method. SetServerType sets the ServerType property of the TServerWinSocket object that describes the server endpoint of the listening connection. Server socket objects use TServerWinSocket to implement their ServerType property.


TCustomServerSocket.SetThreadCacheSize

TCustomServerSocket	See also

Sets the ThreadCacheSize property.

procedure SetThreadCacheSize(Value: Integer);

Description

Applications cannot call this protected method. SetThreadCacheSize sets the ThreadCacheSize property of the TServerWinSocket object that describes the server endpoint of the listening connection. Server socket objects use TServerWinSocket to implement their ThreadCacheSize property.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TAbstractSocket

TCustomSocket


TCustomAdapter

Hierarchy	Properties	Methods	See also

TCustomAdapter is a base class for objects that bind VCL objects to COM interfaces.

Unit

axctrls

Description

Do not create objects of this class.  Instead, call the GetOleFont procedure to create the binding between a TFont and an OLE font object or GetOlePicture to create the binding between a TPicture and an OLE picture object.


TCustomAdapter properties

TCustomAdapter	Alphabetically	Legend

Derived from TInterfacedObject

RefCount


TCustomAdapter properties

TCustomAdapter	By object	Legend

RefCount


TCustomAdapter methods

TCustomAdapter	Alphabetically

In TCustomAdapter

Changed

ConnectOleObject

Create

Destroy

ReleaseOleObject

Update

Derived from TInterfacedObject

AfterConstruction

BeforeDestruction

NewInstance

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

SafeCallException


TCustomAdapter methods

TCustomAdapter	By object

AfterConstruction

BeforeDestruction

Changed

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ConnectOleObject

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReleaseOleObject

SafeCallException

Update


TCustomAdapter.Changed

TCustomAdapter	See also

Responds when the VCL representation of the OLE object changes.

procedure Changed; virtual;

Description

Changed is called automatically so that the associated OLE object can be updated to reflect changes made to the corresponding VCL object. In TCustomAdapter, Changed calls ReleaseOleObject so that the OLE object can be reacquired to reflect the changes in the VCL object. Descendants of TCustomAdapter override Changed to use the OLE interface to make appropriate changes.


TCustomAdapter.ConnectOleObject

TCustomAdapter	See also

Associates the adapter with an OLE interface.

procedure ConnectOleObject(OleObject: IUnknown);

Description

ConnectOleObject is used internally to associate the adapter with the OLE object it represents.


TCustomAdapter.Create

TCustomAdapter	See also

Constructs an instance of the custom adapter control.

constructor Create;

Description

Never create an object of this class, only its descendants, such as TFontAdapter or TPictureAdapter.


TCustomAdapter.Destroy

TCustomAdapter	See also

Destroys the custom adapter object.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead, use the Free method, which checks that the adapter is not nil before calling Destroy.

Destroy frees and disconnects the VCL object from an OLE object.


TCustomAdapter.ReleaseOleObject

TCustomAdapter	See also

Releases the associated OLE interface, allowing it to decrease its reference count.

procedure ReleaseOleObject;

Description

When implementing a descendant of TCustomAdapter, call ReleaseOleObject when the adapter no longer needs the OLE object.


TCustomAdapter.Update

TCustomAdapter	See also

Provides the interface for a method that responds to changes in the OLE object.

procedure Update; virtual; abstract;

Description

Descendants of TCustomAdapter override Update to modify the associated VCL object so that it reflects changes in the corresponding OLE object. It is the converse of the Changed method.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TInterfacedObject


TCustomWebDispatcher

Hierarchy	Properties	Methods	Events	See also

TCustomWebDispatcher is the abstract base class for Web dispatcher objects.

Unit

httpapp

Description

Add a descendant of TCustomWebDispatcher to a Web application to enable it to respond to HTTP request messages. When a Web application is created, it automatically includes a TWebModule object, which is a descendant of TCustomWebDispatcher. Keep the default Web module, or replace it with another data module that contains a descendant of TCustomWebDispatcher, such as TWebDispatcher.

TCustomWebDispatcher manages the action items that assemble responses to HTTP request messages. When the TWebApplication object receives an HTTP request message, TCustomWebDispatcher passes the request on to the appropriate action item or action items to service the message.

TCustomWebDispatcher also keeps track of information about the current HTTP message for the benefit of TCustomContentProducer objects.


TCustomWebDispatcher properties

TCustomWebDispatcher	Alphabetically	Legend

In TCustomWebDispatcher

Action

Actions

Request

Response

Derived from TDataModule

DesignOffset

DesignSize

OldCreateOrder

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomWebDispatcher properties

TCustomWebDispatcher	By object	Legend

Action

Actions

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

DesignOffset

DesignSize

Name

OldCreateOrder

Owner

Request

Response

Tag

VCLComObject


TCustomWebDispatcher.Action

TCustomWebDispatcher	See also

Provides indexed access to the action items managed by the TCustomWebDispatcher object.

property Action[Index: Integer]: TWebActionItem;

Description

Use Action to iterate over all of the actions in the Actions collection. Zero is the index of the first action item, one is the index of the second action item, and so on. To access individual actions by name, use the ActionByName method.


TCustomWebDispatcher.Actions

TCustomWebDispatcher	See also

Represents the collection of action items managed by the TCustomWebDispatcher object.

property Actions: TWebActionItems;

Description

Use the methods of Actions to add action items for use by the dispatcher, to clear the set of action items managed by the dispatcher, or to access the attributes of the action items.


TCustomWebDispatcher.Request

TCustomWebDispatcher	See also

Provides access to the TWebRequest object that the dispatcher is currently handling.

property Request: TWebRequest;

Description

Use Request to obtain information about the current HTTP request message. The dispatcher matches this TWebRequest object to an action item, and invokes the OnAction event handler of the action item to generate and send a response to the HTTP request message. OnAction event handlers often use descendants of TCustomContentProducer to help generate the response to the request message. These content producers can use the Request property to correctly produce the content of the HTTP response.


TCustomWebDispatcher.Response

TCustomWebDispatcher	See also

Provides access to the TWebResponse object for the message the dispatcher is currently handling.

property Response: TWebResponse;

Description

Use Response to obtain information about the emerging response to the current HTTP request message. The dispatcher matches the request object specified by the Request property to an action item. It then invokes the OnAction event handler of the action item to fill in the TWebResponse object specified by the Response property. OnAction event handlers often use descendants of TCustomContentProducer to help generate the response. These content producers can use Response to determine the state of the emerging response that is being produced.


TCustomWebDispatcher events

TCustomWebDispatcher	Alphabetically	Legend

In TCustomWebDispatcher

AfterDispatch

BeforeDispatch

Derived from TDataModule

OnCreate

OnDestroy


TCustomWebDispatcher events

TCustomWebDispatcher	By object	Legend

AfterDispatch

BeforeDispatch

OnCreate

OnDestroy


TCustomWebDispatcher.AfterDispatch

TCustomWebDispatcher	See also

Occurs after the HTTP response message has been successfully filled out by the action items but not yet sent.

property AfterDispatch: THTTPMethodEvent;

Description

Write an AfterDispatch event handler to provide a final check of the HTTP response message before it is sent to the Web client. An AfterDispatch event handler can let a response stand as is, change the response, send the response, or change the Handled parameter to False to prevent the Web application from sending the response.

The AfterDispatch event does not occur if all of the action items indicate that the response was not handled, or if the response is sent by any of the action items.


TCustomWebDispatcher.BeforeDispatch

TCustomWebDispatcher	See also

Occurs before the dispatcher tries to match the HTTP request message with any of its action items.

property BeforeDispatch: THTTPMethodEvent;

Description

Write a BeforeDispatch event handler to preprocess all HTTP request messages. A BeforeDispatch event handler can enable or disable the action items appropriate to the response, begin filling out the response object, or provide any other necessary preprocessing.

If the BeforeDispatch event handler finishes filling out the response object, it should change the Handled parameter to True so the dispatcher will not send the request on to any of the action items. If the BeforeDispatch event handler sends the response message, the dispatcher will not pass the request on to any of the action items, even if the Handled parameter is left as False.

If the BeforeDispatch event handler sets the Handled parameter to True but does not send the response, the Web dispatcher will generate an AfterDispatch event.


TCustomWebDispatcher methods

TCustomWebDispatcher	Alphabetically	Legend

In TCustomWebDispatcher

ActionByName

Create

Destroy

DispatchAction

DoAfterDispatch

DoBeforeDispatch

Notification

Derived from TDataModule

CreateNew

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomWebDispatcher methods

TCustomWebDispatcher	By object	Legend

ActionByName

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateNew

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DispatchAction

DoAfterDispatch

DoBeforeDispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Notification

RemoveComponent

SafeCallException

UpdateAction


TCustomWebDispatcher.ActionByName

TCustomWebDispatcher	See also

Returns the action item identified by the AName parameter.

function ActionByName(const AName: string): TWebActionItem;

Description

Call ActionByName to gain access to an individual action item when its name is known. Change the properties of the action item so that it handles different HTTP request messages, or invoke its OnAction event handler to respond to an HTTP request message.


TCustomWebDispatcher.Create

TCustomWebDispatcher	See also

Creates an instance of TCustomWebDispatcher.

constructor Create(AOwner: TComponent); override;

Description

Do not call the constructor for TCustomWebDispatcher. Web applications automatically include a Web module. If the Web module is replaced by another data model, the Web dispatcher should be added to the new data module at design time. Objects placed at design time are created automatically. If an application tries to create a dispatcher object in a Web module, or in a data module that already has a Web dispatcher, an exception is raised.

Create creates the TWebActionItems object that holds the action items managed by the dispatcher. If the Web dispatcher is included in another data module, it adds a reference to itself to any content producer in that data module.

After the Web dispatcher is created automatically at runtime, an OnCreate event occurs.


TCustomWebDispatcher.Destroy

TCustomWebDispatcher	See also

Frees an instance of TCustomWebDispatcher.

destructor Destroy; override;

Description

Do not destroy the TCustomWebDispatcher directly in an application. The dispatcher is freed automatically when the server application shuts down.

Destroy frees the TWebActionItems object used to hold the collection of action items.


TCustomWebDispatcher.DispatchAction

TCustomWebDispatcher	See also

Passes an HTTP request message to the action items in Actions until it is handled.

function DispatchAction(Request: TWebRequest; Response: TWebResponse): Boolean;

Description

The Web application calls DispatchAction when it receives an HTTP request message so that the dispatcher can dispatch the request to any action items that can generate the response.

Before DispatchAction looks for action items to handle the HTTP request message represented by the Request parameter, it generates a BeforeDispatch event. If the BeforeDispatch event handler handles the action, the dispatcher does not pass the request message to any of the action items.

If there is no BeforeDispatch event handler, or of the BeforeDispatch event handler does not handle the request, DispatchAction attempts to match the MethodType and PathInfo of the request with the MethodType and PathInfo properties of each action item in the Actions property. When an action item matches the MethodType and PathInfo of the request, DispatchAction calls its OnAction event handler.

The OnAction event handler can complete the response to the request, or indicate that the request is not fully handled and allow another action item to finish processing the request. If the OnAction event handler does not complete the request, DispatchAction continues checking the action items in the Actions property and calling the OnAction event handler when a match is found.

If all of the action items are checked, and the request is still not fully handled, DispatchAction calls the OnAction event handler of the default action item.

Finally, if the request has been handled by the BeforeDispatch event handler or any of the action items, DispatchAction generates an AfterDispatch event. The AfterDispatch event does not occur if the BeforeDispatch event or any of the action items has already sent the response.

DispatchAction returns a Boolean value indicating whether the Web application should send the response message if it is not already sent. DispatchAction returns True if the action was handled by the action items and the AfterDispatch event handler did not change its Handled parameter to False.


TCustomWebDispatcher.DoAfterDispatch

TCustomWebDispatcher	See also

Generates an AfterDispatch event and returns a value that indicates whether the Web application can send the response.

function DoAfterDispatch(Request: TWebRequest; Response: TWebResponse): Boolean;

Description

Applications cannot call DoAfterDispatch. The DispatchAction method calls DoAfterDispatch after sending the HTTP request message to any matching action items. The DispatchAction method does not call DoAfterDispatch if the HTTP request message was not handled by the action items or by a BeforeDispatch event handler. DoAfterDispatch is also not called if the message was already sent back to the Web client.

If the AfterDispatch event handler indicates that the response should not be sent, DoAfterDispatch returns False, and the Web application drops the connection without sending the response message. Otherwise, DoAfterDispatch returns True, and the Web application sends the response message if it was not sent from within the AfterDispatch event handler.


TCustomWebDispatcher.DoBeforeDispatch

TCustomWebDispatcher	See also

Generates a BeforeDispatch event and returns a value that indicates whether the dispatcher should look for action items to handle the request.

function DoBeforeDispatch(Request: TWebRequest; Response: TWebResponse): Boolean;

Description

Applications cannot call DoBeforeDispatch. The DispatchAction method calls DoBeforeDispatch before trying to match the HTTP request message with any of its action items.

If the BeforeDispatch event handler indicates that it has handled the request message, DoBeforeDispatch returns True, and the DispatchAction method does not try to pass the request message to any of the action items. Otherwise, DoBeforeDispatch returns False, and unless the response message was sent from within the BeforeDispatch event handler, the DispatchAction method proceeds with looking for action items to handle the request message.

If DoBeforeDispatch returns True but the response has not been sent, DispatchAction generates an AfterDispatch event.


TCustomWebDispatcher.Notification

TCustomWebDispatcher	See also

Responds to notifications when objects are added to the module.

procedure Notification(AComponent: TComponent; Operation: TOperation); override;

Description

Notification ensures that all TCustomContentProducer objects have access to the dispatcher, by setting their Dispatcher property as they are added to the application.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected

Published


Hierarchy

TObject

TPersistent

TComponent

TDataModule


TCustomContentProducer

Hierarchy	Properties	Methods	See also

TCustomContentProducer is the base class for all objects that produce the string that is sent as the contents of an HTTP response message.

Unit

httpapp

Description

Use TCustomContentProducer as a base class when defining a class to produce the contents of an HTTP response message. In most cases, the content producer will assemble a string of HTML commands. However, descendants of TCustomContentProducer can be defined to produce any valid MIME type.


TCustomContentProducer properties

TCustomContentProducer	Alphabetically	Legend

In TCustomContentProducer

Dispatcher

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomContentProducer properties

TCustomContentProducer	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Dispatcher

Name

Owner

Tag

VCLComObject


TCustomContentProducer.Dispatcher

TCustomContentProducer	See also

Provides access to the dispatcher for the Web server application that includes the TCustomContentProducer object.

property Dispatcher: TCustomWebDispatcher;

Description

Use Dispatcher to get access to the dispatcher. The properties of the dispatcher give access to the TWebRequest and TWebResponse objects for the HTTP message that is currently being serviced. Use these objects to obtain detailed information about the message for which the content producer is generating a response string.


TCustomContentProducer methods

TCustomContentProducer	Alphabetically	Legend

In TCustomContentProducer

Content

ContentFromStream

ContentFromString

Notification

Derived from TComponent

Create

Destroy

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomContentProducer methods

TCustomContentProducer	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Content

ContentFromStream

ContentFromString

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Notification

RemoveComponent

SafeCallException


TCustomContentProducer.Content

TCustomContentProducer	See also

Returns the content produced by the content producer.

function Content: string; virtual;

Description

Call Content to retrieve the content for using in an HTTP response message. TCustomContentProducer returns an empty string. Descendants of TCustomContentProducer return the value of the content that they produce. In most cases, this content is a string of HTML commands, although it can be any valid MIME type.


TCustomContentProducer.ContentFromStream

TCustomContentProducer	See also

Returns the content produced in response to input read from a stream.

function ContentFromStream(Stream: TStream): string; virtual;

Description

Call ContentFromStream to retrieve the content produced by the content producer based on the information provided by the Stream parameter. TCustomContentProducer ignores the Stream parameter and returns the value created by the Content method.

Descendants of TCustomContentProducer override this method to interpret streamed input in their own way.


TCustomContentProducer.ContentFromString

TCustomContentProducer	See also

Returns the content produced in response to an input string.

function ContentFromString(const S: string): string; virtual;

Description

Call ContentFromString to retrieve the content produced by the content producer based on the information provided by the S parameter. TCustomContentProducer ignores the string and returns the value created by the Content method.

Descendants of TCustomContentProducer override this method to interpret the input string in their own way.


TCustomContentProducer.Notification

TCustomContentProducer	See also

Overrides the inherited method to respond to messages that the dispatcher is going away.

procedure Notification(AComponent: TComponent; Operation: TOperation); override;

Description

After calling the inherited method, Notification checks whether this call was triggered by the removal of the dispatcher. If so, the Dispatcher property is set to nil.


Scope

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent


TCustomSocket

Hierarchy	Properties	Methods	Events	See also

TCustomSocket is an abstract base class for socket components.

Unit

scktcomp

Description

Override TCustomSocket to create a socket component that can be assigned event handlers for the events and error conditions that occur. In addition to the properties and methods introduced by TAbstractSocket that enable an application to work with Windows sockets, TCustomSocket introduces several events that can be used by applications.

Do not create instances of TCustomSocket. Use a descendant of TCustomSocket to add the ability to communicate with other machines using TCP/IP. To create a socket that initiates the connection with another machine, use TClientSocket. To create a socket that responds to requests for connections from other machines, use TServerSocket.


TCustomSocket properties

TCustomSocket	Alphabetically	Legend

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomSocket properties

TCustomSocket	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomSocket events

TCustomSocket	Alphabetically	Legend

In TCustomSocket

OnAccept

OnConnect

OnConnecting

OnDisconnect

OnError

OnListen

OnLookup

OnRead

OnWrite


TCustomSocket events

TCustomSocket	By object	Legend

OnAccept

OnConnect

OnConnecting

OnDisconnect

OnError

OnListen

OnLookup

OnRead

OnWrite


TCustomSocket.OnAccept

TCustomSocket	See also

Occurs on server sockets just after the connection to a client socket is accepted.

property OnAccept: TSocketNotifyEvent;

Description

Write an OnAccept event handler for a server socket to take specific action after the connection to a client socket has been accepted. This is the first point when information is available about the local port and IP address that will be used in the server endpoint of the connection. The port number, and possibly the IP address, will differ from those of the listening socket.

Server sockets open a socket connection for listening to establish a queue to hold client requests. After a request from the queue is accepted by the server socket, an OnAccept event occurs. After the server socket accepts the connection, the client socket completes the connection, and an OnConnect event occurs for the client socket.


TCustomSocket.OnConnect

TCustomSocket	See also

Occurs on client sockets just after the connection to the server is opened.

property OnConnect: TSocketNotifyEvent;

Description

Write an OnConnect event handler for a client socket to take specific action after the connection to a server socket has been established. Depending on the service, this may be the point when the socket should start reading or writing over the connection.

When a client socket opens a connection, the following events occur:

1	An OnLookup event occurs prior to an attempt to locate the server socket.

2	The Windows socket is set up, and initialized for event notification.

3	An OnConnecting event occurs after the server socket is located.

4	The connection request is accepted by the server and completed by the client socket.

5	An OnConnect event occurs after the connection is established.


TCustomSocket.OnConnecting

TCustomSocket	See also

Occurs for a client socket after the server socket has been located, but before the connection is established.

property OnConnecting: TSocketNotifyEvent;

Description

Write an OnConnecting event handler for a client socket to take specific action just before the connection to a server socket is established. This is the first opportunity to obtain the actual port and IP address of the server endpoint of the connection that is about to form.

When a client socket opens a connection, the following events occur:

1	An OnLookup event occurs prior to an attempt to locate the server socket.

2	The Windows socket is set up, and initialized for event notification.

3	An OnConnecting event occurs after the server socket is located.

4	The connection request is accepted by the server and completed by the client socket.

5	An OnConnect event occurs after the connection is established.


TCustomSocket.OnDisconnect

TCustomSocket	See also

Occurs just before a client socket closes the connection to a server socket.

property OnDisconnect: TSocketNotifyEvent;

Description

Write an OnDisconnect event handler to take specific action when the connection to a server socket is about to be terminated. OnDisconnect occurs after the value of the Active property is set to False, but before the actual connection is closed.


TCustomSocket.OnError

TCustomSocket	See also

Occurs when the socket fails in making, using, or shutting down a connection.

property OnError: TSocketErrorEvent;

Description

Write an OnError event handler to respond to errors that arise with the socket connection. Set the ErrorCode parameter to 0 if the OnError event handler successfully deals with the error condition, to prevent an ESocketError from being raised.


TCustomSocket.OnListen

TCustomSocket	See also

Occurs just before a server socket is opened for listening.

property OnListen: TSocketNotifyEvent;

Description

Write an OnListen event handler for a server socket to take specific action just before the socket is opened for listening. OnListen occurs after Address and Port have been bound to the socket connection, but before it is opened. This is the last opportunity to make changes to the socket endpoint before it is opened for listening. Use the SocketHandle property of the Socket parameter for Windows API calls that change the socket.

Server sockets open a socket connection for listening to establish a queue to hold client requests. The connection to a client socket is completed when a request from the queue is accepted.


TCustomSocket.OnLookup

TCustomSocket	See also

Occurs when a client socket is about to look up the server socket with which it wants to connect.

property OnLookup: TSocketNotifyEvent;

Description

Write an OnLookup event handler for a client socket to take specific action just before attempting to locate a server socket. This is the first opportunity to make Windows API calls that affect the client properties of the socket, such as specifying a particular port number. Use the SocketHandle property of the Socket parameter for Windows API calls.

When a client socket opens a connection, the following events occur:

1	An OnLookup event occurs prior to an attempt to locate the server socket.

2	The Windows socket is set up, and initialized for event notification.

3	An OnConnecting event occurs after the server socket is located.

4	The connection request is accepted by the server and completed by the client socket.

5	An OnConnect event occurs after the connection is established.

Note:	Changing the Address, Host, Port, or Service properties of socket component in an OnLookup event handler has no effect on the address or port used to locate a server socket. These properties must be correct before the Open method is called.


TCustomSocket.OnRead

TCustomSocket	See also

Occurs when a client socket should read information from the socket connection.

property OnRead: TSocketNotifyEvent;

Description

Write an OnRead event handler to read from the socket connection. If the socket is a blocking socket, use a TWinSocketStream object to read from the connection. Otherwise, use the methods of the Socket parameter to perform the actual reading.


TCustomSocket.OnWrite

TCustomSocket	See also

Occurs when a client socket should write information to the socket connection.

property OnWrite: TSocketNotifyEvent;

Description

Write an OnWrite event handler to write to the socket connection. If the socket is a blocking socket, use a TWinSocketStream object to write to the connection. Otherwise, use the methods of the Socket parameter to perform the actual writing.


TCustomSocket methods

TCustomSocket	Alphabetically	Legend

In TCustomSocket

Error

Event

Derived from TAbstractSocket

Close

Open

Derived from TComponent

Create

Destroy

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomSocket methods

TCustomSocket	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Error

Event

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Open

RemoveComponent

SafeCallException

UpdateAction


TCustomSocket.Error

TCustomSocket	See also

Generates an OnError event.

type TErrorEvent = (eeGeneral, eeSend, eeReceive, eeConnect, eeDisconnect, eeAccept);

procedure Error(Socket: TCustomWinSocket; ErrorEvent: TErrorEvent; var ErrorCode: Integer); override;

Description

Applications cannot call Error. It responds to error conditions by calling the OnError event handler if it is assigned. Override Error to add class-specific error processing or to block the OnError event.

The Socket parameter indicates the Windows socket object which encounters the error condition.

The ErrorEvent parameter indicates what the socket was trying to do when the error occurred. It has one of the following values:

Value	Meaning

eeGeneral	The socket received an error message that does not fit into any of the following categories.

eeSend	An error occurred when trying to write to the socket connection.

eeReceive	An error occurred when trying to read from the socket connection.

eeConnect	For client sockets, this indicates that the client socket can’t locate the server, or that a problem on the server prevents the opening of a connection. For server sockets, this indicates that a client connection request that has already been accepted could not be completed.

eeDisconnect	An error occurred when trying to close a connection.

eeAccept	For server sockets only, this indicates that a problem occurred when trying to accept a client connection request.

The ErrorCode parameter is the error code received by the Windows socket object. Setting this value to 0 in the Error method prevents the socket from raising an exception. For information on possible error codes, see the Microsoft documentation on Windows sockets.


TCustomSocket.Event

TCustomSocket	See also

Dispatches the events that occur in the normal operation of the socket to the appropriate event handlers.

procedure Event(Socket: TCustomWinSocket; SocketEvent: TSocketEvent); override;

Description

Applications cannot call Event. It is called automatically when various events occur. Override Event to introduce class-specific responses when certain events occur or to prevent the socket from calling the associated event handler.

The Socket parameter indicates the Windows socket object that calls Event to indicate when specific events occur.

The SocketEvent parameter indicates the event that occurred.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TAbstractSocket


TCustomWinSocket

Hierarchy	Properties	Methods	Events	See also

TCustomWinSocket is the base class for all Windows socket objects.

Unit

scktcomp

Description

TCustomWinSocket introduces properties, events, and methods to describe an endpoint in a Windows socket connection. Descendants of TCustomWinSocket are used by socket components to manage the Windows socket API calls and to store information about a socket communication link.

A Windows socket encapsulates a set of communication protocols to allow the application to connect to other machines for reading or writing information. Windows sockets provide connections based on the TCP/IP protocol. They also allow connections that use the Xerox Network System (XNS), Digital’s DECnet protocol, or Novell’s IPX/SPX family. Sockets allow an application to form connections to other machines without being concerned with the details of the actual networking software.

Descendants of TCustomWinSocket represent different endpoints in socket connections. TClientWinSocket represents the client endpoint of a socket communication link to a server socket. TServerWinSocket represents the server endpoint of a listening connection. TServerClientWinSocket represents the server endpoint of a socket communication link to a client socket.


TCustomWinSocket properties

TCustomWinSocket	Alphabetically	Legend

In TCustomWinSocket

Addr

ASyncStyles

Connected

Data

Handle

LocalAddress

LocalHost

LocalPort

LookupState

RemoteAddr

RemoteAddress

RemoteHost

RemotePort

SocketHandle


TCustomWinSocket properties

TCustomWinSocket	By object	Legend

Addr

ASyncStyles

Connected

Data

Handle

LocalAddress

LocalHost

LocalPort

LookupState

RemoteAddr

RemoteAddress

RemoteHost

RemotePort

SocketHandle


TCustomWinSocket.Addr

TCustomWinSocket	See also

Specifies the Internet socket address structure used in Windows socket API calls to represent the full specification of the local socket port.

property Addr: TSockAddrIn;

Description

Use Addr to represent the port used by the socket on the local system when working directly with Windows socket API calls. The value of Addr is determined by the values of the LocalAddress and LocalPort properties.


TCustomWinSocket:ASyncStyles
TCustomWinSocket.ASyncStyles

TCustomWinSocket	See also

Determines which asynchronous events the socket can receive.

type

  TAsyncStyle = (asRead, asWrite, asOOB, asAccept, asConnect, asClose);

  TAsyncStyles = set of TAsyncStyle;

property ASyncStyles: TAsyncStyles;

Description

Use ASyncStyles to determine what sorts of notifications the socket needs to respond to. Set ASyncStyles to change the notifications that the socket receives from the socket connection. ASyncStyles is a set drawn from the following values

Value	Meaning

asRead	The socket receives notification that the connection is ready for reading.

asWrite	The socket receives notification that the connection is ready for writing.

asOOB	The socket receives notification when out-of-band data arrives.

asAccept	The socket receives notification when another socket requests a connection.

asConnect	The socket receives notification when a communication link to another socket is opened.

asClose	The socket receives notification when a communication link to another socket is terminated.

Any notification specified by ASyncStyles arrives as a window message to the Handle property.

Note:	If the socket is a non-blocking socket, then ASyncStyles should include asRead and asWrite so that the socket will be informed of asynchronous reading and writing events.


TCustomWinSocket.Connected

TCustomWinSocket	See also

Indicates whether the socket connection is open and available for communication with other machines.

property Connected: Boolean;

Description

Read Connected before trying to use or change the Windows socket connection. Connected indicates whether the socket connection has been established. When Connected is True, the Windows socket is open and available for use. When Connected is False, the Windows socket is closed and can be changed.

To open a client Windows socket, use the Open method. To open a server Windows socket, use the Listen method. The Windows socket that represents the server endpoint of a connection to a client socket is opened in its constructor.

To close a Windows socket, use the Close method.


TCustomWinSocket.Data

TCustomWinSocket

Points to application-specific data associated with the socket.

property Data: Pointer;

Description

Use Data to associate information specific to the socket connection with the Windows socket object. For example, Data can be used to store access and authentication information used by a server socket to evaluate client connection requests.

Data can store information in a thread-safe manner that would otherwise require the use of global variables. This is useful given the multi-threaded nature of many client-server applications.


TCustomWinSocket.Handle

TCustomWinSocket	See also

Specifies the handle of the window that receives notifications from the Windows socket.

property Handle: HWnd;

Description

Use Handle to send messages to the Windows socket or to subclass the Window procedure that receives messages of asynchronous events from the socket connection.


TCustomWinSocket.LocalAddress

TCustomWinSocket	See also

Specifies the IP address of the local system that was bound to the socket connection.

property LocalAddress: string;

Description

LocalAddress is a string of four numeric (byte) values in the standard internet dot notation, such as

123.197.1.2

Each address identifies the system and indicates the types of interfaces supported by the socket. A single system (machine) can support multiple addresses. LocalAddress is the address from among the possible addresses supported by the local system that is bound to the socket connection.

A single LocalAddress can be used simultaneously by multiple socket connections. Each of those connections must have a unique LocalPort number to distinguish it from other connections to the same LocalAddress.


TCustomWinSocket.LocalHost

TCustomWinSocket	See also

Specifies the name of the local system.

property LocalHost: string;

Description

Use LocalHost to get the name of the system that is running the application that uses the Windows socket. LocalHost is a string containing the domain name and service of the local socket endpoint, such as

http://www.wSite.Com

LocalHost provides an alias for the local IP address given in the LocalAddress property. Most Intranets provide host names for the IP addresses of systems on the net. On Windows 95 and NT machines, if a host name is not available, create one for the local IP address by entering the name into the HOSTS file. See the Microsoft documentation on Windows sockets for more information on the HOSTS file.


TCustomWinSocket.LocalPort

TCustomWinSocket	See also

Specifies the ID number of the port used by the socket connection.

property LocalPort: Integer;

Description

Use LocalPort to determine the port number that is bound to the socket connection. For server endpoints of listening connections, LocalPort is the ID associated with the service the server socket provides. For client or server endpoints of connections to another socket, LocalPort is usually an arbitrary value picked when the connection was made.

Port numbers allow a single system, identified by the LocalAddress property, to host multiple connections simultaneously. Each combination of LocalPort and LocalAddress can only be bound to a single socket connection. This combination is represented by the Addr property.

Many values of LocalPort are associated by convention with a particular service such as ftp or http. To determine whether the value of LocalPort is associated with a specific service, use the LookupService method.


TCustomWinSocket.LookupState

TCustomWinSocket	See also

Indicates any asynchronous activities occurring while opening a connection.

type TLookupState = (lsIdle, lsLookupAddress, lsLookupService);

property LookupState: TLookupState;

Description

LookupState is used internally to coordinate asynchronous activities while opening a connection. The AsyncInitSocket method sets the value of LookupState to indicate when it is looking up various types of information. The following table lists the possible values:

Value	Meaning

lsIdle	The socket is not currently looking up any information asynchronously.

lsLookupAddress	The socket is looking up an IP address asynchronously and has not yet received the result.

lsLookupService	The socket is looking up a Service asynchronously and has not yet received the result.


TCustomWinSocket.RemoteAddr

TCustomWinSocket	See also

Specifies the internet socket address structure used in Windows socket API calls to represent the full specification of the remote socket port.

property RemoteAddr: TSockAddrIn;

Description

When working directly with Windows socket API calls, use RemoteAddr to represent the port used by the socket on the other end of the connection. The value of RemoteAddr is determined by the values of the RemoteAddress and RemotePort properties.


TCustomWinSocket.RemoteAddress

TCustomWinSocket	See also

Specifies the IP address of the remote system that was bound to the socket connection.

property RemotelAddress: string;

Description

RemoteAddress is a string of four numeric (byte) values in the standard internet dot notation, such as

123.197.1.2

Each address identifies the system on the other end of the socket connection and indicates the types of interfaces supported by the remote socket. A single system can support multiple addresses. RemoteAddress is the address from among the possible addresses supported by the remote system that is bound to the socket connection.

A single RemoteAddress may be participating in multiple socket connections. Each of those connections has a unique RemotePort number to distinguish it from other connections to the same RemoteAddress. The RemoteAddr property uniquely identifies the RemoteAddress and RemotePort combination used by the socket connection.


TCustomWinSocket.RemoteHost

TCustomWinSocket	See also

Specifies the name of the remote system.

property RemoteHost: string;

Description

Use RemoteHost to get the name of the system on the other end of the socket connection. RemoteHost is a string containing the domain name and service of the remote endpoint of the socket connection, such as

http://www.wSite.Com

LocalHost provides an alias for the local IP address given in the RemoteAddress property.


TCustomWinSocket.RemotePort

TCustomWinSocket	See also

Specifies the ID number of the port used by the RemoteHost to form the socket connection.

property RemotePort: Integer;

Description

Use RemotePort to determine the port number used by the socket on the other end of the socket connection.

Port numbers allow a single system, identified by the RemoteAddress or RemoteHost property, to host multiple connections simultaneously. Each combination of RemotePort and RemoteAddress can only be bound to a single socket connection. This combination is represented by the RemoteAddr property.

Many port numbers are associated by convention with a particular service such as ftp or http. To determine whether the value of RemotePort is associated with a specific service, use the LookupService method.

Note:	If a client socket requests a specific port to indicate a desired service, the value of RemotePort for the actual connection may differ from the requested port number. Most server sockets listen on the port associated with a service, but switch to an arbitrary available port number for forming connections.


TCustomWinSocket.SocketHandle

TCustomWinSocket	See also

Specifies the Windows handle for the socket.

property SocketHandle: TSocket;

Description

Use SocketHandle for Windows socket API calls that require the handle to the socket. When the Connected property is False, SocketHandle is INVALID_SOCKET.

SocketHandle is set to a valid Windows socket handle by the Listen or Open method.


TCustomWinSocket events

TCustomWinSocket	Alphabetically

In TCustomWinSocket

OnErrorEvent

OnSocketEvent


TCustomWinSocket events

TCustomWinSocket	By object

OnErrorEvent

OnSocketEvent


TCustomWinSocket.OnErrorEvent

TCustomWinSocket	See also

Occurs when the socket fails in making, using, or shutting down a connection.

property OnErrorEvent: TSocketErrorEvent;

Description

Socket components provide an OnErrorEvent event handler that converts error notifications into error events on the socket component. Most applications will therefore not provide an event handler for OnErrorEvent.


TCustomWinSocket.OnSocketEvent

TCustomWinSocket	See also

Occurs when the Windows socket receives notification of asynchronous events.

type TSocketEventEvent = procedure (Sender: TObject; Socket: TCustomWinSocket; SocketEvent: TSocketEvent) of object;

property OnSocketEvent: TSocketEventEvent;

Description

Socket components provide an OnSocketEvent event handler that converts Windows socket notifications into events on the socket component. Most applications will therefore not provide an event handler for OnSocketEvent. Replacing this event handler can prevent some expected events from occurring.

The Sender parameter is the Windows socket object that owns the event handler. Usually, this is the same as the Socket parameter.

The Socket parameter indicates the Windows socket that generates or receives notification of the event.

The SocketEvent parameter indicates the event that occurred.


TCustomWinSocket methods

TCustomWinSocket	Alphabetically	Legend

In TCustomWinSocket

Accept

AsyncInitSocket

Close

Connect

Create

DefaultHandler

Destroy

Disconnect

DoListen

DoOpen

Error

Event

InitSocket

Listen

Lock

LookupName

LookupService

Open

Read

ReceiveBuf

ReceiveLength

ReceiveText

SendBuf

SendStream

SendStreamThenDrop

SendText

SetAsyncStyles

Unlock

Write

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCustomWinSocket methods

TCustomWinSocket	By object	Legend

Accept

AfterConstruction

AsyncInitSocket

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Connect

Create

DefaultHandler

Destroy

Disconnect

Dispatch

DoListen

DoOpen

Error

Event

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InitSocket

InstanceSize

Listen

Lock

LookupName

LookupService

MethodAddress

MethodName

NewInstance

Open

Read

ReceiveBuf

ReceiveLength

ReceiveText

SafeCallException

SendBuf

SendStream

SendStreamThenDrop

SendText

SetAsyncStyles

Unlock

Write


TCustomWinSocket.Accept

TCustomWinSocket	See also

Provides the interface for a method that accepts a connection to a client socket.

procedure Accept(Socket: TSocket); virtual;

Description

Accept is called automatically in response to notifications that a client socket is requesting a connection. The Socket parameter is the Windows socket handle for the socket that receives the notification.

The Accept method for TCustomWinSocket does nothing with the notification. Descendants of TCustomWinSocket that represent listening server sockets override this method to accept the connection to the client socket.

Accept is only called if the ASyncStyles property includes asAccept.


TCustomWinSocket.AsyncInitSocket

TCustomWinSocket	See also

Looks up information or forms socket connections asynchronously.

procedure AsyncInitSocket(const Name, Address, Service: string; Port: Word; QueueSize: Integer; Client: Boolean);

Description

AsyncInitSocket is used internally to open a socket connection in non-blocking sockets. It is called by the Open or Listen method when that method’s Block parameter is False.

The Name parameter is the host name for the socket. The Address parameter is the IP address. The Service parameter is the service for which the socket is to used. The Port parameter is the port number for the socket. The QueueSize parameter indicates the number of client requests a listening connection can hold while waiting to form connections. The Client parameter indicates whether the socket address structure is to be used by a client socket to describe the destination of a connection or by a server socket to describe the listening connection.


TCustomWinSocket.Close

TCustomWinSocket	See also

Shuts down the socket connection if it is open.

procedure Close;

Description

Call Close to terminate an open socket connection. Close triggers an OnSocketEvent of type seDisconnect before the connection is shut down. If the Windows socket is a listening server socket, Close shuts down all open connections to client sockets before shutting down the listening connection.


TCustomWinSocket.Connect

TCustomWinSocket	See also

Provides the interface for a method that responds to connection notifications from client sockets.

procedure Connect(Socket: TSocket); virtual;

Description

Connect is called automatically in response to notifications that the client socket has successfully completed a connection to a server socket. The Socket parameter is the Windows socket handle for the socket that receives the notification.

The Connect method for TCustomWinSocket does nothing with the notification. Descendants of TCustomWinSocket that represent client sockets override this method to respond to connection notifications.

Connect is only called if the ASyncStyles property includes asConnect.


TCustomWinSocket.Create

TCustomWinSocket	See also

Creates an instance of TCustomWinSocket from a Windows socket handle.

constructor Create(ASocket: TSocket);

Description

Call Create to create a Windows socket object. Most Windows socket objects are created automatically by the socket component that uses them. Applications may create their own Windows socket objects in an OnGetSocket event handler for a server socket component.

After calling the inherited constructor, Create

Makes sure that Winsock.dll is initialized.

Allocates helper objects to manage multithreading issues.

Initializes ASyncStyles to [asRead, asWrite, asConnect, asClose]

Initializes the SocketHandle property to the ASocket parameter and sets the Connected property to reflect whether ASocket is the handle of a valid open Windows socket.

Initializes the Addr property.


TCustomWinSocket.DefaultHandler

TCustomWinSocket	See also

Processes message records.

procedure DefaultHandler(var Message); override;

Description

DefaultHandler overrides the inherited method in order to process all messages that are sent to the Windows socket object. DefaultHandler passes the messages to the Windows CallWindowProc function.


TCustomWinSocket.Destroy

TCustomWinSocket	See also

Destroys an instance of TCustomWinSocket.

destructor Destroy; override;

Description

Most applications do not need to explicitly free Windows socket objects.  They are freed by the socket components that use them.


TCustomWinSocket.Disconnect

TCustomWinSocket	See also

Shuts down the socket connection represented by a Windows socket handle.

procedure Disconnect(Socket: TSocket); virtual;

Description

Disconnect is called by the Close method to terminate an individual socket connection.

Disconnect calls the Lock method to make sure the method is thread-safe. Then, it generates an OnSocketEvent of type seDisconnect. After the OnSocketEvent, Disconnect closes the connection. Finally, it calls Unlock to end the critical section started by Lock.


TCustomWinSocket.DoListen

TCustomWinSocket	See also

Opens a listening connection.

procedure DoListen(QueueSize: Integer);

Description

The socket uses DoListen internally to open a listening connection with a queue that can hold QueueSize client connection requests. DoListen handles those tasks that are common to opening a listening connection synchronously or asynchronously.

Do not call DoListen to open a listening connection. Instead, call the public Listen method, which orchestrates the opening of a connection either synchronously or asynchronously, depending on the socket type.


TCustomWinSocket.DoOpen

TCustomWinSocket	See also

Opens a connection to a remote socket.

procedure DoOpen;

Description

The socket uses DoOpen internally to open a connection to a remote socket. DoOpen handles those tasks that are common to establishing a connection synchronously or asynchronously.

Do not call DoOpen to open a connection. Instead, call the public Open method, which orchestrates the opening of a connection either synchronously or asynchronously, depending on the socket type.


TCustomWinSocket.Error

TCustomWinSocket	See also

Generates an OnErrorEvent event.

type TErrorEvent = (eeGeneral, eeSend, eeReceive, eeConnect, eeDisconnect, eeAccept);

procedure Error(Socket: TCustomWinSocket; ErrorEvent: TErrorEvent; var ErrorCode: Integer); dynamic;

Description

Error is called automatically when the Windows socket object receives error notifications. It generates the OnErrorEvent event. When overriding this method, be sure to call the inherited method, because socket components rely on the OnErrorEvent event for their own error handling.

The Socket parameter indicates the Windows socket object that encounters the error condition.

The ErrorEvent parameter indicates what the socket was trying to do when the error occurred. It has one of the following values:

Value	Meaning

eeGeneral	The socket received an error message that does not fit into any of the following categories.

eeSend	An error occurred when trying to write to the socket connection.

eeReceive	An error occurred when trying to read from the socket connection.

eeConnect	For client sockets, this indicates that the client socket can’t locate the server, or that a problem on the server prevents the opening of a connection. For server sockets, this indicates that a client connection request that has already been accepted could not be completed.

eeDisconnect	An error occurred when trying to close a connection.

eeAccept	For server sockets only, this indicates that a problem occurred when trying to accept a client connection request.

The ErrorCode parameter is the error code received by the Windows socket object. Changing this value to 0 in the Error method prevents the socket from raising an exception. For information on possible error codes, see the Microsoft documentation on Windows sockets.


TCustomWinSocket.Event

TCustomWinSocket	See also

Generates an OnSocketEvent event.

procedure Event(Socket: TCustomWinSocket; SocketEvent: TSocketEvent); dynamic;

Description

Error is called automatically when the Windows socket object receives notifications or when it performs certain actions. It generates the OnSocketEvent event. When overriding this method, be sure to call the inherited method, because socket components rely on the OnSocketEvent event to generate many of their own events.

The Socket parameter indicates the Windows socket that generates or receives notification of the event.

The SocketEvent parameter indicates the event that occurred.


TCustomWinSocket.InitSocket

TCustomWinSocket	See also

Generates a windows internet socket address structure from a description of the desired socket port.

function InitSocket(const Name, Address, Service: string; Port: Word; Client: Boolean): TSockAddrIn;

Description

Applications can not call InitSocket. It is called by the Open or Listen method to obtain a Windows internet socket address structure for the parameters obtained from a socket component.

The Name parameter is the host name for the socket. The Address parameter is the IP address. The Service parameter is the service for which the socket is to used. The Port parameter is the port number for the socket. The Client parameter indicates whether the socket address structure is to be used by a client socket to describe the destination of a connection or by a server socket to describe the listening connection.

The host portion of the Windows internet socket address is obtained from the host name if it is given. Otherwise the Address parameter is used. If Client is True, either the Name or the Address parameter must be specified. If Client is False, they may both be left blank to specify a server that listens on multiple addresses.

If port number for the Windows internet socket address is obtained from the Service parameter if it is given. Otherwise, the Port parameter is used. One of these two parameters must be specified.


TCustomWinSocket.Listen

TCustomWinSocket	See also

Opens a listening connection for a server socket.

procedure Listen(const Name, Address, Service: string; Port: Word; QueueSize: Integer; Block: Boolean=True);

Description

Server socket components call Listen to open a listening connection.

Listen creates the Windows socket that will make the listening connection, and binds the Windows internet socket address derived from the parameters to the socket. Listen then generates an OnSocketEvent of type seListen. Finally, Listen opens the socket as a listening connection with a queue that can hold QueueSize client requests, setting the Connected property to True.

The Name, Address, Service, and Port parameters are taken from the Host, Address, Service and Port properties of the server socket component.

QueueSize indicates how many client requests the listening connection can hold. TServerSocket sets the QueueSize to 5.

Block indicates whether the socket can look up the information it needs to establish a connection asynchronously. When Block is True, the socket blocks execution for each lookup instead of retrieving information about the connection using asynchronous notifications.


TCustomWinSocket.Lock

TCustomWinSocket	See also

Starts a critical section, blocking all other execution threads until the Unlock method is called.

procedure Lock;

Description

Call Lock before beginning a section of code that is not thread-safe. Call Unlock when the critical section of code is completed. Unless absolutely necessary, do not use Lock to lock lengthy operations such as reading and writing over a blocking connection. Locking lengthy operations can severely impact performance, because all execution threads in the application that use the Windows socket object must wait until Unlock is called.


TCustomWinSocket.LookupName

TCustomWinSocket	See also

Generates the portion of a Windows internet socket address structure that describes the host.

function LookupName(const name: string): TInAddr;

Description

Call LookupName to obtain the internet address associated with the system identified by the name parameter. LookupName is used by InitSocket to generate the portion of the Windows Internet socket address structure that identifies the host.


TCustomWinSocket.LookupService

TCustomWinSocket	See also

Returns the port number associated with a specific service.

function LookupService(const service: string): Integer;

Description

Call LookupService to obtain the standard port number for the service named by the service parameter. Windows provides a number of standard service names such as ftp, http, finger, or time. Each standard service is associated, by convention, with a specific port number. These standard port numbers allow client sockets to indicate the desired service by requesting a specific port number. They allow server sockets to listen on an expected port number for the service offered. Servers can specify additional services and their associated ports in a SERVICES file. For more information on the SERVICES file, see the Microsoft documentation for Windows sockets.

InitSocket calls LookupService to obtain the port number for the Service specified by a socket component.


TCustomWinSocket.Open

TCustomWinSocket	See also

Opens a connection to a remote socket.

procedure Open(const Name, Address, Service: string; Port: Word; Block: Boolean=True);

Description

Client socket components call Open to open a connection to a server socket.

Open creates the Windows socket that will connect to the server socket, and generates an OnSocketEvent of type seLookup. After the OnSocketEvent, Open binds the Windows internet socket address derived from the parameters to the socket, locating the server socket. Open then generates an OnSocketEvent of type seConnecting. When the server socket accepts the connection, Open completes the connection to the server socket. Then it generates an OnSocketEvent of type seConnect. After the OnSocketEvent, the Connected property is set to True.

The Name, Address, Service, and Port parameters are taken from the Host, Address, Service and Port properties of the client socket component.

Block indicates whether the socket can look up the information it needs to establish a connection asynchronously. When Block is True, the socket blocks execution for each lookup instead of retrieving information about the connection using asynchronous notifications.


TCustomWinSocket.Read

TCustomWinSocket	See also

Generates an OnSocketEvent of type seRead in response to notifications that the socket connection is ready.

procedure Read(Socket: TSocket); virtual;

Description

Read is called in response to asynchronous notifications that the socket connection is ready for reading. The Windows socket can then read from the connection in the OnSocketEvent event handler or the socket component can read from the connection in an OnRead or OnClientRead event handler. The event handler can use the ReceiveBuf method or the ReceiveText method to read the information from the connection.

Note:	Read is only called for asynchronous read notifications in a non-blocking socket. Blocking sockets must use a TWinSocketStream object for reading. The TWinSocketStream object waits for the remote socket to be ready before transferring information.


TCustomWinSocket.ReceiveBuf

TCustomWinSocket	See also

Reads up to Count bytes from the socket connection into the Buf parameter.

function ReceiveBuf(var Buf; Count: Integer): Integer;

Description

Use ReceiveBuf to read from the socket connection in the OnSocketEvent event handler of a Windows socket object or in the OnRead or OnClientRead event handler of a socket component. ReceiveBuf returns the number of bytes actually read. If no bytes are read, ReceiveBuf returns –1.

ReceiveBuf only works in response to a read notification to a non-blocking windows socket. Blocking sockets must use a TWinSocketStream for reading. The TWinSocketStream object waits for the remote socket to be ready before transferring information.

Note:	While the ReceiveLength method can return an estimate of the size of buffer required to retrieve information from the socket, the number of bytes it returns is not necessarily accurate.


TCustomWinSocket.ReceiveLength

TCustomWinSocket	See also

Returns the number of bytes ready to be sent over the socket connection.

function ReceiveLength: Integer;

Description

Call ReceiveLength to determine the amount of information to read over the socket connection in response to an asynchronous read notification.

Note:	ReceiveLength is not guaranteed to be accurate for streaming socket connections.


TCustomWinSocket.ReceiveText

TCustomWinSocket	See also

Reads a string from the socket connection.

function ReceiveText: string;

Description

Use ReceiveText to read a string from the socket connection in the OnSocketEvent event handler of a Windows socket object or in the OnRead or OnClientRead event handler of a socket component. ReceiveText returns the number of bytes in the string.

ReceiveText only works in response to a read notification to a non-blocking windows socket. Blocking sockets must use a TWinSocketStream for reading. The TWinSocketStream object waits for the remote socket to be ready before transferring information.


TCustomWinSocket.SendBuf

TCustomWinSocket	See also

Writes Count bytes to the socket connection from the Buf parameter.

function SendBuf(var Buf; Count: Integer): Integer;

Description

Use SendBuf to write to the socket connection. Call this method from the OnSocketEvent event handler of a Windows socket object or in the OnWrite or OnClientWrite event handler of a socket component. Alternately, Use SendBuf to write when a connection is first formed when the socket does not expect notification that the socket on the other end of the connection is expecting to read.

For non-blocking sockets, the data is sent to the WinSock DLL which has it's own internal buffers. If the WinSock can accept additional data, SendBuf returns immediately with the number of bytes queued. If the WinSock internal buffer space is not able to accept the buffer being sent, SendBuf returns -1 and no data is queued at all. In this case, wait a bit for the WinSock to have a chance to send out already-queued data; then try again.

For blocking sockets, SendBuf returns the number of bytes actually written.

If an error occurs while writing to the connection, SendBuf terminates the connection and raises an ESocketError exception.


TCustomWinSocket.SendStream

TCustomWinSocket	See also

Writes all the information that can be read from the AStream parameter to the socket connection.

function SendStream(AStream: TStream): Boolean;

Description

Use SendStream to write to the socket connection. The writing may occur in the OnSocketEvent event handler of a Windows socket object or in the OnWrite or OnClientWrite event handler of a socket component. Alternately, SendStream may write from a socket that is expected to write to the connection without a notification to signal the connection’s readiness to read. SendStream reads information from the stream indicated by AStream and writes it to the socket connection. The value returned by SendStream indicates whether any information was successfully written to the connection.

Note:	The Stream passed as a parameter to SendStream becomes “owned” by the windows socket object.  The Windows socket object frees the stream when it is finished with it.  Do not attempt to free the stream after it has been passed as a parameter.


TCustomWinSocket.SendStreamThenDrop

TCustomWinSocket	See also

Writes all the information that can be read from the AStream parameter to the socket connection and then terminates the connection.

function SendStreamThenDrop(AStream: TStream): Boolean;

Description

Use SendStreamThenDrop to write to a socket connection when the connection is no longer needed after the writing is complete. SendStream reads information from the stream indicated by AStream and writes it to the socket connection, shutting down the connection when it is done. The value returned by SendStream indicates whether any information was successfully written to the connection.

Note:	The Stream passed as a parameter to SendStream becomes “owned” by the windows socket object.  The Windows socket object frees the stream when it is finished with it.  Do not attempt to free the stream after it has been passed as a parameter.


TCustomWinSocket.SendText

TCustomWinSocket	See also	Example

Writes the string S to the socket connection.

function SendText(const S: string): Integer;

Description

Use SendText to write a string to the socket connection. The writing may occur in the OnSocketEvent event handler of a Windows socket object or in the OnWrite or OnClientWrite event handler of a socket component. Alternately, SendText may write from a socket that is expected to write to the connection without a notification to signal the connection’s readiness to read. If an error occurs while writing to the connection, SendText terminates the connection and raises an ESocketError exception.

SendText returns 0 if the string was successfully written. It returns a nonzero value if the writing must be postponed. When SendText returns a nonzero value, it must be called again later to write the value over the connection.


TCustomWinSocket.SetAsyncStyles

TCustomWinSocket	See also

Sets the AsyncStyles property.

type

  TAsyncStyle = (asRead, asWrite, asOOB, asAccept, asConnect, asClose);

  TAsyncStyles = set of TAsyncStyle;

procedure SetAsyncStyles(Value: TASyncStyles);

Description

SetAsyncStyles implements the AsyncStyles property. Override SetAsyncStyles to limit the value of AsyncStyles to notifications that are appropriate to a particular type of Windows socket.


TCustomWinSocket.Unlock

TCustomWinSocket	See also

Reenables execution in other threads after a critical section begun by the Lock method.

procedure Unlock;

Description

Call Unlock at the end of a section of code that is not thread-safe. Every call to Unlock should match a call to the Lock method at the beginning of the critical section of code.


TCustomWinSocket.Write

TCustomWinSocket	See also

Generates an OnSocketEvent of type seWrite in response to notifications that the socket connection is ready.

procedure Write(Socket: TSocket); virtual;

Description

Write is called in response to asynchronous notifications that the socket connection is ready for the socket to send information. The Windows socket can write to the connection in the OnSocketEvent event handler or the socket component can write to the connection in an OnWrite or OnClientWrite event handler. The event handler can use the SendBuf method, the SendStream method, or the SendText method to write the information to the connection.

Note:	Write is only called for asynchronous write notifications in a non-blocking socket. Blocking sockets must use their own mechanisms for determining when the connection is ready for the socket to write.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject


THTTPDataLink

Hierarchy	Properties	Methods	See also

THTTPDataLink helps TDSTableProducer manage its link to the data source.

Unit

dbweb

Description

THTTPDataLink is tailored to work with a TDSTableProducer object. It should only be used by the TDSTableProducer class.


THTTPDataLink properties

THTTPDataLink	Alphabetically	Legend

In THTTPDataLink

DefaultFields

FieldCount

Fields

SparseMap

Derived from TDataLink

Active

ActiveRecord

BOF

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

EOF

ReadOnly

RecordCount


THTTPDataLink properties

THTTPDataLink	By object	Legend

Active

ActiveRecord

BOF

BufferCount

DataSet

DataSource

DataSourceFixed

DefaultFields

Editing

EOF

FieldCount

Fields

ReadOnly

RecordCount

SparseMap


THTTPDataLink.DefaultFields

THTTPDataLink	See also

Indicates whether the associated table producer uses dynamically generated field components.

property DefaultFields: Boolean;

Description

Read DefaultFields to determine whether the image of the table will display dynamically generated field components or persistent field components. If DefaultFields is True, the fields in the image of the table will represent dynamically allocated field components. If DefaultFields is False, the image will be built from persistent field components.

If the image of the datasource is built from persistent field components, it may not show all of the fields that are present in the underlying database table.


THTTPDataLink.FieldCount

THTTPDataLink	See also

Specifies the number of entries in the Fields array.

property FieldCount: Integer;

Description

Use FieldCount when iterating over all the field components in the Fields property. FieldCount is the number of columns shown in the image of the datasource. The Fields array can contain undefined field components, which correspond to field components that are not in the dataset, such as calculated fields.


THTTPDataLink.Fields

THTTPDataLink	See also

Lists all the field components from the dataset that may be shown in the image of the datasource.

property Fields[I: Integer]: TField;

Description

Use Fields to access field components by index. Fields[0] is the first field component, Fields[1] is the second field component, and so on. If the SparseMap property is True, Fields may contain undefined field components. For these entries, Fields returns nil.

TDSTableProducer uses Fields to keep track of all field components that are part of its dataset. Whenever necessary, TDSTableProducer reconciles the field bindings of its columns with the field components in Fields.


THTTPDataLink.SparseMap

THTTPDataLink	See also

Indicates whether the associated table producer has customized the number or order of the fields that appear in the table.

property SparseMap: Boolean;

Description

Read SparseMap to determine whether Fields is a simple reflection of the underlying dataset. TDSTableProducer sets SparseMap when it builds the field map. SparseMap is False if TDSTableProducer builds a default field map directly from the dataset. SparseMap is True if the number or order of the fields has been changed from the default. When SparseMap is True, the Fields array may contain undefined fields.


THTTPDataLink methods

THTTPDataLink	Alphabetically	Legend

In THTTPDataLink

ActiveChanged

AddMapping

ClearMapping

Create

DataSetChanged

DataSetScrolled

Destroy

EditingChanged

FocusControl

GetMappedIndex

LayoutChanged

Modified

RecordChanged

Reset

UpdateData

Derived from TDataLink

Edit

ExecuteAction

UpdateAction

UpdateRecord

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


THTTPDataLink methods

THTTPDataLink	By object	Legend

ActiveChanged

AddMapping

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClearMapping

Create

DataSetChanged

DataSetScrolled

DefaultHandler

Destroy

Dispatch

Edit

EditingChanged

ExecuteAction

FieldAddress

FocusControl

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetMappedIndex

GetNamePath

InheritsFrom

InitInstance

InstanceSize

LayoutChanged

MethodAddress

MethodName

Modified

NewInstance

RecordChanged

Reset

SafeCallException

UpdateAction

UpdateData

UpdateRecord


THTTPDataLink.ActiveChanged

THTTPDataLink	See also

Informs the table producer when the Active property changes.

procedure ActiveChanged; override;

Description

Applications cannot call the ActiveChanged method directly. Changes in the Active property trigger this procedure. ActiveChanged calls the LinkActive method of the TDSTableProducer, which recomputes the layout for the table if the dataset has just become active.


THTTPDataLink.AddMapping

THTTPDataLink	See also

Adds a field component to the end of the Fields array.

function AddMapping(const FieldName: string): Boolean;

Description

Applications should not call AddMapping directly, because this would cause the Fields array to become out of sync with the THTMLTableColumns object used by TDSTableProducer. TDSTableProducer calls AddMapping iteratively to set up the Fields array so that it corresponds to the columns in the table image.


THTTPDataLink.ClearMapping

THTTPDataLink	See also

Empties the Fields array and frees any associated memory.

procedure ClearMapping;

Description

Applications should not call ClearMapping directly, because this would cause the Fields array to become out of sync with the THTMLTableColumns object used by TDSTableProducer. TDSTableProducer calls ClearMapping before rebuilding the Fields list, every time the column mapping changes.


THTTPDataLink.Create

THTTPDataLink	See also

Creates an instance of THTTPDataLink.

constructor Create(DSTableProducer: TDSTableProducer);

Description

Applications should not create instances of THTTPDataLink. TDSTableProducer instantiates a THTTPDatalink object from its own constructor.


THTTPDataLink.DataSetChanged

THTTPDataLink	See also

Informs the associated table producer of changes to the dataset.

procedure DataSetChanged; override;

Description

Applications can not call DataSetChanged directly. Changes to the contents of the dataset trigger this method automatically.


THTTPDataLink.DataSetScrolled

THTTPDataLink	See also

Ignores scrolling events on the dataset.

procedure DataSetScrolled(Distance: Integer); override;

Description

Applications can not call DataSetScrolled directly. This method overrides the inherited method so that TDSTableProducer can ignore scrolling events that would occur if the TDSTableProducer were a visual control.


THTTPDataLink.Destroy

THTTPDataLink	See also

Destroys an instance of THTTPDataLink.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. The TDSTableProducer object that owns the THTTPDataLink frees the THTTPDataLink from its own destructor.

Destroy frees up the memory used by the Fields array before calling the inherited destructor.


THTTPDataLink.EditingChanged

THTTPDataLink	See also

Ignores changes to the editing state of the dataset.

procedure EditingChanged; override;

Description

Applications can not call EditingChanged directly. This method ignores changes to the editing state of the dataset, which are irrelevant to TDSTableProducer.


THTTPDataLink.FocusControl

THTTPDataLink	See also

Discards requests to set focus to the indicated field.

procedure FocusControl(Field: TFieldRef); override;

Description

TDSTableProducer does not support the concept of focus assigned to an individual field. FocusControl discards requests sent through the data source to assign focus to an individual field.


THTTPDataLink.GetMappedIndex

THTTPDataLink	See also

Returns the index of the field component in the dataset that corresponds to the index of the field component within the Fields array.

function  GetMappedIndex(ColIndex: Integer): Integer;

Description

Applications can not call GetMappedIndex directly. GetMappedIndex takes ColIndex, the index of a field component in the Fields array, and returns the corresponding index of the field component in the dataset.


THTTPDataLink.LayoutChanged

THTTPDataLink	See also

Informs TDSTableProducer of changes in the layout of columns at design time.

procedure LayoutChanged; override;

Description

Applications can not call the LayoutChanged method directly. LayoutChanged is triggered automatically by changes to the layout of columns at design time. LayoutChanged instructs the TDSTableProducer object to recompute the layout for the table.


THTTPDataLink.Modified

THTTPDataLink	See also

Tracks changes to the data which have not been written to the current record in the database.

procedure Modified;

Description

Call Modified before changing the value of a field in the current record of the dataset. It is not necessary to call Modified if the changes are written directly to the field components indexed by the Fields property.


THTTPDataLink.RecordChanged

THTTPDataLink	See also

Ignores changes to the contents of the current record or field of the data source.

procedure RecordChanged(Field: TField); override;

Description

Applications can not call RecordChanged directly. This method ignores changes to the contents of the current record in the data source, which are irrelevant to the TDSTableProducer.


THTTPDataLink.Reset

THTTPDataLink	See also

Cancels any pending edits to the dataset that have not been written to the current record in the database.

procedure Reset;

Description

Applications can not call Reset directly. Descendants of TDSTableProducer can implement a method or user interface that triggers the cancellation of pending edits.


THTTPDataLink.UpdateData

THTTPDataLink	See also

Discards requests to post changes to the dataset.

procedure UpdateData; override;

Description

TDSTableProducer produces an HTML image of a dataset. It is not a control that can be used to edit the data in the dataset. UpdateData discards requests sent through the data source to post edits to the dataset.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink


TDBCtrlPanel

Hierarchy	Properties	Methods	See also

TDBCtrlPanel represents a panel in a TDBCtrlGrid object.

Unit

dbcgrids

Description

Use TDBCtrlPanel to hold the fields from a single record in a dataset.  TDBCtrlGrid represents the records in a dataset by arranging copies of the same TDBCtrlPanel object in rows or columns, where each panel represents a single record in the dataset.

Lay out a single panel at design time.  Add data-aware edit controls or data display objects.  At runtime, TDBCtrlGrid replicates the panel for the records in the dataset.

The appearance of the panel is determined by the properties of the TDBCtrlGrid object that contains the panel.  The OnPaintPanel event of TDBCtrlGrid allows customized painting of the panels.


TDBCtrlPanel properties

TDBCtrlPanel	Alphabetically	Legend

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDBCtrlPanel properties

TDBCtrlPanel	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentWindow

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TDBCtrlPanel methods

TDBCtrlPanel	Alphabetically

In TDBCtrlPanel

CreateLinked

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBCtrlPanel methods

TDBCtrlPanel	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateLinked

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TDBCtrlPanel.CreateLinked
TDBCtrlPanel.::CreateLinked

TDBCtrlPanel

Creates and initializes an instance of TDBCtrlPanel.

constructor CreateLinked(DBCtrlGrid: TDBCtrlGrid);

Description

Do not call the constructor for TDBCtrlPanel directly. TDBCtrlGrid calls the CreateLinked method for TDBCtrlPanel from its own constructor.

CreateLinked initializes the Parent property to the DBCtrlGrid parameter and initializes the ControlStyle property to include [csAcceptsControls, csCaptureMouse, csClickEvents, csDoubleClicks, csOpaque, csReplicatable].


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


 TDBCtrlGrid

Hierarchy	Properties	Methods	Events	See also

TDBCtrlGrid displays records from a data source in a free-form layout.

Unit

dbcgrids

Description

Put a TDBCtrlGrid object on a form to display and edit the records from a database table or query. Unlike the TDBGrid object, which displays each record in a single row, TDBCtrlGrid allows a free-form layout for each record in the dataset. Each record is displayed in its own panel; Design one panel at design time and TDBCtrlGrid replicates that panel for each record displayed.

At runtime, users can use the database navigator (TDBNavigator) to move through data in the TDBCtrlGrid object, and to insert, delete, and edit the data. Edits made using the data grid are not posted to the underlying dataset until the user moves to a different record or closes the application.


TDBCtrlGrid properties

TDBCtrlGrid	Alphabetically	Legend

In TDBCtrlGrid

AllowDelete

AllowInsert

Canvas

ColCount

DataSource

EditMode

Orientation

PanelBorder

PanelCount

PanelHeight

PanelIndex

PanelWidth

RowCount

SelectedColor

ShowFocus

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DragCursor

DragMode

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDBCtrlGrid properties

TDBCtrlGrid	By object	Legend

Action

Align

AllowDelete

AllowInsert

Anchors

BiDiMode

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ColCount

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DataSource

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragMode

EditMode

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Orientation

Owner

PanelBorder

PanelCount

PanelHeight

PanelIndex

PanelWidth

Parent

ParentColor

ParentFont

ParentShowHint

ParentWindow

PopupMenu

RowCount

SelectedColor

ShowFocus

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TDBCtrlGrid.AllowDelete

TDBCtrlGrid	See also

Determines whether the user can delete the current record from the dataset by pressing Ctrl+Delete.

property AllowDelete: Boolean;

Description

Set AllowDelete to False to prevent the TDBCtrlGrid object from deleting records.

When AllowDelete is False, TDBCtrlGrid will not delete records from the dataset when the user presses Ctrl+Delete or the DoKey method is called with the Key parameter set to gkDelete. The TDBCtrlGrid object can still be used to insert records.

When AllowDelete is True (the default), TDBCtrlGrid will delete the current record when the user presses Ctrl+Delete or when the DoKey method is called with the Key parameter set to gkDelete. Even with AllowDelete set to True, records cannot be deleted unless the dataset is in edit mode.


TDBCtrlGrid.AllowInsert

TDBCtrlGrid	See also

Determines whether the user can insert new records with the Insert key or append new records with the Ctrl+Insert key combination.

property AllowInsert: Boolean;

Description

Set AllowInsert to False to prevent the TDBCtrlGrid object from inserting records.

When AllowInsert is False, TDBCtrlGrid will not insert records into the dataset when the user presses Insert or Ctrl+Insert or when the DoKey method is called with the Key parameter set to gkInsert or gkAppend. The TDBCtrlGrid object can still be used to delete records.

When AllowInsert is True (the default), TDBCtrlGrid will insert a new record into the dataset before the current record when the user presses Insert or append a new record to the end of the dataset when the user presses Ctrl+Insert. Even with AllowInsert set to True, records cannot be inserted unless the dataset is in edit mode.


TDBCtrlGrid.Canvas

TDBCtrlGrid	See also

Indicates the drawing surface used to draw the TDBCtrlGridObject.

property Canvas: TCanvas;

Description

Use the properties and methods of Canvas to draw an image of a panel in the TDBCtrlGrid object from an OnPaintPanel event handler.


TDBCtrlGrid.ColCount

TDBCtrlGrid	See also

Specifies the number of columns of panels shown in the grid.

property ColCount: Integer;

Description

Set ColCount to the number of columns of panels that should appear in the TDBCtrlGrid object. Each panel represents a separate record in the dataset.

Setting ColCount causes the TDBCtrlGrid object to resize to accomodate the new number of columns. PanelWidth doesn’t change.


TDBCtrlGrid.DataSource

TDBCtrlGrid

Identifies the link to the dataset where the TDBCtrlGrid object finds its data.

property DataSource: TDataSource;

Description

Set DataSource to the TDataSource object that links to the dataset where the grid should fetch its data. DataSource allows the data-aware grid to read from, write to, and navigate around the dataset.

DBCtrlGrid1.DataSource := DataSource1;


TDBCtrlGrid.EditMode

TDBCtrlGrid	See also

Determines whether the TDBCtrlGrid can be used to insert, delete, or edit records.

property EditMode: Boolean;

Description

Set EditMode to True to allow the user to edit the dataset using the grid. The user can toggle EditMode by pressing F2 or Enter. Inserting or deleting records using the grid will set EditMode to True.


TDBCtrlGrid.Orientation

TDBCtrlGrid	See also

Determines the order in which records from the dataset are displayed in the TDBCtrlGrid.

type

  TDBCtrlGridOrientation = (goVertical, goHorizontal);

property Orientation: TDBCtrlGridOrientation;

Description

Set Orientation to goVertical (the default) to have the panels ordered in rows with a vertical scroll bar. Set Orientation to goHorizontal to arrange panels in columns with a horizontal scroll bar.


TDBCtrlGrid.PanelBorder

TDBCtrlGrid	See also

Determines whether each panel is drawn with a raised border around it.

type

  TDBCtrlGridBorder = (gbNone, gbRaised);

property PanelBorder: TDBCtrlGridBorder;

Description

The default value of gbRaised draws a raised border. Set PanelBorder to gbNone to eliminate the border.


TDBCtrlGrid.PanelCount

TDBCtrlGrid	See also

Specifies the number of records visible in the grid.

property PanelCount: Integer;

Description

TDBCtrlGrid can represent a number of panels equal to the number in ColCount times the number in RowCount. Usually, PanelCount will be the same as this value. PanelCount will be smaller than this if there are not enough records in the dataset to fill the entire grid.


TDBCtrlGrid.PanelHeight

TDBCtrlGrid	See also

Specifies the height (in pixels) of each panel.

property PanelHeight: Integer;

Description

Set PanelHeight to the desired size of each panel in the grid. When the PanelHeight property is set, the grid resizes itself to fit the new panel height.


TDBCtrlGrid.PanelIndex

TDBCtrlGrid	See also

Specifies the index of the panel in the grid which represents the current record.

property PanelIndex: Integer;

Description

Read PanelIndex to determine which panel represents the current record in the dataset. Set PanelIndex to move in the dataset to the record corresponding to a panel in the grid.

PanelIndex is a number in the range 0.PanelCount - 1, where 0 is the first panel, 1 is the second panel, and so on. The location of the panel with the index PanelIndex depends on the value of the Orientation property. When Orientation is goVertical, the panels are counted by rows. When Orientation is goHorizontal, the panels are counted by columns.


TDBCtrlGrid.PanelWidth

TDBCtrlGrid	See also

Specifies the width (in pixels) of each panel.

property PanelWidth: Integer;

Description

Set PanelWidth to the desired size of each panel in the grid. When the PanelWidth property is set, the grid resizes itself to fit the new panel width.


TDBCtrlGrid.RowCount

TDBCtrlGrid	See also

Specifies the number of rows of panels displayed in the grid.

property RowCount: Integer;

Description

Set RowCount to the number of rows of panels that should appear in the TDBCtrlGrid object. Each panel represents a separate record in the dataset.

Setting RowCount causes the TDBCtrlGrid object to resize to accomodate the new number of rows. PanelHeight does not change.


TDBCtrlGrid.ShowFocus

TDBCtrlGrid	See also

Indicates whether to draw a focus rectangle around the current record in the TDBCtrlGrid when it has input focus.

property ShowFocus: Boolean;

Description

Set ShowFocus to True to have TDBCtrlGrid draw a focus rectangle around the current record when it has input focus. Set ShowFocus to False when providing visual feedback of focus in some other manner in an OnPaintPanel event handler.


TDBCtrlGrid.SelectedColor

TDBCtrlGrid 	See also

Specifies the background color of the panel that represents the current record in the dataset.

property SelectedColor: TColor;

Description

Set SelectedColor to a value other than value of the Color property to make the panel that represents the current record stand out. TDBCtrlGrid draws the selected panel using SelectedColor even when it does not have input focus. All other panels are drawn with the background set to the value of the Color property.


TDBCtrlGrid events

TDBCtrlGrid	Alphabetically	Legend

In TDBCtrlGrid

OnPaintPanel

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBCtrlGrid events

TDBCtrlGrid	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnPaintPanel

OnStartDrag


TDBCtrlGrid.OnPaintPanel

TDBCtrlGrid	See also

Occurs when TDBCtrlGrid needs to draw a panel in the grid.

type TPaintPanelEvent = procedure(DBCtrlGrid: TDBCtrlGrid; Index: Integer) of object;

property OnPaintPanel: TPaintPanelEvent;

Description

Write an OnPaintPanel event handler to customize the drawing of a panel in the TDBCtrlGrid object. TDBCtrlGrid paints the background using the Color or SelectedColor property, including the raised border if it is specified by the PanelBorder property. Then the OnPaintPanel event occurs to allow an event handler to add to the image of the panel.

The DBCtrlGrid parameter is the grid that contains the panel. The Index parameter is the index of the panel being painted, where 0 is the first panel, 1 is the second panel, and so on. Use the PanelIndex property to determine whether the panel being drawn is selected.

Use the Canvas property to paint the panel. The point (0,0) on the canvas is the upper left corner of the panel, and the point (PanelWidth, PanelHeight) is the lower right corner.

Controls placed on the panel are drawn separately and do not need to be drawn in an OnPaintPanel event handler.


TDBCtrlGrid methods

TDBCtrlGrid	Alphabetically

In TDBCtrlGrid

Create

Destroy

DoKey

ExecuteAction

GetTabOrderList

KeyDown

UpdateAction

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBCtrlGrid methods

TDBCtrlGrid	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DoKey

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

KeyDown

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TDBCtrlGrid.Create

TDBCtrlGrid	See also

Creates and initializes an instance of TDBCtrlGrid.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize a TDBCtrlGrid object at runtime.TDBCtrlGrid objects placed in a form at design time are created automatically.

Pass a single Component as a parameter to provide the TDBCtrlGrid object with an Owner that is responsible for freeing it.

Create allocates the helper objects it uses and initializes

AllowInsert and AllowDelete to True.

ColCount to 1 and RowCount to 3.

ControlStyle to [csOpaque, csDoubleClicks].

PanelBorder to gbRaised.

PanelWidth to 200 and PanelHeight to 72.

SelectedColor to Color.

ShowFocus to True.

TabStop to True.


TDBCtrlGrid.Destroy

TDBCtrlGrid	See also

Destroys an instance of TDBCtrlGrid.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free, which checks that the TDBCtrlGrid reference is not nil, and only then calls Destroy.

Destroy frees the helper objects used by TDBCtrlGrid before calling the inherited destructor.


TDBCtrlGrid.DoKey

TDBCtrlGrid 	See also

Implements the responses to a number of standard keystrokes.

type TDBCtrlGridKey = (gkNull, gkEditMode, gkPriorTab, gkNextTab, gkLeft, gkRight, gkUp, gkDown, gkScrollUp, gkScrollDown, gkPageUp, gkPageDown, gkHome, gkEnd, gkInsert, gkAppend, gkDelete, gkCancel);

procedure DoKey(Key: TDBCtrlGridKey);

Description

Call DoKey to perform the operation specified by the Key parameter. For example, use DoKey to remap keystrokes from an OnKeyDown event handler.

The actions performed for the different values of Key are given in the following table

Value	Action

gkNull	Do nothing.

gkEditMode	Toggle the EditMode property.

gkPriorTab	Move to the previous panel.

gkNextTab	Move to the next panel.

gkLeft	Move one panel to the left.

gkRight	Move one panel to the right.

gkUp	Move one panel up.

gkDown	Move one panel down.

gkScrollUp	Move one panel up.

gkScrollDown	Move one panel down.

gkPageUp	Move ColCount * RowCount records up in the dataset.

gkPageDown	Move ColCount * RowCount records down in the dataset.

gkHome	Move to the first record in the dataset.

gkEnd	Move to the last record in the dataset.

gkInsert	Insert a new record prior to the current record in the dataset and set EditMode to True.

gkAppend	Insert a new record at the end of the dataset and set EditMode to True.

gkDelete	Delete the current record from the dataset and set EditMode to False.

gkCancel	Cancel any edits not written to the dataset and set EditMode to False.


TDBCtrlGrid.ExecuteAction

TDBCtrlGrid	See also

Executes an action with the DB control grid as its target.

function ExecuteAction(Action: TBasicAction): Boolean; override;

Description

ExecuteAction is called automatically when the user invokes an action with the DB control grid as its target. The Action parameter specifies the action that was invoked. ExecuteAction returns a boolean value indicating whether the action was successfully executed.

ExecuteAction first calls the inherited method, which checks whether the action knows how to execute with the grid as a target. If this does not successfully dispatch the action, ExecuteAction attempts to invoke the action with the grid’s associated dataset as a target.


TDBCtrlGrid.GetTabOrderList

TDBCtrlGrid	See also

Overrides the default to remove all child controls from the tab order.

procedure GetTabOrderList(List: TList); override;

Description

GetTabOrderList returns an empty list. TDBCtrlGrid implements its own handling of the tab key to move through the panels in database order.


TDBCtrlGrid.KeyDown

TDBCtrlGrid 	See also

Performs special processing when a key is pressed.

procedure KeyDown(var Key: Word; Shift: TShiftState); override;

Description

After calling the OnKeyDown event handler, KeyDown translates each combination of the Key and Shift parameters into a logical key code and calls the DoKey method to perform the appropriate action.

KeyDown performs the following translations:

Key and Shift values	Key code

LeftArrow	gkLeft

RightArrow	gkRight

UpArrow	gkUp

DownArrow	gkDown

PageUp	gkPageUp

PageDown	gkPageDown

Home	gkHome

End	gkEnd

Return	gkEditMode

F2	gkEditMode

Insert	gkAppend

Ctrl+Insert	gkInsert

Ctrl+Delete	gkDelete

Escape	gkCancel

All other keys	gkNull


TDBCtrlGrid.UpdateAction

TDBCtrlGrid	See also

Updates an action to reflect the current state of the grid.

function UpdateAction(Action: TBasicAction): Boolean; override;

Description

UpdateAction is called automatically when the application is idle allow the grid to set action properties to reflect the current state of the grid. The Action parameter is the action to be updated. UpdateAction returns a boolean that indicates whether the action was updated by the grid.

As implemented in TDBCtrlGrid, UpdateAction checks whether the action relies on the state of the associated dataset, and if so, updates the action accordingly.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TDBCtrlGridLink

Hierarchy	Properties	Methods	See also

TDBCtrlGridLink helps manage data events for a TDBCtrlGrid object.

Unit

dbcgrids

Description

TDBCtrlGridLink is tailored to work with a TDBCtrlGrid. It should only be used by the TDBCtrlGrid class.


TDBCtrlGridLink properties

TDBCtrlGridLink	Alphabetically	Legend

Derived from TDataLink

Active

ActiveRecord

BOF

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

Eof

ReadOnly

RecordCount


TDBCtrlGridLink properties

TDBCtrlGridLink	By object	Legend

Active

ActiveRecord

BOF

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

Eof

ReadOnly

RecordCount


TDBCtrlGridLink methods

TDBCtrlGridLink	Alphabetically	Legend

In TDBCtrlGridLink

ActiveChanged

Create

DataSetChanged

Derived from TDataLink

Destroy

Edit

ExecuteAction

UpdateAction

UpdateRecord

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDBCtrlGridLink methods

TDBCtrlGridLink	By object	Legend

ActiveChanged

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DataSetChanged

DefaultHandler

Destroy

Dispatch

Edit

ExecuteAction

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

UpdateAction

UpdateRecord


TDBCtrlGridLink.ActiveChanged

TDBCtrlGridLink	See also

Informs the TDBCtrlGrid object of changes in the Active property.

procedure ActiveChanged; override;

Description

Applications can’t call the ActiveChanged procedure directly. Changes in the Active property trigger this procedure. ActiveChanged causes the TDBCtrlGrid object to update its appearance to reflect the data in the dataset.


TDBCtrlGridLink.Create

TDBCtrlGridLink	See also

Creates an instance of TDBCtrlGridLink.

constructor Create(DBCtrlGrid: TDBCtrlGrid);

Description

Applications should not call the Create method for a TDBCtrlGridLink directly. The TDBCtrlGrid that owns a TDBCtrlGridLink calls Create from its own constructor.


TDBCtrlGridLink.DataSetChanged

TDBCtrlGridLink	See also

Informs the TDBCtrlGrid of changes to the dataset.

procedure DataSetChanged; override;

Description

Applications can’t call the DataSetChanged method directly. DataSetChanged is called automatically when the contents of the dataset change. When the dataset scrolls or when the representation of the dataset by the TDBCtrlGrid changes, DataSetChanged is called indirectly. DataSetChanged causes the TDBCtrlGrid object to update its appearance to reflect the changes to the dataset.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink


TDBOleControl

Hierarchy	Properties	Methods

Supports simple data binding for ActiveX controls.

Unit

Dbolectl

Description

Use TBDOleControl to import ActiveX controls that contain simple bindable properties. With simple data binding, you can hook up properties of ActiveX controls to a data source.

Applications typically do not use TDBOleControl; it is available through the ActiveX control wizard and the ActiveForm wizard. Once you create an ActiveX control using either wizard, a type library is created. Edit the type library binding properties to add simple data binding to your applications.


TDBOleControl properties

TDBOleControl	Alphabetically	Legend

In TDBOleControl

DataBindings

DataSource

Derived from TOleControl

DefaultDispatch

Name

OleObject

Parent

PerPropBrowsing

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDBOleControl properties

TDBOleControl	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DataBindings

DataSource

DefaultDispatch

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

OleObject

Owner

Parent

ParentWindow

PerPropBrowsing

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TDBOleControl.DataBindings

TDBOleControl	See also

Represents the data bindings between ActiveX control properties and fields in a dataset.

property DataBindings: TDataBindings;

Description

Use DataBindings to read or set the data bindings in a data-aware ActiveX control. DataBindings is a collection of TDataBindItem objects. Use the properties of the TDataBindings object to specify the data bindings of individual properties in the data-aware control.

Data bindings are typically set by editing the ActiveX control’s type library.


TDBOleControl.DataSource

TDBOleControl	See also

Specifies the link to the dataset where the data-aware ActiveX control finds its data.

property DataSource: TDataSource;

Description

Set DataSource to the TDataSource object that links to the dataset where the data-aware object should fetch its data. DataSource allows the data-aware control to read from, write to, and navigate around the dataset.


TDBOleControl methods

TDBOleControl	Alphabetically

In TDBOleControl

Create

Destroy

Derived from TOleControl

BrowseProperties

DefaultHandler

DoObjectVerb

GetEnumPropDesc

GetHelpContext

GetObjectVerbs

GetPropDisplayString

GetPropDisplayStrings

IsCustomProperty

IsPropPageProperty

SetBounds

SetPropDisplayString

ShowAboutBox

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBOleControl methods

TDBOleControl	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

BrowseProperties

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DoObjectVerb

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetEnumPropDesc

GetHelpContext

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetObjectVerbs

GetParentComponent

GetPropDisplayString

GetPropDisplayStrings

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsCustomProperty

IsPropPageProperty

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetPropDisplayString

SetTextBuf

Show

ShowAboutBox

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TDBOleControl.Create

TDBOleControl	See also

Creates an instance of TDBOleControl.

constructor Create(AOwner: TComponent); override;

Description

Use Create to create a new instance of TDBOleControl object. Create calls the inherited constructor, then creates and initializes TDataBinding objects.


TDBOleControl.Destroy

TDBOleControl	See also

Destroys an instance of TDBOleControl.

destructor Destroy; override;

Description

Do not call Destroy. Instead call Free, which calls Destroy if this TDBOleControl reference is not nil.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TOleControl


TDependency

Hierarchy	Properties	Methods	See also

TDependency object represents a dependent service or load ordering group used by TService objects.

Unit

SvcMgr

Description

A TDependency object represents a new service or load ordering group that must start before the service represented by a TService object. Collections of dependency objects are TDependencies objects. TService has Dependencies and LoadGroup properties that use dependency collections. Each dependency has a Name property that identifies the service or load ordering group, and a boolean IsGroup property to indicate whether the dependency represents a load ordering group.


TDependency properties

TDependency	Alphabetically	Legend

In TDependency

DisplayName

IsGroup

Name

Derived from TCollectionItem

Collection

ID

Index


TDependency properties

TDependency	By object	Legend

Collection

DisplayName

ID

Index

IsGroup

Name


TDependency.DisplayName

TDependency	Properties 	See also

Represents the name of the dependent service as displayed in the property editor window.

property DisplayName: string;

Description

DisplayName is the string that represents the Dependency service as displayed in the Dependencies property editor window for the TService component. By default, DisplayName is the same as the Name property, unless Name is an empty string. In that case, DisplayName is the same as ClassName.

Note: A dependency can be a service. If this is true, do not confuse the various name-related properties of dependency and service objects. For more information, see Service name properties.


TDependency.IsGroup

TDependency	Properties	See also

Indicates whether the dependency represents a load ordering group for a service (TService object).

property IsGroup: Boolean;

Description

IsGroup indicates whether the dependency represents a load ordering group.

Note: Because services and service groups share the same name space, group names must be prefixed by the SC_GROUP_IDENTIFIER character to distinguish them from service names. If IsGroup is set to true, SC_GROUP_INDENTIFIER will automatically be prefixed to the Dependency name (Name property). DisplayName is not modified.


TDependency.Name
TDependency..Name

TDependency	Properties 	See also

Identifies the dependent service or load ordering group used by a TService object.

property Name: String;

Description

Name is the name identifying the service or load ordering group. If Name is the name of a service, Name reflects the actual ServiceStartName of a TService instance.

The property editor for the Dependencies property of TService technically uses the dependency’s DisplayName to identify the dependency service in its collection list. However, Name and DisplayName are nearly always the same.

Dependency objects that are load ordering groups are prefixed by SC_GROUP_IDENTIFIER. Setting the IsGroup property handles prefixing the Name automatically.

Note: A dependency can be a service. If this is true, do not confuse the various name-related properties of dependency and service objects. For more information, see Service name properties.


TDependency methods

TDependency	Alphabetically	Legend

In TDependency

Derived from TCollectionItem

Create

Destroy

GetNamePath

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDependency methods

TDependency	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Scope

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TCollectionItem


 TWebDispatcher

Hierarchy	Properties	Methods	Events

TWebDispatcher passes HTTP request message on to the appropriate action items that assemble a response.

Unit

httpapp

Description

Use TWebDispatcher to convert an ordinary data module to a Web module. Add a TWebDispatcher object to an existing data module that contains other non-visual components and business rules for the Web application. Then delete the automatically generated Web module from the Web application and replace it with the data module that now contains the Web dispatcher.

TWebDispatcher enables the Web server application to respond to HTTP request messages. Only one Web dispatcher can be added to an application. This is why the automatically generated Web module, which is a type of Web dispatcher, must be deleted from the Web application before the data module containing TWebDispatcher can be added.

The TWebDispatcher object manages a collection of action items which know how to respond to HTTP request messages. View, add and delete the action items managed by the dispatcher using the Action editor which is opened by double clicking on the TWebDispatcher icon.

TWebDispatcher publishes some of the properties and events introduced by TCustomWebDispatcher, but introduces no new properties, events, or methods of its own.


TWebDispatcher properties

TWebDispatcher	Alphabetically	Legend

Derived from TCustomWebDispatcher

Action

Actions

Request

Response

Derived from TDataModule

DesignOffset

DesignSize

OldCreateOrder

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TWebDispatcher properties

TWebDispatcher	By object	Legend

Action

Actions

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

DesignOffset

DesignSize

Name

OldCreateOrder

Owner

Request

Response

Tag

VCLComObject


TWebDispatcher events

TWebDispatcher	Alphabetically	Legend

Derived from TCustomWebDispatcher

AfterDispatch

BeforeDispatch

Derived from TDataModule

OnCreate

OnDestroy


TWebDispatcher events

TWebDispatcher	By object	Legend

AfterDispatch

BeforeDispatch

OnCreate

OnDestroy


TWebDispatcher methods

TWebDispatcher	Alphabetically

Derived from TCustomWebDispatcher

ActionByName

Create

Destroy

Derived from TDataModule

AfterConstruction

BeforeDestruction

CreateNew

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWebDispatcher methods

TWebDispatcher	By object

ActionByName

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateNew

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataModule

TCustomWebDispatcher


TDependencies

Hierarchy	Properties	Methods	See also

TDependencies is a container for TDependency objects.

Unit

SvcMgr

Description

TDependencies is a collection of TDependency objects, each of which represents a dependent service or load ordering group for a service (TService instance). TDependencies objects are the implementation of the Dependencies property of TService.


TDependencies properties

TDependencies	Alphabetically	Legend

In TDependencies

Items

Derived from TCollection

Count

ItemClass


TDependencies properties

TDependencies	By object	Legend

Count

ItemClass

Items


TDependencies.Items

TDependencies	See also

Lists the dependency objects in the dependencies collection.

property Items[Index: Integer]: TDependency;

Description

The value of the Index parameter corresponds to the Index property of each TDependency object in the collection. It represents the position of the dependency object in the dependencies collection.


TDependencies methods

TDependencies	Alphabetically	Legend

In TDependencies

Create

Derived from TCollection

Add

Assign

BeginUpdate

Clear

Delete

Destroy

EndUpdate

FindItemID

GetNamePath

Insert

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDependencies methods

TDependencies	By object	Legend

Add

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

FindItemID

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDependencies.Create

TDependencies	See also

Creates an instance of a TDependencies object.

constructor Create(Owner: TPersistent);

Description

Applications should not need to call the constructor directly. Instances of TService create the TDependencies object from their own constructors. The Owner parameter is the TService instance that uses the TDependencies object to implement its Dependencies property.

Create sets the TDependency owner to the Owner parameter and calls the inherited Create.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TCollection


 TDataSetPageProducer

Hierarchy	Properties	Methods	Events	See also

TDataSetPageProducer produces a string of HTML commands based on an input template.

Unit

dsprod

Description

Use TDataSetPageProducer to convert an HTML template that includes field data into a string of HTML commands that can be interpreted by a client application such as a Web browser. HTML templates include HTML commands and HTML-transparent tags that are replaced with customized content by the dataset page producer in an OnHTMLTag event handler.

Dataset page producers differ from other page producer components in that they replace HTML-transparent tags that match fields in a dataset with the current value of those fields.


TDataSetPageProducer properties

TDataSetPageProducer	Alphabetically	Legend

In TDataSetPageProducer

DataSet

Derived from TCustomPageProducer

HTMLDoc

HTMLFile

StripParamQuotes

Derived from TCustomContentProducer

Dispatcher

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDataSetPageProducer properties

TDataSetPageProducer	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DataSet

DesignInfo

Dispatcher

HTMLDoc

HTMLFile

Name

Owner

StripParamQuotes

Tag

VCLComObject


TDataSetPageProducer.DataSet

TDataSetPageProducer	See also

Specifies where the dataset page producer looks for the field values it displays in HTML.

property DataSet: TDataSet;

Description

Set DataSet to specify the dataset from which field values are added to the dataset page producer’s content. When the Content method is called, the dataset page producer converts its HTML template into HTML commands. When the template includes a tag of the form <#fieldname>, where fieldname specifies the name of one of the fields in DataSet, the dataset page producer replaces the tag with the value of the field.


TDataSetPageProducer events

TDataSetPageProducer	Alphabetically	Legend

Derived from TPageProducer

OnHTMLTag


TDataSetPageProducer events

TDataSetPageProducer	By object	Legend

OnHTMLTag


TDataSetPageProducer methods

TDataSetPageProducer	Alphabetically

In TDataSetPageProducer

Content

Derived from TCustomPageProducer

ContentFromStream

ContentFromString

Create

Destroy

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataSetPageProducer methods

TDataSetPageProducer	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Content

ContentFromStream

ContentFromString

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TDataSetPageProducer.Content

TDataSetPageProducer	See also

Returns the translated HTML template.

function Content: string; override;

Description

Call Content to get the HTML commands that result from converting the HTML template. Content reads the template from HTMLDoc or HTMLFile, depending on which property is set. Content replaces each tag in the template that has the form <#Fieldname> with the value of the field in DataSet that has the specified name. Any HTML-transparent tags in the template that do not have tag names which match a field in DataSet are passed on to the OnHTMLTag event handler.

The string returned by Content can be used as the Content property of the response to an HTTP request message.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomContentProducer

TCustomPageProducer

TPageProducer


 TDataSetTableProducer

Hierarchy	Properties	Methods	Events	See also

TDataSetTableProducer assembles a sequence of HTML commands to display the records from a dataset in a tabular format.

Unit

dbweb

Description

Use TDataSetTableProducer to produce an HTML table for the records of a TDataSet object. If the dataset is a query that requires input parameters from an HTTP request message, use TQueryTableProducer instead.

TDataSetTableProducer allows an application to create images of a dataset for an HTTP response message.


TDataSetTableProducer properties

TDataSetTableProducer	Alphabetically	Legend

In TDataSetTableProducer

DataSet

Derived from TDSTableProducer

Caption

CaptionAlignment

Columns

Editor

Footer

Header

MaxRows

RowAttributes

TableAttributes

Derived from TCustomContentProducer

Dispatcher

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDataSetTableProducer properties

TDataSetTableProducer	By object	Legend

Caption

CaptionAlignment

Columns

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DataSet

DesignInfo

Dispatcher

Editor

Footer

Header

MaxRows

Name

Owner

RowAttributes

TableAttributes

Tag

VCLComObject


TDataSetTableProducer.DataSet

TDataSetTableProducer	See also

Specifies the TDataSet object where the dataset table producer looks for the records it displays in an HTML table.

property DataSet: TDataSet;

Description

Set DataSet to specify the dataset that contains the records to be displayed in an HTML table. Use DataSet to set the dataset for the TDataSetTableProducer rather than the DataSource property. Dataset table producers do not use an external TDataSource object, but generate their own data source internally.

The individual field bindings specified by the THTMLTableColumn objects in the Columns property refer to fields in DataSet.


TDataSetTableProducer events

TDataSetTableProducer	Alphabetically	Legend

Derived from TDSTableProducer

OnCreateContent

OnFormatCell

OnGetTableCaption


TDataSetTableProducer events

TDataSetTableProducer	By object	Legend

OnCreateContent

OnFormatCell

OnGetTableCaption


TDataSetTableProducer methods

TDataSetTableProducer	Alphabetically

In TDataSetTableProducer

Content

Derived from TDSTableProducer

BeginUpdate

Create

Destroy

EndUpdate

Derived from TCustomContentProducer

ContentFromStream

ContentFromString

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataSetTableProducer methods

TDataSetTableProducer	By object

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Content

ContentFromStream

ContentFromString

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

EndUpdate

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TDataSetTableProducer.Content

TDataSetTableProducer	See also	Example

Returns the HTML representation of the records in the dataset.

function Content: string; override;

Description

Call Content to retrieve the HTML representation specified by the properties of the TDataSetTableProducer object. Content calls the OnCreateContent event handler. If the OnCreateContent event handler indicates that the Content method should continue, Content returns the Header property, followed by an HTML table image of the records in the dataset, followed by the Footer property. If the OnCreateContent event handler indicates that the Content method should not continue, Content returns an empty string.

The string returned by Content can be used as the Content property of the response to an HTTP request message.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomContentProducer

TDSTableProducer


 TDSTableProducer

Hierarchy	Properties	Methods	Events	See also

TDSTableProducer is the abstract base class for objects that produce a set of HTML commands to display the records from a dataset in a tabular format.

Unit

dbweb

Description

Use TDSTableProducer as a base class when defining a class that produces an HTML table that represents the records of a dataset. TDSTableProducer introduces many properties to describe the appearance and data binding of the HTML table. The events and methods of TDSTableProducer allow an application to retrieve the database information and produce the HTML commands that describe the table.


TDSTableProducer properties

TDSTableProducer	Alphabetically	Legend

In TDSTableProducer

Caption

CaptionAlignment

Columns

DataLink

DataSet

DataSource

Editor

Footer

Header

InternalDataSource

MaxRows

RowAttributes

TableAttributes

Derived from TCustomContentProducer

Dispatcher

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDSTableProducer properties

TDSTableProducer	By object	Legend

Caption

CaptionAlignment

Columns

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DataLink

DataSet

DataSource

DesignInfo

Dispatcher

Editor

Footer

Header

InternalDataSource

MaxRows

Name

Owner

RowAttributes

TableAttributes

Tag

VCLComObject


TDSTableProducer.Caption

TDSTableProducer	See also

Specifies the caption string that appears with the HTML table.

property Caption: string;

Description

Set Caption to add a caption to the HTML table that represents the dataset. Caption indicates the text that should appear inside the HTML CAPTION tag.


TDSTableProducer.CaptionAlignment

TDSTableProducer	See also

Specifies where the Caption string should appear relative to the HTML table.

type THTMLCaptionAlignment = (caDefault, caTop, caBottom);

property CaptionAlignment: THTMLCaptionAlignment;

Description

Set CaptionAlignment to specify whether the Caption should appear above or below the HTML table. CaptionAlignment can be one of the following values:

Value	Meaning

caDefault	The Web browser can position the caption where it wants.

caTop	The caption should appear above the HTML table.

caBottom	The caption should appear below the HTML table.

CaptionAlignment is the value of the ALIGN option on the HTML CAPTION tag.


TDSTableProducer.Columns

TDSTableProducer	See also 	Example

Describes the field bindings and display attributes of the columns in the HTML table.

property Columns: THTMLTableColumns;

Description

Use Columns to read or set the field bindings and display attributes of the columns in the HTML table. Each THTMLTableColumn object specifies the display attributes of the corresponding column. Each column object also specifies the name of the field the column represents. The field binding of a column designates a field within the dataset specified by the DataSet property.

Columns can be set at design time through a property editor, or programmatically at runtime.


TDSTableProducer.DataLink

TDSTableProducer	See also

Manages the link to the dataset.

property DataLink: THTTPDataLink;

Description

Applications cannot use the DataLink property. It is exposed as a protected property so that descendant HTML producers can customize their response to data events.


TDSTableProducer.DataSet

TDSTableProducer	See also

Specifies the dataset from which the data in the HTML table is taken.

property DataSet: TDataSet;

Description

Set DataSet to specify where the TDSTableProducer should look for the data it displays in the HTML table. The individual field bindings specified by the THTMLTableColumn objects in the Columns property refer to fields in DataSet.

Specify the data binding of a TDSTableProducer using the DataSet property rather than through a DataSource property. TDSTableProducer objects do not use an external TDataSource object.


TDSTableProducer.DataSource

TDSTableProducer	See also

Represents the link to the DataSet of the TDSTableProducer.

property DataSource: TDataSource;

Description

Do not use the DataSource property. The data source of a TDSTableProducer object is an internally generated TDataSource object that is used for internal interfaces that do not work directly with a TDataSet object.

The InternalDataSource property provides read-only access to the data source represented by DataSource.


TDSTableProducer.Editor

TDSTableProducer

Writes changes made in the property editor at design time to the TDSTableProducer object.

property Editor: TDSTableProducerEditor;

Description

Descendants of TDSTableProducer set the Editor property to the TDSTableProducerEditor object that connects their implementation with a common property editor. Editor allows a single property editor to represent the properties of different table producers.


TDSTableProducer.Footer

TDSTableProducer	See also

Specifies a set of HTML commands that appear in the HTML document following the HTML table.

property Footer: TStrings;

Description

Set Footer to embed the representation of DataSet in a larger document. The Content method of TDSTableProducer descendants returns any Header commands, followed by the HTML table that represents the DataSet, followed by any Footer commands.


TDSTableProducer.Header

TDSTableProducer	See also	Example

Specifies a set of HTML commands that appear in the HTML document preceding the HTML table.

property Header: TStrings;

Description

Set Header to embed the representation of DataSet in a larger document. The Content method of TDSTableProducer descendants returns any Header commands, followed by the HTML table that represents the DataSet, followed by any Footer commands.


TDSTableProducer.InternalDataSource

TDSTableProducer	See also

Represents the link to the dataset.

property InternalDataSource: TDataSource;

Description

Descendants of TDSTableProducer read InternalDataSource to access the properties and methods of the data source. Unlike other data-aware components, TDSTableProducer does not use an external TDataSource object.


TDSTableProducer.MaxRows

TDSTableProducer	See also

Specifies the maximum number of rows that appear in the HTML table.

property MaxRows: Integer;

Description

Set MaxRows to change the upper limit on the size of the HTML table produced to represent the DataSet. MaxRows is initialized to 20.

If DataSet contains more than MaxRows records, only the first MaxRows records appear in the HTML commands produced by Content. If DataSet contains fewer than MaxRows records, the HTML table produced by TDSTableProducer will contain only enough rows to display all the records in DataSet.


TDSTableProducer.RowAttributes

TDSTableProducer	See also

Specifies the display attributes of all the rows in the HTML table.

property RowAttributes: THTMLTableRowAttributes;

Description

Set RowAttributes to a THTMLTableRowAttributes object that describes the display attributes of the rows in the HTML table. Setting RowAttributes calls the Assign method of the THTMLTableRowAttributes object stored internally by TDSTableProducer. Thus, the memory for any row attributes object assigned to the RowAttributes property is never owned or freed by TDSTableProducer.

Note:	Not all the properties of the row attributes object are copied when one row attributes object is assigned to another. To ensure that all the attributes represented by RowAttributes are set appropriately, read RowAttributes and set the individual properties of the THTMLTableRowAttributes object.


TDSTableProducer.TableAttributes

TDSTableProducer	See also

Specifies the display attributes that pertain to the entire HTML table produced by TDSTableProducer.

property TableAttributes: THTMLTableAttributes;

Description

Set TableAttributes to a THTMLTableAttributes object that describes the display attributes for the HTML TABLE tag. Setting TableAttributes calls the Assign method of the THTMLTableAttributes object stored internally by TDSTableProducer. Thus, the memory for any table attributes object assigned to the TableAttributes property is never owned or freed by TDSTableProducer.

Note:	Not all the properties of the table attributes object are copied when one table attributes object is assigned to another. To ensure that all the attributes represented by TableAttributes are set appropriately, read TableAttributes and set the individual properties of the THTMLTableAttributes object.


TDSTableProducer events

TDSTableProducer	Alphabetically	Legend

In TDSTableProducer

OnCreateContent

OnFormatCell

OnGetTableCaption


TDSTableProducer events

TDSTableProducer	By object	Legend

OnCreateContent

OnFormatCell

OnGetTableCaption


TDSTableProducer.OnCreateContent

TDSTableProducer	See also

Occurs in descendants of TDSTableProducer when the Content method needs to generate the HTML table image.

type TCreateContentEvent = procedure (Sender: TObject; var Continue: Boolean) of object;

property OnCreateContent: TCreateContentEvent;

Description

Write an OnCreateContent event handler to conditionally prevent the Content method from producing any HTML commands. Set the Continue parameter to False to make Content return an empty string.


TDSTableProducer.OnFormatCell

TDSTableProducer	See also

Occurs when the HTML for a specified cell specified is about to be generated.

type

  THTMLBgColor = type string;

THTMLAlign = (haDefault, haLeft, haRight, haCenter);

THTMLVAlign = (haVDefault, haTop, haMiddle, haBottom, haBaseline);

THTMLFormatCellEvent = procedure (Sender: TObject; CellRow, CellColumn: Integer; var BgColor: THTMLBgColor; var Align: THTMLAlign; var VAlign: THTMLVAlign; var CustomAttrs, CellData: string) of object;

property OnFormatCell: THTMLFormatCellEvent;

Description

Write an OnFormatCell event handler to change the appearance or contents of individual cells in the HTML table from the default values produced by TDSTableProducer. CellRow and CellColumn specify the cell that is about to be generated, where the table header is CellRow 0, and the first column is CellColumn 0.

BgColor, Align, VAlign, and CustomAttrs represent the default display properties for the cell, taken from the THTMLTableColumn object for the column in which the cell appears. See the corresponding entries for these properties of the THTMLTableColumn object for more information on these values.

CellData is the text that appears in the cell, taken from the field object for the column. The OnFormatCell event handler can change any or all of these values to specify the way the cell should appear in the final HTML table.


TDSTableProducer.OnGetTableCaption

TDSTableProducer	See also

Occurs when the HTML table producer is about to generate the HTML for the table caption.

type

  THTMLCaptionAlignment = (caDefault, caTop, caBottom);

THTMLGetTableCaptionEvent = procedure (Sender: TObject; var Caption: string; var Alignment: THTMLCaptionAlignment) of object;

property OnGetTableCaption: THTMLGetTableCaptionEvent;

Description

Write an OnGetTableCaption event handler to change the value or placement of the HTML table caption. The Caption and Alignment parameters are originally set to the values of the Caption and CaptionAlignment properties, respectively. The OnGetTableCaption event handler can change these values to alter the caption for the HTML table returned by the Content method.


TDSTableProducer methods

TDSTableProducer	Alphabetically	Legend

In TDSTableProducer

AcquireLayoutLock

BeginLayout

BeginUpdate

ColumnHeader

Create

DefineFieldMap

Destroy

DoCreateContent

DoFormatCell

DoGetCaption

EndLayout

EndUpdate

FormatCell

GetDataSet

GetDataSource

LayoutChanged

LinkActive

Notification

RowHeader

SetColumns

SetDataSet

SetDataSource

StoreColumns

TableCaption

TableHeader

Derived from TCustomContentProducer

Content

ContentFromStream

ContentFromString

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDSTableProducer methods

TDSTableProducer	By object	Legend

AcquireLayoutLock

AfterConstruction

Assign

BeforeDestruction

BeginLayout

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ColumnHeader

Content

ContentFromStream

ContentFromString

Create

DefaultHandler

DefineFieldMap

Destroy

DestroyComponents

Destroying

Dispatch

DoCreateContent

DoFormatCell

DoGetCaption

EndLayout

EndUpdate

FieldAddress

FindComponent

FormatCell

Free

FreeInstance

FreeNotification

FreeOnRelease

GetDataSet

GetDataSource

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

LayoutChanged

LinkActive

MethodAddress

MethodName

NewInstance

Notification

RemoveComponent

RowHeader

SafeCallException

SetColumns

SetDataSet

SetDataSource

StoreColumns

TableCaption

TableHeader


TDSTableProducer.AcquireLayoutLock

TDSTableProducer	See also

Calls BeginLayout when the HTML table is not currently being laid out.

function AcquireLayoutLock: Boolean;

Description

Applications cannot call this protected method. AcquireLayoutLock is called before recomputing Columns when the fields in the dataset change or when the Columns property changes. AquireLayoutLock returns True if the HTML table is not already being laid out, to indicate that the computation of Columns should proceed. AquireLayoutLock prevents the computation of Columns from looping endlessly in response to the changes that occur during the computation.


TDSTableProducer.BeginLayout

TDSTableProducer	See also

Increments a counter that indicates the number of times the computation of the column order was begun but not completed.

procedure BeginLayout;

Description

Applications cannot call this protected method. TDSTableProducer calls BeginLayout internally before making changes to the Columns property or any of the individual THTMLTableColumn objects in Columns. Once the change is complete, TDSTableProducer calls EndLayout.

When all BeginLayout calls have been matched by a corresponding call to EndLayout, the field mapping maintained by DataLink for the fields in the dataset is updated to match both the field bindings of the Columns property and the fields available in the dataset. The Columns property is updated in turn to match the field bindings in DataLink. This ensures that the Columns property matches both the specified column bindings and the fields available in the dataset.


TDSTableProducer.BeginUpdate

TDSTableProducer	See also

Increments a counter that indicates the number of changes to the contents of the HTML table that have been initiated but not completed.

procedure BeginUpdate;

Description

Applications should not call BeginUpdate. BeginUpdate is called internally before changes that affect the contents of the HTML table. Once a change is complete, EndUpdate is called. BeginUpdate and EndUpdate allow descendants of TDSTableProducer to wait until changes to the dataset are complete before fetching records for the HTML image of the table.


TDSTableProducer.ColumnHeader

TDSTableProducer	See also

Returns the string of HTML <TH> tags that define the column headers for the table.

function ColumnHeader: string; dynamic;

Description

The table producer uses this protected method when it assembles its HTML table. For each THTMLTableColumn object listed in the Columns property, ColumnHeader looks up the string that labels it (using its Title property or the display name for the field if there is no title caption). ColumnHeader then creates a table header (<TH>) tag that describes the column label, including all the properties specified by the THTMLTableColumn object.


TDSTableProducer.Create

TDSTableProducer	See also

Creates an instance of TDSTableProducer.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create a table producer from within the OnAction event handler of a TWebActionItem that needs to produce an HTML image of a dataset in response to an HTTP request message.

After calling the inherited constructor, Create allocates all the helper objects used by TDSTableProducer and initializes the MaxRows property to 20.


TDSTableProducer.DefineFieldMap

TDSTableProducer	See also

Builds the Fields array in DataLink.

procedure DefineFieldMap;

Description

Applications cannot call this protected method. DefineFieldMap rebuilds the field mapping for the dataset that is maintained by DataLink. This mapping reflects both the column bindings of the Columns property and the fields available in the dataset. After calling DefineFieldMap, the Columns property should be updated to match the field bindings in DataLink. This ensures that the Columns property reflects any changes imposed by the dataset.


TDSTableProducer.Destroy

TDSTableProducer	See also

Destroys an instance of TDSTableProducer.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the TDSTableProducer reference is not nil, and only then calls Destroy.

Destroy frees all the helper objects used by TDSTableProducer.


TDSTableProducer.DoCreateContent

TDSTableProducer	See also

Indicates whether the Content method should produce a string of HTML commands.

function DoCreateContent: Boolean;

Description

Applications can’t call this protected method. It is called internally by the Content method to allow the OnCreateContent event handler to block the creation of any HTML commands. If DoCreateContent returns True, Content assembles a string of HTML to describe the dataset. If DoCreateContent returns False, Content returns an empty string.

DoCreateContent calls the OnCreateContent event handler if one is assigned. If there is no OnCreateContent event handler, DoCreateContent returns True. Descendants of TDSTableProducer can override DoCreateContent to add additional restrictions on when the HTML describing DataSet should be produced, or to block the OnCreateContent event.


TDSTableProducer.DoFormatCell

TDSTableProducer	See also

Generates an OnFormatCell event.

type

  THTMLBgColor = type string;

THTMLAlign = (haDefault, haLeft, haRight, haCenter);

THTMLVAlign = (haVDefault, haTop, haMiddle, haBottom, haBaseline);

procedure DoFormatCell(CellRow, CellColumn: Integer; var BgColor: THTMLBgColor; var Align:THTMLAlign; var VAlign: THTMLVAlign; var CustomAttrs, CellData: string); dynamic;

Description

Applications can’t call this protected method. It is called internally by the Content method to allow the OnFormatCell event handler to customize the contents or display attributes of any cell in the HTML table. CellRow and CellColumn indicate the cell about to be rendered as HTML, where CellRow for the table header is 0, and CellColumn for the first column is 0. BgColor, Align, VAlign, and CustomAttrs are the display attributes that can be changed. CellData is the text that goes in the cell.

Descendants of TDSTableProducer can override DoFormatCell to make additional changes to the cells as they are rendered or to block the OnFormatCell event.


TDSTableProducer.DoGetCaption

TDSTableProducer	See also

Generates an OnGetCaption event.

type THTMLCaptionAlignment = (caDefault, caTop, caBottom);

procedure DoGetCaption(var TableCaption: string; var CaptionAlign: THTMLCaptionAlignment); dynamic;

Description

Applications can’t call this protected method. It is called internally by the Content method to let the OnGetTableCaption event handler change the Caption and CaptionAlignment properties when the table caption is rendered as HTML.

Descendants of TDSTableProducer can override DoCreateCaption to make additional changes when the caption is rendered or to block the OnCreateCaption event.


TDSTableProducer.EndLayout

TDSTableProducer	See also

Decrements a counter that indicates the number of times the computation of the column order has been begun but not completed.

procedure EndLayout;

Description

Applications can’t call this protected method. TDSTableProducer objects call EndLayout internally after making changes to the Columns property or when changes are made to the fields in DataSet.

Each call to EndLayout should match a corresponding call to BeginLayout. If all BeginLayout calls have been matched by an EndLayout call, EndLayout calls DefineFieldMap to regenerate the field mapping for the dataset maintained by DataLink. The Columns property is then updated to match the field map in DataLink. This ensures that the Columns property matches both the specified column bindings and the fields available in the dataset.


TDSTableProducer.EndUpdate

TDSTableProducer	See also

Decrements a counter that indicates the number of changes to the contents of the HTML table.

procedure EndUpdate;

Description

Applications should not call EndUpdate. EndUpdate is called internally after changes to the column bindings or DataSet of the TDSTableProducer. BeginUpdate and EndUpdate allow descendants of TDSTableProducer to wait until changes to the dataset are complete before fetching records for the HTML image of the table.


TDSTableProducer.FormatCell

TDSTableProducer	See also

Returns an HTML tag of a specified type that reflects a set of specified options.

function FormatCell(CellRow, CellColumn: Integer; CellData: string; const Tag: string; const BgColor: THTMLBgColor; Align: THTMLAlign; VAlign: THTMLVAlign;; const Custom: string): string; dynamic;

Description

The table producer uses this protected utility to assemble a set of properties into a single HTML tag. FormatCell first generates an OnFormatCell event, so that the application can override any of the properties that control the tag options. Then it assembles the resulting values into the specified tag.

CellRow and CellColumn identify the table cell to be formatted. These parameters are passed to an OnFormatCell event handler so that it can identify the cell.

CellData contains the text displayed in the cell (a data value or column header).

Tag indicates the type of HTML tag to generate (<TD> for data cells, <TH> for column headers).

BgColor specifies the background color of the cell. An OnFormatCell event handler can override this value.

Align specifies the horizontal alignment of CellData within the cell. An OnFormatCell event handler can override this value.

VAlign specifies the vertical alignment of CellData within the cell. An OnFormatCell event handler can override this value.

Custom specifies any other options for the generated HTML tag. An OnFormatCell event handler can override this value.

FormatCell returns a string with the generated HTML tag.


TDSTableProducer.GetDataSet

TDSTableProducer	See also

Provides the abstract prototype of a method to access the DataSet property.

function GetDataSet: TDataSet; virtual; abstract;

Description

Descendants of TDSTableProducer implement the GetDataSet method to access their specific implementation of the DataSet property. Descendants of TDSTableProducer restrict the DataSet property to different classes of TDataSet objects.


TDSTableProducer.GetDataSource

TDSTableProducer	See also

Returns the value of the DataSource property.

function GetDataSource: TDataSource;

Description

GetDataSource is exposed as a protected method so that descendants of TDSTableProducer can override the implementation of the DataSource property.

The DataSource property for TDSTableProducer is an internally generated TDataSource object, not an external component that can be shared with other objects. It is surfaced only for internal APIs that require a TDataSource object rather than working directly with TDataSet.


TDSTableProducer.LayoutChanged

TDSTableProducer	See also

Causes the Columns property to be recomputed when the dataset changes or changes are made to individual column objects.

procedure LayoutChanged;

Description

Applications cannot call this protected method. It is called when the Columns property changes or the fields in the dataset change. LayoutChanged recomputes the Columns property after guarding against recursion from the changes to the Columns property that arise in the computation.

LayoutChanged calls AcquireLayoutLock to initiate the changes to Columns. If AcquireLayoutLock does not indicate that the call to LayoutChanged is recursive, LayoutChanged calls EndLayout to perform the actual computation.


TDSTableProducer.LinkActive

TDSTableProducer	See also

Recomputes the Columns property when the dataset becomes active.

procedure LinkActive(Value: Boolean);

Description

Applications cannot call this protected method. LinkActive is called when the DataSource property changes or when the dataset becomes active. It recomputes Columns to reflect any changes that may have occurred in the fields of the dataset when it was not active.


TDSTableProducer.Notification

TDSTableProducer	See also

Adjusts the properties of TDSTableProducer when its helper objects are destroyed.

procedure Notification(AComponent: TComponent; Operation: TOperation); override;

Description

Notification overrides the inherited method to respond to messages that the DataSource or one of its field objects is about to be destroyed. Notification sets the DataSource property to nil, or unbinds the column that references the field component.


TDSTableProducer.RowHeader

TDSTableProducer	See also

Returns the HTML <TR> tag that defines each row of the HTML table.

function RowHeader: string; dynamic;

Description

The table producer calls this protected method for each row when it assembles its HTML table. RowHeader generates an HTML table row tag (<TR>), using the RowAttributes property to determine what options are added to the tag.


TDSTableProducer.SetColumns

TDSTableProducer	See also

Sets the Columns property.

procedure SetColumns(Value: THTMLTableColumns);

Description

SetColumns is the protected method used to set the Columns property. SetColumns calls the Assign method of the THTMLTableColumns object stored internally by TDSTableProducer. Thus, the memory for any columns object assigned to the Columns property is never owned or freed by TDSTableProducer.


TDSTableProducer.SetDataSet

TDSTableProducer	See also

Provides the abstract prototype of a method to set the DataSet property.

procedure SetDataSet(ADataSet: TDataSet); virtual; abstract;

Description

Descendants of TDSTableProducer override SetDataSet to ensure that the DataSet property can only be set to an appropriate descendant of TDataSet.


TDSTableProducer.SetDataSource

TDSTableProducer	See also

Sets the DataSource property.

procedure SetDataSource(Value: TDataSource);

Description

SetDataSource is the protected implementation of the DataSource property.

The DataSource property for TDSTableProducer is an internally generated TDataSource object, not an external component that can be shared with other objects. It is surfaced only for internal API calls that require a TDataSource object rather than working directly with TDataSet.


TDSTableProducer.StoreColumns

TDSTableProducer	See also

Indicates whether the Columns property is stored when the TDSTableProducer is saved.

function StoreColumns: Boolean;

Description

StoreColumns causes the Columns property to be stored only when the Columns property has a State property of csCustom. The State property for Columns indicates whether the columns represent default display attributes for all the fields in the dataset, or if the display attributes or field bindings of the columns have been customized programmatically or by the Columns editor.


TDSTableProducer.TableCaption

TDSTableProducer	See also

Returns the HTML <Caption> tag that defines the caption for the HTML table.

function TableCaption: string; dynamic;

Description

The table producer calls this protected method when it assembles its HTML table. TableCaption generates an OnGetTableCaption event to allow an event handler to override the Caption and CaptionAlignment properties. It then returns the HTML table caption tag (<caption>) with the resulting caption and alignment.


TDSTableProducer.TableHeader

TDSTableProducer	See also

Returns the HTML <Table> tag for the HTML table.

function TableHeader: string; dynamic;

Description

The table producer calls this protected method when it assembles its HTML table. TableHeader generates an HTML table tag (<Table>), using the TableAttributes property to determine what options are added to the tag.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TCustomContentProducer


TDSTableProducerEditor

Hierarchy	Properties	MethodsSeealso

TDSTableProducer is the base class for the helper object used by TDSTableProducer objects to communicate with a property editor at design time.

Unit

dbweb

Description

Component writers can derive objects from TDSTableProducer to enable new descendants of TDSTableProducer to take advantage of the property editors in the IDE. TDSTableProducerEditor introduces methods to communicate changes between a TDSTableProducer object and the property editor.


TDSTableProducerEditor properties

TDSTableProducerEditor	Alphabetically	Legend

In TDSTableProducerEditor

DataSource

DSTableProducer


TDSTableProducerEditor properties

TDSTableProducerEditor	By object	Legend

DataSource

DSTableProducer


TDSTableProducerEditor.DataSource

TDSTableProducerEditor	See also

Indicates the DataSource property of the associated TDSTableProducer.

property DataSource: TDataSource;

Description

Applications should not directly change the DataSource property. DataSource allows the property editor to read or change the internal data source of the TDSTableProducer object.


TDSTableProducerEditor.DSTableProducer

TDSTableProducerEditor	See also

Indicates the TDSTableProducer object that uses TDSTableProducerEditor to communicate with its property editor at design time.

property DSTableProducer: TDSTableProducer;

Description

Read TDSTableProducer to obtain direct access to the TDSTableProducer object that uses TDSTableProducerEditor.


TDSTableProducerEditor methods

TDSTableProducerEditor	Alphabetically

In TDSTableProducerEditor

Changed

Create

Destroy

PostChange

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDSTableProducerEditor methods

TDSTableProducerEditor	By object

AfterConstruction

BeforeDestruction

Changed

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

PostChange

SafeCallException


TDSTableProducerEditor.Changed

TDSTableProducerEditor	See also

Provides the interface for a method that responds to change notifications from the TDSTableProducer object.

procedure Changed; virtual;

Description

The Changed method for TDSTableProducerEditor does nothing. It exists so that descendants of TDSTableProducerEditor can perform any necessary updates when the TDSTableProducer object changes. TDSTableProducer calls Changed when any of its properties change.


TDSTableProducerEditor.Create

TDSTableProducerEditor	See also

Creates an instance of TDSTableProducerEditor.

constructor Create(DSTableProducer: TDSTableProducer);

Description

Do not call Create directly in an application. A TDSTableProducerEditor is created at design time when needed.

Create initializes the DSTableProducer property, and sets the Editor property in the TDSTableProducer object passed as the DSTableProducer parameter.


TDSTableProducerEditor.Destroy

TDSTableProducerEditor	See also

Destroys an instance of TDSTableProducerEditor.

destructor Destroy; override;

Description

Do not call Destroy from an application. A TDSTableProducerEditor object is freed automatically at design time. Destroy sets the Editor property of the associated TDSTableProducer object to nil.


TDSTableProducerEditor.PostChange

TDSTableProducerEditor	See also

Provides an interface for a method that responds to update notifications from the columns of a TDSTableProducer object.

procedure PostChange; virtual;

Description

The PostChange method for TDSTableProducerEditor does nothing. It exists so that descendants of TDSTableProducerEditor can perform any necessary updates when the columns of the TDSTableProducer object change. THTMLTableColumns calls PostChange when its columns are changed.


Accessibility

Read-only


Hierarchy

TObject


TDataBindings

Hierarchy	Properties	Methods

TDataBindings holds a group of TDataBindItem objects.

Unit

Dbolectl

Description

Use TDataBindings to connect the properties of a data-aware ActiveX control to the fields in a dataset. TDataBindings maintains an index of data bindings (TDataBindItem objects) in its Items array. The Count property of its ancestor TCollection, contains the number of items in the collection. Use the Add method to add items to the collection.

Typically, this object is for internal use. Instead, you access an object’s data bindings through the DataBindings property of the DBOleControl object.


TDataBindings properties

TDataBindings	Alphabetically	Legend

In TDataBindings

Items

Derived from TCollection

Count

ItemClass


TDataBindings properties

TDataBindings	By object	Legend

Count

ItemClass

Items


TDataBindings.Items

TDataBindings	See also

Provides indexed access to the TDataBindItem objects in the collection.

property Items[Index: Integer]: TDataBindItem;

Description

Use Items to access the properties of TDataBindItem objects maintained by TDataBindings. Items is the default property of TDataBindings, so the name of the property can be left off when using this property. Thus, the line:

FirstDataBinding := DBOleCtl1.DataBindings.Items[0];

can be written as:

FirstDataBinding := DBOleCtl1.DataBindings[0];


TDataBindings methods

TDataBindings	Alphabetically

In TDataBindings

Add

Create

GetItemByDispID

GetOwner

Update

Derived from TCollection

Assign

BeginUpdate

Clear

Delete

Destroy

EndUpdate

FindItemID

GetNamePath

Insert

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDataBindings methods

TDataBindings	By object

Add

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

FindItemID

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetItemByDispID

GetNamePath

GetOwner

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

Update


TDataBindings.Add

TDataBindings	See also

Creates a new TDataBindItem object and adds it to the end of the Items property array.

function Add: TDataBindItem;

Description

Call Add to add a new TDataBindItem to the set of data bindings associated with the specified data-aware control. With this method, you must also set the fields within the TDataBindItem at the same time. These data bindings can be modified programmatically at a later time.


TDataBindings.Create

TDataBindings

Creates an instance of TDataBindings.

constructor Create(DBOleControl: TDBOleControl);

Description

Applications should not need to call Create directly. The data-aware control object that uses the TDataBindings collection to represent its data bindings creates the TDataBindings object from its own constructor.


TDataBindings.GetItemByDispID

TDataBindings

Returns the associated TDataBindItem property for the specified DispID.

function GetItemByDispID(ADispID: TDispID): TDataBindItem;

Description

GetItemByDispID returns the TDataBindItem property for the specified DispID. It returns nil if  no TDataBindItem property exists for the specified DispID.


TDataBindings.GetOwner

TDataBindings	See also

Returns the owner of an object.

function GetOwner: TPersistent; override;

Description

GetOwner is used to find the owner of a data binding, that is, the data-aware control.


TDataBindings.Update

TDataBindings

For internal use.

procedure Update(Item: TCollectionItem); override;

Description

Update refreshes the field definitions in the Items property array to reflect the current state of the physical fields in the underlying dataset. This is typically for internal use.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


TDataBindItem

Hierarchy	Properties	Methods

TDateBindItem represents a data binding in a data-aware ActiveX control.

Unit

Dbolectl

Description

The TDatabBindItem object stores the association between a property in a data-aware control and a field in the dataset. TDataBindings holds a collection of data bindings for a particular ActiveX control, which is represented by a TDBOleControl object.


TDataBindItem properties

TDataBindItem	Alphabetically	Legend

In TDataBindItem

DataField

DispID

Derived from TCollectionItem

Collection

DisplayName

ID

Index


TDataBindItem properties

TDataBindItem	By object	Legend

Collection

DataField

DispID

DisplayName

ID

Index


TDataBindItem.DataField

TDataBindItem	Properties	See also

Represents the name of the field to be bound.

property DataField: string;

Description

DataField relates a property in a data-aware ActiveX control to a specific field in the dataset. The dataset is specified by the DataSource property of TDBOleControl object.


TDataBindItem.DispID

TDataBindItem	Properties	See also

The identifier (DispID) of the data-aware control property to be bound.

property DispID: TDispID;

Description

Every data-aware property in an ActiveX control has a unique DispID. The collection of databindings is represented by the DataBindings property of TDBOleControl object.


TDataBindItem methods

TDataBindItem	Alphabetically

In TDataBindItem

Create

Destroy

Derived from TPersistent

Assign

Derived from TCollectionItem

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDataBindItem methods

TDataBindItem	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

FreeInstance

Free

GetInterfaceEntry

GetInterfaceTable

GetInterface

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDataBindItem.Create

TDataBindItem	Methods	See also

Creates an instance of TDataBindItem.

constructor Create(Collection: TCollection); override;

Description

Do not create an instance of TDataBindItem directly. Instead, an instance is created when the Add method of the TDataBindings object is called.


TDataBindItem.Destroy

TDataBindItem	MethodsSee also

Destroys the TDataBindItem instance and frees its memory.

destructor Destroy; override;

Description

Destroy is called indirectly by TCollection’s Clear method.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem


EAppletException

Hierarchy	Properties	Methods	See also

EAppletException is the exception class for errors that occur in a Control Panel Application.

Unit

ctlpanel

Description

EAppletException is the exception for errors specific to applications created by the control panel wizard.


EAppletException properties

EAppletException	Alphabetically

Derived from Exception

HelpContext

Message


EAppletException properties

EAppletException	By object

HelpContext

Message


EAppletException methods

EAppletException	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EAppletException methods

EAppletException	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EOleException

Hierarchy	Properties	Methods	See also

EOleException is the exception class for OLE automation errors that occur in methods or properties of an object.

Unit

comobj

Description

EOleException is the exception class for errors specific to the OLE IDispatch interface. EOleException is raised when an error occurs in the middle of a method call from IDispatch. EOleException is generated when a Delphi server receives a failure return value from a property or method that was called with the IDispatch interface Invoke method.

When an error occurs, objects invoked through IDispatch can return essential information about the exception, including the source of the error, error code, description, help file, and ID number for context-sensitive help. EOleException captures this information, and the error description and ID number (if available) are included in a message generated by CreateHelp; the other information is stored in the Source and HelpFile properties defined for EOleException and the ErrorCode property inherited from EOleSysError.


EOleException properties

EOleException	Alphabetically

In EOleException

HelpFile

Source

Derived from EOleSysError

ErrorCode

Derived from Exception

HelpContext

Message


EOleException properties

EOleException	By object

ErrorCode

HelpContext

HelpFile

Message

Source


EOleException.HelpFile

EOleException

Specifies the name and location of the help file that contains information about the error that occurred.

property HelpFile: string;

Description

HelpFile lists the name and complete directory path of the help file that contains information about the error.


EOleException.Source

EOleException

Designates the application program in which the exception occurred.

property Source: string;

Description

Source gives the source of the exception. Usually, this is the name of an application program.


EOleException methods

EOleException	Alphabetically

In EOleException

Create

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EOleException methods

EOleException	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EOleException.Create

EOleException	See also

Creates an ole exception object.

constructor Create(const Message: string; ErrorCode: HRESULT; const Source, HelpFile: string; HelpContext: Integer);

Description

Create instantiates an EOleException object.

Create allocates memory for the exception and initializes the ErrorCode, HelpFile, and Source properties using information passed in the OLE EXCEPINFO structure. It then calls the inherited CreateHelp method to display the error description and ID number from EXCEPINFO.


Hierarchy

TObject

Exception

EOleError

EOleSysError


EOleRegistrationError

Hierarchy	Properties	Methods

EOleRegistrationError is the exception class for errors that occur when registering an OLE object.

Unit

comobj

Description

EOleRegistrationError is raised by the CreateRegKey method when it encounters an error while trying to register a COM class with the system registry.


EOleRegistrationError properties

EOleRegistrationError	Alphabetically

Derived from Exception

HelpContext

Message


EOleRegistrationError properties

EOleRegistrationError	By object

HelpContext

Message


EOleRegistrationError methods

EOleRegistrationError	Alphabetically

In EOleRegistrationError

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EOleRegistrationError methods

EOleRegistrationError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EOleError


EOleError

Hierarchy	Properties	Methods	See also

EOleError is the exception class for low-level OLE errors.

Unit

comobj

Description

EOleError is raised when the system returns a non-zero HRESULT involving low-level OLE errors or and old OLE 2 errors. Delphi checks for, but does not generate, these exceptions.


EOleError properties

EOleError	Alphabetically

Derived from Exception

HelpContext

Message


EOleError properties

EOleError	By object

HelpContext

Message


EOleError methods

EOleError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EOleError methods

EOleError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EOleSysError

Hierarchy	Properties	Methods

EOleSysError is the exception class for errors specific to the OLE IDispatch interface.

Unit

comobj

Description

EOleSysError is the exception class for errors that occur during an attempt to invoke a method or property of an OLE automation object. When the IDispatch Invoke method fails, EOleSysError is raised. Objects invoked through IDispatch can return the error code—an OLE status code or SCODE—indicating the reason for the error.


EOleSysError properties

EOleSysError	Alphabetically

In EOleSysError

ErrorCode

Derived from Exception

HelpContext

Message


EOleSysError properties

EOleSysError	By object

ErrorCode

HelpContext

Message


EOleSysError.ErrorCode

EOleSysError	See also

The status code returned by the failed method call, indicating the reason for the failure.

property ErrorCode: HRESULT;

Description

ErrorCode is the numerical error code returned by a failed call to an OLE automation object’s method or property.

ErrorCode is initialized in the constructor.


EOleSysError methods

EOleSysError	Alphabetically

In EOleSysError

Create

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EOleSysError methods

EOleSysError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EOleSysError.Create

EOleSysError	See also

Creates an EOleSysError object.

constructor Create(const Message: string; ErrorCode: HRESULT; HelpContext: Integer);

Description

Create calls SysErrorMessage to turn the OLE error code, ErrorCode, into a message string which it passes to the inherited constructor. EOleSysError initializes the ErrorCode property to the ErrorCode string.


Hierarchy

TObject

Exception

EOleError


ESocketError

Hierarchy	Properties 	Methods 	See also

ESocketError is the exception class for failures that occur when trying to create, use, or shut down Windows socket objects.

Unit

scktcomp

Description

ESocketError is raised if

A socket cannot be created.

A socket cannot be initialized.

A socket cannot be opened.

An application tries to change the properties of an already open socket.

A failure occurs when reading from or writing to a socket.

A socket cannot be properly closed.


ESocketError properties

ESocketError	Alphabetically

Derived from Exception

HelpContext

Message


ESocketError properties

ESocketError	By object

HelpContext

Message


ESocketError methods

ESocketError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


ESocketError methods

ESocketError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


TEvent

Hierarchy	Properties	Methods	See also

TEvent is a wrapper for a Windows event.

Unit

syncobjs

Description

Use TEvent to signal that an event has occurred or a state has been reached.

In a multi-threaded application, use TEvent to allow one thread to signal to other threads that an event has occurred.

The handle of a TEvent object can also be used to communicate with other processes, so that an application can coordinate the timing of events with other applications. For example, use the handle of a TEvent object to wait until another process is ready to transfer information through a Windows API call.

In a single-threaded application, use TEvent to coordinate between sections of code that respond to asynchronous events such as Windows messages.


TEvent properties

TEvent	Alphabetically	Legend

Derived from THandleObject

Handle

LastError


TEvent properties

TEvent	By object	Legend

Handle

LastError


TEvent methods

TEvent	Alphabetically

In TEvent

Create

ResetEvent

SetEvent

WaitFor

Derived from THandleObject

Destroy

Derived from TSynchroObject

Acquire

Release

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TEvent methods

TEvent	By object

Acquire

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Release

ResetEvent

SafeCallException

SetEvent

WaitFor


TEvent.Create

TEvent	See also

Instantiates a TEvent object to represent a Windows event object.

type

  PSecurityAttributes = ^TSecurityAttributes;

  TSecurityAttributes = record

    nLength: DWORD;

    lpSecurityDescriptor: Pointer;

    bInheritHandle: BOOL;

  end;

constructor Create(EventAttributes: PSecurityAttributes; ManualReset, InitialState: Boolean; const Name: string);

Description

Call Create to create a TEvent object. Create can generate a new Windows event object or can provide access to an existing named event object.

Set the EventAttributes parameter to specify the access rights and inheritance capabilities of the new Windows event object. Calling Create with EventAttributes set to nil creates an event object with a default set of security attributes. If the TEvent object is created to access an existing named event object, only the bInheritHandle field of EventAttributes is used, as the access rights were determined when the Windows event object was created.

Set ManualReset to specify whether the signal of the TEvent object can only be turned off by a call to the ResetEvent method, or whether it is automatically reset when a single waiting thread is released. When ManualReset is True, the TEvent signal stays set until the ResetEvent method turns it off. When ManualReset is False, the signal is automatically turned off when only a single thread waits on the signal and that thread is released. If the TEvent object is created to access an existing named event object, the ManualReset parameter is ignored.

Set InitialState to indicate whether the TEvent object should be created with the signal set, or turned off. When InitialState is True, the TEvent object is created with the signal set. If the TEvent object is created to access an existing named event object, the InitialState parameter is ignored.

Set Name to provide a name for a new Windows event object or to specify an existing named event object. If no other thread or process will need to access the event object to wait for its signal, Name can be left blank. Name can be a string of up to 260 characters, not including the backslash character (\). If Name is used to specify an existing event object, the value must match the name of the existing event in a case-sensitive comparison. If Name matches the name of an existing Windows semaphore, mutex, or file-mapping object, the TEvent object will be created with Handle set to 0 and all method calls will fail.


TEvent.ResetEvent

TEvent	See also

Turns off the signal of the event object.

procedure ResetEvent;

Description

Call ResetEvent to signal that the event has not occurred or the desired state was not achieved. Other threads or processes that wait for the event will wait until the signal is turned on again by the SetEvent method, the event object is destroyed, or the waiting process times out.


TEvent.SetEvent

TEvent	See also

Turns on the signal of the event object.

procedure SetEvent;

Description

Call SetEvent to signal that the event has occurred or the desired state was achieved. Other threads or processes that wait for the event will resume execution with a return value indicating that the signal was set.


TEvent.WaitFor

TEvent	See also

Waits until another thread or process turns on the signal of the event object.

type TWaitResult = (wrSignaled, wrTimeout, wrAbandoned, wrError);

function WaitFor(Timeout: DWORD): TWaitResult;

Description

Call WaitFor to wait until the signal of the event object is turned on. If the signal is not set after Timeout milliseconds, WaitFor returns anyway. WaitFor returns one of the following values:

Value	Meaning

wrSignaled	The signal of the event object was set.

wrTimeout	The time specified by the Timeout parameter elapse without the signal being set.

wrAbandoned	The event object was destroyed before the Timeout period elapsed.

wrError	An error occurred while waiting. Check the LastError property for an error code giving more information.


Accessibility

Read-only


Hierarchy

TObject

TSynchroObject

THandleObject


TFontAdapter

Hierarchy	Properties	Methods	See also

TFontAdapter is a helper class used to connect a TFont object to an OLE font object.

Unit

axctrls

Description

To create an instance of a TFontAdapter, call the global GetOleFont procedure.  GetOleFont creates the binding between a TFont object and an OLE font interface.


TFontAdapter properties

TFontAdapter	Alphabetically	Legend

Derived from TInterfacedObject

RefCount


TFontAdapter properties

TFontAdapter	By object	Legend

RefCount


TFontAdapter methods

TFontAdapter	Alphabetically

In TFontAdapter

Changed

Create

GetOleFont

SetOleFont

Update

Derived from TCustomAdapter

Destroy

Derived from TInterfacedObject

AfterConstruction

BeforeDestruction

NewInstance

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

SafeCallException


TFontAdapter methods

TFontAdapter	By object

AfterConstruction

BeforeDestruction

Changed

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetOleFont

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

SetOleFont

Update


TFontAdapter.Changed

TFontAdapter	See also

Updates the associated IFont interface with the new properties of the font object.

procedure Changed; override;

Description

Changed is called automatically when the TFont object changes.  It ensures that the associated OLE interface is updated.


TFontAdapter.GetOleFont

TFontAdapter	See also

Obtains the IFontDisp interface from the associated OLE object.

procedure TFontAdapter.GetOleFont(var OleFont: IFontDisp);

Description

ActiveX controls that use TFontAdapter call GetOleFont to obtain the interface that corresponds to the adapter’s TFont object. If the OLE object for the font does not exist, GetOleFont creates it.

The IFontDisp interface is returned as the OleFont parameter.


TFontAdapter.SetOleFont

TFontAdapter	See also

Associates the adapter with the OLE object represented by a specified interface.

procedure TFontAdapter.SetOleFont(const OleFont: IFontDisp);

Description

ActiveX controls that use TFontAdapter call SetOleFont to associate the adapter with the interface passed as the OleFont parameter.


TFontAdapter.Update

TFontAdapter	See also

Updates the associated TFont object to reflect changes in the associated OLE font.

procedure TFontAdapter.Update;

Description

Update is called automatically when the associated OLE object changes. It ensures that the corresponding TFont object reflects those changes.


TFontAdapter.Create

TFontAdapter	See also

Creates an instance of the font adapter control.

constructor Create(Font: TFont);

Description

Applications do not normally create objects of this class. Instead, they call the GetOleFont procedure, which creates the binding between a TFont and an OLE font object.


Accessibility

Read-only


Hierarchy

TObject

TInterfacedObject

TCustomAdapter


THandleObject

Hierarchy	Properties	Methods	See also

THandleObject is the base class for all thread synchronization objects that use a handle.

Unit

syncobjs

Description

Use THandleObject as a base class when defining an object that uses a handle when coordinating the execution of different threads in a multi-threaded application. Handled synchronization objects include event objects that allow threads to signal when critical events have occurred.

Do not create instances of THandleObject. THandleObject is a base class that introduces properties for managing the handle of a synchronization object but does not provide a mechanism for acquiring that handle. Descendants of THandleObject must acquire the appropriate type of handle.


THandleObject properties

THandleObject	Alphabetically	Legend

In THandleObject

Handle

LastError


THandleObject properties

THandleObject	By object	Legend

Handle

LastError


THandleObject.Handle

THandleObject	See also

Specifies the handle of the Windows object used by THandleObject.

type THandle = Integer;

property Handle: THandle;

Description

Read Handle to obtain the Windows handle for the synchronization object. Use Handle when making Windows API calls that require a handle to the synchronization object.

THandleObject provides no mechanism for setting the Handle property. Descendants of THandleObject set the Handle property to the handle for whatever Windows synchronization object they represent.


THandleObject.LastError

THandleObject	See also

Indicates the Windows error code obtained from Handle.

property LastError: Integer;

Description

Read LastError when an operation of the THandleObject fails. LastError returns the Windows error code that represents the reason for the failure. If no operation failed, LastError is 0.


THandleObject methods

THandleObject	Alphabetically

In THandleObject

Destroy

Derived from TSynchroObject

Acquire

Release

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


THandleObject methods

THandleObject	By object

Acquire

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Release

SafeCallException


THandleObject.Destroy

THandleObject	See also

Destroys an instance of THandleObject.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the THandleObject reference is not nil and only then calls Destroy.

Destroy releases the handle before calling the inherited destructor.


Accessibility

Read-only


Hierarchy

TObject

TSynchroObject


TISAPIApplication

Hierarchy	Properties	Methods	See also

TISAPIApplication encapsulates an ISAPI or NSAPI server application.

Unit

isapiapp

Description

TISAPIApplication provides the fundamental behavior of an ISAPI or NSAPI server application. The HTTP server calls the methods of TISAPIApplication when it receives an HTTP request message. TISAPIApplication creates a thread to manage the request message, and a creates a new instance of the Web module for that thread, or reuses an old instance that was deactivated after a previous response was sent.

TISAPIApplication creates TISAPIRequest and TISAPIResponse objects to represent the request message and any response that should be sent in return, passes these to the dispatcher so that the response can be filled in, and sends the response if it was not already sent by a TWebActionItem.

Each ISAPI server project automatically declares an Application variable of type TISAPIApplication as the instance of the application. This declaration overrides the Application variable declared in the Forms unit if the ISAPIApp unit is declared last in the uses list of the project file. Every ISAPI server application must include the ISAPIApp unit.

To work with a CGI server, use the TCGIApplication object instead.


TISAPIApplication properties

TISAPIApplication	Alphabetically	Legend

Derived from TWebApplication

ActiveCount

CacheConnections

InactiveCount

MaxConnections

Title

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TISAPIApplication properties

TISAPIApplication	By object	Legend

ActiveCount

CacheConnections

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

InactiveCount

MaxConnections

Name

Owner

Tag

Title

VCLComObject


TISAPIApplication methods

TISAPIApplication	Alphabetically

In TISAPIApplication

GetExtensionVersion

HttpExtensionProc

TerminateExtension

Derived from TWebApplication

Create

CreateForm

Destroy

Initialize

Run

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TISAPIApplication methods

TISAPIApplication	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateForm

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetExtensionVersion

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

HttpExtensionProc

InheritsFrom

Initialize

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

Run

SafeCallException

TerminateExtension


TISAPIApplication.GetExtensionVersion

TISAPIApplication	See also

Returns the application name and version number.

type

  THSE_VERSION_INFO = packed record

    dwExtensionVersion: DWORD;

    lpszExtensionDesc: array [0..HSE_MAX_EXT_DLL_NAME_LEN-1] of Char;

  end;

function GetExtensionVersion(var Ver: THSE_VERSION_INFO): BOOL;

Description

The HTTP server calls GetExtensionVersion to obtain the application name and version number. GetExtensionVersion returns the version number for the HTTP functions in the runtime library, and the Title property of the ISAPI application object.


TISAPIApplication.HttpExtensionProc

TISAPIApplication	See also

Responds to an HTTP request message.

function HttpExtensionProc(var ECB: TEXTENSION_CONTROL_BLOCK): DWORD;

Description

The HTTP server calls HttpExtensionProc when it receives an HTTP request message. HttpExtensionProc creates the TISAPIRequest and TISAPIResponse objects for the HTTP request message, and calls the HandleRequest message so that the response can be filled out and sent. Finally, HttpExtensionProc frees the request and response objects.

If the response is filled out and sent, HttpExtensionProc returns HSE_STATUS_SUCCESS. Otherwise it returns HSE_STATUS_ERROR.


TISAPIApplication.TerminateExtension

TISAPIApplication

Returns True.

function TerminateExtension(dwFlags: DWORD): BOOL;

Description

The HTTP server calls TerminateExtension when it wants to shut down the ISAPI application. TerminateExtension always returns True, allowing the server to shut down.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TWebApplication


TISAPIRequest

Hierarchy	Properties	Methods	See also

TISAPIRequest represents client request information that is passed to a server application DLL.

Unit

isapiapp

Description

Use TISAPIRequest to interpret a client request to a server application DLL.

ISAPI application objects create TISAPIRequest objects to capture client requests. The properties of the TISAPIRequest objects are obtained from the Web server. The ISAPI application uses TISAPIRequest objects to create corresponding TISAPIResponse objects. The TWebDispatcher for the application then invokes the TWebActionItem that is associated with the path portion of the URL of the TISAPIRequest object.


TISAPIRequest properties

TISAPIRequest	Alphabetically	Legend

In TISAPIRequest

Accept

Authorization

CacheControl

Connection

Content

ContentEncoding

ContentLength

ContentType

ContentVersion

Cookie

Date

DerivedFrom

ECB

Expires

From

Host

IfModifiedSince

Method

PathInfo

PathTranslated

ProtocolVersion

Query

Referer

RemoteAddr

RemoteHost

ScriptName

ServerPort

Title

URL

UserAgent

Derived from TWebRequest

ContentFields

CookieFields

MethodType

QueryFields


TISAPIRequest properties

TISAPIRequest	By object	Legend

Accept

Authorization

CacheControl

Connection

Content

ContentEncoding

ContentFields

ContentLength

ContentType

ContentVersion

Cookie

CookieFields

Date

DerivedFrom

ECB

Expires

From

Host

IfModifiedSince

Method

MethodType

PathInfo

PathTranslated

ProtocolVersion

Query

QueryFields

Referer

RemoteAddr

RemoteHost

ScriptName

ServerPort

Title

URL

UserAgent


TISAPIRequest.Accept

TISAPIRequest	See also

Indicates the value of the Accept header of the HTTP request message.

property Accept: string;

Description

Read Accept to determine the media types the Web client can accept in response to the request. Not every HTTP request message has an Accept header. If the Accept property is not set, then any media type is potentially acceptable in the response.

Accept headers usually indicate that the response should be limited to a small set of desired types. For example, a Web client requesting an audio response might produce a TISAPIRequest object with Accept set to the following string:

audio/*; q=0.2, audio/basic

This request indicates that the preferred response media type is audio/basic, but that any audio type is acceptable if it is the best available after an 80% mark-down in quality.

For information on the format of Accept headers, see the current Internet standards documentation.


TISAPIRequest.Authorization

TISAPIRequest	See also	Example

Indicates the value of the Authorization header of the HTTP request message.

property Authorization: string;

Description

Read Authorization to check whether the client that sent the request message has provided the correct authentication information. Authorization allows the Web application to provided limited access to the resource specified by the URL property.

For more information about HTTP authentication schemes, see the Internet standards documentation.


TISAPIRequest.CacheControl

TISAPIRequest 	See also

Indicates the value of the Cache-Control header of the HTTP request message.

property CacheControl: string;

Description

Read CacheControl to determine any Web client directives that must be obeyed by all caching mechanisms along the request/response chain. The CacheControl directives of the HTTP request do not need to apply to the corresponding HTTP response.

The HTTP 1.1 standard defines the following directives for CacheControl:

Value	Meaning

no-cache	The request may not be cached. The Web server validates the request before the TISAPIRequest object is created.

no-store	The request contains sensitive information and may not be stored on any permanent medium such as a back-up tape. If the request is stored temporarily in a file, the file must be deleted.

max-age=ss	The request is considered invalid if it is older than ss seconds. This directive takes precedence over the Expires property, even if Expires is more restrictive. Invalid requests are validated by the Web server before the TISAPIRequest object is created.

max-stale or max-stale=ss	The client is willing to accept a response that has exceeded it’s expiration time. The max-stale directive can optionally specify the number of seconds by which the response can exceed it’s expiration time.

min-fresh=ss	The client is not willing to accept a response that expires in less than ss seconds.


TISAPIRequest.Connection

TISAPIRequest	See also

Indicates the value of the Connection header of the HTTP request message.

property Connection: string;

Description

Read Connection to determine the options requested by the Web client for its connection to the server application. The HTTP 1.1 standard specifies only one value for the Connection header. If the value of Connection is close, then the connection should be closed after the completion of the response.


TISAPIRequest.Content

TISAPIRequest	See also

Represents the unparsed contents of the HTTP request message.

property Content: string;

Description

Use Content to read the contents of an HTTP request message that is sending information to the server. The value of Content depends on the Method of the HTTP request. When the Method is POST, Content is the unparsed string giving the values to be posted with their associated fields. When the Method is PUT, Content is the value that should replace the URL given by the URL property.

Tip:	When the Method is POST, the parsed version of the post request is available in the ContentFields property.

Note:	If the content of a message is particularly large, it is transferred in chunks. In this case, the Content property does not contain the entire message content. To read the rest of the content, use the ReadClient method.


TISAPIRequest.ContentEncoding

TISAPIRequest	See also

Indicates the value of the Content-Encoding header of the HTTP request message.

property ContentEncoding: string;

Description

Read ContentEncoding to determine what encoding mechanisms, if any, have been applied to the Content of the HTTP request. The encoding mechanisms are listed in the order in which the Web client applied them, separated by commas. Typically, ContentEncoding indicates a compression method or an encoding scheme used to transfer extended ASCII characters over the net.

Reverse the ContentEncoding mechanisms to decode the Content into the form indicated by the ContentType property.


TISAPIRequest.ContentLength

TISAPIRequest	See also

Indicates the value of the Content-Length header of the HTTP request message.

property ContentLength: Integer;

Description

Read the ContentLength property to determine the length of the Content property. ContentLength allows an application to determine the end of the Content property when the ContentType is not text/html. A ContentLength of 0 indicates that the length of the Content property is not determined, either because the request does not include any Content, or because the Web client did not know the length.

Note:	The length of the Content may be less than ContentLength when the Content is passed using chunked transfer coding.


TISAPIRequest.ContentType

TISAPIRequest	See also

Indicates the value of the Content-Type header of the HTTP request message.

property ContentType: string;

Description

Read ContentType to determine the media type of the Content of the HTTP request message. The ContentType is a string of the form Type/SubType.

Most HTTP requests do not require any Content at all. For most requests with a Method that requires a value for Content, the ContentType is text/html. However, HTTP requests for server-specific values of Method can use any media type appropriate to the request.


TISAPIRequest.ContentVersion

TISAPIRequest	See also

Indicates the value of the Content-Version header of the HTTP request message.

property ContentVersion: string;

Description

Read ContentVersion to determine the version of the Content of the HTTP request message. Most HTTP requests do not require any Content at all. When the Method requires a value for Content, the ContentVersion may be set to indicate the version of the source of that content. The format of the ContentVersion depends on the ContentType of the request.


TISAPIRequest.Cookie

TISAPIRequest	See also

Indicates the value of the Cookie header of the HTTP request message.

property Cookie: string;

Description

Use Cookie to read the “cookie” strings provided in the Web client request. Cookie strings are generally used to track state information in a Web application. Cookie is the unparsed value of the Cookie header. The Cookie header can include multiple fields separated by semicolons. Use the CookieFields property to work with the Cookie header on a field-by-field basis.


TISAPIRequest.Date

TISAPIRequest 	See also

Indicates the value of the Date header of the HTTP request message.

property Date: TDateTime;

Description

Read Date to determine the date and time at which the HTTP request message originated. Date can be used to determine whether the Content of the request is still valid. The value of Date is translated into local time as specified in the Windows Control Panel from the time units set by the Web client.

For example, if an HTTP request message specifies a MethodType of mtPost, and Date is older than the most recent values of the fields that are being posted, the server application may return a status code that indicates an error rather than overwriting more recent values.

Date is represented using the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since Dec. 30 1899. The fractional part of a TDateTime value is the fraction of a 24-hour day that has elapsed.


TISAPIRequest.DerivedFrom

TISAPIRequest	See also

Indicates the value of the Derived-From header of the HTTP request message.

property DerivedFrom: string;

Description

Read DerivedFrom to determine the URI where the value of Content originated. DerivedFrom is only meaningful when the request includes a Content property and the Content did not originate with the Web client.


TISAPIRequest.ECB

TISAPIRequest	See also

Indicates the extension control block structure used by the server application DLL to communicate with the Web server.

property ECB: PEXTENSION_CONTROL_BLOCK;

Description

Read ECB to gain direct access to the extension control block that the server application DLL uses to represent the client request message. Most applications will not need to use the ECB property because the header fields values can be read using the GetFieldByName method.


TISAPIRequest.Expires

TISAPIRequest 	See also

Indicates the value of the Expires header of the HTTP request message.

property Expires: TDateTime;

Description

Use Expires to determine whether the request is “stale”. Expires is the date and time at which the request becomes invalid. The value of Expires is translated into local time as specified in the Windows Control Panel from the time units set by the Web client.

If the request has a CacheControl value with a max-age directive, the max-age directive overrides the value of Expires.

Expires is represented using the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since Dec. 30 1899. The fractional part of a TDateTime value is the fraction of a 24-hour day that has elapsed.


TISAPIRequest.From

TISAPIRequest	See also

Indicates the value of the From header of the HTTP request message.

property From: string;

Description

Read From to determine the Internet e-mail address of the human user for whom the Web client sent the HTTP request message. This value can be used for logging purposes, or to contact the originator of the request if problems occur.


TISAPIRequest.Host

TISAPIRequest	See also

Indicates the value of the Host header of the HTTP request message.

property Host: string;

Description

Read Host to determine the Internet host and port number of resource being requested. For example, if the client request specifies the following URL:

http://www.TSite.com/art/gallery.dll/mammals?animal=dog&color=black

the value of Host would be

www.TSite.com

The value of Host can be used to differentiate between internally ambiguous URLs, such as the root “/” URL of a server for multiple host names on a single IP address.


TISAPIRequest.IfModifiedSince

TISAPIRequest 	See also

Indicates the value of the If-Modified-Since header of the HTTP request message.

property IfModifiedSince: TDateTime;

Description

Read IfModifiedSince on a request with a MethodType of mtGet to determine whether the request is conditional. If the information requested by the Web client was not modified since the time indicated by IfModifiedSince, the response should be a not modified error rather than the information indicated by the URL property.

The value of IfModifiedSince is given according to the local clock as specified in the Windows Control Panel, not the clock of the Web client.

IfModifiedSince is represented using the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since Dec. 30 1899. The fractional part of a TDateTime value is the fraction of a 24-hour day that has elapsed.


TISAPIRequest.Method

TISAPIRequest	See also

Indicates the value of the Method header of the HTTP request message.

property Method: string;

Description

Read Method to determine the method that is requested by the Web client. The HTTP 1.1 standard defines the following methods

Value	Meaning

OPTIONS	A request for information about available communication options.

GET	A request for the information identified by the URL property.

HEAD	A request for information about the properties of the HTTP response, but not for the content of the response.

POST	A request for the server application to post the data included in the Content property, as appropriate.

PUT	A request for the server application to replace the resource indicated by the URL property with the data included in the Content property.

DELETE	A request for the server application to delete or hide the resource identified by the URL property.

TRACE	A request for the server application to send a loop-back to confirm receipt of the request.

The Method property may indicate any other method that the Web client requests of the server. If the Method can’t be matched to the Allow property of a TISAPIResponse object, the request can’t be serviced.

The MethodType property indicates whether the value of Method is GET, HEAD, POST, PUT, or one of the other strings. When possible, use MethodType instead of the Method property to save the overhead of string comparison.

Note:	An HTTP application does not need to service all method types. However, there must be a response for the GET and HEAD method requests.


TISAPIRequest.PathInfo

TISAPIRequest	See also

Indicates the path information (if any) of the URL specified in the HTTP request message.

property PathInfo: string;

Description

Read PathInfo to determine the path on the server machine where the target of the request is found. For example, given this URL:

http://www.TSite.com/art/gallery.dll/mammals?animal=dog&color=black

and assuming that the /gallery.dll part is the Web server application, the PathInfo portion is:

/mammals

The TWebDispatcher object uses the PathInfo to identify the appropriate TWebActionItem for servicing the request message.


TISAPIRequest.PathTranslated

TISAPIRequest	See also

Represents a translation of the PathInfo property to a fully qualified path on the Web server.

property PathTranslated: string;

Description

Use PathTranslated to refer to the location of the target of the request in an HTTP response.


TISAPIRequest.ProtocolVersion

TISAPIRequest	See also

Indicates the version number of the HTTP protocol specified in the initial header of the HTTP request message.

property ProtocolVersion: string;

Description

Use ProtocolVersion to determine the protocol used by the Web client when generating the HTTP request message.

Some properties of the HTTP request may be interpreted differently depending on the ProtocolVersion. For example, if ProtocolVersion is 1.0, then the connection should not be considered persistent, even if the Connection property does not specify the close option.


TISAPIRequest.Query

TISAPIRequest	See also

Represents the value of the query information (if any) of the URL specified in the HTTP request message.

property Query: string;

Description

Read Query to determine the details of a query specified in the URL of the Web client request. For example, given this URL:

http://www.TSite.com/art/gallery.dll/mammals?animal=dog&color=black

and assuming that the /gallery.dll part is the Web server application, the Query portion is:

animal=dog&color=black

Query is the unparsed query portion of the URL. The query may include multiple fields separated by ampersands. Use the QueryFields property to work with the query on a field-by-field basis.


TISAPIRequest.Referer

TISAPIRequest	See also

Indicates the value of the Referer header of the HTTP request message.

property Referer: string;

Description

Read Referer to determine the URI of the resource where the HTTP request message originated. Referer allows the server application to generate back-links to the source of the request. If Referer is a partial URI, it should be interpreted as a relative path to the URL property.

The Referer property is not set when the URL of the HTTP request was obtained from a source that does not have its own URI, such as input from the user keyboard.


TISAPIRequest.RemoteAddr

TISAPIRequest	See also

Indicates the remote IP address of the client associated with the HTTP request message.

property RemoteAddr: string;

Description

Read RemoteAddr to obtain the IP address of the source of the Web client request.


TISAPIRequest.RemoteHost

TISAPIRequest	See also

Indicates the fully qualified reverse domain lookup of the client that sent the request message.

property RemoteHost: string;

Description

Use RemoteHost to compose URI values for back-links to the source of the request when the Referer property is not specified. RemoteHost does not include any path information.


TISAPIRequest.ScriptName

TISAPIRequest	See also

Indicates the value of the script information (if any) of the URL specified in the HTTP request message.

property ScriptName: string;

Description

Read ScriptName to determine the full path to the Web server application specified by the client request. For example, given this URL:

http://www.TSite.com/art/gallery.dll/mammals?animal=dog&color=black

and assuming that the /gallery.dll part is the Web server application, the ScriptName portion is:

/art/gallery


TISAPIRequest.ServerPort

TISAPIRequest	See also

Indicates the port number of the port on the Web server that received the request message.

property ServerPort: Integer;

Description

Read ServerPort to determine the number of the port used in the connection to the Web server. The Host property will include the ServerPort if it is specified as part of the URL for the client request.


TISAPIRequest.Title

TISAPIRequest	See also

Indicates the value of the Title header of the HTTP request message.

property Title: string;

Description

Read Title to determine the Title of the information requested in the Web client request.


TISAPIRequest.URL

TISAPIRequest	See also

Indicates the Uniform Resource Identifier (URI) specified by the request message to identify the target of the request.

property URL: string;

Description

Use the URL property to identify the resource the Web client identifies as the target of the request message. URL may be an HTML page to return, a resource to be created or deleted, or an object that provides some other service for the Web client.

The TISAPIRequest object parses the URL into its constituent parts, yielding the Host property, the ScriptName property, the PathInfo property, and the Query property.

Note:	Usually the URL property is a Uniform Resource Locator (URL) that can be parsed into host, script, path, and query portions. However, it is possible for HTTP request messages to specify the target in more general terms, as a Uniform Resource Identifier (URI).


TISAPIRequest.UserAgent

TISAPIRequest	See also

Indicates the value of the User-Agent header of the HTTP request message.

property UserAgent: string;

Description

Read UserAgent to obtain information about the user agent originating the client request. Use the UserAgent information for statistical purposes, for tracing protocol violations, and for tailoring responses to known limitations of specific applications that generate client requests. The UserAgent string contains one or more descriptors, in order of significance. Each descriptor gives the name of the product or application that generated the request, or a comment about the user agent.


TISAPIRequest methods

TISAPIRequest	Alphabetically	Legend

In TISAPIRequest

Create

GetDateVariable

GetFieldByName

GetIntegerVariable

GetStringVariable

ReadClient

ReadString

TranslateURI

WriteClient

WriteString

Derived from TWebRequest

Destroy

ExtractContentFields

ExtractCookieFields

ExtractFields

ExtractQueryFields

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TISAPIRequest methods

TISAPIRequest	By object	Legend

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

ExtractContentFields

ExtractCookieFields

ExtractFields

ExtractQueryFields

FieldAddress

Free

FreeInstance

GetDateVariable

GetFieldByName

GetIntegerVariable

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetStringVariable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadClient

ReadString

SafeCallException

TranslateURI

WriteClient

WriteString


TISAPIRequest.Create

TISAPIRequest	See also

Creates an instance of TISAPIRequest to represent the request message information contained in the AECB parameter.

constructor Create(AECB: PEXTENSION_CONTROL_BLOCK);

Description

Applications don’t need to call Create to instantiate an ISAPI request object. TISAPIApplication creates a TISAPIRequest object whenever it receives a client request.


TISAPIRequest.GetDateVariable

TISAPIRequest	See also

Extracts a date value from the extension control block.

function GetDateVariable(Index: Integer): TDateTime; override;

Description

GetDateVariable reads date-time values from the extension control block specified by the ECB property. The ISAPI request object uses GetDateVariable to access the properties that represent dates from the HTTP request headers.


TISAPIRequest.GetFieldByName

TISAPIRequest	See also

Returns the value of the HTTP header variable specified by the Name parameter.

function GetFieldByName(const Name: string): string; override;

Description

Use GetFieldByName to read the value of an HTTP header variable that is not surfaced as one of the properties of TISAPIRequest. For information on possible HTTP request header variables, see the current Internet standards documents.


TISAPIRequest.GetIntegerVariable

TISAPIRequest	See also

Extracts an integer value from the extension control block.

function GetIntegerVariable(Index: Integer): Integer; override;

Description

GetIntegerVariable reads integer values from the extension control block specified by the ECB property. The ISAPI request object uses GetIntegerVariable to access the properties that represent integers from the HTTP request headers.


TISAPIRequest.GetStringVariable

TISAPIRequest	See also

Extracts a string value from the extension control block.

function GetStringVariable(Index: Integer): string; override;

Description

GetStringVariable reads string values from the extension control block specified by the ECB property. The ISAPI request object uses GetStringVariable to access the properties that represent strings from the HTTP request headers.


TISAPIRequest.ReadClient

TISAPIRequest	See also

Reads Count bytes from the HTTP request into Buffer.

function ReadClient(var Buffer; Count: Integer): Integer; override;

Description

Use ReadClient to load a chunk of information from the contents of an HTTP request into a buffer. ReadClient allows the server application to get the next chunk of information when the content of the request message is too large for the Content property. ReadClient returns the number of bytes actually read. If no more content is available, ReadClient returns -1.


TISAPIRequest.ReadString

TISAPIRequest	See also

Reads Count bytes from the HTTP request into a string.

function ReadString(Count: Integer): string; override;

Description

Use ReadString to load the next chunk of content information form the HTTP request into a string. ReadString allows the server application to get the next chunk of information when the content of the request message is too large for the Content property.


TISAPIRequest.TranslateURI

TISAPIRequest	See also

Translates a Uniform Resource Identifier (URI) into the internal representation of a location on the server.

function TranslateURI(const URI: string): string; virtual; abstract;

Description

Use TranslateURI is used to translate the URI specified in a client request into a format that can be used by the server application.


TISAPIRequest.WriteClient

TISAPIRequest	See also

Writes Count bytes from Buffer back to the HTTP client.

function WriteClient(var Buffer; Count: Integer): Integer; override;

Description

Use WriteClient to write the contents of a response back to the Web client.


TISAPIRequest.WriteString

TISAPIRequest	See also

Writes the string AString back to the HTTP client.

function WriteString(const AString: string): Boolean; virtual; override;

Description

Use WriteString to write the contents of a response back to the web client.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TWebRequest


TISAPIResponse

Hierarchy	Properties	Methods	See also

TISAPIResponse represents HTTP messages sent by an ISAPI application in response to an HTTP request message.

Unit

isapiapp

Description

Use TISAPIResponse to specify the response to an HTTP request message.

An ISAPI application creates a TISAPIResponse object based on the TISAPIRequest object for an incoming HTTP request message. TWebDispatcher then passes the TISAPIResponse object to the TWebActionItem associated with the TISAPIRequest object. The TWebActionItem sets the properties of the TISAPIResponse object.


TISAPIResponse properties

TISAPIResponse	Alphabetically	Legend

In TISAPIResponse

Allow

Content

ContentEncoding

ContentLength

ContentType

ContentVersion

Date

DerivedFrom

Expires

LastModified

Location

LogMessage

Realm

ReasonString

Server

StatusCode

Title

Version

WWWAuthenticate

Derived from TWebResponse

ContentStream

Cookies

CustomHeaders

HTTPRequest


TISAPIResponse properties

TISAPIResponse	By object	Legend

Allow

Content

ContentEncoding

ContentLength

ContentStream

ContentType

ContentVersion

Cookies

CustomHeaders

Date

DerivedFrom

Expires

HTTPRequest

LastModified

Location

LogMessage

Realm

ReasonString

Server

StatusCode

Title

Version

WWWAuthenticate


TISAPIResponse.Allow

TISAPIResponse	See also

Lists the HTTP request methods that the application can service.

property Allow: string;

Description

Use Allow to indicate what type of request methods the server application can respond to for the URL specified inthe HTTPRequest. Allow is a string of method names, separated by commas. The method names can include any pre-defined methods from the HTTP standard, or any additional methods implemented by the server application. At a minimum, the TISAPIResponse object must allow GET and HEAD requests.


TISAPIResponse.Content

TISAPIResponse	See also 	Example

Specifies the information sent to the web client in response to an HTTP request message.

property Content: string;

Description

Use Content to send requested information to the web client. Not every HTTP request message requires content to be returned. For example, responses to requests with a Method of OPTIONS, HEAD, POST, PUT, DELETE, or TRACE should not include any Content. In all these cases, the response information is contained entirely in the response header, which is built from the other properties of the TISAPIResponse object.

The response content can be a string of HTML commands, the name of an HTML file, graphic content such as a bit-stream, or any other MIME content type.

Note:	If the ContentStream property is set, it supersedes the value of the Content property. If both Content and ContentStream are set, the web client is sent the value of the ContentStream, not the value of the Content property.


TISAPIResponse.ContentEncoding

TISAPIResponse	See also

Lists the mechanisms, if any, used to encode the content of the HTTP response message.

property ContentEncoding: string;

Description

Set ContentEncoding when the value of the Content has been encoded before it is sent to the web client. The encoding mechanisms are listed in the order in which they are applied, separated by commas. Typically, ContentEncoding indicates a compression method or an encoding method used to transfer extended-ascii characters over the net.


TISAPIResponse.ContentLength

TISAPIResponse	See also

Specifies the length, in bytes, of the Content property.

property ContentLength: Integer;

Description

Set ContentLength to the length of the Content property, if it is known. If the length of the Content property is unknown, or if the HTTP response message does not include any content, set ContentLength to 0. Web clients use the ContentLength when reading the contents of the HTTP response message.

If the contents of the response message are taken from a stream, the value of ContentLength is set from the stream.


TISAPIResponse.ContentType

TISAPIResponse	See also	Example

Indicates the media type of the Content of the HTTP response message.

property ContentType: string;

Description

Set ContentType to indicate the media type of the Content of the HTTP response message. The value of ContentType must specify a valid MIME content type. The ContentType string has the form Type/SubType.

For example, if the response message sends a string of HTML commands to the web client in response to a GET request, the ContentType is text/html.

Note:	If the HTTP request message includes an Accept header, ContentType should be one of the content types listed in the TISAPIRequest.Accept property.


TISAPIResponse.ContentVersion

TISAPIResponse	See also

Indicates the version associated with the Content of the HTTP response message.

property ContentVersion: string;

Description

Use ContentVersion to specify a version associated with the Content of the HTTP response. The meaning of ContentVersion depends on the type of information that is sent in the HTTP response. For example, if the Content of the HTTP response has a ContentType of text/html, ContentVersion would be the version of HTML used.

Server applications that introduce meanings for the ContentVersion property should document the interpretation they assign to ContentVersion.


TISAPIResponse.Date

TISAPIResponse 	See also

Specifies the time and date when the HTTP response message is sent to the web client.

property Date: TDateTime;

Description

Set Date to the current date and time immediately before sending the HTTP response message to the web client. The Web client uses Date to determine the age of the information returned.

Date is represented using the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since Dec. 30 1899. The fractional part of a TDateTime value is the fraction of a 24-hour day that has elapsed.


TISAPIResponse.DerivedFrom

TISAPIResponse	See also

Specifies the URI of the resource where the Content of the HTTP response originated.

property DerivedFrom: string;

Description

Set DerivedFrom to the URI where the value of Content originates. It is especially important to set DerivedFrom when the Content of the HTTP response did not originate from the resource indicated by the URL property of the HTTP request message.


TISAPIResponse.Expires

TISAPIResponse 	See also

Specifies the date and time after which the Content of the HTTP response message should be considered invalid.

property Expires: TDateTime;

Description

Set Expires when the Content of the HTTP response message contains information that may become invalid with the passage of time. Setting an Expires value does not imply that the information or its source will necessarily change or cease to exist when the Expires date and time is reached. Web clients are simply warned to check the freshness of the information after the Expires date and time.

The value of Expires is specified in Greenwich Mean Time.

Expires is represented using the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since Dec. 30 1899. The fractional part of a TDateTime value is the fraction of a 24-hour day that has elapsed.


TISAPIResponse.LastModified

TISAPIResponse 	See also

Indicates the date and time that the value of the Content property was last updated.

property LastModified: TDateTime;

Description

Set LastModified to indicate the last time the Content of the HTTP response was modified. This allows web clients to determine whether their local version of that information is up-to-date. When the HTTP request is a HEAD message, this may allow the web client and server to skip a potentially expensive transfer of information.

The value of LastModified is specified in the local time of the machine. The HTTP response message translates this value to the date encoding used by HTTP.

LastModified is represented using the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since Dec. 30 1899. The fractional part of a TDateTime value is the fraction of a 24-hour day that has elapsed.


TISAPIResponse.Location

TISAPIResponse	See also

Specifies the URI of a resource the web client should point to for the completion of its request.

property Location: string;

Description

Set Location when creating a new resource in response to the HTTP request message, or when the servicing of the response must be delegated to another URI than the one specified in the HTTP request message.


TISAPIResponse.LogMessage

TISAPIResponse	See also

Specifies a descriptive string included in the response message for event logging purposes.

property LogMessage: string;

Description

Set LogMessage to a description of the action carried out by the TWebActionItem object that services this HTTP response. Usually, LogMessage includes the URI that handled the HTTP request message, along with date and time information.


TISAPIResponse.Realm

TISAPIResponse	See also

Specifies the set of protected-access URIs that includes the URL specified by the request message.

property Realm: string;

Description

Set Realm when the HTTP response message returns 401 (Unauthorized) or 402 (Payment required). Realm is the name of a set of URIs that require a password or payment before the web client can access them. All the URIs in the realm, including the URL specified in the HTTP request message, are made available as soon as the web client provides the password or payment for the realm. The server application should keep track, internally, of the passwords or payments the client has provided, using the client information provided by the TISAPIRequest object.


TISAPIResponse.ReasonString

TISAPIResponse	See also

Indicates the status of the response to the web client request in a human-readable format.

property ReasonString: string;

Description

Set ReasonString to inform the human web client of the success or failure of the HTTP request message. Each reason string is associated with a 3-digit status code whose value indicates the status of the response. The HTTP standard defines a number of stock status codes and corresponding reason strings. In addition, server applications can define new reason strings and associate them with unused status codes.


TISAPIResponse.Server

TISAPIResponse	See also

Provides information about the software used by the server application to handle the request.

property Server: string;

Description

Set Server to a string giving the name and version number of the application that provides the Content of the HTTP response message. The value of Server can contain multiple product identifiers and comments, listed in order of significance and separated by spaces. Product identifiers take the form ProductName/VersionNumber.


TISAPIResponse.StatusCode

TISAPIResponse	See also

Indicates the status of the response to the HTTP request message as a 3-digit integer.

property StatusCode: Integer;

Description

Set StatusCode to inform the web client the status of the HTTP request message. Status codes are standard return values that can be interpreted by all web clients. Each status code has a corresponding reason string that provides a human web client with a more understandable indication of the status.

The following tables lists the available status codes and their corresponding reason strings.

StatusCode	ReasonString

100	Continue

101	Switching Protocols

200	OK

201	Created

202	Accepted

203	Non-Authoritative Information

204	No Content

205	Reset Content

206	Partial Content

300	Multiple Choices

301	Moved Permanently

302	Moved Temporarily

303	See Other

304	Not Modified

305	Use Proxy

400	Bad Request

401	Unauthorized

402	Payment Required

403	Forbidden

404	Not Found

405	Method Not Allowed

406	Not Acceptable

407	Proxy Authentication Required

408	Request Time-out

409	Conflict

410	Gone

411	Length Required

412	Precondition Failed

413	Request Entity Too Large

414	Request-URI Too Large

415	Unsupported Media Type

500	Internal Server Error

501	Not Implemented

502	Bad Gateway

503	Service Unavailable

504	Gateway Time-out

505	HTTP Version not supported

Status codes not in the table can be created by the server application. When creating a new status code, the most significant digit should indicate the class of response, as follows:

1xx: Informational (request received, continuing process)

2xx: Success (request received, understood, and accepted)

3xx: Redirection (Further action needed to complete the request)

4xx: Client Error (request contains bad syntax or cannot be serviced)

5xx: Server Error (server failed to handle a valid request)


TISAPIResponse.Title

TISAPIResponse	See also

Specifies a title for the Content of the HTTP response message.

property Title: string;

Description

Set the Title property to add a Title header to the HTTP response message. Title is an optional application-specific title associated with the information included in the message.


TISAPIResponse.Version

TISAPIResponse	See also

Specifies the HTTP protocol version that the web client is using.

property Version: string;

Description

Read Version to ensure that the properties set in the TISAPIResponse object will be understood by the web client. The value of Version is taken from the ProtocolVersion property of the HTTPRequest property.

For more information on the different HTTP protocol versions, see the Internet standards documentation.


TISAPIResponse.WWWAuthenticate

TISAPIResponse	See also

Lists one or more comma-separated challenges when the request fails with StatusCode 401 (Unauthorized).

property WWWAuthenticate: string;

Description

Set WWWAuthenticate when the HTTP request fails because it requires access to a URI in a realm for which the web client has not provided a password. WWWAuthenticate consists of an authentication scheme name, followed by a comma-separated list of parameter/value pairs that specify the parameters to the authentication scheme. The first parameter/value pair indicates the realm.

For more information about HTTP authentication schemes, see the Internet standards documentation.


TISAPIResponse methods

TISAPIResponse	Alphabetically	Legend

In TISAPIResponse

Create

GetContent

GetDateVariable

GetIntegerVariable

GetLogMessage

GetStatusCode

GetStringVariable

SendRedirect

SendResponse

SendStream

Sent

SetContent

SetDateVariable

SetIntegerVariable

SetLogMessage

SetStatusCode

SetStringVariable

Derived from TWebResponse

Destroy

GetCustomHeader

SetCookieField

SetCustomHeader

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TISAPIResponse methods

TISAPIResponse	By object	Legend

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetContent

GetCustomHeader

GetDateVariable

GetIntegerVariable

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetLogMessage

GetStatusCode

GetStringVariable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

SendRedirect

SendResponse

SendStream

Sent

SetContent

SetCookieField

SetCustomHeader

SetDateVariable

SetIntegerVariable

SetLogMessage

SetStatusCode

SetStringVariable


TISAPIResponse.Create

TISAPIResponse	See also

Creates an instance of TISAPIResponse to represent the response to the HTTPRequest parameter.

constructor Create(HTTPRequest: TWebRequest);

Description

Applications don’t need to call Create to instantiate a ISAPI response object. TISAPIApplication creates a TISAPIResponse for each TISAPIRequest it creates.


TISAPIResponse.GetContent

TISAPIResponse	See also

Reads the value of the Content property.

function GetContent: string; override;

Description

GetContent is the protected access function for the Content property.


TISAPIResponse.GetDateVariable

TISAPIResponse	See also

Extracts a date from the internal table of HTTP header variables.

function GetDateVariable(Index: Integer): TDateTime; override;

Description

The ISAPI response object uses GetDateVariable to access the properties that represent dates.


TISAPIResponse.GetIntegerVariable

TISAPIResponse	See also

Extracts an integer value from the internal table of HTTP header variables.

function GetIntegerVariable(Index: Integer): Integer; override;

Description

The ISAPI response object uses GetIntegerVariable to access the properties that represent integers.


TISAPIResponse.GetLogMessage

TISAPIResponse	See also

Reads the value of the LogMessage property.

function GetLogMessage: string; override;

Description

GetLogMessage is the protected access function for LogMessage property.


TISAPIResponse.GetStatusCode

TISAPIResponse	See also

Reads the value of the StatusCode property.

function GetStatusCode: Integer; override;

Description

GetStatusCode is the protected access function for the StatusCode property.


TISAPIResponse.GetStringVariable

TISAPIResponse	See also

Extracts a string value from the internal table of HTTP header variables.

function GetStringVariable(Index: Integer): string; override;

Description

The ISAPI response object uses GetStringVariable to access the properties that represent strings.


TISAPIResponse.SendRedirect

TISAPIResponse	See also

Sends the response with a StatusCode of 301 (Moved Permanently) and with Location set to the URI parameter.

procedure SendRedirect(const URI: string); override;

Description

Call SendRedirect to redirect the web client request to another URI that is the proper target of the request. SendRedirect does the same thing as setting the StatusCode to 301, the Location to URI, and calling SendResponse.


TISAPIResponse.SendResponse

TISAPIResponse	See also	Example

Sends the ISAPI response message to the web client.

procedure SendResponse; override;

Description

Call SendResponse after setting the properties of the HTTP response object to specify the response that should be made to the web client. If the request should be redirected to another URI, it is more efficient to call SendRedirect.


TISAPIResponse.SendStream

TISAPIResponse	See also

Sends the ISAPI response message with the contents set to the contents of AStream.

procedure SendStream(AStream: TStream); override;

Description

Only call SendStream after first calling SendResponse. Unlike SendStream, SendResponse fills the header of the HTTP response message, based on the properties of the TISAPIResponse object. If SendResponse has not been called first to set the header of the HTTP response message, set the ContentStream property to AStream, and call SendResponse.


TISAPIResponse.Sent

TISAPIResponse	See also

Indicates whether the ISAPI response message has been sent.

function Sent: Boolean; override;

Description

Sent returns True if the SendRedirect or SendStream method has been called. TISAPIApplication objects read Sent to determine whether they should send a response to the web client.


TISAPIResponse.SetContent

TISAPIResponse	See also

Sets the Content property.

procedure SetContent(const Value: string); override;

Description

SetContent is the protected method used by ISAPI response objects to set the Content property.


TISAPIResponse.SetDateVariable

TISAPIResponse	See also

Sets a date-time valued HTTP header property.

procedure SetDateVariable(Index: Integer; const Value: TDateTime); override;

Description

SetDateVariable writes date-time to the internal table used to store HTTP header variables. The ISAPI response object uses SetDateVariable to set the properties that represent dates.


TISAPIResponse.SetIntegerVariable

TISAPIResponse	See also

Sets an integer valued HTTP header property.

procedure SetIntegerVariable(Index: Integer; Value: Integer); override;

Description

SetIntegerVariable writes integer values to the internal table used to store HTTP header variables. The ISAPI response object uses SetIntegerVariable to set the properties that represent integers.


TISAPIResponse.SetLogMessage

TISAPIResponse	See also

Sets the value of the LogMessage property.

procedure SetLogMessage(const Value: string); virtual; override;

Description

SetLogMessage is the protected method used by ISAPI response objects to set the LogMessage property.


TISAPIResponse.SetStatusCode

TISAPIResponse	See also

Sets the StatusCode property.

procedure SetStatusCode(Value: Integer); override;

Description

SetStatusCode is the protected method used by ISAPI response objects to set the StatusCode property.


TISAPIResponse.SetStringVariable

TISAPIResponse	See also

Sets a string valued HTTP header property.

procedure SetStringVariable(Index: Integer; const Value: string); override;

Description

SetStringVariable writes string values to the internal table used to store HTTP header variables. The ISAPI response object uses SetStringVariable to set the properties that represent strings.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TWebResponse


TMask

Hierarchy	Methods	See also

TMask allows the comparison of strings containing wildcards to a file mask.

Unit

masks

Description

Use TMask to determine if a string matches the format described by a mask. The mask contains literal characters, wildcards that can match any character, and sets that match a single character that is included in the set.

Note:	Do not confuse TMask with the EditMask of a field or masked edit object. While both are used for comparing strings to a symbolic description of valid values, the special mask symbols and matching rules are completely different.


TMask methods

TMask	Alphabetically

In TMask

Create

Destroy

Matches

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TMask methods

TMask	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

Matches

MethodAddress

MethodName

NewInstance

SafeCallException


TMask.Create

TMask	See also

Creates an instance of TMask for a given mask.

constructor Create(const MaskValue: string);

Description

Call Create to create a mask object for comparing strings to the mask given by the MaskValue parameter. A valid mask consists of literal characters, sets, and wildcards.

Each literal character must match a single character in the string. The comparison to literal characters is case-insensitive.

Each set begins with an opening bracket ([) and ends with a closing bracket (]). Between the brackets are the elements of the set. Each element is a literal character or a range. Ranges are specified by an initial value, a dash (-), and a final value. Do not use spaces or commas to separate the elements of the set. A set must match a single character in the string. The character matches the set if it is the same as one of the literal characters in the set, or if it is in one of the ranges in the set. A character is in a range if it matches the initial value, the final value, or falls between the two values. All comparisons are case-insensitive. If the first character after the opening bracket of a set is an exclamation point (!), then the set matches any character that is not in the set.

Wildcards are asterisks (*) or question marks (?). An asterisk matches any number of characters. A question mark matches a single arbitrary character.


TMask.Destroy

TMask	See also

Destroys an instance of TMask.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the TMask reference is not nil, and only then calls Destroy.

Destroy frees the memory used to store a parsed image of the mask.


TMask.Matches

TMask	See also

Indicates whether a specified string matches the mask.

function Matches(const Filename: string): Boolean;

Description

Call Matches to compare the Filename parameter to the mask that describes valid values. Matches returns True if the string matches the mask. Matches returns False if the string does not match the mask. Matches raises an exception if the mask is syntactically invalid.

The mask is set when the TMask object is created.

Note:	While the VCL uses TMask to check the whether file names specify valid directories, the Filename parameter does not need to be a file name. TMask can be used to check strings against any syntactically correct mask.


Hierarchy

TObject


 TMonthCalendar

Hierarchy	Properties	Methods	Events

TMonthCalendar is stand-alone calendar in which a user can select a date or range of dates.

Unit

Comctrls

Description

Use TMonthCalendar to allow a user to specify a date or range of dates using a standard calendar user interface.

TMonthCalendar ignores the BiDiMode setting, displaying dates according to the sytem locale.


TMonthCalendar properties

TMonthCalendar	Alphabetically	Legend

Derived from TCommonCalendar

CalColors

Date

EndDate

FirstDayOfWeek

MaxDate

MaxSelectRange

MinDate

MultiSelect

ShowToday

ShowTodayCircle

WeekNumbers

Derived from TWinControl

BorderWidth

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

AutoSize

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TMonthCalendar properties

TMonthCalendar	By object	Legend

Action

Align

Anchors

AutoSize

BiDiMode

BorderWidth

BoundsRect

Brush

CalColors

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Constraints

ControlCount

ControlState

Controls

ControlStyle

Cursor

Date

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

EndDate

FirstDayOfWeek

FloatingDockSiteClass

Floating

Font

Handle

Height

HelpContext

Hint

HostDockSite

ImeMode

ImeName

Left

LRDockWidth

MaxDate

MaxSelectRange

MinDate

MultiSelect

Name

Owner

ParentBiDiMode

ParentFont

ParentShowHint

Parent

ParentWindow

PopupMenu

ShowHint

Showing

ShowTodayCircle

ShowToday

TabOrder

TabStop

Tag

TBDockHeight

Top

VCLComObject

Visible

VisibleDockClientCount

WeekNumbers

Width

WindowProc


TMonthCalendar events

TMonthCalendar	Alphabetically	Legend

Derived from TCommonCalendar

OnGetMonthInfo

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnStartDock

OnStartDrag


TMonthCalendar events

TMonthCalendar	By object	Legend

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnGetMonthInfo

OnKeyDown

OnKeyPress

OnKeyUp

OnStartDock

OnStartDrag


TMonthCalendar methods

TMonthCalendar	Alphabetically	Legend

In TMonthCalendar

CanAutoSize

ConstrainedResize

Create

CreateParams

GetCalendarHandle

MsgSetCalColors

MsgSetDateTime

MsgSetRange

Derived from TCommonCalendar

BoldDays

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

Destroy

DisableAlign

DockDrop

EnableAlign

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMonthCalendar methods

TMonthCalendar	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BoldDays

BringToFront

Broadcast

CanAutoSize

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ConstrainedResize

ContainsControl

ControlAtPos

Create

CreateParams

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlagsReadingOnly

DrawTextBiDiModeFlags

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindComponent

FlipChildren

Focused

FreeInstance

FreeNotification

FreeOnRelease

Free

GetCalendarHandle

GetInterfaceEntry

GetInterfaceTable

GetInterface

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

MethodAddress

MethodName

MsgSetCalColors

MsgSetDateTime

MsgSetRange

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

UpdateAction

UpdateControlState

Update

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TMonthCalendar.CanAutoSize

TMonthCalendar

Specifies whether the control can size itself automatically to display a full month.

function CanAutoSize(var NewWidth, NewHeight: Integer): Boolean; override;

Description

Override CanAutoSize in a derived class to specify whether the control can size itself automatically to display a full month.

NewWidth and NewHeight are set to the minimum width and height required to display a full month in the calendar.

By default, CanAutoSize returns True if the control has a window handle; otherwise CanAutoSize returns False.


TMonthCalendar.ConstrainedResize

TMonthCalendar

Overrides the inherited ConstrainedResize method.

procedure ConstrainedResize(var MinWidth, MinHeight, MaxWidth, MaxHeight: Integer); override;

Description

Assures that the size constraints allow a full month to be displayed in the calendar. Then calls the inherited ConstrainedResize method.


TMonthCalendar.Create

TMonthCalendar

Creates and initializes an instance of TMonthCalendar.

constructor Create(AOwner: TComponent); override;

Description

TMonthCalendar performs the following tasks:

Sets CalExceptionClass to EMonthCalError.

Sets Width to 176.

Sets Height to 153.


TMonthCalendar.CreateParams

TMonthCalendar

Overrides the inherited CreateParams method.

procedure CreateParams(var Params: TCreateParams); override;

Description

CreateParams incorporates the TMonthCalendar window styles and then calls the inherited CreateParams method.


TMonthCalendar.GetCalendarHandle

TMonthCalendar

Returns the calendar control’s window handle.

function GetCalendarHandle: HWND; override;

Description

Use GetCalendarHandle to get the calendar control’s window handle.


TMonthCalendar.MsgSetCalColors

TMonthCalendar

Sets the calendar’s colors.

function MsgSetCalColors(ColorIndex: Integer; ColorValue: TColor): Boolean; override;

Description

Override MsgSetCalColors in a derived class to specify how the calendar’s colors are set.

By default, MsgSetCalColors sets the calendar’s colors using the MonthCal_SetColor function, returning True.

ColorIndex is an index corresponding to an area in the calendar for which a new color is specified.

ColorValue is the new color.


TMonthCalendar.MsgSetDateTime

TMonthCalendar

Sets the calendar’s current date and time.

function MsgSetDateTime(Value: TSystemTime): Boolean; override;

Description

Override MsgSetDateTime in a derived class to specify how the calendar’s current date and time are set.

By default, MsgSetDateTime sets the calendar’s date and time using the MonthCal_SetCurSel function, returning True.

Value is the system time.


TMonthCalendar.MsgSetRange

TMonthCalendar

Sets the calendar’s selection.

function MsgSetRange(Flags: Integer; SysTime: PSystemTime): Boolean; override;

Description

Override MsgSetDateTime to specify how the calendar’s selection is set.

By default, MsgSetRange sets the selection using the MonthCal_SetRange function, returning True.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCommonCalendar


TMonthCalColors

Hierarchy	Properties	Methods	See also

TMonthCalColors defines a color scheme for TDateTimePicker’s drop-down calendar.

Unit

comctrls

Description

The CalColors property of TDateTimePicker or TMonthCalendar holds a TMonthCalColors object. TMonthCalColors determines the colors of a calendar display.


TMonthCalColors properties

TMonthCalColors	Alphabetically	Legend

In TMonthCalColors

BackColor

MonthBackColor

TextColor

TitleBackColor

TitleTextColor

TrailingTextColor


TMonthCalColors properties

TMonthCalColors	By object	Legend

BackColor

MonthBackColor

TextColor

TitleBackColor

TitleTextColor

TrailingTextColor


TMonthCalColors.BackColor

TMonthCalColors	See also

The background color displayed between months in the calendar.

property BackColor: TColor;

Description

BackColor may not be implemented in some Windows versions.


TMonthCalColors.MonthBackColor

TMonthCalColors	See also

The background color of the calendar.

property MonthBackColor: TColor;

Description

MonthBackColor determines the background color of the main section of the calendar, where the dates are displayed.


TMonthCalColors.TextColor

TMonthCalColors	See also

The color of the font used for dates that fall within the displayed month.

property TextColor: TColor;

Description

TextColor determines the color of the numerals for dates that fall within the displayed month. To set the color of dates in the last week of the preceding month and the first week of the the next month, use TrailingTextColor.


TMonthCalColors.TitleBackColor

TMonthCalColors	See also

The background color of the calendar’s title bar.

property TitleBackColor: TColor;

Description

TitleBackColor determines the color of the title bar (above the main section of the calendar), where the month and year are displayed.


TMonthCalColors.TitleTextColor

TMonthCalColors	See also

The color of the font used for the calendar’s title bar.

property TitleTextColor: TColor;

Description

TitleTextColor determines the color in which the month and year are displayed on the calendar’s title bar.


TMonthCalColors.TrailingTextColor

TMonthCalColors	See also

The color of the font used for dates not in the currently displayed month.

property TrailingTextColor: TColor;

Description

TrailingTextColor determines the color of the numerals for dates that fall in the last week of the preceding month or the first week of the next month.


TMonthCalColors methods

TMonthCalColors	Alphabetically

In TMonthCalColors

Assign

Create

Derived from TPersistent

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TMonthCalColors methods

TMonthCalColors	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TMonthCalColors.Assign

TMonthCalColors	See also

Copies the properties from another TMonthCalColors instance.

procedure Assign(Source: TPersistent); override;

Description

Call the Assign method to duplicate the contents of another TMonthCalColors in a new object. If the source parameter is not a TMonthCalColors instance (or nil), Assign raises an EConvertError exception.


TMonthCalColors.Create

TMonthCalColors

Creates and initializes a TMonthCalColors instance.

constructor Create(AOwner: TCommonCalendar);

Description

Create generates a TMonthCalColors object and initializes its properties.


Scope

Published


Hierarchy

TObject

TPersistent


TOleGraphic

Hierarchy	Properties	Methods	Events	See also

TOleGraphic is a wrapper for an OLE graphical interface.

Unit

axctrls

Description

TOleGraphic is a graphical container for icons, metafiles and bitmaps used in ActiveX controls. TOleGraphic is used internally to expose an IPicture interface as the image of the TPicture property of an ActiveX control. Because TOleGraphic is a wrapper for OLE interfaces, it cannot be used to load or save information to a file.


TOleGraphic properties

TOleGraphic	Alphabetically	Legend

In TOleGraphic

Empty

Height

MMHeight

MMWidth

Palette

Picture

Transparent

Width

Derived from TGraphic

Modified

PaletteModified


TOleGraphic properties

TOleGraphic	By object	Legend

Empty

Height

MMHeight

MMWidth

Modified

Palette

PaletteModified

Picture

Transparent

Width


TOleGraphic.Empty

TOleGraphic

Specifies whether the OLE graphics object contains a graphic.

property Empty: Boolean;

Description

Empty determines if a graphic has been loaded into the OLE graphic object. Empty is True if the OLE graphic contains a graphic, and False if it does not.


TOleGraphic.Height

TOleGraphic	See also

Specifies the vertical size (in pixels) of the OLE graphic.

property Height: Integer;

Description

Height indicates the height of the OLE graphic in pixels.


TOleGraphic.MMHeight

TOleGraphic	See also

Indicates the height of the OLE graphic in 0.01 millimeter units.

property MMHeight: Integer;

Description

MMHeight is used for a more accurate reading of the vertical size of the graphic. The Height property, by contrast, is always in screen device pixel units; to avoid loss of precision in converting between device pixels and millimeters, set or read the dimensions in millimeters with MMHeight.


TOleGraphic.MMWidth

TOleGraphic	See also

Indicates the width of the OLE graphic in 0.01 millimeter units.

property MMWidth: Integer;

Description

MMWidth is used for a more accurate reading of the horizontal size of the graphic. The Width property, by contrast, is always in screen device pixel units; to avoid loss of precision in converting between device pixels and millimeters, set or read the dimensions in millimeters with MMWidth.


TOleGraphic.Palette

TOleGraphic

Controls the OLE graphic’s color mapping.

property Palette: HPALETTE;

Description

The Palette of an OLE graphic contains up to 256 colors that can be used to display the graphic on screen.


TOleGraphic.Picture

TOleGraphic

Specifies the interface reference for which the OLE graphic is a container.

property Picture: IPicture;

Description

Picture is for internal use only.


TOleGraphic.Transparent

TOleGraphic

Indicates whether the OLE graphic image completely fills its entire rectangular area.

property Transparent: Boolean;

Description

Use Transparent to determine whether the OLE graphic image covers its entire rectangular area. If Transparent is True the image does not completely cover the entire area. If Transparent is False, the image does cover its entire rectangular area.


TOleGraphic.Width

TOleGraphic	See also

Specifies the vertical size (in pixels) of the graphic.

property Width: Integer;

Description

Use Width to find the width of the OLE graphic.

Note:	Width assumes the screen resolution, so arithmetic conversions may not be as accurate.


TOleGraphic events

TOleGraphic	Alphabetically

Derived from TGraphic

OnChange

OnProgress


TOleGraphic events

TOleGraphic	By object

OnChange

OnProgress


TOleGraphic methods

TOleGraphic	Alphabetically

In TOleGraphic

Assign

LoadFromClipboardFormat

LoadFromFile

LoadFromStream

SaveToClipboardFormat

SaveToStream

Derived from TGraphic

SaveToFile

Derived from TPersistent

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TOleGraphic methods

TOleGraphic	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

LoadFromClipboardFormat

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

SafeCallException

SaveToClipboardFormat

SaveToFile

SaveToStream


TOleGraphic.Assign

TOleGraphic	See also

Copies an IPicture to the OLE graphic object.

procedure Assign(Source: TPersistent); override;

Description

Assign copies the IPicture contained in Source to the OLE graphic object. Assign then calls the inherited Assign. The IPicture can be a bitmap, metafile or icon image.


TOleGraphic.LoadFromClipboardFormat

TOleGraphic	See also

Loads an OLE graphic from the Clipboard into the OLE graphic object.

procedure LoadFromClipboardFormat(AFormat: Word; AData: THandle; APalette: HPALETTE); override;

Description

LoadFromClipboardFormat is called if the OLE graphic is registered with the TPicture object using the RegisterClipboardFormat method.

LoadFromClipboardFormat replaces the current image with the data pointed to by the AData parameter. The palette for the OLE graphic is specified by the APalette parameter.


TOleGraphic.LoadFromFile

TOleGraphic	See also

Prevents OleGraphics from trying to load from a file.

Procedure LoadFromFile(const Filename: string); override;

Description

LoadFromFile is overriden in TOleGraphic so that it will not load a graphic from a file. Attempting to do so is not appropriate for an IPicture.


TOleGraphic.LoadFromStream

TOleGraphic	See also

Loads an IPicture interface from a stream into the OLE graphic object.

procedure LoadFromStream(Stream: TStream); override;

Description

To use LoadFromStream specify the stream from which the OLE graphic is to be loaded as the value of Stream.


TOleGraphic.SaveToClipboardFormat

TOleGraphic	See also

Saves the OLE graphic to a Clipboard format.

procedure SaveToClipboardFormat(var AFormat: Word; var AData: THandle; var APalette: HPALETTE); override;

Description

Use SaveToClipboardFormat to copy the OLE graphic to a Clipboard format. The resulting values can then be copied to the Windows clipboard using the clipboard’s SetAsHandle method.

The graphic’s palette is returned in the APalette parameter, the format in the AFormat parameter, and a handle to the data in the AData parameter. Before the OLE graphic can be saved, an application must have registered the format using the RegisterClipboardFormat method.


TOleGraphic.SaveToStream

TOleGraphic	See also

Saves the OLE graphic to a stream.

procedure SaveToStream(Stream: TStream); override;

Description

Use SaveToStream to save the OLE graphic to the stream specified by the Stream parameter. SaveToStream uses the IPersistStream interface of the graphic write it to the stream.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TGraphic


TOleServer

Hierarchy	Properties	Methods	See also

TOleServer is the base class for components that represent an imported COM server.

Unit

OleServer

Description

TOleServer is the base class for COM servers that are imported by choosing Project|Import Type Library from the IDE. TOleServer introduces several properties and methods that manage the connection to a COM server and for invoking its default events.

Descendants of TOleServer expose the properties, methods, and events of the server CoClass. When an application calls one of the TOleServer descendant’s methods or sets one of its properties, the component automatically establishes a connection to the COM server. You can also connect explicitly by calling the Connect method.

Do not create instances of TOleServer. TOleServer relies on abstract methods to establish and break a connection to the COM server. Instead, use a descendant of TOleServer that wraps the desired server. Numerous TOleServer descendants are provided on the new Servers tab of the Component Palette. In addition, you can create your own descendants by importing the server’s type library.


TOleServer properties

TOleServer	Alphabetically	Legend

In TOleServer

AutoConnect

ConnectKind

EventDispatch

RemoteMachineName

ServerData

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TOleServer properties

TOleServer	By object	Legend

AutoConnect

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConnectKind

DesignInfo

EventDispatch

Name

Owner

RemoteMachineName

ServerData

Tag

VCLComObject


TOleServer.AutoConnect

TOleServer	See also

Specifies whether the component automatically connects to the server.

property AutoConnect: Boolean;

Description

Set AutoConnect to True to specify whether the server should be loaded automatically when the application first starts up. If AutoConnect is False, the application establishes a connection when it calls one of the TOleServer descendant’s methods, sets a property, or calls the Connect method.

Note:	AutoConnect only establishes a connection when the application is first run. Changing the AutoConnect property at runtime has no effect.


TOleServer.ConnectKind

TOleServer	See also

Indicates the type of process to which the TOleServer component establishes a connection.

type TConnectKind = (ckRunningOrNew, ckNewInstance, ckRunningInstance, ckRemote, ckAttachToInterface);

property ConnectKind: TConnectKind;

Description

Set ConnectKind to indicate how the TOleServer component establishes a connection. TOleServer establishes the connection when the application is run (if AutoConnect is True) or when the application calls the Connect (or ConnectTo) method.

The following table lists the possible values:

Value	Meaning

ckRunningOrNew	Attach to a running server or create a new instance of the server.

ckNewInstance	Always create a new instance of the server.

ckRunningInstance	Only attach to a running instance of the server.

ckRemote	Bind to a remote instance of the server. When using this option, you must supply a value for RemoteMachineName.

ckAttachToInterface	Don’t bind to the server. Instead, the application supplies an interface using the ConnectTo method, which is introduced in descendant classes. This option can’t be used with the AutoConnect property.


TOleServer.EventDispatch

TOleServer	See also

Specifies a helper object that enables the TOleServer object to handle server events:

type TServerEventDispatch = class(TObject, IUnknown, IDispatch);

property EventDispatch: TServerEventDispatch;

Description

EventDispatch is used internally by descendant objects that surface the events of a COM server. EventDispatch supports an IDispatch interface, which it uses to allow TOleServer descendants to dispatch events to the appropriate event handler.

TOleServer introduces no events of its own. EventDispatch is used only by descendants that surface events from a COM server.


TOleServer.RemoteMachineName

TOleServer	See also

Specifies the machine running the COM server when ConnectKind is ckRemote.

property RemoteMachineName: string;

Description

Use RemoteMachineName when the COM server instance is running remotely on another machine. Specify the name of the machine on which the COM server is running as the value of RemoteMachineName.

Note: RemoteMachineName is only used if ConnectKind is ckRemote. Setting RemoteMachineName to a non-empty string sets ConnectKind to ckRemote.


TOleServer.ServerData

TOleServer	See also

Encodes information about the COM server to which TOleServer connects.

type

  PServerData = ^TServerData;

  TServerData = record

    ClassID: TGUID;          // CLSID of CoClass

    IntfIID: TGUID;          // IID of default interface

    EventIID: TGUID;         // IID of default source interface

    LicenseKey: Pointer;     // Pointer to license string

    Version: Integer;        // Version of this structure

    InstanceCount: Integer;  // Instance of the Server running

  end;

property ServerData: PServerData;

Description

TOleServer uses ServerData internally to store type library information describing its COM server. Each TOleServer descendant initializes this property in the constructor, specifying the information it needs to establish a connection.


TOleServer methods

TOleServer	Alphabetically	Legend

In TOleServer

_AddRef

_Release

Connect

ConnectEvents

Create

Destroy

Disconnect

DisconnectEvents

GetAutoConnect

GetConnectKind

GetServer

InitServerData

InvokeEvent

Loaded

QueryInterface

SetAutoConnect

SetConnectKind

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOleServer methods

TOleServer	By object	Legend

_AddRef

_Release

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Connect

ConnectEvents

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Disconnect

DisconnectEvents

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetAutoConnect

GetConnectKind

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetServer

HasParent

InheritsFrom

InitInstance

InitServerData

InsertComponent

InstanceSize

InvokeEvent

Loaded

MethodAddress

MethodName

NewInstance

QueryInterface

RemoveComponent

SafeCallException

SetAutoConnect

SetConnectKind

UpdateAction


TOleServer.Connect

TOleServer	See also

Establishes a connection to the COM server.

procedure Connect; virtual; abstract;

Description

Call Connect to connect the TOleServer component to the COM server it represents. If the AutoConnect property is True, the TOleServer component automatically calls Connect when the application is first run.

Do not use Connect if the value of ConnectKind is ckAttachToInterface. When attaching to an interface, use the ConnectTo method, which is introduced by descendant classes, instead.

If the value of ConnectKind is ckRemote, the RemoteMachineName property must be set before calling Connect.

TOleServer introduces Connect as an abstract method. Descendant classes must override this method to let the TOleServer component connect to a specific type of COM server.


TOleServer.ConnectEvents

TOleServer	See also

Establishes a connection using the EventDispatch property as an event sink.

procedure ConnectEvents(const Obj: IUnknown);

Description

TOleServer descendants use ConnectEvents internally to implement their event handlers for events on the COM server. If the TOleServer descendant does not expose any server events, ConnectEvents is not used.

The Obj parameter is an interface for the COM server.


TOleServer.Create

TOleServer	See also

Creates and initializes an instance of TOleServer.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TOleServer at runtime. TOleServer descendants added at design time are instantiated automatically.

Create calls the InitServerData method so that each TOleServer descendant can initialize the ServerData property to reflect the particular COM interface it represents.


TOleServer.Destroy

TOleServer	See also

Frees an instance of TOleServer.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, use the Free method, which checks that the TOleServer reference is not nil, and only then calls Destroy.

Destroy calls the Disconnect method to ensure that the connection is terminated before the TOleServer object gets freed.


TOleServer.Disconnect

TOleServer	See also

Terminates the connection to the COM server.

procedure Disconnect; virtual; abstract;

Description

Call Disconnect to terminate a connection formed using the Connect method.

TOleServer introduces Disconnect as an abstract method. Descendant classes must override this method to let the TOleServer component disconnect from a specific type of COM server.


TOleServer.DisconnectEvents

TOleServer	See also

Terminates a connection that was established using the ConnectEvents method.

procedure DisconnectEvents(const Obj: Iunknown);

Description

TOleServer descendants use DisconnectEvents internally to terminate the connection established by ConnectEvents. If the TOleServer descendant does not expose any server events, DisconnectEvents is not used.

The Obj parameter is an interface for the COM server.


TOleServer.GetAutoConnect

TOleServer	See also

Returns the value of the AutoConnect property.

function GetAutoConnect: Boolean;

Description

GetAutoConnect is the protected read implementation for the AutoConnect property.


TOleServer.GetConnectKind

TOleServer	See also

Returns the value of the ConnectKind property.

function GetConnectKind: TConnectKind;

Description

GetConnectKind is the protected read implementation for the ConnectKind property.


TOleServer.GetServer

TOleServer	See also

Returns an interface for the COM server.

function  GetServer: IUnknown; virtual;

Description

TOleServer descendants call GetServer from the implementation of their Connect methods. GetServer obtains an interface for the COM server described by ServerData. The ConnectKind property indicates how GetServer can obtain the interface.


TOleServer.InitServerData

TOleServer	See also

Initializes the ServerData property to reflect the type library information of the COM server.

procedure InitServerData; virtual; abstract;

Description

The TOleServer constructor calls InitServerData to initialize ServerData with information from the COM server’s type library.

InitServerData is an abstract method in TOleServer. Each TOleServer descendant implements this method so that the ServerData property reflects its particular COM server.


TOleServer.InvokeEvent

TOleServer	See also

Dispatches an event from the COM server to the appropriate event handler.

type

  TDispID = Longint;

  TVariantArray = Array of OleVariant;

procedure InvokeEvent(DispID: TDispID; var Params: TVariantArray); virtual;

Description

TOleServer descendants use InvokeEvent internally to link their event handlers to events on the COM server.

DispID is the dispatch ID for the appropriate event handler.

Params passes the parameters of the event handler as an array of OleVariants.

As implemented in TOleServer, InvokeEvent does nothing, because TOleServer has no events. Descendants that surface events from a COM server override this method so that the event sink specified by EventDispatch can pass events on to the appropriate event handlers.


TOleServer.Loaded

TOleServer	See also

Connects to the COM server when the TOleServer object is first loaded into memory if AutoConnect is True.

procedure Loaded: override;

Description

The VCL streaming system automatically calls Loaded after the TOleServer component is loaded into memory.

Loaded checks the AutoConnect property, and if it is True, calls the Connect method to establish a connection.


TOleServer.QueryInterface

TOleServer	See also

Returns a reference to a specified interface if the OLE server supports that interface.

type HResult = Longint;

function QueryInterface(const IID: TGUID; out Obj): HResult; override;

Description

QueryInterface implements the IUnknown interface method QueryInterface. QueryInterface returns a reference to the interface specified by the IID parameter as the Obj parameter. If the Ole server does not support the interface, the Obj parameter returns nil and QueryInterface returns a nonzero error code.


TOleServer.SetAutoConnect

TOleServer	See also

Sets the value of the AutoConnect property.

procedure SetAutoConnect(Value: Boolean);

Description

SetAutoConnect is the protected write implementation for the AutoConnect property.


TOleServer.SetConnectKind

TOleServer	See also

Sets the value of the ConnectKind property.

procedure SetConnectKind(ck: TConnectKind);

Description

SetConnectKind is the protected write implementation for the ConnectKind property.


TOleServer._AddRef

TOleServer	See also

Increments the reference count for the number of interface references dependent on the Ole server.

function _AddRef: Integer; stdcall;

Description

_AddRef implements the IUnknown interface method, AddRef, which increments the reference count of objects using the Ole server’s interface. _AddRef returns the resulting value of the reference count.


TOleServer._Release

TOleServer	See also

Decrements the reference count for the calling interface on a object.

function _Release: Integer; stdcall;

Description

_Release implements the IUnknown interface method, Release, which decrements the reference count of objects using the Ole server’s interface. If the reference count on the interface falls to 0, the server object is freed from memory.

_Release returns the resulting value of the reference count.


Scope

Published

Protected

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent


TOleStream

Hierarchy	Properties	Methods	See also

TOleStream reads and writes information over a streaming interface that is provided by an OLE object.

Unit

axctrls

Description

Use TOleStream to create a TStream wrapper for an OLE stream interface. TOleStream uses the streaming interface of the OLE stream to read and write information. TActiveXControl objects use TOleStream to load themselves from a stream or save themselves to a stream.


TOleStream properties

TOLEStream	Alphabetically

Derived from TStream

Position

Size


TOleStream properties

TOLEStream	By object

Position

Size


TOleStream methods

TOLEStream	Alphabetically

Derived from TOleStream

Create

Read

Seek

Write

Derived from TStream

CopyFrom

FixupResourceHeader

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TOleStream methods

TOLEStream	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

CopyFrom

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

FixupResourceHeader

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Read

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

SafeCallException

Seek

Write

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader


TOleStream.Create

TOleStream

Creates a TOleStream object to represent a stream interface.

constructor Create(const Stream: IStream);

Description

Call Create to convert a stream interface into a TOleStream object. The Stream parameter is the stream interface that the TOleStream object uses for reading and writing.


TOleStream.Read

TOleStream	See also

Reads up to Count bytes from the current position into Buffer.

function Read(var Buffer; Count: Longint): Longint; override;

Description

Call Read to read data from the OLE stream when it is not known how many bytes are available. Buffer must have at least Count bytes allocated to hold the data that was read from the stream.

Read uses the stream interface to transfer up to Count bytes into Buffer, starting at the current position, and then advances the current position by the number of bytes actually transferred. Read returns the number of bytes actually transferred (which may be less than the number requested in Count.)

All the other data-reading methods of an OLE stream (ReadBuffer, ReadComponent) call Read to do their actual reading.


TOleStream.Seek

TOleStream	See also

Resets the current position of the stream.

function Seek(Offset: Longint; Origin: Word): Longint; override;

);Description

Use Seek to move the current position by the indicated offset. Seek uses the stream interface to change the current position to the value indicated by the Offset and Origin parameters.

The Origin parameter indicates how to interpret the Offset parameter. Origin should be one of the following values:

Value	Meaning

soFromBeginning	Offset is from the beginning of the OLE stream. Seek moves to the position Offset. Offset must be >= 0.

soFromCurrent	Offset is from the current position in the OLE stream. Seek moves to Position + Offset.

soFromEnd	Offset is from the end of the OLE stream. Offset must be <= 0 to indicate a number of bytes before the end of the stream.

Seek returns the new value of the Position property.


TOleStream.Write

TOleStream	See also

Writes Count bytes from Buffer to the current position in the OLE stream and updates the current position by Count bytes.

function Write(const Buffer; Count: Longint): Longint; override;

Description

Use Write to write Count bytes to the OLE stream, starting at the current position. Write uses the stream interface to transfer the information from Buffer.

All the other data-writing methods of an OLE stream (WriteBuffer, WriteComponent) call Write to do their actual writing.


Hierarchy

TObject

TStream


 TPageProducer

Hierarchy	Properties	Methods	Events	See also

TPageProducer produces a string of HTML commands based on an input template.

Unit

httpapp

Description

Use TPageProducer to convert an HTML template into a string of HTML commands that can be interpreted by a client application such as a Web browser. HTML templates include HTML commands and HTML-transparent tags that are replaced with customized content by the OnHTMLTag event.

Note:	See the WebServ demo for an example of how to use TPageProducer.


TPageProducer properties

TPageProducer	Alphabetically	Legend

Derived from TCustomPageProducer

HTMLDoc

HTMLFile

StripParamQuotes

Derived from TCustomContentProducer

Dispatcher

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TPageProducer properties

TPageProducer	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Dispatcher

HTMLDoc

HTMLFile

Name

Owner

StripParamQuotes

Tag

VCLComObject


TPageProducer events

TPageProducer	Alphabetically	Legend

In TPageProducer

OnHTMLTag


TPageProducer events

TPageProducer	By object	Legend

OnHTMLTag


TPageProducer.OnHTMLTag

TPageProducer	See also 	Example

Occurs when the page producer needs to interpret the value of an HTML-transparent tag in the HTML template.

type

  TTag = (tgCustom, tgLink, tgImage, tgTable, tgImageMap, tgObject, tgEmbed);

  THTMLTagEvent = procedure (Sender: TObject; Tag: TTag; const TagString: string; TagParams: TStrings; var ReplaceText: string) of object;

property OnHTMLTag: THTMLTagEvent;

Description

Write an OnHTMLTag event handler to convert an HTML-transparent tag into the corresponding HTML commands that can be interpreted by a Web browser. If an OnHTMLTag event is not supplied, the HTML-transparent tags in the HTML template will be replaced by empty strings.

The Tag parameter indicates the type of HTML-transparent tag that was encountered in the HTML template. It can have one of the following values

Value	Meaning

tgLink	The TagString parameter is LINK. The TagParams describe a hypertext link. The event handler should return a sequence of HTML commands beginning with an <A> tag and ending with an </A> tag.

tgImage	The TagString parameter is IMAGE. The TagParams describe a graphic image. The event handler should return an HTML <IMG> tag.

tgTable	The TagString parameter is TABLE. The TagParams describe a desired tabular image. The event handler should return a sequence of HTML commands beginning with a <TABLE> tag and ending with a </TABLE> tag.

tgImageMap	The TagString parameter is IMAGEMAP. The TagParams describe a graphic image with associated hotzones. The event handler should return a sequence of HTML commands beginning with a <MAP> tag and ending with a </MAP> tag.

tgObject	The TagString parameter is OBJECT. The TagParams contain a reference to an ActiveX control. The event handler should return a sequence of HTML commands beginning with an <OBJECT> tag and ending with an </OBJECT> tag.

tgEmbed	The TagString parameter is EMBED. The TagParams contain a reference to a Netscape-compliant add-in DLL. The event handler should return a sequence of HTML commands beginning with an <EMBED> tag and ending with an </EMBED> tag.

tgCustom	The TagString parameter is an application-defined string. The event handler can convert the HTML-transparent tag in an application-specific manner.

The TagString parameter is the tag name of the HTML-transparent tag. If the Tag parameter is tgCustom, TagString should be used to determine what conversion to perform. The TagParams parameter gives the parameter portion of the HTML-transparent tag. Each string in the TStrings object has the form ParamName=Value. Use the Names and Values properties of the TStrings object to parse these parameters.

The OnHTMLTag event handler should return the converted HTML commands in the ReplaceText parameter. The returned value can contain HTML-transparent tags for another page producer to convert. For example, one page producer might have a template that represents the format of the final HTTP response. It could read the HTTP request and for each section in the request assemble a set of HTML-transparent tags with parameters based on the request. Another page producer might take the content of the first page producer, and interpret those parameters.


TPageProducer methods

TPageProducer	Alphabetically

Derived from TCustomPageProducer

Content

ContentFromStream

ContentFromString

Create

Destroy

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPageProducer methods

TPageProducer	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Content

ContentFromStream

ContentFromString

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomContentProducer

TCustomPageProducer


 TPageScroller

Hierarchy	Properties	Methods	Events

TPageScroller defines a display area for a narrow window, such as a toolbar.

Unit

Comctrls

Description

Use TPageScroller to define a display area for a narrow window, such as a toolbar.

If the window is larger than the display area, TPageScroller attaches arrows to the edges of the window, allowing it to be scrolled within the display area.

The page scroller control is similar to the scroll box control. However, the page scroller provides arrows that extend over the edges of the display area, whereas the scroll box provides scroll bars. Also, the page scroller supports scrolling for only one orientation (horizontal or vertical), so the constrained window must fit either the width or height of the display area.


TPageScroller properties

TPageScroller	Alphabetically	Legend

In TPageScroller

AutoScroll

ButtonSize

Control

DragScroll

Margin

Orientation

Position

Derived from TWinControl

BorderWidth

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DockSite

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TPageScroller properties

TPageScroller	By object	Legend

Action

Align

Anchors

AutoScroll

BiDiMode

BorderWidth

BoundsRect

Brush

ButtonSize

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

Control

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DockSite

DoubleBuffered

DragCursor

DragKind

DragMode

DragScroll

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Margin

Name

Orientation

Owner

Parent

ParentColor

ParentFont

ParentShowHint

ParentWindow

PopupMenu

Position

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TPageScroller.AutoScroll

TPageScroller

Specifies whether the page scroller scrolls when the mouse hovers over one of its arrows.

property AutoScroll: Boolean;

Description

Use AutoScroll to specify whether the page scroller scrolls when the mouse hovers over one of its arrows.


TPageScroller.ButtonSize

TPageScroller

Specifies the size of the page scroller’s arrows.

property ButtonSize: Integer;

Description

Use ButtonSize to specify the size of the page scroller’s arrows.


TPageScroller.Control

TPageScroller

Specifies the control contained in the page scroller.

property Control: TWinControl;

Description

Use Control to specify the control contained in the page scroller.


TPageScroller.DragScroll

TPageScroller

Specifies whether the contained window can be a drag-and-drop target.

property DragScroll: Boolean;

Description

Use DragScroll to specify whether the contained window can be a drag-and-drop target. If DragScroll is true, the page scroller will scroll when an item is dragged over the page scroller’s arrows.


TPageScroller.Margin

TPageScroller

Specifies the margin between the contained window and the inside edges of the page scroller.

property Margin: Integer;

Description

Use Margin to specify the margin between the contained window and the inside edges of teh page scroller.


TPageScroller.Orientation

TPageScroller

Specifies whether the page scroller is horizontal or vertical.

property Orientation: TPageScrollerOrientation;

Description

Use Orientation to specify whether the page scroller is horizontal or vertical.


TPageScroller.Position

TPageScroller

Specifies the scroll position of the page scroller.

property Position: Integer;

Description

Use Position to specify the scroll position of the page scroller.


TPageScroller events

TPageScroller	Alphabetically	Legend

In TPageScroller

OnScroll

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseWheel

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnResize

OnStartDock

OnStartDrag


TPageScroller events

TPageScroller	By object	Legend

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseWheel

OnResize

OnScroll

OnStartDock

OnStartDrag


TPageScroller.OnScroll

TPageScroller

Occurs immediately before the page scroller scrolls.

property OnScroll: TPageScrollEvent;

Description

Write code in the OnScroll event handler to perform actions when the page scroller scrolls.


TPageScroller methods

TPageScroller	Alphabetically	Legend

In TPageScroller

AlignControls

Create

CreateParams

CreateWnd

GetButtonState

Scroll

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPageScroller methods

TPageScroller	By object	Legend

AfterConstruction

AlignControls

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParams

CreateParented

CreateParentedControl

CreateWnd

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetButtonState

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

Scroll

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TPageScroller.AlignControls

TPageScroller

Aligns controls in the contained window.

procedure AlignControls(AControl: TControl; var Rect: TRect); override;

Description

Call AlignControls to align the controls in the page scroller’s contained window according to values of their Align properties.

Overrides the inherited AlignControls property in order to take the orientation of the page scroller into account.


TPageScroller.Create

TPageScroller

Creates and initializes an instance of TPageScroller.

constructor Create(AOwner: TComponent); override;

Description

Create performs the following tasks:

Calls the inherited Create method.

Sets Width to 150 and Height to 45

Sets TabStop to True.

Sets ControlsStyle to [csAcceptsControls, csDoubleclicks];

Sets ButtonSize to 12;

Sets DragScroll to True.;


TPageScroller.CreateParams

TPageScroller

Sets the page scroller’s window parameters.

procedure CreateParams(var Params: TCreateParams); override;

Description

CreateParams is called automatically when the page scroller window is created.

CreateParams overrides the inherited CreateParams method in order to set window styles specific to the page scroller control.


TPageScroller.CreateWnd

TPageScroller

Creates the page scroller’s window.

procedure CreateWnd; override;

Description

Call CreateWnd to create the page scroller’s window.

CreateWnd overrides the inherited CreateWnd method in order to initialize the page scroller’s color, handle, button size, margin, and position.


TPageScroller.GetButtonState

TPageScroller

Returns the state of one of the page scroller’s buttons.

function GetButtonState(Button: TPageScrollerButton): TPageScrollerButtonState;

Description

Call GetButtonState to get the state of one of the page scroller’s buttons.

Button is the button for which to get the state information.

GetButtonState returns the button state.


TPageScroller.Scroll

TPageScroller

Called immediately before the page scroller scrolls.

procedure Scroll(Shift: TShiftState; X, Y: Integer; Orientation: TPageScrollerOrientation; var Delta: Integer); dynamic;

Description

Override the Scroll method in a derived class to handle the scrolling event.

By default, Scroll calls the OnScroll event handler.

Shift is the state of the Shift, Alt, Ctrl keys and mouse buttons.

X is the horizontal position of the page scroller.

Y is the vertical position of the page scroller.

Orientation is the direction for the scroll.

Delta is the amount of the scroll.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TPictureAdapter

Hierarchy	Properties	Methods	See also

TPictureAdapter connects a native TPicture object to an OLE picture object.

Unit

axctrls

Description

To create an instance of a TPictureAdapter call the GetOlePicture procedure, which creates the binding between a TPicture and an OLE picture object.


TPictureAdapter properties

TPictureAdapter	Alphabetically	Legend

Derived from TInterfacedObject

RefCount


TPictureAdapter properties

TPictureAdapter	By object	Legend

RefCount


TPictureAdapter methods

TPictureAdapter	Alphabetically

In TPictureAdapter

Create

Derived from TCustomAdapter

Destroy

Derived from TInterfacedObject

AfterConstruction

BeforeDestruction

NewInstance

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

SafeCallException


TPictureAdapter methods

TPictureAdapter	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TPictureAdapter.Create

TPictureAdapter	See also

Create constructs an instance of the picture adapter control.

constructor Create(Picture: TPicture);

Description

Do not call the constructor for this class directly. Instead, call the GetOlePicture procedure to create the binding between a TPicture and an OLE picture.


Accessibility

Read-only


Hierarchy

TObject

TInterfacedObject

TCustomAdapter


TPropertyPage

Hierarchy	Properties	Methods	Events	See also

TPropertyPage is an abstract class that implements a property page for an ActiveX control.

Unit

axctrls

Description

TPropertyPage extends TCustomForm by adding the functionality needed to embed the form in an ActiveX property page dialog. It also adds methods to copy property values from the object to the form’s controls, and vice versa.

To implement your own property page for an ActiveX object, derive a new class from TPropertyPage, design the form, then override the UpdateObject and UpdatePropertyPage methods.  The Delphi IDE provides an expert for creating a skeleton property page.  See Creating a new property page for more information.

TPropertyPage provides a helper method, Modified, that your form can call when any of the controls on the form are changed by the user.  Calling the Modified method notifies the property dialog that the user has modified the object’s properties.  Normally this will enable the Apply button on the property dialog.

The property page maintains a connection to the object it is editing, using the OleObjects property.  This property is a Variant and can be used to read and write the object’s properties.


TPropertyPage properties

TPropertyPage	Alphabetically	Legend

In TPropertyPage

OleObject

OleObjects

Derived from TCustomForm

Active

ActiveControl

ActiveOleControl

BorderStyle

Canvas

ClientHeight

ClientRect

ClientWidth

Designer

DropTarget

Floating

FormState

HelpFile

KeyPreview

Menu

ModalResult

Monitor

OldCreateOrder

OleFormObject

Parent

PixelsPerInch

PrintScale

Scaled

Visible

WindowState

Derived from TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

Brush

ClientOrigin

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

Caption

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

ParentFont

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TPropertyPage properties

TPropertyPage	By object	Legend

Action

Active

ActiveControl

ActiveOleControl

Align

Anchors

AutoScroll

BiDiMode

BorderStyle

BoundsRect

Brush

Canvas

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

Designer

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DropTarget

Enabled

Floating

FloatingDockSiteClass

Font

FormState

Handle

Height

HelpContext

HelpFile

Hint

HorzScrollBar

HostDockSite

KeyPreview

Left

LRDockWidth

Menu

ModalResult

Monitor

Name

OldCreateOrder

OleFormObject

OleObject

OleObjects

Owner

Parent

ParentFont

ParentWindow

PixelsPerInch

PopupMenu

PrintScale

Scaled

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

VertScrollBar

Visible

VisibleDockClientCount

Width

WindowProc

WindowState


TPropertyPage.OleObject

TPropertyPage	See also

Contains a reference to the first item in the array of ActiveX controls being edited by the page.

property OleObject: OleVariant;

Description

Property pages have the ability to be “hooked up to” multiple ActiveX controls, usually by multi-selecting the ActiveX controls in the form designer, and right clicking to invoke the property pages. OleObject points to the first control in the array. To access other ActiveX controls, use the property, OleObjects.

Cast the value of OleObject to the appropriate interface, such as IUnknown or IDispatch, and use the methods of the interface to access the property values and methods of the control.


TPropertyPage.OleObjects

TPropertyPage	See also

An array of Dispatch Ids for each ActiveX control being edited by the page.

property OleObjects: TinterfaceList;

Description

Property pages have the ability to be “hooked up to” multiple ActiveX controls, usually by multi-selecting the ActiveX controls in the form designer, and right clicking to invoke the property pages. Cast the value of an entry from the OleObjects Items property to the appropriate interface, such as IUnknown or IDispatch, and use the methods of the interface to access the property values and methods of the control.


TPropertyPage events

TPropertyPage	Alphabetically	Legend

Derived from TCustomForm

OnActivate

OnClose

OnCreate

OnDeactivate

OnDestroy

OnHide

OnPaint

OnShow

Derived from TWinControl

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnMouseDown

OnMouseMove

OnMouseUp

OnResize


TPropertyPage events

TPropertyPage	By object	Legend

OnActivate

OnClick

OnClose

OnContextPopup

OnCreate

OnDblClick

OnDeactivate

OnDestroy

OnDragDrop

OnDragOver

OnHide

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnPaint

OnResize

OnShow


TPropertyPage methods

TPropertyPage	Alphabetically

In TPropertyPage

Create

Destroy

EnumCtlProps

Modified

UpdateObject

UpdatePropertyPage

Derived from TCustomForm

AfterConstruction

BeforeDestruction

Close

CloseQuery

CreateNew

DefaultHandler

DefocusControl

Dock

FocusControl

GetFormImage

Hide

IsShortCut

MouseWheelHandler

Print

Release

SendCancelMode

SetFocus

SetFocusedControl

Show

ShowModal

WantChildKey

Derived from TScrollingWinControl

DisableAutoRange

EnableAutoRange

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPropertyPage methods

TPropertyPage	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

Close

CloseQuery

ContainsControl

ControlAtPos

Create

CreateNew

CreateParented

CreateParentedControl

DefaultHandler

DefaultHandler

DefocusControl

Destroy

DestroyComponents

Destroying

DisableAlign

DisableAutoRange

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EnableAutoRange

EndDrag

EnumCtlProps

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

FocusControl

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetFormImage

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

IsShortCut

ManualDock

ManualFloat

MethodAddress

MethodName

Modified

MouseWheelHandler

NewInstance

PaintTo

Perform

Print

Realign

Refresh

Release

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendCancelMode

SendToBack

SetBounds

SetFocus

SetFocusedControl

SetTextBuf

Show

ShowModal

Update

UpdateAction

UpdateControlState

UpdateObject

UpdatePropertyPage

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

WantChildKey


TPropertyPage.Create

TPropertyPage

Creates an instance of TPropertyPage.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a property page at runtime. Property pages added at design time are created automatically. Pass a single Component as an argument to assign the property page an owner that is responsible for freeing the property page.

Create instantiates the helper objects used by the property page.


TPropertyPage.Destroy

TPropertyPage	See also

Frees an instance of TPropertyPage.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free, which verifies that the property page reference is not nil, and only then calls Destroy.

Destroy frees any associated OLE objects before freeing the object instance.


TPropertyPage.EnumCtlProps

TPropertyPage	See also

Looks for a PropType type property in a control on the form.

procedure EnumCtlProps(PropType: TGUID; PropNames: TStrings);

Description

Use EnumCtlProps to locate all properties of the ActiveX object specified by OleObject that use the GUID specified by the PropType parameter.  The names of all properties of the specified type are added to the PropNames list.  The property names can be used subsequently to read or write property values using the IDispatch interface of the ActiveX object.

Note:	EnumCtlProps does not clear the PropNames list before adding property names.  Applications should clear the string list before calling EnumCtlProps to avoid mistaking entries that were previously in the list for properties of the ActiveX object.


TPropertyPage.Modified

TPropertyPage

Notifies the property page’s container that the user has edited one of the controls on the page.

procedure Modified;

Description

Call Modified from the controls on the property page when their values change. The property dialog will enable the Apply button in response to this method call.


TPropertyPage.UpdatePropertyPage

TPropertyPage	See also

Copies the property values from the ActiveX object to controls on the property page.

procedure UpdatePropertyPage; virtual;

Description

This method is normally called when the property page is first shown, or when the user undoes changes to the property dialog box.  The UpdatePropertyPage method implemented by TPropertyPage does nothing.  Override this method to copy the property values from the ActiveX object to the controls on the property page.

UpdatePropertyPage is the reverse of UpdateObject, which copies the property values from controls on the property page to the ActiveX object.


TPropertyPage.UpdateObject

TPropertyPage	See also

UpdateObject is called to copy property values from the controls on the form to the ActiveX Object.

procedure UpdateObject; virtual;

Description

Override this method to copy values from the controls on the property page to properties of the ActiveX Object.  Cast the value of the OleObject property to an IDispatch interface to set the property values.

UpdateObject is the reverse of UpdatePropertyPage, which copies the property values from the ActiveX Object to controls on the form.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TScrollingWinControl

TCustomForm


TPropertyPageImpl

Hierarchy	Properties	Methods

TPropertyPageImpl implements the IPropertyPage interface to provide the interfaces needed to support an ActiveX property page.

Unit

Axctrls

Description

Applications do not create TPropertyPageImpl objects; they are created automatically when the user creates an ActiveX control object by using the ActiveX control or ActiveForms wizard.

This class is used internally by TPropertyPage to provide a bridge between a Delphi form and the ActiveX property page API. TPropertyPageImpl implements the property page portion of the COM object while TActiveXPropertyPage implements the COM server portion.


TPropertyPageImpl properties

TPropertyPageImpl	Alphabetically	Legend

In TPropertyPageImpl

PropertyPage

Derived from TAggregatedObject

Controller


TPropertyPageImpl properties

TPropertyPageImpl	By object	Legend

Controller

PropertyPage


TPropertyPageImpl.PropertyPage

TPropertyPageImpl	Properties	See also

Represents the property page of the ActiveX control.

property PropertyPage: TPropertyPage;

Description

The property page that this TPropertyPageImpl represents. When clients call the IPropertyPage interface, TPropertyPageImpl converts these these calls to actions on the property page that is referenced by this object.


TPropertyPageImpl methods

TPropertyPageImpl	Alphabetically

In TPropertyPageImpl

InitPropertyPage

Derived from TAggregatedObject

Create

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TPropertyPageImpl methods

TPropertyPageImpl	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

FreeInstance

Free

GetInterfaceEntry

GetInterfaceTable

GetInterface

InheritsFrom

InitInstance

InitPropertyPage

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TPropertyPageImpl.InitPropertyPage

TPropertyPageImpl	Methods	See also

Initializes the associated property page.

procedure InitPropertyPage; virtual;

Description

Do not call InitPropertyPage, TActiveXPropertyPage calls this method after creating both the TPropertyPage and TPropertyPageImpl objects. It sets the TPropertyPageImpl’s PropertyPage property, and then calls InitPropertyPage. InitPropertyPage sets an internal field of TPropertyPage so that the TPropertyPage can locate its associated TPropertyPageImpl. In addition, InitPropertyPage initializes some properties on the property page.


Accessibility

Read-only


Hierarchy

TObject

TAggregatedObject


 TQueryTableProducer

Hierarchy	Properties	Methods	Events	See also

TQueryTableProducer assembles a sequence of HTML commands to display the result set of a query in a tabular format.

Unit

dbweb

Description

Use TQueryTableProducer to produce an HTML table for the records of a parameterized query. The TQuery object obtains its parameters from an HTTP request message. If the request is a GET message, the parameters for the query are the QueryFields property of the request object. If the request is a POST message, the parameters for the query are the ContentFields property of the request object.

To produce an HTML table for a query that has no parameters, use the TDataSetTableProducer object instead.

Note:	See the WebServ demo for an example of how to use TQueryTableProducer.


TQueryTableProducer properties

TQueryTableProducer	Alphabetically	Legend

In TQueryTableProducer

DataSet

Query

Derived from TDSTableProducer

Caption

CaptionAlignment

Columns

Editor

Footer

Header

MaxRows

RowAttributes

TableAttributes

Derived from TCustomContentProducer

Dispatcher

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TQueryTableProducer properties

TQueryTableProducer	By object	Legend

Caption

CaptionAlignment

Columns

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DataSet

DesignInfo

Dispatcher

Editor

Footer

Header

MaxRows

Name

Owner

Query

RowAttributes

TableAttributes

Tag

VCLComObject


TQueryTableProducer.DataSet

TQueryTableProducer	See also

Specifies the TQuery object that TQueryTableProducer uses to obtain its data.

property DataSet: TDataSet;

Description

Set DataSet to specify the query that is run to obtain the data for the HTML table. Use DataSet to set the query for the TQueryTableProducer rather than the DataSource property: TQueryTableProducer generates its data source internally.

The individual field bindings specified by the THTMLTableColumn objects in the Columns property refer to fields in DataSet.

Note:	DataSet is identical to the Query property, except the query object is viewed as a TDataSet type.


TQueryTableProducer.Query

TQueryTableProducer	See also 	Example

Specifies the TQuery object that TQueryTableProducer runs to obtain its data.

property Query: TQuery;

Description

Set Query to specify the query to run to obtain the data for the HTML table. Use Query to set the query for the TQueryTableProducer rather than the DataSource property: TQueryTableProducer generates its data source internally.

The individual field bindings specified by the THTMLTableColumn objects in the Columns property refer to fields in DataSet.

Note:	Query is identical to the DataSet property, except Query does not use the TDataSet base class of the query object.


TQueryTableProducer events

TQueryTableProducer	Alphabetically	Legend

Derived from TDSTableProducer

OnCreateContent

OnFormatCell

OnGetTableCaption


TQueryTableProducer events

TQueryTableProducer	By object	Legend

OnCreateContent

OnFormatCell

OnGetTableCaption


TQueryTableProducer methods

TQueryTableProducer	Alphabetically

In TQueryTableProducer

Content

Derived from TDSTableProducer

BeginUpdate

Create

Destroy

EndUpdate

Derived from TCustomContentProducer

ContentFromStream

ContentFromString

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TQueryTableProducer methods

TQueryTableProducer	By object

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Content

ContentFromStream

ContentFromString

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

EndUpdate

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TQueryTableProducer.Content

TQueryTableProducer	See also 	Example

Returns the HTML representation of the query results.

function Content: string; override;

Description

Call Content to run the query with the parameters taken from the HTTP request message and retrieve the resulting HTML representation. If the MethodType of the request is mtGet, the parameters for the query are the QueryFields property of the request. If the MethodType of the request is mtPost, the parameters for the query are the ContentFields property of the request.

After running the query, Content calls the OnCreateContent event handler. If the OnCreateContent event handler indicates that the Content method should continue, Content returns the Header property, followed by an HTML table image of the records in the query, followed by the Footer property. If the OnCreateContent event handler indicates that the Content method should not continue, Content returns an empty string.

The string returned by Content can be used as the Content property of the response object associated with the request message.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomContentProducer

TDSTableProducer


TWebRequest

Hierarchy	Properties	Methods	See also

TWebRequest is the base class for all objects that represent client request information that is passed to a Web server application.

Unit

httpapp

Description

Use a descendant of TWebRequest to interpret an HTTP request message.

Web application objects create TWebRequest objects to capture client requests. The properties of the TWebRequest objects are obtained from the HTTP request message. The Web application uses TWebRequest objects to create corresponding TWebResponse objects. The TWebDispatcher for the application then invokes the TWebActionItem that is associated with the PathInfo of the TWebRequest object.

TWebRequest has three descendants, which represent client requests for different types of Web server applications. These descendants are

TISAPIRequest objects for DLLs that respond to the ISAPI or NSAPI servers.

TCGIRequest objects for CGI server applications.

TWinCGIRequest objects for Windows-based CGI servers.


TWebRequest properties

TWebRequest	Alphabetically	Legend

In TWebRequest

Accept

Authorization

CacheControl

Connection

Content

ContentEncoding

ContentFields

ContentLength

ContentType

ContentVersion

Cookie

CookieFields

Date

DerivedFrom

Expires

From

Host

IfModifiedSince

Method

MethodType

PathInfo

PathTranslated

ProtocolVersion

Query

QueryFields

Referer

RemoteAddr

RemoteHost

ScriptName

ServerPort

Title

URL

UserAgent


TWebRequest properties

TWebRequest	By object	Legend

Accept

Authorization

CacheControl

Connection

Content

ContentEncoding

ContentFields

ContentLength

ContentType

ContentVersion

Cookie

CookieFields

Date

DerivedFrom

Expires

From

Host

IfModifiedSince

Method

MethodType

PathInfo

PathTranslated

ProtocolVersion

Query

QueryFields

Referer

RemoteAddr

RemoteHost

ScriptName

ServerPort

Title

URL

UserAgent


TWebRequest.Accept

TWebRequest	See also

Reports the value of the Accept header of the HTTP request message.

property Accept: string;

Description

Read Accept to determine the media types the Web client can accept in response to the request. Not every HTTP request message has an Accept header. If the Accept property is not set, then any media type is potentially acceptable in the response.

Accept headers usually indicate that the response should be limited to a small set of desired types. For example, a Web client requesting an audio response might produce a TWebRequest object with Accept set to the following string:

audio/*; q=0.2, audio/basic

This request indicates that the preferred response media type is audio/basic, but that any audio type is acceptable if it is the best available after an 80% mark-down in quality.

For information on the format of Accept headers, see the current Internet standards documentation.


TWebRequest.Authorization

TWebRequest	See also	Example

Reports the value of the Authorization header of the HTTP request message.

property Authorization: string;

Description

Read Authorization to check whether the client that sent the request message has provided the correct authentication information. Authorization allows the Web application to provided limited access to the resource specified by the URL property.

For more information about HTTP authentication schemes, see the Internet standards documentation.


TWebRequest.CacheControl

TWebRequest 	See also

Reports the value of the Cache-Control header of the HTTP request message.

property CacheControl: string;

Description

Read CacheControl to determine any Web client directives that must be obeyed by all caching mechanisms along the request/response chain. The CacheControl directives of the HTTP request need not apply to the corresponding HTTP response.

The HTTP 1.1 standard defines the following directives for CacheControl:

Value	Meaning

no-cache	The request may not be cached. The Web server validates the request before the TWebRequest object is created.

no-store	The request contains sensitive information and may not be stored on any permanent medium such as a backup tape. If the request is stored temporarily in a file, the file must be deleted.

max-age=ss	The request is considered invalid if it is older than ss seconds. This directive takes precedence over the Expires property, even if Expires is more restrictive. Invalid requests are validated by the Web server before the TWebRequest object is created.

max-stale or max-stale=ss	The client is willing to accept a response that has exceeded its expiration time. The max-stale directive can optionally specify the number of seconds by which the response can exceed it’s expiration min-fresh=ss	The client is not willing to accept a response that expires in less than ss seconds.


TWebRequest.Connection

TWebRequest	See also

Reports the value of the Connection header of the HTTP request message.

property Connection: string;

Description

Read Connection to determine the options requested by the Web client for its connection to the server application. The HTTP 1.1 standard specifies only one value for the Connection header. If the value of Connection is close, the connection should be closed after the completion of the response.


TWebRequest.Content

TWebRequest	See also

Represents the unparsed contents of the HTTP request message.

property Content: string;

Description

Use Content to read the contents of an HTTP request message that is sending information to the server. The value of Content depends on the Method of the HTTP request. When the Method is POST, Content is the unparsed string giving the values to be posted with their associated fields. When the Method is PUT, Content is the value that should replace the URL given by the URL property.

Tip:	When the Method is POST, the parsed version of the post request is available in the ContentFields property.

Note:	If the content of a message is particularly large, it is transferred in chunks. In this case, the Content property does not contain the entire message content. To read the rest of the content, use the ReadClient method.


TWebRequest.ContentEncoding

TWebRequest	See also

Reports the value of the Content-Encoding header of the HTTP request message.

property ContentEncoding: string;

Description

Read ContentEncoding to determine what encoding mechanisms, if any, have been applied to the Content of the HTTP request. The encoding mechanisms are listed in the order in which the Web client applied them, separated by commas. Typically, ContentEncoding indicates a compression method or an encoding scheme used to transfer extended ASCII characters over the net.

Reverse the ContentEncoding mechanisms to decode the Content into the form indicated by the ContentType property.


TWebRequest.ContentFields

TWebRequest	See also	Example

Reports the parsed content of a POST request message.

property ContentFields: TStrings;

Description

Use ContentFields to read the fields of an HTTP request message when the MethodType is mtPost. The Content of the HTTP request is parsed, separating into fields at the ampersand character.

Each field appears as a separate string in the ContentFields list with the form Name=Value. As a TStrings object, ContentFields allows applications to manipulate the individual fields by name or value.


TWebRequest.ContentLength

TWebRequest	See also

Reports the value of the Content-Length header of the HTTP request message.

property ContentLength: Integer;

Description

Read the ContentLength property to determine the length of the Content property. ContentLength allows an application to determine the end of the Content property when the ContentType is not text/html. A ContentLength of 0 indicates that the length of the Content property is not determined, either because the request does not include any Content, or because the Web client did not know the length.

Note:	The length of the Content may be less than ContentLength when the Content is passed using chunked transfer coding.


TWebRequest.ContentType

TWebRequest	See also

Reports the value of the Content-Type header of the HTTP request message.

property ContentType: string;

Description

Read ContentType to determine the media type of the Content of the HTTP request message. The ContentType is a string of the form Type/SubType.

Most HTTP requests do not require any Content at all. For most requests with a Method that requires a value for Content, the ContentType is text/html. However, HTTP requests for server-specific values of Method can use any media type appropriate to the request.


TWebRequest.ContentVersion

TWebRequest	See also

Reports the value of the Content-Version header of the HTTP request message.

property ContentVersion: string;

Description

Read ContentVersion to determine the version of the Content of the HTTP request message. Most HTTP requests do not require any Content at all. When the Method requires a value for Content, the ContentVersion may be set to indicate the version of the source of that content. The format of the ContentVersion depends on the ContentType of the request.


TWebRequest.Cookie

TWebRequest	See also

Reports the value of the Cookie header of the HTTP request message.

property Cookie: string;

Description

Use Cookie to read the “cookie” strings provided in the Web client request. Cookie strings are used to track state information in a Web application. Cookie is the unparsed value of the Cookie header. The Cookie header can include multiple fields separated by semicolons. Use the CookieFields property to work with the Cookie header on a field-by-field basis.


TWebRequest.CookieFields

TWebRequest	See also	Example

Represents the parsed contents of the Cookie header of an HTTP request message.

property CookieFields: TStrings;

Description

Use CookieFields to work with individual “cookie” strings provided by the Web client request. The Cookie property is parsed into separate fields by separating into substrings whenever a semicolon is encountered.

Cookie strings are used to track state information in a Web application. Each field appears as a separate string in the CookieFields list with the form Name=Value. As a TStrings object, CookieFields allows applications to manipulate the individual fields by name or value.

Note:	Applications can give state variables any name except one of the reserved cookie field names. See the Netscape documentation for a list of reserved cookie field names and their meanings.


TWebRequest.Date

TWebRequest 	See also

Reports the value of the Date header of the HTTP request message.

property Date: TDateTime;

Description

Read Date to determine the date and time at which the HTTP request message originated. Date can be used to determine whether the Content of the request is still valid. The value of Date is translated into local time as specified in the Windows Control Panel from the time units set by the Web client.

For example, if an HTTP request message specifies a MethodType of mtPost, and Date is older than the most recent values of the fields that are being posted, the server application may return a status code that indicates an error rather than overwriting more recent values.

Date is represented using the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since Dec. 30 1899. The fractional part of a TDateTime value is the fraction of a 24-hour day that has elapsed.


TWebRequest.DerivedFrom

TWebRequest	See also

Reports the value of the Derived-From header of the HTTP request message.

property DerivedFrom: string;

Description

Read DerivedFrom to determine the URI from which the value of Content originated. DerivedFrom is only meaningful when the request includes a Content property and the Content did not originate with the Web client.


TWebRequest.Expires

TWebRequest 	See also

Reports the value of the Expires header of the HTTP request message.

property Expires: TDateTime;

Description

Use Expires to determine whether the request is “stale.” Expires is the date and time at which the request becomes invalid. The value of Expires is translated into local time as specified in the Windows Control Panel from the time units set by the Web client.

If the request has a CacheControl value with a max-age directive, the max-age directive overrides the value of Expires.

Expires is represented using the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since Dec. 30 1899. The fractional part of a TDateTime value is the fraction of a 24-hour day that has elapsed.


TWebRequest.From

TWebRequest	See also

Reports the value of the From header of the HTTP request message.

property From: string;

Description

Read From to determine the Internet e-mail address of the human user for whom the Web client sent the HTTP request message. This value can be used for logging purposes, or to contact the originator of the request if problems occur.


TWebRequest.Host

TWebRequest	See also

Reports the value of the Host header of the HTTP request message.

property Host: string;

Description

Read Host to determine the Internet host and port number of resource being requested. For example, if the client request specifies the following URL:

http://www.TSite.com/art/gallery.dll/mammals?animal=dog&color=black

The value of Host would be

www.TSite.com

The value of Host can be used to differentiate between internally ambiguous URLs, such as the root “/” URL of a server for multiple host names on a single IP address.


TWebRequest.IfModifiedSince

TWebRequest 	See also

Reports the value of the If-Modified-Since header of the HTTP request message.

property IfModifiedSince: TDateTime;

Description

Read IfModifiedSince on a request with an HTTPMethod of mtGet to determine whether the request is conditional. If the information requested by the Web client was not modified since the time indicated by IfModifiedSince, the response should be a not modified error rather than the information indicated by the URL property.

The value of IfModifiedSince is given according to the local clock as specified in the Windows Control Panel, not the clock of the Web client.

IfModifiedSince is represented using the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since Dec. 30 1899. The fractional part of a TDateTime value is the fraction of a 24-hour day that has elapsed.


TWebRequest.Method

TWebRequest	See also

Reports the value of the Method header of the HTTP request message.

property Method: string;

Description

Read Method to determine the method that is requested by the Web client. The HTTP 1.1 standard defines the following methods

Value	Meaning

OPTIONS	A request for information about available communication options.

GET	A request for the information identified by the URL property.

HEAD	A request for information about the properties of the HTTP response, but not for the content of the response.

POST	A request for the server application to post the data included in the Content property, as appropriate.

PUT	A request for the server application to replace the resource indicated by the URL property with the data included in the Content property.

DELETE	A request for the server application to delete or hide the resource identified by the URL property.

TRACE	A request for the server application to send a loop-back to confirm receipt of the request.

The Method property may indicate any other method that the Web client requests of the server. If the Method can’t be matched to the Allow property of a TWebResponse object, the request can’t be serviced.

Note:	The MethodType property indicates whether the value of Method is GET, HEAD, POST, PUT, or one of the other strings. When possible, use MethodType instead of the Method property to save the overhead of string comparison.

Note:	An HTTP application does not need to service all method types. However, there must be a response for the GET and HEAD method requests.


TWebRequest.MethodType

TWebRequest	See also

Indicates the method requested by the Web client.

property MethodType: TMethodType;

Description

Read MethodType to determine the type of response that is requested by the Web client. MethodType encodes of the most common METHOD header values.

If MethodType is mtAny, read the Method property to determine the method requested by the Web client.


TWebRequest.PathInfo

TWebRequest	See also

Reports the value of the path information (if any) of the URL specified in the HTTP request message.

property PathInfo: string;

Description

Read PathInfo to determine the path on the server machine where the target of the request is found. For example, given this URL:

http://www.TSite.com/art/gallery.dll/mammals?animal=dog&color=black

and assuming that the /gallery.dll part is the Web server application, the PathInfo portion is:

/mammals

The TWebDispatcher object uses the PathInfo to identify the appropriate TWebActionItem for servicing the request message.


TWebRequest.PathTranslated

TWebRequest	See also

Represents a translation of the PathInfo property to a fully qualified path on the Web server.

property PathTranslated: string;

Description

Use PathTranslated to refer to the location of the target of the request in an HTTP response.


TWebRequest.ProtocolVersion

TWebRequest	See also

Reports the version number of the HTTP protocol specified in the initial header of the HTTP request message.

property ProtocolVersion: string;

Description

Use ProtocolVersion to determine the protocol used by the Web client when generating the HTTP request message.

Some properties of the HTTP request may be interpreted differently depending on the ProtocolVersion. For example, if ProtocolVersion is 1.0, then the connection should not be considered persistent, even if the Connection property does not specify the close option.


TWebRequest.Query

TWebRequest	See also

Indicates the value of the query information (if any) of the URL specified in the HTTP request message.

property Query: string;

Description

Read Query to determine the details of a query specified in the URL of the Web client request. For example, given this URL:

http://www.TSite.com/art/gallery.dll/mammals?animal=dog&color=black

and assuming that the /gallery.dll part is the Web server application, the Query portion is:

animal=dog&color=black

Query is the unparsed query portion of the URL. The query may include multiple fields separated by ampersands. Use the QueryFields property to work with the query on a field-by-field basis.


TWebRequest.QueryFields

TWebRequest	See also

Represents the parsed contents of the Query in the URL of the HTTP request message.

property QueryFields: TStrings;

Description

Use QueryFields to work with individual query values provided by the Web client request. The Query property is parsed into separate fields by separating into substrings whenever an ampersand is encountered.

Each query field appears as a separate string in the QueryFields list with the form Name=Value. As a TStrings object, QueryFields allows applications to manipulate the individual fields by name or value.


TWebRequest.Referer

TWebRequest	See also

Reports the value of the Referer header of the HTTP request message.

property Referer: string;

Description

Read Referer to determine the URI of the resource where the HTTP request message originated. Referer allows the server application to generate back-links to the source of the request. If Referer is a partial URI, it should be interpreted as a relative path to the URL property.

The Referer property is not set when the URL of the HTTP request was obtained from a source that does not have its own URI, such as input from the user keyboard.


TWebRequest.RemoteAddr

TWebRequest	See also

Indicates the remote IP address of the client associated with the HTTP request message.

property RemoteAddr: string;

Description

Read RemoteAddr to obtain the IP address of the source of the Web client request.


TWebRequest.RemoteHost

TWebRequest	See also

Reports the fully qualified reverse domain lookup of the client associated with the HTTP request message.

property RemoteHost: string;

Description

Use RemoteHost to compose URI values for back-links to the source of the request when the Referer property is not specified. RemoteHost does not include any path information.


TWebRequest.ScriptName

TWebRequest	See also

Indicates the value of the script information (if any) of the URL specified in the HTTP request message.

property ScriptName: string;

Description

Read ScriptName to determine the full path to the Web server application specified by the client request. For example, given this URL:

http://www.TSite.com/art/gallery.dll/mammals?animal=dog&color=black

and assuming that the /gallery.dll part is the Web server application, the ScriptName portion is:

/art/gallery


TWebRequest.ServerPort

TWebRequest	See also

Indicates the port number of the port on the Web server that receives the HTTP request message.

property ServerPort: Integer;

Description

Read ServerPort to determine the number of the port used in the connection to the Web server. The Host property will include the ServerPort if it is specified as part of the URL for the client request.


TWebRequest.Title

TWebRequest	See also

Reports the value of the Title header of the HTTP request message.

property Title: string;

Description

Read Title to determine the Title of the information requested in the Web client request.


TWebRequest.URL

TWebRequest	See also

Reports the Uniform Resource Identifier (URI) specified by the HTTP request message to identify the target of the request.

property URL: string;

Description

Use the URL property to identify the resource the Web client identifies as the target of the request message. URL may be an HTML page to return, a resource to be created or deleted, or an object that provides some other service for the Web client.

The TWebRequest object parses the URL into its constituent parts, yielding the Host, ScriptName, PathInfo, and Query properties.

Note:	Usually the URL property is a Uniform Resource Locator (URL) that can be parsed into host, script, path, and query portions. However, it is possible for HTTP request messages to specify the target in more general terms, as a Uniform Resource Identifier (URI).


TWebRequest.UserAgent

TWebRequest	See also

Reports the value of the User-Agent header of the HTTP request message.

property UserAgent: string;

Description

Read UserAgent to obtain information about the user agent originating the client request. Use the UserAgent information for statistical purposes, for tracing protocol violations, and for tailoring responses to known limitations of specific applications that generate client requests. The UserAgent string contains one or more descriptors, in order of significance. Each descriptor gives the name of the product or application that generated the request, or a comment about the user agent.


TWebRequest methods

TWebRequest	Alphabetically	Legend

In TWebRequest

Create

Destroy

ExtractContentFields

ExtractCookieFields

ExtractFields

ExtractQueryFields

GetDateVariable

GetFieldByName

GetIntegerVariable

GetStringVariable

ReadClient

ReadString

TranslateURI

WriteClient

WriteString

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TWebRequest methods

TWebRequest	By object	Legend

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

ExtractContentFields

ExtractCookieFields

ExtractFields

ExtractQueryFields

FieldAddress

Free

FreeInstance

GetDateVariable

GetFieldByName

GetIntegerVariable

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetStringVariable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadClient

ReadString

SafeCallException

TranslateURI

WriteClient

WriteString


TWebRequest.Create

TWebRequest	See also

Creates an instance of TWebRequest.

constructor Create;

Description

Applications shouldn’t need to call Create to instantiate a request object. The TWebApplication object creates a TWebRequest object whenever it receives a client request.


TWebRequest.Destroy

TWebRequest	See also

Destroys an instance of TWebRequest.

destructor Destroy; override;

Description

Do not call Destroy. When the request message is fully handled, TWebApplication destroys the request object by calling its Free method.

Destroy frees the TStrings objects used to represent the ContentFields, CookieFields, and QueryFields properties.


TWebRequest.ExtractContentFields

TWebRequest	See also

Parses the Content property into its constituent fields.

procedure ExtractContentFields(Strings: TStrings);

Description

Call ExtractContentFields to fill the Strings parameter with the individual fields in the Content property. ExtractContentFields assumes that fields are separated by ampersands. This is the format used when the MethodType is mtPost. If the Content property is not assigned, ExtractContentFields does nothing.


TWebRequest.ExtractCookieFields

TWebRequest	See also

Parses the Cookie property into its constituent fields.

procedure ExtractCookieFields(Strings: TStrings);

Description

Call ExtractCookieFields to fill the Strings parameter with the individual fields in the Cookie property. ExtractCookieFields assumes that fields are separated by semicolons. If the Cookie property is not assigned, ExtractCookieFields does nothing.


TWebRequest.ExtractFields

TWebRequest	See also

Parses a multi-valued string into its constituent fields.

procedure ExtractFields(Separators, WhiteSpace: TSysCharSet; Content: PChar; Strings: TStrings);

Description

Call ExtractFields to parse a multi-valued HTTP header into separate strings for each value. For example, if the separator character of the UserAgent property is known, ExtractFields can parse this property into separate UserAgent values.

Separators is a set of characters that are used to separate individual values within the multi-valued string. WhiteSpace is a set of characters that are to be ignored when parsing the string. Content is the multi-valued string to be parsed. Strings is the TStrings object that receives the individual values that are parsed from Content.


TWebRequest.ExtractQueryFields

TWebRequest	See also

Parses the Query property into its constituent fields.

procedure ExtractQueryFields(Strings: TStrings);

Description

Call ExtractQueryFields to fill the Strings parameter with the individual fields in the Query property. ExtractQueryFields assumes that fields are separated by ampersands (;). If the Query property is not assigned, ExtractQueryFields does nothing.


TWebRequest.GetDateVariable

TWebRequest	See also

Provides the abstract prototype of a method to extract a date value from an indexed table of HTTP header variables.

function GetDateVariable(Index: Integer): TDateTime; virtual; abstract;

Description

Descendants of TWebRequest implement GetDateVariable to provide a method by which the date-time values are read from the header strings of the HTTP request message. The request object uses GetDateVariable to access the properties that represent dates from the HTTP request headers.


TWebRequest.GetFieldByName

TWebRequest	See also

Provides the abstract prototype of a method that returns the value of the HTTP header variable specified by the Name parameter.

function GetFieldByName(const Name: string): string; virtual; abstract;

Description

Descendants of TWebRequest implement GetFieldByName to provide access to arbitrary header fields in the HTTP request message. Use GetFieldByName to read the value of an HTTP header variable that is not surfaced as one of the properties of TWebRequest. For information on possible HTTP request header variables, see the current Internet standards documents.


TWebRequest.GetIntegerVariable

TWebRequest	See also

Provides the abstract prototype of a method to extract an integer value from an indexed table of HTTP header variables.

function GetIntegerVariable(Index: Integer): Integer; virtual; abstract;

Description

Descendants of TWebRequest implement GetIntegerVariable to provide a method by which the integer values are read from the header strings of the HTTP request message. The request object uses GetIntegerVariable to access the properties that represent integers from the HTTP request headers.


TWebRequest.GetStringVariable

TWebRequest	See also

Provides the abstract prototype of a method to extract a string value from an indexed table of HTTP header variables.

function GetStringVariable(Index: Integer): string; virtual; abstract;

Description

Descendants of TWebRequest implement GetStringVariable to provide a method by which the string values are read from the header strings of the HTTP request message. The request object uses GetStringVariable to access the properties that represent strings from the HTTP request headers.


TWebRequest.ReadClient

TWebRequest	See also

Provides the abstract prototype of a method to read from the HTTP request into a buffer.

function ReadClient(var Buffer; Count: Integer): Integer; virtual; abstract;

Description

Descendants of TWebRequest implement ReadClient. ReadClient is used to read content information from the HTTP request. Use ReadClient to get the next chunk of information when the content of the request message is too large for the Content property.

Use Buffer to provide a buffer to contain the content information. Use Count to specify the number of bytes to read. ReadClient returns the number of bytes actually read.


TWebRequest.ReadString

TWebRequest	See also

Provides the abstract prototype of a method to read Count bytes from the HTTP request into a string.

function ReadString(Count: Integer): string; virtual; abstract;

Description

Descendants of TWebRequest implement ReadString. ReadString is used to load content information from the HTTP request into a string. Use ReadString to get the next chunk of information when the content of the request message is too large for the Content property.


TWebRequest.TranslateURI

TWebRequest	See also

Provides the abstract prototype for a method to translate a Uniform Resource Identifier (URI) into an internal representation of a location on the server.

function TranslateURI(const URI: string): string; virtual; abstract;

Description

Descendants of TWebRequest implement TranslateURI. TranslateURI is used to translate the URI specified in a client request into a format that can be used by the server application. The internal format varies, depending on whether the server application is an ISAPI or NSAPI application. TranslateURI is not relevant to CGI applications.


TWebRequest.WriteClient

TWebRequest	See also

Provides the abstract prototype for a method to write Count bytes from Buffer back to the HTTP client.

function WriteClient(var Buffer; Count: Integer): Integer; virtual; abstract;

Description

Descendants of TWebRequest implement WriteClient. WriteClient is used by TWebResponse to send the contents of a response to the Web client.


TWebRequest.WriteString

TWebRequest	See also

Provides the abstract prototype for a method to write the string AString back to the HTTP client.

function WriteString(const AString: string): Boolean; virtual; abstract;

Description

Descendants of TWebRequest implement WriteString. WriteString is used by TWebResponse to send the contents of a response to the Web client.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject


TWebResponse

Hierarchy	Properties	Methods	See also

TWebResponse is the base class for all objects that represent HTTP messages sent in response to an HTTP request message.

Unit

httpapp

Description

Use a descendant of TWebResponse to specify the response to an HTTP request message.

A web application creates a TWebResponse object based on the TWebRequest object for an incoming HTTP request message. The Web dispatcher for the application then passes the TWebResponse object to the TWebActionItem associated with the TWebRequest object, so that the response can be formulated.

TWebResponse has three descendants, which represent HTTP response messages in different types of web server applications. These descendants are

TISAPIResponse objects in server DLLs.

TCGIResponse objects in CGI server applications.

TWinCGIResponse objects in Windows-based CGI servers.


TWebResponse properties

TWebResponse	Alphabetically	Legend

In TWebResponse

Allow

Content

ContentEncoding

ContentLength

ContentStream

ContentType

ContentVersion

Cookies

CustomHeaders

Date

DerivedFrom

Expires

HTTPRequest

LastModified

Location

LogMessage

Realm

ReasonString

Sent

Server

StatusCode

Title

Version

WWWAuthenticate


TWebResponse properties

TWebResponse	By object	Legend

Allow

Content

ContentEncoding

ContentLength

ContentStream

ContentType

ContentVersion

Cookies

CustomHeaders

Date

DerivedFrom

Expires

HTTPRequest

LastModified

Location

LogMessage

Realm

ReasonString

Server

Sent

StatusCode

Title

Version

WWWAuthenticate


TWebResponse.Allow

TWebResponse	See also

Lists the HTTP request methods that the application can service.

property Allow: string;

Description

Use Allow to indicate what type of request methods the server application can respond to for the URI specified by HTTPRequest. Allow is a string of method names, separated by commas. The method names can include any pre-defined methods from the HTTP standard, or any additional methods implemented by the server application. At a minimum, the TWebResponse object must allow GET and HEAD requests.


TWebResponse.Content

TWebResponse	See also 	Example

Contains the information sent to the web client in response to an HTTP request message.

property Content: string;

Description

Use Content to send requested information to the web client. Not every HTTP request message requires content to be returned. For example, responses to requests with a Method of OPTIONS, HEAD, POST, PUT, DELETE, or TRACE should not include any Content. In all these cases, the response information is contained entirely in the response header, which is built from the other properties of the TWebResponse object.

The response content can be a string of HTML commands, the name of an HTML file, graphic content such as a bit-stream, or any other MIME content type.

Note:	If the ContentStream property is set, it supersedes the value of the Content property. If both Content and ContentStream are set, the web client is sent the value of the ContentStream, not the value of the Content property.


TWebResponse.ContentEncoding

TWebResponse	See also

Lists the mechanisms, if any, that are used to encode the content of the HTTP response message.

property ContentEncoding: string;

Description

Set ContentEncoding when the value of Content has been encoded before it is sent to the web client. The encoding mechanisms are listed in the order in which they are applied, separated by commas. Typically, ContentEncoding indicates a compression method or an encoding method used to transfer extended-ascii characters over the net.


TWebResponse.ContentLength

TWebResponse	See also

Specifies the length, in bytes, of the Content property.

property ContentLength: Integer;

Description

Set ContentLength to the length of the Content property, if it is known. If the length of the Content property is unknown, or if the response message does not include any content, set ContentLength to 0. Web clients use the ContentLength when reading the contents of the HTTP response message.

If the contents of the response message are taken from a stream, the value of ContentLength is set from the stream.


TWebResponse.ContentStream

TWebResponse	See also	Example

Specifies stream object for writing the contents of the HTTP response message to the web client.

property ContentStream: TStream;

Description

Use ContentStream to set the contents of the HTTP response message to a value that can be written from a stream. ContentStream allows the response object to write its contents directly from a stream.

The stream specified by ContentStream can access a string of HTML commands, the contents of a BLOB database field, or any MIME content type.

Note:	ContentStream supersedes the Content property. If both Content and ContentStream are set, the web client is sent the value of the ContentStream, not the value of the Content property.


TWebResponse.ContentType

TWebResponse	See also	Example

Indicates the media type of the Content of the HTTP response message.

property ContentType: string;

Description

Set ContentType to indicate the media type of the Content of the HTTP response message. The value of ContentType must specify a valid MIME content type. The ContentType string has the form Type/SubType.

For example, if the HTTP response message sends a string of HTML commands to the web client in response to a GET request, the ContentType is text/html.

Note:	If the HTTP request message includes an Accept header, ContentType should be one of the content types listed in the TWebRequest.Accept property.


TWebResponse.ContentVersion

TWebResponse	See also

Represents the version associated with the Content of the HTTP response message.

property ContentVersion: string;

Description

Use ContentVersion to specify a version associated with the Content of the HTTP response. The meaning of ContentVersion depends on the type of information that is sent in the HTTP response. For example, if the Content of the HTTP response has a ContentType of text/html, ContentVersion would be the version of HTML used.

Server applications that introduce meanings for the ContentVersion property should document the interpretation they assign to ContentVersion.


TWebResponse.Cookies

TWebResponse	See also 	Example

Lists all cookie headers that should be sent with the response.

property Cookies: TCookieCollection;

Description

Use Cookies to obtain direct access to the individual TCookie objects that represent the fields of the cookie headers in the response message. Each TCookie object represents in individual cookie header that is included with the response message.

Use the Add method of the cookie collection to add a single cookie to the collection, or use the SetCookieField method to add multiple related cookie headers to this collection. SetCookieField creates and adds new cookies that share a common set of values for the domain, path, expires, and secure fields. Use the HeaderValue property of the individual entries in Cookies to determine the actual response header string that is sent for each cookie header.

Note:	For more information about the use of cookies, see the documentation on Netscape’s Web site.


TWebResponse.CustomHeaders

TWebResponse	See also

Lists message header strings that are added to the response message before it is sent.

property CustomHeaders: TStrings;

Description

Use CustomHeaders to add header information to the response that can not be specified using the other properties of TWebResponse. Each string in the CustomHeaders property has the form HeaderName=Value, where HeaderName specifies the name of the header, and Value is the value for that header, formatted as a string.

Note:	Setting the CustomHeaders property assigns a set of strings to the custom headers list. It does not replace the TStrings object that is the value of CustomHeaders.


TWebResponse.Date

TWebResponse 	See also

Indicates the time and date when the HTTP response message is sent to the web client.

property Date: TDateTime;

Description

Set Date to the current date and time immediately before sending the HTTP response message to the web client. The Web client uses Date to determine the age of the information returned.

Date is represented using the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since Dec. 30 1899. The fractional part of a TDateTime value is the fraction of a 24-hour day that has elapsed.


TWebResponse.DerivedFrom

TWebResponse	See also

Specifies the URI of the resource where the Content of the HTTP response originated.

property DerivedFrom: string;

Description

Set DerivedFrom to the URI where the value of Content originates. It is especially important to set DerivedFrom when the Content of the HTTP response did not originate from the resource indicated by the URL property of the request object.


TWebResponse.Expires

TWebResponse 	See also

Specifies the date and time after which the Content of the HTTP response message should be considered invalid.

property Expires: TDateTime;

Description

Set Expires when the Content of the HTTP response message contains information that may become invalid with the passage of time. Setting an Expires value does not imply that the information or its source will necessarily change or cease to exist when the Expires date and time is reached. Web clients are simply warned to check the freshness of the information after the Expires date and time.

The value of Expires is specified in Greenwich Mean Time.

Expires is represented using the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since Dec. 30 1899. The fractional part of a TDateTime value is the fraction of a 24 hour day that has elapsed.


TWebResponse.HTTPRequest

TWebResponse	See also

Represents the HTTP request message for which this is a response.

property HTTPRequest: TWebRequest;

Description

Read HTTPRequest to determine the header and contents of the HTTP request message that spawned this response message. The properties of HTTPRequest give access to the information sent in the web client request message.


TWebResponse.LastModified

TWebResponse 	See also

Indicates the date and time that the value of the Content property was last updated.

property LastModified: TDateTime;

Description

Set LastModified to indicate the last time the Content of the response was modified. This allows web clients to determine whether their local version of that information is up-to-date. When the HTTP request is a HEAD message, this may allow the web client and server to skip a potentially expensive transfer of information.

The value of LastModified is specified in the local time of the machine. The HTTP response message translates this value to the date encoding used by HTTP.

LastModified is represented using the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since Dec. 30 1899. The fractional part of a TDateTime value is the fraction of a 24 hour day that has elapsed.


TWebResponse.Location

TWebResponse	See also

Specifies the URI of a resource the web client should point to for the completion of its request.

property Location: string;

Description

Set Location when the TWebResponse created a new resource in response to the HTTP request message, or when servicing of the request must be delegated to another URI than the one specified in the HTTP request message.


TWebResponse.LogMessage

TWebResponse	See also

Describes the HTTP response message for event logging purposes.

property LogMessage: string;

Description

Set LogMessage to a description of the action carried out by the TWebActionItem object that services this HTTP response. Usually, LogMessage includes the URI that handled the request message, along with date and time information.


TWebResponse.Realm

TWebResponse	See also

Specifies the set of protected-access URIs that includes the URL specified by the HTTP request message.

property Realm: string;

Description

Set Realm when the response message returns 401 (Unauthorized) or 402 (Payment required). Realm is the name of a set of URIs that require a password or payment before the web client can access them. All the URIs in the realm, including the URL specified in the request message, are made available as soon as the web client provides the password or payment for the realm. The server application should keep track, internally, of the passwords or payments the client has provided, using the client information provided by the TWebRequest object.


TWebResponse.ReasonString

TWebResponse	See also

Indicates the status of the response to the web client request as a human-readable string.

property ReasonString: string;

Description

Set ReasonString to inform the human web client of the success or failure of the HTTP request message. Each reason string is associated with a 3-digit status code whose value indicates the status of the response. The HTTP standard defines a number of stock status codes and corresponding reason strings. In addition, server applications can define new reason strings and associate them with unused status codes.


TWebResponse.Server

TWebResponse	See also

Provides information about the software used by the server application to handle the request.

property Server: string;

Description

Set Server to a string giving the name and version number of the application that provides the Content of the response message. The value of Server can contain multiple product identifiers and comments, listed in order of significance and separated by spaces. Product identifiers take the form ProductName/VersionNumber.


TWebResponse.StatusCode

TWebResponse	See also

Indicates the status of the response to the HTTP request message as a 3-digit integer.

property StatusCode: Integer;

Description

Set StatusCode to inform the web client the status of the HTTP request message. Status codes are standard return values that can be interpreted by all web clients. Each status code has a corresponding reason string that provides a human web client with a more understandable indication of the status.

The following tables lists the standard status codes and their corresponding reason strings.

StatusCode	ReasonString

100	Continue

101	Switching Protocols

200	OK

201	Created

202	Accepted

203	Non-Authoritative Information

204	No Content

205	Reset Content

206	Partial Content

300	Multiple Choices

301	Moved Permanently

302	Moved Temporarily

303	See Other

304	Not Modified

305	Use Proxy

400	Bad Request

401	Unauthorized

402	Payment Required

403	Forbidden

404	Not Found

405	Method Not Allowed

406	Not Acceptable

407	Proxy Authentication Required

408	Request Time-out

409	Conflict

410	Gone

411	Length Required

412	Precondition Failed

413	Request Entity Too Large

414	Request-URI Too Large

415	Unsupported Media Type

500	Internal Server Error

501	Not Implemented

502	Bad Gateway

503	Service Unavailable

504	Gateway Time-out

505	HTTP Version not supported

Status codes not in the table can be created by the server application. When creating a new status code, the most significant digit should indicate the class of response, as follows:

1xx: Informational (request received, continuing process)

2xx: Success (request received, understood, and accepted)

3xx: Redirection (Further action needed to complete the request)

4xx: Client Error (request contains bad syntax or cannot be serviced)

5xx: Server Error (server failed to handle a valid request)


TWebResponse.Title

TWebResponse	See also

Specifies a title for the Content of the HTTP response message.

property Title: string;

Description

Set the Title property to add a Title header to the HTTP response message. Title is an optional application-specific title associated with the information included in the message.


TWebResponse.Version

TWebResponse	See also

Specifies the HTTP protocol version number that the web client is using.

property Version: string;

Description

Read Version to ensure that the properties set in the TWebResponse object will be understood by the web client. The value of Version is taken from the ProtocolVersion property of the TWebRequest object.

For more information on the different HTTP protocol versions, see the Internet standards documentation.


TWebResponse.WWWAuthenticate

TWebResponse	See also

Lists of one or more comma-separated challenges provided when the request fails with StatusCode 401 (Unauthorized).

property WWWAuthenticate: string;

Description

Set WWWAuthenticate when the HTTP request fails because it requires access to a URI in a realm for which the web client has not provided a password. WWWAuthenticate consists of an authentication scheme name, followed by a comma-separated list of parameter/value pairs that specify the parameters to the authentication scheme. The first parameter/value pair indicates the realm.

For more information about HTTP authentication schemes, see the Internet standards documents.


TWebResponse methods

TWebResponse	Alphabetically	Legend

In TWebResponse

AddCustomHeaders

Create

Destroy

GetContent

GetCustomHeader

GetDateVariable

GetIntegerVariable

GetLogMessage

GetStatusCode

GetStringVariable

SendRedirect

SendResponse

SendStream

Sent

SetContent

SetContentStream

SetCookieField

SetCustomHeader

SetDateVariable

SetIntegerVariable

SetLogMessage

SetStatusCode

SetStringVariable

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TWebResponse methods

TWebResponse	By object	Legend

AddCustomHeaders

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetContent

GetCustomHeader

GetDateVariable

GetIntegerVariable

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetLogMessage

GetStatusCode

GetStringVariable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

SendRedirect

SendResponse

SendStream

Sent

SetContent

SetContentStream

SetCookieField

SetCustomHeader

SetDateVariable

SetIntegerVariable

SetLogMessage

SetStatusCode

SetStringVariable


TWebResponse.AddCustomHeaders

TWebResponse	See also

Appends the custom headers specified by the CustomHeaders property to the Headers parameter.

procedure AddCustomHeaders(var Headers: string);

Description

Call AddCustomHeaders to add the message headers described by the CustomHeaders property to a string of message headers. Each header is added on its own line (separated by carriage return and line feed), in the format HeaderName: Value.


TWebResponse.Create

TWebResponse	See also

Creates an instance of TWebResponse to represent the response to the HTTPRequest parameter.

constructor Create(HTTPRequest: TWebRequest);

Description

Applications shouldn’t need to call Create to instantiate a response object. The TWebApplication object creates a TWebResponse for each TWebRequest it creates.


TWebResponse.Destroy

TWebResponse	See also

Destroys an instance of TWebResponse.

destructor Destroy; override;

Description

Do not call Destroy. The TWebApplication object that creates the TWebResponse object destroys it by calling its Free method.

Destroy frees the ContentStream object if one was used to write the contents of the HTTP response message.


TWebResponse.GetContent

TWebResponse	See also

Provides the abstract prototype of a method to access the Content property.

function GetContent: string; virtual; abstract;

Description

Descendants of TWebResponse implement GetContent to provide an access method for their internal representation of the Content property. This method is abstract because response objects for different types of HTTP applications store the value of the Content property differently.


TWebResponse.GetCustomHeader

TWebResponse	See also

Returns the value of the custom header with the specified name.

function GetCustomHeader(const Name: string): String;

Description

Call GetCustomHeader to obtain the value of one of the custom headers specified in the CustomHeaders property. The Name parameter specifies the name of the HTTP message header.


TWebResponse.GetDateVariable

TWebResponse	See also

Provides the abstract prototype of a method to extract a date value from an indexed table of HTTP header variables.

function GetDateVariable(Index: Integer): TDateTime; virtual; abstract;

Description

Descendants of TWebResponse implement GetDateVariable to provide a method by which date-time values are read from the internal table used to store HTTP header variables. The response object uses GetDateVariable to access the properties that represent dates.


TWebResponse.GetIntegerVariable

TWebResponse	See also

Provides the abstract prototype of a method to extract an integer value from an indexed table of HTTP header variables.

function GetIntegerVariable(Index: Integer): Integer; virtual; abstract;

Description

Descendants of TWebResponse implement GetIntegerVariable to provide a method by which integer values are read from the internal table used to store HTTP header variables. The response object uses GetIntegerVariable to access the properties that represent integers.


TWebResponse.GetLogMessage

TWebResponse	See also

Provides the abstract prototype of a method to access the LogMessage property.

function GetLogMessage: string; virtual; abstract;

Description

Descendants of TWebResponse implement GetLogMessage to provide an access method for internal representation of the LogMessage property. This method is abstract because response objects for different types of HTTP applications store the value of the LogMessage property differently.


TWebResponse.GetStatusCode

TWebResponse	See also

Provides the abstract prototype of a method to access the StatusCode property.

function GetStatusCode: Integer; virtual; abstract;

Description

Descendants of TWebResponse implement GetStatusCode to provide an access method for internal representation of the StatusCode property. This method is abstract because response objects for different types of HTTP applications store the value of the StatusCode property differently.


TWebResponse.GetStringVariable

TWebResponse	See also

Provides the abstract prototype of a method to extract a string value from an indexed table of HTTP header variables.

function GetStringVariable(Index: Integer): string; virtual; abstract;

Description

Descendants of TWebResponse implement GetStringVariable to provide a method by which the string values are read from the internal table used to store HTTP header variables. The response object uses GetStringVariable to access the properties that represent strings.


TWebResponse.SendRedirect

TWebResponse	See also

Provides the abstract prototype of a method that sends the response with a StatusCode of 301 (Moved Permanently) and a Location of URI.

procedure SendRedirect(const URI: string); virtual; abstract;

Description

Call SendRedirect to redirect the web client request to another URI that is the proper target of the request. SendRedirect does the same thing as setting the StatusCode to 301, the Location to URI, and calling SendResponse.


TWebResponse.SendResponse

TWebResponse	See also	Example

Provides the abstract prototype of a method that sends the HTTP response message to the web client.

procedure SendResponse; virtual; abstract;

Description

Call SendResponse after setting the properties of the HTTP response object to specify the response that should be made to the web client. If the request should be redirected to another URI, it is more efficient to call SendRedirect instead.


TWebResponse.SendStream

TWebResponse	See also

Provides the abstract prototype of a method that sends the HTTP response message with the contents set to the contents of AStream.

procedure SendStream(AStream: TStream); virtual; abstract;

Description

Only call SendStream after first calling SendResponse. Unlike SendStream, SendResponse fills the header of the HTTP response message, based on the properties of the TWebResponse object. If SendResponse has not been called first to set the header of the HTTP response message, set the ContentStream property to AStream, and call SendResponse.


TWebResponse.Sent

TWebResponse	See also

Indicates whether the HTTP response message has already been sent.

function Sent: Boolean; virtual;

Description

Because SendRedirect and SendStream are abstract methods for TWebResponse, TWebResponse.Sent always returns False. Descendants of TWebResponse override Sent to check whether the message was sent and return True or False as appropriate.

TWebApplication objects read Sent and send unsent responses to the web client.


TWebResponse.SetContent

TWebResponse	See also

Provides the abstract prototype of a method to set the Content property.

procedure SetContent(const Value: string); virtual; abstract;

Description

Descendants of TWebResponse implement SetContent to provide a method for setting the Content property. This method is abstract because response objects for different types of HTTP applications can store the value of the Content property differently.


TWebResponse.SetContentStream

TWebResponse	See also

Sets the value of the ContentStream property to the Value parameter.

procedure SetContentStream(Value: TStream); virtual;

Description

SetContentStream frees the previous value of ContentStream and replaces the property with the Value parameter.


TWebResponse.SetCookieField

TWebResponse	See also

Adds a cookie header to the response message.

procedure SetCookieField(Values: TStrings; const ADomain, APath: string; AExpires: TDateTime; ASecure: Boolean);

Description

Call SetCookieField to add a cookie header to the Cookies property. Each cookie header contains a set of name/value pairs that can be passed on by the client application. Use the Values parameter to specify the name/value pairs as strings of the form Name=Value. Use the ADomain and APath parameters to indicate which URLs the cookie should be sent to. Use the AExpires parameter to indicate when the cookie is no longer valid. Use the ASecure property to indicate whether the cookie should only be passed on by the client if a secure connection is used.

See the documentation on the Netscape Web site for more information about cookies.


TWebResponse.SetCustomHeader

TWebResponse	See also

Replaces the value of a specified custom header.

procedure SetCustomHeader(const Name, Value: string);

Description

Call SetCustomHeader to add a new custom header to the list maintained by the CustomHeaders property, or to change the value of one of the headers already in the list. SetCustomHeader locates the header in the list with the name specified by the Name parameter. If a header with that name is in the list, SetCustomHeader replaces the value of that header with the value specified as the Value parameter. If the name was not found, SetCustomHeader adds a new header to the list with the given name and value.


TWebResponse.SetDateVariable

TWebResponse	See also

Provides the abstract prototype of a method to set a date-time valued HTTP header property.

procedure SetDateVariable(Index: Integer; const Value: TDateTime); virtual; abstract;

Description

Descendants of TWebResponse implement SetDateVariable to provide a method by which date-time values are written to the internal table used to store HTTP header variables. The response object uses SetDateVariable to set the properties that represent dates.


TWebResponse.SetIntegerVariable

TWebResponse	See also

Provides the abstract prototype of a method to set an integer valued HTTP header property.

procedure SetIntegerVariable(Index: Integer; Value: Integer); virtual; abstract;

Description

Descendants of TWebResponse implement SetIntegerVariable to provide a method by which integer values are written to the internal table used to store HTTP header variables. The response object uses SetIntegerVariable to set the properties that represent integers.


TWebResponse.SetLogMessage

TWebResponse	See also

Provides the abstract prototype of a method to set the value of the LogMessage property.

procedure SetLogMessage(const Value: string); virtual; abstract;

Description

Descendants of TWebResponse implement SetLogMessage to provide a method to set the internal representation of the LogMessage property. This method is abstract because response objects for different types of HTTP applications store the value of the LogMessage property differently.


TWebResponse.SetStatusCode

TWebResponse	See also

Provides the abstract prototype of a method to set the value of the StatusCode property.

procedure SetStatusCode(Value: Integer); virtual; abstract;

Description

Descendants of TWebResponse implement SetStatusCode to provide a method to set the internal representation of the StatusCode property. This method is abstract because response objects for different types of HTTP applications store the value of the StatusCode property differently.


TWebResponse.SetStringVariable

TWebResponse	See also

Provides the abstract prototype of a method to set a string valued HTTP header property.

procedure SetStringVariable(Index: Integer; const Value: string); virtual; abstract;

Description

Descendants of TWebResponse implement SetStringVariable to provide a method by which string values are written to the internal table used to store HTTP header variables. The response object uses SetStringVariable to set the properties that represent strings.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject


TReflectorWindow

Hierarchy	Properties	Methods

TReflectorWindow ensures that ActiveX controls respond properly to Windows messages.

Unit

Axctrls

Description

TReflectorWindow is for internal use only. Applications should never instantiate this class. It is used to reflect certain messages to an ActiveX control.


TReflectorWindow properties

TReflectorWindow	Alphabetically	Legend

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TReflectorWindow properties

TReflectorWindow	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentWindow

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TReflectorWindow methods

TReflectorWindow	Alphabetically

In TReflectorWindow

Create

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TReflectorWindow methods

TReflectorWindow	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TReflectorWindow.Create

TReflectorWindow	See also

Creates an instance of TReflectorWindow.

constructor Create(ParentWindow: HWND; Control: TControl); reintroduce;

Description

Applications never have to instantiate TReflectorWindow.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


EnumDispatchProperties procedure

See also

Fills a TStringList will all the property names and DispIDs in a specified IDispatch interface.

Unit

AxCtrls

Category

COM utilities

procedure EnumDispatchProperties(Dispatch: IDispatch; PropType: TGUID; VTCode: Integer; PropList: TStrings);

Description

Use EnumDispatchProperties to get the names of the properties supported by an IDispatch interface. The Dispatch parameter is an instance of the IDispatch interface. The PropType and VTCode parameters allow the caller to limit the list to only those properties that match a particular GUID and type identifier. To see all properties of the IDispatch interface, set PropType to GUID_NULL and VTCode to VT_EMPTY.

The property names that the IDispatch interface supports are added to the list passed in as the PropList parameter.


GetDispatchPropValue function

See also

Returns the value of a property on an IDispatch interface.

Unit

AxCtrls

Category

COM utilities

function GetDispatchPropValue(Disp: IDispatch; DispID: Integer): OleVariant;

Description

Call GetDispatchPropValue to read the value of the property with the dispatch ID specified by DispID from the IDispatch interface given by Disp.


GetOleFont procedure

See also

Creates an OLE font object that is directly mapped to a native TFont.

Unit

AXCtrls

Category

COM utilities

procedure GetOleFont(Font: TFont; var OleFont: IFontDisp);

Description

OLE conventions implement fonts as automation objects that contain the properties of the font.  This routine creates an adapter object that maps the properties of a TFont object into an OLE font object, thereby allowing an OLE client to access the font properties of a VCL control. Call this function when you implement a method that retrieves a TFont value from a VCL object and returns it as an OLE font.

The Font parameter is a pointer to the native TFont. This can be the Font property of a VCL control.  The OLE font is returned in the OleFont parameter. The resulting OLE font object is a direct connection to the native VCL font, so changing the OLE font's properties will change the TFont's properties, and vice-versa.


GetOlePicture procedure

See also

Creates an OLE picture object that is directly mapped to a native TPicture.

Unit

AXCtrls

Category

COM utilities

procedure GetOlePicture(Picture: TPicture; var OlePicture: IPicture);

Description

OLE conventions implement pictures as automation objects that contain the properties of the picture.  This routine creates an adapter object that maps the properties of a native VCL TPicture into an OLE picture object, thereby allowing an OLE client to access the picture properties of a VCL control. Call this function when you implement a method that retrieves a TPicture value from a VCL object and returns it as an OLE picture.

The Picture parameter is a pointer to the native TPicture. This can be the Picture property of a VCL control.  The OLE picture is returned in the OlePicture parameter. The resulting OLE picture object is a direct connection to the native VCL picture, so changing the OLE picture's properties will change the TPicture's properties, and vice-versa.


GetOleStrings procedure

See also

Implements a TStrings object as an IStrings interface for use by OLE objects.

Unit

AXCtrls

Category

COM utilities

procedure GetOleStrings(Strings: TStrings; var OleStrings: IStrings);

Description

When the GetOleStrings function is called, the Strings parameter is implemented as an IStrings and assigned to the TStrings.StringsAdapter property. The IString interface is returned as the OleStrings parameter.


ParkingWindow function

See also

Provides a temporary parent window for activeX controls when the container is not ready to act as a parent.

Unit

AxCtrls

Category

COM utilities

function ParkingWindow: HWND;

Description

Call ParkingWindow to get the window handle of the parking window. This can be used as a temporary parent to activeX controls until the host application’s container is ready.


SetDispatchPropValue procedure

See also

Sets the value of a property on an IDispatch interface.

Unit

AxCtrls

Category

COM utilities

procedure SetDispatchPropValue(Disp: IDispatch; DispID: Integer; const Value: OleVariant);

Description

Call SetDispatchPropValue to assign the value specified by the Value parameter to the specified property of the IDispatch interface given by the Disp parameter. The DispID parameter gives the dispatch ID of the property to set.


SetOleFont procedure

See also

Connects an OLE font object to a TFont object and copies the properties of the OLE font object to the TFont.

Unit

AXCtrls

Category

COM utilities

procedure SetOleFont(Font: TFont; OleFont: IFontDisp);

Description

OLE conventions implement fonts as automation objects that contain the properties of the font.  This routine associates an OLE font object (the OleFont parameter) with a native VCL font (the Font parameter), allowing the font to be accessed by both OLE programs and VCL programs.  The TFont object is initialized to have the same properties as OleFont.

Call this method when you implement an automation method that takes an OLE font as a parameter, and which needs to pass the font along as a native TFont object.


SetOlePicture procedure

See also

Connects an OLE picture object to a TPicture object, and copies the properties of the OLE picture object to the TPicture.

Unit

AXCtrls

Category

COM utilities

procedure SetOlePicture(Picture: TPicture; OlePicture: IPictureDisp);

Description

OLE conventions implement pictures as automation objects that contain the properties of the picture.  This routine associates an OLE picture object (the OlePicture parameter) with a native VCL picture (the Picture parameter), allowing the picture to be accessed by both OLE programs and VCL programs.  The TPicture object is initialized to have the same properties as OlePicture.

Call this method when you implement an automation method that takes an OLE picture as a parameter, and which needs to pass the picture along as a native TPicture object.


SetOleStrings procedure

See also

Uses an IStrings interface to assign the contents of a TStrings object.

Unit

AXCtrls

Category

COM utilities

procedure SetOleStrings(Strings: TStrings; OleStrings: IStrings);

Description

Use SetOleStrings to update a TStrings object so that it matches the strings supplied by an IStrings interface. The Strings parameter is the TStrings object to update. The OleStrings parameter is the interface used as a source.


CheckToolMenuDropdown procedure

See also

Displays a tool button’s dropdown menu.

Unit

ComCtrls

Category

Windows controls utilities

procedure CheckToolMenuDropdown(ToolButton: TToolButton);

Description

Call CheckToolMenuDropdown to programmatically display the dropdown menu for a tool button of style tbsDropDown.  If the tool button has no associated dropdown menu, CheckToolMenuDropDown does nothing.

Note:	CheckToolMenuDropDown is included for backward compatibility. Applications should use the tool button’s CheckMenuDropDown method instead.


GetComCtlVersion function

See also

Indicates which version of ComCtl32.dll is installed.

Unit

ComCtrls

Category

Windows controls utilities

function GetComCtlVersion: Integer;

Description

The appearance and behavior of some common controls, such as tool bars and cool bars, varies depending on which version of ComCtl32.dll is installed. Use GetComCtlVersion to determine which version is installed.  GetComCtlVersion returns an integer that includes the major version number as the high-order word and the minor version number as the low-order word.

Installing Microsoft’s Internet Explorer on a system affects which version of ComCtl32.dll is installed. To help determine which version of Internet Explorer is installed, the ComCtrls unit defines several constants:

Constant	Value	Meaning

ComCtlVersionIE3	$00040046	The version of ComCtl32.dll installed with Internet Explorer version 3.

ComCtlVersionIE4	$00040047	The version of ComCtl32.dll installed with Internet Explorer version 4.

ComCtlVersionIE401	$00040048	The version of ComCtl32.dll installed with Internet Explorer version 4.01.

ComCtlVersionIE5	$00050050	The version of ComCtl32.dll installed with Internet Explorer version 5.

To quickly determine which version of Internet Explorer is installed, you can compare the return value of GetComCtlVersion with these constants. For example:

if GetComCtlVersion >= ComCtlVersionIE4 then { IE4 is installed }


InitCommonControl function

See also

Wraps the API routine, InitCommonControlsEx, which registers common control classes from ComCtl32.dll.

Unit

ComCtrls

Category

Windows controls utilities

function InitCommonControl(CC: Integer): Boolean;

Description

InitCommonControl wraps both the current Windows API routine, InitCommonControlsEx, and its obsolete predecessor, InitCommonControls. It calls the newer function if available; otherwise it calls the older InitCommonControls function.

The routine passes the address of an InitCommonControlsEx structure that contains information specifying which control classes will be registered.


ClassIDToProgID function

See also

Returns the programmatic ID for a specified class given its class ID (CLSID).

Unit

ComObj

Category

COM utilities

function ClassIDToProgID(const ClassID: TGUID): string;

Description

ClassIDToProgID retrieves the programmatic ID for the CLSID specified by the ClassID parameter.

If ClassIDToProgID succeeds, it returns a string that specifies the requested ProgID. If ClassIDToProgID fails an EOleSysError exception is raised with an error code indicating the cause of the error. The possible error codes are as follows:

Error code	Meaning

REGDB_E_CLASSNOTREG	Class not registered in the registry.

REGDB_E_READREGDB	Error reading registry.


CoInitFlags variable

See also

Specifies the level of threading support requested for a COM server .EXE.

Unit

ComObj

Category

COM utilities

var CoInitFlags: Integer = -1;

Description

CoInitFlags controls the way COM is intialized for threading support. This variable only affects executables (.EXEs), not in-process servers (.DLLs and .OCXs).

Typically, code to initialize the level of threading support is added automatically by the wizard that creates the COM object in your application. In applications containing multiple COM objects, COM is initialized for the highest level of support, where single threading is lowest and free threading is highest. To manually set the level of COM threading support, assign a value to CoInitFlags in the program’s main source file before the call to Application.Initialize.

The following table lists the constants (defined in the activeX unit) that can be or’ed together to create a value for CoInitFlags.

Constant	Value	Meaning

COINIT_MULTITHREADED	0	COM calls objects on any thread (free threading)

COINIT_APARTMENTTHREADED	2	Each object has its own thread (apartment model)

COINIT_DISABLE_OLE1DDE	4	Don't use DDE for Ole1 support.

COINIT_SPEED_OVER_MEMORY	8	 Optimize for speed rather than memory.

The value of CoInitFlags is –1 for single threading.


ComClassManager function

See also

Returns a TComClassManager object.

Unit

ComObj

Category

COM utilities

function ComClassManager: TComClassManager;

Description

Use ComClassManager to obtain a reference to the global COM class manager. This COM class manager manages the class factory objects owned by COM servers.


CreateClassID function

See also

CreateClassID generates a new GUID and returns it as a string.

Unit

ComObj

Category

COM utilities

function CreateClassID: string;

Description

Use CreateClassID to create a new GUID and access it as a string. A demo of the CreateClassID function is available in the Demos area.


CreateComObject function

See also

Instantiates a single instance of a COM object.

Unit

ComObj

Category

COM utilities

function CreateComObject(const ClassID: TGUID): IUnknown;

Description

CreateComObject creates a single uninitialized object of the class associated with the CLSID specified by the ClassID parameter. CreateComObject is used to create an object of a specified type when the CLSID is known, and when the object is on a local or in-proc server.

CreateComObject is called once to create each new single instance of a class. To create multiple instance of the same class it is recommended to use a class factory.

CreateComObject returns a reference to the interface to be used to communicate with the object. For CreateComObject this interface is of type IUnknown. To create OLE objects that return references to the IDispatch interface, use CreateOleObject.


CreateOleObject function

See also

Instantiates a single instance of an Automation object.

Unit

ComObj

Category

COM utilities

function CreateOleObject(const ClassName: string): IDispatch;

Description

CreateOleObject creates a single uninitialized object of the class specified by the ClassName parameter.  ClassName specifies the string representation of the Class ID (CLSID). CreateOleObject is used to create an object of a specified type when the CLSID is known, and when the object is on a local or in-proc server. Only objects that are not part of an aggregate are created using CreateOleObject.

CreateOleObject is called once to create each new single instance of a class. To create multiple instance of the same class, using a class factory is recommended.

CreateOleObject returns a reference to the interface that can be used to communicate with the object. For CreateOleObject this interface is of type IDispatch. To create a COM object that does not support an IDispatch interface, use CreateComObject.


CreateRegKey procedure

See also

Creates or opens a registry key that is a subkey of HKEY_CLASSES_ROOT.

Unit

ComObj

Category

COM utilities

procedure CreateRegKey(const Key, ValueName, Value: string);

Description

CreateRegKey creates or opens the key specified by the Key parameter. If the key does not already exist in the registry, CreateRegKey creates it, otherwise CreateRegKey opens it. This is useful for implementing the UpdateRegistry method of a class factory.

Key specifies a null-terminated string, which cannot be NULL and cannot begin with the backslash character ('\'). It must be a subkey of HKEY_CLASSES_ROOT.

When the key is created, additional value and type information for the specified key can be set from the parameters passed to CreateRegKey.

ValueName points to a null-terminated string that specifies the name of the subkey associated with value. This parameter can be nilNULL or an empty string.

Value specifies the data to be stored with the specified value name.

If CreateRegKey is not successful, an EOleRegistrationError exception is raised.


CreateRemoteComObject function

See also

Creates a Com object on another machine and returns an IUnknown interface for it.

Unit

ComObj

Category

COM utilities

function CreateRemoteComObject(const MachineName: WideString; const ClassID: TGUID): IUnknown;

Description

Use CreateRemoteComObject to create an object on a remote server. CreateRemoteComObject creates a single uninitialized object of the class associated with the CLSID specified by the ClassID parameter. The MachineName parameter specifies the machine that lists the ClassID in its type library.

Usually, MachineName is the UNC name of the machine, which can be obtained by looking up its Machine Name under the Network settings in the Windows control panel. However, under some configurations of COM, MachineName is the IP address or Host name of the remote system.

CreateRemoteComObject returns a reference to the IUnknown interface for the object. Use this interface to obtain information about other interfaces supported by the object.


DeleteRegKey procedure

See also

Deletes a single key that is a subkey of HKEY_CLASSES_ROOT from the system registry.

Unit

ComObj

Category

COM utilities

procedure DeleteRegKey(const Key: string);

Description

Use DeleteRegKey to update the system registry. This is useful for implementing the UpdateRegistry method of a class factory.

DeleteRegKey deletes the subkey of HKEY_CLASSES_ROOT that is passed in as the Key parameter. Key must specify a null-terminated string, which is the name of the key to delete. It cannot be NULL. The Key to delete must not have subkeys.

If DeleteRegKey succeeds it removes the entire specified key from the registry, including all of its values. An exception is raised if it fails.


GetActiveOleObject function

See also

Retrieves a reference to an IDispatch interface to a currently running, registered COM object.

Unit

ComObj

Category

COM utilities

function GetActiveOleObject(const ClassName: string): IDispatch;

Description

GetActiveOleObject returns a reference to the IDispatch interface of the active object for the given class indicated by ClassName. ClassName is the programmatic ID for the class of the active object from the OLE running object table. GetActiveOleObject is used to access the OLE running object table. To add an object to this table, use the RegisterActiveObject API.

If either the the class object or the IDispatch interface are not successfully returned, an EOleSysError exception is raised.


GetRegStringValue function

See also

Retrieves a value stored under a subkey of HKEY_CLASSES_ROOT from the system registry.

Unit

ComObj

Category

COM utilities

function GetRegStringValue(const Key, ValueName: string): string;

Description

GetRegStringValue returns the value specified by the ValueName property that is stored under the key specified by Key. Key must be a subkey of HKEY_CLASSES_ROOT. If there is no such value stored in the system registry, GetRegStringValue returns an empty string.


GUIDToString function

See also

Converts a class identifier GUID to a string.

Unit

ComObj

Category

COM utilities

function GUIDToString(const ClassID: TGUID): string;

Description

GUIDToString converts a GUID into a string of printable characters. Each GUID always converts to a unique string.

If GUIDToString succeeds it returns a string for the requested GUID. If GUIDToString fails, an EOleSysError exception is raised with an error code indicating the cause of the error.


InterfaceConnect procedure

See also

Connects an IConnectionPoint interface.

Unit

ComObj

Category

COM utilities

procedure InterfaceConnect(const Source: IUnknown; const IID: TIID; const Sink: IUnknown; var Connection: Longint);

Description

InterfaceConnect is a wrapper for obtaining an IConnectionPointContainer from a COM server advising on a particular connection point. The IConnectionPointContainer and IConnectionPoint interfaces comprise the standard ActiveX event-handling mechanism.

IConnectionPoint allows you to expose an outgoing pointer to an object, typically an event sink. IConnectionPointContainer enumerates the connection points supported by an object, so that a caller can find the right connection point. When an event occurs, you use a connection between the event source, which calls the interface that handles events of that type, and the event sink, which implements the interface. The sink implements the member functions for a set of events.

At design time, the host enumerates the set of events an object can trigger by inspecting the type information for the object's event set. To allow users of ActiveX Designers to write event handlers, the host can check the parameters of the events, and from them create a stub event handler for the user to fill in.

For property changes, ActiveX Designers implement a standard sink interface called IPropertyNotifySink.

A demo containing this procedure resides in Demos/ActiveX directory.

For more details on event handling, see the Microsoft Developer’s Network documentation.


InterfaceDisconnect procedure

See also

Disconnects an IConnectionPoint interface connection that was previously made by the InterfaceConnect procedure.

Unit

ComObj

Category

COM utilities

procedure InterfaceDisconnect(const Source: IUnknown; const IID: TIID;

Description

InterfaceDisconnect disconnects an IConnectionPoint interface connection that was previously made by the InterfaceConnect procedure. These procedures are wrappers for the ActiveX event-handling mechanism, the IConnectionPointContainer and IConnectionPoint interfaces.

A demo containing this procedure resides in Demos/ActiveX directory.

For more details on event handling, see the Microsoft Developer’s Network documentation.


OleCheck procedure

See also	Example

Throws an EOleSysError exception if the result code indicates an error.

Unit

ComObj

Category

COM utilities

procedure OleCheck(ECode: HResult);

Description

OleCheck is used to wrap many COM routines, so that if that routine fails, users will have an opportunity to handle it in the resulting exception that is raised.

If ECode is a value less than zero, OleCheck raises an EOleSysError exception that specifies the error code.


OleError procedure

See also

Raises an EOleSysError exception.

Unit

ComObj

Category

COM utilities

procedure OleError(ErrorCode: HResult);

Description

OleError raises an EOleSysError exception from an error code passed in as the ErrorCode parameter.

OleError is used internally to catch failed function calls by throwing an EOleSysError exception that indicates the cause of the failure as an error code. Unlike the OleCheck procedure, which checks its parameter to determine whether it represents an error, OleError always raises an exception.


ProgIDToClassID function

See also

Returns the class ID (CLSID) TGUID that corresponds to the string specified as the ProgID parameter.

Unit

ComObj

Category

COM utilities

function ProgIDToClassID(const ProgID: string): TGUID;

Description

ProgIDToClassID retrieves, from the registry, the CLSID for a given programmatic ID. The ProgID parameter specifies the programmatic ID for which the CLSID is requested. A programmatic ID is a string that is associated with the CLSID in the registry.

If ProgIDToClassID succeeds it returns the requested CLSID. If ProgIDToClassID fails an EOleSysError exception is raised with an error code indicating the cause of the error. The error code possibilities are as follows:

Error code	Meaning

CO_E_CLASSSTRING	The registered CLSID for the ProgID is invalid.

REGDB_E_WRITEREGDB	An error occurred writing the CLSID to the registry.

Note:	If the ProgID cannot be found in the registry, ProgIDToClassID creates an OLE 1 CLSID for the ProgID and a CLSID entry in the registry.


RegisterComServer procedure

Registers an in-process COM server with the operating system.

Unit

ComObj

Category

COM utilities

procedure RegisterComServer(const DLLName: string);

Description

COM servers are always registered as dynamic link libraries, DLLs. The DLLName parameter specifies the name of the DLL that implements the COM controls.


RegisterAsService procedure

See also

Registers a COM object as an NT service.

Unit

ComObj

Category

COM utilities

procedure RegisterAsService(const ClassID, ServiceName: string);

Description

Use RegisterAsService to register a service given a classID. ClassID specifies the classID of the COM object that implements the service. ServiceName specifies the name under which the object is registered.


StringToGUID function

See also

Converts a string to a GUID.

Unit

ComObj

Category

COM utilities

function StringToGUID(const S: string): TGUID;

Description

StringToGUID converts the string representation of a GUID, S, into the original CLSID.

If StringToGUID succeeds it returns the requested CLSID. If StringToGUID fails an EOleSysError exception is raised with an error code indicating the cause of the error.


ComServer variable

Provides class and registry information about server objects.

Unit

Comserv

Category

COM utilities

var ComServer: TComServer;

Description

ComServ declares an instance of COM server. By default, when the ComServ unit is included in a project, Delphi constructs a COM server object and assigns it to ComServ. ComServ has several properties and methods that provide class and registry information about the objects loaded on the server. See TComServer object for a list of properties and methods.


DLLCanUnloadNow function

See also

Tells Windows whether it can unload the in-process server exporting this function.

Unit

Comserv

Category

COM utilities

function DllCanUnloadNow: HResult; stdcall;

Description

Do not call DllCanUnloadNow directly. DllCanUnloadNow is exported by ActiveX servers (DLLs) and is called by the Ole engine to indicate whether the server can be unloaded from memory because it is no longer in use. A DLL is no longer in use when it is not managing any existing objects (the reference count on all of its objects is 0).

The return values for DllCanUnloadNow are as follows:

Value	Meaning

S_OK	The DLL can be unloaded.

S_FALSE	The DLL cannot be unloaded now.

Note:	DllCanUnloadNow is one of four functions in the ComServ unit that every in-process ActiveX server must export so that Windows can manage the server resources properly. The others are DllGetClassObject, DllRegisterServer, and DllUnregisterServer.


DllGetClassObject function

See also

Obtains a class factory for an ActiveX object when the ActiveX object resides in an in-process ActiveX server (DLL).

Unit

Comserv

Category

COM utilities

function DllGetClassObject(const CLSID, IID: TGUID; var Obj): HResult; stdcall;

Description

Do not call DllGetClassObject directly.  DllGetClassObject is exported by all ActiveX server DLLs, and it is called internally by the OLE engine. When a user calls CoGetClassObject (or CoCreateInstance, which internally calls CoGetClassObject) to obtain a class factory for an ActiveX object, the OLE engine loads the ActiveX server DLL into memory and calls its DllGetClassObject function.

The parameters to DllGetClassObject are:

CLSID is the class identifier for the ActiveX object to be created by the class factory.

IID is the interface indentifier for the interface through which the caller will communicate with the class factory object to create instances of the object referenced by CLSID. This parameter is nearly always IID_IClassFactory or IID_IClassFactory2.

Obj will hold a pointer to the resulting class factory interface upon successful completion of the function.  If an error occurs, Obj will be set to nil.

The return values for DLLGetClassObject are as follows:

Value	Meaning

S_OK	The object was retrieved successfully.

E_NOINTERFACE	The object referenced by Obj doesn't support the interface passed in the IID parameter.

CLASS_E_CLASSNOTAVAILABLE	The DLL does not support the class type referenced by the CLSID parameter.

Note:	DllGetClassObject is one of four functions in the ComServ unit that every in-process server must export so that Windows can manage the server resources properly. The others are DllCanUnloadNow, DllRegisterServer, and DllUnregisterServer.


DllRegisterServer function

See also

Registers an in-process ActiveX server in the current module within the system registry.

Unit

Comserv

Category

COM utilities

function DllRegisterServer: HResult; stdcall;

Description

Do not call DllRegisterServer directly. DllRegisterServer is exported by in-process ActiveX servers (DLLs) and instructs the DLL to create its registry entries for the type library and all classes supported in that server module. DLLRegisterServer is usually called when the ActiveX server is installed on a user's system.

If this function fails, the state of the registry for its type library and its classes is indeterminate.

The return values for DllRegisterServer are as follows:

Value	Meaning

S_OK	The registry entries were created successfully.

E_FAIL	The registry entries were not completed.

Note:	DllRegisterServer is one of four functions in the ComServ unit that every in-process server must export so that Windows can manage the server resources properly. The others are DllCanUnloadNow, DllGetClassObject, and DllUnregisterServer.


DllUnregisterServer function

See also

Unregisters an OLE automation server in the current module with the system registry.

Unit

Comserv

Category

COM utilities

function DllUnregisterServer: HResult; stdcall;

Description

Do not call DllUnregisterServer directly. DllUnregisterServer is exported by in-process automation servers (DLLs) and instructs the DLL to remove entries created through DllRegisterServer. DLLRegisterServer is called when a server is uninstalled.

The return values for DllUnregisterServer are as follows:

Value	Meaning

S_OK	The registry entries were successfully removed.

S_FALSE	Some or all registry entries were not removed.

Note:	DllUnregisterServer is one of four functions in the ComServ unit that every in-process server must export so that Windows can manage the server resources properly. The others are DllCanUnloadNow, DllGetClassObject, and DllRegisterServer. It should never be necessary for users to directly call or alter any of these functions.


HtmlTable function

See also

Generates the HTML image of a dataset, using the properties and events of a table producer object.

Unit

Dbweb

Category

miscellaneous routines

function HtmlTable(DataSet: TDataSet; DataSetHandler: TDSTableProducer; MaxRows: Integer): string;

Description

Call HtmlTable to obtain a sequence of HTML commands that describe a dataset in tabular format. The DataSet parameter indicates the dataset whose records are converted into an HTML image. The DataSetHandler parameter is the table producer whose properties describe the attributes of the resulting image and whose event handlers respond to events that occur during the generation of the image. The MaxRows parameter is the maximum number of records from the dataset that will appear in the image.

Calling HtmlTable is equivalent to calling the Content method of the DataSetHandler parameter after setting its DataSet and MaxRows properties to the values given for the parameters of the same names.


DosPathToUnixPath function

See also

Converts a DOS-compatible path specification to a Unix-compatible path specification.

Unit

Httpapp

function DosPathToUnixPath(const Path: string): string;

Description

Use DosPathToUnixPath to convert a path name on the local machine to a path name that can be sent in an HTTP message, or that will be used by a Unix-based application. DosPathToUnixPath converts all backslash characters (\) to forward slashes (/).

The Path parameter is the Dos-compatible path. The return value is the corresponding Unix-compatible path.


ExtractHTTPFields procedure

See also

Parses a multi-valued string into its constituent fields.

Unit

Httpapp

Category

HTTP utilities

procedure ExtractHTTPFields(Separators, WhiteSpace: TSysCharSet; Content: PChar; Strings: TStrings; StripQuotes:Boolean=False);

Description

ExtractHTTPFields is a general utility to parse multi-valued HTTP header strings into separate substrings.

Separators is a set of characters that are used to separate individual values within the multi-valued string.

WhiteSpace is a set of characters that are to be ignored when parsing the string.

Content is the multi-valued string to be parsed.

Strings is the TStrings object that receives the individual values that are parsed from Content.

StripQuotes determines whether the surrounding quotes are removed from the resulting items. When StripQuotes is True, surrounding quotes are removed before substrings are added to Strings.

Note:	Characters contained in Separators or WhiteSpace are treated as part of a value substring if the substring is surrounded by single or double quote marks. HTTP escape characters are converted using the HTTPDecode function.


HTTPDecode function

See also

Decodes a string that includes HTTP escape characters.

Unit

Httpapp

Category

HTTP utilities

function HTTPDecode(const AStr: string): string;

Description

HTTPDecode decodes the escape characters (+ and %) in a string that comes from an HTTP message header. Plus characters (+) are converted into spaces. Percent signs (%) indicate that the next two characters are the hex representation of a character. If a percent sign is followed by another percent sign (%%), it is converted into a single percent sign.

For example, the string

%%+%3f

is converted into

% ?

The AStr parameter is the undecoded string. The return value is the converted version of the string.


HTTPEncode function

See also

Converts a string into a form that contains no values that are illegal in an HTTP message header.

Unit

Httpapp

Category

HTTP utilities

function HTTPEncode(const AStr: String): string;

Description

HTTPEncode converts all characters in the AStr parameter except for the letters A through Z (and a through z), numerals 0 through 9, the asterisk (*), dollar sign ($), exclamation point (!), at sign (@), period (.), underscore (_), single quote (‘), comma (,) parentheses, and hyphen (-). Spaces are converted to plus characters (+), and all other characters are converted into hex values preceded by the percent sign (%).

For example, the string

% ?

is converted into

%%+%3f

HTTPEncode returns the converted string.


ParseDate function

See also

Converts a date value from an HTTP message header into a TDateTime value.

Unit

Httpapp

Category

HTTP utilities

function ParseDate(const DateStr: string): TDateTime;

Description

HTTP message headers permit several formats for the representation of date and time values. ParseDate converts from any of these formats into a TDateTime value. ParseDate allows server applications to work with date values taken from HTTP request messages, without worrying about the details of how they are formatted.

Use ParseDate when interpreting temporal header values in HTTP request messages when they are not already parsed as a property of TWebRequest. TWebRequest parses the Date header and Expires header automatically.


StatusString function

See also

Returns the explanatory string associated with one of the predefined HTTP response status codes.

Unit

Httpapp

Category

HTTP utilities

function StatusString(StatusCode: Integer): string;

Description

The HTTP protocol specification defines a number of standard status codes that indicate the status of an HTTP request message. HTTP applications interpret these status codes, but for human beings, each of these codes has a corresponding string that provides a more understandable indication of the status of the HTTP request.

Call StatusString to obtain the string that corresponds to a standard status code. If the StatusCode parameter is not one of the codes defined in the HTTP standard, StatusString returns an empty string.


UnixPathToDosPath function

See also

Converts a Unix-compatible path specification to a Dos-compatible path specification.

Unit

Httpapp

Category

HTTP utilities

function UnixPathToDosPath(const Path: string): string;

Description

Use UnixPathToDosPath to convert a path name obtained from an HTTP message or other Unix-based application to a path name that can be used by Windows. UnixPathToDosPath converts all forward slashes (/) to backslash characters (\).

The Path parameter is the Unix-compatible path. The return value is the corresponding Dos-compatible path.


GetExtensionVersion function

See also

Returns the name and version number of an ISAPI or NSAPI application.

Unit

Isapiapp

Category

HTTP utilities

function GetExtensionVersion(var Ver: THSE_VERSION_INFO): BOOL;

Description

Do not call GetExtensionVersion. ISAPI and NSAPI DLLs export GetExtension to provide an entry point that is called by ISAPI or NSAPI Web servers. This allows the Web server to obtain version information about the web server application.


HTTPExtensionProc function

See also

Receives an HTTP request message for an ISAPI or NSAPI application.

Unit

Isapiapp

Category

HTTP utilities

function HttpExtensionProc(var ECB: TEXTENSION_CONTROL_BLOCK): DWORD;

Description

Do not call HttpExtensionProc. ISAPI and NSAPI DLLs export HttpExtensionProc to provide an entry point that is called by ISAPI or NSAPI Web servers when they receive HTTP request messages.


TerminateExtension function

See also

Indicates whether an ISAPI or NSAPI application is ready to be shut down.

Unit

Isapiapp

function TerminateExtension(dwFlags: DWORD): BOOL;

Description

Do not call TerminateExtension. TerminateExtension is exported by ISAPI and NSAPI DLLs. It provides an entry point that is called by ISAPI or NSAPI Web servers, when they are ready to shut down the ISAPI or NSAPI application, to check whether it would cause problems to do so.


MatchesMask function

See also

Indicates whether a file name conforms to the format specified by a filter string.

Unit

Masks

Category

file name utilities

function MatchesMask(const Filename, Mask: string): Boolean;

Description

Call MatchesMask to check the Filename parameter using the Mask parameter to describe valid values. A valid mask consists of literal characters, sets, and wildcards.

Each literal character must match a single character in the string. The comparison to literal characters is case-insensitive.

Each set begins with an opening bracket ([) and ends with a closing bracket (]). Between the brackets are the elements of the set. Each element is a literal character or a range. Ranges are specified by an initial value, a dash (-), and a final value. Do not use spaces or commas to separate the elements of the set. A set must match a single character in the string. The character matches the set if it is the same as one of the literal characters in the set, or if it is in one of the ranges in the set. A character is in a range if it matches the initial value, the final value, or falls between the two values. All comparisons are case-insensitive. If the first character after the opening bracket of a set is an exclamation point (!), then the set matches any character that is not in the set.

Wildcards are asterisks (*) or question marks (?). An asterisk matches any number of characters. A question mark matches a single arbitrary character.

MatchesMask returns True if the string matches the mask. MatchesMask returns false if the string does not match the mask. MatchesMask raises an exception if the mask is syntactically invalid.

Note:	The Filename parameter does not need to be a file name. MatchesMask can be used to check strings against any syntactically correct mask.


SetErrorProc function

See also

Replaces the exception handler for error messages that are received from a Windows socket connection.

Unit

ScktComp

Category

exception handling routines

type TSocketErrorProc = procedure(ErrorCode: Integer);

function SetErrorProc(ErrorProc: TSocketErrorProc): TSocketErrorProc;

Description

Call SetErrorProc to assign an exception handler for error messages from Windows socket API calls. By default, socket components have no special error handler and simply raise an ESocketError exception when they receive error messages. If an exception handler is assigned using SetErrorProc, the socket component does not raise this exception.

The ErrorProc parameter specifies the exception handler. It is passed the Windows socket error code. Inside this exception handler an application can compensate for the error or raise an exception. Passing a value of nil for the ErrorProc parameter restores the default behavior, where the socket component raises an ESocketError exception.

SetErrorProc returns the current exception handler. This value is nil when SetErrorProc is called for the first time, and is the value of the ErrorProc parameter from the previous invocation of SetErrorProc thereafter.


Application variable (for service applications)

Represents a service application for a service project.

Unit

SvcMgr

Category

service applications

var Application: TServiceApplication;

Description

By default, when a new service application project is created, Delphi constructs an application object and assigns it to Application. If the project represents a service application, Application is initialized to a TServiceApplication object.


Application variable (for Web server applications)

See also

Represents a web server application for an internet project.

Unit

Webbroker

Category

HTTP utilities

var Application: TWebApplication;

Description

By default, when a new internet server project is created, Delphi constructs an application object and assigns it to Application. If the project represents a CGI or Win-CGI server application, Application is initialized to a TCGIApplication object. If the project represents an ISAPI or NSAPI server application, Application is initialized to a TISAPIApplication object. Which type of TWebApplication object gets created depends on whether the project includes the ISAPIApp unit or the CGIApp unit.


TServiceApplication

Hierarchy	Properties	Methods	See also

TServiceApplication encapsulates a Windows NT service application.

Unit

SvcMgr

Description

TServiceApplication encapsulates a Windows NT application type known as a service. TServiceApplication provides the fundamental behavior of this type of application. Each Service project automatically declares an Application variable of type TServiceApplication as the instance of the application. The Application variable is added to a project by selecting File | New from the menu of the IDE main window and selecting Service Application in the New Items dialog.

TServiceApplication contains TService objects, each of which encapsulates a Windows NT service. The service application object provides methods to create service objects and to install, register, dispatch, and uninstall services.

When the service application is run using the /INSTALL switch, it registers the services it contains. When run using the /UNINSTALL switch, it unregisters its services. Unless the application is run with the /SILENT switch, the service application shows a confirmation message after successfully installing or uninstalling its services.

Note: Do not add the Forms or HttpApp units to the uses list of the project, because those units declare conflicting Application variables of types TApplication and TWebApplication, respectively.


TServiceApplication properties

TServiceApplication	Alphabetically	Legend

In TServiceApplication

ServiceCount

Title

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TServiceApplication properties

TServiceApplication	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

ServiceCount

Tag

Title

VCLComObject


TServiceApplication.ServiceCount

TServiceApplication	See also

Indicates the number of services in the service application.

property ServiceCount: Integer;

Description

ServiceCount is the number of services in the service application. Each service is encapsulated by a TService instance and has its own dedicated service thread.


TServiceApplication.Title

TServiceApplication

Indicates the name of the title application.

property Title: string;

Description

Title is the name of the service application. This text string appears below the icon of the application when it is minimized.


TServiceApplication methods

TServiceApplication	Alphabetically

In TServiceApplication

Create

CreateForm

Destroy

Initialize

Run

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TServiceApplication methods

TServiceApplication	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateForm

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

Initialize

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

Run

SafeCallException

UpdateAction


TServiceApplication.Create

TServiceApplication

Instantiates a TServiceApplication object.

constructor Create(AOwner: TComponent); override;

Description

Applications do not need to call the constructor directly. TServiceApplication is instantiated by selecting File | New from the menu of the IDE main window and selecting Service Application in the New Items dialog. An Application variable of type TServiceApplication is declared and initialized as the instance of the application.


TServiceApplication.CreateForm

TServiceApplication

Creates the service object or objects for the service application.

procedure CreateForm(InstanceClass: TComponentClass; var Reference); virtual;

Description

Do not call CreateForm in an application. Delphi’s module manager calls CreateForm internally to register the service objects of the service application.

CreateForm instantiates a TService object for each service contained in the service application. CreateForm is called automatically, for the first service, when the service application is first created. Subsequently, CreateForm is called for each new service added to the application. To add a new service, select File | New from the menu of the IDE main window and choose Service in the New Items dialog.


TServiceApplication.Destroy

TServiceApplicationSee also

Disposes of an instance of a TServiceApplication object.

destructor Destroy; override;

Description

You do not need to call the destructor directly. TServiceApplication is destroyed when your application closes.

The destructor frees the memory associated with sub-objects.


TServiceApplication.Initialize

TServiceApplication

Sets the initial state of the application and hides any associated MainForm.

procedure Initialize; virtual;

Description

Initialize sets the initial state of the application to hide any main form that may be associated with the application. Service applications are rarely interactive and do not typically have a form associated with them. If a form has been added to the application, Initialize hides it on start. Initialize then follows the standard (default) VCL application initialization process.


TServiceApplication.Run

TServiceApplication

Installs, registers, and adds services to its component list, and creates a thread for the service application.

procedure Run; virtual;

Description

Run handles installing and uninstalling services, depending on the command line switches. When the service application is run using the /INSTALL switch, it registers the services it contains. When run using the /UNINSTALL switch, it unregisters its services. Unless the application is run with the /SILENT switch, the service application shows a confirmation message after successfully installing or uninstalling its services.

If not called with the /INSTALL or /UNINATALL switch, Run creates a service application thread that responds to Windows messages from clients. Note that this thread is for the application and differs from the dedicated TServiceThread instances associated with individual services in the application.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


TService

Hierarchy	Properties	Methods	Events	See also

TService encapsulates a Windows NT service.

Unit

SvcMgr

Description

TService encapsulates a Windows NT service in an NT service application. A Win32 service is accessed via the Service Control Manager and can be started automatically at system boot, by a user through the Services control panel applet, or by a Win32-based application that uses the service functions. Services can execute even when no user is logged on to the system. Windows NT also supports a driver service that does not interact with the SCM.


TService properties

TService	Alphabetically	Legend

In TService

AllowPause

AllowStop

Dependencies

DisplayName

ErrCode

ErrorSeverity

Interactive

LoadGroup

Param

ParamCount

Password

ServiceStartName

ServiceThread

ServiceType

StartType

Status

TagID

Terminated

WaitHint

Win32ErrCode

Derived from TDataModule

DesignOffset

DesignSize

OldCreateOrder

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TService properties

TService	By object	Legend

AllowPause

AllowStop

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Dependencies

DesignInfo

DesignOffset

DesignSize

DisplayName

ErrCode

ErrorSeverity

Interactive

LoadGroup

Name

OldCreateOrder

Owner

Param

ParamCount

Password

ServiceStartName

ServiceThread

ServiceType

StartType

Status

Tag

TagID

Terminated

VCLComObject

WaitHint

Win32ErrCode


TService.AllowPause

TService	See also

Indicates whether clients are allowed to pause the service.

property AllowPause: Boolean;

Description

AllowPause indicates whether clients of the service can pause and resume the service by calling the Windows API ControlService function. When AllowPause is True, an OnPause event occurs before the service pauses, and an OnContinue event occurs when the service resumes.


TService.AllowStop

TService	See also

Indicates whether clients are allowed to stop the service.

property AllowStop: Boolean;

Description

AllowStop indicates whether clients of the service can stop it by calling the Windows API ControlService function. When AllowStop is True, an OnStop event occurs before the service stops.


TService.Dependencies

TService	See also

Lists the services or load ordering groups on which the service depends.

property Dependencies: TDependencies;

Description

Dependencies is a container for TDependency objects, which are dependent services or load ordering groups that must start before this service. If the container is empty, the service has no dependencies.

Dependency on a service means that this service can only run if the service it depends on is running. Dependency on a group means that this service can run if at least one member of the group is running after an attempt to start all members of the group.


TService.DisplayName

TService	See also

Identifies the service in the Windows Service Control Manager.

property DisplayName: String;

Description

DisplayName contains a string, with a maximum length of 256 characters, that is the name of the service as displayed in the Service Control Manager. User interface programs use DisplayName to identify the service. DisplayName is case-preserved in the Service Control Manager, however display name comparisons are always case-insensitive.

Note: A dependency can be a service. If this is true, do not confuse the various name-related properties of dependency and service objects. For more information, see Service name properties.


TService.ErrCode

TService	See also

Contains the service specific error code returned on starting or stopping the service.

property ErrCode: DWord;

Description

ErrCode specifies a service specific error code that the service returns when an error occurs while the service is starting or stopping. If ErrCode is not defined, the Win32ErrCode property is used instead.


TService.ErrorSeverity

TService	See also

Indicates the severity of service startup failure.

type  TErrorSeverity = (esIgnore, esNormal, esSevere, esCritical);

property ErrorSeverity: TErrorSeverity ;

Description

ErrorSeverity indicates the severity if this service fails to start during startup of the service application. The possibilities of this type is listed in the following table:

Value	Meaning

esIgnore	the startup program logs the error but continues

esNormal	the startup program logs the error and displays a message, but continues

esSevere	the startup program logs the error but only continues if the last-known-good configuration is being started; otherwise the last-known-good configuration is started instead

esCritical	the startup program logs the error and starts up the last-known-good configuration instead. If this is the last-known-good configuration, the startup operation fails.


TService.Interactive

TService	See also

Indicates whether the service is interactive with the Windows desktop.

property Interactive: Boolean;

Description

Interactive indicates whether the service can interact with the Windows desktop. Interactive only has an effect when ServiceType is stWin32. For more information about creating interactive NT services, see the Microsoft Help.


TService.LoadGroup

TService	See also

Names of the load ordering group that includes the service.

property LoadGroup: String;

Description

LoadGroup is the name of the load-ordering group that includes the service. This is used by other services that have dependencies on the load ordering group (See Dependencies). The registry lists load-ordering groups at HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ServiceGroupOrder. The order in which services are loaded depends on the order of the load groups in the Registry and the dependencies listed in service Dependencies properties.

Because services and service groups share the same name space, the SC_GROUP_IDENTIFIER character must prefix group names to distinguish them from service names. This is automatically prefixed if the TDependency’s IsGroup property is True.

Note: A dependency can be a service. If this is true, do not confuse the various name-related properties of dependency and service objects. For more information, see Service name properties.


TService.Param

TService	See also

Lists the parameters to the service.

property Param[Index: Integer]: String;

Description

Param is an indexed property that contains the parameters to the service. These parameters are typed into the Startup Parameters input window in the Service Control Manager.


TService.ParamCount

TService	See also

Indicates the number of startup parameters for the service.

property ParamCount: Integer;

Description

ParamCount is the number of parameters for the service. These parameters are typed into the Startup Parameters input window in the Service Control Manager.


TService.Password

TService	See also

Specifies the password, optionally used depending upon the ServiceStartName, for accessing the service.

property Password: String;

Description

Password is the password for the account name specified by the ServiceStartName property if the ServiceType is stWin32.

If Password is nil or if it points to an empty string, the service has no password. If ServiceType is stDevice or stFileSystem, this parameter is ignored.


TService.ServiceStartName

TService	See also

ServiceStartName is the name used in the Service Control Manager Startup dialog to start the service.

property ServiceStartName: String;

Description

ServiceStartName is the name used to start the service.

If ServiceType is stWin32, ServiceStartName is the account name (in the form "DomainName\Username") which the service process is logged on as when it runs. If the account belongs to the built-in domain, ".\Username" can be specified. If the service application includes more than one service, leave ServiceStartName blank, and leave the Password property blank.

If the service type is not stWin32, ServiceStartName is the driver object name (\FileSytems\Rdr or \Driver\Xns) which the input and output system uses to load the device driver. With device drivers or file systems drivers, you can leave ServiceStartName blank and the I/O system will create a default name based on the service name.

Note: A dependency can be a service. If this is true, do not confuse the various name-related properties of dependency and service objects. For more information, see Service name properties.


TService.ServiceThread

TService	See also

Identifies the dedicated thread for the service.

property ServiceThread: TServiceThread;

Description

ServiceThread is the instance of the TServiceThread class that is the dedicated thread for the service. Each service in the service application has a dedicated thread that contains a loop in its Execute method for processing service requests. Often a service will spawn a new thread, derived from TThread, to free the service thread to continue processing service requests.


TService.ServiceType

TService	See also

Identifies the type of the service as Win32, device driver, or file system driver.

type TServiceType = (stWin32, stDevice, stFileSystem);

property ServiceType: TServiceType;

Description

ServiceType indicates the type of service. ServiceType can be stWin32 (a Win32 service – the default), stDevice (a device driver), or stFileSystem (a file system driver).


TService.StartType

TService

Indicates when or how the service starts.

type TStartType = (stBoot, stSystem, stAuto, stManual, stDisabled);

property StartType: TStartType;

Description

StartType specifies how and why the service starts. The following table lists the possible values of TStartType:

StartType value	Service is started

stBoot	by the operating system loader
(used only when ServiceType is not stWin32)

stSystem	after boot systems are initialized
(used only when ServiceType is not stWin32)

stAuto	automatically during system startup

stManual	when a process calls the Windows StartService function

stDisabled	the service can’t be started except by an administrator


TService.Status

TService	See also

Indicates the current state of the service.

type

TCurrentStatus = (csStopped, csStartPending, csStopPending, csRunning, csContinuePending, csPausePending, csPaused);

property Status: TCurrentStatus;

Description

Status indicates the current state of the service. The status information is displayed in the Service Control Manager. Status can be specified as one of the following values:

Value	Meaning

csStopped	The service is not running.

csStartPending	The service is starting.

csStopPending	The service is stopping.

csRunning	The service is running.

csContinuePending	The service continue is pending.

csPausePending	The service pause is pending.

csPaused	The service is paused


TService.TagID

TService	See also

Specifies a unique tag for the service within its LoadGroup.

property TagID: DWord;

Description

TagID is the unique tag value for this service in its LoadGroup. If no tag is requested, this property is 0. Tags are only evaluated when the ServiceType is not stWin32 and the StartType is stBoot or stSystem.


TService.Terminated

TService	See also

Indicates whether the service thread has terminated.

property Terminated: Boolean;

Description

Terminated indicates whether the dedicated thread that the service is running in has terminated.


TService.WaitHint

TService	See also

Specifies the estimated time, in milliseconds, between a call from the Windows Service Control Manager and the service reporting its status.

property WaitHint: Integer;

Description

WaitHint specifies the amount of time, in milliseconds, that can elapse between a pending start, stop, pause, or continue operation and the service setting its status with a call to the Windows API. Normally this is handled automatically. If the service performs a lengthy operation of more than WaitHint time in one of its event handlers, you should call ReportStatus method to update to the Service Control Manager.


TService.Win32ErrCode

TService	See also

Indicates the Win32 error code reported by the service if a service specific code is not defined.

property Win32ErrCode: DWord;

Description

Win32ErrCode specifies a Win32 error code that the service uses to report an error that occurs when it is starting or stopping. If an error code specific to the service is defined, this property is automatically set to ERROR_SERVICE_SPECIFIC_ERROR and the service specific error is reported instead.


TService events

TService	Alphabetically	Legend

In TService

AfterInstall

AfterUninstall

BeforeInstall

BeforeUninstall

OnContinue

OnExecute

OnPause

OnShutdown

OnStart

OnStop

Derived from TDataModule

OnCreate

OnDestroy


TService events

TService	By object	Legend

AfterInstall

AfterUninstall

BeforeInstall

BeforeUninstall

OnContinue

OnCreate

OnDestroy

OnExecute

OnPause

OnShutdown

OnStart

OnStop


TService.AfterInstall

TService	See also

Occurs immediately after the service is registered with the Windows Service Control manager.

property AfterInstall: TServiceEvent;

Description

Write an AfterInstall event handler to take specific action immediately after the service is registered. Install services by running the service application with the INSTALL switch.


TService.AfterUninstall

TService	See also

Occurs immediately after the service is removed from the Service Control manager’s database.

property AfterUninstall: TServiceEvent;

Description

Write an AfterUninstall event handler to take specific action immediately after the service is removed. Uninstall services by running the service application with the UNINSTALL switch.


TService.BeforeInstall

TService	See also

Occurs before the service is first registered with the Windows Service Control manager.

property BeforeInstall: TServiceEvent;

Description

Write a BeforeInstall event handler to take specific action immediately before the service is first registered.  Install services by running the service application with the INSTALL switch.


TService.BeforeUninstall

TService	See also

Occurs immediately before the service is removed from the Service Control manager’s database.

property BeforeUninstall: TServiceEvent;

Description

Write a BeforeUninstall event handler to take specific action immediately before the service is removed. Uninstall services by running the service application with the UNINSTALL switch.


TService.OnContinue

TService	See also

Occurs when the Service Control manager resumes the service after it has been paused.

type

  TContinueEvent = procedure(Sender: TService; var Continued: Boolean) of object;

property OnContinue: TContinueEvent;

Description

Write an OnContinue event handler to take specific action when the Service Control manager resumes the service after it has been paused. Set Continued to True when the service resumes.


TService.OnExecute

TService	See also

Occurs when the thread associated with the service starts up.

property OnExecute: TServiceEvent;

Description

If you are not spawning a new thread to handle individual service requests in an OnStart event handler, this is where you implement the service. When the OnExecute event handler finishes, the service thread terminates. Most OnExecute event handlers contain a loop that calls the service thread’s ProcessRequests method so that other service requests are not locked out.


TService.OnPause

TService	See also

Occurs when the Service Control manager pauses the service temporarily.

type

  TPauseEvent = procedure(Sender: TService; var Paused: Boolean) of object;

property OnPause: TPauseEvent;

Description

Write an OnPause event handler to take specific action when the service is temporarily paused. Set Paused to True if you have paused the service.


TService.OnShutdown

TService	See also

Occurs when the system running the service application is about to shut down.

property OnShutdown: TServiceEvent;

Description

Write an OnShutdown event handler to take specific action just before the service shuts down. The service application terminates immediately after OnShutDown.


TService.OnStart

TService	See also

OnStartup occurs when the service first starts up, before the OnExecute event.

type

  TStartEvent = procedure(Sender: TService; var Started: Boolean) of object;

property OnStart: TStartEvent;

Description

This event should be used to initialize the service. For example, if each service request is handled in a separate thread (a good idea if handling the request takes much time) the thread for a request is spawned in an OnStart event handler. Set Started to True if you have started the service.


TService.OnStop

TService	See also

Occurs when the Service Control manager stops the service.

type

  TStopEvent = procedure(Sender: TService; var Stopped: Boolean) of object;

property OnStop: TStopEvent;

Description

Write an OnStop event handler to take specific action when the service stops. Set Stopped to True if you have stopped the service.


TService methods

TService	Alphabetically	Legend

In TService

CreateNew

Destroy

GetServiceController

LogMessage

ReportStatus

Derived from TDataModule

AfterConstruction

BeforeDestruction

Create

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TService methods

TService	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateNew

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetServiceController

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

LogMessage

MethodAddress

MethodName

NewInstance

RemoveComponent

ReportStatus

SafeCallException

UpdateAction


TService.CreateNew

TService	See also

Instantiates and initializes a TService object.

constructor CreateNew(AOwner: TComponent; Dummy: Integer = 0); override;

Description

Call CreateNew to instantiate a service object at runtime. Services added at design time are created automatically. The AOwner parameter specifies the TServiceApplication object that is responsible for ultimately freeing the service.The Dummy parameter is not used. Use CreateNew rather than the Create constructor to instantiate a new service object at runtime. CreateNew does not attempt to stream in an associated DFM file that indicates any components added to the service at design time.

CreateNew instantiates a TService object and initializes the following properties:

Property	Value

WaitHint	5000

Interactive	False

ServiceType	stWin32

ErrorSeverity	esNormal

StartType	stAuto

TagID	0

AllowStop	True

AllowPause	True

Create also creates an empty string list of Params and a collection of Dependencies (a single TDependencies object).  These are used for the Params and Dependencies properties.

Some of these values initialized in the constructor are passed as parameters to the Windows API CreateService function.


TService.Destroy

TService	See also

Disposes of a TService instance.

destructor Destroy; override;

Description

Destroy frees the memory associated with the objects for the Params and Dependencies properties that were created in the constructor, and for the EventLogger object created in the LogMessage method. Then it calls the inherited Destroy.


TService.GetServiceController

TService

Returns the service’s registered handler function.

type TServiceController = procedure(CtrlCode: DWord); stdcall;

function GetServiceController: PServiceController; virtual; abstract;

Description

GetServiceController returns the handler for the service. You do not need to call this function directly. The service object’s main function calls it automatically.

Note: Each service in the service application has a main function for that service. When a request is made to start the service, the main thread of the service calls the RegisterServiceCtrlHandler function to register this control handler function. TService automatically calls RegisterServiceCtrlHandler and returns this handler function. Because this function cannot be a class method (member function), the Service application wizard generates code that creates a non-member handler, (ServiceController) for your service object. This routine returns the service object’s Handler (Controller).


TService.LogMessage

TService

Sends an error message to the event log.

procedure LogMessage(Message: String; EventType: DWord = 1; Category: Integer = 0; ID: Integer = 0);

Description

LogMessage sends an error message to the event log when an error or exception occurs. By default the EventType is EVENTLOG_ERROR_TYPE (usually indicating a loss of functionality or data) and the category and ID are zero. For example, if a service cannot be loaded as the system boots, it can log an error event, and the category and ID are zero.

The EventType specifies the type of event being logged. This parameter can be one of the following values:

Value	Meaning

EVENTLOG_ERROR_TYPE	Error event

EVENTLOG_WARNING_TYPE	Warning event

EVENTLOG_INFORMATION_TYPE	Information event

EVENTLOG_AUDIT_SUCCESS 	Success Audit event

EVENTLOG_AUDIT_FAILURE	Failure Audit event

The Category parameter specifies the event category, which is source-specific information and can have any value.

The ID parameter specifies the event identifier, which is the message that goes with this event as an entry in the message file associated with the event source.


TService.ReportStatus

TService	See also

Updates the Service Control Manager's status information for the calling service.

procedure ReportStatus;

Description

ReportStatus sends current status information about the calling service the Service Control Manager.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataModule


TServiceThread

Hierarchy	Properties	Methods	Events	See also

TServiceThread represents the thread associated with a specific service (TService object).

Unit

SvcMgr

Description

TServiceThread is the thread associated with a service. Each service application has one or more service objects, each of which has its own dedicated thread. TServiceThread instances represent those threads.

Note: TServiceThread has an Execute method that contains a loop so that service requests do not get locked out. The default procedure calls ProcessRequests after a service request has finished executing. For more information about optimizing service execution by spawning individual threads for each service request, see Service threads.


TServiceThread properties

TServiceThread	Alphabetically	Legend

Derived from TThread

FreeOnTerminate

Handle

Priority

Suspended

ThreadID


TServiceThread properties

TServiceThread	By object	Legend

FreeOnTerminate

Handle

Priority

Suspended

ThreadID


TServiceThread events

TServiceThread	Alphabetically

Derived from TThread

OnTerminate


TServiceThread events

TServiceThread	By object

OnTerminate


TServiceThread methods

TServiceThread	Alphabetically	Legend

In TServiceThread

Create

ProcessRequests

Derived from TThread

Destroy

Resume

Suspend

Terminate

WaitFor

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TServiceThread methods

TServiceThread	By object	Legend

AfterConstruction

BeforeDestruction

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

FreeInstance

Free

GetInterfaceEntry

GetInterfaceTable

GetInterface

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ProcessRequests

Resume

SafeCallException

Suspend

Terminate

WaitFor


TServiceThread.Create

TServiceThread	Methods	See also

Instantiates and initializes a TServiceThread object.

constructor Create(Service: TService);

Description

Applications do not need to call the constructor directly. Instances of TService create the TServiceThread object on startup. The Service parameter is the TService instance for which the TServiceThread is the dedicated thread.

The constructor sets the FreeOnTerminate property to True and then calls the base class constructor so that the thread object is created with its Suspended property set to False.


TServiceThread.ProcessRequests

TServiceThread	Methods	See also

Allows clients to invoke the service associated with the service thread.

procedure ProcessRequests(WaitForMessage: Boolean);

Description

TServiceThread’s ProcessRequests is called in the Execute method after any associated service’s OnExecute event handler has finished executing. For more information about optimizing service execution by spawning individual threads for each service request, see the Developer’s Guide.

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TThread


TSimpleEvent

Hierarchy	Properties	Methods	See also

TSimpleEvent represents an unnamed manual event object.

Unit

syncobjs

Description

Use TSimpleEvent to coordinate between threads that all have access to the same simple event object. TSimpleEvent can also be used in a single-threaded application to coordinate sections of code that respond to different asynchronous events such as Windows messages or user actions.

Because TSimpleEvent represents an unnamed event object, a single TSimpleEvent object must be within the scope of all code that uses it. To coordinate with code that is out of scope, or with other applications, use a named TEvent object.


TSimpleEvent properties

TSimpleEvent	Alphabetically	Legend

Derived from THandleObject

Handle

LastError


TSimpleEvent properties

TSimpleEvent	By object	Legend

Handle

LastError


TSimpleEvent methods

TSimpleEvent	Alphabetically

In TSimpleEvent

Create

Derived from TEvent

ResetEvent

SetEvent

WaitFor

Derived from THandleObject

Destroy

Derived from TSynchroObject

Acquire

Release

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TSimpleEvent methods

TSimpleEvent	By object

Acquire

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Release

ResetEvent

SafeCallException

SetEvent

WaitFor


TSimpleEvent.Create

TSimpleEvent	See also

Creates a Windows event object and instantiates a TSimpleEvent object to represent that event.

constructor Create;

Description

Call Create to create a TSimpleEvent object. Create creates a manual, unnamed Windows event object. The event starts out in an unset state.

The Handle property is initialized to the Windows handle for the event object.


Accessibility

Read-only


Hierarchy

TObject

TSynchroObject

THandleObject

TEvent


TServerClientThread

Hierarchy	Properties	Methods	Events	See also

TServerClientThread is an execution thread used for a single connection to a client socket accepted by a Windows server socket.

Unit

scktcomp

Description

TServerWinSocket objects spawn TServerClientThread objects to handle separate client connections in separate execution threads. This allows server sockets to perform slow reading and writing operations with client sockets without adversely affecting the performance on other connections.

TServerClientThread introduces new properties to

Access the TServerWinSocket object that spawned the thread and the TServerClientWinSocket that is connected to the client socket.

Store and access thread-specific data.

Determine if the thread is stored in a thread cache maintained by the TServerWinSocket.

Applications that receive frequent client requests will want to derive a descendant class from TServerClientThread to handle reading and writing to separate clients. This is because TServerClientThread objects use the OnClientRead and OnClientWrite events of the associated server socket. These events are not thread-local.


TServerClientThread properties

TServerClientThread	Alphabetically	Legend

In TServerClientThread

ClientSocket

Data

KeepInCache

ServerSocket

Derived from TThread

FreeOnTerminate

Handle

Priority

Suspended

ThreadID


TServerClientThread properties

TServerClientThread	By object	Legend

ClientSocket

Data

FreeOnTerminate

Handle

KeepInCache

Priority

ServerSocket

Suspended

ThreadID


TServerClientThread.ClientSocket

TServerClientThread	See also 	Example

Specifies the TServerClientWinSocket object that uses the thread for all reading and writing over the socket connection.

property ClientSocket: TServerClientWinSocket;

Description

Use ClientSocket to gain direct access to the Windows socket component that uses the thread. If ClientSocket is nil, the thread is idle and available for re-use by another TServerClientWinSocket object. TServerClientThread uses ClientSocket to read from or write to the socket connection.


TServerClientThread.Data

TServerClientThread	See also

Points to application-specific data associated with the thread.

property Data: Pointer;

Description

Use Data to associate information with the thread object. Data can store information in a thread-safe manner that would otherwise require the use of global variables.


TServerClientThread.KeepInCache

TServerClientThread	See also

Determines whether the thread should be kept in the thread cache maintained by ServerSocket.

property KeepInCache: Boolean;

Description

The TServerWinSocket that spawns server client threads for its connections to client sockets maintains a cache of server client threads for re-use. As server client threads are activated, the TServerWinSocket object sets the KeepInCache property to indicate whether the thread will fit in the thread cache.

When KeepInCache is True, FreeOnTerminate is set to False before the thread terminates, and the thread is left in the thread cache. When KeepInCache is False, the thread is freed when execution terminates.


TServerClientThread.ServerSocket

TServerClientThread	See also

Specifies the TServerWinSocket object that manages all the TServerClientThread objects for its client connections.

property ServerSocket: TServerWinSocket;

Description

Use ServerSocket to get direct access to the listening Windows socket object that spawned the thread for a client connection it accepted. TServerClientThread passes events and errors to the appropriate event handlers assigned to ServerSocket. TServerClientThread adds itself to the cache of threads maintained by ServerSocket from its constructor, and removes itself when the thread terminates.


TServerClientThread events

TServerClientThread	Alphabetically

Derived from TThread

OnTerminate


TServerClientThread events

TServerClientThread	By object

OnTerminate


TServerClientThread methods

TServerClientThread	Alphabetically 	Legend

In TServerClientThread

ClientExecute

Create

Destroy

DoTerminate

EndConnect

Error

Event

Execute

HandleException

Reactivate

StartConnect

Derived from TThread

Resume

Suspend

Terminate

WaitFor

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TServerClientThread methods

TServerClientThread	By object 	Legend

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientExecute

Create

DefaultHandler

Destroy

Dispatch

DoTerminate

EndConnect

Error

Event

Execute

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

HandleException

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Reactivate

Resume

SafeCallException

StartConnect

Suspend

Terminate

WaitFor


TServerClientThread.ClientExecute

TServerClientThread	See also 	Example

Simulates OnClientRead and OnClientWrite events for the associated server socket.

procedure ClientExecute; virtual;

Description

TServerClientThread calls ClientExecute from its Execute method. ClientExecute checks whether there is any information to read from the associated socket connection, and if so, simulates an OnClientRead event on the associated server socket. If there is no information sent from the client, ClientExecute simulates an OnClientWrite event.

Because the server socket that receives these events is not local to the thread, the events occur within the main VCL thread using the Synchronize method. This method can be too slow if the server socket has many client connections, because each thread must wait for any other thread to finish reading or writing. When a server socket receives many client connection requests, override ClientExecute to handle the reading or writing using a thread-local instance of TWinSocketStream. In the ClientExecute method, be sure to check the Terminated property periodically.

Note:	Do not use the properties and methods of global objects directly in the ClientExecute method.  Instead, separate the use of objects that are not thread-local into a separate procedure call, and call that procedure by passing it as a parameter to the Synchronize method.


TServerClientThread.Create

TServerClientThread	See also

Creates an instance of TServerClientThread.

constructor Create(CreateSuspended: Boolean; ASocket: TServerClientWinSocket);

Description

Use Create to create an instance of TServerClientThread for a connection to a client socket, and add the thread to the cache maintained by the associated listening socket.

Initializes FreeOnTerminate to True.

Initializes Priority to tpHigher.

Initializes ClientSocket to the ASocket parameter and ServerSocket to ASocket.ServerWinSocket.

Starts the thread executing.

Adds the thread to the cache maintained by ServerSocket.

Sets the OnErrorEvent and OnSocketEvent event handlers of ClientSocket so that events are sent to ServerSocket.

Signals when initialization is complete and the thread is ready for reading from or writing to the client connection.


TServerClientThread.Destroy

TServerClientThread	See also

Destroys the server client thread object and releases the memory allocated to it.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. ServerClientThread objects are freed by the TServerWinSocket object that manages them.

Destroy frees the TServerClientWinSocket object that encapsulates the connection to the client socket before calling the inherited destructor.


TServerClientThread.DoTerminate

TThread	See also

Removes the thread from the list of active threads maintained by the associated server socket.

procedure DoTerminate; override;

Description

DoTerminate overrides the inherited method to suppress the OnTerminate event. Instead, it removes the thread from the Connections property of the associated TServerWinSocket. The thread is then either added to the server socket’s thread cache or destroyed.


TServerClientThread.EndConnect

TThread	See also

Indicates whether the thread should execute again for another client.

function EndConnect: Boolean;

Description

The Execute method calls EndConnect when the ClientExecute method finishes. It frees all memory associated with the current client connection and checks whether the Thread is being reused for another client connection. If the thread should be reused, EndConnect returns True to indicate that the ClientExecute method should be called again.


TServerClientThread.Error

TThread	See also

Generates an OnClientError event for the associated server socket.

TErrorEvent = (eeGeneral, eeSend, eeReceive, eeConnect, eeDisconnect, eeAccept);

procedure Error(ErrorEvent: TErrorEvent; var ErrorCode: Integer); virtual;

Description

TServerClientThread assigns the Error method as an event handler for the OnErrorEvent method of the associated TClientWinSocket object. This allows errors received from the client to generate OnClientError events on the server socket.

Warning:	Error is not thread-safe. It should not be called from the server client thread. It is only intended for use by the associated client socket, which is not local to the server client thread.


TServerClientThread.Event

TThread	See also

Generates an OnClientEvent event for the associated server socket.

procedure Event(SocketEvent: TSocketEvent); virtual;

Description

TServerClientThread assigns the Event method as an event handler for the OnSocketEvent method of the associated TClientWinSocket object. This allows events generated by the client to trigger client events on the server socket.

Warning:	Event is not thread-safe. It should not be called from the server client thread. It is only intended for use by the associated client socket, which is not local to the server client thread.


TServerClientThread.Execute

TServerClientThread	See also

Manages the caching of server client threads and calls the ClientExecute method to run the thread for individual client connections.

procedure Execute; override;

Description

Execute is called automatically when the thread runs. A thread runs when Create is called if CreateSuspended set to False, or when Resume is first called after the thread is created if CreateSuspended set to True.

Do not override the Execute method to implement the thread function of a TServerClientThread descendant. Instead, override the ClientExecute method, which is run after the thread is initialized for a particular client connection.


TServerClientThread.HandleException

TServerClientThread	See also 	Example

Displays an error message using the main VCL thread.

procedure HandleException; virtual;

Description

HandleException obtains the current exception object and calls TApplication.ShowException (for descendants of Exception) or the global ShowException procedure (for other objects) to display an error message. HandleException wraps the call to ShowException in the Synchronize method to ensure that the call is thread-safe.


TServerClientThread.Reactivate

TServerClientThread	See also

Initializes the thread for a particular client connection.

procedure ReActivate(ASocket: TServerClientWinSocket);

Description

Reactivate is called when the thread is created or reactivated from the server socket’s cache of threads. It assigns the Error and Event methods as event handlers for the associated TServerWinSocket, and informs the server socket that the thread is now active.


TServerClientThread.StartConnect

TServerClientThread	See also

Indicates when the thread is ready to execute.

function StartConnect: Boolean;

Description

The Execute method calls StartConnect to determine when to call ClientExecute. StartConnect waits until the Reactivate method has signaled that the thread is properly initialized, and then returns True if the thread is ready to run. If the thread is terminated for any reason before it is fully initialized, StartConnect returns False.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TThread


TServerClientWinSocket

Hierarchy	Properties	Methods	Events	See also

TServerClientWinSocket describes the server endpoint of a socket connection to a client socket.

Unit

scktcomp

Description

TServerClientWinSocket is used by server socket components to manage the Windows socket API calls for the socket connection to an individual client socket. TServerClientWinSocket objects are created when a client socket connection is accepted by a listening server socket.

Applications can create and customize the properties of a TServerClientWinSocket object in an OnGetSocket event handler for a server socket component. Component writers can create descendants of TServerClientWinSocket that may be substituted for TServerClientWinSocket in the OnGetSocket event handler.


TServerClientWinSocket properties

TServerClientWinSocket	Alphabetically	Legend

In TServerClientWinSocket

ServerWinSocket

Derived from TCustomWinSocket

Addr

ASyncStyles

Connected

Data

Handle

LocalAddress

LocalHost

LocalPort

LookupState

RemoteAddr

RemoteAddress

RemoteHost

RemotePort

SocketHandle


TServerClientWinSocket properties

TServerClientWinSocket	By object	Legend

Addr

ASyncStyles

Connected

Data

Handle

LocalAddress

LocalHost

LocalPort

LookupState

RemoteAddr

RemoteAddress

RemoteHost

RemotePort

ServerWinSocket

SocketHandle


TServerClientWinSocket.ServerWinSocket

TServerClientWinSocket	See also

Describes the endpoint of the listening connection that accepted the connection to the client socket which is managed by this TServerClientWinSocket.

property ServerWinSocket: TServerWinSocket;

Description

Use ServerWinSocket to gain access to the Windows socket object for the listening connection that spawned this TServerClientWinSocket. Use the ServerWinSocket to trigger events that can be handled by the event handlers of the server socket, to get execution threads from the cache maintained by the Windows server socket, or to get information about the other active connections accepted by the server socket.


TServerClientWinSocket events

TServerClientWinSocket	Alphabetically

Derived from TCustomWinSocket

OnErrorEvent

OnSocketEvent


TServerClientWinSocket events

TServerClientWinSocket	By object

OnSocketEvent

OnErrorEvent


TServerClientWinSocket methods

TServerClientWinSocket	Alphabetically

In TServerClientWinSocket

Create

Destroy

Derived from TCustomWinSocket

Accept

Close

Connect

Disconnect

Listen

Lock

LookupName

LookupService

Open

Read

ReceiveBuf

ReceiveLength

ReceiveText

SendBuf

SendStream

SendStreamThenDrop

SendText

Unlock

Write

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TServerClientWinSocket methods

TServerClientWinSocket	By object

Accept

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Connect

Create

DefaultHandler

Destroy

Disconnect

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

Listen

Lock

LookupName

LookupService

MethodAddress

MethodName

NewInstance

Open

Read

ReceiveBuf

ReceiveLength

ReceiveText

SafeCallException

SendBuf

SendStream

SendStreamThenDrop

SendText

Unlock

Write


TServerClientWinSocket.Create

TServerClientWinSocket	See also

Creates and initializes an instance of TServerClientWinSocket.

constructor Create(Socket: TSocket; ServerWinSocket: TServerWinSocket);

Description

Use Create to create an instance of TServerClientWinSocket in the OnGetSocket event handler of a server socket component. The Socket parameter is the Windows socket handle for the accepted socket connection to a client socket. The ServerWinSocket parameter is the Windows socket object for the listening connection that accepted the connection to the client socket.

Create adds the new TServerClientWinSocket object to the list of connections maintained by the listening server socket. It then sets the OnSocketEvent event handler so that notifications from the connection to the client can be passed on to the server socket. After setting up the connection to the server socket, Create calls the inherited constructor.


TServerClientWinSocket.Destroy

TServerClientWinSocket	See also

Destroys an instance of TServerClientWinSocket.

destructor Destroy; override

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TServerClientWinSocket reference is not nil, and only then calls Destroy. Instances of TServerClientWinSocket are freed automatically when the connection is closed.

Destroy removes the TServerClientWinSocket from the list of connections maintained by the listening windows socket.


Accessibility

Read-only


Hierarchy

TObject

TCustomWinSocket


 TServerSocket

Hierarchy	Properties	Methods	Events	See also

TServerSocket manages server socket connections for a TCP/IP server.

Unit

scktcomp

Description

Add a TServerSocket object to a form or data module to turn an application into a TCP/IP server. TServerSocket listens for requests for TCP/IP connections from other machines, and establishes connections when requests are received.


TServerSocket properties

TServerSocket	Alphabetically	Legend

In TServerSocket

Socket

Derived from TCustomServerSocket

ServerType

ThreadCacheSize

Derived from TAbstractSocket

Active

Port

Service

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TServerSocket properties

TServerSocket	By object	Legend

Active

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Port

ServerType

Service

Socket

Tag

ThreadCacheSize

VCLComObject


TServerSocket.Socket

TServerSocket	See also	Example

Specifies the TServerWinSocket object that describes the endpoint of the listening connection.

property Socket: TServerWinSocket;

Description

Use Socket to obtain

Information about the connections currently active on the server socket.

Information about the connection threads that are cached for use by the server socket.

Access to the Windows socket handle for the listening connection that is needed for Windows socket API calls.


TServerSocket events

TServerSocket	Alphabetically	Legend

Derived from TCustomServerSocket

OnClientConnect

OnClientDisconnect

OnClientError

OnClientRead

OnClientWrite

OnGetSocket

OnGetThread

OnThreadEnd

OnThreadStart

Derived from TCustomSocket

OnAccept

OnListen


TServerSocket events

TServerSocket	By object	Legend

OnAccept

OnClientConnect

OnClientDisconnect

OnClientError

OnClientRead

OnClientWrite

OnGetSocket

OnGetThread

OnListen

OnThreadEnd

OnThreadStartTCustomServerSocket_OnThreadStart>Main


TServerSocket methods

TServerSocket	Alphabetically

In TServerSocket

Create

Derived from TCustomServerSocket

Destroy

Derived from TAbstractSocket

Close

Open

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TServerSocket methods

TServerSocket	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Open

RemoveComponent

SafeCallException

UpdateAction


TServerSocket.Create

TServerSocket	See also

Creates an instance of TServerSocket.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize a server socket component at runtime. TServerSocket objects placed at design time are created automatically.

After calling the inherited constructor, Create

Allocates the TServerWinSocket object that encapsulates the Windows socket connection for the server socket.

Initializes the event and error dispatchers for the server socket.

Initializes ThreadCacheSize to 10.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TAbstractSocket

TCustomSocket

TCustomServerSocket


TServerWinSocket

Hierarchy	Properties	Methods	Events	See also

TServerWinSocket describes the endpoint of a listening server socket connection.

Unit

scktcomp

Description

TServerWinSocket is used by server socket components to manage the Windows socket API calls for a TCP/IP listening connection. TServerWinSocket introduces new properties, events, and methods to manage multiple socket connections to different client sockets, and to generate or re-use TServerClientThread objects that allow each client connection to have its own execution thread.


TServerWinSocket properties

TServerWinSocket	Alphabetically	Legend

In TServerWinSocket

ActiveConnections

ActiveThreads

Connections

IdleThreads

ServerType

ThreadCacheSize

Derived from TCustomWinSocket

Addr

ASyncStyles

Connected

Data

Handle

LocalAddress

LocalHost

LocalPort

LookupState

RemoteAddr

RemoteAddress

RemoteHost

RemotePort

SocketHandle


TServerWinSocket properties

TServerWinSocket	By object	Legend

ActiveConnections

ActiveThreads

Addr

ASyncStyles

Connected

Connections

Data

Handle

IdleThreads

LocalAddress

LocalHost

LocalPort

LookupState

RemoteAddr

RemoteAddress

RemoteHost

RemotePort

ServerType

SocketHandle

ThreadCacheSize


TServerWinSocket.ActiveConnections

TServerWinSocket	See also

Indicates the number of connections to client sockets accepted by this listening socket that are currently open.

property ActiveConnections: Integer;

Description

Use ActiveConnections to monitor the use of the server socket. ActiveConnections is the number of entries in the Connections array.


TServerWinSocket.ActiveThreads

TServerWinSocket	See also

Indicates the number of TServerClientThread objects currently in use by the socket connections listed in the Connections array.

property ActiveThreads: Integer;

Description

Use ActiveThreads to monitor thread usage by the listening socket. If ActiveThreads is usually much higher than ThreadCacheSize, increasing ThreadCacheSize should improve performance. To determine whether ThreadCacheSize is too high, use the IdleThreads property.

When the ServerType property is stThreadBlocking, each client connection automatically spawns a thread which is added to the cache and counted by ActiveThreads.


TServerWinSocket.Connections

TServerWinSocket	See also	Example

Lists all TServerClientWinSocket objects that represent open socket connections to client sockets that were accepted by this listening socket.

property Connections[Index: Integer]: TCustomWinSocket;

Description

Use Connections with the ActiveConnections property to iterate over all open socket connections accepted by the listening socket. Each entry in the Connections array is a TServerClientWinSocket object, where an Index of 0 gives the first TServerClientWinSocket, an Index of 1 returns the second TServerClientWinSocket, and so on.

If ServerType is stThreadBlocking, the thread associated with each of the TServerClientWinSocket objects in the Connections array can be obtained using the GetClientThread method.


TServerWinSocket.IdleThreads

TServerWinSocket	See also

Indicates the number of unused TServerClientThread objects available in the cache.

property IdleThreads: Integer;

Description

Use IdleThreads to monitor thread cache usage by the listening socket. If IdleThreads often very high, the thread cache is tying up a lot of unused memory storing extra threads. Monitor the ActiveThreads property to determine an appropriate value for ThreadCacheSize.

When the ServerType property is stThreadBlocking, each client connection automatically spawns a thread which is added to the cache. As the threads in the cache complete their execution, they become available for re-use, and are counted by IdleThreads. When there are more active threads than ThreadCacheSize, the extra threads are freed when they finish execution instead.


TServerWinSocket.ServerType

TServerWinSocket	See also

Specifies whether each connection accepted by the server socket is non-blocking, or if it is automatically given a separate execution thread.

type TServerType = (stNonBlocking, stThreadBlocking);

property ServerType: TServerType;

Description

Set ServerType to stThreadBlocking to automatically spawn a new thread for each socket connection accepted by the listening socket connection. When ServerType is stThreadBlocking, the TServerClientThread object for a connection generates OnClientRead or OnClientWrite events when the server socket needs to read or write.

Set ServerType to stNonBlocking to handle all reading and writing over socket connections accepted by the listening socket asynchronously. When ServerType is stNonBlocking, all client connections are handled in a single execution thread by default. OnClientRead or OnClientWrite events occur when the server socket needs to attend to I/O over one of the connections.

Use a non-blocking socket when reading and writing must be synchronized with client sockets.

Note:	When ServerType is stThreadBlocking, it is important that the OnClient... event handlers contain thread-safe code.


TServerWinSocket.ThreadCacheSize

TServerWinSocket	See also

Indicates the number of TServerClientThread objects cached for re-use by new connections to client sockets.

property ThreadCacheSize: Integer;

Description

When ServerType is stThreadBlocking, each new connection that is accepted by the server socket is given a separate execution thread. In order to improve performance, server sockets store the these threads in a cache rather than freeing them when the connection is closed. New connections can then reuse threads from the cache, rather than requiring the socket server to create a new thread every time a connection is accepted.

Set ThreadCacheSize to specify the number of threads that are cached for re-use. The ideal value for ThreadCacheSize depends on the number and frequency of client socket requests received by the server socket. If ThreadCacheSize is too low, the server socket will spend more time freeing and creating threads when client connections are accepted. If ThreadCacheSize is too high, the server socket may unnecessarily lock up the memory for threads that are never reused.


TServerWinSocket events

TServerWinSocket	Alphabetically

In TServerWinSocket

OnClientConnect

OnClientDisconnect

OnClientError

OnClientRead

OnClientWrite

OnGetSocket

OnGetThread

OnThreadEnd

OnThreadStart

Derived from TCustomWinSocket

OnErrorEvent

OnSocketEvent


TServerWinSocket events

TServerWinSocket	By object

OnClientConnect

OnClientDisconnect

OnClientError

OnClientRead

OnClientWrite

OnErrorEvent

OnGetSocket

OnGetThread

OnSocketEvent

OnThreadEnd

OnThreadStart


TServerWinSocket.OnClientConnect

TServerWinSocket	See also

Occurs when a client socket completes a connection accepted by the listening socket.

property OnClientConnect: TSocketNotifyEvent;

Description

Write an OnClientConnect event handler to take specific action when a client socket completes the socket connection to a TServerClientWinSocket object. Depending on the service, this is the point when the socket should begin reading or writing.

The order of Windows server socket events leading up to OnClientConnect is as follows:

1	An OnSocketEvent event of type seListen occurs just before the Windows socket is opened for listening.

2	The listening Windows socket receives client requests in a listening queue. The listening socket accepts one of those requests, and receives a Windows socket handle for the new socket connection.

3	The listening socket generates an OnGetSocket event, passing in the Windows socket handle. If a TServerClientWinSocket object for the Windows socket handle was not created in the OnGetSocket event handler, the Windows socket creates one. The Windows socket continues to listen for other clients.

4	An OnSocketEvent event of type seAccept occurs, using the new TServerClientWinSocket object.

5	If ServerType is stThreadBlocking and no thread is available in the cache, an OnGetThread event occurs. If the OnGetThread event handler does not create a thread, the Windows socket object creates a TServerClientThread.

6	If ServerType is stThreadBlocking, an OnThreadStart event occurs as the thread begins execution.

7	The client completes the connection to the TServerClientWinSocket object and an OnClientConnect event occurs.

The Sender parameter is the TServerWinClient object that listens for client requests. The Socket parameter is the TServerClientWinSocket object that forms a connection to the client socket.

Note:	If ServerType is stThreadBlocking, make sure that all code in an OnClientConnect event handler is thread-safe. Use the GetClientThread method to access thread-specific information.

Note:	The OnClientConnect event handler for TServerWinSocket is also set when setting the OnClientConnect event handler of the associated TServerSocket.


TServerWinSocket.OnClientDisconnect

TServerWinSocket	See also

Occurs when one of the connections to a client socket is closed.

property OnClientDisconnect: TSocketNotifyEvent;

Description

Write an OnClientDisconnect event handler to take specific action when the connection to a client socket is ending. The termination of a client request does not close the listening socket. The listening connection remains open for accepting new client connection requests.

The TServerClientWinSocket object associated with the client connection is freed after OnClientDisconnect. If ServerType is stThreadBlocking, OnThreadEnd occurs after OnClientDisconnect.

The Sender parameter is the TServerWinClient object that received the client request. The Socket parameter is the TServerClientWinSocket object that is ending a connection with the client socket.

Note:	If ServerType is stThreadBlocking, make sure that all code in an OnClientDisconnect event handler is thread-safe.Use the GetClientThread method to access thread-specific information.

Note:	The OnClientDisconnect event handler for TServerWinSocket is also set when setting the OnClientDisconnect event handler of the associated TServerSocket.


TServerWinSocket.OnClientError

TServerWinSocket	See also

Occurs when a failure is encountered when establishing, using, or terminating the socket connection to an individual client socket.

property OnClientError: TSocketErrorEvent;

Description

Write an OnClientError event handler to respond to errors that arise with the connection to a client socket. Set the ErrorCode parameter to 0 if the OnClientError event handler successfully deals with the error condition, to prevent an ESocketError from being raised.

The Sender parameter is the TServerWinClient object that received the client request. The Socket parameter is the TServerClientWinSocket object that manages the connection to the client. The ErrorEvent parameter indicates what Socket was attempting to do when the error occurred. The ErrorCode parameter is the error code returned by the Windows socket API call.

Note:	If ServerType is stThreadBlocking, make sure that all code in an OnClientError event handler is thread-safe. Use the GetClientThread method to access thread-specific information.

Note:	The OnClientError event handler for TServerWinSocket is also set when setting the OnClientError event handler of the associated TServerSocket.


TServerWinSocket.OnClientRead

TServerWinSocket	See also

Occurs when the server socket should read information from a client socket.

property OnClientRead: TSocketNotifyEvent;

Description

Write an OnClientRead event handler to read from the socket connection. Use a TWinSocketStream object or the methods of the Socket parameter to do the reading.

The Sender parameter is the TServerWinClient object that received the client request. The Socket parameter is the TServerClientWinSocket object that encapsulates the Windows socket connection.

Note:	If ServerType is stThreadBlocking, make sure that all code in an OnClientRead event handler is thread-safe. Use the GetClientThread method to access thread-specific information.

Note:	The OnClientRead event handler for TServerWinSocket is also set when setting the OnClientRead event handler of the associated TServerSocket.


TServerWinSocket.OnClientWrite

TServerWinSocket	See also

Occurs when the server socket should write information to a client socket.

property OnClientWrite: TSocketNotifyEvent;

Description

Write an OnClientWrite event handler to write to the socket connection. Use a TWinSocketStream object or the methods of the Socket parameter to do the actual writing.

The Sender parameter is the TServerWinClient object that received the client request. The Socket parameter is the TServerClientWinSocket object that encapsulates the Windows socket connection.

Note:	If ServerType is stThreadBlocking, make sure that all code in an OnClientWrite event handler is thread-safe. Use the GetClientThread method to access thread-specific information.

Note:	The OnClientWrite event handler for TServerWinSocket is also set when setting the OnClientWrite event handler of the associated TServerSocket.


TServerWinSocket.OnGetSocket

TServerWinSocket	See also

Occurs when the server socket needs to create a new TServerClientWinSocket object to form the connection to a client socket.

type

TGetSocketEvent = procedure (Sender: TObject; Socket: TSocket; var ClientSocket: TServerClientWinSocket) of object;

property OnGetSocket: TGetSocketEvent;

Description

Write an OnGetSocket event handler to create a specialized TServerClientWinSocket object to use in the connection represented by the Socket parameter. Return the new TServerClientWinSocket object in the ClientSocket parameter.

The Sender parameter is the TServerWinSocket object that received the client request. The Socket parameter is the Windows socket handle for the socket connection to the client socket.

Note:	The OnGetSocket event handler for TServerWinSocket is also set when setting the OnGetSocket event handler of the associated TServerSocket.


TServerWinSocket.OnGetThread

TServerWinSocket	See also

Occurs when the server socket needs to create a new execution thread for a connection to a client socket.

type

TGetThreadEvent = procedure (Sender: TObject; ClientSocket: TServerClientWinSocket; var SocketThread: TServerClientThread) of object;

property OnGetThread: TGetThreadEvent;

Description

Write an OnGetThread event handler to create a specialized descendant of TServerClientThread for the connection to the client socket. Create the new thread with the CreateSuspended parameter set to False, and return it in the SocketThread parameter. OnGetThread only occurs if there are no idle threads in the cache.

Most applications that use thread-blocking connections will want to create a new descendant of TServerClientThread in an OnGetThread event handler. This is because the default behavior of TServerClientThread uses the OnClientRead and OnClientWrite event handlers for reading and writing. These events occur on the server socket, which is not thread-local.

The Sender parameter is the TServerWinSocket object that received the client request. The ClientSocket parameter is the TServerClientWinSocket object that will communicate with the client socket.

Note:	The OnGetThread event handler for TServerWinSocket is also set when setting the OnGetThread event handler of the associated TServerSocket.


TServerWinSocket.OnThreadEnd

TServerWinSocket	See also

Occurs when a client socket connection is terminated and the associated thread finishes execution.

type

TThreadNotifyEvent = procedure (Sender: TObject; Thread: TServerClientThread) of object;

property OnThreadEnd: TThreadNotifyEvent;

Description

Write an OnThreadEnd to take specific action when the thread for a client connection finishes execution. OnThreadEnd occurs after the OnClientDisconnect event.

The Sender parameter is the TServerWinSocket that received the client request. The Thread parameter is the thread that is finishing up.

Note:	The OnThreadEnd event handler for TServerWinSocket is also set when setting the OnThreadEnd event handler of the associated TServerSocket.


TServerWinSocket.OnThreadStart

TServerWinSocket	See also

Occurs when the execution thread for a connection to a client socket starts up.

type TThreadNotifyEvent = procedure (Sender: TObject; Thread: TServerClientThread) of object;

property OnThreadStart: TThreadNotifyEvent;

Description

Write an OnThreadStart to initialize the TServerClientThread for the connection to a single client socket. The Sender parameter is the TServerWinSocket that received the client request. The Thread parameter is the thread that is about to start execution.

Note:	The OnThreadStart event handler for TServerWinSocket is also set when setting the OnThreadStart event handler of the associated TServerSocket.


TServerWinSocket methods

TServerWinSocket	Alphabetically

In TServerWinSocket

Accept

Create

Destroy

Disconnect

GetClientThread

Listen

Derived from TCustomWinSocket

Close

Connect

Lock

LookupName

LookupService

Open

Read

ReceiveBuf

ReceiveLength

ReceiveText

SendBuf

SendStream

SendStreamThenDrop

SendText

Unlock

Write

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TServerWinSocket methods

TServerWinSocket	By object

Accept

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Connect

Create

DefaultHandler

Destroy

Disconnect

Dispatch

FieldAddress

Free

FreeInstance

GetClientThread

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

Listen

Lock

LookupName

LookupService

MethodAddress

MethodName

NewInstance

Open

Read

ReceiveBuf

ReceiveLength

ReceiveText

SafeCallException

SendBuf

SendStream

SendStreamThenDrop

SendText

Unlock

Write


TServerWinSocket.Accept

TServerWinSocket	See also

Accepts a connection to a client socket.

procedure Accept(Socket: TSocket); override;

Description

Accept is called automatically in response to notifications that a client socket is requesting a connection. The Socket parameter is the Windows socket handle for the listening connection.

Accept accepts the client connection request, obtaining the Windows socket handle for the client connection. It then generates an OnGetSocket event, passing this socket handle as an argument to any event handler. If a TServerClientWinSocket is not created by an OnGetSocket event handler, Accept creates a TServerClientWinSocket to represent the server endpoint of the accepted connection. Next, Accept obtains a running TServerClientThread, either by restarting a thread in the cache, obtaining one from an OnGetThread event, or creating a new TServerClientThread object. This new thread handles the connection to the client socket.

Accept is only called if the ASyncStyles property includes asAccept.


TServerWinSocket.Create

TServerWinSocket	See also

Creates an instance of TServerWinSocket from a Windows socket handle.

constructor Create(ASocket: TSocket);

Description

Call Create to create a Windows listening socket object. Windows listening socket objects are created automatically by the server socket component that uses them.

Create allocates the helper objects that manage the list of active client connections and the thread cache before calling the inherited constructor. Create also initializes the ASyncStyles property to [asAccept].


TServerWinSocket.Destroy

TServerWinSocket	See also

Destroys an instance of TServerWinSocket.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the Windows listening socket object is not nil, and only then calls Destroy. Unless the Windows socket object is not used by a server socket component, it is freed automatically by the socket component.

Destroy frees the helper objects that manage the list of active client connections and the thread cache.


TServerWinSocket.Disconnect

TServerWinSocket	See also

Shuts down the socket connection represented by a Windows socket handle.

procedure Disconnect(Socket: TSocket);

Description

Disconnect is called by the Close method to terminate the socket connection.

Disconnect calls the Lock method to make sure the method is thread-safe. Then, it terminates all open connections to client sockets. Next it generates an OnSocketEvent of type seDisconnect. Finally, it closes the listening connection and calls Unlock to end the critical section started by Lock.


TServerWinSocket.GetClientThread

TServerWinSocket	See also

Returns the execution thread used by the client connection managed by the ClientSocket parameter.

function GetClientThread(ClientSocket: TServerClientWinSocket): TServerClientThread;

Description

Use GetClientThread to obtain access to the TServerClientThread for a particular client connection. GetClientThread allows an OnClient... event handler to access thread-global information saved in the Data property of the thread.


TServerWinSocket.Listen

TServerWinSocket	See also

Opens a listening connection for a server socket.

procedure Listen(const Name, Address, Service: string; Port: Word;

Description

Server socket components call Listen to open a listening connection.

Listen creates the Windows socket that will make the listening connection, and binds the Windows internet socket address derived from the parameters to the socket. Listen then generates an OnSocketEvent of type seListen. Finally, Listen opens the socket as a listening connection with a queue that can hold QueueSize client requests, setting the Connected property to True.

The Name, Address, Service, and Port parameters are taken from the Host, Address, Service and Port properties of the server socket component. The QueueSize is set to 5 by TServerSocket.


Accessibility

Read-only


Hierarchy

TObject

TCustomWinSocket


TStringsAdapter

Hierarchy	Properties	Methods	See also

TStringsAdapter is a helper class used to allow a TStrings object to implement an IStrings interface for use with OLE.

Unit

axctrls

Description

Use a strings adapter to adapt a TStrings object so that it supports the IStrings interface. To do so, create the strings adapter by calling the GetOleStrings procedure, passing the TStrings object as a parameter.  Once the strings adapter is instantiated for a TStrings object, the StringsAdapter property of the TStrings object can be used to interact with the TStrings object through an IStrings interface.


TStringsAdapter properties

TStringsAdapter	Alphabetically	Legend

Derived from TAutoIntfObject

DispIID

DispIntfEntry

DispTypeInfo

Derived from TInterfacedObject

RefCount


TStringsAdapter properties

TStringsAdapter	By object	Legend

DispIID

DispIntfEntry

DispTypeInfo

RefCount


TStringsAdapter methods

TStringsAdapter	Alphabetically

In TStringsAdapter

Create

Derived from TAutoIntfObject

SafeCallException

Derived from TInterfacedObject

AfterConstruction

BeforeDestruction

NewInstance

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName


TStringsAdapter methods

TStringsAdapter	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TStringsAdapter.Create

TStringsAdapter	See also

Creates an instance of the string adapter control.

constructor Create(Strings: TStrings);

Description

Do not call the Create method directly. Instead, call the GetOleStrings procedure to adapt a TStrings object so that it supports the IStrings interface.


Accessibility

Read-only


Hierarchy

TObject

TInterfacedObject

TAutoIntfObject


TSynchroObject

Hierarchy	Methods	See also

TSynchroObject is the base class for all thread synchronization objects.

Unit

syncobjs

Description

Use TSynchroObject as a base class when defining an object that coordinates the execution of different threads in a multi-threaded application. Synchronization objects include critical sections that temporarily block the execution of other threads which may interfere with the successful completion of a section of code, and event objects that allow threads to signal when critical events have occurred.


TSynchroObject methods

TSynchroObject	Alphabetically

In TSynchroObject

Acquire

Release

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TSynchroObject methods

TSynchroObject	By object

Acquire

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Release

SafeCallException


TSynchroObject.Acquire

TSynchroObject	See also

Provides the interface for a method that devotes the synchronization object to a thread.

procedure Acquire; virtual;

Description

Call Acquire from the thread that wishes to use the synchronization object. The Acquire method for TSynchroObject does nothing other than provide the interface for a method that can start the synchronization object working on behalf of the calling thread.


TSynchroObject.Release

TSynchroObject	See also

Provides the interface for a method to release the synchronization object for use by other threads.

procedure Release; virtual;

Description

Call Release from a thread that is finished using the synchronization object. The Release method for TSynchroObject does nothing other than provide the interface for a method that can unbind the synchronization object from the calling thread.


Hierarchy

TObject


THTMLTableAttributes

Hierarchy	Properties	Methods	Events	See also

THTMLTableAttributes represents the display attributes of an HTML table tag.

Unit

httpapp

Description

Use THTMLTableAttributes to describe the desired appearance of an HTML table. The properties of the THTMLTableAttributes object correspond to the options that can be added to the HTML table tag. When the attributes of all the parts of the HTML table have been specified, an HTML producer object creates the HTML commands to specify the table as described.


THTMLTableAttributes properties

THTMLTableAttributes	Alphabetically	Legend

In THTMLTableAttributes

Align

BgColor

Border

CellPadding

CellSpacing

Width

Derived from THTMLTagAttributes

Custom

Producer


THTMLTableAttributes properties

THTMLTableAttributes	By object	Legend

Align

BgColor

Border

CellPadding

CellSpacing

Custom

Producer

Width


THTMLTableAttributes.Align

THTMLTableAttributes 	See also

Specifies the alignment of the table within the HTML document.

property Align: THTMLAlign;

Description

Set Align to indicate the desired alignment of the table within the HTML document, or within the cell of a surrounding HTML table object. Align indicates the desired value of the Align option of the HTML table tag.

The default value of Align is haDefault, which means the web browser that reads the HTML document positions the HTML table where it wants.


THTMLTableAttributes.BgColor

THTMLTableAttributes	See also

Specifies the background color of the HTML table.

property BgColor: THTMLBgColor;

Description

Use BgColor to indicate the desired background color of the HTML table. The value of BgColor is the name of color. This can be one of the following strings:

Aqua	Black	Blue
Fuschia	Gray	Green
Lime	Maroon	Navy
Olive	Purple	Red
Silver	Teal	White
Yellow
Use the BgColor property of the HTML attributes objects for the pieces of the table for more involved color effects.


THTMLTableAttributes.Border

THTMLTableAttributes	See also

Specifies the thickness of the border drawn around the HTML table.

property Border: Integer;

Description

Set Border to specify whether a border should be drawn around the table, and if so, how thick it should be. The thickness specified by any particular value of border depends on the web browser that views the HTML table. For any browser, however, larger numbers indicate thicker borders. A value of -1 indicates that no border should be drawn around the table.


THTMLTableAttributes.CellPadding

THTMLTableAttributes	See also

Specifies the amount of space to leave around the contents of each cell in the HTML table.

property CellPadding: Integer;

Description

Set CellPadding to specify how many pixels of whitespace should appear between a cell’s contents and the edges of the cell. A value of -1 indicates that the web browser should decide how to pad the cells of the HTML table.


THTMLTableAttributes.CellSpacing

THTMLTableAttributes	See also

Specifies the amount of space to leave between cells in the HTML table.

property CellSpacing: Integer;

Description

Set CellSpacing to specify how many pixels of whitespace should appear between the cells in the table. A value of -1 indicates that the web browser should decide how to separate the cells of the HTML table.

Note:	CellSpacing refers to the whitespace between cells in an HTML table, not the thickness of the lines drawn to separate rows and columns.


THTMLTableAttributes.Width

THTMLTableAttributes	See also

Specifies the width of the entire HTML table.

property Width: Integer;

Description

Set Width to indicate the desired width of the HTML table as a percentage of the width of the web browser window. If the value of Width is too small for the contents of the table, the web browser will ignore this property.

The default value of Width is 100, meaning the table will span the entire browser window. In this case, the value of the Align property is meaningless.


THTMLTableAttributes events

THTMLTableAttributes	Alphabetically

Derived from THTMLTagAttributes

OnChange


THTMLTableAttributes events

THTMLTableAttributes	By object

OnChange


THTMLTableAttributes methods

THTMLTableAttributes	Alphabetically	Legend

In THTMLTableAttributes

AssignTo

Create

RestoreDefaults

Derived from TPersistent

Assign

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


THTMLTableAttributes methods

THTMLTableAttributes	By object	Legend

AfterConstruction

Assign

AssignTo

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RestoreDefaults

SafeCallException


THTMLTableAttributes.AssignTo

THTMLTableAttributes	See also

Copies the properties of a THTMLTableAttributes object to another THTMLTableAttributes object.

procedure AssignTo(Dest: TPersistent); override;

Description

Applications can not call the protected AssignTo method. To assign the properties of a THTMLTableAttributes object to another object, use the Assign method of the destination object.

When the Assign method of another object specifies a THTMLTableAttributes object as the source of the assignment, the AssignTo method of the THTMLTableAttributes object is called. AssignTo checks whether the Dest parameter is another THTMLTableAttributes object, and if so, copies the values of the Align, Border, CellSpacing, CellPadding, and Width properties. If Dest is any other class of object, the inherited method is called.

Note:	AssignTo does not copy the Custom property.


THTMLTableAttributes.Create

THTMLTableAttributes	See also

Creates an instance of THTMLTableAttributes.

constructor Create(Producer: TCustomContentProducer);

Description

Call Create to create and initialize a THTMLTableAttributes object. The Producer parameter specifies the HTML producer that is using the THTMLTableAttributes object to specify the attributes of an HTML table that makes up part of its output.

After calling the inherited constructor, Create initializes

•	Width to a value of 100.

•	Border to a value of -1.

•	CellPadding to a value of -1.

•	CellSpacing to a value of -1.


THTMLTableAttributes.RestoreDefaults

THTMLTableAttributes	See also

Changes all properties of the table attributes object back to their initial settings.

procedure RestoreDefaults; override;

Description

Call RestoreDefaults to undo any changes that were made to the table attributes either programmatically, or using the response editor at design time. RestoreAttributes sets

?	Align to haDefault.

?	Border, CellPadding, and CellSpacing to –1.

?	Custom to an empty string.

?	Width to 100.


Scope

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

THTMLTagAttributes


THTMLTableCellAttributes

Hierarchy	Properties	Methods	Events	See also

THTMLTableCellAttributes represents the display attributes of an HTML table cell tag.

Unit

httpapp

Description

Use THTMLTableCellAttributes to describe the desired appearance of a cell in an HTML table. The properties of the THTMLTableCellAttributes object correspond to the options that can be added to the HTML table data tag (TD). When the attributes of all the parts of the HTML table have been specified, an HTML producer object creates the HTML commands to specify the table as described.


THTMLTableCellAttributes properties

THTMLTableCellAttributes	Alphabetically	Legend

Derived from THTMLTableElementAttributes

Align

BgColor

VAlign

Derived from THTMLTagAttributes

Custom

Producer


THTMLTableCellAttributes properties

THTMLTableCellAttributes	By object	Legend

Align

BgColor

Custom

Producer

VAlign


THTMLTableCellAttributes events

THTMLTableCellAttributes	Alphabetically

Derived from THTMLTagAttributes

OnChange


THTMLTableCellAttributes events

THTMLTableCellAttributes	By object

OnChange


THTMLTableCellAttributes methods

THTMLTableCellAttributes	Alphabetically

Derived from THTMLTableElementAttributes

RestoreAttributes

Derived from THTMLTagAttributes

Create

Derived from TPersistent

Assign

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


THTMLTableCellAttributes methods

THTMLTableCellAttributes	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RestoreAttributes

SafeCallException


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

THTMLTagAttributes

THTMLTableElementAttributes


THTMLTableElementAttributes

Hierarchy	Properties	Methods	Events	See also

THTMLTableElementAttributes is the common base class for objects that describe the display attributes of parts of an HTML table.

Unit

httpapp

Description

Use the properties of THTMLTableElementAttributes to describe the desired appearance of a piece of an HTML table. The properties of THTMLTableElementAttributes correspond to the common options that can be added to the tags for the parts of the HTML table. When the attributes of all the parts of the HTML table have been specified, an HTML producer object creates the HTML commands to specify the table as described.


THTMLTableElementAttributes properties

THTMLTableElementAttributes	Alphabetically	Legend

In THTMLTableElementAttributes

Align

BgColor

VAlign

Derived from THTMLTagAttributes

Custom

Producer


THTMLTableElementAttributes properties

THTMLTableElementAttributes	By object	Legend

Align

BgColor

Custom

Producer

VAlign


THTMLTableElementAttributes.Align

THTMLTableElementAttributes	See also

Specifies the horizontal alignment of the contents of the HTML table element.

property Align: THTMLAlign;

Description

Set Align to indicate the desired horizontal alignment of the contents of the cell or cells indicated by the table element. Align indicates the desired value of the Align option of the HTML tag for the table element.

The default value of Align is haDefault, which means the web browser that reads the HTML document horizontally positions the contents of the table element wherever it wishes.

The Align property of table data cells or header cells overrides the Align property of the table row in which they appear.


THTMLTableElementAttributes.BgColor

THTMLTableElementAttributes	See also

Specifies the background color of the HTML table element.

property BgColor: THTMLBgColor;

Description

Use BgColor to indicate the desired background color of the HTML table element. The value of BgColor is the name of color. This can be one of the following strings:

Aqua	Black	Blue

Fuschia	Gray	Green

Lime	Maroon	Navy

Olive	Purple	Red

Silver	Teal	White

Yellow

Use the BgColor property of the THTMLTableAttributes object to set a background color for the entire table. Use the BgColor property of the table element attributes object to make a table element stand out from the rest of the table.


THTMLTableElementAttributes.VAlign

THTMLTableElementAttributes	See also

Specifies the vertical alignment of the contents of the HTML table element.

property VAlign: THTMLVAlign;

Description

Set VAlign to indicate the desired vertical alignment of the contents of the HTML table element. VAlign indicates the desired value of the VAlign option of the HTML tag for the table element.

The default value of VAlign is haVDefault, which means the web browser that reads the HTML document positions the contents of cells in the table element wherever it wishes vertically.

The VAlign property of table data cells or header cells overrides the VAlign property of the table row in which they appear.


THTMLTableElementAttributes events

THTMLTableElementAttributes	Alphabetically

Derived from THTMLTagAttributes

OnChange


THTMLTableElementAttributes events

THTMLTableElementAttributes	By object

OnChange


THTMLTableElementAttributes methods

THTMLTableElementAttributes	Alphabetically	Legend

In THTMLTableElementAttributes

AssignTo

RestoreDefaults

Derived from THTMLTagAttributes

Create

Derived from TPersistent

Assign

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


THTMLTableElementAttributes methods

THTMLTableElementAttributes	By object	Legend

AfterConstruction

Assign

AssignTo

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RestoreDefaults

SafeCallException


THTMLTableElementAttributes.AssignTo

THTMLTableElementAttributes	See also

Copies the properties of a THTMLTableElementAttributes object to another THTMLTableElementAttributes object.

procedure AssignTo(Dest: TPersistent); override;

Description

Applications can not call the protected AssignTo method. To assign the properties of a THTMLTableElementAttributes object to another object, use the Assign method of the destination object.

When the Assign method of another object specifies a THTMLTableElementAttributes object as the source of the assignment, the AssignTo method of the THTMLTableElementAttributes object is called. AssignTo checks whether the Dest parameter is another THTMLTableElementAttributes object, and if so, copies the values of the BgColor, Align, and VAlign properties. If Dest is any other class of object, the inherited method is called.

Note:	AssignTo does not copy the Custom property.


THTMLTableElementAttributes.RestoreDefaults

THTMLTableElementAttributes	See also

Changes all properties of the attributes object back to their initial settings.

procedure RestoreDefaults; override;

Description

Call RestoreDefaults to undo any changes that were made to the table element attributes either programmatically, or using the Object Inspector at design time. RestoreAttributes sets

Align to haDefault, and VAlign to haVDefault.

BgColor to an empty string.

Custom to an empty string.


Scope

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

THTMLTagAttributes


THTMLTableHeaderAttributes

Hierarchy	Properties	Methods	Events	See also

THTMLTableHeaderAttributes represents the display attributes of the header tag in an HTML table.

Unit

httpapp

Description

Use THTMLTableHeaderAttributes to describe the desired appearance of a header cell in an HTML table. The properties of the THTMLTableHeaderAttributes object correspond to the options that can be added to the HTML header tag (TH). When the attributes of all the parts of the HTML table have been specified, the HTML content producer creates the HTML commands to specify the table as described.


THTMLTableHeaderAttributes properties

THTMLTableHeaderAttributes	Alphabetically	Legend

In THTMLTableHeaderAttributes

Caption

Derived from THTMLTableElementAttributes

Align

BgColor

VAlign

Derived from THTMLTagAttributes

Custom

Producer


THTMLTableHeaderAttributes properties

THTMLTableHeaderAttributes	By object	Legend

Align

BgColor

Caption

Custom

Producer

VAlign


THTMLTableHeaderAttributes.Caption

THTMLTableHeaderAttributes	See also

Represents the text that appears in the header cell.

property Caption: string;

Description

Set the Caption property to provide a caption for the column that contains the header cell. If the header cell is used by a dataset table producer or a query table producer, the Caption property overrides the field name that would label the column by default.


THTMLTableHeaderAttributes events

THTMLTableHeaderAttributes	Alphabetically

Derived from THTMLTagAttributes

OnChange


THTMLTableHeaderAttributes events

THTMLTableHeaderAttributes	By object

OnChange


THTMLTableHeaderAttributes methods

THTMLTableHeaderAttributes	Alphabetically

In THTMLTableHeaderAttributes

RestoreDefaults

Derived from THTMLTagAttributes

Create

Derived from TPersistent

Assign

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


THTMLTableHeaderAttributes methods

THTMLTableHeaderAttributes	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RestoreDefaults

SafeCallException


THTMLTableHeaderAttributes.RestoreDefaults

THTMLTableHeaderAttributes	See also

Changes all properties of the attributes object back to their initial settings.

procedure RestoreDefaults; override;

Description

Call RestoreDefaults to undo any changes that were made to the table element attributes either programmatically, or using the Object Inspector at design time. RestoreAttributes sets

Align to haDefault, and VAlign to haVDefault.

BgColor to an empty string.

Caption to an empty string.

Custom to an empty string.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

THTMLTagAttributes

THTMLTableElementAttributes


THTMLTableRowAttributes

Hierarchy	Properties	Methods	Events	See also

THTMLTableRowAttributes represents the display attributes of the row tag in an HTML table.

Unit

httpapp

Description

Use THTMLTableRowAttributes to describe the desired appearance of a row of an HTML table. The properties of the THTMLTableRowAttributes object correspond to the options that can be added to the HTML row tag (TR). When the attributes of all the parts of the HTML table have been specified, the content producer creates the HTML commands to specify the table as described.

THTMLTableRowAttributes introduces no new properties, events, or methods beyond those introduced by its immediate ancestor THTMLTableElementAttributes.


THTMLTableRowAttributes properties

THTMLTableRowAttributes	Alphabetically	Legend

Derived from THTMLTableElementAttributes

Align

BgColor

VAlign

Derived from THTMLTagAttributes

Custom

Producer


THTMLTableRowAttributes properties

THTMLTableRowAttributes	By object	Legend

Align

BgColor

Custom

Producer

VAlign


THTMLTableRowAttributes events

THTMLTableRowAttributes	Alphabetically

Derived from THTMLTagAttributes

OnChange


THTMLTableRowAttributes events

THTMLTableRowAttributes	By object

OnChange


THTMLTableRowAttributes methods

THTMLTableRowAttributes	Alphabetically

Derived from THTMLTableElementAttributes

RestoreDefaults

Derived from THTMLTagAttributes

Create

Derived from TPersistent

Assign

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


THTMLTableRowAttributes methods

THTMLTableRowAttributes	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RestoreDefaults

SafeCallException


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

THTMLTagAttributes

THTMLTableElementAttributes


THTMLTableColumn

Hierarchy	Properties	Methods	See also

THTMLTableColumn represents the display attributes and field binding of a column in the HTML representation of a dataset.

Unit

dbweb

Description

Use THTMLTableColumn to specify the appearance or value of a column in a table produced by TDSTableProducer. Applications can set the properties of the columns programmatically at runtime, or use the Columns editor at design time.


THTMLTableColumn properties

THTMLTableColumn	Alphabetically	Legend

In THTMLTableColumn

Align

BgColor

Custom

DisplayName

DSTableProducer

Field

FieldName

Title

VAlign

Derived from TCollectionItem

Collection

ID

Index


THTMLTableColumn properties

THTMLTableColumn	By object	Legend

Align

BgColor

Collection

Custom

DisplayName

DSTableProducer

Field

FieldName

ID

Index

Title

VAlign


THTMLTableColumn.Align

THTMLTableColumn	See also

Specifies the horizontal alignment of the contents of the cells in the column.

property Align: THTMLAlign;

Description

Set Align to indicate the desired horizontal alignment of text in the cells of the column. Align indicates the desired value of the Align option of the HTML TD tag.

The default value of Align is haDefault, which means the web browser that reads the HTML document horizontally positions the contents of cells wherever it wishes.


THTMLTableColumn.BgColor

THTMLTableColumn	See also 	Example

Specifies the background color of the cells in the column.

property BgColor: THTMLBgColor;

Description

Use BgColor to indicate a value for the BgColor option of the HTML TD tag. The value of BgColor is the name of color. This can be one of the following strings:

Aqua	Black	Blue

Fuschia	Gray	Green

Lime	Maroon	Navy

Olive	Purple	Red

Silver	Teal	White

Yellow

Use the BgColor property of the THTMLTableAttributes object to set a background color for the entire table. Use the BgColor property of THTMLTableColumn to make a column stand out from the rest of the table.


THTMLTableColumn.Custom

THTMLTableColumn	See also

Specifies a tag option and its value in the HTML TD tags for the cells in the column.

property Custom: string;

Description

Use Custom to represent one or more options to be added to an HTML tag. Each option and its value should have the form

OPTIONNAME=Value

If Custom specifies more than one option, each object should be separated from the others by spaces.


THTMLTableColumn.DisplayName

THTMLTableColumn	See also

Names an individual HTML table column within a collection of columns.

property DisplayName: string;

Description

Use DisplayName to name a particular column in the list of columns maintained by TDSTableProducer. DisplayName is also the string that appears in the header cell at the top of the column.

Note:	If the FieldName property is set, reading DisplayName will always return FieldName, even if DisplayName was set to another value.


THTMLTableColumn.DSTableProducer

THTMLTableColumn 	See also

Indicates the table producer component that uses this column.

property DSTableProducer: TDSTableProducer;

Description

Read DSTableProducer to obtain information about the component that uses this object to represent the attributes of a column in the HTML table it produces. For example, to access the dataset which contains the field for this column, use the Dataset property of DSTableProducer.


THTMLTableColumn.Field

THTMLTableColumn	See also

Indicates the field component associated with the field binding of the column.

property Field: TField;

Description

Read Field to get direct access to the field component for the column. Usually, Field is a field component maintained by the dataset. In some cases, however, Field is maintained directly by THTMLTableColumn, such as when the column represents a calculated field. Do not set the Field property unless the TField object is obtained from the dataset of the TDSTableProducer that uses this THTMLTableColumn object, or is a calculated field based on that dataset.

Setting Field automatically updates the FieldName property.


THTMLTableColumn.FieldName

THTMLTableColumn	See also

Specifies the name of the field to which the column is bound.

property FieldName: string;

Description

Set FieldName to specify the field binding for the column in the HTML table. FieldName identifies a particular field component in the dataset of the TDSTableProducer object that uses this THTMLTableColumn object.

Setting Fieldname automatically updates the Field property.


THTMLTableColumn.Title

THTMLTableColumn	See also

Specifies the display attributes to be added to the header cell that appears at the top of the column.

property Title: THTMLTableHeaderAttributes;

Description

Set Title to a THTMLTableHeaderAttributes object that describes the display attributes for the HTML TH tag for the header cell at the top of the column. Setting Title calls the Assign method of the THTMLTableHeaderAttributes object stored internally by THTMLTableColumn. Thus, the memory for any table header attributes object assigned to the Title property is never owned or freed by the HTML table column.

Note:	Not all the properties of the table header attributes object are copied when one table attributes object is assigned to another. To ensure that all the attributes represented by Title are set appropriately, read Title and set the individual properties of the THTMLTableHeaderAttributes object.


THTMLTableColumn.VAlign

THTMLTableColumn	See also

Specifies the vertical alignment of the contents of the cells in the column.

property VAlign: THTMLVAlign;

Description

Set VAlign to indicate the desired vertical alignment of text in the cells of the column. VAlign indicates the desired value of the VAlign option of the HTML <TD> tag.

The default value of VAlign is haVDefault, which means the web browser that reads the HTML document vertically positions the contents of cells wherever it wishes.


THTMLTableColumn methods

THTMLTableColumn	Alphabetically

In THTMLTableColumn

AssignTo

Create

Destroy

RestoreDefaults

Update

Derived from TCollectionItem

GetNamePath

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


THTMLTableColumn methods

THTMLTableColumn	By object

AfterConstruction

Assign

AssignTo

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RestoreDefaults

SafeCallException

Update


THTMLTableColumn.AssignTo

THTMLTableColumn	See also

Copies the properties of a THTMLTableColumn object to another THTMLTableColumn object.

procedure AssignTo(Dest: TPersistent); override;

Description

Applications can not call the protected AssignTo method. To assign the properties of a THTMLTableColumn object to another object, use the Assign method of the destination object.

When the Assign method of another object specifies a THTMLTableColumn object as the source of the assignment, the AssignTo method of the THTMLTableColumn object is called. AssignTo checks whether the Dest parameter is another THTMLTableColumn object, and if so, copies the values of all properties except Custom and DisplayName. If Dest is any other class of object, the inherited method is called.


THTMLTableColumn.Create

THTMLTableColumn	See also

Creates an instance of THTMLTableColumn.

constructor Create(Collection: TCollection); override;

Description

Do not call Create to create and initialize a THTMLTableColumn object. Columns created using the Columns editor at design time are created automatically. At runtime, create THTMLTableColumn objects using the Add or Insert methods of the THTMLTableColumns object that manages them.

After allocating the THTMLTableColumn object, Create tells the associated TDSTableProducer object to update its layout.


THTMLTableColumn.Destroy

THTMLTableColumn	See also

Destroys an instance of THTMLTableColumn.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the THTMLTableColumn reference is not nil, and only then calls Destroy. Do not explicitly free a THTMLTableColumn that is included in a THTMLTableColumns object. THTMLTableColumns frees the individual column objects it manages.


THTMLTableColumn.RestoreDefaults

THTMLTableColumn	See also

Changes all properties of the attributes object back to their initial settings.

procedure RestoreDefaults; override;

Description

Call RestoreDefaults to undo any changes that were made to the table element attributes either programmatically, or using the Columns editor at design time. RestoreAttributes sets

Align to haDefault, and VAlign to haVDefault.

BgColor to an empty string.

Custom to an empty string.

It also restores the default settings for the THTMLTableHeaderAttributes object that represents the title of the column.


THTMLTableColumn.Update

THTMLTableColumn 	See also

Ensures that the Field property reflects the underlying dataset.

procedure Update;

Description

Call Update to ensure that the Field property reflects any changes to the fields in the underlying dataset.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem


THTMLTableColumns

Hierarchy	Properties	Methods	See also

THTMLTableColumns is a collection of THTMLTableColumn objects that describe the display attributes and field bindings of the columns in an HTML representation of tabular data.

Unit

dbweb

Description

THTMLTableColumns is tailored for use by TDSTableProducer. It stores and manages changes to the THTMLTableColumn objects that describe the columns of the HTML table produced by TDSTableProducer. THTMLTableColumns informs the table producer of changes to the column bindings so the table producer can recompute its layout.


THTMLTableColumns properties

THTMLTableColumns	Alphabetically	Legend

In THTMLTableColumns

DSTableProducer

Items

State

Derived from TCollection

Count

ItemClass


THTMLTableColumns properties

THTMLTableColumns	By object	Legend

Count

DSTableProducer

ItemClass

Items

State


THTMLTableColumns.DSTableProducer

THTMLTableColumns

Indicates the table producer that uses THTMLTableColumns to store and manage column descriptions.

property DSTableProducer: TDSTableProducer;

Description

Read DSTableProducer to gain direct access to the table producer that uses the THTMLTableColumns object. THTMLTableColumns uses this property to inform the table producer of changes to the columns so that it can recompute its layout.


THTMLTableColumns.Items

THTMLTableColumns	See also 	Example

Lists the THTMLTableColumn objects that THTMLTableColumns stores and manages for its TDSTableProducer object.

property Items[Index: Integer]: THTMLTableColumn; default;

Description

Use Items to access the individual column descriptors managed by THTMLTableColumns. Items is an indexed array, where the first column descriptor has index 0, the second column descriptor has index 1, and so on.

Items is the default property of THTMLTableColumns. This means that applications do not need to specify the Items property name when referring to the elements of the Items array.


THTMLTableColumns.State

THTMLTableColumns	See also

Indicates whether the individual column descriptors are generated dynamically or statically stored.

type THTMLColumnState = (csDefault, csCustom);

property State: THTMLColumnState;

Description

Set State to csDefault to indicate that the column descriptors should be generated dynamically. Dynamically generated column descriptors impose no special display attributes on the columns of the HTML table, and correspond exactly in order and number to the fields of the dataset. Setting State to csDefault replaces all the column descriptors in the collection with dynamically generated defaults.

Set State to csCustom before customizing the column descriptors by adding display attributes, reordering the fields, adding columns for calculated fields, or including only a subset of the fields in the dataset. When State is csCustom, the column descriptors are saved with the TDSTableProducer object.

Note:	Using the Columns editor to customize the column descriptors automatically sets State to csCustom.


THTMLTableColumns methods

THTMLTableColumns	Alphabetically

In THTMLTableColumns

Add

Create

RebuildColumns

RestoreDefaults

Derived from TCollection

Assign

BeginUpdate

Clear

Destroy

EndUpdate

FindItemID

GetNamePath

Insert

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


THTMLTableColumns methods

THTMLTableColumns	By object

Add

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

Dispatch

EndUpdate

FieldAddress

FindItemID

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

RebuildColumns

RestoreDefaults

SafeCallException


THTMLTableColumns.Add

THTMLTableColumns	See also

Adds a new column descriptor to the end of the Items array.

function  Add: THTMLTableColumn;

Description

Call Add to add a column descriptor to the collection of columns shown in the HTML table generated by TDSTableProducer. Applications should only call Add when the value of the State property is csCustom.


THTMLTableColumns.Create

THTMLTableColumns	See also

Creates an instance of THTMLTableColumns.

type THTMLTableColumnClass = class of THTMLTableColumn;

constructor Create(DSTableProducer: TDSTableProducer; ColumnClass: THTMLTableColumnClass);

Description

Do not call the constructor of THTMLTableColumns. TDSTableProducer calls Create from its own constructor. The DSTableProducer parameter specifies the TDSTableProducer object that uses the THTMLTableColumns object to manage its column descriptors. The ColumnClass parameter indicates the class of the THTMLTableColumn objects that fill the Items array.


THTMLTableColumns.RebuildColumns

THTMLTableColumns	See also

Replaces all the column descriptors in the Items array with new column descriptors that exactly match the fields in the dataset of DSTableProducer.

procedure RebuildColumns;

Description

Call RebuildColumns to set the collection of column descriptors to the default state which matches the order and number of fields in the dataset, and which imposes no special display attributes. RebuildColumns returns the collection of column descriptors to the state that is dynamically maintained when the State property is csDefault.


THTMLTableColumns.RestoreDefaults

THTMLTableColumns	See also

Restores the default properties of every column in the Items property array.

procedure RestoreDefaults;

Description

At design time, RestoreDefaults is called when the Restore defaults button is pressed in the Response editor.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


THTMLTagAttributes

Hierarchy	Properties	Methods	Events	See also

THTMLTagAttributes is the base class for all objects that represent the attributes of an HTML tag.

Unit

httpapp

Description

Descendants of TCustomContentProducer use THTMLTagAttributes objects to encapsulate the options added to the HTML tags in the HTML commands that they produce. When the TCustomContentProducer object generates HTML commands, it looks up the tag attributes represented by the properties of its tag attributes objects, and generates the appropriate tag options.


THTMLTagAttributes properties

THTMLTagAttributes	Alphabetically	Legend

In THTMLTagAttributes

Custom

Producer


THTMLTagAttributes properties

THTMLTagAttributes	By object	Legend

Custom

Producer


THTMLTagAttributes.Custom

THTMLTagAttributes	See also

Represents a tag option and its value in an HTML tag.

property Custom: string;

Description

Use Custom to represent one or more options to be added to an HTML tag. Each option and its value should have the form

OPTIONNAME=Value

The options specified by Custom should be separated by spaces. For example, to merge a cell in an HTML table with the three adjacent cells to the left and below, the table data tag for the cell requires the ROWSPAN and COLSPAN options to be set. The value of Custom to specify these values would be the string

ROWSPAN=2 COLSPAN=2

The HTML producer inserts the Custom string into the HTML tag when it generates its Content.


THTMLTagAttributes.Producer

THTMLTagAttributes	See also

Indicates the content producer that uses the THTMLTagAttributes object to represent the options for one of the HTML tags in the content it produces.

property Producer: TCustomContentProducer;

Description

Use Producer to gain access to the HTML producer object that is using the THTMLTagAttributes object. The THTMLTagAttributes object can use the Producer property in an OnChange event handler to notify the TCustomContentProducer object of changes to the attributes it represents.


THTMLTagAttributes events

THTMLTagAttributes	Alphabetically

In THTMLTagAttributes

OnChange


THTMLTagAttributes events

THTMLTagAttributes	By object

OnChange


THTMLTagAttributes.OnChange

THTMLTagAttributes	See also

Occurs immediately after a tag attributes property changes.

property OnChange: TNotifyEvent;

Description

Write an OnChange event handler to take specific action whenever any of the properties of the tag attributes object changes. When OnChange occurs, the tag attributes object already has the new property setting. Use an OnChange event handler to inform the HTML content producer when the attributes of a tag change so that the content producer can update the content it is producing.


THTMLTagAttributes methods

THTMLTagAttributes	Alphabetically	Legend

In THTMLTagAttributes

Changed

Create

RestoreDefaults

Derived from TPersistent

Assign

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


THTMLTagAttributes methods

THTMLTagAttributes	By object	Legend

AfterConstruction

Assign

BeforeDestruction

Changed

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RestoreDefaults

SafeCallException


THTMLTagAttributes.Changed

THTMLTagAttributes	See also

Generates an OnChange event.

procedure Changed;

Description

Call Changed from a descendant of THTMLTagAttributes after a tag option introduced by that descendant changes. Changed is exposed as a protected method so that component writers can create descendants of THTMLTagAttributes which correctly trigger the OnChange event handler.


THTMLTagAttributes.Create

THTMLTagAttributes	See also

Creates an instance of THTMLTagAttributes.

constructor Create(Producer: TCustomContentProducer);

Description

Call Create to create and initialize an instance of THTMLTagAttributes at runtime. After calling the inherited constructor, Create sets the Producer property to the value of the Producer parameter.


THTMLTagAttributes.RestoreDefaults

THTMLTagAttributes	See also

Changes all properties of the tag attributes object back to their initial settings.

procedure RestoreDefaults; virtual;

Description

Call RestoreDefaults to undo any changes that were made to the tag attributes either programmatically, or at design time. RestoreAttributes sets the Custom property to an empty string.


Scope

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent


TTypedComObjectFactory

Hierarchy	Properties	Methods

TTypedComObjectFactory is the type of the class factory object used to instantiate a TypedComObject class.

Unit

comobj

Description

TTypedComObjectFactory inherits support for the IUnknown, IClassFactory, and IClassFactory2 interfaces. TTypedComObjectFactory is used to instantiate the TTypedComObject class.


TTypedComObjectFactory properties

TTypedComObjectFactory	Alphabetically	Legend

In TTypedComObjectFactory

ClassInfo

Derived from TComObjectFactory

ClassID

ClassName

ComClass

ComServer

Description

ErrorIID

Instancing

LicString

ProgID

ShowErrors

SupportsLicensing

ThreadingModel


TTypedComObjectFactory properties

TTypedComObjectFactory	By object	Legend

ClassID

ClassInfo

ClassName

ComClass

ComServer

Description

ErrorIID

Instancing

LicString

ProgID

ShowErrors

SupportsLicensing

ThreadingModel


TTypedComObjectFactory.ClassInfo

TTypedComObjectFactory

Specifies an interface reference that provides type information without having to load a type library.

property ClassInfo: ITypeInfo;

Description

ClassInfo is of type ITypeInfo, which is an interface usually used for reading information about objects. Use ITypeInfo to extract information about the characteristics and capabilities of objects from type libraries.

Type information interfaces are intended to describe the parts of the application that can be called by outside clients, rather than those that might be used internally to build an application.

The ITypeInfo interface provides access to the following:

The set of function descriptions associated with the type; for interfaces, this contains the set of member functions in the interface.

The set of data member descriptions associated with the type; for structures, this contains the set of fields of the type.

The general attributes of the type, such as whether it describes a structure, an interface, and so on.

An ITypeInfo instance provides various information about a type, and is used in different ways. A compiler can use an ITypeInfo to compile references to members of the type. A type interface browser can use it to find information about each member of the type.

Note:	An IDispatch implementer can use it to provide automatic delegation of IDispatch calls to an interface.

Note:	A type library is a container for type descriptions. A type library contains descriptions of one or more objects, and is accessed through the ITypeLib interface. The ITypeLib interface provides access to information about the type description in a type library. The descriptions of individual objects are accessed through the ITypeInfo interface.


TTypedComObjectFactory methods

TTypedComObjectFactory	Alphabetically

In TTypedComObjectFactory

Create

GetInterfaceTypeInfo

UpdateRegistry

Derived from TComObjectFactory

CreateComObject

Destroy

RegisterClassObject

Derived from TObject

AfterConstruction

BeforeDestruction

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TTypedComObjectFactory methods

TTypedComObjectFactory	By object

AfterConstruction

BeforeDestruction

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateComObject

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetInterfaceTypeInfo

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RegisterClassObject

SafeCallException

UpdateRegistry


TTypedComObjectFactory.Create

TTypedComObjectFactory	See also

Instantiates a TTypedComObjectFactory object.

constructor Create(ComServer: TComServerObject; TypedComClass: TTypedComClass; const ClassID: TGUID; Instancing: TClassInstancing; ThreadingModel: TThreadingModel = tmSingle);

Description

Create is used to instantiate a TTypedComObjectFactory. Create is automatically called when the COM server that contains the class definition for a TTypedComObject is loaded. Class factories should be instantiated in the initialization section of the unit that includes their associated server.

Create allocates memory for a TTypedComObjectFactory, and verifies that a type library exists and is available, before calling the inherited Create. If the type library is not available, an EOleSysError exception is raised.


TTypedComObjectFactory.GetInterfaceTypeInfo

TTypedComObjectFactory

Retrieves the type information for the typed COM object created by the factory.

function GetInterfaceTypeInfo(TypeFlags: Integer): ITypeInfo;

Description

GetInterfaceTypeInfo is called to retrieve type information on the TTypedComObject instances that are created by the factory.


TTypedComObjectFactory.UpdateRegistry

TTypedComObjectFactory	See also

Registers the typed COM object class.

procedure UpdateRegistry(Register: Boolean); override;

Description

UpdateRegistry is called for EXEs when the EXE is run, and for DLLs or EXEs when the routines are called to specifically register or unregister the server.


Accessibility

Read-only


Hierarchy

TObject

TComObjectFactory


TTypedComObject

Hierarchy	Properties	Methods

TTypedComObject supports the IProvideClassInfo interface and is the class type for COM objects that can provide the type information without requring a type library to be loaded.

Unit

comobj

Description

TTypedComObject supports the IProvideClassInfo interface which gives an object the ability to describe its interfaces and types when everything else about it, such as its class identifier (CLSID), is unknown. TTypedComObject requires a type library for the IProvideClassInfo interface. This class is designed to require a type library so that it can support dual interfaces, which are created by default.

IProvideClassInfo has a single method, GetClassInfo, which is implemented in TTypedComObject to provide access to the type information for the object’s CoClass entry in its type library. This means that if the TTypedComObject has a running instance, a client can query for the IProvideClassInfo interface and retrieve this information without having to load and navigate a type library to find the ITypeInfo pointer for the object’s CoClass.

Use TTypedComObject as a base class for objects that can conveniently provide type information without having to load a type library, such as an unknown object received through a drag-and-drop operation. The only objects that must implement IProvideClassInfo are those with custom events such as ActiveX controls.

Note

There is no support for type information in a particular language. Type information appropriate to the user’s international settings on the current machine is assumed to have been loaded.

Implemented methods of IProvideClassInfo

GetClassClassInfo.


TTypedComObject properties

TTypedComObject	Alphabetically	Legend

Derived from TComObject

Controller

Factory

RefCount

ServerExceptionHandler


TTypedComObject properties

TTypedComObject	By object	Legend

Controller

Factory

RefCount

ServerExceptionHandler


TTypedComObject methods

TTypedComObject	Alphabetically

In TTypedComObject

GetClassInfo

Derived from TComObject

Create

CreateAggregated

CreateFromFactory

Destroy

Initialize

ObjAddRef

ObjQueryInterface

ObjRelease

SafeCallException

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTypedComObject methods

TTypedComObject	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateAggregated

CreateFromFactory

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetClassInfo

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

Initialize

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ObjAddRef

ObjQueryInterface

ObjRelease

SafeCallException


TTypedComObject.GetClassInfo

TOleContainer

Returns a pointer to a TTypedComObject’s type information.

function GetClassInfo(out TypeInfo: ITypeInfo): HResult; stdcall;

Description

The GetClassInfo method returns a pointer to a type information object that describes the incoming and outgoing interfaces to the ActiveX control. The method gets a pointer to the control’s type library, and through it, uses the ITypeLib interface to retrieve the type information.


Accessibility

Read-only


Hierarchy

TObject

TComObject


TWebBrowser

Hierarchy	Properties	Methods	Events

TWebBrowser provides access to the WebBrowser functionality of Microsoft’s Shell Doc Object and Control Library (SHDOCVW.DLL).

Unit

shdocvw

Description

TWebBrowser draws on the WebBrowser functionality of Microsoft’s Shell Doc Object and Control Library (SHDOCVW.DLL) to allow you to create a customized Web browsing application or to add Internet, file and network browsing, document viewing, and data downloading capabilities to your Delphi applications.


TWebBrowser properties

TWebBrowser	Alphabetically	Legend

In TWebBrowser

AddressBar

Application

Busy

Container

ControlInterface

DefaultInterface

Document

FullName

FullScreen

HWND

LocationName

LocationURL

MenuBar

Name

Offline

Parent

Path

ReadyState

RegisterAsBrowser

RegisterAsDropTarget

Resizable

Silent

StatusBar

StatusText

TheaterMode

ToolBar

TopLevelContainer

Type_

Visible

Derived from TOLEControl

DefaultDispatch

OleObject

PerPropBrowsing

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragMode

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TWebBrowser properties

TWebBrowser	By object	Legend

Action

AddressBar

Align

Anchors

Application

BiDiMode

BoundsRect

Brush

Busy

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

Container

ControlCount

ControlInterface

Controls

ControlState

ControlStyle

Cursor

DefaultDispatch

DefaultInterface

DesignInfo

DockClientCount

DockClients

DockOrientation

Document

DoubleBuffered

DragCursor

DragMode

Enabled

Floating

FloatingDockSiteClass

FullName

FullScreen

Handle

Height

HelpContext

Hint

HostDockSite

HWND

Left

LocationName

LocationURL

LRDockWidth

MenuBar

Name

Offline

OleObject

Owner

Parent

ParentShowHint

ParentWindow

Path

PerPropBrowsing

PopupMenu

ReadyState

RegisterAsBrowser

RegisterAsDropTarget

Resizable

ShowHint

Showing

Silent

StatusBar

StatusText

TabOrder

TabStop

Tag

TBDockHeight

TheaterMode

ToolBar

Top

TopLevelContainer

Type_

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TWebBrowser.AddressBar

TWebBrowser

Not used in TWebBrowser.

property AddressBar: WordBool;

Description

Do not use AddressBar. It is included in the TWebBrowser interface because the IWebBrowser2 interface is shared with Internet Explorer. AddressBar shows or hides the URL address bar on Internet Explorer. TWebBrowser does not have an address bar.


TWebBrowser.Application

TWebBrowser	See also

Provides access to the Automation interface for the application that contains the WebBrowser control, or, if that is unavailable, the interface for the WebBrowser control.

property Application: IDispatch;

Description

Use Application to access the interface for the application containing the WebBrowser control. If the application does not have an Automation interface, or if the interface is not accessible, Application provides access to the Automation interface of the Web browser control.


TWebBrowser.Busy

TWebBrowser	See also	Example

Indicates whether the WebBrowser control is in the middle of a navigation or downloading operation.

property Busy: WordBool;

Description

Read Busy to determine whether the Web browser component is currently navigating to a new URL or downloading a document. If Busy is True, you can interrupt the current operation using the Stop method before starting a new operation.

Note:	The Web browser receives events at the beginning and end of each operation, as well as at discrete points during a download operation.


TWebBrowser.Container

TWebBrowser	See also

Provides access to the automation interface of the Web browser’s container.

property Container: IDispatch;

Description

Use Container to access the interface for the Web browser’s parent or container. If the Web browser does not have a container with an Automation interface, Container is nil.


TWebBrowser.ControlInterface

TWebBrowser	See also

Provides access to the interface for this Web browser component.

property  ControlInterface: IWebBrowser2;

Description

Use ControlInterface to access the interface for the WebBrowser component. This interface lets an Automation controller access the properties, methods, and events of the Web browser.


TWebBrowser.DefaultInterface

TWebBrowser	See also

Provides access to the default interface for the component.

property  DefaultInterface: IWebBrowser2;

Description

Use DefaultInterface to access the default interface for the component. As implemented in TWebBrowser, this is the same as the ControlInterface property.


TWebBrowser.Document

TWebBrowser	See also

Provides access to the automation interface of the active document.

property Document: IDispatch;

Description

Use Document to access an IDispatch interface for manipulating the contents of the HTML document through the COM object model. If there is no active document, Document is nil. That is, you must first load a document using the Navigate or Navigate2 method before you can manipulate it using the Document interface.

For more information about this interface, see the document object section of Microsoft’s Dynamic HTML reference.


TWebBrowser.FullName

TWebBrowser	See also

Indicates the fully qualified path name for the executable that hosts the Web Browser component.

property FullName: WideString;

Description

Read FullName to obtain the name of the executable as a WideString. Unlike the Name property, FullName specifies a fully qualified path name.


TWebBrowser.FullScreen

TWebBrowser

Not used in TWebBrowser.

property FullScreen: WordBool;

Description

Do not use FullScreen. It is included in the TWebBrowser interface because the IWebBrowser2 interface is shared with Internet Explorer. FullScreen determines whether Internet Explorer is maximized.


TWebBrowser.HWND

TWebBrowser	See also

Provides access to the Window handle for the Web browser.

property HWND: Integer;

Description

Use HWND for Windows API calls that require a window handle. Use HWND instead of the Handle property when working with TWebBrowser controls.


TWebBrowser.LocationName

TWebBrowser	See also

Identifies the short (UI-friendly) name of the URL or file currently displayed.

property LocationName: WideString;

Description

Read LocationName to get the name of the resource currently displayed in the Web browser control. If the resource is an HTML page from the Web, LocationName is the title of that page. If the resource is a folder or file on the local network or on a disk, LocationName is the full UNC name of the folder or file.


TWebBrowser.LocationURL

TWebBrowser	See also

Identifies the URL or path of the document or folder currently displayed.

property LocationURL: WideString;

Description

Read LocationURL to get the name of the resource currently displayed in the Web browser control. If the resource is an HTML page from the Web, LocationName is its URL. If the resource is a folder or file on the local network or on a disk, LocationName is the full UNC name of the folder or file.

Note:	LocationURL is a read-only property. To direct the Web browser to display the resource at a specific URL, folder, or file, use the Navigate or Navigate2 method.


TWebBrowser.MenuBar

TWebBrowser

Not used in TWebBrowser.

property MenuBar: WordBool;

Description

Do not use MenuBar. It is included in the TWebBrowser interface because the IWebBrowser2 interface is shared with Internet Explorer. MenuBar shows or hides the menu bar in Internet Explorer. TWebBrowser does not have a menu bar.


TWebBrowser.Name

TWebBrowser	See also

Indicates the name for the executable that hosts the Web Browser component.

property Name: WideString;

Description

Read Name to obtain the name of the executable that hosts the Web browser. Unlike the FullName property, Name does not include the path.


TWebBrowser.Offline

TWebBrowser	See also

Indicates whether the Web browser gets its document from the local cache.

property Offline: WordBool;

Description

Set Offline to True to work offline with the Web browser. When the Web browser is offline, it can’t read HTML pages using an Internet connection. Instead, you must specify a source document as a UNC filename.

Note:	You can use Internet Explorer to save HTML pages to a local cache so that they are available for offline work.


TWebBrowser.Parent

TWebBrowser	See also

Provides access to the Automation interface of the Web browser’s container.

property Parent: IDispatch;

Description

Use Parent to access the interface for the Web browser’s parent or container. If the Web browser does not have a container with an Automation interface, the value of Parent is the same as ControlInterface.

Use the TopLevelContainer property to determine which interface is the value of Parent.


TWebBrowser.Path

TWebBrowser	See also

Indicates the name for the executable that hosts the Web Browser component.

property Path: WideString;

Description

Read Path to obtain the path of the executable that hosts the Web browser.


TWebBrowser.ReadyState

TWebBrowser	See also

Indicates the state of the Web browser component.

property ReadyState: TOleEnum;

Description

Read ReadyState to obtain state information specific to the Web browser control. Use this information to avoid attempting to use the Web browser control when it is not ready to perform an action.

The following table lists the possible values:

Constant	Value	Meaning

READYSTATE_UNINITIALIZED	0	Default initialization state. The Control has not begun loading any properties.

READYSTATE_LOADING	1	The control is loading its properties.

READYSTATE_LOADED	2	The control has initialized its properties but is not yet interactive.

READYSTATE_INTERACTIVE	3	The control is interactive, but not all of its data is available. (It is downloading a document or frame).

READYSTATE_COMPLETE	4	The control is interactive and all of its data is available. (The current document is fully downloaded).


TWebBrowser.RegisterAsBrowser

TWebBrowser

Registers the control as a top-level browser for target name resolution.

property RegisterAsBrowser: WordBool;

Description

Set RegisterAsBrowser to True when using the Web browser control to implement a top-level browser.


TWebBrowser.RegisterAsDropTarget

TWebBrowser	See also

Specifies whether users can load a document using drag-and-drop.

property RegisterAsDropTarget: WordBool;

Description

Set RegisterAsDropTarget to True to allow users to drop HTML documents onto the Web browser. When RegisterAsDropTarget is True, users can load a document by dragging it onto the Web browser. When RegisterAsDropTarget is False, dragging a document onto the Web browser has no effect.


TWebBrowser.Resizable

TWebBrowser

Not used in TWebBrowser.

property Resizable: WordBool;

Description

Do not use Resizable. It is included in the TWebBrowser interface because the IWebBrowser2 interface is shared with Internet Explorer. Resizable determines whether the Internet Explorer window can be resized.


TWebBrowser.Silent

TWebBrowser

Specifies whether the Web browser can display dialog boxes.

property Silent: WordBool;

Description

Set Silent to True to prevent the Web browser control from displaying dialog boxes.


TWebBrowser.StatusBar

TWebBrowser

Not used in TWebBrowser.

property StatusBar: WordBool;

Description

Do not use StatusBar. It is included in the TWebBrowser interface because the IWebBrowser2 interface is shared with Internet Explorer. StatusBar shows or hides the status bar in Internet Explorer. TWebBrowser does not have a status bar.


TWebBrowser.StatusText

TWebBrowser

Not used in TWebBrowser.

property StatusText: WideString;

Description

Do not use StatusText. It is included in the TWebBrowser interface because the IWebBrowser2 interface is shared with Internet Explorer. StatusText specifies the text that appears on the status bar in Internet Explorer. TWebBrowser does not have a status bar.


TWebBrowser.TheaterMode

TWebBrowser

Not used in TWebBrowser.

property TheaterMode: WordBool;

Description

Do not use TheaterMode. It is included in the TWebBrowser interface because the IWebBrowser2 interface is shared with Internet Explorer. TheaterMode changes the display of Internet Explorer to use theater or normal mode.


TWebBrowser.ToolBar

TWebBrowser

Not used in TWebBrowser.

property ToolBar: Integer;

Description

Do not use ToolBar. It is included in the TWebBrowser interface because the IWebBrowser2 interface is shared with Internet Explorer. ToolBar determines which toolbar is displayed in Internet Explorer. TWebBrowser does not have any tool bars.


TWebBrowser.TopLevelContainer

TWebBrowser	See also

Indicates whether the Web browser is a top-level Automation object.

property TopLevelContainer: WordBool;

Description

Read TopLevelContainer to determine whether the Web browser has a parent with an Automation interface. When TopLevelContainer is False, the Container and Parent properties provide access to the parent’s interface. When ToplevelContainer is True, the value of Container is nil and the value of Parent is the Web browser’s own interface.


TWebBrowser.Type_

TWebBrowser	See also

Indicates the type name of the contained document object.

property Type_: WideString;

Description

Read Type_ to determine the type of the Automation object whose interface is represented by the Document property.


TWebBrowser.Visible

TWebBrowser	See also

Specifies whether the Web browser component appears onscreen.

property Visible: WordBool;

Description

Use Visible to show or hide the Web browser control.


TWebBrowser events

TWebBrowser	Alphabetically	Legend

In TWebBrowser

OnBeforeNavigate2

OnCommandStateChange

OnDocumentComplete

OnDownloadBegin

OnDownloadComplete

OnFullScreen

OnMenuBar

OnNavigateComplete2

OnNewWindow2

OnProgressChange

OnPropertyChange

OnQuit

OnStatusBar

OnStatusTextChange

OnTheaterMode

OnTitleChange

OnToolBar

OnVisible

In TWinControl

OnEnter

OnExit

In TControl

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TWebBrowser events

TWebBrowser	By object	Legend

OnBeforeNavigate2

OnCommandStateChange

OnDocumentComplete

OnDownloadBegin

OnDownloadComplete

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnFullScreen

OnMenuBar

OnNavigateComplete2

OnNewWindow2

OnProgressChange

OnPropertyChange

OnQuit

OnStartDrag

OnStatusBar

OnStatusTextChange

OnTheaterMode

OnTitleChange

OnToolBar

OnVisible


TWebBrowser.OnBeforeNavigate2

TWebBrowser	See also

Occurs immediately before the Web browser navigates to a new resource.

type TWebBrowserBeforeNavigate2 = procedure(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant; var Flags: OleVariant; var TargetFrameName: OleVariant; var PostData: OleVariant; var Headers: OleVariant; var Cancel: WordBool) of object;

property OnBeforeNavigate2: TWebBrowserBeforeNavigate2;

Description

Write an OnBeforeNavigate2 event handler to redirect or cancel a change to a different URL. This event may occur as the result of a call to the Navigate or Navigate2 method, or the user clicking a link.

Sender is the Web browser control that is about to look up a new URL.

pDisp is the Automation interface of the Web browser control specified by Sender.

URL is the Uniform Resource Locator of the resource the Web browser is looking up. Change this value to redirect the navigation operation to a different resource.

Flags is not currently used.

TargetFrameName is the name of the frame in which the resource will be displayed, or NULL if the resource should not be displayed in a named frame. Change this value to change where the resource is displayed. See the Navigate method for a list of possible values.

PostData contains the data sent to the server when the underlying operation is an HTTP post message. The event handler can change this value before it is sent to the target URL.

Headers contains any headers sent to the servers when the URL represents an HTTP message. HTTP headers specify such things as the intended action required of the server, the type of data, and so on. (See TWebRequest object, whose properties represent many of the more common headers). The event handler can change this value before it is sent to the target URL.

Cancel determines whether the Web browser looks up the specified resource after the event handler exits. Change Cancel to True to cancel the navigation operation.


TWebBrowser.OnCommandStateChange

TWebBrowser	See also	Example

Occurs when the ability to execute certain TWebBrowser methods changes.

type TWebBrowserCommandStateChange = procedure(Sender: TObject; Command: Integer; Enable: WordBool) of object;

property OnCommandStateChange: TWebBrowserCommandStateChange;

Description

Write an OnCommandStateChange to update any controls in the application whose state depends on the ability to execute the Web browser’s methods.

Sender is the Web browser control whose capabilities have changed.

Command indicates what has changed. The following table lists the possible values:

Constant	Value	Meaning

CSC_UPDATECOMMANDS	-1	Any change not covered by the other constants. The application must check the properties of the Web browser to update its controls. For example, the event handler might check the Busy property to update a Stop button.

CSC_NAVIGATEFORWARD	1	The history list changed the ability of the GoForward method to navigate to a new URL. The Enable parameter indicates whether GoForward now navigates to a new URL (True), or not (False).

CSC_NAVIGATEBACK	2	The history list changed the ability of the GoBack method to navigate to a new URL. The Enable parameter indicates whether GoBack now navigates to a new URL (True), or not (False).

Enable indicates whether the CSC_NAVIGATEFORWARD or CSC_NAVIGATEBACK commands should now be enabled (True), or not (False).


TWebBrowser.OnDocumentComplete

TWebBrowser	See also	Example

Occurs when the document being navigated to reaches ReadyState_Complete.

type TWebBrowserDocumentComplete = procedure(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant) of object;

property OnDocumentComplete: TWebBrowserDocumentComplete;

Description

Write an OnDocumentComplete event handler to take specific action when a frame or document is fully loaded into the Web browser .For a document without frames, this event occurs once when the document finishes loading. On a document containing multiple frames, this event occurs once for each frame. When the multiple-frame document finishes loading, the Web browser fires the event one final time.

Sender is the Web browser that is loading the document.

pDisp is the Automation interface of the top-level frame or browser. When loading a document without frames, pDisp is the interface of the Web browser. When loading a document with multiple frames, this is the interface of the containing frame, except for the very last time the event occurs, when it is the interface of the Web browser.

URL is the URL, UNC file name, or PIDL that to which the Web browser navigated. This URL can be different from the URL to which the browser was told to navigate. For example, the browser may have been redirected by the target resource or by an OnBeforeNavigate2 event handler. In addition, the value of URL is the canonicalized and qualified URL: for example, if an application specified a URL of "www.borland.com" in a call to the Navigate or Navigate2 method, the URL in the OnDocumentComplete event handler is  "http://www.borland.com/".


TWebBrowser.OnDownloadBegin

TWebBrowser	See also

Occurs when the Web browser starts downloading a document.

property OnDownloadBegin: TNotifyEvent;

Description

Write an OnDownloadBegin event handler to take specific action after the Web browser has located a document and immediately before it starts downloading the document. For example, use the OnDownloadBegin event to launch an animation control the represents downloading or a progress bar that is updated by an OnProgressChange event handler. The control can then be stopped in an OnDownloadComplete event handler.

Note:	To take specific action when the Web browser looks up the resource, rather than when it begins downloading, use the OnBeforeNavigate2 event. OnDownloadBegin occurs shortly after OnBeforeNavigate2.


TWebBrowser.OnDownloadComplete

TWebBrowser	See also

Occurs when a navigation operation finishes, is halted, or fails.

property OnDownloadComplete: TNotifyEvent;

Description

Write an OnDownLoadComplete event handler to take specific action after the Web browser stops a downloading operation. For example, use the OnDownloadComplete event to stop an download indication that is started in an OnDownloadBegin event handler.

Note:	Unlike the OnNavigateComplete2 event, OnDownloadComplete occurs even if the Web browser does not successfully navigate to an URL.


TWebBrowser.OnFullScreen

TWebBrowser

Not used in TWebBrowser.

property OnFullScreen: TWebBrowserOnFullScreen;

Description

Do not use this event. It is included in the TWebBrowser interface because the IWebBrowser2 interface is shared with Internet Explorer. OnFullScreen occurs with Internet Explorer when the application is maximized or restored from a maximized state.


TWebBrowser.OnMenuBar

TWebBrowser

Not used in TWebBrowser.

property OnMenuBar: TWebBrowserOnMenuBar;

Description

Do not use this event. It is included in the TWebBrowser interface because the IWebBrowser2 interface is shared with Internet Explorer. OnMenuBar occurs with Internet Explorer when the menu bar is hidden or shown.


TWebBrowser.OnNavigateComplete2

TWebBrowser	See also	Example

Occurs immediately after the Web browser successfully navigates to a new location.

type TWebBrowserNavigateComplete2 = procedure(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant) of object;

property OnNavigateComplete2: TWebBrowserNavigateComplete2;

Description

Write an OnNavigateComplete2 event handler to take specific action when the Web browser successfully navigates to a new resource. The event can occur before the document is fully downloaded, but when it occurs at least part of the document must be received and a viewer for the document created.

Sender is the Web browser that navigated to the new resource.

pDisp is the Automation interface of the browser.

URL is the URL, UNC file name, or PIDL that to which the Web browser navigated. This URL can be different from the URL to which the browser was told to navigate. For example, the browser may have been redirected by the target resource or by an OnBeforeNavigate2 event handler. In addition, the value of URL is the canonicalized and qualified URL: for example, if an application specified a URL of "www.borland.com" in a call to the Navigate or Navigate2 method, the URL in the OnDocumentComplete event handler is  "http://www.borland.com/".

Note:	Unlike the OnDownloadComplete event, OnNavigateComplete2 does not occur if the operation is not successful.


TWebBrowser.OnNewWindow2

TWebBrowser	See also

Occurs when a new, hidden, non-navigated Web browser window is needed.

type TWebBrowserNewWindow2 = procedure(Sender: TObject; var ppDisp: IDispatch; var Cancel: WordBool) of object;

property OnNewWindow2: TWebBrowserNewWindow2;

Description

Write an OnNewWindow2 to take specific action immediately before the Web browser creates a new window for displaying a resource. This window may be needed because the user shift-clicked on a link, the user right-clicked on a link and chose "open in new window", the frame for the target URL does not yet exist, or the Navigate or Navigate2 requested that the target document appear in a new window.

Sender is the WebBrowser that needs a new window to display its target resource.

ppDisp optionally returns the interface for a newly created, hidden, TWebBrowser component that can act as the new window. The Web browser configures this component and navigates to the target URL, starting with an OnBeforeNavigate2 event. If the event handler does not create a component and return its interface as the ppDisp parameter, the Web browser generates a top-level window as a separate, nonhosted process.

Cancel allows the event handler to block the creation of a new window. When the event handler sets Cancel to True, the Web browser tries to display the target resource in its current window, starting with an OnBeforeNavigate2 event.

Note:	The event handler should not return a value for ppDisp when setting Cancel to True.


TWebBrowser.OnProgressChange

TWebBrowser	See also

Occurs when the progress of a download operation is updated.

type TWebBrowserProgressChange = procedure(Sender: TObject; Progress: Integer; ProgressMax: Integer) of object;

property OnProgressChange: TWebBrowserProgressChange;

Description

Write an OnProgressChange event handler to provide visual feedback about the download process. For example, an OnProgressChange event handler can update a TProgressBar component or display the number of bytes downloaded so far.

Sender is the Web browser control that is in the process of downloading a document.

Progress indicates how much of the document has already been downloaded, on a scale of 0 to ProgressMax. When Progress is –1, the operation is finished.

ProgressMax indicates the total size of the download operation.

Tip:	To calculate the percentage of progress to show in a progress indicator (when Progress is not –1), multiply the value of Progress by 100 and divide by the value of ProgressMax.


TWebBrowser.OnPropertyChange

TWebBrowser

Not used in TWebBrowser.

property OnPropertyChange: TWebBrowserPropertyChange;

Description

Do not use this event. It is included in the TWebBrowser interface because the IWebBrowser2 interface is shared with Internet Explorer. OnPropertyChange occurs with Internet Explorer when a property is modified using the PutProperty method.


TWebBrowser.OnQuit

TWebBrowser

Not used in TWebBrowser.

property OnQuit: TNotifyEvent;

Description

Do not use this event. It is included in the TWebBrowser interface because the IWebBrowser2 interface is shared with Internet Explorer. OnQuit occurs when the Internet Explorer is about to shut down.


TWebBrowser.OnStatusBar

TWebBrowser

Not used in TWebBrowser.

property OnStatusBar: TWebBrowserOnStatusBar;

Description

Do not use this event. It is included in the TWebBrowser interface because the IWebBrowser2 interface is shared with Internet Explorer. OnStatusBar occurs when the Internet Explorer first shows or hides its status bar.


TWebBrowser.OnStatusTextChange

TWebBrowser

Not used in TWebBrowser.

property OnStatusTextChange: TWebBrowserStatusTextChange;

Description

Do not use this event. It is included in the TWebBrowser interface because the IWebBrowser2 interface is shared with Internet Explorer. OnStatusTextChange occurs when the text displayed in the Internet Explorer’s status bar changes.


TWebBrowser.OnTheaterMode

TWebBrowser

Not used in TWebBrowser.

property OnTheaterMode: TWebBrowserOnTheaterMode;

Description

Do not use this event. It is included in the TWebBrowser interface because the IWebBrowser2 interface is shared with Internet Explorer. OnTheaterMode occurs when the Internet Explorer changes into or out of theater mode.


TWebBrowser.OnTitleChange

TWebBrowser	See also

Occurs when the title of a document in the WebBrowser control becomes available or changes.

type TWebBrowserTitleChange = procedure(Sender: TObject; const Text: WideString) of object;

property OnTitleChange: TWebBrowserTitleChange;

Description

Write an OnTitleChange event handler to respond when the Web browser obtains information about the document title. Because the title can change while an HTML page is downloading, LocationName is originally set to the URL of the document. After the title specified in the HTML page, if any, becomes available, LocationName is changed to reflect the actual title.

The Sender parameter is the Web browser that is unloading a document.

Text is the newly-available title of the document.


TWebBrowser.OnToolBar

TWebBrowser

Not used in TWebBrowser.

property OnToolBar: TWebBrowserOnToolBar;

Description

Do not use this event. It is included in the TWebBrowser interface because the IWebBrowser2 interface is shared with Internet Explorer. OnToolBar occurs when the Internet Explorer changes which tool bars are visible.


TWebBrowser.OnVisible

TWebBrowser	See also

Occurs when the Web browser window is about to be shown or hidden.

type TWebBrowserOnVisible = procedure(Sender: TObject; Visible: WordBool) of object;

property OnVisible: TWebBrowserOnVisible;

Description

Write an OnVisible event handler to make adjustments to compensate for the appearance or disappearance of the Web browser window.

The Sender parameter is the Web browser whose Visible property is changing.

Visible is True if the Web browser is about to appear, False if the Web browser is about to be hidden.


TWebBrowser methods

TWebBrowser	Alphabetically

In TWebBrowser

ClientToWindow

ExecWB

GetProperty

GoBack

GoForward

GoHome

GoSearch

Navigate

Navigate2

PutProperty

QueryStatusWB

Quit

Refresh

Refresh2

ShowBrowserBar

Stop

Derived from TOLEControl

BrowseProperties

Create

DefaultHandler

Destroy

DoObjectVerb

GetEnumPropDesc

GetHelpContext

GetObjectVerbs

GetPropDisplayString

GetPropDisplayStrings

IsCustomProperty

IsPropPageProperty

SetBounds

SetPropDisplayString

ShowAboutBox

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWebBrowser methods

TWebBrowser	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

BrowseProperties

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ClientToWindow

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DoObjectVerb

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

ExecWB

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetEnumPropDesc

GetHelpContext

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetObjectVerbs

GetParentComponent

GetPropDisplayString

GetPropDisplayStrings

GetProperty

GetTabOrderList

GetTextBuf

GetTextLen

GoBack

GoForward

GoHome

GoSearch

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsCustomProperty

IsPropPageProperty

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

Navigate

Navigate2

NewInstance

PaintTo

Perform

PutProperty

QueryStatusWB

Quit

Realign

Refresh

Refresh2

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetPropDisplayString

SetTextBuf

Show

ShowAboutBox

ShowBrowserBar

Stop

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TWebBrowser.ClientToWindow

TWebBrowser

Not used in TWebBrowser.

procedure ClientToWindow(var pcx: SYSINT; var pcy: SYSINT);

Description

Do not use this method. It is included in the TWebBrowser interface because the IWebBrowser2 interface is shared with Internet Explorer. Internet Explorer uses ClientToWindow to convert between client coordinates and window coordinates.


TWebBrowser.ExecWB

TWebBrowser	See also

Executes a command.

type

  OLECMDID = TOleEnum;

  OLECMDEXECOPT = TOleEnum;

procedure ExecWB(cmdID: OLECMDID; cmdexecopt: OLECMDEXECOPT); overload;

procedure ExecWB(cmdID: OLECMDID; cmdexecopt: OLECMDEXECOPT; var pvaIn: OleVariant); overload;

procedure ExecWB(cmdID: OLECMDID; cmdexecopt: OLECMDEXECOPT; var pvaIn: OleVariant; var pvaOut: OleVariant); overload;

Description

ExecWB lets you use the IOleCommandTarget interface to pass a command to the Web browser control. For more information, see the Microsoft documentation of IOleCommandTarget.

cmdID specifies the command to execute. Microsoft provides the following constants. However, the Web Browser does not support all of these commands. Use the QueryStatusWB method to determine what commands can be used.

OLECMDID_OPEN	OLECMDID_NEW	OLECMDID_SAVE

OLECMDID_SAVEAS	OLECMDID_SAVECOPYAS	OLECMDID_PRINT

OLECMDID_PRINTPREVIEW 	OLECMDID_PAGESETUP	OLECMDID_SPELL

OLECMDID_PROPERTIES	OLECMDID_CUT	OLECMDID_COPY

OLECMDID_PASTE	OLECMDID_PASTESPECIAL	OLECMDID_UNDO

OLECMDID_REDO	OLECMDID_SELECTALL	OLECMDID_CLEARSELECTION

OLECMDID_ZOOM 	OLECMDID_GETZOOMRANGE	OLECMDID_UPDATECOMMANDS

OLECMDID_REFRESH	OLECMDID_STOP	OLECMDID_HIDETOOLBARS

OLECMDID_SETPROGRESSMAX	OLECMDID_SETPROGRESSPOS	OLECMDID_SETPROGRESSTEXT

OLECMDID_SETTITLE	OLECMDID_SETDOWNLOADSTATE 	OLECMDID_STOPDOWNLOAD

OLECMDID_FIND	OLECMDID_ONTOOLBARACTIVATED	OLECMDID_DELETE

OLECMDID_HTTPEQUIV	OLECMDID_ENABLE_INTERACTION	OLECMDID_HTTPEQUIV_DONE

OLECMDID_ONUNLOAD	OLECMDID_PROPERTYBAG2	OLECMDID_PREREFRESH

cmdexecopt modifies how the command is executed. The following table lists the possible values:

Constant	Value	Meaning

OLECMDEXECOPT_DODEFAULT	0	Use the default behavior, whether prompting the user for input or not.

OLECMDEXECOPT_PROMPTUSER	1	Execute the command after obtaining user input.

OLECMDEXECOPT_DONTPROMPTUSER	2	Execute the command without prompting the user.

OLECMDEXECOPT_SHOWHELP	3	Show help for the command, but do not execute it.

pvaIn specifies a Variant array that contains any input arguments. This value can be omitted if there are not input arguments.

pvaOut	specifies a Variant that receives the results of the command, if any. This value can be omitted if there are no results.


TWebBrowser.GetProperty

TWebBrowser

Not used in TWebBrowser.

function  GetProperty(const Property_: WideString): OleVariant;

Description

Do not use this method. It is included in the TWebBrowser interface because the IWebBrowser2 interface is shared with Internet Explorer. Internet Explorer uses GetProperty to return a property value.


TWebBrowser.GoBack

TWebBrowser	See also

Navigates to the previous item in the history list.

procedure GoBack;

Description

Call GoBack to return to the last document in the history list. GoBack has no effect unless the history list contains additional documents.

Note:	The Navigate or Navigate2 command can change the history list, depending on the specified flags.


TWebBrowser.GoForward

TWebBrowser	See also

Navigates to the next item in the history list.

procedure GoForward;

Description

Call GoForward to return to the next document in the history list. GoForward reverses the effect of the last GoBack command.


TWebBrowser.GoHome

TWebBrowser	See also

Navigates to the current start page.

procedure GoForward;

Description

Call GoHome to navigate to the registered home or start page. The URL for this page is specified in the Registry at

HKEY_CURRENT_USERS\Software\Microsoft\Internet Explorer\Main

under the name Startpage. You can change this value using the TRegistry or TRegistryIniFile object, or using Navigation tab of the Internet Explorer’s Options dialog.


TWebBrowser.GoSearch

TWebBrowser	See also

Navigates to the current search page.

procedure GoSearch;

Description

Call GoSearch to navigate to the registered search page. The URL for this page is specified in the Registry at

HKEY_CURRENT_USERS\Software\Microsoft\Internet Explorer\Main

under the name SearchPage. You can change this value using the TRegistry or TRegistryIniFile object, or using Navigation tab of the Internet Explorer’s Options dialog.


TWebBrowser.Navigate

TWebBrowser	See also

Navigates to a resource identified by a path name or URL.

procedure Navigate(const URL: WideString); overload;

procedure Navigate(const URL: WideString; var Flags: OleVariant); overload;

procedure Navigate(const URL: WideString; var Flags: OleVariant; var TargetFrameName: OleVariant); overload;

procedure Navigate(const URL: WideString; var Flags: OleVariant; var TargetFrameName: OleVariant; var PostData: OleVariant); overload;

procedure Navigate(const URL: WideString; var Flags: OleVariant; var TargetFrameName: OleVariant; var PostData: OleVariant; var Headers: OleVariant); overload;

Description

Use Navigate to locate and download a specific resource. Navigate can send an HTTP message to a specified URL and display the results or simply display the results of a specified file.

URL specifies the UNC path name of a file or the Uniform Resource Locator of an Internet resource that the Web browser should display.

Flags is a set of values that specify whether to add the resource to the history list, whether to read from or write to the cache, and whether to display the resource in a new window. It can be a sum of zero or more of the following:

Constant	Value	Meaning

navOpenInNewWindow	1	Open the resource or file in a new window.

navNoHistory	2	Do not add the resource or file to the history list. The new page replaces the current page in the list.

navNoReadFromCache	4	Do not read from the disk cache for this navigation.

navNoWriteToCache	8	Do not write the results of this navigation to the disk cache.

navAllowAutosearch	16	If the navigation fails, the Web browser attempts to navigate common root domains (.com, .edu, and so on). If this still fails, the URL is passed to a search engine.

TargetFrameName is the name of the frame in which the resource will be displayed, or NULL if the resource should not be displayed in a named frame.

PostData contains the data sent to the server when using Navigate to generate an HTTP POST message. If PostData is NULL, Navigate generates an HTTP GET message. PostData is ignored if URL does not specify an HTTP URL.

Headers contains any headers sent to the servers when the URL represents an HTTP URL. HTTP headers specify such things as the intended action required of the server, the type of data, and so on. (See TWebRequest object, whose properties represent many of the more common headers).

Note:	To navigate to a location that can’t be expressed as an URL (for example, to an item identifier list), use the Navigate2 method instead.


TWebBrowser.Navigate2

TWebBrowser	See also

Navigates to a specified resource.

procedure Navigate2(var URL: OleVariant); overload;

procedure Navigate2(var URL: OleVariant; var Flags: OleVariant); overload;

procedure Navigate2(var URL: OleVariant; var Flags: OleVariant; var TargetFrameName: OleVariant); overload;

procedure Navigate2(var URL: OleVariant; var Flags: OleVariant; var TargetFrameName: OleVariant; var PostData: OleVariant); overload;

procedure Navigate2(var URL: OleVariant; var Flags: OleVariant; var TargetFrameName: OleVariant; var PostData: OleVariant; var Headers: OleVariant); overload;

Description

Use Navigate2 to locate and download a specific resource. Navigate can send an HTTP message to a specified URL and display the results, display the results of a specified file, or navigate to a resource that can’t be expressed as an URL such as an item identifier list.

URL specifies the UNC path name of a file, the Uniform Resource Locator of an Internet resource, or a pointer to an item identifier list (PIDL).

Flags is a set of values that specify whether to add the resource to the history list, whether to read from or write to the cache, and whether to display the resource in a new window. It can be a sum of zero or more of the following:

Constant	Value	Meaning

navOpenInNewWindow	1	Open the resource or file in a new window.

navNoHistory	2	Do not add the resource or file to the history list. The new page replaces the current page in the list.

navNoReadFromCache	4	Do not read from the disk cache for this navigation.

navNoWriteToCache	8	Do not write the results of this navigation to the disk cache.

navAllowAutosearch	16	If the navigation fails, the Web browser attempts to navigate common root domains (.com, .edu, and so on). If this still fails, the URL is passed to a search engine.

TargetFrameName is the name of the frame in which the resource will be displayed, or NULL if the resource should not be displayed in a named frame.

PostData contains the data sent to the server when using Navigate to generate an HTTP POST message. If PostData is NULL, Navigate generates an HTTP GET message. PostData is ignored if URL does not specify an HTTP URL.

Headers contains any headers sent to the servers when the URL represents an HTTP URL. HTTP headers specify such things as the intended action required of the server, the type of data, and so on. (See TWebRequest object, whose properties represent many of the more common headers).


TWebBrowser.PutProperty

TWebBrowser

Not used in TWebBrowser.

procedure PutProperty(const Property_: WideString; vtValue: OleVariant);

Description

Do not use this method. It is included in the TWebBrowser interface because the IWebBrowser2 interface is shared with Internet Explorer. Internet Explorer uses PutProperty to set a property value.


TWebBrowser.QueryStatusWB

TWebBrowser	See also

Returns information about what commands the Web browser supports.

type

  OLECMDID = TOleEnum;

  OLECMDF = TOleEnum;

function  QueryStatusWB(cmdID: OLECMDID): OLECMDF;

Description

Use QueryStatusWB to determine what commands can be executed using the ExecWB method. QueryStatusWB uses the QueryStatus method of the IOleCommandTarget interface to obtain information about the status of commands. For more information, see the Microsoft documentation of IOleCommandTarget.

cmdID specifies the command about which you want information. See the ExecWB method for a list of possible cmdID values.

QueryStatusWB returns a value made by adding together zero of more of the following:

Constant	Value	Meaning

OLECMDF_SUPPORTED	1	The Web browser control supports the command (but it may not be enabled).

OLECMDF_ENABLED	2	The command is currently enabled.

OLECMDF_LATCHED	4	The command is an on/off toggle that is currently on.

OLECMDF_NINCHED	8	Not currently used.


TWebBrowser.Quit

TWebBrowser

Not used in TWebBrowser.

procedure Quit;

Description

Do not use this method. It is included in the TWebBrowser interface because the IWebBrowser2 interface is shared with Internet Explorer. Internet Explorer responds to Quit by shutting down.


TWebBrowser.Refresh

TWebBrowser	See also

Reloads the current document.

procedure Refresh;

Description

Call Refresh to reload the current document. This is useful when the Web browser is displaying the resource at an URL that may have changed.

Refresh always sends a pragma:nocache header, telling the server not to return a cached copy. This can cause problems with some servers. To prevent the pragma:nocache header, or to refresh only expired pages, use the Refresh2 method instead.


TWebBrowser.Refresh2

TWebBrowser	See also

Reloads the current document if necessary.

procedure Refresh2; overload;

procedure Refresh2(var Level: OleVariant); overload;

Description

Call Refresh2 to reload the current document. Unlike the Refresh method, Refresh2 lets you specify what level of refresh to perform.

Level indicates what type of information is refreshed. The following table lists the possible values:

Constant	Value	Meaning

REFRESH_NORMAL	0	Perform a lightweight refresh that does not include the pragma:nocache header. The pragma:nocache header tells the server not to return a cached copy. This can cause problems with some servers.

REFRESH_IFEXPIRED	1	Only refresh if the page has expired. Do not include the pragma:nocache header.

REFRESH_CONTINUE	2	For internal use only.

REFRESH_COMPLETELY	3	Perform a full refresh, including the pragma:nocache header. Using this option is the same as calling the Refresh method.

When Level is omitted, a value of REFRESH_COMPLETELY is assumed.


TWebBrowser.ShowBrowserBar

TWebBrowser

Not used in TWebBrowser

procedure ShowBrowserBar(var pvaClsid: OleVariant);

procedure ShowBrowserBar(var pvaClsid: OleVariant; var pvarShow: OleVariant);

procedure ShowBrowserBar(var pvaClsid: OleVariant; var pvarShow: OleVariant; var pvarSize: OleVariant);

Description

Do not use this method. It is included in the TWebBrowser interface because the IWebBrowser2 interface is shared with Internet Explorer. Internet Explorer uses ShowBrowserBar to show or hide a specified browser bar.


TWebBrowser.Stop

TWebBrowser	See also

Stops the current operation.

procedure Stop;

Description

Stop cancels any pending navigation or download operation and terminates any dynamic page elements, such as background sounds and animations.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TOleControl


TWebModule

Hierarchy	Properties	Methods	Events	See also

TWebModule is the automatically generated Web module for a Web server application.

Unit

httpapp

Description

When a new Web application is created, it automatically contains a Web module. The Web module serves as a repository for non-visual components such as TPageProducer, TSession, TTable, TDataSetTableProducer, etc. It also enables the Web server application to respond to HTTP request messages by passing the request and response objects to the appropriate action items. An application can have only one Web module.

The TWebModule object manages a collection of action items which know how to respond to HTTP request messages. View, add and delete the action items managed by the Web module using the Action editor which is opened by double clicking on the TWebModule icon.

If a data module already exists which contains many of the non-visual components and business rules for the application, the Web module can be replaced by that data module. Simply delete the Web module, add the new data module in its place, and add a TWebDispatcher object to the new data module.

Note:	See the WebServ demo for an example of how to use TWebModule.


TWebModule properties

TWebModule	Alphabetically	Legend

Derived from TCustomWebDispatcher

Action

Actions

Request

Response

Derived from TDataModule

DesignOffset

DesignSize

OldCreateOrder

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TWebModule properties

TWebModule	By object	Legend

Action

Actions

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

DesignOffset

DesignSize

Name

OldCreateOrder

Owner

Request

Response

Tag

VCLComObject


TWebModule events

TWebModule	Alphabetically	Legend

Derived from TCustomWebDispatcher

AfterDispatch

BeforeDispatch

Derived from TDataModule

OnCreate

OnDestroy


TWebModule events

TWebModule	By object	Legend

AfterDispatch

BeforeDispatch

OnCreate

OnDestroy


TWebModule methods

TWebModule	Alphabetically

In TWebModule

Create

Derived from TCustomWebDispatcher

ActionByName

Destroy

Derived from TDataModule

CreateNew

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWebModule methods

TWebModule	By object

ActionByName

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateNew

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException


TWebModule.Create

TWebModule	See also

Creates an instance of TWebModule.

constructor Create(AOwner: TComponent); override;

Description

Do not create  instances at runtime. The Web module is created automatically when a Web application project is created at design time. Every time a Web server application is run in response to an HTTP request message, a new TWebModule is created based on the Web module that was created at design time.

Create generates an OnCreate event, so that Web applications can initialize the Web module before the new HTTP request message is processed.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataModule

TCustomWebDispatcher


OnHTMLTag Example

This example shows an OnHTMLTag event handler that replaces tags for images based on the information in a dataset and replaces table tags with an image of the entire dataset.  The image tags have the form <#IMAGE ImageID=5> while the table tags have the form <#TABLE>.  The table of images is represented by a table component named ImageTable, which is indexed by image ID.

procedure TMyModule.ImageHTMLTag(Sender: TObject; Tag: TTag; const TagString: String; TagParams: TStrings; var ReplaceText: String);

var

  ImageID: integer;

begin

  case Tag of

    tgImage:

      begin

      ImageID := StrToInt(TagParams.Values['ImageID']);

      if ImageTable.FindKey([ImageID]) then

        ReplaceText := '<IMG SRC=' +

                       ImageTable.FieldByName('Filename').AsString +

                       ' ALT=' +

                       ImageTable.FieldByName('Description').AsString +

                       ' >'

      else

        ReplaceText := '(Unknown Image)'

      end;

    tgTable:

      begin

        ReplaceText := DataSetTableProducer1.Content;

      end;

  end;

end;


Query, OnAction, Content Example

This example shows a simple OnAction event handler that returns the content of a query table producer component as the response to matching HTTP request messages.

procedure TInfoModule.WebModule1QueryAction(Sender: TObject; Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);

begin

  if Request.QueryFields.Count = QueryTableProducer1.Query.ParamCount then

    Response.Content := QueryTableProducer1.Content;

  if Response.Content == '' then

    Handled := False; { indicate that the request was not handled }

  end;


Locate, Header, Content Example
Header, Content Example

This example shows an OnAction event handler that adds a header to a table producer component and sets the content of the current web response to display that header along with the table generated by the table producer.

procedure TCustomerInfoModule.WebModule1QueryActionAction(Sender: TObject; Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);

begin

  if Customer.Locate('CustNo', Request.QueryFields.Values['CustNo'], []) then

  begin

    CustomerOrders.Header.Clear;

    CustomerOrders.Header.Add('The following table was produced using a TDatasetTableProducer.<P>');

    CustomerOrders.Header.Add('Orders for: ' + CustomerCompany.AsString);

    Response.Content := CustomerOrders.Content;

  end

  else

    Response.Content := Format('<html><body><b>Customer: %s not found</b></body></html>',

      [Request.QueryFields.Values['CustNo']]);

end;


ContentType, ContentStream, SendResponse Example

This example shows an OnAction event handler that sends a response message that contains a jpeg image taken from a database table.

procedure TCustomerInfoModule.CustomerInfoModuleGetImageAction( Sender: TObject; Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);

var

  Jpg: TJpegImage;

  S: TMemoryStream;

  P: TPicture;

begin

  Jpg := TJpegImage.Create;

  try

    P := TPicture.Create;

    P.Assign(BioLifeGraphic);

    Jpg.Assign(P.Graphic);

    S := TMemoryStream.Create;

    try

      Jpg.SaveToStream(S);

      S.Position := 0;

      Response.ContentType := 'image/jpeg';

      Response.ContentStream := S;

      Response.SendResponse;

    finally

      P.Free;

      S.Free;

    end;

  finally

    Jpg.Free;

  end;

end;


Cookies, Add, Expires, Secure, Name, Value, Authorization Example
Cookies, Add, Expires, Secure, Name, Value, Authorization, CookieFields Example

This example shows an OnAction event handler that adds a cookie to the response message. The cookie stores the current authorization information. This allows the current client to revisit the URL without resupplying a password for a limited period (1 day). Because a password is sensitive information, the cookie can only be sent on a secure connection.

procedure TWebModule1.PasswordCookieActionAction(Sender: TObject; Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);

begin

  Handled := False; { adding a cookie does not handle the request }

  with Response.Cookies.Add do

  begin

    Name := 'LastPassword';

    { Set the LastPassword cookie to the current authorization }

    { Or, if no authorization was supplied this time, carry over }

    { the authorization from the LastPassword cookie of the request }

    Value := Request.Authorization;

    if Value = '' then

      Value :=  Request.CookieFields.Values('LastPassword');

    Secure := True; { be sure to use a secure connection!!!!}

    Expires := Now + 1; { this cookie expires in one day }

  end;

end;


Content, ContentFromString Example

This example shows an OnAction event handler that chains multiple page producers together. It  feeds the results of one page producer into another page producer using the ContentFromString method.

procedure WebModule1.Action2Action(Sender: TObject; Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);

begin

  Response.Content := PageProducer2.ContentFromString(PageProducer1.Content);

end;


OnCommandStateChange, Busy Example

This example shows an OnCommandStateChange event handler that updates a set of controls that manipulate the Web browser. BackCtrl calls the GoBack method, the FrwrdCtrl calls the GoForward method, and StopCtrl calls the Stop method. Note that these control can be buttons in a tool bar, menu items, or actions in an action list that control both tool buttons and menu items.

procedure TForm1.WebBrowser1CommandStateChange(Sender: TObject; Command: Integer; Enable: WordBool);

begin

  case Command of

    CSC_NAVIGATEBACK: BackCtrl.Enabled := Enable;

    CSC_NAVIGATEFORWARD: FrwrdCtrl.Enabled := Enable;

    CSC_UPDATECOMMANDS: StopCtrl.Enabled := TWebBrowser(Sender).Busy;

  end;

end;


OnNavigateComplete2, OnDocumentComplete Example

This example shows how to detect when a document is completely loaded, even if it includes multiple frames. Only the final OnDocumentComplete event passes the same Dispatch interface as the OnNavigateComplete event handler.

var

  CurDispatch: IDispatch; {save the interface globally }

procedure TForm1.WebBrowser1NavigateComplete2(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant);

begin

  if CurDispatch = nil then

    CurDispatch := pDisp; { save for comparison }

end;

procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant);

begin

  if (pDisp = CurDispatch) then

  begin

    Beep; {the document is loaded, not just a frame }

    CurDispatch := nil; {clear the global variable }

  end;

end;


TWinSocketStream

Hierarchy	Properties	Methods	See also

TWinSocketStream is a stream that provides services which allow applications to read from or write to socket connections.

Unit

scktcomp

Description

Use TWinSocketStream to read or write information over a blocking socket connection. Windows socket objects include methods to read from or write to the socket connection they represent. However, these methods do not provide a mechanism for timing out when the socket connection is dropped or for waiting until the socket connection is ready before reading.

When the socket is a non-blocking socket, this lack of a timeout or waiting mechanism is not a problem, because reading and writing occur asynchronously in response to notifications from the socket connection. For blocking sockets, however, these mechanisms provided by TWinSocketStream are necessary so that the application using the socket does not hang indefinitely.

To use a Windows socket stream, create an instance of TWinSocketStream, use the methods of the stream to read or write the data, and then free the Windows socket stream.

Note:	TWinSocketStream does not work with non-blocking sockets.


TWinSocketStream properties

TWinSocketStream	Alphabetically

In TWinSocketStream

TimeOut

Derived from TStream

Position

Size


TWinSocketStream properties

TWinSocketStream	By object

Position

Size

TimeOut


TWinSocketStream.TimeOut

TWinSocketStream	See also

Specifies the time, in milliseconds, that the socket stream should wait before timing out on a read or write call.

property TimeOut: Longint;

Description

Set TimeOut to the amount of time that should elapse before a read or write operation aborts under the assumption that the socket connection has failed.


TWinSocketStream methods

TWinSocketStream	Alphabetically

In TWinSocketStream

Create

Destroy

Read

Seek

WaitForData

Write

Derived from TStream

CopyFrom

FixupResourceHeader

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TWinSocketStream methods

TWinSocketStream	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

CopyFrom

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

FixupResourceHeader

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Read

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

SafeCallException

Seek

WaitForData

Write

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader


TWinSocketStream.Create

TWinSocketStream	See also	Example

Creates an instance of TWinSocketStream for a Windows socket object.

constructor Create(ASocket: TCustomWinSocket; TimeOut: Longint);

Description

Call Create to obtain an instance of TWinSocketStream for reading from or writing to the socket connection represented by the ASocket parameter. ASocket should be the endpoint of an open blocking socket connection to another Windows socket.

Create associates the stream with the socket connection, and allocates helper objects to allow it to determine when the socket connection is ready for reading or writing. The TimeOut property is initialized to the value of the TimeOut parameter.

If ASocket represents a non-blocking socket connection, Create raises an ESocketError exception.


TWinSocketStream.Destroy

TWinSocketStream	See also

Destroys an instance of TWinSocketStream.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead call Free. Free verifies that the TWinSocketStream reference is not nil and only then calls Destroy.

Free the TWinSocketStream object when it is no longer needed for reading from or writing to the socket connection.

Destroy frees the helper objects allocated in the Create method before calling the default destructor.


TWinSocketStream.Read

TWinSocketStream	See also 	Example

Reads up to Count bytes from the socket connection into Buffer.

function Read(var Buffer; Count: Longint): Longint; override;

Description

Use Read to read data from the socket connection when the number of bytes to be transferred is unknown. Buffer must have at least Count bytes allocated to hold the data that is read from the connection. Read returns the number of bytes actually transferred (which may be less than the number requested in Count.)

Read may return 0 if the socket connection is extremely slow and the read operation has not completed after TimeOut milliseconds. This ensures that the Read method does not hang indefinitely when a problem occurs with the socket connection.

To guard against the Read method timing out because of a slow connection, set Count fairly low, and make several calls to Read, rather than fewer calls with a large value of Count.

To ensure that the socket connection is ready to send data before calling Read, use the WaitForData method.

Unlike the ReadBuffer method, Read does not raise an exception if Count bytes are not read from the socket connection.


TWinSocketStream.Seek

TWinSocketStream	See also

Always returns 0.

function Seek(Offset: Longint; Origin: Word): Longint; override;

Description

Seek overrides the inherited method to always set the Position property of the TWinSocketStream object to 0. Socket connections do not support random access. The Position property of a Windows socket stream can only reflect the position at the beginning of all remaining data.


TWinSocketStream.WaitForData

TWinSocketStream	See also 	Example

Waits up to Timeout milliseconds for the socket connection to be ready to transfer data.

function WaitForData(Timeout: Longint): Boolean;

Description

Call WaitForData to ensure that the socket connection is ready to read or write information. WaitForData returns True if the socket connection is ready. WaitForData returns False if the socket connection is not ready after Timeout milliseconds elapse.

Call WaitForData before reading or writing information over the socket connection. Otherwise, Read or Write method calls may time out before any data is transferred.


TWinSocketStream.Write

TWinSocketStream	See also 	Example

Writes Count bytes from Buffer to the socket connection.

function Write(const Buffer; Count: Longint): Longint; override;

Description

Use Write to write data from a Buffer to the socket connection. Write returns the number of bytes transferred.

Write may return 0 if the socket connection is extremely slow and the write operation has not completed after TimeOut milliseconds. This ensures that the Write method does not hang indefinitely when a problem occurs with the socket connection.

To guard against the Write method timing out because of a slow connection, set Count fairly low, and make several calls to Write, rather than fewer calls with a large value of Count.

Unlike the WriteBuffer method, Write does not raise an exception if Count bytes are not written. For example, if the connection is too slow to transfer all the data, Write will return 0, where WriteBuffer will raise an exception.


Hierarchy

TObject

TStream


TAction

Hierarchy	Properties	Methods	Events	See also

TAction is the generic class for creating action objects that implement user commands across a range of different controls.

Unit

ActnList

Description

TAction implements the generic behavior introduced in TCustomAction. TAction publishes many of the properties inherited from TCustomAction, but does not introduce any new behavior.

Use action objects, in conjunction with action lists and action links, to centralize the response to user commands (actions). You can derive from TAction, if you wish to retain the published scope of TCustomAction members, or derive from TCustomAction if you wish to modify their scope.

For specialized actions that augment the behavior of TAction, see the action classes in the StdActns and DbActns units. For more information about using Actions and Action lists, see Using action lists.


TAction properties

TAction	Alphabetically	Legend

Derived from TCustomAction

Caption

Checked

DisableIfNoHandler

Enabled

HelpContext

Hint

ImageIndex

Name

ShortCut

Visible

Derived from TContainedAction

ActionList

Category

Index

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TAction properties

TAction	By object	Legend

ActionList

Caption

Category

Checked

ComObject

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

DisableIfNoHandler

Enabled

HelpContext

Hint

ImageIndex

Index

Name

Owner

ShortCut

Tag

VCLComObject

Visible


TAction events

TAction	Alphabetically	Legend

Derived from TCustomAction

OnHint

Derived from TBasicAction

OnExecute

OnUpdate


TAction events

TAction	By object	Legend

OnExecute

OnHint

OnUpdate


TAction methods

TAction	Alphabetically

Derived from TCustomAction

Create

Destroy

DoHint

Execute

Derived from TContainedAction

GetParentComponent

Update

Derived from TBasicAction

ExecuteTarget

HandlesTarget

RegisterChanges

UnRegisterChanges

UpdateTarget

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TAction methods

TAction	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DoHint

Execute

ExecuteAction

ExecuteTarget

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HandlesTarget

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RegisterChanges

RemoveComponent

SafeCallException

UnRegisterChanges

Update

UpdateAction

UpdateTarget


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TBasicAction

TContainedAction

TCustomAction


TActionLink

Hierarchy	Properties	Methods	Events

TActionLink is the base class for action links that connect actions to commonly used properties of VCL objects, components and controls.

Unit

ActnList

Description

TActionLink introduces method prototypes to manage links between actions and their VCL object clients. TActionLink methods ensure that the action is of the appropriate type to support actions for the client. These methods are overriden in descendant classes to ensure the appropriate connection between the action event and the client property.

Unimplemented method prototypes are also introduced in TActionLink as interfaces for setting actions on client properties via an action link. Descendant action link classes override these methods to ensure the appropriate behavior for their client type.

Use TActionLink as a base class if you want to link actions with clients that are not controls or menu items. TActionLink introduces interfaces for methods that support the following actions, most of which are linked with properties of the same name:

Caption

Checked

Enabled

HelpContext

Hint

ImageIndex

ShortCut

Visible


TActionLink properties

TActionLink	Alphabetically

Derived from TBasicActionLink

Action


TActionLink properties

TActionLink	By object

Action


TActionLink events

TActionLink	Alphabetically

Derived from TBasicActionLink

OnChange


TActionLink events

TActionLink	By object

OnChange


TActionLink methods

TActionLink	Alphabetically	Legend

In TActionLink

IsCaptionLinked

IsCheckedLinked

IsEnabledLinked

IsHelpContextLinked

IsHintLinked

IsImageIndexLinked

IsShortCutLinked

IsVisibleLinked

SetCaption

SetChecked

SetEnabled

SetHelpContext

SetHint

SetImageIndex

SetShortCut

SetVisible

Derived from TBasicActionLink

Create

Destroy

Execute

Update

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TActionLink methods

TActionLink	By object	Legend

AfterConstruction

BeforeDestruction

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

Execute

FieldAddress

FreeInstance

Free

GetInterfaceEntry

GetInterfaceTable

GetInterface

InheritsFrom

InitInstance

InstanceSize

IsCaptionLinked

IsCheckedLinked

IsEnabledLinked

IsHelpContextLinked

IsHintLinked

IsImageIndexLinked

IsShortCutLinked

IsVisibleLinked

MethodAddress

MethodName

NewInstance

SafeCallException

SetCaption

SetChecked

SetEnabled

SetHelpContext

SetHint

SetImageIndex

SetShortCut

SetVisible

Update


TActionLink.IsCaptionLinked

TActionLink	See also

Introduces a method prototype to determine whether the action, for the caption, and client are linked.

function IsCaptionLinked: Boolean; virtual;

Description

IsCaptionLinked ensures that the action type supports the appropriate event for the client. Descendant classes override IsCaptionLinked to determine whether the action, for the caption, is linked with the appropriate client property. IsCaptionLinked returns True if the client requests that the action control this event, False otherwise.


TActionLink.IsCheckedLinked

TActionLink	See also

Introduces a method prototype to determine whether the action, for the checked state, and client are linked.

function IsCheckedLinked: Boolean; virtual;

Description

IsCheckedLinked ensures that the action type supports the appropriate event for the client. Descendant classes override IsCheckedLinked to determine whether the action, for the checked state, is linked with the appropriate client property. IsCheckedLinked returns True if the client requests that the action control this event, False otherwise.


TActionLink.IsEnabledLinked

TActionLink	See also

Introduces a method prototype to determine whether the action, for the enabled state, and client are linked.

function IsEnabledLinked: Boolean; virtual;

Description

IsEnabledLinked ensures that the action type supports the appropriate event for the client. Descendant classes override IsEnabledLinked to determine whether the action, for the enabled state, is linked with the appropriate client property. IsEnabledLinked returns True if the client requests that the action control this event, False otherwise.


TActionLink.IsHelpContextLinked

TActionLink	See also

Introduces a method prototype to determine whether the action, for the help context, and client are linked.

function IsHelpContextLinked: Boolean; virtual;

Description

IsHelpContextLinked ensures that the action type supports the appropriate event for the client. Descendant classes override IsHelpContextLinked to determine whether the action, for the help context, is linked with the appropriate client property. IsHelpContextLinked returns True if the client requests that the action control this event, False otherwise.


TActionLink.IsHintLinked

TActionLink	See also

Introduces a method prototype to determine whether the action, for the hint, and client are linked.

function IsHintLinked: Boolean; virtual;

Description

IsHintLinked ensures that the action type supports the appropriate event for the client. Descendant classes override IsHintLinked to determine whether the action, for the hint, is linked with the appropriate client property. IsHintLinked returns True if the client requests that the action control this event, False otherwise.


TActionLink.IsImageIndexLinked

TActionLink	See also

Introduces a method prototype to determine whether the action, for the image index, and client are linked.

function IsImageIndexLinked: Boolean; virtual;

Description

IsImageIndexLinked ensures that the action type supports the appropriate event for the client. Descendant classes override IsImageIndexLinked to determine whether the action, for the image index, is linked with the appropriate client property. IsImageIndexLinked returns True if the client requests that the action control this event, False otherwise.


TActionLink.IsShortCutLinked

TActionLink	See also

Introduces a method prototype to determine whether the action, for the shortcut, and client are linked.

function IsShortCutLinked: Boolean; virtual;

Description

IsShortCutLinked ensures that the action type supports the appropriate event for the client. Descendant classes override IsShortCutLinked to determine whether the action, for the short cut, is linked with the appropriate client property. IsShortCutLinked returns True if the client requests that the action control this event, False otherwise.


TActionLink.IsVisibleLinked

TActionLink	See also

Introduces a method prototype to determine whether the action, for the visible state, and client are linked..

function IsVisibleLinked: Boolean; virtual;

Description

IsVisibleLinked ensures that the action type supports the appropriate event for the client. Descendant classes override IsVisibleLinked to determine whether the action, for the visible state, is linked with the appropriate client property. IsVisibleLinked returns True if the client requests that the action control this event, False otherwise.


TActionLink.SetCaption

TActionLink	See also

Introduces an interface for the action of setting the caption on a client.

procedure SetCaption(const Value: string); virtual;

Description

SetCaption is a method prototype that introduces an interface for the action of setting the caption on a client, via the action link. Value specifies the string to which the caption should be set.

Descendant action link classes override SetCaption to ensure the appropriate behavior for their client type.


TActionLink.SetChecked

TActionLink	See also

Introduces an interface for the action of setting the checked state of a client.

procedure SetChecked(Value: Boolean); virtual;

Description

SetChecked is a method prototype that introduces an interface for the action of setting the checked state of a client, via the action link. Value specifies whether the checked state should be set.

Descendant action link classes override SetChecked to ensure the appropriate behavior for their client type.


TActionLink.SetEnabled

TActionLink	See also

Introduces an interface for the action of setting the enabled state of a client.

procedure SetEnabled(Value: Boolean); virtual;

Description

SetEnabled is a method prototype that introduces an interface for the action of setting the enabled state of a client, via the action link. Value specifies whether the enabled state should be set.

Descendant action link classes override SetEnabled to ensure the appropriate behavior for their client type.


TActionLink.SetHelpContext

TActionLink	See also

Introduces an interface for the action of setting the help context of a client.

procedure SetHelpContext(Value: THelpContext); virtual;

Description

SetHelpContext is a method prototype that introduces an interface for the action of setting the help context of a client, via the action link. Value specifies the value to which the help context should be set.

Descendant action link classes override SetHelpContext to ensure the appropriate behavior for their client type.


TActionLink.SetHint

TActionLink	See also

Introduces an interface for the action of setting the hint for a client.

procedure SetHint(const Value: string); virtual;

Description

SetHint is a method prototype that introduces an interface for the action of setting the hint for a client, via the action link. Value specifies the string to which the hint should be set.

Descendant action link classes override SetHint to ensure the appropriate behavior for their client type.


TActionLink.SetImageIndex

TActionLink	See also

Introduces an interface for the action of setting the image index for a client.

procedure SetImageIndex(Value: Integer); virtual;

Description

SetImageIndex is a method prototype that introduces an interface for the action of setting the image index for a client, via the action link. Value specifies the index to which the image for the client should be set.

Descendant action link classes override SetImageIndex to ensure the appropriate behavior for their client type.


TActionLink.SetShortCut

TActionLink	See also

Introduces an interface for the action of setting the shortcut for a client.

procedure SetShortCut(Value: TShortCut); virtual;

Description

SetShortCut is a method prototype that introduces an interface for the action of setting the shortcut for a client, via the action link. Value specifies the TShortCut to which the shortcut should be set.

Descendant action link classes override SetShortCut to ensure the appropriate behavior for their client type.


TActionLink.SetVisible

TActionLink	See also

Introduces an interface for the action of setting the visible state of a client.

procedure SetVisible(Value: Boolean); virtual;

Description

SetVisible is a method prototype that introduces an interface for the action of setting the visible state of a client, via the action link. Value specifies whether the enabled state should be set.

Descendant action link classes override SetVisible to ensure the appropriate behavior for their client type.


Scope

Protected


Hierarchy

TObject

TBasicActionLink


 TActionList

Hierarchy	Properties	Methods	Events	See also

TActionList is the generic class for creating components that maintain lists of actions used with components and controls, such as menu items and buttons.

Unit

ActnList

Description

TActionList implements the generic behavior introduced in TCustomActionList, but does not introduce any new behavior. TActionList publishes some of the members inherited from TCustomActionList.

Action lists are used, in conjunction with actions and action links, to centralize the response to user commands (actions). Action list components are the user interface for working with actions. Add action list components to your form or data module from the standard page of the component palette. Double-click the action list to display the action list editor, from which you can add, delete, and rearrange actions. For more information about using action lists, see Using action lists.


TActionList properties

TActionList	Alphabetically	Legend

Derived from TCustomActionList

ActionCount

Actions

Images

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TActionList properties

TActionList	By object	Legend

ActionCount

Actions

ComObject

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

Images

Name

Owner

Tag

VCLComObject


TActionList events

TActionList	Alphabetically

Derived from TCustomActionList

OnChange

OnExecute

OnUpdate


TActionList events

TActionList	By object

OnChange

OnExecute

OnUpdate


TActionList methods

TActionList	Alphabetically

Derived from TCustomActionList

Create

Destroy

ExecuteAction

IsShortCut

UpdateAction

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TActionList methods

TActionList	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsShortCut

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TCustomActionList


TADTField

Hierarchy	Properties	Methods	Events

A TADTField object represents an ADT (Abstract Data Type) field in a dataset.

Unit

DB

Description

ADT fields are database fields that contain Abstract Data Type (ADT) values. ADTs are user defined types created on the server, and are similar to structures.  An ADT can contain most scalar field types, including array fields, reference fields, nested dataset fields, or nested ADTs.

TADTField introduces no new properties, events, or methods. It overrides the Size property and Create method to reflect the specifics of a field of type ftADT.


TADTField properties

TADTField	Alphabetically	Legend

In TADTField

Size

Derived from TObjectField

AsString

AsVariant

DataSet

FieldCount

FieldKind

Fields

FieldValues

HasConstraints

ObjectType

UnNamed

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSize

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldName

FieldNo

FullName

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TADTField properties

TADTField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldCount

FieldKind

FieldName

FieldNo

Fields

FieldValues

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Name

NewValue

ObjectType

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

UnNamed

ValidChars

Value

VCLComObject

Visible


TADTField.Size

TADTField

Size is the total number of fields of the ADT field.

property Size: Word;

Description

Size is the total number of fields contained in the ADT field, including the fields of any fields that are type ADT and nested ADT fields.


TADTField events

TADTField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TADTField events

TADTField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TADTField methods

TADTField	Alphabetically

In TADTField

Create

Derived from TObjectField

Destroy

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TADTField methods

TADTField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TADTField.Create

TADTField	See also

Creates an instance of TADTField.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TADTField. Create calls the inherited constructor and then sets the DataType to ftADT.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TObjectField


TAggregateField

Hierarchy	Properties	Methods	Events	See also

TAggregate field represents a maintained aggregate in a client dataset and enables a data-aware control to bind to the aggregate field.

Unit

Db

Description

TAggregateField represents an aggregate value from a client dataset in a form that can be used by data-aware controls. Use the Fields Editor on a ClientDataSet to create a persistent aggregate field to which a TDBText control can bind.

Like TAggregate, TAggregateField represents a calculation that summarizes the data in a set of records. When using aggregate fields, you do not need to explicitly create the corresponding aggregate object in the client dataset: the Fields editor creates that object when you create a persistent aggregate field.


TAggregateField properties

TAggregateField	Alphabetically	Legend

In TAggregateField

Active

AsString

AsVariant

Currency

DisplayFormat

DisplayName

Expression

GroupingLevel

Handle

IndexName

Precision

ResultType

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DisplayLabel

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

Precision

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Value

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TAggregateField properties

TAggregateField	By object	Legend

Active

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

Currency

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

Expression

FieldKind

FieldName

FieldNo

FullName

GroupingLevel

Handle

HasConstraints

ImportedConstraint

Index

IndexName

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

Precision

ProviderFlags

ReadOnly

Required

ResultType

Size

Tag

Text

ValidChars

Value

VCLComObject

Visible


TAggregateField.Active

TAggregateField	See also

Indicates whether the aggregate should be calculated.

property Active: Boolean;

Description

Use the Active property to indicate that the aggregate value should be maintained when possible. If Active is False, the value of the aggregate is never calculated.

If Active is True, the aggregate value is calculated unless

•	It summarizes records over a group not defined by the current index.

•	The client dataset’s AggregatesActive property is False.

Note:	To determine whether the aggregate is currently maintained, read the InUse property.


TAggregateField.AsString

TAggregateField	See also

AsString converts the value of the aggregate field to a string.

property AsString: string;

Description

Use AsString to assign an aggregate field value to a string variable:

NewString := MyAggregateField.AsString;


TAggregateField.AsVariant

TAggregateField	See also

AsVariant converts the value of the aggregate field to a string.

property AsVariant: Variant;

Description

Use AsVariant to assign an aggregate field value to a variant variable,

NewVariant := MyAggregateField.AsVariant;


TAggregateField.Currency

TAggregateField	See also

Determines whether the value in the field should be formatted as a currency value.

property Currency: Boolean;

Description

Use the Currency property to specify the formatting of the field if its ResultType is a floating-point type (ftFloat or ftCurrency).

Floating-point values are formatted for display using the DisplayFormat property if it is assigned. If DisplayFormat is not assigned, Currency determines how the field is formatted for display. If Currency is True the value is formatted for display using the FloatToText function with the ffCurrency formatting code. If Currency is False, the value is formatted with the ffGeneral format.


TAggregateField.DisplayFormat

TAggregateField	See also

Determines how numeric and time values are formatted for display in a data-aware control.

property DisplayFormat: String;

Description

Use the DisplayFormat property to override automatic formatting of a field for display purposes when ResultType is ftFloat, ftCurrency, ftDate, ftTime, or ftDateTime.

When ResultType is ftFloat or ftCurrency, the value of DisplayFormat is a string that encodes the formatting of data using the specifiers in the following table:

Specifier	Represents

0	Digit placeholder. If the value being formatted has a digit in the position where the "0" appears in the format string, then that digit is copied to the output string. Otherwise, a "0" is stored in that position in the output string.

#	Digit placeholder. If the value being formatted has a digit in the position where the "#" appears in the format string, then that digit is copied to the output string. Otherwise, nothing is stored in that position in the output string.

.	Decimal point. The first "." character in the format string determines the location of the decimal separator in the formatted value; any additional "." characters are ignored. The actual character used as a the decimal separator in the output string is determined by the DecimalSeparator global variable. The default value of DecimalSeparator is specified in the Number Format of the Regional Settings section in the Windows Control Panel.

,	Thousand separator. If the format string contains one or more "," characters, the output will have thousand separators inserted between each group of three digits to the left of the decimal point. The placement and number of "," characters in the format string does not affect the output, except to indicate that thousand separators are wanted. The actual character used as a the thousand separator in the output is determined by the ThousandSeparator global variable. The default value of ThousandSeparator is specified in the Number Format of the Regional Settings section in the Windows Control Panel.

E+	Scientific notation. If any of the strings "E+", "E-", "e+", or "e-" are contained in the format string, the number is formatted using scientific notation. A group of up to four "0" characters can immediately follow the "E+", "E-", "e+", or "e-" to determine the minimum number of digits in the exponent. The "E+" and "e+" formats cause a plus sign to be output for positive exponents and a minus sign to be output for negative exponents. The "E-" and "e-" formats output a sign character only for negative exponents.

'xx'/"xx"	Characters enclosed in single or double quotes are output as-is, and do not affect formatting.

;	Separates sections for positive, negative, and zero numbers in the format string.

The locations of the leftmost "0" before the decimal point in the format string and the rightmost "0" after the decimal point in the format string determine the range of digits that are always present in the output string.

The number being formatted is always rounded to as many decimal places as there are digit placeholders ("0" or "#") to the right of the decimal point. If the format string contains no decimal point, the value being formatted is rounded to the nearest whole number.

If the number being formatted has more digits to the left of the decimal separator than there are digit placeholders to the left of the "." character in the format string, the extra digits are output before the first digit placeholder.

To allow different formats for positive, negative, and zero values, the format string can contain between one and three sections separated by semicolons.

One section: The format string applies to all values.

Two sections: The first section applies to positive values and zeros, and the second section applies to negative values.

Three sections: The first section applies to positive values, the second applies to negative values, and the third applies to zeros.

If the section for negative values or the section for zero values is empty, that is, if there is nothing between the semicolons that delimit the section, the section for positive values is used instead.

If the section for positive values is empty, or if the entire format string is empty, the value is formatted using general floating-point formatting with 15 significant digits. General floating-point formatting is also used if the value has more than 18 digits to the left of the decimal point and the format string does not specify scientific notation.

When ResultType is ftDate, ftTime, or ftDateTime, the value of DisplayFormat is a string that encodes the formatting of data using the specifiers in the following table:

Specifier	Displays

c	The date using the format given by the ShortDateFormat global variable, followed by the time using the format given by the LongTimeFormat global variable. The time is not displayed if the fractional part of the DateTime value is zero.

d	The day as a number without a leading zero (1-31).

dd	The day as a number with a leading zero (01-31).

ddd	The day as an abbreviation (Sun-Sat) using the strings given by the ShortDayNames global variable.

dddd	The day as a full name (Sunday-Saturday) using the strings given by the LongDayNames global variable.

ddddd	The date using the format given by the ShortDateFormat global variable.

dddddd	The date using the format given by the LongDateFormat global variable.

m	The month as a number without a leading zero (1-12). If the m specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.

mm	The month as a number with a leading zero (01-12). If the mm specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.

mmm	The month as an abbreviation (Jan-Dec) using the strings given by the ShortMonthNames global variable.

mmmm	The month as a full name (January-December) using the strings given by the LongMonthNames global variable.

yy	The year as a two-digit number (00-99).

yyyy	The year as a four-digit number (0000-9999).

h	The hour without a leading zero (0-23).

hh	The hour with a leading zero (00-23).

n	The minute without a leading zero (0-59).

nn	The minute with a leading zero (00-59).

s	The second without a leading zero (0-59).

ss	The second with a leading zero (00-59).

t	The time using the format given by the ShortTimeFormat global variable.

tt	The time using the format given by the LongTimeFormat global variable.

am/pm	The time using the 12-hour clock for the preceding h or hh specifier, followed by "am" for any hour before noon, or "pm" for any hour after noon. The am/pm specifier can use lower, upper, or mixed case, and the result is displayed accordingly.

a/p	The time using the 12-hour clock for the preceding h or hh specifier, followed by "a" for any hour before noon, or "p" for any hour after noon. The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly.

ampm	The time using the 12-hour clock for the preceding h or hh specifier, followed by the contents of the TimeAMString global variable for any hour before noon, or the contents of the TimePMString global variable for any hour after noon.

/	The date separator character given by the DateSeparator global variable.

:	The time separator character given by the TimeSeparator global variable.

'xx'/"xx"	Characters enclosed in single or double quotes are displayed as-is, with no formatting changes.


TAggregateField.DisplayName

TAggregateField	See also

Represents the name of the field for display purposes.

property DisplayName: string;

Description

Set DisplayName to give the aggregate a name that can be used to label values displayed to the user.


TAggregateField.Expression

TAggregateField	See also

Specifies the formula used to calculate the aggregate value.

property Expression: string;

Description

Set Expression to indicate how aggregate values should be calculated. Expression contains an expression that includes one or more of the summary operators in the following table:

Operator	Use

Sum	Totals the values for a numeric field or expression.

Avg	Computes the average value for a numeric or date-time field or expression.

Count	Specifies the number of non-blank values for a field or expression. Use count(*) to count the number of records in a dataset or subgroup.

Min	Indicates the minimum value for a string, numeric, or date-time field or expression.

Max	Indicates the maximum value for a string, numeric, or date-time field or expression.

The summary operators act on field values or on expressions built from field values using the same operators you use to create filters. (You can’t nest summary operators, however.) You can create expressions by using operators on summarized values with other summarized values, or on summarized values and constants. However, you can’t combine summarized values with field values, because such expressions are ambiguous (there is no indication of which record should supply the field value.) These rules are illustrated in the following expressions:

Sum(Qty * Price)	{legal -- summary of an expression on fields }

Max(Field1) - Max(Field2)	{legal -- expression on summaries }

Avg(DiscountRate) * 100	{ legal -- expression of summary and constant }

Min(Sum(Field1))	{ illegal -- nested summaries }

Count(Field1) - Field2	{ illegal -- expression of summary and field }

Note:	To specify the set of records summarized by this expression, use the GroupingLevel property.


TAggregateField.GroupingLevel

TAggregateField	See also

Specifies the set of records summarized by this aggregate.

property GroupingLevel: Integer;

Description

Use GroupingLevel to indicate the groups of records over which this aggregate is calculated. When GroupingLevel is 0 (the default), the aggregate summarizes all the records in the client dataset. When GroupingLevel is greater than 0, the aggregate summarizes each group of records that has the same values on the first GroupingLevel fields of the index.

GroupingLevel can be any value from 0 to the number of fields in the index specified by IndexName.


TAggregateField.Handle

TAggregateField	See also

Points to the aggregate handle.

property Handle: Pointer;

Description

TAggregateField uses Handle internally to obtain its aggregated values. Most applications do not need to use this value.

Component writers can use Handle, if necessary, with the routines declared in the dsintf unit.


TAggregateField.IndexName

TAggregateField	See also

Specifies the index that is used to define subgroups of records.

property IndexName: String;

Description

Set IndexName to specify an index tha3t sorts the records of DataSet into subgroups. Each subgroup is defined as a set of records which all have the same values on a set of fields. This defining set of fields is the first GroupingLevel fields of the index.

IndexName is required for any aggregate that does not summarize all the records in the client dataset (GroupingLevel = 0). When the index associated with an aggregate is not the current index of the client dataset, its value is unavailable.


TAggregateField.Precision

TAggregateField	See also

Determines the precision used in formatting floating-point values.

property Precision: Integer;

Description

When the aggregate field represents a floating-point value (ResultType is ftFloat or ftCurrency), use Precision to set the number of digits beyond the decimal point that appear before rounding begins. Precision affects the format of the floating-point value when it is displayed as a text string, not the actual value that is stored in the field.

The default value of Precision is 15 decimal places.

Note:	Precision must be greater than or equal to 2. Trying to set Precision to a value less than 2 changes the value of Precision to 2.


TAggregateField.ResultType

TAggregateField	See also

Indicates the data type of the aggregate field.

property ResultType: TFieldType;

Description

Read ResultType to determine the type of data that the aggregate produces.


TAggregateField events

TAggregateField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TAggregateField events

TAggregateField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TAggregateField methods

TAggregateField	Alphabetically

In TAggregateField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TAggregateField methods

TAggregateField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

FreeOnRelease

Free

GetData

GetInterfaceEntry

GetInterfaceTable

GetInterface

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TAggregateField.Create

TAggregateField	See also

Creates an instance of TAggregateField.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TAggregateField.

It is seldom necessary to call Create directly, because an aggregate field component is instantiated automatically when an aggregate field is added through the Fields Editor of a client data set.

Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField


 TAnimate

Hierarchy	Properties	Methods	Events	See also

TAnimate is a wrapper for a Windows animation control.

Unit

comctrls

Description

Use TAnimate to put an animation control on a form. An animation control is a window that silently displays an Audio Video Interleaved (AVI) clip. An AVI clip is a series of bitmap frames like a movie. Although AVI clips can have sound, animation controls only work with silent AVI clips. TAnimate works with uncompressed AVI files or AVI clips compressed using run-length encoding (RLE).

TAnimate can obtain its AVI clip from an AVI resource, and AVI file, or, if the application is running under Windows 95 or NT 4.0, from Shell32.dll.

At design time, you can browse through the frames of the AVI clip specified in FileName, CommonAVI, ResName, or ResID by right-clicking on the TAnimate component and choosing Next Frame or Previous Frame.


TAnimate properties

TAnimate	Alphabetically	Legend

In TAnimate

Active

Center

CommonAVI

FileName

FrameCount

FrameHeight

FrameWidth

Open

Repetitions

ResHandle

ResID

ResName

StartFrame

StopFrame

Timers

Transparent

Derived from TWinControl

BorderWidth

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

AutoSize

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ParentShowHint

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TAnimate properties

TAnimate	By object	Legend

Action

Active

Align

Anchors

AutoSize

BiDiMode

BorderWidth

BoundsRect

Brush

Center

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

CommonAVI

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

FileName

Floating

FloatingDockSiteClass

FrameCount

FrameHeight

FrameWidth

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Open

Owner

Parent

ParentColor

ParentShowHint

ParentWindow

Repetitions

ResHandle

ResID

ResName

ShowHint

Showing

StartFrame

StopFrame

TabOrder

TabStop

Tag

TBDockHeight

Timers

Top

Transparent

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TAnimate.Active

TAnimate	See also 	Example

Indicates whether the animation control is playing the AVI clip.

property Active: Boolean;

Description

Set Active to True to cycle through the frames specified by the StartFrame and StopFrame properties by the number of iterations specified in the Repetitions property. Set Active to False to interrupt the animation control when it is playing the AVI clip.

The animation control must be Open before it can be Active.


TAnimate.Center

TAnimate	See also

Determines whether the frames of the AVI clip are centered in the animation control.

property Center: Boolean;

Description

Use Center to position the frames of the AVI clip in the animation control when FrameHeight is not the same as ClientHeight or FrameWidth is not the same as ClientWidth. When Center is True, the frames are centered both horizontally and vertically in the client area of the control. When Center is False, the top left corner of the frames is positioned at the top left corner of the client area.


TAnimate.CommonAVI

TAnimate	See also	Example

Indicates whether the animation control displays a one of the common Windows AVI clips provided in Shell32.dll.

type TCommonAVI = (aviNone, aviFindFolder, aviFindFile, aviFindComputer, aviCopyFiles, aviCopyFile, aviRecycleFile, aviEmptyRecycle, aviDeleteFile);

property CommonAVI: TCommonAVI;

Description

Set CommonAVI to display one of the common Windows AVI clips in the animation control. The common Windows AVI clips appear in the Windows user interface when the user attempts common file actions. CommonAVI is aviNone when the animation control displays an AVI clip that was specified in some other manner.

Setting CommonAVI automatically sets the FileName property to an empty string, ResHandle and ResID to 0, and ResName to an empty string.

Note:	CommonAVI cannot be used when running under NT 3.51.


TAnimate.FileName

TAnimate	See also

Specifies the name of the file that contains the AVI clip displayed by the animation control.

property FileName: TFileName;

Description

Set FileName to use the animation control to display the AVI clip stored in a file. FileName must be the name of a file containing a silent AVI clip.

Note:	Setting FileName automatically sets the CommonAVI property to aviNone, ResHandle and ResID to 0, and ResName to an empty string.


TAnimate.FrameCount

TAnimate	See also

Indicates the total number of frames in the AVI clip.

property FrameCount: Integer;

Description

Read FrameCount to determine the number of frames that can be displayed by the animation control. The animation control can play all the frames in the AVI clip, or run through a subset of those frames.


TAnimate.FrameHeight

TAnimate	See also

Indicates the height, in pixels, of each image in the AVI clip.

property FrameHeight: Integer;

Description

Read FrameHeight to determine the height required to fully display the frames of the AVI clip. If AutoSize is True, the animation control automatically sizes itself to the value of FrameHeight.


TAnimate.FrameWidth

TAnimate	See also

Indicates the width, in pixels, of each image in the AVI clip.

property FrameWidth: Integer;

Description

Read FrameWidth to determine the width required to fully display the frames of the AVI clip. If AutoSize is True, the animation control automatically resizes itself to the value of FrameWidth.


TAnimate.Open

TAnimate	See also

Indicates whether the AVI clip is loaded into memory.

property Open: Boolean;

Description

Read Open to determine whether the AVI clip is loaded and ready for playing. When the AVI clip is specified using the CommonAVI, FileName, ResName, or ResID property, the animation control is opened automatically. When Open is True, the animation control displays the frame specified by the StartFrame property until the clip is played using the Active property or Play method.

Set Open to False to free the resources used by the AVI clip. When the animation control is not open, none of the frames can be shown.

Note:	When Open is changed from False to True, the StartFrame property is reset to 1 and the StopFrame property is reset to FrameCount.


TAnimate.Repetitions

TAnimate	See also

Specifies the number of times to repeat the sequence of frames.

property Repetitions: Integer;

Description

Set Repetitions to specify the number of times the sequence of frames in the AVI clip is repeated when the Active property is set to True. After the sequence is repeated by the specified number of times, the value of Active becomes False again.

To show the sequence a single time, set Repetitions to 1. Set Repetitions to 0 to indicate that the sequence of frames should repeat indefinitely. When Repetitions is 0, use the Active property or Stop method to interrupt the animation.

Note:	The Play method overrides Repetitions with the value passed as the Count parameter.


TAnimate.ResHandle

TAnimate	See also

Specifies the Windows handle for the module that contains the AVI clip as a resource.

type THandle = Integer;

property ResHandle: THandle;

Description

Set ResHandle at runtime to the instance handle or module handle of the module that includes the animation resource. After setting ResHandle, set the ResID or ResName property to specify which resource in the indicated module is the AVI clip that should be displayed by the animation control.

If a value is not specified for ResHandle, the animate control uses the instance of the application’s main executable.

Note:	Setting ResHandle automatically sets the CommonAVI property to aviNone and the FileName property to an empty string.


TAnimate.ResID

TAnimate	See also

Specifies the resource ID of the AVI clip.

property ResID: Integer;

Description

Set ResID to identify a resource that should be used as the AVI clip displayed by the animation control. Use ResHandle to indicate the module that contains the resource identified by ResID.

If the resource file identifies the AVI clip by name rather than number, use the ResName property instead.

Note:	Setting ResID automatically sets the CommonAVI property to aviNone, the FileName property to an empty string, and the ResName property to an empty string.


TAnimate.ResName

TAnimate	See also

Specifies the resource name of the AVI clip.

property ResName: string;

Description

Set ResName to identify a resource that should be used as the AVI clip displayed by the animation control. Use ResHandle to indicate the module that contains the resource identified by ResName.

If the resource file identifies the AVI clip by number rather than number, use the ResID property instead.

Note:	Setting ResName automatically sets the CommonAVI property to aviNone, the FileName property to an empty string, and the ResID property to 0.


TAnimate.StartFrame

TAnimate	See also

Specifies the first frame displayed when the animation control is activated.

property StartFrame: SmallInt;

Description

Set StartFrame to specify the first frame in the AVI clip that is shown when the Active property is set to True. When StartFrame is 1, the clip is played from the very beginning, when StartFrame is 2, the clip begins with the second frame, and so on. If Repetitions is not 1, after the sequence of frames is played, it starts over at the frame specified by StartFrame (which may not be the first frame in the clip).

When the animation control is Open but not Active, it displays the frame specified by StartFrame.

Note:	The Play method overrides StartFrame with the value passed as the FromFrame parameter.


TAnimate.StopFrame

TAnimate	See also

Specifies the last frame displayed when the animation control is activated.

property StopFrame: SmallInt;

Description

Set StopFrame to specify the last frame in the AVI clip that is shown every time the animation control displays its sequence of frames. When StopFrame is 0, the clip is played to the very end. Otherwise, StopFrame is the number of the frame in the sequence. When the Active property is set to True, the animation control displays the sequence of frames from StartFrame to StopFrame, repeating this sequence by the number of iterations specified by the Repetitions property.

Note:	The Play method overrides StopFrame with the value passed as the ToFrame parameter.


TAnimate.Timers

TAnimate	See also

Specifies whether the frames are displayed using a timer.

property Timers: Boolean;

Description

Set Timers to specify whether the frames in the AVI clip should be changed in response to timer messages, or whether the sequence progresses asynchronously in a separate execution thread. When Timers is True, the frames progress in response to timer messages. This is useful for synchronizing the animation sequence with other actions such as playing a sound track. When Timers is False, the AVI clip is played in a separate thread.


TAnimate.Transparent

TAnimate	See also

Specifies whether the background color of the frame matches the Color property.

property Transparent: Boolean;

Description

Set Transparent to True to replace the background color stored in the AVI file with the value of the Color property, or the parent control’s color if the value of ParentColor is True. Set Transparent to False to display the background color stored in the AVI clip.


TAnimate events

TAnimate	Alphabetically	Legend

In TAnimate

OnClose

OnOpen

OnStart

OnStop


TAnimate events

TAnimate	By object	Legend

OnClose

OnOpen

OnStart

OnStop


TAnimate.OnClose

TAnimate	See also

Occurs immediately after the animation control is closed.

property OnClose: TNotifyEvent;

Description

Write an OnClose event handler to take specific action when the Open property is set to False. For example, if the animation control is used to cycle through a series of AVI clips, the clip could be changed in an OnClose event handler.

To respond when the clip stops playing, but the animation control remains open, use the OnStop event.


TAnimate.OnOpen

TAnimate	See also

Occurs immediately after the animation control is opened.

property OnOpen: TNotifyEvent;

Description

Write an OnOpen event handler to take specific action when the Open property changes from False to True. This is a good opportunity to set the Repetitions, StartFrame, and StopFrame properties before the AVI clip is activated, or to seek to a particular frame.


TAnimate.OnStart

TAnimate	See also

Occurs immediately after the animation control starts playing.

property OnStart: TNotifyEvent;

Description

Write an OnStart event handler to take specific action when the AVI clip is played. Setting the Active property to True or calling the Play method triggers an OnStart event. OnStart is useful for launching other actions that should be synchronized with the playing of the animation sequence.


TAnimate.OnStop

TAnimate	See also

Occurs when the animation control finishes playing.

property OnStop: TNotifyEvent;

Description

Write an OnStop event handler to take specific action when the AVI clip finishes playing all its repetitions. For example, use an OnStop event handler to shut down any simultaneous actions that were started in an OnStart event handler.


TAnimate methods

TAnimate	Alphabetically

In TAnimate

CanAutoSize

Create

PlayTAnimate_Play>Main

Reset

Seek

Stop

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TAnimate methods

TAnimate	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanAutoSize

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

PlayTAnimate_Play>Main

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

Reset

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

Seek

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Stop

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TAnimate.CanAutoSize

TAnimate	See also

Indicates how the control can be resized.

function CanAutoSize(var NewWidth, NewHeight: Integer): Boolean; override;

Description

CanAutoSize is called automatically when the AutoSize property is True and an attempt is made to resize the control. It allows the animation control to adjust to the size of AVI video images.

When CanAutoSize is called, the NewWidth and NewHeight parameters indicate the proposed new dimensions of the control. If the Open property is True, CanAutoSize adjusts these values so that they reflect the dimensions of the AVI video images and returns True. If the animation control is not Open, CanAutoSize returns False.


TAnimate.Create

TAnimate	See also	Example

Creates and initializes an animation control.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate an animation control at runtime. Animation controls placed on forms at design time are created automatically.

Pass a single Component as a parameter to provide the animation control with an Owner that is responsible for freeing it. This is the most commonly used constructor.

If you want to embed the animation control in a non-VCL window, use the constructor CreateParented, that is inherited from TWinControl. This constructor is used when the control is implemented as an ActiveX control that is embedded in a non-VCL window.

After calling the inherited constructor, Create initializes the following properties:

AutoSize is set to True.

Center is set to True.

ControlStyle is set to [csReflector].

StartFrame is set to 1.

Transparent is set to True.


TAnimate.Play

TAnimate	See also

Displays a sequence of frames from the AVI clip.

procedure Play(FromFrame, ToFrame: Word; Count: Integer);

Description

Call Play to display the specified sequence of frames, repeating the sequence Count times. FromFrame is the first frame in the sequence, where 1 specifies the first frame in the clip, 2 specifies the second frame, and so on. ToFrame is the last frame in the sequence. The value of ToFrame should be greater than or equal to FromFrame and less than or equal to the value of the FrameCount property. Count specifies the number of times the sequence should be repeated. If Count is 0, the sequence is repeated until the Stop method is called.

If the animation control is not Open when Play is called, Play sets Open to True.

Note:	Calling Play is the same as setting StartFrame to FromFrame, StopFrame to ToFrame, Repetitions to Count, and then setting Active to True.


TAnimate.Reset

TAnimate	See also

Clears the values of StartFrame and StopFrame, and displays the first frame in the AVI clip.

procedure Reset;

Description

Call Reset to restore the animation control to a default state. Reset closes and reopens the animation control, generating OnClose and OnOpen events. The animation control is left open but not active.


TAnimate.Seek

TAnimate	See also

Displays a specified frame in the sequence.

procedure Seek(Frame: SmallInt);

Description

Call Seek to move to a particular frame in the AVI clip. The Frame parameter specifies which frame, where 1 is the first frame in the sequence, 2 is the second frame, and so on. Frame must be a value less than or equal to FrameCount.

If the animation control is not open when Seek is called, Seek sets Open to True.


TAnimate.Stop

TAnimate	See also

Interrupts the animation control when it is playing.

procedure Stop;

Description

Call Stop to halt the sequence of images in an active animation control. Stop does the same thing as setting the Active property to False.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


 TApplicationEvents

Hierarchy	Properties	Methods	Events	See also

TApplicationEvents intercepts application-level events.

Unit

Appevnts

Description

Use TApplicationEvents to intercept the events of the global Application object. When you add a TApplicationEvents object to a form, the Application object forwards all events to the TApplicationEvents object. Thus, each event of the TApplicationEvents object is the same as the event with the same name on the Application object.

Each form in an application can have its own TApplicationEvents object. Each application event occurs for all the TApplicationEvents objects in the project. To change the order in which the different TApplicationEvents objects receive events, use the Activate method. To prevent other TApplicationEvents objects from receiving a specific event, use the CancelDispatch method.


TApplicationEvents properties

TApplicationEvents	Alphabetically	Legend

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TApplicationEvents properties

TApplicationEvents	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TApplicationEvents events

TApplicationEvents	Alphabetically	Legend

Derived from TCustomApplicationEvents

OnActionExecute

OnActionUpdate

OnActivate

OnDeactivate

OnException

OnHelp

OnHint

OnIdle

OnMessage

OnMinimize

OnRestore

OnShortCut

OnShowHint


TApplicationEvents events

TApplicationEvents	By object	Legend

OnActionExecute

OnActionUpdate

OnActivate

OnDeactivate

OnException

OnHelp

OnHint

OnIdle

OnMessage

OnMinimize

OnRestore

OnShortCut

OnShowHint


TApplicationEvents methods

TApplicationEvents	Alphabetically

Derived from TCustomApplicationEvents

Activate

CancelDispatch

Create

Derived from TComponent

Destroy

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TApplicationEvents methods

TApplicationEvents	By object

Activate

AfterConstruction

Assign

BeforeDestruction

CancelDispatch

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomApplicationEvents


TApplication

Hierarchy	Properties	Methods	Events	See also

TApplication is the type used for a Delphi Windows application.

Unit

forms

Description

TApplication encapsulates a Windows application. The methods and properties introduced in TApplication reflect the fundamentals established in the Windows operating system to create, run, sustain, and destroy an application. TApplication thereby simplifies the interface between the developer and the Windows environment. For this purpose TApplication encapsulates behavior for:

Windows message processing.

Context-sensitive online help.

Menu accelerator and key processing.

Exception handling.

Managing the fundamental parts defined by the Windows operating system for an application, such as MainWindow, WindowClass, and so on

Each Delphi application automatically declares an Application variable as the instance of the application. If the Delphi application is not a Web server application, control panel applet, or NT service application, this variable is of type TApplication.

TApplication does not appear on the Component palette, nor is it available in the form designer to visually manipulate; so it has no published properties. Nevertheless, some of its public properties can be set or modified at design time in the Forms and Application pages of the Project|Options dialog box. In addition, you can add a TApplicationEvents component to any form in the project to intercept the application’s events, and supply event handlers using the IDE.

Note:	 For application-wide properties and methods that affect the display, see TScreen.


TApplication properties

TApplication	Alphabetically	Legend

In TApplication

Active

AllowTesting

BiDiKeyboard

BiDiMode

CurrentHelpFile

DialogHandle

ExeName

Handle

HelpFile

Hint

HintColor

HintHidePause

HintPause

HintShortCuts

HintShortPause

Icon

MainForm

NonBiDiKeyboard

ShowHint

ShowMainForm

Terminated

Title

UpdateFormatSettings

UpdateMetricSettings

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TApplication properties

TApplication	By object	Legend

Active

AllowTesting

BiDiKeyboard

BiDiMode

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

CurrentHelpFile

DesignInfo

DialogHandle

ExeName

Handle

HelpFile

Hint

HintColor

HintHidePause

HintPause

HintShortCuts

HintShortPause

Icon

MainForm

Name

NonBiDiKeyboard

Owner

ShowHint

ShowMainForm

Tag

Terminated

Title

UpdateFormatSettings

UpdateMetricSettings

VCLComObject


TApplication.Active

TApplication	See also

Specifies whether the application is active and has focus.

property Active: Boolean;

Description

Active is True while the application is active and False if it is not. Active is set to True in the constructor.

An application is active if the form or application has focus. An application becomes inactive when a window from a different application is about to become activated. When the application closes, Active is set to False in the destructor.

Note:	Active is read-only.


TApplication.AllowTesting

TApplication

Represents information for the IDE.

property AllowTesting: Boolean;

Description

Do not use AllowTesting; it is for internal use only.


TApplication.BiDiKeyboard

TApplication	See also

Specifies the name of the keyboard map that should be used in middle-east locales when text reads from right to left.

property BiDiKeyboard: string;

Description

This name is a string composed of the hexadecimal value of the language identifier (low word) and a device identifier (high word). For example, Saudi Arabian Arabic has a language identifier of 0x0401, so its primary layout is named "00000401".

This keyboard layout is only used when the application runs in a middle-eastern locale and the value of BiDiMode indicates that text should read from right to left.


TApplication.BiDiMode

TApplication	See also

Indicates the layout of the application when running under Middle Eastern versions of Windows.

property BiDiMode: TBiDiMode;

Description

Use BiDiMode to specify the bi-directional mode for the application. The bi-directional mode controls the direction in which text appears (left-to-right or right-to-left), the placement of vertical scrollbars, and the default alignment of text when the application runs in Middle Eastern locales.

The application’s BiDiMode is used in the ShowMessage procedure and the MessageBox method. It also serves as the ParentBiDiMode for forms and for popup menus that are not activated by a control.


TApplication.CurrentHelpFile

TApplication	See also

Indicates the current help file.

property CurrentHelpFile: string;

Description

Read CurrentHelpFile to determine the name of the help file that is currently used by the application when it executes a help command (via the HelpCommand method) or brings up context sensitive help (via the HelpContext or HelpJump method). If CurrentHelpFile is an empty string, the application ignores attempts to display Help.

If the active form has an associated help file, this is the value of CurrentHelpFile. Otherwise, CurrentHelpFile reflects the value of the application’s HelpFile property.


TApplication.DialogHandle

TApplication	See also

Provides a mechanism for using non-VCL dialog boxes in a Delphi application.

property DialogHandle: HWnd;

Description

Use DialogHandle when displaying a modeless dialog box that was created using the CreateDialog API function. Assigning the handle of the modeless dialog box to DialogHandle allows the dialog to see messages from the application's message loop.

Assign the handle of the modeless dialog box to DialogHandle when it receives an activation message (WM_NCACTIVATE) and set DialogHandle to zero when the dialog box receives a deactivation message.


TApplication.ExeName

TApplication	See also	Example

Contains the file name of the application’s executable file including path information.

property ExeName: string;

Description

Use ExeName to obtain the name of the executable file for the application.

The name of the application is the root name of the project with an .EXE extension. By default this name is PROJECT1.EXE. To change the ExeName, save the project by the desired new root name and rebuild the application. ExeName will reflect the change to the project filename.

ExeName is a read-only property.


TApplication.Handle

TApplication	See also

Provides access to the window handle of the main form (window) of the application.

property Handle: HWND;

Description

Use Handle when calling Windows API functions that require a parent window handle. For example, a DLL that displays its own top-level pop-up windows needs a parent window to display its windows in the application. Using the Handle property makes such windows part of the application, so that they are minimized, restored, enabled and disabled with the application.

Note:	When writing a DLL that uses VCL forms, assign the window handle of the host EXE’s main window to the DLL’s Application.Handle property. This makes the DLL’s form part of the host application. Never assign to the Handle property in an EXE.


TApplication.HelpFile

TApplication	See also 	Example

Specifies the name of the default file the application uses to display Help.

property HelpFile: string;

Description

Use HelpFile to specify a default help file for applications that use the Windows Help system. Either assign a filename to the HelpFile property at runtime, or specify a Help File on the Application page of the Project|Options dialog box at design time.

Windows displays help topics from the file specified by CurrentHelpFile. HelpFile supplies the value of CurrentHelpFile unless there is a help file associated with the active form.

By default, HelpFile is a null string, and the application's Help method ignores attempts to display Help unless the active form has an associated help file.


TApplication.Hint

TApplication	See also 	Example

Specifies the text string that appears in the Help Hint box.

property Hint: string;

Description

TApplication’s Hint property is assigned the Hint value of the control or menu item that the mouse is currently moving over. It can also be assigned a string value that informs the user of some action, error, or other type of information. Therefore, use Hint either to:

Transfer hints from controls to another area of display, such as a status bar, using the OnHint event handler. This reads the Hint property.

Indicate the status of the application while it is processing some action. This sets the Hint property.

Help Hints appear when the OnHint event occurs. Therefore, if TApplication’s Hint property is assigned to the status bar’s caption, for example, the caption of the status bar control displays the current string value of the Hint property during an OnHint event.

There are two parts to the Hint string: short and long. Short hints are used by pop-up tool tips. Long hints are used by the status bar, separated by the | character. Use the global functions GetShortHint and GetLongHint, from the Controls unit to extract the long and short hints from a hint string.

Note:	When setting Hint to a message informing the user of an event occuring in the application, remember that, by default, the Hint string is reset to a control’s Hint when the mouse cursor moves over a control.


TApplication.HintColor

TApplication	See also

Determines the color of the hint boxes for the Help Hints for the application.

property HintColor: TColor;

Description

Use HintColor to specify the hint box color. A default color value of clInfoBk is set for the HintColor property in the constructor when the application is created. To change the HintColor assign it a new TColor value at runtime.

Tip:	To further customize the hint window, create a custom descendant of THintWindow and assign it to the global HintWindowClass variable.


TApplication.HintHidePause

TApplication	See also

Specifies the time interval to wait before hiding the Help Hint if the mouse has not moved from the control or menu item.

property HintHidePause: Integer;

Description

Use HintHidePause to specify a wait time in milliseconds, which is different from the default value of 2500 ms or 2 1/2 seconds that is set in the constructor. The Help Hint for the control or menu item is specified in the Hint property.

Note:	The default is a predefined constant value that is several times longer than HintPause.


TApplication.HintPause

TApplication	See also

Specifies the time interval that passes before the control's Help Hint appears when the user places the mouse pointer on a control or menu item.

property HintPause: Integer;

Description

Use HintPause to change the default pause time of 500 ms or 1/2 second that is set in the constructor. When assigning a value to HintPause, specify the interval in milliseconds. The Help Hint displayed at the end of the pause is specified in the Hint property.


TApplication.HintShortCuts

TApplication

Specifies whether the application’s pop-up hints include shortcut information.

property HintShortCuts: Boolean;

Description

Use HintShortCuts to specify whether the application’s pop-up hints include shortcut information. If HintShortCuts is True, the shortcut information is displayed. For example, if HintShortCuts is True, the hint for the Cut command might be “Cut (Ctrl+X)” instead of “Cut”.


TApplication.HintShortPause

TApplication	See also

Specifies the time period to wait before bringing up a hint if another hint has already been shown.

property HintShortPause: Integer;

Description

Use HintShortPause to reduce the flicker when moving the mouse quickly over a set of buttons that all have help hints on. Specify a value in milliseconds that is different from the default value of 50 ms that is set in the constructor.


TApplication.Icon

TApplication	See also 	Example

Determines which icon represents the application on the Windows task bar.

property Icon: TIcon;

Description

Use Icon to assign a specific icon to represent the application. Set the Icon property by either:

Assigning it a TIcon at runtime.

Loading an icon on the Application pages of the Project|Options dialog box at design time.

Icon represents the application when it is minimized and appears either on the Windows desktop or task bar.


TApplication.MainForm

TApplication	See also

Identifies which form in the application is the main window.

property MainForm: TForm;

Description

Use MainForm to determine the form that acts as the application’s main window. The main form is the first form created in the main body of the application. When the main form closes, the application terminates.

When a new project is created, Form1 automatically becomes the value of the MainForm property. To assign a different form to the MainForm property, use the Forms page of the Project|Options dialog box at design time. MainForm cannot be modified at runtime; it is read-only.


TApplication.NonBiDiKeyboard
TApplication.BiDiKeyboard

TApplication	See also

Specifies the name of the keyboard map that should be used unless text reads from right to left.

property NonBiDiKeyboard: string;

Description

Use NonBiDiKeyboard to specify the keyboard map that should be used. This name is a string composed of the hexadecimal value of the language identifier (low word) and a device identifier (high word). For example, U.S. English has a language identifier of 0x0409, so the primary U.S. English layout is named "00000409". Variants of U.S. English layout (such as the Dvorak layout) are named "00010409", "00020409", and so on.

If the application is running in a middle-eastern locale and the value of BiDiMode indicates that text should read from right to left, the application uses BiDiKeyboard.


TApplication.ShowHint

TApplication	See also 	Example

Determines whether Help Hints are enabled or disabled for the entire application.

property ShowHint: Boolean;

Description

Use ShowHints to choose when to display Help Hints. If ShowHint is True, Help Hints are enabled; if ShowHint is False, Help Hints are disabled. The default value is True. Help Hints are specified in the Hint property.

Setting ShowHint for the application to False disables all Help Hints, regardless of the value of the ShowHint properties for individual controls.

Tip:	You can customize the hint window by creating a custom descendant of THintWindow and assigning it to the global HintWindowClass variable.


TApplication.ShowMainForm

TApplication	See also

Determines whether the application shows its main form on startup.

property ShowMainForm: Boolean;

Description

Use ShowMainForm to control whether and when the application shows its main form.

The default value of True is set in the constructor. When ShowMainForm is True the main window shows automatically when the application starts. The MainForm property specifies which form is the main form.

To hide the main form at startup, set ShowMainForm to False in the main project file before the call to Application.Run. Make sure that the Visible property of the form is also False.


TApplication.Terminated

TApplication	See also

Reports whether the application has received the Windows WM_QUIT message, which then terminates the application.

property Terminated: Boolean;

Description

Terminated is used when calling the ProcessMessages method so that the application doesn't attempt to process Windows messages after the application has quit. ProcessMessage sets Terminated to True when it receives a WM_QUIT message.

An application usually receives a WM_QUIT message because the main window of the application has closed, or because the Terminate method has been called.

Note:	For applications using calculation-intensive loops, call ProcessMessages periodically, and also check Terminated to determine whether or not to abort the calculation and allow the application to terminate.


TApplication.Title

TApplication	See also

Contains the text that appears below the icon representing the application when it is minimized.

property Title: string;

Description

Use the Title property to modify the name of this text string appearing below the icon of the application. The default value is taken from the DLL or EXE file name at runtime.

Set the Title at runtime, or enter the value of the Title property on the Application page of the Project | Options dialog box.


TApplication.UpdateFormatSettings

TApplication	See also

Specifies whether format settings are updated automatically when the user alters the system configuration.

property UpdateFormatSettings: Boolean;

Description

Use UpdateFormatSettings to control automatic updating of format settings. The default of True is set in the constructor. UpdateFormatSettings is checked when the application receives a WM_WININICHANGE message.

Using the default format settings is recommended. These settings are initialized to the Windows local settings. However, to prevent the settings from changing during the execution of the application when altering the format settings in a Delphi application, UpdateFormatSettings can be set to False.


TApplication.UpdateMetricSettings

TApplication

Specifies whether the settings used for the hint window font and the icon title font are updated.

property UpdateMetricSettings: Boolean;

Description

Use UpdateMetricSettings to specify whether or not the hint window font and the icon title font on the desk top should be updated to reflect the system settings when those settings are changed.

The initial value of True is set in the constructor.


TApplication events

TApplication	Alphabetically

In TApplication

OnActionExecute

OnActionUpdate

OnActivate

OnDeactivate

OnException

OnHelp

OnHint

OnIdle

OnMessage

OnMinimize

OnRestore

OnShortCut

OnShowHint


TApplication events

TApplication	By object

OnActionExecute

OnActionUpdate

OnActivate

OnDeactivate

OnException

OnHelp

OnHint

OnIdle

OnMessage

OnMinimize

OnRestore

OnShortCut

OnShowHint


TApplication.OnActionExecute

TApplication	See also

Occurs when an action’s Execute method is called and its action list has not already handled it.

property OnActionExecute: TActionEvent;

Description

Use the OnExecute event handler to respond when a user invokes actions whose action lists do not have OnExecute event handlers.

If the action list that contains the action does not handle it in an OnExecute event handler, then the action is routed to the Application object’s ExecuteAction method, which invokes the OnActionExecute event handler. (The application’s ExecuteAction method applies to all actions in the application.)

The Handled parameter of the event handler returns False by default. If the handler handles the event, it should change Handled to True, thereby preventing further attempts to handle the action. When the event handler exits with Handled set to False, the action’s OnExecute event occurs. If the action remains unhandled after that, the active control’s ExecuteAction method is called to allow the action to execute with an identified target. Finally, the active form’s ExecuteAction method is called if all other handlers do not handle the action.


TApplication.OnActionUpdate

TApplication	See also

Occurs when an action’s Update method is called and its action list has not already handled it.

property OnActionUpdate: TActionEvent;

Description

Use the OnActionUpdate event handler to update the properties of an action when the application is idle if the action’s action list does not handle it in an OnUpdate event handler.

If the action list that contains the action does not update it in an OnUpdate event handler, the action is routed to the Application object’s UpdateAction method, which invokes the OnActionUpdate event handler. (The application’s UpdateAction method applies to all actions in the application.)

The Handled parameter of the event handler returns False by default. If the handler updates the event, it should change Handled to True, thereby ending the processing of the action. When the event handler exits with Handled set to False, the action’s OnUpdate event occurs. If the action is not updated after that, the active control’s UpdateAction method is called to allow the target to update the action. Finally, the active form’s UpdateAction method is called if all other handlers do not handle the action.

Note:	OnActionUpdate occurs after the application’s OnIdle event.


TApplication.OnActivate

TApplication	See also

Occurs when an application becomes active.

property OnActivate: TNotifyEvent;

Description

Write an OnActivate event handler to perform special processing when the application becomes active.

An application becomes active when it is initially run or when focus moves from another Windows application back to any window of the application.


TApplication.OnDeactivate

TApplication	See also 	Example

Occurs when an application becomes inactive.

property OnDeactivate: TNotifyEvent;

Description

Write an OnDeactive event handler to perform any special processing that should occur immediately before the application is deactivated. The OnDeactivate event occurs when the user switches from the application to another Windows application.


TApplication.OnException

TApplication	See also 	Example

Occurs when an unhandled exception occurs in the application.

type TExceptionEvent = procedure (Sender: TObject; E: Exception) of object;

property OnException: TExceptionEvent;

Description

Use OnException to change the default behavior that occurs when an exception is not handled by application code. The OnException event handler is called automatically in the HandleException method.

OnException only handles exceptions that occur during message processing. Exceptions that occur before or after the execution of the application’s Run method do not generate OnException events.

If an exception passes through the try blocks in the application code, the application automatically calls the HandleException method. Unless the exception object is EAbort, HandleException calls the OnException handler, if one exists. Otherwise, it calls ShowException to display a message box indicating an error occurred.

TExceptionEvent is the type of the OnException event. It points to a method that handles exceptions in the application. The Sender parameter is the object that raised the exception, and E is the exception object.


TApplication.OnHelp

TApplication	See also 	Example

Occurs when the application receives a request for help.

type THelpEvent = function (Command: Word; Data: Longint; var CallHelp: Boolean): Boolean of object;

property OnHelp: THelpEvent;

Description

Write an OnHelp event handler to perform special processing when the user requests help. The HelpContext and the HelpJump methods automatically trigger the OnHelp event.

Set CallHelp to True to have the VCL call WinHelp after the event. Set CallHelp to False to prevent the VCL from calling WinHelp.

All application help methods go through OnHelp. The application calls WinHelp only if OnHelp’s CallHelp parameter returns True, or if no OnHelp event handler is assigned.

To find the possible values of the Command and Data parameters, search for WinHelp in the Win32 Developer's Reference Help (Win32.HLP) file, which explains the WinHelp API (application programming interface). The possible values for the Data parameter depend upon the value of the Command parameter.

The return value is True if the event handler succeeds, False if it fails.


TApplication.OnHint

TApplication	See also 	Example

Occurs when the mouse pointer moves over a control or menu item that can display a Help Hint.

property OnHint: TNotifyEvent;

Description

Write an OnHint event handler to perform special processing when the mouse pauses over a control or menu item whose Hint property is not an empty string (‘’).

A common use of the OnHint event is to display the value of a control or menu item's Hint property as the text of a status bar (TStatusBar). The Hint property of a control can specify both a short Help Hint and a (usually) longer hint that appears elsewhere because of code in an OnHint event handler.


TApplication.OnIdle

TApplication 	Example

Occurs when an application becomes idle.

type TIdleEvent = procedure (Sender: TObject; var Done: Boolean) of object;

property OnIdle: TIdleEvent;

Description

Write an OnIdle event handler to perform special processing when an application is idle. An application is idle when it is not processing code. For example, an application is idle when it is waiting for input from the user.

The TIdleEvent type is the type of the OnIdle event. TIdleEvent has a Boolean parameter Done that is True by default. When Done is True, the Windows API WaitMessage function is called after OnIdle returns. WaitMessage yields control to other applications until a new message appears in the message queue of the application. When Done is False, the application does not yield control to other applications while it is not busy.

OnIdle is called only once, as the application transitions into an idle state. It is not called continuously unless Done is set to False. Applications that set Done to False consume an inordinate amount of CPU time, which affects overall system performance.


TApplication.OnMessage

TApplication	See also 	Example

Occurs when the application receives a Windows message.

type TMessageEvent = procedure (var Msg: TMsg; var Handled: Boolean) of object;

property OnMessage: TMessageEvent;

Description

Use OnMessage to trap any or all Windows messages posted to all windows in the application. The OnMessage event occurs when an application receives a Windows message. An OnMessage event handler allows an application to respond to messages other than those declared in the events for TApplication. If the application doesn't have a specific handler for an incoming message, the message is dispatched to the window for which it was intended, and Windows handles the message.

The TMessageEvent type is the type of the OnMessage event. The Msg parameter identifies the Windows message, and the Handled parameter indicates whether the event handler responded to the message. Set Handled to True if the message has been completely handled, to prevent subsequent processing of the message.

Note:	OnMessage only receives messages that are posted to the message queue, not those sent directly with the Windows API SendMessage function.

Caution:	Thousands of messages per second flow though this event. Be careful when coding the handler, because it can affect the performance of the entire application.


TApplication.OnMinimize

TApplication	See also 	Example

Occurs when an application is minimized.

property OnMinimize: TNotifyEvent;

Description

Write an OnMinimize event handler to perform special processing when the application is minimized. The application is minimized, either because the user minimizes the main window, or because of a call to the Minimize method. The Icon property determines the icon that represents the minimized application.


TApplication.OnRestore

TApplication	See also

Occurs when the previously minimized application is restored to its normal size.

property OnRestore: TNotifyEvent;

Description

Write an OnRestore event handler to perform special processing when the application is restored from the minimized state in which it appears as an icon. An application is restored either because the user restores the application, or because the application calls the Restore method.

Note:	Don't confuse restoring an application with restoring a form or window to its original size. To minimize, maximize, and restore a window or form, change the value of the WindowState property.


TApplication.OnShortCut

TApplication	See also

Occurs when the user presses a key (before the OnKeyDown event).

property OnShortCut: TShortCutEvent;

Description

Use OnShortCut to dispatch shortcut keystrokes before the form or its controls handle them. When the user presses a key, the application can dispatch it as a shortcut key instead of allowing the standard keystroke processing (OnKeyDown, OnKeyPress, and OnKeyUp). Built-in shortcut processing is provided for menu shortcuts and actions associated with the form. OnShortCut lets the application implement additional shortcuts.

If the OnShortCut event handler responds to the keystroke, set its Handled parameter to True. This prevents the keystroke from being passed on to menus or actions associated with the application. It also prevents the standard keystroke processing in the same way that a menu or action shortcut does.


TApplication.OnShowHint

TApplication	See also 	Example

Occurs when the application is about to display the hint window for a Help Hint.

type TShowHintEvent = procedure (var HintStr: string; var CanShow: Boolean; var HintInfo: THintInfo) of object;

property OnShowHint: TShowHintEvent;

Description

Write an OnShowHint event handler to change the appearance and behavior of Help Hints.

The TShowHintEvent is the type of the OnShowHint event. The HintStr parameter sets the text of the Help Hint. To obtain the text of a hint for a particular control, call the GetLongHint or GetShortHint function, assigning the result to HintStr. To change the text, change the value of this string.

Use the CanShow parameter to permit or prevent the Help Hint from displaying. If CanShow is True, the Help Hint displays. If it is False, the Help Hint does not appear.

The HintInfo parameter is a record that contains information about the appearance and behavior of the Help window. Change its fields to customize the way the Help Hint is displayed.


TApplication methods

TApplication	Alphabetically

In TApplication

ActivateHint

BringToFront

CancelHint

ControlDestroyed

Create

CreateForm

CreateHandle

Destroy

ExecuteAction

HandleException

HandleMessage

HelpCommand

HelpContext

HelpJump

HideHint

HintMouseMessage

HookMainWindow

Initialize

IsRightToLeft

MessageBox

Minimize

NormalizeAllTopMosts

NormalizeTopMosts

ProcessMessages

Restore

RestoreTopMosts

Run

ShowException

Terminate

UnhookMainWindow

UpdateAction

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TApplication methods

TApplication	By object

ActivateHint

AfterConstruction

Assign

BeforeDestruction

BringToFront

CancelHint

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ControlDestroyed

Create

CreateForm

CreateHandle

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HandleException

HandleMessage

HasParent

HelpCommand

HelpContext

HelpJump

HideHint

HintMouseMessage

HookMainWindow

InheritsFrom

Initialize

InitInstance

InsertComponent

InstanceSize

IsRightToLeft

MessageBox

MethodAddress

MethodName

Minimize

NewInstance

NormalizeAllTopMosts

NormalizeTopMosts

ProcessMessages

RemoveComponent

Restore

RestoreTopMosts

Run

SafeCallException

ShowException

Terminate

UnhookMainWindow

UpdateAction

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TApplication.ActivateHint

TApplication	See also

Displays a hint window for the control at a specified position.

procedure ActivateHint(CursorPos: TPoint);

Description

ActivateHint locates the control or menu item at the position specified by CursorPos, where CursorPos represents a screen coordinates in pixels. After locating the control, ActivateHint displays the control’s Hint in a hint window.


TApplication.BringToFront

TApplication	See also

Sets the last active window as the topmost window on the desktop above all other applications.

procedure BringToFront;

Description

Use BringToFront to find the window owned by the MainForm that was last active and bring it to the foreground. BringToFront also tests to see if the window is visible and enabled before making it the topmost window.


TApplication.CancelHint

TApplication	See also

Cancels the display of a hint for a control.

procedure CancelHint;

Description

Applications rarely, if ever, call CancelHint directly. CancelHint is used internally to cancel the display of hints at appropriate times, such as when a window is not valid or when the application closes. CancelHint calls a series of routines that clean up the display and timing issues of the hint window for a control.


TApplication.ControlDestroyed

TApplication	See also

Notifies the application when a control is destoyed.

procedure ControlDestroyed(Control: TControl);

Description

ControlDestroyed is for internal use and is called automatically by TControl. Do not call it directly.

ControlDestroyed notifies the application that the control passed as the Control parameter has been destoyed, so that the properties which refer to controls, such as MainForm and ActiveCustomForm, can be updated to specify a valid object or nil.


TApplication.Create

TApplication	See also

Creates a new application.

constructor Create(AOwner: TComponent); override;

Description

Do not call Create directly. Each Delphi application automatically creates an instance of an application object.

For TApplication, the Create method initializes default values for some of its properties. It also prepares the application to run by setting up objects such as hint windows, the application icon, the main window handle, the instance handle, lists for managing child windows of the main window (form), and so on.


TApplication.CreateForm

TApplication	See also	Example

Creates a new form.

procedure CreateForm(FormClass: TFormClass; var Reference);

Description

Call CreateFrom to dynamically create a form at runtime. Developers do not need to add code for creating most forms, because typically one or more calls to CreateForm are added automatically to the Delphi project's main statement part when using the form designer.

CreateForm creates a new form of the type specified by the FormClass parameter and assigns it to the variable given by the Reference parameter. The owner of the new form is the Application object.

Note:	By default the form created by the first call to CreateForm in a project becomes the application’s main form.


TApplication.CreateHandle

TApplication	See also

Generates a main window for the application if it does not already have one.

procedure CreateHandle;

Description

Do not call CreateHandle directly. In EXEs, the application’s constructor calls CreateHandle. In DLLs it does not.

CreateHandle encapsulates much of what traditional Windows programs write in WinMain. For example, CreateHandle registers the Window Class, creates the application window and determines how the application window is shown.


TApplication.Destroy

TApplication	See also

Destroys the application instance and all of its associated memory.

destructor Destroy; override;

Description

Never call Application.Destroy or Application.Free. Instead, use the application’s Terminate method to end the application.

Destroy signals that the application has been deactivated before calling the inherited destructor. It then frees memory for hooked windows, the application instance, other object instances and lists that were created at application startup or that accumulated during execution

Since the Application owns all forms (usually), it destroys these forms in its destructor.


TApplication.ExecuteAction

TApplication	See also

Generates an OnActionExecute event.

function ExecuteAction(Action: TBasicAction): Boolean; reintroduce;

Description

When the user invokes an action, Delphi makes a series of calls to respond to that action. First, it generates an OnExecute event of the action list that contains the action. If the action list does not handle the OnExecute event, then the action is routed to the Application object’s ExecuteAction method, which invokes the OnActionExecute event handler. (The application’s ExecuteAction method responds to all unhandled actions in the application.) If the OnActionExecute event handler does not handle the action, then it is routed to the action’s OnExecute event handler. If that does not handle the action, the active control’s ExecuteAction method is called, followed (if necessary) by the active form’s ExecuteAction method.

Do not call ExecuteAction. It is called automatically when the user invokes an action. The Action parameter specifies the action that was invoked. ExecuteAction checks whether the application knows how to perform its function, and if so, executes the action and returns True. Otherwise, ExecuteAction returns False, and Delphi continues processing the action.


TApplication.HandleException

TApplication	See also

Provides default handling of exceptions for the application.

procedure HandleException(Sender: TObject);

Description

If an exception passes through all the try blocks in the application code, the application automatically calls HandleException, which displays a dialog box indicating an error occurred. Unless the exception object is EAbort, HandleException calls the OnException event handler, if one exists. Otherwise, it calls ShowException to display a message dialog box indicating an error occurred.

To assign other exception handling code for the application, use the OnException event handler.


TApplication.HandleMessage

TApplication	See also 	Example

Interrupts the execution of an application while Windows processes a message in the Windows message queue.

procedure HandleMessage;

Description

HandleMessage interrupts the execution of the application so that Windows can process a single message from the Windows message queue before returning control to the application. If the message queue is empty, HandleMessage generates an OnIdle event and starts the process of updating the actions in the application.

Note:	If the application goes idle, HandleMessage may take a long time to return. Therefore, do not call HandleMessage when waiting for something message-based while priority actions are also being processed. Instead, call ProcessMessages when processing more than just messages.


TApplication.HelpCommand

TApplication	See also 	Example

Provides quick access to any of the Help commands in the WinHelp API (application programming interface).

function HelpCommand(Command: Word; Data: Longint): Boolean;

Description

Use HelpCommand to send a command to WinHelp. Before sending the help command to the Windows help engine, HelpCommand generates an OnHelp event on the active form or on TApplication. Finally, the command is forwarded to WinHelp if there is no OnHelp event handler or if the OnHelp event handler indicates that WinHelp should be called.

For information about Windows help commands and the data passed to them, see the WinHelp topic in the Windows Help system.


TApplication.HelpContext

TApplication	See also 	Example

Displays a specified help topic.

function HelpContext(Context: THelpContext): Boolean;

Description

Use HelpContext to bring up the help topic specified by the Context parameter from the file specified in the CurrentHelpFile property. HelpContext generates an OnHelp event (either on the active form or on the application object itself). If there is no OnHelp event handler, or if the event handler indicates that WinHelp should be called, then HelpContext invokes the Windows help engine, passing it the context ID.

For example, if the Context value is 714, the HelpContext method displays the screen with the context help ID of 714 in the help file specified by CurrentHelpFile.

HelpContext returns False if CurrentHelpFile is an empty string, meaning the application has no help file assigned. In all other cases, HelpContext returns True.


TApplication.HelpJump

TApplication	See also 	Example

Displays a specified help topic.

function HelpJump(const JumpID: string): Boolean;

Description

Call HelpJump to bring up a topic identified by its symbolic name. HelpJump displays the topic identified by the JumpID parameter from the file specified in the Current HelpFile property. HelpJump generates an OnHelp event (either on the active form or on the application object itself). If there is no OnHelp event handler, or if the event handler indicates that WinHelp should be called, then HelpJump invokes the Windows help engine, passing it the topic name.

For example, if the JumpID value is 'TApplication_HelpJump' and the HelpFile property specifies the Delphi VCL help file, then HelpJump displays this screen (which has the context string 'TApplication_HelpJump').

HelpJump returns False if CurrentHelpFile is an empty string, meaning the application has no help file assigned. In all other cases, HelpJump returns True.


TApplication.HideHint

TApplication	See also

Hides the current hint.

procedure HideHint;

Description

Applications rarely, if ever, call HideHint directly. HideHint is used internally to hide the hint window at the appropriate times according to predetermined conditions and timer values. For example, CancelHint calls HideHint.


TApplication.HintMouseMessage

TApplication	See also

Regulates the display of hint windows.

procedure HintMouseMessage(Control: TControl; var Message: TMessage);

Description

Applications rarely, if ever, call HintMouseMessage directly. HintMouseMessage is used internally to manage the display of the hint windows.


TApplication.HookMainWindow

TApplication	See also

Enables a non-VCL dialog box to receive messages sent to the application’s main window.

procedure HookMainWindow(Hook: TWindowHook);

Description

Use HookMainWindow to ensure that a non-VCL dialog box behaves correctly as a child of the application, not as a standalone window. For example, switching among applications with Alt+Tab treats the application as a single task after calling HookMainWindow, rather than treating the non-VCL dialog box as a separate task.

When the window identified by the Handle property receives relevant dialog messages, it passes them to the dialog procedure passed as the Hook parameter.

There is no problem with leaving a dialog box hooked into the main window, even for extended periods. However, should the dialog box close, call the UnhookMainWindow method to release the hook.


TApplication.Initialize

TApplication 	Example

Provides an opportunity to initialize sub-systems such as OLE automation.

procedure Initalize;

Description

Initialize is the first method called for every project. It calls the InitProc procedure pointer. By default, the call to Initialize for the application does nothing because the default InitProc pointer is nil .

To use Initialize, the InitProc pointer must be predefined. This can be accomplished in one of two ways:

Include a unit that defines InitProc, such as the OleAuto unit.

Create a custom initialization procedure that assigns a value to the InitProc pointer, and add a call to this procedure to the project source prior to the call to Initialize.

Warning:	Only one instance of InitProc can be defined in an application. If more than one unit assigns a value to InitProc, only the last assignment will work.

For projects that do not assign a value to InitProc, the call to Initialize can be safely deleted from the project source.

Note:	Although Initialize is the first method called in the main project source code, it is not the first code that is executed in an application. The application first executes the “initialization” section of all the units used by the application.


TApplication.IsRightToLeft

TApplication	See also

Specifies whether the application adjusts its interface for Middle Eastern locales.

function IsRightToLeft: Boolean;

Description

Use IsRightToLeft to determine whether the application makes any adjustments of control alignment, text direction, or scrollbar placement. IsRightToLeft returns True if the application’s BiDiMode indicates that any of these should be reversed and the application is running on a system with a Middle Eastern locale.


TApplication.MessageBox

TApplication 	See also	Example

Displays a specified message to the user.

function MessageBox(const Text, Caption: PChar; Flags: Longint): Integer;

Description

Use MessageBox to display a generic dialog box a message and one or more buttons. Caption is the caption of the dialog box and is optional.

MessageBox is an encapsulation of the Windows API MessageBox function. TApplication’s encapsulation of MessageBox automatically supplies the missing window handle parameter needed for the Windows API function.

The value of the Text parameter is the message, which can be longer than 255 characters if necessary. Long messages are automatically wrapped in the message box. The value of the Caption property is the caption that appears in the title bar of the dialog box. Captions can be longer than 255 characters, but don't wrap. A long caption results in a wide message box.

To see the possible values of the Flags parameter, see the MessageBox function in the Windows API Help file. The corresponding parameter on the Windows function is called TextType. The values determine the buttons that appear in the message box and the behavior of the message box. These values can be combined to obtain the desired effect.

MessageBox returns 0 if there isn’t enough memory to create the message box. Otherwise it returns one of the following values:

Value	Numeric value	Meaning

IDOK	1	The user chose the OK button.

IDCANCEL	2	The user chose the Cancel button.

IDABORT	3	The user chose the Abort button.

IDRETRY	4	The user chose the Retry button.

IDIGNORE	5	The user chose the Ignore button.

IDYES	6	The user chose the Yes button.

IDNO	7	The user chose the No button.


TApplication.Minimize

TApplication	See also 	Example

Shrinks an application to the Windows task bar.

procedure Minimize;

Description

Call Minimize to minimize the application. When the user minimizes the application, the Minimize method is automatically called.

Note:	Don't confuse the Minimize method, which minimizes an entire application, with minimizing a form or window. To minimize, maximize, or restore a window or form, change the value of its WindowState property.


TApplication.NormalizeAllTopMosts

TApplication	See also

Makes forms that have been designated as topmost forms (their FormStyle is fsStayOnTop) behave as if they were not topmost forms.

procedure NormalizeAllTopMosts;

Description

Use NormalizeAllTopMosts to allow other windows appear on top of a topmost form. Normally, topmost forms remain on top of other windows, and so may obscure other windows.

NormalizeAllTopMosts behaves like the NormalizeTopMosts method, except that it also includes the application’s Main Window.


TApplication.NormalizeTopMosts

TApplication	See also 	Example

Makes forms that have been designated as topmost forms (their FormStyle is fsStayOnTop) behave as if they were not topmost forms.

procedure NormalizeTopMosts;

Description

Use NormalizeTopMosts to allow a message box or dialog box that is displayed using the Windows API functions (such as MessageBox and MessageDlg) directly, appear on top of a topmost form. Otherwise the topmost form remains on top, and may obscure the message box.

Calling NormalizeTopMosts is not necessary when using VCL methods and functions to display message boxes.

To return the forms designated as fsStayOnTop to be topmost again, call RestoreTopMosts.


TApplication.ProcessMessages

TApplication	See also 	Example

Interrupts the execution of an application so that Windows can process the message queue.

procedure ProcessMessages;

Description

Call ProcessMessages to permit Windows to process these messages that are currently in the message queue. ProcessMessages cycles the Windows message loop until it is empty and then returns control to the application.

Note:	Neglecting message processing affects only the application calling ProcessMessages, not other applications. In lengthy operations, calling ProcessMessages periodically allows the application to respond to paint and other messages.

Note:	ProcessMessages does not allow the application to go idle, whereas HandleMessage does.


TApplication.Restore

TApplication	See also 	Example

Restores a minimized application to its normal size.

procedure Restore;

Description

Use Restore to restore the application to its previous size before it was minimized. When the user restores the application to normal size, Restore is automatically called.

Note:	Don't confuse the Restore method, which restores the entire application, with restoring a form or window to its original size. To minimize, maximize, and restore a window or form, change the value of its WindowState property.


TApplication.RestoreTopMosts

TApplication	See also 	Example

Restores forms designated as fsStayOnTop to be topmost again.

procedure RestoreTopMosts;

Description

Use RestoreTopMosts to return forms that were originally designated as topmost forms (FormStyle is fsStayOnTop), then temporarily changed to be non-topmost forms with the NormalizeTopMosts or NormalizeAllTopMosts method, to a topmost position.


TApplication.Run

TApplication	See also	Example

Executes the application.

procedure Run;

Description

Do not call Run. When creating a new project, Delphi automatically creates a main program block in the project file that calls the Run method. When the application is executed, the application’s Run method is called.

Run contains the application’s main message loop. The call to Run does not return until the application’s message loop terminates.


TApplication.ShowException

TApplication	See also 	Example

Displays a message box for exceptions that are not caught by application code.

procedure ShowException(E: Exception);

Description

The HandleException method calls ShowException by default if no handler is specified for the OnException event. If an exception handler filters exceptions, ShowException is called for those exceptions that are not filtered out.

To specify how exceptions are handled for an application, write a handler for the OnException event.

Note:	Calling ShowException is rarely necessary in a Delphi application, since the default VCL exception handler calls ShowException automatically.


TApplication.Terminate

TApplication	See also 	Example

Ends application execution.

procedure Terminate;

Description

Terminate calls the Windows API PostQuitMessage function to perform an orderly shutdown of the application. Terminate is not immediate.

Terminate is called automatically on a WM_QUIT message and when the main form closes.


TApplication.UnhookMainWindow

TApplication	See also

Releases a dialog procedure previously hooked by a call to the HookMainWindow method.

type TWindowHook = function(var Message: TMessage): Boolean of object;

procedure UnhookMainWindow(Hook: TWindowHook);

Description

Use UnhookMainWindow to release the hooked window. Specify the dialog procedure as the value of the Hook parameter.

The TWindowHook type is the parameter type used for UnhookMainWindow. It is a method-pointer type used for the dialog-procedures of non-VCL dialog boxes. The dialog procedure is similar to a window procedure for a window, in that it processes messages for the dialog box, but its syntax is somewhat different.

For more information about Windows hooks see the SetWindowsEx and UnhookWindowsEx functions in the Windows Help File.


TApplication.UpdateAction

TApplication	See also

Generates an OnActionUpdate event.

function UpdateAction(Action: TBasicAction): Boolean; reintroduce;

Description

When the application is idle, Delphi makes a series of calls to update the properties (such as whether it is enabled, checked, and so on) of every action that is linked to a visible control or menu item. First, Delphi generates an OnUpdate event of the action list that contains the action. If the action list does not handle the OnUpdate event, then the action is routed to the Application object’s UpdateAction method, which invokes the OnActionUpdate event handler. (The application’s UpdateAction method responds to all unhandled actions in the application.) If the OnActionUpdate event handler does not update the action, then it is routed to the action’s OnUpdate event handler. If that does not update the action, the active control’s UpdateAction method is called, followed (if necessary) by the active form’s UpdateAction method.

Do not call UpdateAction. It is called automatically when the application is idle. The Action parameter specifies the action to be updated. UpdateAction returns True if the action’s properties are updated and require no further processing. Otherwise, UpdateAction returns False, and Delphi continues processing the action.


TApplication.UseRightToLeftAlignment

TApplication	See also

Specifies whether the application object is in a right-to-left alignment mode.

function UseRightToLeftAlignment: Boolean;

Description

Use IsRightToLeft to determine whether the application’s controls alignment is reversed so that they are aligned from right to left. UseRightToLeftAlignment returns True for Middle Eastern locales if the BiDiMode property is bdRightToLeft. Otherwise, it returns False.


TApplication.UseRightToLeftReading

TApplication	See also

Specifies whether the application object is in a right-to-left text mode.

function UseRightToLeftReading: Boolean;

Description

Call UseRightToLeftReading to determine which style and text drawing flags (used in ExTextOut or DrawText) to set for the application’s controls.

UseRightToLeftReading returns True for for Middle Eastern locales if the BiDiMode property is not bdLeftToRight. Otherwise, it returns False.

Note:	UseRightToLeftReading is identical to the IsRightToLeft method.


TApplication.UseRightToLeftScrollBar

TApplication	See also

Specifies whether the vertical scroll bar appears on the left side controls.

function UseRightToLeftScrollBar: Boolean;

Description

Call UseRightToLeftScrollBar to determine whether the vertical scroll bars appear on the left sides of the application’s controls. When UseRightToLeftScrollBar returns True, the vertical scroll bars appear on the left sides of the controls. When UseRightToLeftScrollBar returns False, the vertical scroll bars appear on the right.

UseRightToLeftReading returns True for Middle Eastern locales if BiDiMode is bdRightToLeft or bdRightToLeftNoAlign.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


TArrayField

Hierarchy	Properties	Methods	Events

TArrayField represents an Array field in a dataset.

Unit

DB

Description

Array fields consist of a set of fields of the same type. The field types can be scalar (e.g. float, string), or non-scalar (an ADT), but an array field of arrays is not permitted.

TArrayField introduces no new properties, events, or methods. It overrides the Size property and Create method to reflect the specifics of a field of type ftArray. The SparseArrays property of TDataSet determines whether a unique TField object is created for each element of the array field.


TArrayField properties

TArrayField	Alphabetically	Legend

In TArrayField

Size

Derived from TObjectField

AsString

AsVariant

DataSet

FieldCount

FieldKind

Fields

FieldValues

HasConstraints

ObjectType

UnNamed

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSize

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldName

FieldNo

FullName

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TArrayField properties

TArrayField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldCount

FieldKind

FieldName

FieldNo

Fields

FieldValues

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Name

NewValue

ObjectType

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

UnNamed

ValidChars

Value

VCLComObject

Visible


TArrayField.Size

TArrayField

Size is the number of elements in the array field.

property Size: Word;

Description

The Size property specifies the number of elements in the array field.


TArrayField events

TArrayField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TArrayField events

TArrayField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TArrayField methods

TArrayField	Alphabetically

In TArrayField

Create

Derived from TObjectField

Destroy

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TArrayField methods

TArrayField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TArrayField.Create

TArrayField	See also

Creates an instance of TArrayField.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TArrayField. Create calls the inherited TField constructor, sets the DataType to ftArray, and sets the Size to 10.

Most applications do not need to explicitly create TArrayField instances. These are created automatically by the dataset.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TObjectField


TAutoIncField

Hierarchy	Properties	Methods	Events	See also

TAutoIncField is a persistent field object for an autoincrement field in a dataset.

Unit

db

Description

TAutoIncField is a persistent field object that provides access to a field in a table. Persistent field objects can be created at design-time using the Fields Editor or at runtime by calling the constructor for the class. Persistent field objects exist solely in the memory space of a Delphi application. Creating a persistent field object only creates an object in the application, and does not result in the creation of a field in a table.

Use the properties, methods, and events of persistent field objects like TAutoIncField to access a field in a table. One use for a persistent field object is retrieving a field’s value. As auto-incrementing fields are a function of the database back-end, an application should not be attempting to set a field value itself (with or without a TAutoIncField object).

Fields in a table can be accessed without use of persistent field objects. Virtual field objects are created to provide access to a field when the field is referenced through such means as the TDataSet.Fields property or the TDataSet.FieldByName method.

Autoincrement fields can hold values in the range -2,147,483,648 to 2,147,483,647, and are used as a counter for the records in the dataset. Each record is given a unique value in an autoincrement field, with each record receiving the next highest integer from that of the previously inserted record. Autoincrement fields are commonly used to provide a unique primary key value for a record.

TAutoIncField does not introduce any new properties, events, or methods beyond those provided by the TIntegerField class. It exists as a separate class to represent the DataType for an autoincrement field.


TAutoIncField properties

TAutoIncField	Alphabetically	Legend

Derived from TIntegerField

AsFloat

AsInteger

AsString

AsVariant

DataSize

MaxValue

MinValue

Value

Derived from TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TAutoIncField properties

TAutoIncField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

MaxValue

MinValue

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

ValidChars

Value

VCLComObject

Visible


TAutoIncField events

TAutoIncField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TAutoIncField events

TAutoIncField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TAutoIncField methods

TAutoIncField	Alphabetically

In TAutoIncField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TAutoIncField methods

TAutoIncField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TAutoIncField.Create

TAutoIncField	See also

Creates an instance of TAutoIncField.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TAutoIncField.

After calling the inherited constructor, Create sets the DataType property to ftAutoInc. After instantiating a TAutoIncField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TAutoIncField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TAutoIncField with a dataset component by setting its DataSet property to the name of the dataset component.

The example below creates a TAutoIncField object for a field named ID accessed through a TQuery named Query1.

var

  T: TAutoIncField;

begin

  Query1.Close;

  T := TAutoIncField.Create(Self);

  T.FieldName := 'ID';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TNumericField

TIntegerField


TBasicActionLink

Hierarchy	Properties	Methods	Events

TBasicActionLink is the base class for action link classes and introduces the fundamental behavior that enables action link classes to communicate between actions and clients.

Unit

Classes

Description

TBasicActionLink is the base class from which all other action link classes ultimately descend. TBasicAction link lays the foundation for the connection between action and the client. The client is a parameter to the TBasicActionLink constructor, and the action object is indicated by the Action property. TBasicActionLink also sets up the link between the action and client execution and updating events.


TBasicActionLink properties

TBasicActionLink	Alphabetically

In TBasicActionLink

Action


TBasicActionLink properties

TBasicActionLink	By object

Action


TBasicActionLink.Action

TBasicActionLink	See also

Indicates which action the link connects to its client.

property Action: TBasicAction;

Description

Action is the action object that the link associates with its client.


TBasicActionLink events

TBasicActionLink	Alphabetically

In TBasicActionLink

OnChange


TBasicActionLink events

TBasicActionLink	By object

OnChange


TBasicActionLink.OnChange

TBasicActionLink	See also

Occurs when an OnChange event is triggered on the action.

property OnChange: TNotifyEvent;

Description

Write an OnChange event handler when you want to respond to a change that occurs when the associated action fires an OnChange event.


TBasicActionLink methods

TBasicActionLink	Alphabetically

In TBasicActionLink

Create

Destroy

Execute

Update

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TBasicActionLink methods

TBasicActionLink	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

Execute

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

Update


TBasicActionLink.Create

TBasicActionLink	See also

Instantiates and initializes a TBasicActionLink object.

constructor Create(AClient: TObject); virtual;

Description

Applications do not need to call the constructor directly. Instances of TBasicActionLink are created automatically when you connect an action with a client in the action list editor. The AClient parameter is the client for the link. The link connects this client to its action.

Create ensures that the client is of the appropriate type for the particular type of link. Descendant classes can progressively specify more customized client types. For example, there are action link classes for controls, for windowed controls, and for button controls.


TBasicActionLink.Destroy

TBasicActionLink	See also

Destroy disposes of the instance of an action link object.

destructor Destroy; override;

Description

You do not need to destroy the action link; it is automatically destroyed by the client that was passed to its constructor when it was created.

If you want to destroy the action link manually, do not call the destructor directly. Call Free instead. Free checks that the link is not nil, and only then invokes the destructor.


TBasicActionLink.Execute

TBasicActionLink	See also

Invokes the action’s Execute method.

function Execute: Boolean; virtual;

Description

Execute calls the action’s Execute method and returns True if the action has an assigned OnExecute event handler, False otherwise. The action link’s Execute method is called if the client is linked to the action for this event.


TBasicActionLink.Update

TBasicActionLink	See also

Invokes the action’s Update method.

function Update: Boolean; virtual;

Description

Update calls the action’s Update method and returns True if the action has an assigned OnUpdate event handler, False otherwise. The action link’s Update method is called if the client is linked to the action for this event.


Hierarchy

TObject


TBasicAction

Hierarchy	Properties	Methods	Events

TBasicAction is the ancestor base class for all action objects.

Unit

Classes

Description

TBasicAction introduces the fundamental behavior for an action. Descendants of TBasicAction add functionality for containment in an action list, for being categorized, and for specializing their behavior tailored to particular clients such as controls or menu items. Use TBasicAction if you want to create an action for an object that is neither a menu item nor a control.


TBasicAction properties

TBasicAction	Alphabetically	Legend

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TBasicAction properties

TBasicAction	By object	Legend

ComObject

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TBasicAction events

TBasicAction	Alphabetically

In TBasicAction

OnExecute

OnUpdate


TBasicAction events

TBasicAction	By object

OnExecute

OnUpdate


TBasicAction.OnExecute

TBasicAction	See also	Example

Occurs when the target’s event that is linked to it fires.

property OnExecute: TNotifyEvent;

Description

Write an OnExecute event handler when you want to respond to the target’s event that triggered it. For example, for most target clients, OnExecute is triggered on a Click method, and is associated with the OnClick event.


TBasicAction.OnUpdate

TBasicAction	See also	Example

Occurs when the application is idle or when the action list updates.

property OnUpdate: TNotifyEvent;

Description

Write an OnUpdate event handler to execute centralized code while an application is idle. For example, actions may want to update enabling and disabling, or checking and unchecking of client targets.


TBasicAction methods

TBasicAction	Alphabetically

In TBasicAction

Create

Destroy

Execute

ExecuteTarget

HandlesTarget

RegisterChanges

UnRegisterChanges

Update

UpdateTarget

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBasicAction methods

TBasicAction	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

DestroyComponents

Destroying

Destroy

Dispatch

ExecuteAction

ExecuteTarget

Execute

FieldAddress

FindComponent

FreeInstance

FreeNotification

FreeOnRelease

Free

GetInterfaceEntry

GetInterfaceTable

GetInterface

GetNamePath

GetParentComponent

HandlesTarget

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RegisterChanges

RemoveComponent

SafeCallException

UnRegisterChanges

UpdateAction

UpdateTarget

Update


TBasicAction.Create

TBasicAction	See also

Instantiates and initializes a TBasicAction object.

constructor Create(AOwner: TComponent); override;

Description

Applications do not need to instantiate TBasicAction directly. Actions are created automatically when you connect an action with a client in the action list editor. If you want to create an action at runtime, you can call Create and assign a TActionList component to its action list property.

Create calls the inherited constructor and then creates its sub-objects, which includes a list of clients that are action links.


TBasicAction.Destroy

TBasicAction	See also

Disposes of an instance of a TBasicAction object.

destructor Destroy; override;

Description

You do not need to call the destructor for an action. An action is a component and is automatically destroyed by its owner, which was passed to the constructor when it is created. If you must destroy an action manually, call Free instead, which safely invokes the destructor.


TBasicAction.Execute

TBasicAction	See also

Indicates whether an OnExecute event handler was called.

function Execute: Boolean; dynamic;

Description

Execute calls the OnExecute event handler, if one is assigned, with the action as the Sender. Execute returns True if an event handler is called, False otherwise.


TBasicAction.ExecuteTarget

TBasicAction	See also

Introduces an interface for invoking an action on a target client component or control.

procedure ExecuteTarget(Target: TObject); virtual;

Description

ExecuteTarget does nothing in TBasicAction. ExecuteTarget was introduced in TBasicAction so that descendants can override it to initiate the action on the target. For example, an edit action that performs copying might copy the contents of an edit control to the clipboard.


TBasicAction.HandlesTarget

TBasicAction	See also

Introduces an interface for verifying that the type, and state, of a target component or control are appropriate for the action.

function HandlesTarget(Target: TObject): Boolean; virtual;

Description

HandlesTarget does nothing in TBasicAction. HandlesTarget was introduced in TBasicAction so that descendants can override it to check the type and state of a target. Handles target can verify any information about a target that is relevant for the action. HandlesTarget returns True if the target meets the specified criteria, False otherwise.


TBasicAction.RegisterChanges

TBasicAction	See also

Associates the action with an action link.

procedure RegisterChanges(Value: TBasicActionLink);

Description

RegisterChanges is called when the action and link are connected, for example, when a link sets a new action. Value is the action link with which the action associates itself. The link is added to the action’s client list.


TBasicAction.UnRegisterChanges

TBasicAction	See also

Breaks the association between the action and the action link.

procedure UnRegisterChanges(Value: TBasicActionLink);

Description

UnRegisterChanges is called when the action and link should no longer be associated. UnRegisterChanges is called, for example, in the destructor or when a link sets a new action. Value is the action link with which the association is broken.


TBasicAction.Update

TBasicAction	See also

Provides an opportunity to execute centralized code when an application is idle.

function Update: Boolean; virtual;

Description

Update triggers the OnUpdate event handler. Update returns True if a handler was found for that event, False otherwise. When the application is idle, the OnUpdate event occurs for every action. This provides an opportunity for applications to execute centralized code for enabling and disabling, checking and unchecking, and so on.


TBasicAction.UpdateTarget

TBasicAction	See also

UpdateTarget introduces an interface for a method of notifying a client when the action updates itself.

procedure UpdateTarget(Target: TObject); virtual;

Description

UpdateTarget does nothing in TBasicAction. UpdateTarget was introduced in TBasicAction so that descendants can override it to correspondingly update a target when the action updates. For examples, see the TEditAction objects in the stdactns unit.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


TBaseDragControlObject

Hierarchy	Properties	Methods	See also

TBaseDragControlObject object provides support for drag-and-drop or drag-and-dock operations.

Unit

controls

Description

Do not create instances of TBaseDragControlObject. TBaseDragControlObject, like its immediate ancestor TDragObject, handles operations common to both drag-and-drop and drag-and-dock behavior. TBaseDragControlObject adds support for associating a control with the drag object.

TBaseDragControlObject has two descendants: TDragControlObject, which is specialized for drag-and-drop operations, and TDragDockObject, which is specialized for drag-and-dock operations.


TBaseDragControlObject properties

TBaseDragControlObject	Alphabetically	Legend

In TBaseDragControlObject

Control

Derived from TDragObject

Cancelling

DragHandle

DragPos

DragTarget

DragTargetPos

MouseDeltaX

MouseDeltaY


TBaseDragControlObject properties

TBaseDragControlObject	By object	Legend

Cancelling

Control

DragHandle

DragPos

DragTarget

DragTargetPos

MouseDeltaX

MouseDeltaY


TBaseDragControlObject.Control

TBaseDragControlObject	See also

Indicates the control that is being dragged.

property Control: TControl;

Description

Use Control to gain access to the object that is being dragged. Depending on the operation, its properties can affect the appearance of the drag cursor and whether a drag target accepts the control.


TBaseDragControlObject methods

TBaseDragControlObject	Alphabetically	Legend

In TBaseDragControlObject

Assign

Create

EndDrag

Finished

Derived from TDragObject

GetName

HideDragImage

Instance

ShowDragImage

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TBaseDragControlObject methods

TBaseDragControlObject	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

EndDrag

FieldAddress

Finished

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetName

HideDragImage

InheritsFrom

InitInstance

Instance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

ShowDragImage


TBaseDragControlObject.Assign

TBaseDragControlObject	See also

Copies the properties of another drag control object.

procedure Assign(Source: TDragObject); override;

Description

Call Assign to copy the properties of another drag object. Assign changes the DragTarget, DragHandle, DragPos, DragTargetPos, MouseDeltaX and MouseDeltaY properties to match a drag object supplied as the Source parameter. If Source is a descendant of TBaseDragControlObject (normally the case), assign copies the Control property as well.


TBaseDragControlObject.Create

TBaseDragControlObject	See also

Creates an instance of the TBaseDragControlObject and stores a reference to the control that is being dragged.

constructor Create(AControl: TControl); virtual;

Description

Call Create to instantiate a specialized descendant of TBaseDragControlObject from the OnStartDrag event handler of a control that can be dragged. Pass the control that is about to be dragged as the AControl parameter. This control becomes the value of the Control property.


TBaseDragControlObject.EndDrag

TBaseDragControlObject	See also

Generates an OnEndDrag event for the control that is being dragged.

procedure EndDrag(Target: TObject; X, Y: Integer); virtual;

Description

EndDrag is called automatically when the user drops the control or cancels the drag operation. It calls the DoEndDrag method of the control specified by the Control property. By default, this method generates an OnEndDrag event for that control.

The Target parameter indicates the object that accepted the control. If the drag operation was canceled or the control was dragged to a floating position (in a drag-and-dock operation), Target is nil. The X and Y parameters indicate where the control is dropped.


TBaseDragControlObject.Finished

TBaseDragControlObject	See also

Finished ends a drag and drop operation.

procedure Finished(Target: TObject; X, Y: Integer; Accepted: Boolean); override;

Description

Finished is called automatically when the user drops the control or cancels the drag operation. Accepted indicates whether the Target control at X, Y position accepts the drag and drop or drag and dock operation. If a target does not accept the dragged object, its DragCanceled method is called before the EndDrag method generates an OnEndDrag event.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TDragObject


 TBatchMove

Hierarchy	Properties	Methods	See also	Example

TBatchMove enables applications to perform database operations on groups of records or entire tables.

Unit

dbtables

Description

Instantiate a TBatchMove object to

Add the records in a dataset to a database table.

Delete the records in a dataset from a database table.

Copy a dataset to create a new database table or overwrite an existing table.

Set the properties of the TBatchMove object to specify the desired operation. Call the Execute method to perform the actual operation. TTable objects can also perform the same batch operations, but only with the options specified by the default TBatchMove property values.

TBatchMove has several properties that instruct the Borland Database Engine (BDE) how to handle problems that occur when executing the batch operation. Additionally, applications can use a TBDECallback object to further refine the response to problems that arise.


TBatchMove properties

TBatchMove	Alphabetically	Legend

In TBatchMove

AbortOnKeyViol

AbortOnProblem

ChangedCount

ChangedTableName

CommitCount

Destination

KeyViolCount

KeyViolTableName

Mappings

Mode

MovedCount

ProblemCount

ProblemTableName

RecordCount

Source

Transliterate

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TBatchMove properties

TBatchMove	By object	Legend

AbortOnKeyViol

AbortOnProblem

ChangedCount

ChangedTableName

CommitCount

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Destination

KeyViolCount

KeyViolTableName

Mappings

Mode

MovedCount

Name

Owner

ProblemCount

ProblemTableName

RecordCount

Source

Tag

Transliterate

VCLComObject


TBatchMove.AbortOnKeyViol

TBatchMove	See also	Example

Specifies whether the batch operation is terminated immediately when integrity or key violations occur.

property AbortOnKeyViol: Boolean;

Description

Set AbortOnKeyViol to True to cancel the batch operation when it causes integrity or key violations in the destination table. Set AbortOnKeyViol to False to cause records that would cause integrity or key violations to be posted to a key violations table instead. Provide a KeyViolTableName when setting AbortOnKeyViol to False. If there is no KeyViolTableName, AbortOnKeyViol may still be set to False, in which case problem records are counted but not saved in a table.

Key violations occur when appending records to a table that has a primary key. On a table with a primary key, no two records may have the same values on all of the key fields. If a record that is being appended has the same values on all the key fields as a record in the destination table, it cannot be appended.

Integrity violations occur when deleting, appending or updating records to a table that has a referential integrity specification. A referential integrity specification requires that certain fields in one table must have values that exist in a particular field of another table. If a record that is being added does not match the restrictions imposed by referential integrity, it cannot be added. If deleting record would cause tighter referential integrity restrictions that another table cannot meet, it cannot be deleted.


TBatchMove.AbortOnProblem

TBatchMove	See also

Specifies whether the batch operation is terminated immediately when it is necessary to truncate data to make it fit in the specified Destination.

property AbortOnProblem: Boolean;

Description

Set AbortOnProblem to True to cancel the batch operation when types of the fields in the Source table records do not match the types of the fields in the Destination table records. Set AbortOnProblem to False to cause the mismatched fields to be “trimmed”. When AbortOnProblem is False, set the ProblemTableName to have all the untrimmed versions of records that were trimmed saved to a separate table.

Trimming a field means converting its value to a value compatible with the destination field type. For example, if a field in the destination table holds a string of size 10 characters, and the corresponding field in the source table holds a string of size 15 characters, any values from the source table longer than 10 characters must be truncated. Values that cannot be converted will cause TBatchMove to raise an exception.

Trimming does not occur when the Mode property is set to batCopy. Trimming fields on a delete operation means that records in the destination table may be deleted that do not exactly match the values from the source table.

Note:	To allow trimming on a field by field basis, use a TBDECallback object.


TBatchMove.ChangedCount

TBatchMove	See also

Indicates the number of records from the Destination table that are altered as a result of the batch operation.

property ChangedCount: Integer;

Description

Use ChangedCount to learn the number of records in the Destination table that are updated if the Mode is batUpdate or batAppendUpdate, or to learn the number that are deleted if the Mode is batDelete.

Set the ChangedTableName property to save the unchanged versions of the altered records to a separate table. ChangedCount is then the number of records in that separate table.


TBatchMove.ChangedTableName

TBatchMove	See also

Specifies the name of a local Paradox table that is created to hold copies of all records from the destination table changed by the batch operation.

property ChangedTableName: TFileName

Description

Set ChangedTableName to create a table that saves all unchanged versions of records that are changed by the batch operation. ChangedTableName must specify the name of a Paradox table. Setting ChangedTableName ensures that no information in the Destination table gets lost when the records are altered or deleted.

When the Mode property is batUpdate or batAppendUpdate, the new table will hold all records that were updated. When the Mode property is batDelete, the new table will hold all records that were deleted.

The ChangedCount property specifies the number of records in the new table.


TBatchMove.CommitCount

TBatchMove	See also

Specifies how many records are batch moved before a commit occurs.

property CommitCount: Integer;

Description

Use CommitCount to chunk batch operations into smaller operations. CommitCount allows an application to accommodate server transaction logs that are not big enough to handle the entire batch. Setting CommitCount to 0 will cause chunking into the number of records that will fit in 32K bytes.

Note:	If the Execute method is called within an explicit transaction on the database containing the tables, CommitCount is ignored.


TBatchMove.Destination

TBatchMove	See also	Example

Specifies the TTable object for the database table that is the destination of the batch operation.

property Destination: TTable;

Description

Use Destination to indicate the database table that will be created or altered by the batch operation. The batch operation affects the Destination differently depending on the Mode:

Mode	Effect on Destination

batAppend	Records are added to the destination table. No pre-existing records are altered. Destination table must already exist.

batUpdate	Records in the destination table with key fields matching the corresponding fields in the source are changed to match the source records. No new records are added. Destination table must already exist and must have an index defined.

batAppendUpdate	Records in the destination table with key fields matching the corresponding fields in the source are changed to match the source. Source records that do not match key fields are added to the destination table. Destination table must already exist and must have an index defined.

batDelete	Records in the destination table that match the records in the source are deleted. Destination table must already exist and must have an index defined.

batCopy	Destination table is created to match the records in the source. If Destination already exists, it is replaced by the copy of the source.


TBatchMove.KeyViolCount

TBatchMove	See also 	Example

Reports the number of records which could not be replaced, added, or deleted from Destination because of integrity or key violations.

property KeyViolCount: Longint;

Description

Use KeyViolCount to learn the number of records form the Source table that could not be applied to the Destination table because of integrity or key violations. To obtain a table of the offending records from the Source table, specify a KeyViolTableName.

Key violations occur when appending records to a table that has a primary key. On a table with a primary key, no two records may have the same values on all of the key fields. If a record that is being appended has the same values on all the key fields as a record in the destination table, it cannot be appended.

Integrity violations occur when deleting, appending or updating records to a table that has a referential integrity specification. A referential integrity specification requires that certain fields in one table must have values that exist in a particular field of another table. If a record that is being added does not match the restrictions imposed by referential integrity, it cannot be added. If deleting record would cause tighter referential integrity restrictions that another table cannot meet, it cannot be deleted.

Note:	If AbortOnKeyViol is True, KeyViolCount will never be greater than one, because the first violation will cause the batch operation to terminate.


TBatchMove.KeyViolTableName

TBatchMove	See also

Specifies the name of a Paradox table that will be created to contain all records from the Source that cannot participate in the batch operation because of integrity or key violations.

property KeyViolTableName: TFileName;

Description

Use KeyViolTableName to obtain a table of records that could not be applied to the Destination table because of integrity or key violations. KeyViolCount has the number of records in the table that is created.

Key violations occur when appending records to a table that has a primary key. On a table with a primary key, no two records may have the same values on all of the key fields. If a record that is being appended has the same values on all the key fields as a record in the destination table, it cannot be appended.

Integrity violations occur when deleting, appending or updating records to a table that has a referential integrity specification. A referential integrity specification requires that certain fields in one table must have values that exist in a particular field of another table. If a record that is being added does not match the restrictions imposed by referential integrity, it cannot be added. If deleting record would cause tighter referential integrity restrictions that another table cannot meet, it cannot be deleted.

Note:	If AbortOnKeyViol is True, then there will be at most one record in this table because the operation aborts with that first record.


TBatchMove.Mappings

TBatchMove	See also 	Example

Specifies the column mappings for a batch operation.

property Mappings: TStrings;

Description

Set Mappings to specify the correspondence between fields in the Source and fields in the Destination. By default TBatchMove matches fields based on their position in the source and destination tables. That is, the first column in the source is matched with the first column in the destination, and so on. Mappings enables an application to override this default.

Mappings is a list of column mappings (one per line) in one of two forms. To map the column ColName in the source table to the column of the same name in the destination table, use:

ColName

To map the column named SourceColName in the source table to the column named DestColName in the destination table, use:

DestColName=SourceColName

When adding or appending records, fields in Destination which have no entry in Mappings will be set to NULL. When copying a dataset, fields in Destination which have no entry in Mappings will not appear as columns in the copy of the table.

If source and destination column data types are not the same, TBatchMove can either cancel the batch operation or perform a “best fit”. If AbortOnProblem is True, type mismatches will terminate the batch move. Otherwise, the field values from the Source will be converted, if possible, to be compatible with the Destination.


TBatchMove.Mode

TBatchMove	See also 	Example

Specifies what the TBatchMove object does when the Execute method is called.

property Mode: TBatchMode;

Description

Use Mode to indicate whether the TBatchMove object should add records, replace records, delete records, or copy the Source. These are the possible values for Mode:

Value	Meaning

batAppend	Append the records in the source to the destination table. The destination table must already exist, and the two tables must not have records with duplicate keys. This is the default mode.

batUpdate	Replace records in the destination table with matching records from the source table. The destination table must exist and must have an index defined to match records.

batAppendUpdate	If a matching record exists in the destination table, replace it. Otherwise, append records to the destination table. The destination table must exist and must have an index defined to match records.

batCopy	Create the destination table based on the structure of the source table. If the destination already exists, the operation will delete it, and replace it with the new copy of the source.

batDelete	Delete records in the destination table that match records in the source table. The destination table must already exist and must have an index defined.


TBatchMove.MovedCount

TBatchMove	See also 	Example

Reports the number of records form the Source which were applied to the destination.

property MovedCount: Longint;

Description

Read MovedCount to learn the number of records from the Source that were read during the Execute method. The MovedCount value includes any records which caused key or integrity violations, or which were trimmed.


TBatchMove.ProblemCount

TBatchMove	See also

Indicates the number of records which could not be added to Destination without loss of data due to a field type mismatch.

property ProblemCount: Longint;

Description

Read ProblemCount to learn the number of records from the Source that had field values which could not be mapped to destination fields without being “trimmed”. If a ProblemTableName is specified, ProblemCount is the number of records in that table.

Trimming a field means converting its value to a value compatible with the destination field type. For example, if a field in the destination table holds a string of size 10 characters, and the corresponding field in the source table holds a string of size 15 characters, any values from the source table longer than 10 characters must be truncated. Values that cannot be converted will cause TBatchMove to raise an exception.

Trimming does not occur when the Mode property is set to batCopy. Trimming fields on a delete operation means that records in the destination table may be deleted that do not exactly match the values from the source table.

Note:	If AbortOnProblem is True, then ProblemCount will be at most one, because the operation aborts when the problem occurs.


TBatchMove.ProblemTableName

TBatchMove	See also

Specifies the name of a Paradox table that will be created to contain all records from the Source that contain fields which were trimmed to match the corresponding field type in the Destination table.

property ProblemTableName: TFileName;

Description

Set ProblemTableName to create a table that holds records from the Source that contain fields that had to be trimmed to be applied to the Destination. ProblemCount will have the number of records placed in the new table. If ProblemTableName is not specified, the data in the record is still trimmed when applied to the destination table, but there will be no easy way to tell which fields were trimmed.

Trimming a field means converting its value to a value compatible with the destination field type. For example, if a field in the destination table holds a string of size 10 characters, and the corresponding field in the source table holds a string of size 15 characters, any values from the source table longer than 10 characters must be truncated. Values that cannot be converted will cause TBatchMove to raise an exception.

Trimming does not occur when the Mode property is set to batCopy. Trimming fields on a delete operation means that records in the destination table may be deleted that do not exactly match the values from the source table.

Note:	If AbortOnProblem is True, then there will be at most one record in this table because the operation aborts with the first record that has a problem.


TBatchMove.RecordCount

TBatchMove	See also

Specifies the maximum number of records that are applied to the Destination when Execute is called.

property RecordCount: Longint;

Description

Use RecordCount to limit the number of Source records that are applied to the Destination. If zero, all records are added, subtracted, or copied, beginning with the first record in Source. If RecordCount is greater than zero, up to RecordCount records are applied to the Destination, starting with the current record in the dataset. If RecordCount exceeds the number of records remaining in Source, no wraparound occurs; the operation is terminated.


TBatchMove.Source

TBatchMove	See also	Example

Specifies the dataset that is the source of the batch operation.

property Source: TBDEDataSet;

Description

Use Source to indicate the dataset that contains the records that will be added to, subtracted from, or copied to the Destination. If Source is a TQuery component, the query is executed before the move is executed. If a filter is currently in effect on Source, the filter conditions are respected when the batch move executes. The Mode property indicates how the Source records are applied to the Destination:

Mode	Effect on Destination

batAppend	Records are added to the destination table.

batUpdate	Records in the destination table with key fields matching the corresponding fields in the source are changed to match the source records.

batAppendUpdate	Records in the destination table with key fields matching the corresponding fields in the source are changed to match the source. Source records that do not match key fields are added to the destination table.

batDelete	Records in the destination table that match the records in the source are deleted.

batCopy	Destination table is created to match the records in the source.


TBatchMove.Transliterate

TBatchMove	See also

Specifies whether the data in the Source records should be converted form the locale of the Source to the locale of the Destination when the Execute method is called.

property Transliterate: Boolean;

Description

Set Transliterate to True when the Source dataset and the Destination table use different language drivers and the data may contain extended ascii characters. Set Transliterate to False to avoid the overhead of the character set conversion when both the Source and the Destination use the same language driver or the data does not contain extended ascii characters.


TBatchMove methods

TBatchMove	Alphabetically

In TBatchMove

Create

Destroy

Execute

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBatchMove methods

TBatchMove	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Execute

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TBatchMove.Create

TBatchMove	See also

Creates an instance of TBatchMove.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create an instance of TBatchMove for performing a batch operation. Create allocates the memory for the TBatchMove object and

•	Sets AbortOnKeyViol to True.

•	Sets AbortOnProblem to True.

•	Sets Transliterate to True.

•	Creates a TStringList object to hold the Mappings.

The property settings made by Create are the values used when a TTable object performs batch operations using its BatchMove method.


TBatchMove.Destroy

TBatchMove	See also

Destroys an instance of TBatchMove.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free, which checks that the TBatchMove object is not nil before calling Destroy.Before calling the inherited destructor, Destroy frees the TStringList object that implements the Mappings property.


TBatchMove.Execute

TBatchMove	See also	Example

Performs the batch operation specified by Mode.

procedure Execute;

Description

After setting properties to indicate what batch operation should be performed and how, call Execute to perform the operation. As a minimum, the Mode, Source, and Destination properties must be set.

After calling Execute, the values of the ChangedCount, KeyViolCount, MovedCount, ProblemCount, and RecordCount properties will become available. These properties will give an indication of what happened as a result of the call to Execute. Additional information about the batch operation will be available through the creation of a changed table, a keyviol table, and/or a problems table if it was requested.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


TBCDField

Hierarchy	Properties	Methods	Events	See also

TBCDField represents a binary-coded decimal (BCD) field in a dataset.

Unit

db

Description

TBCDField is a persistent field object that encapsulates the fundamental behavior common to binary-coded decimal (BCD) fields. TBCDField inherits properties, methods, and events common to all field objects from TField. TBCDField reimplements a number of properties for managing the value and attributes of a numeric field in a database.

As with all persistent field objects, a TBCDField can be created at design-time using the Fields Editor or at runtime by calling the constructor for the class. Persistent field objects exist solely in the memory space of the application. Creating a persistent field object only creates an object in the application, and does not result in the creation of a field in a table.

Fields in a table can be accessed without use of persistent field objects. Virtual field objects are created to provide access to a field when the field is referenced through such means as the TDataSet.Fields property or the TDataSet.FieldByName method. So that the return value of the Fields property and FieldByName method can be properly treated as a TBCDField, typecast the return value as a TBCDField.

BCD values provide greater precision and accuracy than floating-point numbers. BCD fields are often used for storing and manipulating monetary values. Normally, BCD values are stored and manipulated in decimal (base ten). However, Delphi does not have a native binary-coded decimal type, so TBCDField uses the Currency type to manipulate BCD values. Currency uses a binary (base two) format.

Because TBCDField uses the Currency type to work with data from BCD fields, TBCDField limits the precision of the BCD values it can support to 4 decimal places and 20 significant digits. The underlying database table may include values that require greater precision. When it encounters such values, TBCDField raises an exception.

Delphi does not have a native type for BCD. Therefore, TBCDField converts the data from a BCD value to a Currency value when it fetches the data from the database table, and converts it from a Currency value to a binary-coded decimal value when it posts the data to the database.


TBCDField properties

TBCDField	Alphabetically	Legend

In TBCDField

AsCurrency

AsFloat

AsInteger

AsString

AsVariant

Currency

DataSize

MaxValue

MinValue

Precision

Value

Derived from TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsDateTime

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TBCDField properties

TBCDField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

Currency

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

MaxValue

MinValue

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

Precision

ProviderFlags

ReadOnly

Required

Size

Tag

Text

ValidChars

Value

VCLComObject

Visible


TBCDField.AsCurrency

TBCDField	See also

Represents the value of the field as a Currency value.

property AsCurrency: Currency;

Description

Use AsCurrency to

Assign the binary-coded decimal (BCD) field value to a currency value.

Assign a currency value to the BCD field.

For example, this code assigns a currency value to a BCD field value:

MyBCDField.AsCurrency := CurrencyValue;

To assign a binary-coded decimal field value to a currency value, use code similar to this:

CurrencyVariable := MyBCDField.AsCurrency;

For BCD fields, the AsCurrency property is equivalent to the Value property. Use AsCurrency when you do not know whether or not the field component is a BCD field.

If a value assigned to the field is not within the range established by the MinValue and the MaxValue properties, an EDatabaseError exception is raised.

Note:	Do not confuse the AsCurrency property, which converts the type of the data, with the Currency property, which indicates how the data should be formatted.


TBCDField.AsFloat

TBCDField	See also

Represents the value of the field as a floating-point value.

property AsFloat: Double;

Description

Use AsFloat to

Assign the binary-coded decimal (BCD) field value to a floating-point value.

Assign a floating-point value to the BCD field.

For example, this code assigns a floating-point value to a BCD field value:

MyBCDField.AsFloat := FloatVariable;

To assign a BCD field value to a floating-point value, use code similar to this:

FloatVariable := MyBCDField.AsFloat;

If a value assigned to the field is not within the range established by the MinValue and the MaxValue properties, an EDatabaseError exception is raised.


TBCDField.AsInteger

TBCDField	See also 	Example

Represents the value of the field as an integer.

property AsInteger: Longint;

Description

Use AsInteger to

Assign the binary-coded decimal field (BCD) value to an integer variable.

Assign an integer value to the BCD field.

For example, this code assigns integer value to a BCD field value:

MyBCDField.AsInteger := IntegerVariable;

To assign a BCD field value to an integer value, use code similar to this:

IntegerVariable := MyBCDField.AsInteger;

If a value assigned to the field is not within the range established by the MinValue and the MaxValue properties, an EDatabaseError exception is raised.


TBCDField.AsString

TBCDField	See also

Represents the value of the field as a string.

property AsString: String;

Description

Use AsString to

Assign the binary-coded decimal (BCD) field value to string variable.

Assign a string value to the BCD field.

For example, this code assigns a string value to a BCD field value:

MyBCDField.AsString := '12.32';

To assign a BCD field value to a string value, use code similar to this:

NewString := MyBCDField.AsString;

If the string assigned to the field does not represent a valid BCD value within the range specified by the MinValue and MaxValue properties, an EDatabaseError exception is raised.


TBCDField.AsVariant

TBCDField	See also

Represents the value of a binary-coded decimal field as a Variant.

property AsVariant: Variant;

Description

Use AsVariant to

Assign the binary-coded decimal (BCD) field value to variant value.

Assign a variant value to the BCD field.

For example, this code assigns a Variant value to a BCD field value:

MyBCDField.AsVariant := VariantVariable;

To assign a BCD field value to a variant value, use code similar to this:

VariantVariable := MyBCDField.AsVariant;

Using variants is useful when both the actual field type and the type of the data are unknown.

If a value assigned to the field is not within the range established by the MinValue and the MaxValue properties, an EDatabaseError exception is raised.


TBCDField.Currency

TBCDField	See also

Determines whether the value in the field should be formatted as a currency value.

property Currency: Boolean;

Description

Use the Currency property to influence how the value in the field should be formatted for viewing and editing in a data-aware control.

For display purposes, the field is formatted using the DisplayFormat property if it is assigned. If DisplayFormat is not assigned, Currency determines how the field is formatted for display. If Currency True, the value is formatted for display using the FloatToText function with the ffCurrency formatting code. If Currency is False, the value is formatted with the ffGeneral format.

For editing purposes, the field is formatted using the EditFormat (or DisplayFormat) property if it is assigned. If neither EditFormat nor DisplayFormat is assigned, Currency determines how to format the field for editing. If Currency is True, the value is formatted for editing using the FloatToText function with the ffFixed formatting code. If Currency is False, the value is formatted with the ffGeneral format.


TBCDField.DataSize

TBCDField	See also	Example

Indicates the amount of memory needed to store the value of a BCD field in its native binary-coded decimal format.

property DataSize: Word;

Description

Check DataSize to determine the number of bytes required to store a binary-coded decimal (BCD) field’s value. Use DataSize to determine the size needed for a buffer when working with the GetData and SetData methods. GetData and SetData work with the field’s value in native database format rather than the Currency type used by the BCD field object.

For BCD fields, DataSize is always 34. BCD fields are a native type to Paradox tables that take up 34 bytes in a database record.


TBCDField.MaxValue

TBCDField	See also

Limits the maximum value in the binary-coded decimal field.

property MaxValue: Currency;

Description

Use MaxValue to get or set the maximum value that can be entered into the field. If a value greater than MaxValue is entered, an EDatabaseError exception is raised.

Newly created binary-coded decimal (BCD) fields set MaxValue to the maximum value that can be expressed by the Currency data type.


TBCDField.MinValue

TBCDField	See also

Limits the minimum value in the binary-coded decimal field.

property MinValue: Currency;

Description

Use MinValue to get or set the minimum value that can be entered into the field. If a value smaller than MinValue is entered, an EDatabaseError exception is raised.

Newly created integer fields set MinValue to the minimum value that can be expressed by the Currency data type.


TBCDField.Precision

TBCDField	See also

Specifies the number of digits of accuracy used to store the field value.

property Precision: Integer;

Description

Precision can be a value between 0 and 32. However, because TBCDField uses the Currency type to work with data from BCD fields, TBCDField limits the precision of the BCD values it can support to 4 decimal places and 20 significant digits. The underlying database table may include values that require greater precision, and setting precision to a value greater than 20 allows you to create a table with higher precision.


TBCDField.Value

TBCDField	See also

Represents the value of the BCD field as a Currency value.

property Value: Currency;

Description

Unlike other field types, the Value of a binary-coded decimal (BCD) field does not correspond exactly to the physical format of the data that is stored in the underlying database table. Delphi does not have a native type for BCD. Therefore, TBCDField converts the data from a BCD value to a Currency value when it fetches the data from the database table, and converts it from a Currency value to a BCD value when it posts the data to the database. For BCD fields, Value is the same as the AsCurrency property.

Note:	Because TBCDField works with its data as a Currency value, simply getting the value of the field and posting that value back to the database table can alter the contents of the field. Thus the line below can alter the contents of the field in the database table.

MyBCDField.Value := MyBCDField.Value;


TBCDField events

TBCDField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TBCDField events

TBCDField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TBCDField methods

TBCDField	Alphabetically

In TBCDField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBCDField methods

TBCDField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TBCDField.Create

TBCDField	See also

Create creates an instance of TBCDField.

constructor Create(AOwner: TComponent); override;

Description

Call Createkeyword, to create and initialize an instance of TBCDField. After calling the inherited constructor, Create sets the DataType property to ftBCD and initializes the Size to 4.

After instantiating a TBCDField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TBCDField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TBCDField with a dataset component by setting its DataSet property to the name of the dataset component. Specify the precision of the TBCDField by setting the Precision property.

The example below creates a TBCDField object for a field named Amount accessed through a TQuery named Query1.

var

  T: TBCDField;

begin

  Query1.Close;

  T := TBCDField.Create(Self);

  T.FieldName := 'Amount';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  T.Precision := 2;

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TNumericField


TBDECallback

Hierarchy	Methods	See also

TBDECallback is a wrapper for a Borland Database Engine (BDE) callback function.

Unit

dbtables

Description

Use a TBDECallback object to register a callback function with the BDE. Callbacks allow an application to instruct the BDE to take specific actions in response to events that occur during a BDE function call.

For example, the TBatchMove object may encounter problems when executing the corresponding BDE batch operation. A callback function can respond to those problems by instructing the BDE to generate a problems table or to trim the data so that the operation succeeds.

To use a TBDECallback object, take the following steps:

1	Create an instance of TBDECallback to register the callback with the BDE.

2	Call the BDE function in which the pertinent events take place. For example, create an instance of TBatchMove, and call its Execute method.

3	When the BDE function returns, destroy the TBDECallback object to unregister the callback function.


TBDECallback methods

TBDECallback	Alphabetically

In TBDECallback

Create

Destroy

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TBDECallback methods

TBDECallback	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TBDECallback.Create

TBDECallback	See also

Creates an instance of TBDECallback and registers the specified callback with the Borland Database Engine (BDE).

type TBDECallbackEvent = function(CBInfo: Pointer): CBRType of object;

constructor Create(AOwner: TObject; Handle: hDBICur; CBType: CBType; CBBuf: Pointer; CBBufSize: Integer; CallbackEvent: TBDECallbackEvent; Chain: Boolean);

Description

Call Create to register a callback with the BDE. Create a TBDECallback object before calling any BDE function that should use the callback to respond to events.

When the BDE encounters the type of event indicated by the CBType parameter, the function specified by the CallbackEvent parameter is called. The CallbackEvent function receives a pointer to a callback descriptor. The type of the callback descriptor varies depending on the CBType. The Delphi application must allocate the memory for the callback descriptor. A pointer to this memory is passed in as the CBBuf parameter, and its size is given by the CBBufSize parameter.

The Chain parameter indicates whether this callback function should replace any other callbacks of this CBType. When Chain is False, the CallbackEvent function replaces any callbacks registered for the CBType. When Chain is True, the CallbackEvent function is called in addition to other registered callbacks.

The Handle parameter is an optional parameter indicating the database cursor associated with the BDE function that may generate the callback. Provide a Handle to make the callback specific to function calls for that cursor.

The types of callback descriptors associated with each CBType are given in the following table. For more information, see the BDE documentation.

CBType	Usage	callback descriptor
cbGENPROGRESS	Respond to information about progress during large batch operations. For example, implement a progress bar or cancel button.  Return cbrABORT to cancel, cbrCONTINUE to continue.	CBPROGRESSDesc
cbRESTRUCTURE	Instruct BDE on how to proceed with situations encountered during a table restructure.  Return cbrYES, to proceed with the default handling, cbrNO to proceed without the default behavior, cbrABORT to cancel the restructure.	RESTCbDesc
cbBATCHRESULT	Instruct BDE on how to proceed with situations encountered during a batch operation.  Return cbrYES, to proceed with the default handling, cbrNO to proceed without the default behavior, cbrABORT to cancel the batch operation.	RESTCbDesc
cbTABLECHANGED	Respond to notifications that a table has changed. The return value is ignored.	not used
cbCANCELQRY	Return cbrABORT to cancel a long running query, or cbrCONTINUE to keep going. The callback is called periodically during the execution of the query.	not used
cbINPUTREQ	Instruct BDE on how to respond when a file (such as a lookup table) is missing.  Indicate the chosen behavior in the CBInputDesc and return cbrCONTINUE.	CBInputDesc
cbDBASELOGIN	Enter a password for an encrypted dBASE table and return cbrCONTINUE.	CBLoginDesc
cbFIELDRECALC	Respond to notifications that fields need to be recalculated. The return value is ignored.	not used
cbTRACE	Respond to trace information about the actions taken by the BDE. The return value is ignored.	TRACEDesc
cbDBLOGIN	Log in to a database server. Return cbrCONTINUE.	not used.
cbDELAYEDUPD	Respond to the notification when cached updates fail to write a modified record to the database.  Return cbrABORT to cancel all cached updates, cbrSKIP or cbrCONTINUE to discard the failed update and continue posting records, cbrRETRY to try the failed commit again.	DELAYUPDCbDesc
Note:	The VCL uses many BDE callback functions. Calling Create with Chain set to False may disable the expected behavior of some objects.


TBDECallback.Destroy

TBDECallback	See also

Unregisters the callback and destroys an instance of TBDECallback.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free, which checks that the TBDECallback object is not nil and only then calls Destroy.

Destroy unregisters the callback before freeing the memory associated with the TBDECallback object. After unregistering the callback, any previous callback of the same type will be reinstated.


Hierarchy

TObject


TBDEDataSet

Hierarchy	Properties	Methods	Events	See also

Encapsulates Borland Database Engine (BDE) functionality for descendant dataset objects.

Unit

dbtables

Description

TBDEDataSet is a dataset object that defines BDE functionality for a dataset. Applications never use TBDEDataSet objects directly. Instead they use the descendants of TBDEDataSet and TDBDataSet, such as TQuery, TStoredProc, and TTable, which inherit its database-related properties and methods.

Developers who create custom dataset components that work through the BDE may want to derive them directly from TBDEDataSet to inherit all the functionality of TDataSet and the BDE-related properties and methods of TBDEDataSet. To inherit control over Delphi database objects, however, most developers should derive custom dataset components that use the BDE from the immediate descendant of TBDEDataSet, TDBDataSet.


TBDEDataSet properties

TBDEDataSet	Alphabetically	Legend

In TBDEDataSet

BlockReadSize

CacheBlobs

CachedUpdates

CanModify

ExpIndex

Filter

Filtered

FilterOptions

Handle

KeySize

Locale

RecNo

RecordCount

RecordSize

UpdateObject

UpdateRecordTypes

UpdatesPending

Derived from TDataSet

Active

AggFields

AutoCalcFields

Bof

Bookmark

DataSetField

DataSource

DefaultFields

Designer

Eof

FieldCount

FieldDefList

FieldDefs

FieldList

Fields

FieldValues

Found

Modified

Name

ObjectView

SparseArrays

State

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TBDEDataSet properties

TBDEDataSet	By object	Legend

Active

AggFields

AutoCalcFields

BlockReadSize

Bof

Bookmark

CacheBlobs

CachedUpdates

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DataSetField

DataSource

DefaultFields

Designer

DesignInfo

Eof

ExpIndex

FieldCount

FieldDefList

FieldDefs

FieldList

Fields

FieldValues

Filter

Filtered

FilterOptions

Found

Handle

KeySize

Locale

Modified

Name

ObjectView

Owner

RecNo

RecordCount

RecordSize

SparseArrays

State

Tag

UpdateObject

UpdateRecordTypes

UpdatesPending

VCLComObject


TBDEDataSet.BlockReadSize

TBDEDataSetSee also

Determines how many record buffers are read in each block.

property BlockReadSize: Integer;

Description

Set BlockReadSize when you need to scan through the entire dataset quickly. When BlockReadSize is greater than zero, and Next is called, data-aware controls are not updated, and data events are not triggered. Set BlockReadSize to zero to disable block read mode. The dataset State is dsBlockRead when BlockReadSize is greater than zero.


TBDEDataSet.CacheBlobs

TBDEDataSetSee also

Determines whether BLOB fields are cached in memory.

property CacheBlobs: Boolean;

Description

Use CacheBlobs to specify whether or not to store BLOB images in memory to improve performance when scrolling through records that display BLOB images. CacheBlobs is True by default, meaning that BLOBs are cached in memory. If an application does not need to display the BLOBs associated with records, then set CacheBlobs to False to conserve system resources.


TBDEDataSet.CachedUpdates

TBDEDataSet	See also

Specifies whether cached updates are enabled for a dataset.

property CachedUpdates: Boolean;

Description

CachedUpdates enables or disables the use of cached updates for a dataset. If CachedUpdates is True, cached updates are enabled. If CachedUpdates is False, cached updates are disabled.

When cached updates are enabled, updates to a dataset (such as posting changes, inserting new records, or deleting records), are stored in an internal cache on the client machine instead of being written directly to the dataset’s underlying database tables. When changes are complete, an application writes all cached changes to the database in the context of a single transaction.

Cached updates are most useful to client applications in two-tiered applications. The main benefits of enabling cached updates are:

•	Fewer transactions and shorter transaction times.

•	Minimization of network traffic.

The potential drawbacks of enabling cached updates are:

•	Other applications can access and change the actual data on the server while users are editing local copies of the data, resulting in an update conflict when cached updates are applied to the database.

•	Other applications cannot access data changes made by an application until its cached updates are applied to the database.

Note:	Instead of using cached updates, applications can obtain the same benefits with greater control by using a client dataset and a provider component.


TBDEDataSet.CanModify

TBDEDataSet	See also

Indicates whether the database underlying a dataset permits write access to data.

property CanModify: Boolean;

Description

Examine CanModify to determine if the database underlying a dataset permits write access to data. When a database connection is established, a dataset typically requests write access. CanModify indicates whether or not write access is granted. If CanModiy is True, data can be modified and written to the database server. If CanModify is False, data can be viewed, but not modified.

Note:	Restrictions on write access for a given user may still prevent writing to an SQL database server even if CanModify is True.


TBDEDataSet.ExpIndex

TBDEDataSet

Indicates whether a dataset is using a dBASE expression index.

property ExpIndex: Boolean;

Description

Read ExpIndex to determine if a dataset is using a dBASE expression index. If ExpIndex is True, an expression index is in use; otherwise ExpIndex is False.


TBDEDataSet.Filter

TBDEDataSet	See also

Specifies the text of the current filter for a dataset.

property Filter: String;

Description

Use Filter to specify a dataset filter. When filtering is applied to a dataset, only those records that meet a filter’s conditions are available to an application. Filter contains the string that describes the filter condition. For example, the following filter condition displays only those records where the State field is 'CA' or 'MA':

State = 'CA' or State = 'MA'

To filter strings bases on partial comparisons, use an asterisk as a wildcard. For example:

State = 'M*'

Note:	Applications can set Filter at runtime to change the filtering condition for a dataset at (for example, in response to user input).


TBDEDataSet.Filtered

TBDEDataSet	See also

Specifies whether filtering is active for a dataset.

property Filtered: Boolean;

Description

Check Filtered to determine whether or not dataset filtering is in effect. If Filtered is True, then filtering is active. Otherwise Filtered is False. To apply filter conditions specified in the Filter property or the OnFilterRecord event handler, set Filtered to True.

Note:	When filtering is enabled, user edits to a record may mean that the record no longer meets a filter’s test condition. The next time the record is retrieved from the dataset while the filter is in effect, the record may seem to disappear. If that happens, the next record that passes the filter condition becomes the current record.


TBDEDataSet.FilterOptions

TBDEDataSet	See also

Specifies whether filtering is case insensitive, and whether or not partial comparisons are permitted when filtering records.

property FilterOptions: TFilterOptions;

Description

Set FilterOptions to specify whether or not filtering is case insensitive when filtering on string or character fields, and whether or not partial comparisons for matching filter conditions is allowed.

By default, FilterOptions is set to an empty set. For filters based on string fields, include foCaseInsensitive in FilterOptions to catch all variations on a string regardless of capitalization.

To prevent partial string comparisons, include foNoPartialCompare in FilterOptions.

Note:	To filter strings bases on partial comparisons, exclude foNoPartialCompare from FilterOptions and use an asterisk as a wildcard. For example:

State = 'M*'


TBDEDataSet.Handle

TBDEDataSet	See also

Specifies the Borland Database Engine (BDE) cursor handle for the dataset.

type HDBICur: Longint;

property Handle: HDBICur;

Description

Use Handle only to bypass TDataSet methods and call directly into the BDE. Many BDE function calls require a cursor handle parameter. Handle is assigned an initial value when a dataset is opened. If used with a BDE call that changes the current record position, call Resync immediately after returning from the BDE call.

Note:	Do not use this property unless an application requires BDE functionality not available through built-in components.


TBDEDataSet.KeySize

TBDEDataSet	See also

Specifies the size of the key for the current index of the dataset.

property KeySize: Word;

Description

Check KeySize to determine the size, in bytes, of the key for the current index. KeySize varies depending on the number and type of fields that make up the current index.


TBDEDataSet.Locale

TBDEDataSet	See also

Identifies the Borland Database Engine (BDE) language driver for the dataset.

property Locale: TLocale;

Description

Examine Locale to determine the BDE language driver for the dataset. Applications that make direct calls to the BDE API may need to pass Locale information as a function parameter.

Language driver information may also be available as one of the values in the Params property of the database component that owns the dataset.

Note:	Do not use this property unless an application requires BDE functionality not available through built-in components.


TBDEDataSet.RecNo

TBDEDataSet	See also

Indicates the current record in the dataset.

property RecNo: Longint;

Description

Examine RecNo to determine the record number of the current record in the dataset. Applications might use this property with RecordCount to iterate through all the records in a dataset, though typically record iteration is handled with calls to First, Last, MoveBy, Next, and Prior.

Note:	If accessing Paradox tables, RecNo can be set to a specific record number to position the cursor on that record.


TBDEDataSet.RecordCount

TBDEDataSet	See also	Example

Indicates the total number of records associated with the dataset.

property RecordCount: Longint;

Description

Examine RecordCount to determine the total number of records in the dataset. Applications might use this property with RecNo to iterate through all the records in a dataset, though typically record iteration is handled with calls to First, Last, MoveBy, and Prior.

Note:	Use RecordCount with care, because record counting can be a costly operation, especially for SQL queries that return large result sets. Generally, an application should only use RecordCount with Paradox and dBASE tables.


TBDEDataSet.RecordSize

TBDEDataSet	See also

Indicates the size of a record in the dataset.

property RecordSize: Word;

Description

Examine RecordSize to determine the physical size, in bytes, of the buffer Delphi allocates to hold a record in the dataset. When a dataset is opened, the Open procedure requests record-buffer size information from the Borland Database Engine (BDE) and stores the returned information in RecordSize. Delphi uses this information internally. Applications seldom, if ever, require this information.


TBDEDataSet.UpdateObject

TBDEDataSet	See also

Specifies the update object component used to update a read-only result set when cached updates are enabled.

property UpdateObject: TDataSetUpdateObject;

Description

Use UpdateObject to specify the TUpdateObject component to use in an application that must be able to update a read-only result set returned by the Borland Database Engine (BDE).

The BDE always attempts to provide an updateable, or “live” query result unless an application specifically requests a read-only view of data. In some cases, such as a query made against multiple tables, a live result set cannot be returned. In these cases, UpdateObject can be used to specify a TUpdateSQL component that performs updates as a separate transaction that is transparent to the application.


TBDEDataSet.UpdateRecordTypes

TBDEDataSet	See also	Example

Specifies the type of records visible in a dataset when cached updates are enabled.

type TUpdateRecordTypes= set of (rtModified, rtInserted, rtDeleted, rtUnmodified);

property UpdateRecordTypes: TUpdateRecordTypes;

Description

Use UpdateRecordTypes to specify the records that are visible in a dataset when cached updates are enabled. UpdateRecordTypes is a set that can have the following values:

Value	Meaning

rtModified	Modified records are visible.

rtInserted	Inserted records are visible.

rtDeleted	Deleted records are visible.

rtUnmodified	Unmodified records are visible.

By default, a dataset is created with an UpdateRecordTypes set of [rtModified, rtInserted, rtUnmodified], meaning that all existing, edited, or inserted records are visible to the user.

An application that must cycle through a dataset to undelete records may change UpdateRecordTypes as part of an undelete method, so that deleted records are “visible” long enough to restore them to their previously undeleted conditions.

An application might also use UpdateRecordTypes like a filter to temporarily limit visible records to those added or inserted by the user during the current session.


TBDEDataSet.UpdatesPending

TBDEDataSet	See also	Example

Indicates whether the cached updates buffer contains records that are not yet applied.

property UpdatesPending: Boolean;

Description

Examine UpdatesPending to check the status of the cached updates buffer. If UpdatesPending is True, then there are edited, deleted, or inserted records to apply to the database. If UpdatesPending is False, there are no records in the cache.


TBDEDataSet events

TBDEDataSet	Alphabetically	Legend

In TBDEDataSet

OnUpdateError

OnUpdateRecord

Derived from TDataSet

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TBDEDataSet events

TBDEDataSet	By object	Legend

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnUpdateError

OnUpdateRecord


TBDEDataSet.OnUpdateError

TBDEDataSet	See also

Occurs if an exception is generated when cached updates are applied to a database.

TUpdateErrorEvent = procedure(DataSet: TDataSet; E: EDatabaseError; UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction) of object;

property OnUpdateError: TUpdateErrorEvent;

Description

Write an OnUpdateError event handler to respond to exceptions generated while applying cached updates to a database.

Because there is a delay between the time a record is first cached and the time cached updates are applied, there is a possibility that another application may change one or more of the same records in the database before the cached changes can be applied. The Borland Database Engine (BDE) checks for this condition and raises an exception. TBDEDataSet responds by calling the OnUpdateError event handler if it exists.

DataSet is the name of the dataset to which updates are applied.

E is a pointer to a EDBEngineError object from which an application can extract an error message and the actual cause of the error condition. The OnUpdateError handler can use this information to determine how to respond to the error condition.

UpdateKind indicates whether the error occurred while inserting, deleting, or modifying a record.

UpdateAction indicates the action to take when the OnUpdateError handler exits. On entry into the handler, UpdateAction is always set to uaFail. If OnUpdateError can handle or correct the error, set UpdateAction to uaRetry before exiting the error handler.

The error handler can use the TField.OldValue and TField.NewValue properties to evaluate error conditions and set TField.NewValue to a new value to reapply. In this case, set UpdateAction to uaRetry before exiting.

Note:	If a call to ApplyUpdates raises an exception and ApplyUpdates is not called within the context of a try...except block, an error message is displayed. If an OnUpdateError handler cannot correct the error condition and leaves UpdateAction set to uaFail, the error message is displayed twice. To prevent redisplay, set UpdateAction to uaAbort in the error handler.

Important:	The code in an OnUpdateError handler must not call any methods that make a different record the current one.


TBDEDataSet.OnUpdateRecord

TBDEDataSet	See also

Occurs when cached updates are applied to a record.

type TUpdateRecordEvent = procedure(DataSet: TDataSet; UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction) of object;

property OnUpdateRecord: TUpdateRecordEvent;

Description

Write an OnUpdateRecord event handler to process updates that cannot be handled by a single update component, such as implementation of cascading updates, insertions, or deletions. This handler is also useful for applications that require additional control over parameter substitution in update components.

DataSet is the name of the dataset to which updates are applied.

UpdateKind indicates whether the current update is the insertion of a record, the deletion of a record, or the modification of a record.

UpdateAction indicates the action taken by the OnUpdateRecord handler before it exits. On entry into the handler, UpdateAction is always set to uaFail. If OnUpdateRecord is successful, it should set UpdateAction to uaApplied before exiting.

The code in an OnUpdateRecord handler must not call any methods that make a different record the current one.

Note:	As an alternate approach, application can use a client dataset and a provider component to handle cached updates. This alternative provides more support and greater control.


TBDEDataSet methods

TBDEDataSet	Alphabetically

In TBDEDataSet

ApplyUpdates

BookmarkValid

Cancel

CancelUpdates

CommitUpdates

CompareBookmarks

ConstraintCallBack

ConstraintsDisabled

Create

CreateBlobStream

Destroy

DisableConstraints

EnableConstraints

FetchAll

FlushBuffers

GetBlobFieldData

GetCurrentRecord

GetIndexInfo

IsSequenced

Locate

Lookup

Post

RevertRecord

Translate

UpdateStatus

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

CheckBrowseMode

ClearFields

Close

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetDetailDataSets

GetDetailLinkFields

GetFieldData

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsEmpty

IsLinkedTo

Last

MoveBy

Next

Open

Prior

Refresh

Resync

SetFields

UpdateCursorPos

UpdateRecord

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBDEDataSet methods

TBDEDataSet	By object

ActiveBuffer

AfterConstruction

Append

AppendRecord

ApplyUpdates

Assign

BeforeDestruction

BookmarkValid

Cancel

CancelUpdates

CheckBrowseMode

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClearFields

Close

CommitUpdates

CompareBookmarks

ConstraintCallBack

ConstraintsDisabled

ControlsDisabled

Create

CreateBlobStream

CursorPosChanged

DefaultHandler

Delete

Destroy

DestroyComponents

Destroying

DisableConstraints

DisableControls

Dispatch

Edit

EnableConstraints

EnableControls

ExecuteAction

FetchAll

FieldAddress

FieldByName

FindComponent

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FlushBuffers

Free

FreeBookmark

FreeInstance

FreeNotification

FreeOnRelease

GetBlobFieldData

GetBookmark

GetCurrentRecord

GetDetailDataSets

GetDetailLinkFields

GetFieldData

GetFieldList

GetFieldNames

GetIndexInfo

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GotoBookmark

HasParent

InheritsFrom

InitInstance

Insert

InsertComponent

InsertRecord

InstanceSize

IsEmpty

IsLinkedTo

IsSequenced

Last

Locate

Lookup

MethodAddress

MethodName

MoveBy

NewInstance

Next

Open

Post

Prior

Refresh

RemoveComponent

Resync

RevertRecord

SafeCallException

SetFields

Translate

UpdateAction

UpdateCursorPos

UpdateRecord

UpdateStatus


TBDEDataSet.ApplyUpdates

TBDEDataSet	See also	Example

Writes a dataset’s pending cached updates to the database.

procedure ApplyUpdates;

Description

Call ApplyUpdates to write a dataset’s pending cached updates to a database. This method passes cached data to the database for storage, but the changes are not committed to the database. An application must explicitly call the database component’s Commit method to commit the changes to the database if the write is successful, or call the database’s Rollback method to undo the changes if there is an error.

Following a successful write to the database, and following a successful call to the database’s Commit method, an application should call the CommitUpdates method to clear the cached update buffer.

Note:	The preferred method for updating datasets is to call a database component’s ApplyUpdates method rather than to call each individual dataset’s ApplyUpdates method. The database component’s ApplyUpdates method takes care of committing and rolling back transactions and clearing the cache when the operation is successful.


TBDEDataSet.BookmarkValid

TBDEDataSet	See also

Tests the validity of a specified bookmark.

function BookmarkValid(Bookmark: TBookmark): Boolean; override;

Description

Call BookmarkValid to determine if a specifed bookmark is currently assigned a value. Bookmark specifies the bookmark to test.

BookmarkValid returns True if a bookmark is valid. Otherwise, it returns False.


TBDEDataSet.Cancel

TBDEDataSet	See also 	Example

Cancels modifications to the current record if those changes are not yet posted.

procedure Cancel;

Description

Call Cancel to undo modifications made to one or more fields belonging to the current record. As long as those changes are not already posted to the database, Cancel returns the record to its previous state, and sets the dataset state to dsBrowse.

Typically Cancel is used to back out of changes in response to user request, or in field validation routines that back out illegal field values. The TDBNavigator object contains a Cancel button that triggers a call to Cancel.


TBDEDataSet.CancelUpdates

TBDEDataSet	See also

Clears all pending cached updates from the cache and restores the dataset its prior state.

procedure CancelUpdates;

Description

Call CancelUpdates to clear all pending cached updates from the cache and restore the dataset to the state it was in when the table was opened, cached updates were last enabled, or updates were last successfully applied to the database.

When a dataset is closed, or the CachedUpdates property is set to False, CancelUpdates is called automatically.

Note:	To undo changes to a single record, call RevertRecord.


TBDEDataSet.CommitUpdates

TBDEDataSet	See also	Example

Clears the cached updates buffer.

procedure CommitUpdates;

Description

Call CommitUpdates to clear the cached updates buffer after both a successful call to ApplyUpdates and a database component’s Commit method. Clearing the cache after applying updates ensures that the cache is empty except for records that could not be processed and were skipped by the OnUpdateRecord or OnUpdateError event handlers. An application can attempt to modify the records still in the cache.

Record modifications made after a call to CommitUpdates repopulate the cached update buffer and require a subsequent call to ApplyUpdates to move them to the database.

Note:	Applications that use a database component’s ApplyUpdates method to apply and commit pending updates for all datasets associated with the database component do not need to call CommitUpdates.


TBDEDataSet.CompareBookmarks

TBDEDataSet	See also

Indicates the relationship between two bookmarks.

function CompareBookmarks(Bookmark1, Bookmark2: TBookmark): Integer;

Description

Call CompareBookmarks to determine if two bookmarks are identical. Bookmark1 and Bookmark2 are the bookmarks to compare. CompareBookmarks returns -1 if Bookmark1 is less than Bookmark2, 1 if Bookmark1 is greater than Bookmark2, and 0 if the bookmarks are identical or nil.


TBDEDataSet.ConstraintCallBack

TBDEDataSet	See also

Specifies the callback function that allows the dataset to communicate with the BDE constraint layer.

function ConstraintCallBack(Req: DsInfoReq; var ADataSources: DataSources): DBIResult; stdcall;

Description

Use the address of ConstraintCallBack as a parameter when making direct API calls to Borland Database Engine (BDE) functions that require a callback to provide information about the constraints on the dataset or its fields.


TBDEDataSet.ConstraintsDisabled

TBDEDataSet	See also

Indicates whether or not constraints are enabled for a dataset.

function ConstraintsDisabled: Boolean;

Description

Call ConstraintsDisabled to determine if constraints are currently disabled for a dataset. If ConstraintsDisabled returns True, constraints are currently disabled. If False, constraints are currently enabled.


TBDEDataSet.Create

TBDEDataSet	See also

Creates an instance of a TBDEDataSet component.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a dataset component at runtime. Ordinarily applications instantiate TBDEDataSet descendants, such as TTable, TQuery, or TStoredProc.

Create

•	Calls its inherited Create method.

•	Set the Locale property of the dataset to the locale of the default session.

•	Sets the CacheBlobs property to True.


TBDEDataSet.CreateBlobStream

TBDEDataSet	See also 	Example

Returns a TBlobStream object for reading or writing the data in a specified blob field.

function CreateBlobStream(Field: TField; Mode: TBlobStreamMode): TStream; override;

Description

Call CreateBlobStream to obtain a stream for reading data from or writing data to a binary large object (BLOB) field. The Field parameter must specify a TBlobField component from the Fields property array. The Mode parameter specifies whether the stream will be used for reading, writing, or updating the contents of the field.

Blob streams are created in a specific mode for a specific field on a specific record. Applications should create a new blob stream every time the record in the dataset changes rather than reusing an existing blob stream.


TBDEDataSet.Destroy

TBDEDataSet	See also

Destroys the instance of a dataset component.

destructor Destroy;

Description

Do not call Destroy directly in an application. Usually destruction of datasets is handled automatically If an application creates its own instances of a dataset, however, the application should call Free, which checks that the dataset component is not nil before calling Destroy.

Destroy calls its inherited destructor if necessary, frees the resources allocated for the BDE asynchronous callback, and sets the UpdateObject property for the dataset to nil.


TBDEDataSet.DisableConstraints

TBDEDataSet	See also

Disables application of server constraints on the dataset.

procedure DisableConstraints;

Description

Call DisableConstraints to prevent, on a temporary basis, application of server constraints replicated to the dataset. For example, when an application iterates through a dataset, it may improve performance to disable constraints temporarily.

Note:	Calling DisableConstraints increments a reference count. As long as this reference count is greater than zero, constraints are disabled for the dataset. To prevent accidental disabling of constraints, always group a call to DisableConstraints with a call to EnableConstraints.


TBDEDataSet.EnableConstraints

TBDEDataSet	See also

Enables application of server constraints against dataset entries.

procedure EnableConstraints;

Description

Call EnableConstraints to turn on application server constraints previously disabled by a call to DisableConstraints.

Note:	Calling EnableConstraints decrements a reference count. When this reference count is zero constraints are enabled for the dataset. To prevent accidental disabling of constraints, always follow a call to DisableConstraints with a matching call to EnableConstraints.


TBDEDataSet.FetchAll

TBDEDataSet	See also

Retrieves all records from the current cursor position to the end of the file and stores them locally.

procedure FetchAll;

Description

Call FetchAll to reduce network traffic when using cached updates. FetchAll calls CheckBrowseMode to post any pending changes, and then retrieves all records from the current cursor position to the end of the file, and store them locally.

Ordinarily when cached updates are enabled, a transaction retrieves only as much data as it needs for display purposes. Each new fetch starts a new, read-only transaction. To consolidate transactions and reduce network traffic, an application can call FetchAll to retrieve all data in a single transaction.

Note:	Using FetchAll is not always appropriate. For example, when an application accesses a database used by many simultaneous clients and there is a high degree of contention for updating the same records, fetching all records at once may not be advantageous because some fetched records may be changed by other applications. Always weigh the advantages of reduced network traffic against the need for reduced record contention.


TBDEDataSet.FlushBuffers

TBDEDataSet	See also

Posts all changes that have been written to the record buffer.

procedure FlushBuffers;

Description

Call FlushBuffers to cause the dataset to post all pending changes to the database, including any cached updates. Use FlushBuffers instead of CheckBrowseMode if it is important that cached record buffers are posted.


TBDEDataSet.GetBlobFieldData

TBDEDataSet	See also

Reads BLOB data into a buffer.

TBlobByteData = array of Byte;

function GetBlobFieldData(FieldNo: Integer; var Buffer: TBlobByteData): Integer; override;

Description

GetBlobFieldData reads blob data from the field specified by FieldNo into a Buffer. The buffer is a dynamic array of bytes, so that it can grow to accommodate the size of the BLOB data. GetBlobFieldData returns the size of the buffer.


TBDEDataSet.GetCurrentRecord

TBDEDataSet	See also

Retrieves the current record into a buffer.

function GetCurrentRecord(Buffer: PChar): Boolean;

Description

Most applications should not need to call GetCurrentRecord. TDataSet automatically allocates a buffer for the active record.

Call GetCurrentRecord to copy the current record into a buffer allocated by the application. Buffer must be at least as big as the record size indicated by the RecordSize property.


TBDEDataSet.GetFieldData

TBDEDataSet	See also

Retrieves the current value of a field into a buffer.

function GetFieldData(FieldNo: Integer; Buffer: Pointer): Boolean; overload; override;

function GetFieldData(Field: TField; Buffer: Pointer): Boolean; overload; override;

function GetFieldData(Field: TField; Buffer: Pointer; NativeFormat: Boolean): Boolean; overload; virtual;

Description

Most applications do not need to call GetFieldData. TField objects call this method to implement their GetData method.

The Field or FieldNo parameter indicates the field whose data should be fetched. Field specifies the component itself, while FieldNo indicates its field number. The Buffer parameter is a memory buffer with sufficient space to accept the value of the field as it exists in the database (unformatted and untranslated). NativeFormat indicates whether the dataset fetches the field in Delphi’s native format for the field type. When NativeFormat is False, the dataset must convert the field value to the native type. This allows the field to handle data from different types of datasets (ADO-based, BDE-based, and so on) in a uniform manner.

GetFieldData returns a value that indicates whether the data was successfully fetched.

GetFieldData returns True if the buffer is successfully filled with the field’s data, and False if the data could not be fetched.


TBDEDataSet.GetIndexInfo

TBDEDataSet	See also

Retrieves information about the current index into the index data fields of the dataset.

procedure GetIndexInfo;

Description

Call GetIndexInfo to update information about the current index. Ordinarily an application does not need to call GetIndexInfo because this routine is used internally to retrieve index information as needed. Some applications, however, may want to ensure that the index information used by the dataset is up-to-date.

GetIndexInfo queries the BDE for index information, including:

•	Whether or not the current index is a dBASE expression index.

•	Whether or not the index is case insensitive.

•	The number of fields that make up the key for the index.

•	The field map for the index.

•	The size of the index key.

Number of fields and field map are not retrieved if the index is a dBASE expression index.


TBDEDataSet.IsSequenced

TBDEDataSet	See also

IsSequenced indicates whether sequence numbers are available for database records.

function IsSequenced: Boolean; override;

Description

Call IsSequenced to determine whether database records can be located by sequence numbers. When IsSequenced is True, the dataset can navigate directly to a specific record by setting the RecNo property. If IsSequenced is False, the only way to navigate to a specific record is to start at the beginning and count records.


TBDEDataSet.Locate

TBDEDataSet	See also

Searches the dataset for a specified record and makes that record the current record.

function Locate(const KeyFields: String; const KeyValues: Variant; Options: TLocateOptions): Boolean;

Description

Call Locate to search a dataset for a specific record and position the cursor on it.

KeyFields is a string containing a semicolon-delimited list of field names on which to search.

KeyValues is a variant array containing the values to match in the key fields. If KeyFields lists a single field, KeyValues specifies the value for that field on the desired record. To specify multiple search values, pass a variant array as KeyValues, or construct a variant array on the fly using the VarArrayOf routine. For example:

with CustTable do

  Locate('Company;Contact;Phone', VarArrayOf(['Sight Diver', 'P', '408-431-1000']), [loPartialKey]);

Options is a set that optionally specifies additional search latitude when searching on string fields. If Options contains the loCaseInsensitive setting, then Locate ignores case when matching fields. If Options contains the loPartialKey setting, then Locate allows partial-string matching on strings in KeyValues. If Options is an empty set, or if the KeyFields property does not include any string fields, Options is ignored.

Locate returns True if it finds a matching record, and makes that record the current one. Otherwise Locate returns False.

Locate uses the fastest possible method to locate matching records. If the search fields in KeyFields are indexed and the index is compatible with the specified search options, Locate uses the index. Otherwise Locate creates a filter for the search.


TBDEDataSet.Lookup

TBDEDataSet	See also

Retrieves field values from a record that matches specified search values.

function Lookup(const KeyFields: String; const KeyValues: Variant; const ResultFields: String): Variant;

Description

Call Lookup to retrieve values for specified fields from a record that matches search criteria. KeyFields is a string containing a semicolon-delimited list of field names on which to search.

KeyValues is a variant array containing the values to match in the key fields. To specify multiple search values, pass KeyValues as a variant array as an argument, or construct a variant array on the fly using the VarArrayOf routine.

ResultFields is a string containing a semicolon-delimited list of field names whose values should be returned from the matching record.

Lookup returns a variant array containing the values from the fields specified in ResultFields.

Lookup uses the fastest possible method to locate matching records. If the search fields in KeyFields are indexed, Lookup uses the index. Otherwise Lookup creates a filter for the search.


TBDEDataSet.Post

TBDEDataSet	See also	Example

Writes a modified record to the database.

procedure Post; override;

Description

Call Post to write a modified record to the database. Dataset methods that change the dataset state, such as Edit, Insert, or Append, or that move from one record to another, such as First, Last, Next, and Prior automatically call Post.


TBDEDataSet.RevertRecord

TBDEDataSet	See also	Example

Restores the current record in the dataset to an unmodified state when cached updates are enabled.

procedure RevertRecord;

Description

Call RevertRecord to undo changes made to the current record when cached updates are enabled.

Note:	To undo all changes to all pending updates in the cache, call CancelUpdates.


TBDEDataSet.Translate

TBDEDataSet

Converts a data string between the ANSI character set used by Delphi (and Windows), and the local code page (OEM character set).

procedure Translate(Src, Dest: PChar; ToOem: Boolean); override;

Description

When the ToOem parameter is True, Translate converts the source string from the ANSI character set to the OEM character set.  If ToOem is False, Translate converts the source string from the OEM character set to the ANSI character set.  By default, BDE datasets work with strings in the OEM character set.  Delphi uses the ANSI character set (which is used by Windows).  Use the Translate method to convert between these two.


TBDEDataSet.UpdateStatus

TBDEDataSet	See also	Example

Reports the update status for the current record.

function UpdateStatus: TUpdateStatus;

Description

Call UpdateStatus to determine the update status for the current record in a dataset when cached updates are enabled. Update status can change frequently as records are edited, inserted, or deleted. UpdateStatus offers a convenient method for applications to assess the current status before undertaking or completing operations that depend on the update status of individual records in the dataset.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataSet


 TBevel

Hierarchy	Properties	Methods	See also

TBevel represents a beveled outline.

Unit

extctrls

Description

Use TBevel to create beveled boxes, frames, or lines. The bevel can appear raised or lowered.


TBevel properties

TBevel	Alphabetically	Legend

In TBevel

Shape

Style

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentShowHint

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TBevel properties

TBevel	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlState

ControlStyle

Cursor

DesignInfo

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentShowHint

Shape

ShowHint

Style

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

Width

WindowProc


TBevel.Shape

TBevel	See also

Determines the shape of the bevel.

type TBevelShape = (bsBox, bsFrame, bsTopLine, bsBottomLine, bsLeftLine, bsRightLine, bsSpacer);

property Shape: TBevelShape;

Description

Set Shape to specify whether the bevel appears as a line, box, frame, or space. These are the possible values of Shape:

Value	Meaning

bsBox	The entire client area appears raised or lowered, depending on the value of Style.

bsFrame	The client area is outlined by a raised or lowered frame.

bsTopLine	The bevel displays a line at the top of the client area.

bsBottomLine	The bevel displays a line at the bottom of the client area.

bsLeftLine	The bevel displays a line at the left side of the client area.

bsRightLine	The bevel displays a line at the right side of the client area.

bsSpacer	The bevel is an empty space.


TBevel.Style

TBevel	See also

Determines whether the bevel appears raised or lowered.

type TBevelStyle = (bsLowered, bsRaised);

property Style: TBevelStyle;

Description

Set Style to indicate whether the bevel should create a raised or a lowered effect. When the Shape property is bsBox, the entire client area appears raised or lowered. For all other values of Shape, the bevel displays a raised or lowered line along the edge or edges of the client area. These are the possible values of Style:

Value	Meaning

bsLowered	The bevel is lowered.

bsRaised	The bevel is raised.


TBevel methods

TBevel	Alphabetically

In TBevel

Create

Derived from TGraphicControl

Destroy

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

Invalidate

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

Repaint

ReplaceDockedControl

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBevel methods

TBevel	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

NewInstance

Perform

Refresh

RemoveComponent

Repaint

ReplaceDockedControl

SafeCallException

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

UpdateAction

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TBevel.Create

TBevel	See also

Creates and initializes an instance of TBevel.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a bevel at runtime. Bevels placed on forms at design time are created automatically. After calling the inherited constructor, Create initializes Style to bsLowered and Shape to bsBox.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl


TBinaryField

Hierarchy	Properties	Methods	Events	See also

TBinaryField represents an untyped binary field in a dataset.

Unit

db

Description

TBinaryField is a persistent field object that encapsulates the fundamental behavior common to untyped binary fields. In addition to the properties, methods, and events common to all fields that are introduced by the TField class, TBinaryField reimplements the properties that are used to read and write binary data from or to the underlying database table.

As with all persistent field objects, a TBinaryField can be created at design-time using the Fields Editor or at runtime by calling the constructor for the class. Persistent field objects exist solely in the memory space of a Delphi application. Creating a persistent field object only creates an object in the application, and does not result in the creation of a field in a table.

Fields in a table can be accessed without use of persistent field objects. Virtual field objects are created to provide access to a field when the field is referenced through such means as the TDataSet.Fields property or the TDataSet.FieldByName method. However, as both the Fields property and the FieldByName method return a value of type TField, the return value must be typecast as a TBinaryField before using any property or method specific to TBinaryField.


TBinaryField properties

TBinaryField	Alphabetically	Legend

In TBinaryField

AsString

AsVariant

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TBinaryField properties

TBinaryField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

ValidChars

Value

VCLComObject

Visible


TBinaryField.AsString

TBinaryField	See also

Represents the value of a binary field as a string.

property AsString: string;

Description

Use AsString to read or write the value of the field as a string. Delphi strings are not limited to text, so the value represented by AsString is the same as the unformatted binary value of the field. When setting the value of AsString, if the assigned value is longer than the DataSize of the field, it will be truncated to include only DataSize bytes.

Note: Reading the Text property of a binary field gives the field name of the field, not the value of AsString.


TBinaryField.AsVariant

TBinaryField	See also

Represents the value of a binary field as a variant array of Byte values.

property AsVariant: Variant;

Description

Use AsVariant to read or write the value of the field as a variant array of byte values. For example, this code assigns a variant array of bytes to a binary field value:

var

  V: Variant;

begin

  V := VarArrayCreate([0, BinaryField.DataSize - 1], VarByte);

  V[i] := 1;

  ...

  BinaryField.AsVariant := V;

end;

To assign a binary field value to a variant variable, use code similar to this:

VariantVariable := MyBinaryField.AsVariant;

Because binary fields are stored in their database tables as unformatted arrays of bytes, the AsVariant property for a binary field is the same as the Value property.


TBinaryField.Value

TBinaryField	See also

Represents the data in the binary field.

property Value: variant;

Description

Use Value to read data from and write data to a binary field component at runtime. For binary fields, the Value property is equivalent to the AsVariant property.


TBinaryField events

TBinaryField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TBinaryField events

TBinaryField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TBinaryField methods

TBinaryField	Alphabetically

In TBinaryField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBinaryField methods

TBinaryField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TBinaryField.Create

TBinaryField	See also

Creates an instance of TBinaryField.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TBinaryField. Create initializes the DataType property to ftBlob.

After instantiating a TBinaryField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TBinaryField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TBinaryField with a dataset component by setting its DataSet property to the name of the dataset component.

The example below creates a TBinaryField object for a field named RawData accessed through a TQuery named Query1.

var

  T: TBinaryField;

begin

  Query1.Close;

  T := TBinaryField.Create(Self);

  T.FieldName := 'RawData';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField


 TBitBtn

Hierarchy	Properties	Methods	Events	See also

TBitBtn is a push button control that can include a bitmap on its button face.

Unit

buttons

Description

Bitmap buttons exhibit the same behavior as button controls. Use them to initiate actions from forms and dialog boxes.

Bitmap buttons have additional properties that are used to specify the bitmap images, and their appearance and placement on the button. You can choose from predefined bitmap buttons styles or use your own, customized bitmap for the button. Although the button can be associated with only one bitmap, the bitmap (glyph property) can be subdivided into four equal-sized portions, which are displayed based on the state of the button: up, down, and disabled.

Note:	Speed buttons can use the fourth part of the glyph with their fourth state called “stay down”.

The Kind property of TBitBtn provides commonly used buttons, such as OK, Cancel, Help, and so on. These predefined button types have appropriate graphical images and default behaviors, so you can easily add them to your application with little or no coding necessary.


TBitBtn properties

TBitBtn	Alphabetically	Legend

In TBitBtn

Glyph

Kind

Layout

Margin

NumGlyphs

Spacing

Style

Derived from TButton

Cancel

Default

ModalResult

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

Caption

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UnDockHeight

UnDockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TBitBtn properties

TBitBtn	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

Cancel

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

Default

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Glyph

Handle

Height

HelpContext

Hint

HostDockSite

Kind

Layout

Left

LRDockWidth

Margin

ModalResult

Name

NumGlyphs

Owner

Parent

ParentBiDiMode

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ShowHint

Showing

Spacing

Style

TabOrder

TabStop

Tag

TBDockHeight

Top

UnDockHeight

UnDockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TBitBtn.Glyph

TBitBtn	See also

Specifies the bitmap that appears on the selected bitmap button.

property Glyph: TBitmap;

Description

Use the Open dialog box that appears as an editor in the Object Inspector to choose a bitmap file (with a .BMP extension) to use on the button, or specify a bitmap file at runtime.

You can provide up to four images within a single bitmap. All images must be the same size and next to each other in a row. Bit buttons display one of these images depending on their state.

Image position	Button state	Description

First	Up	This image appears when the button is up (unselected). This image is also used when the button has focus (for example, if the user tabs to it); in this case, a focus rectangle is drawn around the button. If no other images exist in the bitmap, bit buttons also use this image for all other states.

Second	Disabled	This image usually appears dimmed to indicate that the button can't be selected.

Third	Clicked	This image appears when the button is clicked. The Up image reappears when the user releases the mouse button.

Fourth	Down	This image appears when the button stays down (indicating that it remains selected).

If only one image is present, bit buttons attempt to represent the other states by altering the image slightly for the different states, although the Down state is always the same as the Up state. If you aren't satisfied with the results, you can provide additional images in the bitmap.

If you have multiple images in a bitmap, you must specify the number of images that are in the bitmap with the NumGlyphs property.

Note:	The lower left pixel of the bitmap is reserved for the “transparent” color. Any pixel in the bitmap which matches that lower left pixel will be transparent.


TBitBtn.Kind

TBitBtn	See also 	Example

Determines the kind of bitmap button.

type TBitBtnKind = (bkCustom, bkOK, bkCancel, bkHelp, bkYes, bkNo, bkClose, bkAbort, bkRetry, bkIgnore, bkAll);

property Kind: TBitBtnKind;

Description

The TBitBtnKind type contains the values the Kind property of a TBitBtn bitmap button can assume.

These are the possible values and their meanings:

Value	Meaning

bkCustom	The button uses the Glyph property to determine the image that appears. As with push buttons, select a ModalResult for the button, or supply the code to respond to an OnClick event.

bkOK	A green check mark and the text “OK” appear on the button face. The button becomes the default button (the Default property is automatically set to True). When the user chooses the button, the dialog box closes. The resulting ModalResult value of the bitmap button is mrOK.

bkCancel	A red X and the text “Cancel” appear on the button face. The button becomes the Cancel button (the Cancel property is automatically set to True). When the user chooses the button, the dialog box closes. The resulting ModalResult value of the bitmap button is mrCancel.

bkYes	A green check mark and the text “Yes” appear on the button face. The button becomes the default button (the Default property is automatically set to True) When the user chooses the button, any changes the user made in the dialog box are accepted and the dialog box closes. The resulting ModalResult value of the bitmap button is mrYes.

bkNo	A red no symbol and the text “No” appear on the button face. The button becomes the Cancel button (the Cancel property is automatically set to True). When the user chooses the button, any changes the user made in the dialog box are canceled and the dialog box closes. The resulting ModalResult value of the bitmap button is mrNo.

bkHelp	A cyan question mark and the text “Help” appear on the button face. When the user chooses the button, a Help screen in the application's Help file appears. The Help file that appears is the file specified as the value of the application's HelpFile property. The value of the HelpContext property of the button specifies which Help screen in the Help file appears.

bkClose	A door with a green exit sign over it and the text “Close” appear on the button face. When the user chooses the button, the form closes. The Default property of the button is True.

bkAbort	A red X and the text “Abort” appear on the button face.

bkRetry	A green circular arrow and the text “Retry” appear on the button face.

bkIgnore	A green man walking away and the text “Ignore” appear on the button face. Use it to allow the user to continue after an error has occurred.

bkAll	A double green check mark and the text “Yes to All” appear on the button face.


TBitBtn.Layout

TBitBtn	See also

Determines where the image appears on the bitmap button.

property Layout: TButtonLayout;

Description

The TButtonLayout type defines the values the Layout property of a bitmap button (TBitBtn). These are the possible values:

Value	Meaning

blGlyphLeft	The image appears on the left side of the text or caption.

blGlyphRight	The image appears on the right side of the text or caption.

blGlyphTop	The image appears at the top of the text or caption.

blGlyphBottom	The image appears at the bottom of the text or caption.


TBitBtn.Margin

TBitBtn	See also

Determines the number of pixels between the edge of the image (specified in the Glyph property) and the edge of the button.

property Margin: Integer;

Description

The margin is the space between the image edge and the button edge. The format of the edges depends on the layout of the image and text (specified in the Layout property). For example, if Layout is blGlyphLeft, the margin appears between the left edge of the image and the left edge of the button. If Margin is 3, three pixels separate the image and the button edges. If Margin is 0, there is no space between the image and the button edges.

If Margin is -1 (the default value), the image and text (specified in the Caption property) are centered. The number of pixels between the image and button edge is equal to the number of pixels between the opposite edge of the button and the text.


TBitBtn.NumGlyphs

TBitBtn	See also

Indicates the number of images that are in the graphic specified in the Glyph property for use on a bitmap button or speed button.

type TNumGlyphs = 1..4;

property NumGlyphs: TNumGlyphs;

Description

If you have multiple images in a bitmap, you must specify the number of images that are in the bitmap with the NumGlyphs property. Valid NumGlyphs values are 1 to 4. The default value is 1.


TBitBtn.Spacing

TBitBtn	See also

Determines where the image and text appear on a bitmap or speed button.

property Spacing: Integer;

Description

Spacing determines the number of pixels between the image (specified in the Glyph property) and the text (specified in the Caption property). The default value is 4 pixels.

If Spacing is a positive number, its value is the number of pixels between the image and text. If Spacing is 0, no pixels will be between the image and text. If Spacing is -1, the text appears centered between the image and the button edge. The number of pixels between the image and text is equal to the number of pixels between the text and the button edge opposite the glyph.


TBitBtn.Style

TBitBtn	See also

Determines the appearance of a bitmap button.

type TButtonStyle = (bsAutoDetect, bsWin31, bsNew);

property Style: TButtonStyle;

Description

The TButtonStyle type contains the values the Style property of bitmap buttons can assume. These are the possible values:

Value	Meaning

bsAutoDetect	When using Windows 3.x, the bitmap button uses the standard Windows 3.x look. When using a later version of Windows, the bitmap button uses a newer look.

bsWin31	Uses the standard Windows 3.1 look, regardless of which version of Windows is running.

bsNew	Uses a new bitmap button look, regardless of which version of Windows is running.


TBitBtn events

TBitBtn	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TBitBtn events

TBitBtn	By object	Legend

OnClick

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TBitBtn methods

TBitBtn	Alphabetically

In TBitBtn

Click

Create

Destroy

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DockDrop

DisableAlign

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

NewInstance

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Derived from TButton

UseRightToLeftAlignment


TBitBtn methods

TBitBtn	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Click

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TBitBtn.Click

TBitBtn	See also

Simulates a mouse click, as if the user had clicked the button.

procedure Click;

Description

When Click is called, any code attached to the OnClick event is executed.

If the value of the Kind property is bkClose, calling Click closes the form. If the value of Kind is bkHelp, calling Click displays the Help screen assigned with the HelpContext property to the bitmap button. If Kind has any other value, the inherited Click method is called.


TBitBtn.Create

TBitBtn	See also

Constructs an instance of the button control and initializes its values.

constructor Create(AOwner: TComponent); override;

Description

Use Create to programmatically instantiate a button. For buttons created in the Delphi form designer, Create is called automatically.

TBitBtn

Calls the inherited Create method.

Creates the TBitmap for the Glyph property.

Assigns the GlyphChanged method to the OnChange event.

Creates a TCanvas object for the bitmap button.

Sets the Style property value to bsAutoDetect.

Sets the Kind property value to bkCustom.

Sets the Layout property value to blGlyphLeft.

Sets the Spacing property value to 4.

Sets the Margin property value to -1.


TBitBtn.Destroy

TBitBtn	See also

Destroys the bitmap button object.

destructor Destroy; override;

Description

Do not call Destroy directly in an application.  Instead, call Free.  Free checks that the bitmap button is not nil, and only then calls Destroy.

Destroy frees the TGlyph and TCanvas objects before calling the inherited Destroy method.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TButtonControl

TButton


TBitmap

Hierarchy	Properties	Methods	Events	See also	Example

TBitmap is an encapsulation of a Windows bitmap (HBITMAP), including its palette (HPALETTE).

Unit

graphics

Description

TBitmap contains an internal image of the bitmap graphic and automatically manages realization of the palette when drawn. A bitmap is a powerful graphics object used to create, manipulate (scale, scroll, rotate, and paint), and store images in memory and as files on a disk.

To draw a bitmap on a canvas, call the Draw or StretchDraw methods of a TCanvas object, passing a TBitmap as a parameter.

Creating copies of a TBitmap is very fast since the handle is copied rather than the image. If the image is modified and the handle is shared by more than one TBitmap object, the image is copied before the modification is performed (that is, copy on write).


TBitmap properties

TBitmap	Alphabetically	Legend

In TBitmap

Canvas

Empty

Handle

HandleType

Height

IgnorePalette

MaskHandle

Monochrome

Palette

PixelFormat

ScanLine

TransparentColor

TransparentMode

Width

Derived from TGraphic

Modified

PaletteModified

Transparent


TBitmap properties

TBitmap	By object	Legend

Canvas

Empty

Handle

HandleType

Height

IgnorePalette

MaskHandle

Modified

Monochrome

Palette

PaletteModified

PixelFormat

ScanLine

Transparent

TransparentColor

TransparentMode

Width


TBitmap.Canvas

TBitmap	See also

Provides access to a drawing surface that represents the bitmap.

property Canvas: TCanvas;

Description

Canvas allows drawing on the bitmap by providing a TCanvas object for this purpose. Drawing on the canvas effectively modifies the underlying bitmap image pixels. Any canvas operation is valid on a bitmap  not just Draw and StretchDraw  including line drawing, rectangles, and circles. The bitmap object is passed as a parameter to these methods.

A canvas object is created automatically for the bitmap and the property is read-only.


TBitmap.Empty

TBitmap	See also

Specifies whether the bitmap object contains a bitmap.

property Empty: Boolean;

Description

Use Empty to determine if a bitmap has been loaded into the bitmap object or drawn using its canvas property. If the bitmap image is empty, that is, if the bitmap object does not contain a bitmap, then Empty is True. If the bitmap image is not empty, that is, if the bitmap contains a bitmap, then Empty is False.


TBitmap.Handle

TBitmap 	See also

Provides access to the Windows GDI bitmap handle for accessing the GDI bitmap object.

property Handle: HBitmap;

Description

Use Handle to call a Windows API function that requires the handle of a bitmap object. Pass Handle as the bitmap handle parameter to these functions.

Handle is the HBITMAP encapsulated by the bitmap object. Avoid grabbing the handle directly since it causes the HBITMAP to be copied if more than one TBitmap shares the handle.

Note:	Be careful who you give the handle to. If the receiver will take ownership (and destroy) the bitmap handle, call TBitmap.ReleaseHandle.


TBitmap.HandleType

TBitmap 	See also

Indicates whether the bitmap is a DDB, Device Dependent Bitmap, or a DIB, Device Independent Bitmap.

type TBitmapHandleType = (bmDIB, bmDDB);

property HandleType: TBitmapHandleType;

ype Description

HandleType is used to find or modify the type of the bitmap. DDBs may be faster to draw on the screen, but may be stored in memory in a device-specific format. DIBs are stored in memory in a standard format supported by all devices (including printers).


TBitmap.::Height
TBitmap.Height

TBitmap	See also 	Example

Specifies the vertical size in pixels of the bitmap.

property Height: Integer;

Description

Use Height to find or set the height of the bitmap image. If the Height property is changed, the bitmap image is copied to a new image with the new Height. Any new area added to the bitmap is filled with white. If the new Height value is smaller than the current one, the bitmap image is cropped.


TBitmap.IgnorePalette

TBitmap	See also

Determines whether the bitmap realizes its palette when drawing its image.

property IgnorePalette: Boolean;

Description

Use IgnorePalette when speed of drawing is a priority. When IgnorePalette is True, the bitmap does not realize its palette when drawing itself, resulting in lower picture quality on 256-color video drivers, but faster drawing of the bitmap image.

Note:	Delphi uses IgnorePalette only when a TDBImage is replicated in a TDBCtrlGrid.


TBitmap.::MaskHandle
TBitmap.MaskHandle

TBitmap 	See also

Provides access to the Windows GDI bitmap handle for accessing the GDI bitmap object.

property MaskHandle: HBitmap;

Description

Use MaskHandle to call a Windows API function that requires the handle of a bitmap object. Pass MaskHandle as the bitmap handle parameter to these functions. MaskHandle is the HBITMAP encapsulated by the bitmap object's mask.


TBitmap.Monochrome

TBitmap	Example

Determines whether the bitmap displays its image in monochrome.

property Monochrome: Boolean

Description

If Monochrome is True if the bitmap displays as a monochrome bitmap. Monochrome is False if the bitmap displays in color, that is, if it contains more than one bit per pixel.

Note: Setting a color bitmap's Monochrome property to True changes the image to monochrome. Note that this operation is irreversible.


TBitmap.Palette

TBitmap	Example

Controls a bitmap’s color mapping.

property Palette: HPalette;

Description

Use Palette to read or change the palette for a 256-color bitmap.

Palette is the HPALETTE realized by the bitmap. Grabbing this handle directly should be avoided since it causes the HPALETTE to be copied if more than one TBitmap shares the handle.

Use Palette to assign custom palettes created with CreatePalette to this property. Palette contains up to 256 colors that can be used to display the bitmap on screen.

When running in a 256-color video mode, and if the bitmap is drawn by an application running in the foreground, all colors of Palette are added to the Windows system palette. If the bitmap is drawn by an application running in the background and another application has loaded the system palette with its own colors, the bitmap's colors are mapped to the system palette. Palette=0 if the bitmap has no palette.

Another (although rare) use of Palette is to assign custom palettes created with CreatePalette to this property. Palette contains up to 256 colors that can be used to display the bitmap on screen.


TBitmap.PixelFormat

TBitmap 	See also

Indicates the bit format of the bitmap image, specifying how the image is displayed and how the pixels of the bitmap image are stored in memory.

type TPixelFormat = (pfDevice, pf1bit, pf4bit, pf8bit, pf15bit, pf16bit, pf24bit, pf32bit, pfCustom);

property PixelFormat: TPixelFormat;

Description

Use PixelFormat to change a TBitmap's internal image to a particular memory format and color depth, or to find out what memory format and color depth a TBitmap is using.

For example, PixelFormat can be used to set the pixel format of the bitmap image to 8-bit for video drivers that cannot display the native format of a bitmap image.

Note: The PixelFormat of a JPEG image object applies to the bitmap if the JPEG image is copied to it.

Changing the pixel format is most commonly used with ScanLine, because your code must decode the pixel data accessed by ScanLine. Image-editing tools usually use one pixel for all internal image operations and copy the results to the screen (in whatever format) as the last step.


TBitmap.ScanLine

TBitmap	See also	Example

Provides indexed access to each line of pixels.

property ScanLine[Row: Integer]: Pointer;

Description

ScanLine is used only with DIBs (Device Independent Bitmaps) for image editing tools that do low-level pixel work.


TBitmap.TransparentColor

TBitmap	See also	Example

Determines which color of the bitmap is to be transparent when the bitmap is drawn.

property TransparentColor: TColor;

Description

Use TransparentColor to determine how to draw the bitmap transparently. When the TransparentMode property is set to tmAuto (default), TransparentColor returns the color of the first pixel in the bitmap image data. For "bottom-up" bitmaps, the first pixel is the bottom leftmost pixel shown onscreen. For "top-down" bitmaps (less common), the first pixel is in the top left corner shown onscreen.

If TransparentColor is assigned, the TransparentMode is automatically set to tmFixed so that the new transparent color can be used later. If you want TransparentColor to disregard any assignments and return the bottom leftmost pixel color again, set TransparentMode to tmAuto.


TBitmap.TransparentMode

TBitmap	See also	Example

Determines whether the TransparentColor property's value is automatically calculated or stored with the bitmap object.

property Transparent: TTransparentMode;

Description

When TransparentMode is set to tmAuto, the TransparentColor property returns the color of the bottom-leftmost pixel of the bitmap image.  When TransparentMode is set to tmFixed, the TransparentColor property refers to the color stored in the bitmap object.


TBitmap.Width

TBitmap	See also

Specifies the width in pixels of the bitmap.

property Width: Integer;

Description

Use Width to find or set the width of the bitmap. Enlargements are filled with white. Shrinkage crops the image.


TBitmap events

TBitmap	Alphabetically

Derived from TGraphic

OnChange

OnProgress


TBitmap events

TBitmap	By object

OnChange

OnProgress


TBitmap methods

TBitmap	Alphabetically

In TBitmap

Assign

Create

Destroy

Dormant

FreeImage

LoadFromClipboardFormat

LoadFromResourceID

LoadFromResourceName

LoadFromStream

Mask

ReleaseHandle

ReleaseMaskHandle

ReleasePalette

SaveToClipboardFormat

SaveToStream

Derived from TGraphic

LoadFromFile

SaveToFile

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TBitmap methods

TBitmap	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

Dormant

FieldAddress

Free

FreeImage

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

LoadFromClipboardFormat

LoadFromFile

LoadFromResourceID

LoadFromResourceName

LoadFromStream

Mask

MethodAddress

MethodName

NewInstance

ReleaseHandle

ReleaseMaskHandle

ReleasePalette

SafeCallException

SaveToClipboardFormat

SaveToFile

SaveToStream


TBitmap.Assign

TBitmap	See also	Example

Copies a new bitmap image to the bitmap object.

procedure Assign(Source: TPersistent); override;

Description

Assign copies the bitmap image contained in Source to the bitmap object. Assign then calls the inherited Assign.. If the bitmap needs to be changed, the actual bitmap image is copied before the changes are made (copy on write).

Note:	An object of one type can always be assigned to another object of the same type. Also, the Source can be of type TPicture if the Graphic property of the picture is a bitmap.


TBitmap.Create

TBitmap	See also 	Example

Instantiates a bitmap object.

constructor Create; override;

Description

Call Create to instantiate a bitmap object at runtime. Create is also called automatically when a bitmap image is loaded into a TImage.

Create allocates memory for a bitmap object, and calls the inherited Create. Then it creates a TBitmapImage as the internal image that represents the bitmap.


TBitmap.Destroy

TBitmap	See also

Disposes of the instance of the bitmap object.

destructor Destroy; override;

Description

Destroy is the destructor for a TBitmap object.

Do not call the destructor directly in an application. Instead, call Free. Free verifies that the bitmap object is not nil before it calls Destroy.

Destroy releases the internal bitmap image (TBitmapImage object) and frees the canvas before calling the inherited destructor.


TBitmap.Dormant

TBitmap	See also	Example

Creates a memory bitmap image in order to release the bitmap handle, forcing the image into DIB format to save resources.

procedure Dormant;

Description

Use Dormant to change the format of the bitmap in memory thereby reducing the amount of GDI resources used by the application.

Dormant creates a bitmap image in memory using a memory stream object. This preserves the image so that the bitmap can then free the HBITMAP (accessed through the Handle property) that was assigned to it.

DIB handles may use fewer Win95 GDI resources than DDB, but DIBs may also use more memory than DDBs, depending on the current video driver and mode.


TBitmap.FreeImage

TBitmap	Example

Frees the cached file image stored in memory by the bitmap.

procedure FreeImage;

Description

Use FreeImage to reduce the memory requirements of an application when color depth and pixel format are not an issue. Freeing the image releases the memory allocated for the bitmap image when it was originally loaded to disk. Consequently, some of the original pixel format of the bitmap is lost (for example, if you changed its format to a DIB) as well as the color depth of the bitmap.

When a bitmap is loaded into a bitmap object, Delphi creates an image of the loaded bitmap in memory. If the bitmap isn't changed, the memory image is used when saving the bitmap, to verify that the bitmap has not lost color depth or changed the pixel format.


TBitmap.LoadFromClipboardFormat

TBitmap	See also 	Example

Loads a bitmap from the Clipboard into the bitmap object.

procedure LoadFromClipboardFormat(AFormat: Word; AData: THandle; APalette: HPALETTE); override;

Description

LoadFromClipboardFormat is called if the bitmap is registered with the TPicture object using the RegisterClipboardFormat method.

LoadFromClipboardFormat replaces the current image with the data pointed to by the AData parameter. The palette for the bitmap is specified by the APalette parameter.


TBitmap.LoadFromResourceID

TBitmap	See also

Loads a bitmap from a resource into the bitmap object.

procedure LoadFromResourceID(Instance: THandle; ResID: Integer);

Description

Use LoadFromResourceID to load a specified bitmap resource along with palette information from a module's executable file. The resource ID for the bitmap is specified in the ResID parameter.


TBitmap.LoadFromResourceName

TBitmap	See also	Example

Loads a bitmap resource into the bitmap object.

procedure LoadFromResourceName(Instance: THandle; const ResName: string);

Description

LoadFromResourceName loads the specified bitmap resource along with palette information from a module's executable file. Specify the resource to be loaded as the value of ResName.

Note:	Use this routine to load bitmaps from RES files instead of the LoadBitmap API. LoadBitmap does not support 256-color images.


TBitmap.LoadFromStream

TBitmap	See also

Loads the bitmap from a stream into the bitmap object.

procedure LoadFromStream(Stream: TStream); override;

Description

Use LoadFromStream to load the bitmap image from a stream. The Stream parameter specifies the stream from which to read the bitmap image. For example, use LoadFromStream to load a bitmap image from a TBlobStream object that reads from a graphic field in a dataset.


TBitmap.Mask

TBitmap 	See also

Converts the current bitmap image into a monochrome mask, replacing TransparentColor with white and every other color with black.

procedure Mask(TransparentColor: TColor);

Description

Use Mask to produce a monochrome mask bitmap based on a given transparent color. Mask produces the same image that MaskHandle does, except that the resulting mask image replaces the image in the TBitmap object, so it only makes sense to call Mask once. Use MaskHandle when only a bitmap handle of the mask image is needed.


TBitmap.ReleaseHandle

TBitmap 	See also	Example

Returns the handle to the bitmap so that the TBitmap object no longer knows about the handle.

function ReleaseHandle: HBitmap;

Description

Use ReleaseHandle to disassociate the bitmap from the bitmap handle. Use it when you need to give a bitmap handle to a routine or object that will assume ownership (or destroy) the bitmap handle.


TBitmap.ReleaseMaskHandle

TBitmap 	See also

Returns the handle to the bitmap's mask so that the TBitmap object no longer knows about the mask handle.

function ReleaseMaskHandle: HBitmap;

Description

Use ReleaseMaskHandle to disassociate the bitmap object from the bitmap mask handle.


TBitmap.ReleasePalette

TBitmap

Returns the handle to the bitmap's palette and disassociates the palette from the TBitmap object.

function ReleasePalette: HPalette;

Description

Use ReleasePalette to disassociate the palette from the bitmap image.


TBitmap.SaveToClipboardFormat

TBitmap	See also	Example

Creates a local copy of the bitmap in Clipboard format.

procedure SaveToClipboardFormat(var AFormat: Word; var AData: THandle; var APalette: HPALETTE); override;

Description

Use SaveToClipboardFormat to copy the bitmap to a Clipboard format. The bitmap’s palette is returned in the APalette parameter, the format in the AFormat parameter, and a handle to the data in the AData parameter. Before the bitmap can be saved, an application must have registered the format with the TBitmap object using the RegisterClipboardFormat method.


TBitmap.SaveToStream

TBitmap 	See also

Saves the bitmap to a stream.

procedure SaveToStream(Stream: TStream); override;

Description

Use SaveToStream to write the bitmap image to the stream specified by the Stream parameter. For example, specify a TBlobStream object as the Stream parameter to save the bitmap image to a graphic field in a dataset.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TGraphic


TBits

Hierarchy	Properties	Methods	See also

TBits stores an “array” of Boolean values.

Unit

classes

Description

Use TBits to store and access an indefinite number of Boolean values. TBits can store as many of Boolean values as can fit in available memory, automatically expanding its storage space as needed. If the number of Boolean values is limited to 32, the same functionality can be achieved using the bitwise AND and OR operators against a 32-bit integer variable.


TBits properties

TBits	Alphabetically

In TBits

Bits

Size


TBits properties

TBits	By object

Bits

Size


TBits.Bits

TBits	See also

Provides indexed access to the array of Boolean values that the TBits object represents.

property Bits[Index: Integer]: Boolean

Description

Use Bits to read or set a particular Boolean value, as indexed by the Index parameter. If Index isn't in the range 0..Size - 1, an EBitsError exception is raised.


TBits.Size

TBits	See also

Represents the number of Boolean values the TBits object can hold.

property Size: Integer;

Description

Set Size to expand or shrink the number of values in the array. When expanding the size, new entries are set to False. When shrinking the size, values whose indexes are less than or equal to the new size are preserved; entries whose indexes are greater than the new size are lost.


TBits methods

TBits	Alphabetically

In TBits

Destroy

OpenBit

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TBits methods

TBits	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

OpenBit

SafeCallException


TBits.Destroy

TBits	See also

Destroys an instance of TBits.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TBits object is not nil and only then calls Destroy.

Destroy frees the memory used to store the array of Boolean values.


TBits.OpenBit

TBits	See also

Returns the index of the first False value.

function OpenBit: Integer;

Description

Use OpenBit to find the first bit in the array that has not been set to True.


Hierarchy

TObject


TBookmarkList

Hierarchy	Properties	Methods	See also

TBookmarkList is a collection of bookmarks that identify a set of records in a dataset.

Unit

dbgrids

Description

Use TBookmarkList to manage a set of bookmarks when working with the records in a dataset. Each bookmark identifies a particular record in the dataset, and can be identified by a string.


TBookmarkList properties

TBookmarkList	Alphabetically	Legend

In TBookmarkList

Count

CurrentRowSelected

Items


TBookmarkList properties

TBookmarkList	By object	Legend

Count

CurrentRowSelected

Items


TBookmarkList.Count

TBookmarkList	See also	Example

Indicates the number of bookmarks in the bookmark list.

property Count: Integer;

Description

Read Count to determine the number of entries in the Items array.  Use Count as an upper limit when iterating over the strings in the Items array.


TBookmarkList.CurrentRowSelected

TBookmarkList	See also

Indicates whether the Bookmark property of the associated DBGrid’s dataset is in the Items array.

property CurrentRowSelected: Boolean;

Description

Read CurrentRowSelected to determine whether the Bookmark property of the associated DBGrid’s dataset specifies a bookmark string in the Items property array. CurrentRowSelected is True when the bookmark string is included, False when it is not. The Bookmark property of the dataset indicates the current record in the dataset.

Set CurrentRowSelected to specify whether the Bookmark string of the associated DBGrid’s dataset should be included in the bookmark list.  Setting CurrentRowSelected to True adds the Bookmark property of the dataset to the Items array if it is not already there.  Setting CurrentRowSelected to False removes the Bookmark of the dataset from the Items array if it is there.  If the Bookmark property of the dataset is an empty string (no bookmark), setting CurrentRowSelected does nothing.

Note:	Trying to read or write CurrentRowSelected when the dataset is not active will raise an EInvalidGridOperation exception.


TBookmarkList.Items

TBookmarkList	See also	Example

Provides indexed access to the bookmarks for marked records in the dataset.

type TBookmarkStr: string;

property Items[Index: Integer]: TBookmarkStr; default;

Description

Use Items to obtain a bookmark string from the set maintained by the TBookmarkList object.  Each bookmark string represents a single record in the dataset of the associated DBGrid. Bookmark strings can be compared with other bookmark strings to determine relative position within the database, and used to position the dataset on an arbitrary record. The Index parameter indicates the index of the bookmark, where 0 is the index of the first bookmark, 1 is the index of the second bookmark, and so on.

Use Items with the Count property to iterate through all of the bookmarks in the list.

Note:	Bookmarks in the bookmark list are not automatically deleted when records in the dataset are deleted.  As a result, some bookmarks in the Items array may become invalid. Call the Refresh method to delete invalid bookmarks from the Items array.


TBookmarkList methods

TBookmarkList	Alphabetically

In TBookmarkList

Clear

Create

Delete

Destroy

Find

IndexOf

Refresh

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TBookmarkList methods

TBookmarkList	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

FieldAddress

Find

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

IndexOf

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Refresh

SafeCallException


TBookmarkList.Clear

TBookmarkList	See also

Deletes all bookmarks from the list.

procedure Clear;

Description

Call Clear to empty the Items array and set the Count property to 0 when all rows of the associated DBGrid are deselected. Calling Clear invalidates the associated DBgrid so that the selected rows that were referenced by the bookmarks in the bookmark list can be repainted.

Note:	Clear removes the bookmarks from the bookmark list to reflect the fact that the corresponding rows are not selected. To delete the rows from the dataset rather than just deselecting them, call the Delete method instead.


TBookmarkList.Create

TBookmarkList	See also

Creates an instance of TBookmarkList and associates it with a DBGrid.

constructor Create(AGrid: TCustomDBGrid);

Description

Applications do not need to call create to instantiate the bookmark list used by DBGrids to implement their SelectedRows property.  DBGrids call Create from their constructor to create this bookmark list.  Component writers that implement additional properties for descendants of TCustomDBGrid can create additional bookmark list objects to represent other sets of records in the dataset.


TBookmarkList.Delete

TBookmarkList	See also

Deletes all the records specified by the bookmarks in the list from the dataset of the associated DBGrid.

procedure Delete;

Description

Call Delete to delete the set of records represented by the bookmark list from the dataset of the associated DBGrid.  To remove all the bookmarks from the list without changing the dataset, use the Clear method instead.


TBookmarkList.Destroy

TBookmarkList	See also

Destroys an instance of TBookmarkList.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TBookmarkList object is not nil, and only then calls Destroy.

Destroy frees the memory used to store the Items property array.


TBookmarkList.Find

TBookmarkList	See also

Indicates whether a specified bookmark string is contained in the bookmark list.

type TBookmarkStr: string;

function Find(const Item: TBookmarkStr; var Index: Integer): Boolean;

Description

Call Find to determine whether the string specified by the Item parameter is one of the bookmark strings in the Items property array.  Find returns True if the bookmark list contains the bookmark string, False otherwise.  If Find returns True, the index of the bookmark string is returned as the value of the Index parameter.

Note:	The index of a specific bookmark string can also be obtained by using the IndexOf method.  Unlike the IndexOf method, which returns a value of -1 if the bookmark string is not in the Items array, Find does not change the value of the Index parameter if the bookmark string can’t be found.  Use Find when a default value should be changed only if the bookmark is not in the list.


TBookmarkList.IndexOf

TBookmarkList	See also

Returns the index of a bookmark string in the Items property array.

type TBookmarkStr: string;

function IndexOf(const Item: TBookmarkStr): Integer;

Description

Call IndexOf to get the index for a bookmark string in the Items array. The first item in the array has index 0, the second item has index 1, and so on. If an item is not in the list, IndexOf returns -1.


TBookmarkList.Refresh

TBookmarkList	See also

Removes all invalid bookmarks from the Items property array.

function Refresh: Boolean;

Description

Bookmarks in the bookmark list are not automatically deleted when records in the dataset are deleted.  As a result, some bookmarks in the Items array may become invalid. Call Refresh to ensure that every bookmark in the bookmark list is valid.  Refresh attempts to locate every record in the dataset that corresponds to a bookmark in the Items property array. All bookmarks that do not correspond to records in the dataset are removed.

If any of the bookmarks in the list are invalid, Refresh returns True, and invalidates the DBGrid so that it will repaint, reflecting the removal of all invalid records.  If all bookmarks in the list are still valid,  Refresh returns False.


Accessibility

Read-only


Hierarchy

TObject


TBlobField

Hierarchy	Properties	Methods	Events	See also

TBlobField represents a field in a dataset that holds a reference to a binary large object (BLOB).

Unit

db

Description

TBlobField is a persistent field object that encapsulates the fundamental behavior common to untyped binary fields. In addition to the properties, methods, and events common to all fields that are introduced by the TField class, TBlobField implements the methods and properties that are used to read and write binary data from or to the underlying database table.

As with all persistent field objects, a TBlobField can be created at design-time using the Fields Editor or at runtime by calling the constructor for the class. Persistent field objects exist solely in the memory space of an application. Creating a persistent field object only creates an object in the application, and does not result in the creation of a field in a table.

Fields in a table can be accessed without use of persistent field objects. Virtual field objects are created to provide access to a field when the field is referenced through such means as the TDataSet.Fields property or the TDataSet.FieldByName method. However, as both the Fields property and the FieldByName method return a value of type TField, the return value must be typecast as a TBlobField before using any property or method specific to TBlobField.

BLOB fields are database fields that contain raw binary data of arbitrary length. BLOB fields can represent different arbitrarily large data types. These data types are distinguished in the header of the binary data.

In addition to the field types supported directly, TBlobField is the direct ancestor of two BLOB field components: TMemoField (ftMemo) and TGraphicField (ftGraphic).

TBlobField introduces new methods to support streaming data to and from the BLOB field. Methods are also implemented to copy raw binary data between the BLOB field and a binary file.


TBlobField properties

TBlobField	Alphabetically	Legend

In TBlobField

AsString

AsVariant

BlobSize

BlobType

IsNull

Modified

Transliterate

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TBlobField properties

TBlobField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

BlobSize

BlobType

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Modified

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

Transliterate

ValidChars

Value

VCLComObject

Visible


TBlobField.AsString

TBlobField	See also

Represents the value of the BLOB field as a string value.

property AsString: String;

Description

Use AsString to assign the BLOB field value to a string or to assign a string value to the BLOB field.

For example, this code assigns a string value to a BLOB field value:

MyBLOBField.AsString := 'Assign the string to a BLOB field';

To assign a BLOB field value to a string value, use code similar to this:

BlobString := MyBLOBField.AsString;

Typically, using AsString makes sense only if the BLOB contains text, such as that in a memo field component. The string data type can, however, store binary data as well. Thus, even BLOB fields for nontextual BLOB types such as ftGraphic or ftTypedBinary can use the AsString property.

Use the AsString property rather than the Text property to set the BLOB field’s value to textual data. Trying to set the Text property will raise an exception.


TBlobField.AsVariant

TBlobField	See also

Represents the value of the BLOB field as a variant value.

property AsVariant: Variant;

Description

Use AsVariant to

•	Assign the BLOB field value to a variant variable.

•	Assign a variant value to the BLOB field.

Using variants is useful when you do not know the actual field type and do not want to use one of the other As* properties to convert the field value to another type.


TBlobField.BlobSize

TBlobField	See also

Indicates the number of bytes of data contained in the blob field on the current record.

property BlobSize: Integer;

Description

Read BlobSize to determine the amount of memory required to store the contents of the BLOB field. Use BlobSize instead of the DataSize property, which always returns 0 for BLOB fields.

Note:	Unlike the DataSize property, which specifies the size for field data on any record, BlobSize gives the size of the BLOB data for the current record only.

In the example below, a handler for the AfterScroll event of a TQuery, the value of the BlobSize property is displayed in the Caption of a form.

procedure TForm1.Table1AfterScroll(DataSet: TDataSet);

begin

  Caption := 'BLOB size: ' +

    IntToStr(TBlobField(Table1.FieldByName('BITMAP')).BlobSize);

end;


TBlobField.BlobType

TBlobField	See also

Identifies the type of the BLOB field associated with a BLOB field object.

property BlobType: TBlobType;

Description

Use BlobType to set or read the data type for the BLOB data associated with the field component.

Specify BlobType when using a TBlobField object to represent a BLOB field type that isn’t directly supported (such as a formatted memo BLOB). The BlobType ensures that the BLOB type in the table matches the expected field type.


TBlobField.IsNull

TBlobField	See also

Indicates whether the BLOB field contains any data.

property IsNull: Boolean;

Description

Read IsNull to determine whether the BLOB field is blank. IsNull is True if the BLOB field is empty. IsNull is False if the BLOB field contains any data.

if Query1Images.IsNull then

  ShowMessage('You forgot the BLOB data!');


TBlobField.Modified

TBlobField	See also

Indicates whether a the value for the BLOB field was changed since it was last read from disk.

property Modified: Boolean;

Description

Set Modified to True when changing the value to a BLOB field using direct Borland Database Engine (BDE) API calls. If the value of the BLOB field is set by using the properties of TBlobField, a TBlobStream object or a data-aware control, Modified is automatically set to True.

BLOB fields use the Modified property to trigger data events and to indicate when the BDE needs to clean up the buffers used to store BLOB data.


TBlobField.Transliterate

TBlobField	See also

Determines whether any text in the BLOB field should be converted between the ANSI character set and the character set identified by the dataset.

property Transliterate: Boolean;

Description

Use Transliterate when the physical database table identified by the dataset does not use an ANSI language driver and the data may contain extended ASCII characters.

When Transliterate is True, BLOB fields call the AnsiToNative function to translate the ANSI characters to the character set used by the dataset when the value is changed using the Value property, the AsString property, or the AsVariant property. When these properties are read to obtain the value of the BLOB field, the NativeToAnsi function translates the characters in the database table to the ANSI character set.

Note:	TBlobStream objects also check the Transliterate property when reading from or writing to a BLOB field.


TBlobField.Value

TBlobField	See also

Represents the data in the BLOB field.

property Value: String;

Description

Use Value to read data directly from and write data directly to a BLOB field component at runtime. For BLOB fields, the Value property is equivalent to the AsString property.

Note:	The string data type can store binary data as well as text. Thus, even BLOB fields for nontextual BLOB types such as ftGraphic or ftTypedBinary can get or set their data using a string.


TBlobField events

TBlobField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TBlobField events

TBlobField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TBlobField methods

TBlobField	Alphabetically

In TBlobField

Assign

Clear

Create

IsBlob

LoadFromFile

LoadFromStream

SaveToFile

SaveToStream

SetFieldType

Derived from TField

AssignValue

Destroy

FocusControl

GetData

IsValidChar

RefreshLookupList

SetData

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBlobField methods

TBlobField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SaveToFile

SaveToStream

SetData

SetFieldType

UpdateAction

Validate


TBlobField.Assign

TBlobField	See also

Copies a value to the BLOB field.

procedure Assign(Source: TPersistent);

Description

Use Assign to copy data to the BLOB field. Assign copies the Value of a BLOB field from

•	Another BLOB field

•	A TStrings object

•	A TBitmap object, if the BlobType is ftGraphic or ftTypedBinary

•	A TPicture object, if the BlobType is ftGraphic or ftTypedBinary

•	Any object that supports TBlobField in its AssignTo method

In the example below, the Assign method is used to copy the bitmap from a TImage component into a BLOB field through its TBlobField field object.

if not (Query1.State in [dsInsert, dsEdit]) then Query1.Insert;

Query1Images.Assign(Image1.Picture.Bitmap);

Query1.Post;


TBlobField.Clear

TBlobField	See also

Clears the current value in the BLOB field.

procedure Clear;

Description

Use Clear to delete the current value in the field and leave the field without a value.

Query1Images.Clear;


TBlobField.Create

TBlobField	See also

Creates an instance of a BLOB field component.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TBlobField. After calling the inherited constructor, Create sets the DataType property to ftBlob. After calling the inherited constructor, Create sets the DataType property to ftBlob.

After instantiating a TBlobField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TBlobField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TBlobField with a dataset component by setting its DataSet property to the name of the dataset component.

The example below creates a TBlobField object for a field named Images accessed through a TQuery named Query1.

var

  T: TBlobField;

begin

  Query1.Close;

  T := TBlobField.Create(Self);

  T.FieldName := 'Images';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


TBlobField.IsBlob

TBlobField	See also	Example

Indicates that this is a BLOB field.

class function IsBlob: Boolean; override;

Description

Use IsBlob when working with a TField object to determine whether it represents BLOB data. For example, before using the GetData or SetData method (which does not work with BLOB fields), call IsBlob to determine whether the method can be used. The IsBlob method for TBlobField always returns True.


TBlobField.LoadFromFile

TBlobField	See also

Loads a BLOB from a file into the field.

procedure LoadFromFile(const FileName: string);

Description

Use LoadFromFile to load the contents of a file into a BLOB field. Specify the name of the file to load into the field as the value of the FileName parameter.

if not (Query.State in [dsInsert, dsEdit]) then Query1.Insert;

Query1Images.LoadFromFile('c:\Windows\Waves.bmp');

Query1.Post;


TBlobField.LoadFromStream

TBlobField	See also

Loads a BLOB from a stream into the field.

procedure LoadFromStream(Stream: TStream);

Description

Use LoadFromStream to copy the contents of a stream into the BLOB field. Specify the stream from which the field’s value is copied as the value of the LoadFromStream parameter.

var

  FS: TFileStream;

begin

  if not (Query1.State in [dsInsert, dsEdit]) then Query1.Insert;

  FS := TFileStream.Create('c:\Windows\Winlogo.bmp', fmOpenRead);

  try

    Query1Images.LoadFromStream(FS);

  finally

    FS.Free;

  end;

  Query1.Post;

end;


TBlobField.SaveToFile

TBlobField	See also

Saves the contents of the BLOB field to a file.

procedure SaveToFile(const FileName: string);

Description

Use SaveToFile to save the contents of the BLOB field to a file. Specify the name of the file as the value of the FileName parameter.

Query1Files.SaveToFile('c:\Data\' + Query1FileName.AsString);


TBlobField.SaveToStream

TBlobField	See also

Saves the contents of the BLOB field to a stream.

procedure SaveToStream(Stream: TStream);

Description

Use SaveToStream to copy the contents of a BLOB field to a stream. Specify the name of the stream to which the field’s value is saved as the value of the Stream parameter.

var

  MS: TMemoryStream;

begin

  MS := TMemoryStream.Create;

  try

    Query1Images.SaveToStream(MS);

    Image1.Picture.Bitmap.LoadFromStream(MS);

  finally

    MS.Free;

  end;

end;


TBlobField.SetFieldType

TBlobField	See also

Specifies the type of the BLOB field.

procedure SetFieldType(Value: TFieldType); override;

Description

Use SetFieldType to change the field type of a BLOB field, overriding the default type.

Normally, the type of the physical database field is checked and a TFieldType is selected that matches most closely. BLOB fields can indicate more explicitly what kind of BLOB is in the database. Specify the BLOB type as the value of the Value parameter.

The following table contains the possible values for BLOB fields. Calling SetFieldType with any other data type does nothing.

Value	Description

ftBlob	Binary Large Object field

ftMemo	Text memo field

ftGraphic	Bitmap field

ftFmtMemo	Formatted text memo field

ftParadoxOle	Paradox OLE field

ftDBaseOle	dBase OLE field

ftTypedBinary	Typed binary field

Note:	Calling SetFieldType does the same thing as setting the BlobType property.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField


TBlobStream

Hierarchy	Properties	Methods	See also

TBlobStream is a stream object that provides services which allow applications to read from or write to field objects that represent Binary large object (BLOB) fields.

Unit

dbtables

Description

Use TBlobStream to access or modify the value of a BLOB field in a BDE-enabled dataset. TBlob stream works with persistent TBlobField objects (including descendants of TBlobField such as TGraphicField and TMemoField). BLOB fields use BLOB streams to read data from and write data to the dataset.

TBlobStream allows objects that have no specialized knowledge of how data is stored in a BLOB field to read or write such data by employing the uniform stream mechanism.

To use a BLOB stream, create an instance of TBlobStream, use the methods of the stream to read or write the data, and then free the BLOB stream. Do not use the same instance of TBlobStream to access data from more than one record. Instead, create a new TBlobStream object every time you need to read or write BLOB data on a new record.


TBlobStream properties

TBlobStream	Alphabetically	Legend

Derived from TStream

Position

Size


TBlobStream properties

TBlobStream	By object	Legend

Position

Size


TBlobStream methods

TBlobStream	Alphabetically

In TBlobStream

Create

Destroy

Read

Seek

Truncate

Write

Derived from TStream

CopyFrom

FixupResourceHeader

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TBlobStream methods

TBlobStream	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

CopyFrom

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

FixupResourceHeader

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Read

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

SafeCallException

Seek

Truncate

Write

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader


TBlobStream.Create

TBlobStream	See also 	Example

Creates an instance of TBlobStream.

constructor Create(Field: TBlobField; Mode: TBlobStreamMode);

Description

Call Create to obtain an instance of TBlobStream for reading from or writing to a specific TBlobField object.

Tip:	Different types of dataset use different classes of BLOB streams. It is usually a better idea to call the dataset’s CreateBlobStream method than to call the BLOB stream constructor.

Create links the TBlobStream to the field object specified by the Field parameter. Mode specifies whether the BLOB stream will be used to read data (bmRead), write data (bmWrite) or modify data (bmReadWrite). Mode must be one of the following values:

Value	Meaning

bmRead	The BLOB stream can read data from the field.

bmWrite	The BLOB stream can replace the data in the field.

bmReadWrite	The BLOB stream can modify the data in the field.

Note: A TBlobStream object should always be destroyed before navigating to a new record. Create a new instance of TBlobStream for the new record.


TBlobStream.Destroy

TBlobStream	See also

Destroys an instance of TBlobStream.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead call Free. Free verifies that the TBlobStream object is not nil and only then calls Destroy. Destroy the TBlobStream object when it is no longer needed for reading from or writing to the BLOB field.

Destroy triggers an OnDataChange event if the BLOB stream was used to overwrite or modify the data in the field. Destroy then frees any buffers that were allocated to handle the data.

Note: A TBlobStream object should always be destroyed before navigating to a new record. Create a new instance of TBlobStream for the new record.


TBlobStream.Read

TBlobStream	See also	Example

Reads up to Count bytes from the current position in the field’s data into Buffer.

function Read(var Buffer; Count: Longint): Longint;

Description

Call Read to read data from the BLOB field when the number of bytes in the field’s data is not known.

Buffer is the target container for Read and must be of type PChar (or equivalent). Buffer must have at least Count bytes allocated to hold the data that was read from the field. Read transfers up to Count bytes from the BLOB data into Buffer, starting in the current position, and then advances the current position by the number of bytes actually transferred. Read returns the number of bytes actually transferred (which may be less than the number requested in Count).

Read checks the Transliterate property of the field, and converts the data into ANSI from the character set specified by the dataset if Transliterate is True.

All the other data-reading methods of a BLOB stream (ReadBuffer, ReadComponent) call Read to do their actual reading.

Note:	Do not call Read when the TBlobStream was created in bmWrite mode.


TBlobStream.Seek

TBlobStream	See also 	Example

Resets the current position of the TBlobStream object.

function Seek(Offset: Longint; Origin: Word): Longint;

Description

Use Seek to move the current position within the BLOB data by the indicated offset. Seek allows an application to read from or write to a particular location within the BLOB data.

The Origin parameter indicates how to interpret the Offset parameter. Origin should be one of the following values:

Value	Meaning

soFromBeginning	Offset is from the beginning of the BLOB data. Seek moves to the position Offset. Offset must be >= 0.

soFromCurrent	Offset is from the current position in the BLOB data. Seek moves to Position + Offset.

soFromEnd	Offset is from the end of the BLOB data. Offset must be <= 0 to indicate a number of bytes before the end of the BLOB.

Seek returns the new value of the Position property, the new current position in the BLOB data.


TBlobStream.Truncate

TBlobStream	See also 	Example

Discards all data in the BLOB field from the current position on.

procedure Truncate;

Description

Use Truncate to limit the size of the BLOB data. Calling Truncate when the current position is 0 will clear the contents of the BLOB field.

Note:	Do not call Truncate when the TBlobStream was created in bmRead mode.


TBlobStream.Write

TBlobStream	See also 	Example

Writes Count bytes from Buffer to the current position in the field and updates the current position by Count bytes.

function Write(const Buffer; Count: Longint): Longint; override;

Description

Use Write to write Count bytes to the BLOB field, starting at the current position. The Write method for TBlobStream always writes the entire Count bytes, as BLOB data does not necessarily include a termination character. Thus, Write is equivalent to the WriteBuffer method.

Buffer is the source container for Write and must be of type PChar (or equivalent). Write transfers up to Count bytes from Buffer into the BLOB field, starting in the current position, and then advances the current position by the number of bytes actually transferred. Write returns the number of bytes actually transferred (which may be less than the number requested in Count).

Write checks the Transliterate property of the field, and converts the data from ANSI into the character set of the dataset if Transliterate is True.

All the other data-writing methods of a BLOB stream (WriteBuffer, WriteComponent) call Write to do their actual writing.

Note:	Do not call Write when the TBlobStream was created in bmRead mode.


Accessibility

Read-only


Hierarchy

TObject

TStream


TBitmapImage

Hierarchy	Methods	See also

TBitmapImage is the internal representation of the bitmap image for a TBitmap object.

Unit

graphics

Description

TBitmapImage is used only for internal implementation in Delphi.  It represents the internal image of the  bitmap encapsulated by the TBitmap object.  All of the data and methods introduced in TBitmapImage are private.  They contain information about the specific HBITMAP, including pointers to the standard HBITMAP structures defined by Windows. TBitmapImage is referenced in the constructor of the TBitmap object when the bitmap image is created.

Note	TBitmapImage is how TBitmap does reference counting and handle sharing. Multiple instances can refer to the same TBitmap image. TBitmapImage is the actual owner of the bitmap handle.


TBitmapImage methods

TBitmapImage	Alphabetically

In TBitmapImage

Destroy

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TBitmapImage methods

TBitmapImage	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TBitmapImage.Destroy

TBitmapImage	See also

Frees the memory associated with the TBitmapImage object.

destructor Destroy; override;

Description

Do not call Destroy. The bitmap object automatically destroys the bitmap image.


Hierarchy

TObject

TSharedImage


TBooleanField

Hierarchy	Properties	Methods	Events	See also

TBooleanField represents a field containing Boolean values.

Unit

db

Description

TBooleanField is a persistent field object that encapsulates the fundamental behavior common to Boolean data. In addition to the properties, methods, and events common to all fields that are introduced by the TField class, TBooleanField reimplements the properties that are used to read Boolean data from and write Boolean data to the underlying database table.

As with all persistent field objects, a TBooleanField can be created at design-time using the Fields Editor or at runtime by calling the constructor for the class. Persistent field objects exist solely in the memory space of a Delphi application. Creating a persistent field object only creates an object in the application, and does not result in the creation of a field in a table.

Fields in a table can be accessed without use of persistent field objects. Virtual field objects are created to provide access to a field when the field is referenced through such means as the TDataSet.Fields property or the TDataSet.FieldByName method. However, as both the Fields property and the FieldByName method return a value of type TField, the return value must be typecast as a TBooleanField before using any property or method specific to TBooleanField.

TBooleanField introduces new properties to convert between boolean values and other data types, and to provide display strings that represent various interpretations of the data. As a descendant of TField, TBooleanField includes many properties, methods, and events that are useful for managing the value and properties of a field in a database.

Boolean fields can hold values of True or False.


TBooleanField properties

TBooleanField	Alphabetically	Legend

In TBooleanField

AsBoolean

AsString

AsVariant

DataSize

DisplayValues

Value

Derived from TField

Alignment

AsCurrency

AsDateTime

AsFloat

AsInteger

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TBooleanField properties

TBooleanField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayValues

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

ValidChars

Value

VCLComObject

Visible


TBooleanField.AsBoolean

TBooleanField	See also

Represents the value of a Boolean field as a Boolean value.

property AsBoolean: Boolean;

Description

Use AsBoolean to set or get the value of a Boolean field using the Boolean type. Physical Boolean database fields store boolean values as WordBool values. AsBoolean converts between the WordBool value and the Boolean type.

var

  CanBillCustomer: Boolean;

begin

  CanBillCustomer := Table1Billable.AsBoolean;

  …

end;


TBooleanField.AsString

TBooleanField	See also

Represents the value of a Boolean field as a string value.

property AsString: String;

Description

Use AsString to

•	Assign the Boolean field value to string variable.

•	Assign a string value to the Boolean field.

For example, this code assigns a string value to an Boolean field value:

MyBoolField.AsString := 'TRUE';

To assign a Boolean field value to a string variable, use code similar to this:

StringVar := MyBoolField.AsString;

If the DisplayValues property has not been set, when a Boolean value is inserted or updated using the AsString property, the value is set to True if the string is ‘True’, and False if the string is ‘False’. Any other string raises an EDatabaseError exception.

The DisplayValues property specifies the strings associated with the values of True or False. Change the DisplayValues property to change the strings that must be assigned to set the value of the Boolean field to True or False.

Reading the AsString property returns the string that corresponds to the value of the field. If DisplayValues has not been set, this is ‘True’ or ‘False’.


TBooleanField.AsVariant

TBooleanField	See also

Represents the value of a Boolean field as a variant value.

property AsVariant: Variant;

Description

Use AsVariant to

•	Assign the Boolean field value to variant variable.

•	Assign a variant value to the Boolean field.

Using variants is useful when both the actual field type and the type of the data is unknown.

var

  CanBillCustomer: Variant;

begin

  CanBillCustomer := Table1Billable.AsVariant;

  …

end;


TBooleanField.DataSize

TBooleanField	See also	Example

Indicates the amount of memory needed to store the value of a Boolean field in its native database format.

property DataSize: Word;

Description

Check DataSize to determine the number of bytes required to store a Boolean field component’s value. Use DataSize to determine the size needed for a buffer when working with the GetData and SetData methods. GetData and SetData work with the field’s value in native database format.

For Boolean fields, DataSize is always 2, because database tables use the WordBool type to store boolean values. This type is not the same as the Boolean type used by TBooleanField to store and manipulate boolean values.


TBooleanField.DisplayValues

TBooleanField	See also

Controls how the Boolean field is translated to and from display format.

property DisplayValues: string;

Description

Use DisplayValues to specify strings you want used to represent Boolean values. Use any pair of phrases, separated by a semicolon. For example, to have the True and False values correspond to the letters T and F, respectively, set DisplayValues to

Table1LogicalField.DisplayValues := 'T;F';

Similarly, to set the values of True and False to the strings Yes and No, set DisplayValues to

Table1LogicalField.DisplayValues := 'Yes;No';

The string associated with True or False can be an empty string. To set the value for True to an empty string, set DisplayValues to a string that begins with a semicolon. For example, to associate False with the string Fail, and True with an empty string, set DisplayValues to

Table1LogicalField.DisplayValues := ';Fail';

To associate False with an empty string, set DisplayValues to the string for True, with no semicolon at all.

The strings associated with True and False by DisplayValues appear in data-aware controls when they display the data for a Boolean field. If one of the strings is an empty string, Boolean values associated with that string appear blank in data-aware controls.

These strings are also used when getting or setting the Boolean field’s AsString property.


TBooleanField.Value

TBooleanField	See also

Represents the value of the data in the Boolean field.

property Value: Boolean;

Description

Use Value to read data from and write data to a Boolean field object at runtime. Using Value is the same as using the AsBoolean property. Use Value when you know the field component is a Boolean field. Use AsBoolean when working with a generic field component.


TBooleanField events

TBooleanField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TBooleanField events

TBooleanField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TBooleanField methods

TBooleanField	Alphabetically

In TBooleanField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBooleanField methods

TBooleanField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TBooleanField.Create

TBooleanField	See also

Instantiates a Boolean persistent field object.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TBooleanField. After calling the inherited constructor, Create sets the DataType property to ftBoolean and initializes the strings associated with Boolean values to ‘True’ and ‘False’.

After instantiating a TBooleanField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TBooleanField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TBooleanField with a dataset component by setting its DataSet property to the name of the dataset component.

The example below creates a TBooleanField object for a field named PaidInFull accessed through a TQuery named Query1.

var

  T: TBooleanField;

begin

  Query1.Close;

  T := TBooleanField.Create(Self);

  T.FieldName := 'PaidInFull';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField


TBrush

Hierarchy	Properties	Methods	Events

TBrush represents the color and pattern used to fill solid shapes.

Unit

graphics

Description

TBrush encapsulates the Winodws brush object (HBRUSH) and is used to fill solid shapes, such as rectangles and ellipses, with a color or pattern.


TBrush properties

TBrush	Alphabetically	Legend

In TBrush

Bitmap

Color

Handle

Style

Derived from TGraphicsObject

OwnerCriticalSection


TBrush properties

TBrush	By object	Legend

Bitmap

Color

Handle

OwnerCriticalSection

Style


TBrush.Bitmap

TBrush	See also 	Example

Specifies an external bitmap image that defines a pattern for the brush.

property Bitmap: TBitmap;

Description

Bitmap points to a TBitmap object that holds a BMP image. If Bitmap is nonempty, the BMP image (rather than the Style property) defines the brush’s pattern. If the image is larger than eight pixels by eight pixels, only the top left eight-by-eight region is used.

Changing the image does not affect the brush until the TBitmap is reassigned to the Bitmap property. Be sure to free the TBitmap after finishing with the brush, since TBrush will not free it.


TBrush.Color

TBrush	See also 	Example

Indicates the color of the brush.

property Color: TColor;

Description

The Color property determines the color of the brush.  This is the color that is used to draw the pattern represented by the Style property, not the background color of the brush (unless Style is bsSolid).

Note:	If the value of the Style property is bsClear, the Color property is ignored. Further, any value assigned to the Color property is lost when Style is set to bsClear.


TBrush.Handle

TBrush

Indicates the Windows handle for the brush.

property Handle: HBrush;

Description

The Handle property provides access to the Windows GDI object handle.


TBrush.Style

TBrush	See also 	Example

Specifies the pattern for the brush.

type TBrushStyle = (bsSolid, bsClear, bsHorizontal, bsVertical, bsFDiagonal, bsBDiagonal, bsCross, bsDiagCross);

property Style:TBrushStyle;

Description

The Style property determines the pattern painted by the brush, unless a value is assigned to Bitmap. The possible values of Style are

Value	Pattern	Value	Pattern

bsSolid	bsCross

bsClear	bsDiagCross

bsBDiagonal	bsHorizontal

bsFDiagonal	bsVertical


TBrush events

TBrush	Alphabetically

Derived from TGraphicsObject

OnChange


TBrush events

TBrush	By object

OnChange


TBrush methods

TBrush	Alphabetically

In TBrush

Assign

Create

Destroy

Derived from TPersistent

GetNamePath

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TBrush methods

TBrush	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TBrush.Assign

TBrush	See also

Copies the contents of the brush to another brush.

procedure Assign(Source: TPersistent); override;

Description

Assign copies the brush’s properties from another TBrush instance.


TBrush.Create

TBrush

Creates and initializes a TBrush instance.

constructor Create;

Description

Create generates a new TBrush instance.


TBrush.Destroy

TBrush	See also

Destroys the TBrush instance and frees its memory.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Call Free instead. Free verifies that the TBrush instance is not nil before calling Destroy.


Scope

Published


Hierarchy

TObject

TPersistent

TGraphicsObject


TButtonControl

Hierarchy	Properties	Methods	See also

TButtonControl is the base class for objects that represent Windows button controls.

Unit

stdctrls

Description

Use TButtonControl as a base class when defining a standard Windows-style button.  Do not create instances of TButtonControl directly in an application. Instead, use a descendant of TButtonControl to put a push button, check box, or radio button on a form.

Note:	Some buttons, such as TSpeedButton, do not use the built-in Windows button controls. These controls do not descend from TButtonControl.


TButtonControl properties

TButtonControl	Alphabetically	Legend

In TButtonControl

Checked

ClicksDisabled

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TButtonControl properties

TButtonControl	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

Checked

ClicksDisabled

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentWindow

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TButtonControl.Checked

TButtonControl	See also	Example

Specifies whether the button control is checked.

property Checked: Boolean;

Description

Use Checked to determine whether a button control is checked.


TButtonControl.ClicksDisabled

TButtonControl	See also

Specifies whether the button control accepts mouse clicks.

property ClicksDisabled: Boolean;

Description

Use ClicksDisabled to determine whether a button control accepts mouse clicks. If ClicksDisabled is True, the button control doesn’t accept mouse clicks. Otherwise, the button control accepts mouse clicks.


TButtonControl methods

TButtonControl	Alphabetically	Legend

In TButtonControl

ActionChange

Create

GetActionLinkClass

GetChecked

SetChecked

WndProc

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TButtonControl methods

TButtonControl	By object	Legend

ActionChange

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetActionLinkClass

GetChecked

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetChecked

SetFocus

SetTextBuf

Show

Update

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

WndProc


TButtonControl.ActionChange

TButtonControl	See also

Updates the button control to reflect changes in its associated action.

procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;

Description

ActionChange is called automatically when the associated action changes. It updates the button control to reflect the action’s current Checked state. Then it calls the inherited method, which checks the associated properties for that client type.

The Sender parameter is the associated action. The CheckDefaults parameter specifies whether properties and event handlers should be changed if they differ from the default values. When CheckDefaults is True, properties and event handlers are only changed when the current values are the default values (that is, when the values have not been previously changed). When CheckDefaults is False, properties and event handlers are changed, regardless of their current values.


TButtonControl.Create

TButtonControl

Creates a button control.

constructor Create(AOwner: TComponent); override;

Description

Create calls the inherited constructor and then sets ImeMode to imDisable.


TButtonControl.GetActionLinkClass

TButtonControl	See also

Returns the appropriate action link class that is associated with button controls.

function GetActionLinkClass: TControlActionLinkClass; override;

Description

GetActionLinkClass is used to get the appropriate class type for the action link used with button controls. GetActionLinkClass is used internally to create action link objects for clients when a button control has an associated action. The action link is used to link the action to the button control client. Each Action link class type is designed to link specific actions to clients based upon the types of properties the client supports. For button controls, GetActionLinkClass returns the TButtonActionLink class type.


TButtonControl.GetChecked

TButtonControl	See also

Returns whether the button control is checked.

function GetChecked: Boolean; virtual;

Description

GetChecked is the read implementation of the Checked property.


TButtonControl.SetChecked

TButtonControl	See also

Sets the Checked property.

procedure SetChecked(Value: Boolean); virtual;

Description

SetChecked is the write implementer for the Checked property.


TButtonControl.WndProc

TButtonControl	See also

Handles Windows messages.

procedure WndProc(var Message: TMessage); override;

Description

WndProc enables button objects to receive input focus when WM_LBUTTONDOWN and WM_LBUTTONDBLCLK messages occur.


Scope

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TButtonActionLink

Hierarchy	Properties	Methods	Events

TButtonActionLink is an action link designed specifically for button control clients.

Unit

Stdctrls

Description

TButtonActionLink is designed to specifically link actions to button control clients. TButtonActionLink overrides methods to determine whether the action and client are linked, and to ensure that action events are appropriate for properties of button control clients.

TButtonActionLink inherits, from its ancestors, support for linking actions with the properties of components, generic controls, and windowed controls. TButtonActionLink adds support for linking the checked action to the appropriate behavior for a button control.


TButtonActionLink properties

TButtonActionLink	Alphabetically

Derived from TBasicActionLink

Action


TButtonActionLink properties

TButtonActionLink	By object

Action


TButtonActionLink events

TButtonActionLink	Alphabetically

Derived from TBasicActionLink

OnChange


TButtonActionLink events

TButtonActionLink	By object

OnChange


TButtonActionLink methods

TButtonActionLink	Alphabetically	Legend

In TButtonActionLink

AssignClient

IsCheckedLinked

SetChecked

Derived from TBasicActionLink

Create

Destroy

Execute

Update

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TButtonActionLink methods

TButtonActionLink	By object	Legend

AfterConstruction

AssignClient

BeforeDestruction

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

Execute

FieldAddress

FreeInstance

Free

GetInterfaceEntry

GetInterfaceTable

GetInterface

InheritsFrom

InitInstance

InstanceSize

IsCheckedLinked

MethodAddress

MethodName

NewInstance

SafeCallException

SetChecked

Update


TButtonActionLink.AssignClient

TButtonActionLink	See also

Assigns a client button that is linked to the associated action..

procedure AssignClient(AClient: TObject); override;

Description

TButtonActionLink overrides AssignClient to ensure that the client for the action is a button control.


TButtonActionLink.IsCheckedLinked

TButtonActionLink	See also

Indicates whether the action for the checked state and the client are linked.

function IsCheckedLinked: Boolean; override;

Description

IsCheckedLinked indicates whether the action, for the checked state, is linked to the appropriate client property. IsCheckedLinked returns True if the client requests that the action control this event, False otherwise.


TButtonActionLink.SetChecked

TButtonActionLink	See also

Sets the checked state of a button control if the client is linked to the action for this event.

procedure SetChecked(Value: Boolean); override;

Description

SetChecked sets the checked state of a button control, and is called only if the client is linked for this event. Value specifies whether the checked state should be set.


Scope

Protected


Hierarchy

TObject

TBasicActionLink

TActionLink

TControlActionLink

TWinControlActionLink


 TButton

Hierarchy	Properties	Methods	Events	See also

TButton is a push button control.

Unit

stdctrls

Description

Use TButton to put a standard Windows push button on a form. TButton introduces several properties to control its behavior in a dialog box setting. Users choose button controls to initiate actions.

To use a button that displays a bitmap instead of a label, use TBitBtn. To use a button that can remain in a depressed position, use TSpeedButton.

Note:	Since the TButton caption is always centered, changing the BiDi alignment has no effect.


TButton properties

TButton	Alphabetically	Legend

In TButton

Cancel

Default

ModalResult

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

Caption

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Font

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TButton properties

TButton	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

Cancel

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

Default

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

ModalResult

Name

Owner

Parent

ParentBiDiMode

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TButton.Cancel

TButton	See also

Determines whether the button’s OnClick event handler executes when the Escape key is pressed.

property Cancel: Boolean;

Description

If Cancel is True, the button’s OnClick event handler executes when the user presses Esc. Although an application can have more than one Cancel button, the form calls the OnClick event handler only for the first visible button in the tab order.


TButton.Default

TButton	See also

Determines whether the button’s OnClick event handler executes when the Enter key is pressed.

property Default: Boolean;

Description

If Default is True, the button’s OnClick event handler executes when the user presses Enter.

Although an application can have more than one Default button, the form calls the OnClick event handler only for the first visible button in the tab order. Moreover, any button that has focus becomes the Default button temporarily; hence, if the user selects another button before pressing Enter, the selected button’s OnClick event handler executes instead.


TButton.ModalResult

TButton

Determines whether and how the button closes its (modal) parent form.

property ModalResult: TModalResult;

Description

Setting the TButton component’s ModalResult property is an easy way to make clicking the button close a modal form. When a button is clicked, the ModalResult property of its parent form is set to the same value as the button’s ModalResult property.

For example, if a dialog box has OK and Cancel buttons, their ModalResult properties could be set at design time to mrOk and mrCancel, repectively. At runtime, clicking the OK button would then change the dialog’s ModalResult property to mrOk, and clicking the Cancel button would change the dialog’s ModalResult property to mrCancel. Unless further processing is required, no OnClick event handlers are required for the buttons.


TButton events

TButton	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TButton events

TButton	By object	Legend

OnClick

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TButton methods

TButton	Alphabetically

In TButton

Click

Create

UseRightToLeftAlignment

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TButton methods

TButton	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Click

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TButton.Click

TButton	See also

Simulates a mouse click, as if the user had clicked the button.

procedure Click; override;

Description

Calling Click assigns the value of the button’s ModalResult property to the ModalResult property of its parent form, and then generates an OnClick event.


TButton.Create

TButton	See also

Creates and initializes a TButton instance.

constructor Create(AOwner: TComponent); override;

Description

Use Create to programmatically instantiate a button. Buttons added in the form designer are created automatically.

Create

Calls the inherited Create method.

Sets the ControlStyle of the button to include the values csSetCaption, csOpaque, csDoubleClicks.

Sets Width to 75 pixels, and Height to 25 pixels.

Sets the TabStop property to True.


TButton.UseRightToLeftAlignment

TButton	See also

Specifies whether the control’s alignment is in a right-to-left mode.

function UseRightToLeftAlignment: Boolean; override;

Description

For TButton, UseRightToLeftAlignment always returns False. This is because the alignment of a button should never be reversed automatically when running in Middle Eastern locales.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TButtonControl


TBytesField

Hierarchy	Properties	Methods	Events	See also

TBytesField represents a bytes field in a dataset.

Unit

db

Description

TBytesField is a persistent field object that encapsulates the fundamental behavior common to untyped binary fields. TBytesField introduces no new properties, methods, or events beyond those inherited from TField. TBytesField overrides the DataSize property and constructor to reflect the specifics of a field of type ftBytes.

As with all persistent field objects, a TBytesField can be created at design-time using the Fields Editor or at runtime by calling the constructor for the class. Persistent field objects exist solely in the memory space of a Delphi application. Creating a persistent field object only creates an object in the application, and does not result in the creation of a field in a table.

Fields in a table can be accessed without use of persistent field objects. Virtual field objects are created to provide access to a field when the field is referenced through such means as the TDataSet.Fields property or the TDataSet.FieldByName method.

A bytes field value is a set of unformatted bytes of fixed size.


TBytesField properties

TBytesField	Alphabetically	Legend

In TBytesField

DataSize

Derived from TBinaryField

AsString

AsVariant

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TBytesField properties

TBytesField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

ValidChars

Value

VCLComObject

Visible


TBytesField.DataSize

TBytesField	See also	Example

Indicates the amount of memory needed to store the value of a Bytes field in its native database format.

property DataSize: Word;

Description

Check DataSize to determine the number of bytes required to store a Bytes field component’s value. Use DataSize to determine the size needed for a buffer when working with the GetData and SetData methods.

For Bytes fields, DataSize is the same as the Size property.


TBytesField events

TBytesField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TBytesField events

TBytesField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TBytesField methods

TBytesField	Alphabetically

In TBytesField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBytesField methods

TBytesField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TBytesField.Create

TBytesField	See also

Creates an instance of TBytesField.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TBytesField. After calling the inherited constructor, Create sets the DataType property to ftBytes.

After instantiating a TBytesField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TBytesField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TBytesField with a dataset component by setting its DataSet property to the name of the dataset component.

The example below creates a TBytesField object for a field named BytesField accessed through a TQuery named Query1.

var

  T: TBytesField;

begin

  Query1.Close;

  T := TBytesField.Create(Self);

  T.FieldName := 'BytesField';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TBinaryField


TCanvas

Hierarchy	Properties	Methods	Events	See also

TCanvas provides an abstract drawing space for objects that must render their own images.

Unit

graphics

Description

Use TCanvas as a drawing surface for objects that draw an image of themselves. Standard window controls such as edit controls or list boxes do not require a canvas, as they are drawn by Windows.

TCanvas provides properties, events and methods that assist in creating an image by

Specifying the type of brush, pen and font to use.

Drawing and filling a variety of shapes and lines.

Writing text.

Rendering graphic images.

Enabling a response to changes in the current image.

TCanvas has two descendants, TControlCanvas and TMetafileCanvas, which assist in drawing images of controls and in creating metafile images for objects.


TCanvas properties

TCanvas	Alphabetically	Legend

In TCanvas

Brush

CanvasOrientation

ClipRect

CopyMode

Font

Handle

LockCount

Pen

PenPos

Pixels

TextFlags


TCanvas properties

TCanvas	By object	Legend

Brush

CanvasOrientation

ClipRect

CopyMode

Font

Handle

LockCount

Pen

PenPos

Pixels

TextFlags


TCanvas.Brush

TCanvas	See also 	Example

Determines the color and pattern for filling graphical shapes and backgrounds.

property Brush: TBrush;

Description

Set the Brush property to specify the color and pattern to use when drawing the background or filling in graphical shapes. The value of Brush is a TBrush object. Set the properties of the TBrush object to specify the color and pattern or bitmap to use when filling in spaces on the canvas.

Note:	Setting the Brush property assigns the specified TBrush object, rather than replacing the current TBrush object.


TCanvas.CanvasOrientation

TCanvas	See also

Determines the orientation of the canvas as left-to-right or right-to-left.

TCanvasOrientation = (coLeftToRight, coRightToLeft);

property CanvasOrientation: TCanvasOrientation;

Description

CanvasOrientation is a read-only property used for bi-directional support. It indicates whether the orientation of the canvas is left-to-right (coLeftToRight) or right-to-left (coRightToLeft). The default is coLeftToRight, meaning that the 0,0 coordinate is at the top left corner of the canvas. In Middle-eastern locales the orientation may be coRightToLeft, meaning that the 0,0 coordinate is at the top right corner of the canvas. This property is important for grid controls because it changes the grid’s canvas orientation during drawing.


TCanvas.ClipRect

TCanvas	See also

Specifies the boundaries of the clipping rectangle.

property ClipRect: TRect;

Description

Use ClipRect to determine where the canvas needs painting. ClipRect limits the drawing region of the canvas so that any drawing that occurs at coordinates outside the ClipRect is clipped and doesn’t appear in the image.

For example, to draw a portion of a large circle in a smaller box, first draw the box, then set the ClipRect to the rectangle defined by the inner boundary of the box. Drawing the entire circle will only show the portion that is within the box.

When handling a form’s OnPaint event, the canvas' ClipRect property is set to the rectangle that needs to be painted. Portions of the image that do not overlap the ClipRect do not need to be drawn. Thus, OnPaint routines can use the value of ClipRect to optimize painting and speed the overall performance of the application.


TCanvas.CopyMode

TCanvas	See also	Example

Specifies how a graphical image is copied onto the canvas.

type TCopyMode = Longint;

property CopyMode: TCopyMode default cmSrcCopy;

Description

Set CopyMode to affect the way graphical images are drawn onto the canvas. The CopyMode is used when copying an image from another canvas using the CopyRect method. CopyMode is also used by TBitmap objects when they draw themselves to a canvas.

Use CopyMode to achieve a variety of affects when rendering an image. Achieve special effects like merged images and making parts of a bitmap transparent by combining multiple images with different CopyModes.

The following table shows the possible values of CopyMode. (These are constants defined in the Windows unit.)

Value	Meaning

cmBlackness	Fills the destination rectangle on the canvas with black.

cmDstInvert	Inverts the image on the canvas and ignores the source.

cmMergeCopy	Combines the image on the canvas and the source bitmap by using the Boolean AND operator.

cmMergePaint	Combines the inverted source bitmap with the image on the canvas by using the Boolean OR operator.

cmNotSrcCopy	Copies the inverted source bitmap to the canvas.

cmNotSrcErase	Combines the image on the canvas and the source bitmap by using the Boolean OR operator, and inverts the result.

cmPatCopy	Copies the source pattern to the canvas.

cmPatInvert	Combines the source pattern with the image on the canvas using the Boolean XOR operator

cmPatPaint	Combines the inverted source bitmap with the source pattern by using the Boolean OR operator. Combines the result of this operation with the image on the canvas by using the Boolean OR operator.

cmSrcAnd	Combines the image on the canvas and source bitmap by using the Boolean AND operator.

cmSrcCopy	Copies the source bitmap to the canvas.

cmSrcErase	Inverts the image on the canvas and combines the result with the source bitmap by using the Boolean AND operator.

cmSrcInvert	Combines the image on the canvas and the source bitmap by using the Boolean XOR operator.

cmSrcPaint	Combines the image on the canvas and the source bitmap by using the Boolean OR operator.

cmWhiteness	Fills the destination rectangle on the canvas with white.


TCanvas.Font

TCanvas	See also

Specifies the font to use when writing text on the image.

property Font: TFont;

Description

Set Font to specify the font to use for writing text on the image. The value of Font is a TFont object. Set the properties of the TFont object to specify the font face, color, size, and style of the font.

Note:	Setting the Font property assigns the specified TFont object, rather than replacing the current TFont object.


TCanvas.Handle

TCanvas	See also	Example

Specifies the Windows GDI handle to the device context for this canvas.

property Handle: HDC;

Description

Set Handle to the HDC for the device context the canvas must draw into. When a windowed control responds to a Windows paint message, the HDC for drawing is passed in to the PaintWindow method. In other cases, an HDC can be obtained for a window by calling the GetDeviceContext method of a control. Additionally, Windows provides API calls to obtain an HDC for a printer or for a memory image.

Read the Handle property to supplement the drawing services provided by the TCanvas object with API calls that require a handle to a device context. Most of the Windows GDI calls require an HDC.

TCanvas does not own the HDC. Applications must create an HDC and set the Handle property. Applications must release the HDC when the canvas no longer needs it. Setting the Handle property of a canvas that already has a valid HDC will not automatically release the initial HDC.

Note:	Some descendants of TCanvas, such as TControlCanvas, do own the HDC. Do not set the Handle property for these objects. They fetch and free their own Handle.


TCanvas.LockCount

TCanvas	See also

Indicates the number of times the canvas has been locked to prevent interference from other threads.

property LockCount: Integer;

Description

Read LockCount to determine whether the canvas is locked. Whenever the Lock method is called to block other threads from interfering with the canvas, LockCount increases. Whenever the Unlock method is called at the end of a critical section, LockCount decreases. When LockCount is 0, other threads may draw on the canvas.


TCanvas.Pen

TCanvas	See also 	Example

Specifies the kind of pen the canvas uses for drawing lines and outlining shapes.

property Pen: TPen;

Description

Set Pen to specify the pen to use for drawing lines and outlining shapes in the image. The value of Pen is a TPen object. Set the properties of the TPen object to specify the color, style, width, and mode of the pen.

Note:	Setting the Pen property assigns the specified TPen object, rather than replacing the current TPen object.


TCanvas.PenPos

TCanvas	See also

Specifies the current drawing position of the Pen.

property PenPos: TPoint;

Description

Read PenPos to learn the current drawing position of the Pen. This is the starting point of a line drawn by the LineTo method. Setting the PenPos property is equivalent to calling the MoveTo method.


TCanvas.Pixels

TCanvas	See also 	Example

Specifies the color of the pixels within the current ClipRect.

property Pixels[X, Y: Integer]: TColor;

Description

Read Pixels to learn the color on the drawing surface at a specific pixel position within the current clipping region. If the position is outside the clipping rectangle, reading the value of Pixels returns -1.

Write Pixels to change the color of individual pixels on the drawing surface. Use Pixels for detailed effects on an image. Pixels may also be used to determine the color that should be used for the FillRect method.

Not every device context supports the Pixels property. Reading the Pixels property for such a device context will return a value of -1. Setting the Pixels property for such a device context does nothing.


TCanvas.TextFlags

TCanvas	See also

Specifies how text is written to the canvas.

property TextFlags: LongInt;

Description

Use TextFlags to influence the way text is drawn when calling the TextOut or TextRect method. TextFlags is an integer made by combining any of the following constants:

Constant	Meaning

ETO_CLIPPED	Only the text that fits within a specified rectangle is displayed. This flag is automatically added when calling the TextRect method. When writing text using TextOut method, this flag has no effect because the drawing boundaries are determined by the TextExtent property.

ETO_OPAQUE	The text is drawn with an opaque background color. Using this flag improves performance but does not allow images behind the text rectangle to show through.

ETO_RTLREADING	Text strings are displayed from right to left. This is available only with Mideast versions of Windows, where text is written from right to left. Often this is used in combination with a CanvasOrientation of coRightToLeft.

ETO_GLYPH_INDEX	The text is an array of character placement codes that are parsed directly by the Windows GDI. Glyph indexing only applies to TrueType fonts, but the flag can be used with other fonts to indicate that the GDI should process the text string directly without language processing. See the Windows GDI documentation for more details.

ETO_IGNORELANGUAGE	This is an undocumented Microsoft flag. Check updates of Microsoft documentation for when information is provided.

ETO_NUMERICSLOCAL	This is an undocumented Microsoft flag. Check updates of Microsoft documentation for when information is available.

ETO_NUMERICSLATIN	This is an undocumented Microsoft flag. Check updates of Microsoft documentation for when information is available.


TCanvas events

TCanvas	Alphabetically

In TCanvas

OnChange

OnChanging


TCanvas events

TCanvas	By object

OnChange

OnChanging


TCanvas.OnChange

TCanvas	See also

Occurs when the image has just changed.

property OnChange: TNotifyEvent;

Description

Write an OnChange event handler to take specific action whenever the image on the canvas changes. When an application calls one of the drawing methods of TCanvas, the following steps occur.

1	An OnChanging event occurs.

2	The TCanvas method makes a change to the image.

3	An OnChange event occurs.

OnChange events occur on changes to the image, not changes to the properties of the canvas. Applications can respond to changes in the Font, Brush, and Pen properties by assigning OnChange event handlers to the corresponding TFont, TBrush, and TPen objects. However, TCanvas assigns its own OnChange event handlers for those objects. Before assigning an OnChange event handler to one of these objects, read the existing event handler. Use that value to call the TCanvas event handler from the new event handler.


TCanvas.OnChanging

TCanvas	See also

Occurs just before a change is made to the image.

property OnChanging: TNotifyEvent;

Description

Write an OnChanging event handler to take specific action before the image on the canvas changes. When an application calls one of the drawing methods of TCanvas, the following steps occur.

1	An OnChanging event occurs.

2	The TCanvas method makes a change to the image.

3	An OnChange event occurs.


TCanvas methods

TCanvas	Alphabetically

In TCanvas

Arc

BrushCopy

Chord

CopyRect

Create

Destroy

Draw

DrawFocusRect

Ellipse

FillRect

FloodFill

FrameRect

LineTo

Lock

MoveTo

Pie

PolyBezier

PolyBezierTo

Polygon

Polyline

Rectangle

Refresh

RoundRect

StretchDraw

TextExtent

TextHeight

TextOut

TextRect

TextWidth

TryLock

Unlock

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCanvas methods

TCanvas	By object

AfterConstruction

Arc

Assign

BeforeDestruction

BrushCopy

Chord

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

CopyRect

Create

DefaultHandler

Destroy

Dispatch

Draw

DrawFocusRect

Ellipse

FieldAddress

FillRect

FloodFill

FrameRect

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

LineTo

Lock

MethodAddress

MethodName

MoveTo

NewInstance

Pie

PolyBezier

PolyBezierTo

Polygon

Polyline

Rectangle

Refresh

RoundRect

SafeCallException

StretchDraw

TextExtent

TextHeight

TextOut

TextRect

TextWidth

TryLock

Unlock


TCanvas.Arc

TCanvas	See also 	Example

Draws an arc on the image along the perimeter of the ellipse bounded by the specified rectangle.

procedure Arc(X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer);

Description

Use Arc to draw an elliptically curved line with the current Pen. The arc traverses the perimeter of an ellipse that is bounded by the points (X1,Y1) and (X2,Y2). The arc is drawn following the perimeter of the ellipse, counterclockwise, from the starting point to the ending point. The starting point is defined by the intersection of the ellipse and a line defined by the center of the ellipse and (X3,Y3). The ending point is defined by the intersection of the ellipse and a line defined by the center of the ellipse and (X4, Y4).

Note:	On Windows 95, the sums X1 + X2 and Y1 + Y2 cannot exceed 32768. Also, the sum X1 + X2 + Y1 + Y2 cannot exceed 32768.

On NT, the drawing direction can be changed to clockwise using the Windows API call SetArcDirection.


TCanvas.BrushCopy

TCanvas	See also 	Example

Copies a portion of a bitmap onto a rectangle on the canvas, replacing one of the colors of the bitmap with the brush of the canvas.

procedure BrushCopy(const Dest: TRect; Bitmap: TBitmap; const Source: TRect; Color: TColor);

Description

Use BrushCopy to achieve special effects such as making the copied image partially transparent. BrushCopy is provided mainly for backward compatibility. Use a TImageList instead of BrushCopy.

Dest specifies the rectangular portion of the canvas that will receive the copy of the bitmap. Bitmap specifies the graphic to copy from. Source specifies the rectangular area of Bitmap to copy. Color specifies the color in Bitmap to replace with the Brush of the canvas.

To use BrushCopy to make the copied image partially transparent, specify the color of the surface of the canvas (clBackground for example) as the Color of the Brush property, then call BrushCopy.


TCanvas.Chord

TCanvas	See also

Draws a closed figure represented by the intersection of a line and an ellipse.

procedure Chord(X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer);

Description

Use Chord to create a shape that is defined by an arc and a line that joins the endpoints of the arc. The chord consists of a portion of an ellipse that is bounded by the points (X1,Y1) and (X2,Y2). The ellipse is bisected by a line that runs between the points (X3,Y3) and (X4,Y4).

The perimeter of the chord runs counter clockwise from (X3, Y3), counterclockwise along the ellipse to (X4,Y4), and straight back to (X3,Y3). If (X3,Y3) and (X4,Y4) are not on the surface of the ellipse, the corresponding corners on the chord are the closest points on the perimeter that intersect the line. The outline of the chord is drawn using the value of Pen, and the shape is filled using the value of Brush.

Note:	On Windows 95, the sums X1 + X2 and Y1 + Y2 cannot exceed 32768. Also, the sum X1 + X2 + Y1 + Y2 cannot exceed 32768.

On NT, the drawing direction can be changed to clockwise using the Windows API call SetArcDirection.


TCanvas.CopyRect

TCanvas	See also 	Example

Copies part of an image from another canvas into the canvas.

procedure CopyRect(Dest: TRect; Canvas: TCanvas; Source: TRect);

Description

Use CopyRect to transfer part of the image on another canvas to the image of the TCanvas object. Dest specifies the rectangle on the canvas where the source image will be copied. The Canvas parameter specifies the canvas with the source image. Source specifies a rectangle bounding the portion of the source canvas that will be copied.

The portion of the source canvas is copied using the mode specified by CopyMode.


TCanvas.Create

TCanvas	See also	Example

Creates an instance of TCanvas.

constructor Create;

Description

Call Create to instantiate a TCanvas object at runtime. Create allocates memory for the instance of TCanvas and creates the TFont, TBrush and TPen objects for the Font, Brush, and Pen properties. Create also initializes the CopyMode to cmSrcCopy.


TCanvas.Destroy

TCanvas	See also

Destroys an instance of TCanvas.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TCanvas object is not nil and only then calls Destroy.

Destroy frees the TBrush, TFont, and TPen objects that were created for the Brush, Font, and Pen properties. Destroy then frees the memory for the TCanvas object.


TCanvas.Draw

TCanvas 	See also 	Example

Renders the graphic specified by the Graphic parameter on the canvas at the location given by the coordinates (X, Y).

procedure Draw(X, Y: Integer; Graphic: TGraphic);

Description

Call Draw to draw a graphic on the canvas. Draw calls the Draw method of the graphic. The image is rendered into a rectangle determined by the size of the graphic, with the upper left corner at the point (X, Y).

Graphics can be bitmaps, icons, or metafiles. If the graphic is a TBitmap object, the bitmap is rendered using the value of CopyMode.


TCanvas.DrawFocusRect

TCanvas	See also 	Example

Draws a rectangle in the style used to indicate that the object inside the rectangle has focus.

procedure DrawFocusRect(const Rect: TRect);

Description

Call DrawFocusRect for the perimeter of the image of a control when the control gets or loses input focus. Because DrawFocusRect uses an XOR function, calling it a second time while specifying the same rectangle removes the rectangle from the screen.

The rectangle this function draws cannot be scrolled. To scroll an area containing a rectangle drawn by DrawFocusRect, call DrawFocusRect to remove the rectangle from the screen, scroll the area, and then call DrawFocusRect to draw the rectangle in the new position.


TCanvas.Ellipse

TCanvas	See also 	Example

Draws the ellipse defined by a bounding rectangle on the canvas.

procedure Ellipse(X1, Y1, X2, Y2: Integer); overload;

procedure Ellipse(const Rect: TRect); overload;

Description

Call Ellipse to draw a circle or ellipse on the canvas. Specify the bounding rectangle either by giving

The top left point at pixel coordinates (X1, Y1) and the bottom right point at (X2, Y2).

A TRect value.

If the bounding rectangle is a square, a circle is drawn.

The ellipse is outlined using the value of Pen, and filled using the value of Brush.

Note:	On Windows 95, the sums X1 + X2 and Y1 + Y2 cannot exceed 32768. Also, the sum X1 + X2 + Y1 + Y2 cannot exceed 32768.


TCanvas.FillRect

TCanvas	See also 	Example

Fills the specified rectangle on the canvas using the current brush.

procedure FillRect(const Rect: TRect);

Description

Use FillRect to fill a rectangular region using the current brush. The region is filled including the top and left sides of the rectangle, but excluding the bottom and left edges.


TCanvas.FloodFill

TCanvas	See also

Fills an area of the canvas using the current brush.

type TFillStyle = (fsSurface, fsBorder);

procedure FloodFill(X, Y: Integer; Color: TColor; FillStyle: TFillStyle);

Description

Use FloodFill to fill a possibly non-rectangular region of the image with the value of Brush. The boundaries of the region to be filled are determined by moving outward from the point (X,Y) until a color boundary involving the Color parameter is encountered.

FillStyle determines what type of color changes define the boundaries, as indicated in the following table.

Value	Meaning

fsSurface	Fill all area that has the color indicated by the Color parameter. Stop when another color is encountered.

fsBorder	Fill all area that does not have the color indicated by the Color parameter. Stop when Color is encountered.

Use the Pixels property to get the exact value of the color at the point (X,Y) when using a FillStyle of fsSurface. Similarly, when FillStyle is fsBorder, use Pixels to get the exact value of the boundary color if a point on the boundary is known.


TCanvas.FrameRect

TCanvas	See also 	Example

Draws a rectangle using the Brush of the canvas to draw the border.

procedure FrameRect(const Rect: TRect);

Description

Use FrameRect to draw a 1 pixel wide border around a rectangular region. FrameRect does not fill the interior of the rectangle with the Brush pattern.

To draw a boundary using the Pen instead, use the Polygon method.


TCanvas.LineTo

TCanvas	See also 	Example

Draws a line on the canvas from PenPos to the point specified by X and Y, and sets the pen position to (X, Y).

procedure LineTo(X, Y: Integer);

Description

Use LineTo to draw a line from PenPos up to, but not including the point (X,Y). LineTo changes the value of PenPos to (X,Y).

The line is drawn using Pen.


TCanvas.Lock

TCanvas	See also

Prevents other threads from drawing on the canvas.

procedure Lock;

Description

Call Lock in a multithreaded application to prevent other threads from drawing on the canvas. Lock prevents other cooperating threads in the application from executing until the Unlock method is called. Nested calls to Lock increment the LockCount property so that the canvas is not unlocked until the last lock is released.

In multi-threaded applications that use Lock to protect a canvas, all calls that use the canvas must be protected by a call to Lock.  Any thread that does not lock the canvas before using it will introduce potential bugs.

Because Lock prevents other threads from executing, it can adversely affect performance. Do not call Lock unless there is a danger that another thread might interfere with drawing on the canvas.


TCanvas.MoveTo

TCanvas	See also 	Example

Changes the current drawing position to the point (X,Y).

procedure MoveTo(X, Y: Integer);

Description

Use MoveTo to set the value of PenPos before calling LineTo. Calling MoveTo is equivalent to setting the PenPos property.


TCanvas.Pie

TCanvas	See also

Draws a pie-shaped the section of the ellipse bounded by the rectangle (X1, Y1) and (X2, Y2) on the canvas.

procedure Pie(X1, Y1, X2, Y2, X3, Y3, X4, Y4: Longint);

Description

Use Pie to draw a pie-shaped wedge on the image. The wedge is defined by the ellipse bounded by the rectangle determined by the points (X1, Y1) and X2, Y2). The section drawn is determined by two lines radiating from the center of the ellipse through the points (X3, Y3) and (X4, Y4).

The wedge is outlined using Pen, and filled using Brush.

Note:	On Windows 95, the sums X1 + X2 and Y1 + Y2 cannot exceed 32768. Also, the sum X1 + X2 + Y1 + Y2 cannot exceed 32768.


TCanvas.PolyBezier

TCanvas	See also

Draws a set of Bézier curves.

procedure PolyBezier(const Points: array of TPoint);

Description

Use PolyBezier to draw cubic Bézier curves using the endpoints and control points specified by the Points parameter. The first curve is drawn from the first point to the fourth point, using the second and third points as control points. Each subsequent curve in the sequence needs exactly three more points: the ending point of the previous curve is used as the starting point, the next two points in the sequence are control points, and the third is the ending point.

This procedure draws lines by using the current pen.

Use the Slice function to pass a portion of an array of points to the PolyBezier method. For example, to form a Bézier curve using the first ten points from an array of 100 points, use the Slice function as follows:

Canvas.PolyBezier(Slice(PointArray, 10));


TCanvas.PolyBezierTo

TCanvas	See also

Draws a set of Bézier curves and updates the value of PenPos.

procedure PolyBezier(const Points: array of TPoint);

Description

Use PolyBezierTo to draw cubic Bézier curves by using the endpoints and control points specified by the Points parameter. The first curve is drawn from the first point to the fourth point, using the second and third points as control points. Each subsequent curve in the sequence needs exactly three more points: the ending point of the previous curve is used as the starting point, the next two points in the sequence are control points, and the third is the ending point.

This procedure draws lines by using the current pen and updates the value of PenPos to the value of the last endpoint.

Use the Slice function to pass a portion of an array of points to the PolyBezierTo method. For example, to form a Bézier curve using the first ten points from an array of 100 points, use the Slice function as follows:

Canvas.PolyBezierTo(Slice(PointArray, 10));


TCanvas.Polygon

TCanvas	See also 	Example

Draws a series of lines on the canvas connecting the points passed in and closing the shape by drawing a line from the last point to the first point.

procedure Polygon(Points: array of TPoint);

Description

Use Polygon to draw a closed, many-sided shape on the canvas, using the value of Pen. After drawing the complete shape, Polygon fills the shape using the value of Brush.

To draw a polygon on the canvas, without filling it, use the Polyline method, specifying the first point a second time at the end.

Use the Slice function to pass a portion of an array of points to the Polygon method. For example, to form a polygon from the first ten points from an array of 100 points, use the Slice function as follows:

Canvas.Polygon(Slice(PointArray, 10));


TCanvas.Polyline

TCanvas	See also 	Example

Draws a series of lines on the canvas with the current pen, connecting each of the points passed to it in Points.

procedure Polyline(Points: array of TPoint);

Description

Use Polyline to connect a set of points on the canvas. If there are only two points, Polyline draws a single line.

Calling the MoveTo function with the value of the first point, and then repeatedly calling LineTo with all subsequent points will draw the same image on the canvas. However, unlike LineTo, Polyline does not change the value of PenPos.

Use the Slice function to pass a portion of an array of points to the Polyline method. For example, to connect the first ten points in an array of 100 points, use the Slice function as follows:

Canvas.Polyline(Slice(PointArray, 10));


TCanvas.Rectangle

TCanvas	See also 	Example

Draws a rectangle on the .

procedure Rectangle(X1, Y1, X2, Y2: Integer); overload;

procedure Rectangle(const Rect: TRect); overload;

Description

Use Rectangle to draw a rectangle using Pen and fill it with Brush. Specify the rectangle’s coordinates in one of two ways:

Giving four coordinates that define the upper left corner at the point (X1, Y1) and the lower right corner at the point (X2, Y2).

Using a TRect type.

To fill a rectangular region without drawing the boundary in the current pen, use FillRect. To outline a rectangular region without filling it, use FrameRect or Polygon. To draw a rectangle with rounded corners, use RoundRect.


TCanvas.Refresh

TCanvas	See also

Deselects the Pen, Brush, and Font from the device context.

procedure Refresh;

Description

Call Refresh to return the HDC used by the canvas to a default state. Refresh does not change the values of the Font, Brush, or Pen properties. Calling any of the drawing methods of the canvas after calling Refresh will re-select the Font, Brush, or Pen into the HDC if it is used by the drawing method.


TCanvas.RoundRect

TCanvas	See also 	Example

Draws a rectangle with rounded corners on the canvas.

procedure RoundRect(X1, Y1, X2, Y2, X3, Y3: Integer);

Description

Use RoundRect to draw a rounded rectangle using Pen and fill it with Brush. The rectangle will have edges defined by the points (X1,Y1), (X2,Y1), (X2,Y2), (X1,Y2), but the corners will be shaved to create a rounded appearance. The curve of the rounded corners matches the curvature of an ellipse with width X3 and height Y3.

To draw an ellipse instead, use Ellipse. To draw a true rectangle, use Rectangle.


TCanvas.StretchDraw

TCanvas	See also	Example

Draws the graphic specified by the Graphic parameter in the rectangle specified by the Rect parameter.

procedure StretchDraw(const Rect: TRect; Graphic: TGraphic );

Description

Call StretchDraw to draw a graphic on the canvas so that the image fits in the specified rectangle. StretchDraw calls the Draw method of the graphic. The graphic object determines how to fit into the rectangle. This may involve changing magnification and/or aspect ratio.

To render the graphic in its natural size, use the Draw method, instead.

Graphics can be bitmaps, icons, or metafiles. If the graphic is a TBitmap object, the bitmap is rendered using the value of CopyMode.


TCanvas.TextExtent

TCanvas	See also

Returns the width and height, in pixels, of a string rendered in the current font.

type

  TSize = record

    cx: Longint;

    cy: Longint;

  end;

function TextExtent(const Text: string): TSize;

Description

Use TextExtent to determine the space a string will occupy in the image. Other elements in the image such as lines, boxes, or additional lines of text can be positioned to accommodate the size of the text.

To check only the height, call TextHeight. To check only the width, call TextWidth.


TCanvas.TextHeight

TCanvas	See also 	Example

Returns the height, in pixels, of a string rendered in the current font.

function TextHeight(const Text: string): Integer;

Description

Use TextHeight to determine the height a string will occupy in the image. Other elements in the image such as lines, boxes, or additional lines of text can be positioned to accommodate the height of the text.

TextHeight returns the same value as TextExtent(Text).cy.


TCanvas.TextOut

TCanvas	See also 	Example

Writes a string on the canvas, starting at the point (X,Y), and then updates the PenPos to the end of the string.

procedure TextOut(X, Y: Integer; const Text: string);

Description

Use TextOut to write a string onto the canvas. The string will be written using the current value of Font. Use the TextExtent method to determine the space occupied by the text in the image. To write only the text that fits within a clipping rectangle, use TextRect instead.


TCanvas.TextRect

TCanvas	See also 	Example

Writes a string inside a clipping rectangle.

procedure TextRect(Rect: TRect; X, Y: Integer; const Text: string);

Description

Use TextRect to write a string within a limited rectangular region. Any portions of the string that fall outside the rectangle passed in the Rect parameter are clipped and don't appear. The upper left corner of the text is placed at the point (X, Y).


TCanvas.TextWidth

TCanvas	See also 	Example

Returns the width, in pixels, of a string rendered in the current font.

function TextWidth(const Text: string): Integer;

Description

Use TextWdith to determine the length a string will occupy in the image. TextWidth indicates whether a given string will fit in the available space. Other graphical elements in the image such as lines, or additional strings can be positioned to accommodate the width of the text.

TextWidth returns the same value as TextExtent(Text).cx.


TCanvas.TryLock

TCanvas	See also

Locks the canvas if it is currently unlocked.

function TryLock: Boolean;

Description

Call TryLock to prevent other threads from writing on the surface of the canvas until the Unlock method is called. Unlike calls to the Lock method, which nest so that every call to Lock must be matched with a subsequent call to Unlock, TryLock need only be matched by a call to Unlock if the canvas was not already locked.

If the canvas is unlocked, TryLock locks the canvas, sets the LockCount property to 1, and returns True. If the canvas is already locked, TryLock returns False without making any changes.

Use TryLock before attempting changes to the canvas that could interfere with other code that is protected by a Lock ... Unlock pair of method calls.


TCanvas.Unlock

TCanvas	See also

Decreases the LockCount property, allowing other threads to execute when LockCount reaches 0.

procedure Unlock;

Description

Call Unlock at the end of a critical section begun with a call to the Lock method. Every call to Lock must be matched by a call to Unlock.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent


TCheckConstraints

Hierarchy	Properties	Methods	See also

TCheckConstraints contains a collection of check constraints for a dataset component.

Unit

db

Description

BDE dataset components support check constraints that define the values that can be entered into a single record. The TCheckConstraints object maintains the collection of check constraints that apply to a given dataset.


TCheckConstraints properties

TCheckConstraints	Alphabetically	Legend

In TCheckConstraints

Items

Derived from TCollection

Count

ItemClass


TCheckConstraints properties

TCheckConstraints	By object	Legend

Count

ItemClass

Items


TCheckConstraints.Items

TCheckConstraints	See also

Maintains an indexed array of check constraints.

property Items[Index: Integer]: TCheckConstraint;

Description

Use Items to access individual check constraints that apply to the dataset component that owns this check constraint collection.


TCheckConstraints methods

TCheckConstraints	Alphabetically

In TCheckConstraints

Add

Create

Derived from TCollection

Assign

BeginUpdate

Clear

Delete

Destroy

EndUpdate

FindItemID

GetNamePath

Insert

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCheckConstraints methods

TCheckConstraints	By object

Add

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

FindItemID

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCheckConstraints.Add

TCheckConstraints	See also

Adds a check constraint item to the list maintained by this collection object.

function Add: TCheckConstraint;

Description

Call Add to add another check constraint to those known to the dataset component that owns this check constraint object.


TCheckConstraints.Create

TCheckConstraints

Instantiates an instance of a check constraint collection object.

constructor Create(Owner: TPersistent);

Description

Call Create to instantiate a check constraint collection object at runtime when you need a collection object and it has not been created automatically for you. Create calls its inherited constructor, and sets the collection’s owner object to Owner.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


 TCheckBox

Hierarchy	Properties	Methods	Events	See also

TCheckBox represents a Windows check box.

Unit

stdctrls

Description

A TCheckBox component presents an option for the user. The user can check the box to select the option, or uncheck it to deselect the option.


TCheckBox properties

TCheckBox	Alphabetically	Legend

Derived from TCustomCheckBox

Alignment

AllowGrayed

Checked

State

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

Caption

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCheckBox properties

TCheckBox	By object	Legend

Action

Align

Alignment

AllowGrayed

Anchors

BiDiMode

BoundsRect

Brush

Caption

Checked

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ShowHint

Showing

State

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TCheckBox events

TCheckBox	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TCheckBox events

TCheckBox	By object	Legend

OnClick

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TCheckBox methods

TCheckBox	Alphabetically

Derived from TCustomCheckBox

Create

GetControlsAlignment

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCheckBox methods

TCheckBox	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TButtonControl

TCustomCheckBox


TCheckConstraint

Hierarchy	Properties	Methods

TCheckConstraint represents a check constraint on a dataset component.

Unit

db

Description

BDE dataset components implement a Constraints property that uses check constraints to represent record level constraints. These constraints can be derived from the server, the data dictionary, and can be customized in applications. Individual constraints associated with a dataset are represented by the TCheckConstraint object.


TCheckConstraint properties

TCheckConstraint	Alphabetically	Legend

In TCheckConstraint

CustomConstraint

ErrorMessage

FromDictionary

ImportedConstraint

Derived from TCollectionItem

Collection

DisplayName

ID

Index


TCheckConstraint properties

TCheckConstraint	By object	Legend

Collection

CustomConstraint

DisplayName

ErrorMessage

FromDictionary

ID

ImportedConstraint

Index


TCheckConstraint.CustomConstraint

TCheckConstraint	See also

Contains the SQL text representation of a constraint defined on a record by an application.

property CustomConstraint: string;

Description

Use CustomConstraint to store the SQL text that defines a check constraint defined by the application for a dataset component. Custom constraints are local to the application and do not get applied to the server when an application writes its changes to a database.

Note:	Custom constraints are SQL expressions. Because of this, always use a period (.) as a floating-point separator.  This may be inconsistent with international Windows settings.


TCheckConstraint.ErrorMessage

TCheckConstraint	See also

Contains the text of an error message to display if data entered in a record by a user violates the constraint condition.

Property ErrorMessage string;

Description

Use ErrorMessage to set the error message string to display in an exception message dialog if a user enters data in a record that violates a check constraint condition.


TCheckConstraint.FromDictionary

TCheckConstraint	See also

Indicates whether or not to fetch a check constraint from the Data Dictionary.

property FromDictionary: Boolean;

Description

Use FromDictionary to indicate whether or not this check constraint should be derived from the Data Dictionary (True), or is local to the application (False).


TCheckConstraint.ImportedConstraint

TCheckConstraint	See also

Contains the SQL text for a check constraint imported from the Data Dictionary or a remote SQL database server.

property ImportedConstraint: string;

Description

Use ImportedConstraint to store the SQL text for a check constraint that is imported from the server or Data Dictionary. Although an application can set this property at runtime, ordinarily the text in ImportedConstraint is automatically provided to the application.


TCheckConstraint methods

TCheckConstraint	Alphabetically

In TCheckConstraint

Assign

GetDisplayName

Derived from TCollectionItem

Create

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCheckConstraint methods

TCheckConstraint	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetDisplayName

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCheckConstraint.Assign

TCheckConstraint

Assigns one constraint to another.

procedure Assign(Source: TPersistent);

Description

Call Assign to copy the SQL that defines the check constraint from another TCheckConstraint object into this one. Source is the TCheckConstraint from which to read text.


TCheckConstraint.GetDisplayName

TCheckConstraint	See also

Retrieves the current text for a constraint.

function GetDisplayName: string;

Description

Call GetDisplayName to retrieve the current text for a check constraint. GetDisplayName attempts to read the current value of the ImportedConstraint property, unless it is an empty string. In that case it reads the current value of the CustomConstraint property. If it, too, is an empty string, then GetDisplayName calls its inherited GetDisplayName method.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem


TChangeLink

Hierarchy	Properties	Methods	Events	See also

The TImageList component uses TChangeLink internally to notify other objects when changes are made to the image list.

Unit

controls

Description

A TImageList keeps a list of its TChangeLink objects. Each is associated with a particular component, such as a tree view or list view control. A component can register its change link with an image list by calling the image list’s RegisterChanges method. Before destruction, the component should then call the UnregisterChanges method.

Component writers can use the change link object to receive notification when changes are made to an image list that a control uses. Use the OnChange event of the change link to execute some code when the image list changes. For example, the tree view control uses a change link object to know when its image list has changed.


TChangeLink properties

TChangeLink	Alphabetically

In TChangeLink

Sender


TChangeLink properties

TChangeLink	By object

Sender


TChangeLink.Sender

TChangeLink	See also

Specifies which image list component notifies the change link object of changes.

property Sender : TCustomImageList;

Description

Use Sender to access the image list that has changed. The TImageList automatically sets this property when a call to RegisterChanges is made.


TChangeLink events

TChangeLink	Alphabetically

In TChangeLink

OnChange


TChangeLink events

TChangeLink	By object

OnChange


TChangeLink.OnChange

TChangeLink	See also

Occurs when there's a change in any of the images stored in the associated image list.

property OnChange: TNotifyEvent;

Description

Use the OnChange event to notify a control when the image list that it’s using changes. Specify any special processing to occur at that time in the OnChange event handler.


TChangeLink methods

TChangeLink	Alphabetically

In TChangeLink

Change

Destroy

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TChangeLink methods

TChangeLink	By object

AfterConstruction

BeforeDestruction

Change

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TChangeLink.Change

TChangeLink	See also

Generates an OnChange event.

procedure Change;

Description

Use the Change method to trigger the OnChange event handler of the change link object.


TChangeLink.Destroy

TChangeLink	See also

Destroys the change link object and releases the memory allocated to it.

destructor Destroy;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the change link is not nil before calling Destroy.

Before freeing the memory for the change link, Destroy first calls the image list’s UnRegisterChanges method to unregister itself from receiving notification when the image list changes.


Hierarchy

TObject


 TCheckListBox

Hierarchy	Properties	Methods	Events	See also

TCheckListBox displays a scrollable list with check boxes next to each item.

Unit

checklst

Description

TCheckListBox is similar to TListBox, except that each item has a check box next to it. Users can check or uncheck items in the list.


TCheckListBox properties

TCheckListBox	Alphabetically	Legend

In TCheckListBox

AllowGrayed

Checked

Flat

ItemEnabled

State

Derived from TCustomListBox

BorderStyle

Canvas

Columns

IntegralHeight

ItemHeight

ItemIndex

Items

SelCount

Selected

Sorted

Style

TabWidth

TopIndex

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

ItemEnabled

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCheckListBox properties

TCheckListBox	By object	Legend

Action

Align

AllowGrayed

Anchors

BiDiMode

BorderStyle

BoundsRect

Brush

Canvas

Checked

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Columns

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Flat

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

ImeMode

ImeName

IntegralHeight

ItemEnabled

ItemHeight

ItemIndex

Items

Left

LRDockWidth

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

SelCount

Selected

ShowHint

Showing

Sorted

State

Style

TabOrder

TabStop

TabWidth

Tag

TBDockHeight

Top

TopIndex

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TCheckListBox.AllowGrayed

TCheckListBox	See also

Determines whether check box can be in a “grayed” state.

property AllowGrayed: Boolean;

Description

If AllowGrayed is set to True, each item has three possible states: checked, unchecked, and grayed. If AllowGrayed is set to False, each item has only two possible states: checked and unchecked.

Note:	It is also possible to disable individual items while still showing whether they are checked or unchecked. To disable items without using the grayed state, use the ItemEnabled property.


TCheckListBox.Checked

TCheckListBox	See also

Indicates which items are checked.

property Checked[Index: Integer]: Boolean;

Description

For each member of the Items array, Checked is True if a check mark appears in the item’s check box. Checked corresponds to the cbChecked state; that is, Checked is True when State = cbChecked and False when State = cbUnchecked or State = cbGrayed.

Note:	Items that have been disabled using the ItemEnabled property may still have a state of cbChecked and a Checked property of True.


TCheckListBox.Flat

TCheckListBox	See also

Determines whether the check boxes appear three-dimensional.

property Flat: Boolean;

Description

When Flat is True (the default), the check boxes in the list box have flat borders. Setting Flat to False gives the check boxes raised borders, which create a three-dimensional look.


TCheckListBox.ItemEnabled

TCheckListBox	See also

Enables or disables individual items in the list.

property ItemEnabled[Index: Integer]: Boolean;

Description

Use ItemEnabled to enable or disable individual list items without using the cbGrayed state. Using ItemEnabled allows the list box to display check marks for items with a state of cbChecked while still graying the item and preventing the user from changing its state.

For each member of the Items array, ItemEnabled is True if the user can change the state of the item. Enabled items have a state of cbChecked or cbUnchecked.

ItemEnabled is False when State =cbGrayed or when the item has been explicitly disabled using this property.


TCheckListBox.State

TCheckListBox	See also

Indicates which items are checked.

type TCheckBoxState = (cbUnchecked, cbChecked, cbGrayed);

property State[Index: Integer]: TCheckBoxState;

Description

For each member of the Items array, State indicates whether its check box is selected (cbChecked), deselected (cbUnchecked), or grayed (cbGrayed).

State combines the information provided by the Boolean Checked property and the Boolean ItemEnabled property:

 When Checked is True, State is cbChecked. (However, when Checked is False, State may be either cbUnchecked or cbGrayed.)

When State is cbGrayed, ItemEnabled is False. (However, ItemEnabled may also be False when State is cbUnchecked or cbChecked.)


TCheckListBox events

TCheckListBox	Alphabetically	Legend

In TCheckListBox

OnClickCheck

Derived from TCustomListBox

OnDrawItem

OnMeasureItem

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TCheckListBox events

TCheckListBox	By object	Legend

OnClickCheck

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnDrawItem

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMeasureItem

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TCheckListBox.OnClickCheck
TCheckListBoxOnClickCheck

TCheckListBox	See also

Occurs when the user selects or deselects an item’s check box.

property OnClickCheck: TNotifyEvent;

Description

Write an OnClickCheck event handler to implement any special processing that should occur when the user checks or unchecks an item.

Note:	This event does not occur for items that are grayed (State=cbGrayed) or disabled (ItemEnabled=False).


TCheckListBox methods

TCheckListBox	Alphabetically

In TCheckListBox

Destroy

Derived from TCustomListBox

Clear

Create

ItemAtPos

ItemRect

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCheckListBox methods

TCheckListBox	By object

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ItemAtPos

ItemRect

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState


TCheckListBox.Destroy

TCheckListBox	See also

Destroys the TCheckListBox instance and frees its memory.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Call Free instead. Free verifies that the check list box is not nil before it calls Destroy.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomListBox


TClassList

Hierarchy	Properties	Methods	See also

TClassList maintains a list of classes.

Unit

contnrs

Description

Use a TClassList object to store and maintain a list of classes.


TClassList properties

TClassList	Alphabetically	Legend

In TClassList

Items

Derived from TList

Capacity

Count

List


TClassList properties

TClassList	By object	Legend

Capacity

Count

Items

List


TClassList.Items

TClassList	See also

Lists the classes in the TClassList.

property Items[Index: Integer]: TClass;

Description

Use Items to access classes in the list. Items is a zero-based array: The first class is indexed as 0, the second class is indexed as 1, and so forth. You can read or change the value at a specific index, or use Items with the Count property to iterate through the list.

Items can contain empty class references. To remove empty references and reduce the size of the array, call the Pack method.


TClassList methods

TClassList	Alphabetically

In TClassList

Add

IndexOf

Insert

Remove

Derived from TList

Clear

Delete

Destroy

Error

Exchange

Expand

Extract

First

Last

Move

Pack

Sort

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TList methods

TClassList	By object

Add

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

Error

Exchange

Expand

Extract

FieldAddress

First

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

IndexOf

InheritsFrom

InitInstance

Insert

InstanceSize

Last

MethodAddress

MethodName

Move

NewInstance

Pack

Remove

SafeCallException

Sort


TClassList.Add

TClassListClass	See also

Inserts a new class at the end of the list.

function Add(aClass: TClass): Integer;

Description

Call Add to insert a new class at the end of the Items array. Add returns the index of the new class, where the first class in the list has an index of 0.

Add increments Count and, if necessary, allocates memory by increasing the value of Capacity.


TClassList.IndexOf

TClassList	See also

Returns the index of the first occurrence in the list of a specified class.

function IndexOf(aClass: TClass): Integer;

Description

Call IndexOf to get the index for a class in the Items array. The first class in the array has index 0, the second class has index 1, and so on.

If a class is not in the list, IndexOf returns -1. If a class appears more than once in the list, IndexOf returns the index of the first appearance.


TClassList.Insert

TClassList	See also

Adds a class to the list at a specified position.

procedure Insert(Index: Integer; aClass: TClass);

Description

Call Insert to add a class at a specified position in the list, shifting the item that previously occupied that position (and all subsequent items) up. Insert increments Count and, if necessary, allocates memory by increasing the value of Capacity.

The Index parameter is zero-based, so the first position in the list has an index of 0.

To replace an empty reference with a new class without growing the array, set the Items property directly.


TClassList.Remove

TClassList	See also

Removes the first occurrence of a specified class from the list.

function Remove(aClass: TClass): Integer;

Description

Call Remove to delete a specific class from the list when its index is unknown. The value returned is the index of the class in the Items array before it was removed. If the specified object is not found on the list, Remove returns –1.

After a class is deleted, all the classes that follow it are moved up in index position and Count is decremented. If a class appears more than once on the list, Remove deletes only the first appearance.

To use an index position (rather than an object reference) to specify the class to be removed, call Delete.


Accessibility

Read-only


Hierarchy

TObject

TList


TClipboard

Hierarchy	Properties	Methods	See also

TClipboard represents the Windows clipboard.

Unit

clipbrd

Description

TClipboard is a wrapper for the Windows clipboard, which contains text or graphics that have been cut or copied from an application.

Do not instantiate separate TClipboard objects by calling the constructor. Instead, use the global instance of TClipboard returned by the Clipboard function. This allows applications to share a single instance of TClipboard and safeguards against accidental deletion of the clipboard. Before calling Clipboard, be sure the uses clause includes the Clipbrd unit.

TClipboard’s properties provide information about the formats that the clipboard is registered to handle.

TClipboard’s methods

•	store and retrieve data in appropriate formats.

•	open and close the clipboard, maintaining a reference count.

•	manage formats for objects in the clipboard.


TClipboard properties

TClipboard	Alphabetically	Legend

In TClipboard

AsText

FormatCount

Formats


TClipboard properties

TClipboard	By object	Legend

AsText

FormatCount

Formats


TClipboard.AsText

TClipboard	See also 	Example

Represents the content of the clipboard as a string.

property AsText: string;

Description

Use the AsText property to place text in and retrieve text from the clipboard. The clipboard must contain a string or an exception occurs. To determine if the clipboard contains a string, pass CF_TEXT to the HasFormat method.


TClipboard.FormatCount

TClipboard	See also 	Example

Specifies the number of formats in the Formats array property.

property FormatCount: Integer;

Description

Use FormatCount to find the number of different format types used to encode the information currently stored in the clipboard. FormatCount is read-only.

To find out if a particular format is available on the clipboard, use the HasFormat method.


TClipboard.Formats

TClipboard	See also 	Example

Provides indexed access to all the formats the clipboard contains.

property Formats[Index: Integer]: Word;

Description

Read Formats to determine what formats encode the information currently on the clipboard. Each format can be accessed by its position in the array.

Usually, when an application copies or cuts something to the clipboard, it places it there in multiple formats. An application can place items of a particular format on the clipboard and retrieve items with a particular format from the clipboard if the format is in the Formats array. To find out if a particular format is available on the clipboard, use the HasFormat method.

When reading information from the clipboard, use the Formats array to choose the best possible encoding for information that can be encoded in several ways.

Before you can write information to the clipboard in a particular format, the format must be registered. To register a new format, use the RegisterClipboardFormat method of TPicture.


TClipboard methods

TClipboard	Alphabetically

In TClipboard

Assign

Clear

Close

GetAsHandle

GetComponent

GetTextBuf

HasFormat

Open

SetAsHandle

SetComponent

SetTextBuf

Derived from TPersistent

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TClipboard methods

TClipboard	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Close

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetAsHandle

GetComponent

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetTextBuf

HasFormat

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Open

SafeCallException

SetAsHandle

SetComponent

SetTextBuf


TClipboard.Assign

TClipboard	See also	Example

Copies an object to the clipboard.

procedure Assign(Source: TPersistent);

Description

Use Assign to copy pictures to and from the clipboard. For example, the following code copies the bitmap from a TBitmap instance (Bitmap1) to the clipboard.

Clipboard.Assign(Bitmap1);

If a bitmap is on the clipboard, the following code copies it to Bitmap1.

Bitmap1.Assign(Clipboard);

The Formats property lists the formats used by the clipboard. Different kinds of graphic object (such as bitmaps and metafiles) have their own formats. Use the HasFormat method to determine whether the information on the clipboard is stored in a format compatible with the object you want to assign it to.


TClipboard.Clear

TClipboard

Deletes the contents of the clipboard.

procedure Clear;

Description

Call Clear to empty the clipboard.

Clear is called automatically by TClipboard operations that add data to the clipboard.


TClipboard.Close

TClipboard	See also 	Example

Closes the clipboard if it is open.

procedure Close;

Description

Call Close when you are finished adding items to the clipboard.

The clipboard can be opened with multiple calls to the Open method before being closed. Open and Close maintain a count of the number of times the clipboard has been opened and will not close it until Close has been called the same number of times.


TClipboard.GetAsHandle

TClipboard	See also 	Example

Returns a Windows handle to data from the clipboard in the specified format.

function GetAsHandle (Format: Word): THandle;

Description

GetAsHandle retrieves data from the clipboard using Windows handles.

The handle returned by GetAsHandle is not owned by the application and is valid only as long as the clipboard is open. If you need it for longer, copy the data to another handle.

The Format parameter can specify any of the formats listed under the HasFormat method. Applications can also define and register their own formats. See the Windows API Help for more information.


TClipboard.GetComponent

TClipboard	See also 	Example

Retrieves a component from the clipboard.

function GetComponent(Owner, Parent: TComponent): TComponent;

Description

Use GetComponent to retrieve a component that is stored on the clipboard.

Owner becomes the owner of the retrieved component and Parent becomes its parent. Owner is usually a form, but both parameters can be nil.

Before a class is read from the clipboard, it must be registered by a call to RegisterClasses. If you try to read an unregistered class, you’ll get an EClassNotFound exception.


TClipboard.GetTextBuf

TClipboard	See also

Retrieves text from the clipboard and copies it to a buffer.

function GetTextBuf(Buffer: PChar; BufSize: Integer): Integer;

Description

Use GetTextBuf to retrieve text from the clipboard and copy it into the buffer pointed to by Buffer. GetTextBuf copies up to the number of characters given by BufSize and returns the number of characters copied.

The resulting text in Buffer is a null-terminated string.


TClipboard.HasFormat

TClipboard 	See also	Example

Indicates whether the clipboard contains data in a specified format.

procedure HasFormat(Format: Word): Boolean;

Description

Use HasFormat to find out whether the clipboard contains data encoded in a specific format. HasFormat returns True if the format is present and False otherwise. TClipboard keeps a list of available formats in the Formats array property.

Some of the possible values of the Format parameter follow. HasFormat supports additional formats provided by Windows or by other applications as well as custom formats registered with TPicture.RegisterClipboardFormat.

Value	Meaning

CF_TEXT	Text with a CR-LF combination at the end of each line. A null character identifies the end of the text.

CF_BITMAP	A Windows bitmap graphic.

CF_METAFILEPICT	A Windows metafile graphic.

CF_PICTURE	An object of type TPicture.

CF_COMPONENT	Any persistent object.


TClipboard.Open
Clipboard.Open

TClipboard	See also 	Example

Opens the clipboard, preventing other applications from changing its contents until the clipboard is closed.

procedure Open;

Description

Call Open before adding a series of items to the clipboard. This prevents other applications from overwriting the clipboard until it is closed. (When adding a single item to the clipboard, there is no need to call Open.)

When an application has finished adding items to the clipboard, it should call the Close method. The clipboard can be opened with multiple calls to the Open method before being closed. Open and Close maintain a count of the number of times the clipboard has been opened and will not close it until Close has been called the same number of times.


TClipboard.SetAsHandle

TClipboard 	See also	Example

Places data represented by a specified handle on the clipboard.

procedure SetAsHandle (Format: Word; Value: THandle);

Description

SetAsHandle writes data represented by the specified handle (Value) to the clipboard using the specified format.

Do not delete a handle after passing it to SetAsHandle. The handle belongs to the clipboard, which will free it.

The Format parameter can specify any of the formats listed under the HasFormat method. Applications can also define and register their own formats. See the Windows API Help for more information.


TClipboard.SetComponent

TClipboard	See also 	Example

Copies a component to the clipboard.

procedure SetComponent(Component: TComponent);

Description

Use SetComponent to copy a component to the clipboard.


TClipboard.SetTextBuf
Clipboard.SetTextBuf

TClipboard	See also

Writes a text buffer to the Clipboard.

procedure SetTextBuf(Buffer: PChar);

Description

Use SetTextBuf to copy text to the clipboard from a buffer. Buffer must point to a null-terminated string.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TComponentList

Hierarchy	Properties	Methods	See also

TComponentList maintains a list of components, updating itself when a component is freed.

Unit

contnrs

Description

Use a TComponentList to store and maintain a list of components. TComponentList provides properties and methods to add, delete, rearrange, locate, access, and sort components. Like TObject List, TComponentList controls the memory of its components; unless the OwnsObjects property is set to False (or the components are removed with the Extract method), TComponentList frees its components when they are removed from the list or when the TComponentList instance is itself destroyed.

In addition, TComponentList tracks its components. Whenever a component is freed, TComponentList automatically updates itself by deleting the reference to the freed component and packing the list.


TComponentList properties

TComponentList	Alphabetically	Legend

In TComponentList

Items

Derived from TObjectList

OwnsObjects

Derived from TList

Capacity

Count

List


TComponentList properties

TComponentList	By object	Legend

Capacity

Count

Items

List

OwnsObjects


TComponentList.Items

TComponentList	See also

Lists the component references.

property Items[Index: Integer]: TComponent; default;

Description

Use Items to access components in the list. Items is a zero-based array: The first component is indexed as 0, the second component is indexed as 1, and so forth. You can read or change the value at a specific index, or use Items with the Count property to iterate through the list.

If OwnsObjects is True, reassigning an Items index frees the component that previously occupied that position in the list.

Items can contain nil references. To remove nil references and reduce the size of the array, call the Pack method.


TComponentList methods

TComponentList	Alphabetically

In TComponentList

Add

Destroy

IndexOf

Insert

Remove

Derived from TObjectList

Clear

Create

Delete

Extract

FindInstanceOf

Derived from TList

Error

Exchange

Expand

First

Last

Move

Pack

Sort

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TComponentList methods

TComponentList	By object

Add

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

Error

Exchange

Expand

Extract

FieldAddress

FindInstanceOf

First

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

IndexOf

InheritsFrom

InitInstance

Insert

InstanceSize

Last

MethodAddress

MethodName

Move

NewInstance

Pack

Remove

SafeCallException

Sort


TComponentList.Destroy

TComponentList	See also

Destroys an instance of TComponentList.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead, call Free, which checks that the component list is not nil before calling Destroy.

Before destroying the TComponentList, Destroy calls Clear, which frees the components in the list if OwnsObjects is True.


TComponentList.Add

TComponentList	See also

Inserts a component at the end of the list.

function Add(AComponent: TComponent): Integer;

Description

Call Add to insert a component at the end of the list. Add places the component after the last item, even if the array contains nil references, and returns the index of the inserted component. (The first component in the list has an index of 0.)

Add increments Count and, if necessary, allocates memory by increasing the value of Capacity.


TComponentList.IndexOf

TComponentList	See also

Returns the index of the first component in the list with a specified value.

function IndexOf(AComponent: TComponent): Integer;

Description

Call IndexOf to get the index for a specified component in the list, where the first component has index 0, the second component has index 1, and so on. If a component is not in the list, IndexOf returns -1. If a component appears more than once, IndexOf returns the index of the first appearance.


TComponentList.Insert

TComponentList	See also

Adds a component to the list at a specified position.

procedure Insert(Index: Integer; AComponent: TComponent);

Call Insert to add a component at a specified position in the list, shifting the item that previously occupied that position (and all subsequent items) up. Insert increments Count and, if necessary, allocates memory by increasing the value of Capacity.

The Index parameter is zero-based, so the first position in the list has an index of 0.

To replace a nil reference with a new component without growing the array, set the Items property directly.


TComponentList.Remove

TComponentList	See also

Removes a specified component from the list and (if OwnsObject is True) frees the component.

function Remove(AComponent: TComponent): Integer;

Call Remove to delete a specific component from the list when its index is unknown. The value returned is the index of the component in the Items array before it was removed. If the specified component is not found on the list, Remove returns –1. If OwnsObjects is True, Remove frees the component in addition to removing it from the list.

After a component is deleted, all the components that follow it are moved up in index position and Count is decremented. If a component appears more than once on the list, Remove deletes only the first appearance. Hence, if OwnsObjects is True, removing a component that appears more than once results in empty references later in the list.

To use an index position (rather than an object reference) to specify the component to be removed, call Delete.

To remove a component from the list without freeing it, call Extract.


Accessibility

Read-only


Hierarchy

TObject

TList

TObjectList


TComponent

Hierarchy	Properties	Methods	See also

TComponent is the common ancestor of all VCL components

Unit

classes

Description

VCL components are persistent objects that have the following capabilities:

The ability to appear on Component palette and be manipulated in the form designer.

The ability to own and manage other components.

Enhanced streaming and filing capabilities.

The ability to be converted into an ActiveX control or other COM object by Wizards on the ActiveX page of the New Objects dialog.

Do not create instances of TComponent. Use TComponent as a base class when declaring non-visual components that can appear on the component palette and be used in the form designer. Properties and methods of TComponent provide basic behavior that descendant classes inherit as well as behavior that components can override to customize their behavior.

To create components which are visible to users at runtime, use TControl or its descendants as a base. To create visual windowed controls use TWinControl or its descendants as a base.


TComponent properties

TComponent	Alphabetically	Legend

In TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TComponent properties

TComponent	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TComponent.ComObject

TComponent	See also

Specifies the interface reference implemented by the component.

property ComObject: IUnknown;

Description

Use ComObject to assign the interface implemented by a component to an interface reference. This property is used by VCL components that support COM interfaces.

If the component is not a wrapper for a COM component, trying to read ComObject causes TComponent to raise an EComponentError exception.


TComponent.ComponentCount

TComponent	See also 	Example

Indicates the number of components owned by the component.

property ComponentCount: Integer;

Description

Use ComponentCount to find or verify the number of components owned by a component, or when iterating through the Components list to perform some action on all owned components. ComponentCount is used internally for such iterative procedures.

Note:	The ComponentCount of a component contains the same number of items as in the Components list for that component, and is always 1 more than the highest Components index, because the first Components index is always 0.


TComponent.ComponentIndex

TComponent	See also

Indicates the position of the component in its owner's Components property array.

property ComponentIndex: Integer;

Description

Use ComponentIndex when iterating through the Components list of the component’s owner to perform some action on owned components. It can be used in conjunction with ComponentCount. ComponentIndex is used internally for iterative assignment procedures.

Note:	The first component in the list has a ComponentIndex value of 0, the second has a value of 1, and so on. Therefore, when using ComponentIndex with ComponentCount, note that ComponentCount is always 1 more than the highest Components index.


TComponent.Components

TComponent	See also 	Example

Lists all components owned by the component.

property Components[Index: Integer]: TComponent;

Description

Use Components to access any of the components owned by this component, such as the components owned by a form. The Components property is most useful when referring to owned components by number rather than name. It is also used internally for iterative processing of all owned components.

Note:	For convenience use Components with ComponentCount for iterative processing. However, be aware that while the ComponentCount of a component contains the same number of items as in the Components list for that component, ComponentCount is always 1 more than the highest Components index, because the first Components index is always 0.


TComponent.ComponentState

TComponent	See also

Describes the current state of the component, indicating when a component needs to avoid certain actions.

type TComponentState = set of (csLoading, csReading, csWriting, csDestroying, csDesigning, csAncestor, csUpdating, csFixups, csFreeNotification, csInline);

property ComponentState: TComponentState;

Description

Components use the ComponentState property to detect states in which certain kinds of actions are allowed or disallowed. For example, if a component needs to avoid certain behaviors at design time that it will perform at runtime, it can check for the csDesigning flag. ComponentState is read-only and its flags are set automatically when appropriate.

The TComponentState type defines the set of possible state flags for the ComponentState property. The following table lists the possible values for the TComponentState type and the meaning corresponding to each flag:

Flag	Component state

csAncestor	The component was introduced in an ancestor form. Only set if csDesigning is also set.

csDesigning	The component is in a form being manipulated by the form designer.

csDestroying	The component is about to be destroyed.

csFixups	The component is linked to a component in another form that has not yet been loaded. This flag is cleared when all pending fixups are resolved.

csFreeNotification	The component has sent a notification that it is being destroyed to other forms but has not yet been destroyed.

csInline	The component is a top-level component that can be modified at design time and also embedded in a form. This flag is used to identify nested frames while loading and saving.

csLoading	A filer object is currently loading the component. This flag is set when the component is first created and not cleared until the component and all its children are fully loaded (when the Loaded method is called).

csReading	The component is reading its property values from a stream. Note that the csLoading flag is always set as well when csReading is set. That is, csReading is set for the subinterval of the time when a component is loading that covers reading in property values.

csUpdating	The component is being updated to reflect changes in an ancestor form. Only set if csAncestor is also set.

csWriting	The component is writing its property values to a stream.


TComponent.ComponentStyle

TComponent

Governs the behavior of the component.

type TComponentStyle = set of (csInheritable, csCheckPropAvail);

property ComponentStyle: TComponentStyle;

Description

ComponentStyle determines whether a component (and therefore the forms that contain it) is inheritable, and whether it needs to check its properties for readability. TComponent sets ComponentStyle to [csInheritable] in the constructor (Most of the standard components are inheritable).

The TComponentStyle type defines a set of values for the ComponentStyle property.

The csInheritable style indicates that descendant form types can inherit from the component. If any of the components in a form do not have the csInheritable style, the form cannot be used as the ancestor of an inherited form.

The csCheckPropAvail style indicates that a component needs to check its properties for readability. This is only used for COM controls, where the Object Inspector cannot tell directly that a property is readable, and therefore displayable. Native components do not use this style.


TComponent.DesignInfo

TComponent	See also

Contains information used by the Form designer.

property DesignInfo: Longint;

Description

DesignInfo is used internally. Do not use this property in applications.


TComponent.Name

TComponent	See also 	Example

Specifies the name of the component as referenced in code.

property Name: TComponentName;

Description

Use Name to change the name of a component to reflect its purpose in the current application. By default, Delphi assigns sequential names based on the type of the component, such as 'Button1', 'Button2', and so on.

Use Name to refer to the component in code.


TComponent.Owner

TComponent	See also

Indicates the component that is responsible for freeing this component.

property Owner: TComponent;

Description

Use Owner to find the owner of a component. When one component owns another, the memory for the owned component is freed when its owner's memory is freed. This means that when a form is destroyed, all the components on the form are also destroyed.

By default, a form owns all components that are on it. In turn, the form is owned by the application. Thus when the application shuts down and its memory is freed, the memory for all forms (and all their owned components) is also freed.

The owner of a component is determined by the parameter passed to the constructor when the component is created. For components created in the form designer, the form is automatically assigned as the owner.


TComponent.Tag

TComponent	Example

Stores an integer value as part of a component.

property Tag: Longint;

Description

Tag has no predefined meaning. The Tag property is provided for the convenience of developers. It can be used for storing an additional integer value or it can be typecast to any 32-bit value such as a component reference or a pointer.


TComponent.VCLComObject

TComponent	See also

Represents information used internally by components that support COM.

property VCLComObject: Pointer;

Description

VCLComObject is for internal use only. To access the interfaces implemented by a VCL COM component, use the ComObject property instead.


TComponent methods

TComponent	Alphabetically	Legend

In TComponent

_AddRef

_Release

ChangeName

Create

DefineProperties

Destroy

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetChildOwner

GetChildParent

GetChildren

GetIDsOfNames

GetNamePath

GetOwner

GetParentComponent

GetTypeInfo

GetTypeInfoCount

HasParent

InsertComponent

Invoke

Loaded

Notification

QueryInterface

ReadState

RemoveComponent

SafeCallException

SetAncestor

SetChildOrder

SetDesigning

SetInline

SetName

SetParentComponent

UpdateAction

Updated

UpdateRegistry

Updating

ValidateContainer

ValidateInsert

ValidateRename

WriteState

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TComponent methods

TComponent	By object	Legend

_AddRef

_Release

AfterConstruction

Assign

BeforeDestruction

ChangeName

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

DefineProperties

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetChildOwner

GetChildParent

GetChildren

GetIDsOfNames

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetOwner

GetParentComponent

GetTypeInfo

GetTypeInfoCount

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invoke

Loaded

MethodAddress

MethodName

NewInstance

Notification

QueryInterface

ReadState

RemoveComponent

SafeCallException

SetAncestor

SetChildOrder

SetDesigning

SetInline

SetName

SetParentComponent

UpdateAction

Updated

UpdateRegistry

Updating

ValidateContainer

ValidateInsert

ValidateRename

WriteState


TComponent.ChangeName

TComponent	See also

Sets the private, internal storage for the Name property to the string passed in NewName.

procedure ChangeName(const NewName: TComponentName);

Description

Do not use ChangeName directly in an application.  Instead, use the Name property.

Note:	The property setter for Name, SetName, uses ChangeName to change the component's name. ChangeName is not virtual; do not override it.


TComponent.Create

TComponent	See also

Allocates memory and constructs a safely initialized instance of a component.

constructor Create(AOwner: TComponent); virtual;

Description

All objects have a Create method that constructs the object. TComponent redefines Create so that, for components, Create also:

establishes the relationship of a component and its Owner, as indicated by the AOwner parameter

sets the ComponentStyle property to csInheritable, meaning that the component can be inherited by a descendant form type

It is not necessary to explicitly create components added in the form designer. These components are created automatically when the application is run, and they are destroyed when the application is closed.

For components created programmatically, that is, not created in the form designer, call Create and pass in an owner components the AOwner parameter. The owner disposes of the component when it is destroyed. If the component is not owned, then use Free when it needs to be destroyed.

Tip:	When passing in Self as the Owner parameter, consider what Self references. If a component creates another component in one of its methods, then Self refers to the first component and not the component being created, which is then owned by the first component.

Note:	TComponent.Create is virtual in part to allow polymorphic instantiation of class references. This is critical to the streaming system and to the form designer. Do not forget to use the override directive when declaring a new component’s Create constructor.


TComponent.DefineProperties

TComponent	See also	Example

Designates methods for storing an object's unpublished data on a stream such as a form file.

procedure DefineProperties(Filer: TFiler); override;

Description

TComponent overrides the DefineProperties method defined in TPersistent to define "fake" Top and Left properties. These are defined so that components that are not controls can be manipulated at design-time. However, the Top and Left properties are hidden, that is, they are not published, because only controls appear at run-time.

DefineProperties is virtual; descendant classes can override it. When overriding DefineProperties, be aware that the Ancestor property of Filer might be set, and that this property can determine whether or not it is appropriate to write properties.

DefineProperties is called automatically as part of the component streaming system; do not call it directly.


TComponent.Destroy

TComponent	See also

Disposes of the component and its owned components.

destructor Destroy; override;

Description

Do not call Destroy directly. Call Free instead.  Free verifies that the component is not nil, and only then calls Destroy.

Before freeing the instance of the component, Destroy sends out an opRemove notification so that any other component with dependencies on the component can make appropriate adjustments.  Destroy then frees all components that it owns (all components listed in the Components property).  Finally it removes the Component from the Components property of its Owner and frees the memory allocated to the component.

Never explicitly free a component in one of its own event handlers, nor free a component from the event handler of a component that it owns or contains.

To destroy a form, call its Release method. Release waits for all the form’s event handlers and the event handlers of the form’s components to finish executing before destroying the form.

Note:	A form owns all the controls and non-visual components that are placed on it in design mode. When it is freed, all of these components are automatically freed as well. By default, all forms are owned by the global Application object. When an application terminates, it frees the global Application object, which frees all forms. For objects that are not components, and for components created with a nil owner, be sure to call Free after finishing with the object; otherwise the memory allocated for the object will be lost until the application terminates.


TComponent.DestroyComponents

TComponent	See also

Destroys all owned components.

procedure DestroyComponents;

Description

DestroyComponents iterates through the components owned by the component, removing each from the list of owned components and destroying it.

It is not necessary to call DestroyComponents directly. DestroyComponents is automatically called in the destructor sequence that begins with a call to Free and ends with the object destroying itself.


TComponent.Destroying

TComponent	See also

Indicates that the component and its owned components are about to be destroyed.

procedure Destroying;

Description

Destroying sets the csDestroying flag in the ComponentState property.  It then calls the Destroying method for each owned component so that their csDestroying flags are also set. If csDestroying is already set, Destroying does nothing.

It is not necessary to call Destroying directly. Destroying is automatically called in the destructor sequence that begins with a call to Free and ends with the object destroying itself.


TComponent.ExecuteAction

TComponent	See also

Invokes an action with the component as its target.

function ExecuteAction(Action: TBasicAction): Boolean; dynamic;

Description

When the user invokes an action, Delphi makes a series of calls to respond to that action. First, it generates an OnExecute event of the action list that contains the action. If the action list does not handle the OnExecute event, then the action is routed to the Application object’s ExecuteAction method, which invokes the OnActionExecute event handler. If the OnActionExecute event handler does not handle the action, then it is routed to the action’s OnExecute event handler. If that does not handle the action, the active control’s ExecuteAction method is called.

The Action parameter specifies the action that was invoked. ExecuteAction returns True if the action was successfully dispatched, and False if the component could not handle the action. If ExecuteAction returns False for the active component, Delphi calls the active form’s ExecuteAction method.

ExecuteAction checks whether the action component knows how to perform its function with the component as a target, and if so, executes the action and returns True. Otherwise, ExecuteAction returns False.

Descendants override ExecuteAction to interpret actions in a class-specific manner and change the default behavior of the action when it specifies the descendant class as a target.


TComponent.FindComponent

TComponent	See also	Example

Indicates whether a given component is owned by the component.

function FindComponent(const AName: string): TComponent;

Description

FindComponent returns the component in the Components property array with the name that matches the string in the AName parameter. Use FindComponent to determine whether a given component is owned by another.


TComponent.FreeNotification

TComponent	See also

Ensures that AComponent is notified that the component is going to be destroyed.

procedure FreeNotification(AComponent: TComponent);

Description

Use FreeNotification when a component in a different form is assigned to a property of the component.

FreeNotification must be called for components in other forms that have references to the component. For components in the same form as the component, the Notification method is called automatically.


TComponent.FreeOnRelease

TComponent

Frees the interface reference for components that were created from COM classes.

procedure FreeOnRelease;

Description

FreeOnRelease is called when an interface implemented by the component is released. FreeOnRelease is used internally and calls the corresponding interface method. It should not be necessary to call FreeOnRelease directly.


TComponent.GetChildOwner

TComponent	See also

Returns the owner of a child component being read from a stream.

function GetChildOwner: TComponent; dynamic;

Description

GetChildOwner is used internally by the component streaming system. It is rarely necessary to call it directly.

In TComponent, GetChildOwner always returns nil, indicating that the owner is the root component currently being read (usually a form or data module). The Owner of a component is responsible for destroying it.


TComponent.GetChildParent

TComponent	See also

Returns the parent, or if there is no parent, returns the owner of a child component being read from a stream.

function GetChildParent: TComponent; dynamic;

Description

GetChildParent is used internally in the component streaming system. It is not necessary to call it directly.

As implemented in TComponent, GetChildParent returns Self. If GetChildParent returns nil, the parent is assumed to be the root component currently being read (usually a form).


TComponent.GetChildren

TComponent	See also

Provides the interface for a method that windowed controls use to return their child components.

procedure GetChildren(Proc: TGetChildProc; Root: TComponent); dynamic;

Description

GetChildren is introduced in TComponent for the streaming system that loads and saves VCL components. Descendant classes override GetChildren to execute the callback specified by Proc for each of their "child" components; that is, components that return this component from their GetParentComponent method.

Root specifies the top-level component (such as a form or data module) that is currently being loaded or saved. Proc is a callback that loads or saves the child component.


TComponent.GetIDsOfNames

TComponent	See also

Maps a single member and an optional set of argument names to a corresponding set of integer dispatch identifiers (dispIDs).

type HResult = Longint;

function GetIDsOfNames(const IID: TGUID; Names: Pointer; NameCount, LocaleID: Integer; DispIDs: Pointer): HResult; stdcall;

Description

GetIDsOfNames implements the IDispatch interface GetIDsOfNames method. For components that support interfaces, GetIDsOfNames calls this method for the interface supported by the component, passing the specified parameters. The returned value can be used on subsequent calls to the Invoke method.


TComponent.GetNamePath

TComponent	See also

Returns a string used by the Object Inspector.

function GetNamePath: string; override;

Description

GetNamePath is used to determine the text to display in the Object Inspector for the name of the object being edited. GetNamePath is introduced in TPersistent so descendants such as collections can appear in the Object Inspector. TComponent overrides GetNamePath to return the component’s name. Do not call GetNamePath directly.


TComponent.GetOwner

TComponent	See also

Returns the owner of a component.

function GetOwner: TPersistent; override;

Description

GetOwner is called by GetNamePath to find the owner of a component. GetNamePath and GetOwner are introduced in TPersistent so descendants such as collections can appear in the Object Inspector. For TComponent, GetOwner returns the value of the Owner property.


TComponent.GetParentComponent

TComponent	See also

Returns the parent of a component.

function GetParentComponent: TComponent; dynamic;

Description

The GetParentComponent method is introduced in TComponent for the streaming system that loads and saves VCL components. As implemented in TComponent, GetParentComponent always returns nil. Descendant classes can override GetParentComponent to return an appropriate parent component.

Note:	Do not confuse a component’s parent, which is responsible for writing the component to a stream, with the component’s owner, which is responsible for freeing the component.


TComponent.GetTypeInfo

TComponent	See also

Retrieves the type information for an object.

type HResult = Longint;

function GetTypeInfo(Index, LocaleID: Integer; out TypeInfo): HResult; stdcall;

Description

GetTypeInfo implements the IDispatch interface GetTypeInfo method. For components that support interfaces, GetTypeInfo calls the GetTypeInfo method for the interface supported by the component, passing it the specified parameters.  Use the returned value to get the type information for an interface implemented by the component.


TComponent.GetTypeInfoCount

TComponent	See also

Returns the number of type information interfaces that an object provides (either 0 or 1).

type HResult = Longint;

function GetTypeInfoCount(out Count: Integer): HResult; stdcall;

Description

GetTypeInfoCount implements the IDispatch interface GetTypeInfoCount method. For components that support interfaces, GetTypeInfoCount calls this method for the interface supported by the component. The out parameter points to a location that receives the number of type information interfaces provided by the object. If the object provides type information, this number is 1; otherwise the number is 0.


TComponent.HasParent

TComponent	See also

Indicates whether the component has a parent to handle its filing.

function HasParent: Boolean; dynamic;

Description

HasParent is introduced in TComponent for the streaming system that loads and saves VCL components. It returns False for TComponent.

A return value of True indicates that some other object (a parent) is responsible for writing the object to a stream. Most commonly the parent is a form or panel that contains a control.

Any child component that returns True from HasParent must also implement the GetParentComponent and SetParentComponent methods.

Note:	Do not confuse a component’s parent, which is responsible for writing the component to a stream, with the component’s owner, which is responsible for freeing the component.


TComponent.InsertComponent

TComponent	See also 	Example

Establishes the component as the owner of a specified component.

procedure InsertComponent(AComponent: TComponent);

Description

InsertComponent adds the component passed in the AComponent parameter to the end of the Components array property. The inserted component must have no name (no specified Name property value), or the name must be unique among all others in the Components list.

When the owning component is destroyed, AComponent is destroyed also.

Components are automatically inserted and removed when visually manipulating them in the form designer. Use InsertComponent when manually adding components to another Owner component’s Components list.


TComponent.Invoke

TComponent	See also

Provides access to Automation properties and methods exposed by an object that supports the IDispatch interface.

type HResult = Longint;

function Invoke(DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult; stdcall;

Description

Invoke implements the IDispatch interface Invoke method. Invoke is the standard mechanism for accessing the exposed properties and methods of an Automation object. For components that support interfaces, Invoke calls the Invoke method for the interface supported by the component, passing it the parameters specified by the function.


TComponent.Loaded

TComponent	See also

Clears the csLoading flag in the ComponentState property indicating that the component has been loaded from a stream.

procedure Loaded; virtual;

Description

Loaded allows a component to initialize itself after all its parts have been loaded from a stream.

When a Delphi application loads a form from its form file, it first constructs the form component by calling its constructor, then reading its property values from the form file. After reading all the property values for all the components, Delphi calls the Loaded methods of each component in the order the components were created. This gives the components a chance to initialize any data that depends on the values of other components or other parts of itself.

Note:	All references to sibling components are resolved by the time Loaded is called. Loaded is the first place that sibling pointers can be used after being streamed in.

Warning:	Loaded may be called multiple times on inherited forms. It is called every time a level of inheritance is streamed in. Do not allocate memory in an overridden Loaded method without first checking that the memory has not been allocated in a previous call.


TComponent.Notification

TComponent	See also

Forwards notification messages to all owned components.

procedure Notification(AComponent: TComponent; Operation: TOperation); virtual;

Description

Do not call the Notification method in an application.  Notification is called automatically when the component specified by AComponent is about to be inserted or removed, as specified by Operation. By default, components pass along the notification to their owned components, if any.

A component can, if needed, act on the notification that a component is being inserted or removed. For example, if a component has object fields or properties that contain references to other components, it can check the notifications of component removals and invalidate those references as needed.


TComponent.QueryInterface

TComponent	See also

Returns a reference to a specified interface if that interface is supported by the object.

type HResult = Longint;

function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall;

Description

For components that support interfaces, QueryInterface calls the QueryInterface method of the interface supported by the component. QueryInterface returns a reference to the interface specified by the IID parameter, as the Obj parameter. If the component does not support the interface, the Obj parameter returns nil.


TComponent.ReadState

TComponent	See also

Reads the component’s data from a stream.

procedure ReadState(Reader: TReader); virtual;

Description

ReadState is part of a sequence of calls used by the streaming system that loads and saves VCL components.  It reads the values of all the component's published properties, stored data, and owned components from the reader object passed in Reader. Do not call ReadState directly.

Although ReadState is virtual, it is rarely overridden. Any descendant classes overriding ReadState should end with a call to the inherited ReadState method of TComponent.


TComponent.RemoveComponent

TComponent	See also 	Example

Removes a specified component specified from the component's Components list.

procedure RemoveComponent(AComponent: TComponent);

Description

Components are automatically inserted and removed when visually manipulating them in the form designer. Use RemoveComponent to programmatically delete the component specified by AComponent from its Owner component.


TComponent.SafeCallException

TComponent	See also

Handles COM exceptions.

type HResult = Longint;

function SafeCallException(ExceptObject: TObject; ExceptAddr: Pointer): HResult; override;

Description

SafeCallException is used for COM exception handling support. Classes that implement COM interfaces override this method to handle errors that might occur. TComponent calls the implementation of this method for the interface supported by the component, if it exists. If the component does not support interfaces, this method calls the SafeCallException method inherited from TObject, which returns E_UNEXPECTED. This is a default return value that is appropriate for classes that do not support any interfaces.


TComponent.SetAncestor

TComponent	See also

Sets or clears the ComponentState property’s csAncestor flag.

procedure SetAncestor(Value: Boolean);

Description

SetAncestor is used internally by the streaming system that loads and saves VCL components. Do not call SetAncestor directly.

SetAncestor sets or clears the csAncestor flag which indicates whether the component was introduced in an ancestor form. SetAncestor then calls the SetAncestor methods of any owned components, passing Value, so that the owned components' ComponentState properties will be synchronized with the owner's.


TComponent.SetChildOrder

TComponent	See also

Provides the interface for a method to rearrange child components.

procedure SetChildOrder(Child: TComponent; Order: Integer); dynamic;

Description

SetChildOrder is introduced in TComponent for the streaming system that loads and saves VCL components. As implemented in TComponent, SetChildOrder does nothing. Descendant classes override SetChildOrder to change the order in which a child appears list returned by GetChildren.


TComponent.SetDesigning

TComponent	See also

Ensures that components inserted at design time have their design-mode flag set.

procedure SetDesigning(Value: Boolean; SetChildren: Boolean=True);

Description

SetDesigning is used internally by the Form designer. Do not call SetDesigning directly.

SetDesigning sets the csDesigning flag in the ComponentState property if Value is True; otherwise, it removes csDesigning.

If the SetChildren parameter is True, SetDesigning then calls the SetDesigning methods of any owned components, passing Value, so that the owned components' ComponentState properties are synchronized with the owner's.

The InsertComponent and RemoveComponent methods call SetDesigning for inserted or removed components to ensure that their design-mode flags are set properly.


TComponent.SetInline

TComponent	See also

Sets the csInline bit of the component’s ComponentState property

procedure SetInline(Value: Boolean);

Description

SetInline is used internally to indicate whether the component can act as a root component in the designer but also be embedded in a form.

SetInline sets the csInline flag in the ComponentState property if Value is True; otherwise, it removes csInline.


TComponent.SetName

TComponent	See also

Sets the value of the Name property.

procedure SetName(const NewName: TComponentName); virtual;

Description

SetName is the virtual property setter for the Name property. It calls the ChangeName method, which performs the actual name change.

ChangeName is not virtual; override SetName instead when modifying the behavior of the Name property.


TComponent.SetParentComponent

TComponent	See also

Provides the interface for a method that changes the parent of a component.

procedure SetParentComponent(Value: TComponent); dynamic;

Description

SetParentComponent is introduced in TComponent for the streaming system that loads and saves VCL components. SetParentComponent does nothing in TComponent. Descendant classes override SetParentComponent to change the value that GetParentComponent returns to match the Value parameter.


TComponent.UpdateAction

TComponent	See also

Updates an action component to reflect the current state of the component.

function UpdateAction(Action: TBasicAction): Boolean; dynamic;

Description

When the application is idle, Delphi makes a series of calls to update the properties (such as whether it is enabled, checked, and so on) of every action that is linked to a visible control or menu item. First, Delphi generates an OnUpdate event of the action list that contains the action. If the action list does not handle the OnUpdate event, then the action is routed to the Application object’s UpdateAction method, which invokes the OnActionUpdate event handler. If the OnActionUpdate event handler does not update the action, then it is routed to the action’s OnUpdate event handler. If that does not update the action, the active control’s UpdateAction method is called.

The Action parameter specifies the action component that should be updated. UpdateAction returns True if the action component now reflects the state of the component, and False if it did not know how to update the action. If UpdateAction returns False for the active component, Delphi calls the active form’s UpdateAction method.

Do not call UpdateAction. It is called automatically when the application is idle. As implemented in TComponent, UpdateAction allows the action to update itself with the component as a target. Descendants can override this method to perform updates that reflect class-specific properties or states.


TComponent.Updated

TComponent	See also

Clears the csUpdating state in the component's ComponentState property when the component finishes updating.

procedure Updated; dynamic;

Description

Do not call Updated directly. It is used internally to clear the csUpdating flag of the ComponentState property. A call to Updated always follows a call to Updating, which sets the flag.


TComponent.UpdateRegistry

TComponent

Provides the interface for a method that adds type library and version information to the Registry on components that implement COM interfaces.

class procedure UpdateRegistry(Register: Boolean; const ClassID, ProgID: string); virtual;

Description

Do not call UpdateRegistry directly. It is for internal use only.


TComponent.Updating

TComponent	See also

Sets the csUpdating state in the component's ComponentState property.

procedure Updating; dynamic;

Description

Do not call Updating directly. It is used internally to indicate that the component is about to be updated. A call to Updating, which sets the csUpdating flag, is always followed by a call to Updated, which clears the flag.


TComponent.ValidateContainer

TComponent	See also

Determines whether an object can be inserted into a container.

procedure ValidateContainer(AComponent: TComponent); dynamic;

Description

ValidateContainer is called by a component when it is about to be inserted into a container object. By default, ValidateContainer calls the ValidateInsert method of the component specified by the AComponent parameter.

Descendant components can override ValidateContainer to disallow a component from being inserted into specific containers. To disallow an insertion, raise an exception in the derived method.


TComponent.ValidateInsert

TComponent	See also

Provides the interface for a method that validates an child component before it is inserted.

procedure ValidateInsert(AComponent: TComponent); dynamic;

Description

ValidateInsert does nothing in TComponent. Descendant classes can override it to disallow a component from accepting an object as a child. By default ValidateInsert allows any object to be inserted into the component.

If a component needs to validate only certain objects, descendant classes can override ValidateInsert to filter out those objects.  To disallow an insertion, raise an exception in the derived method.


TComponent.ValidateRename

TComponent	See also

Ensures that renaming an owned component does not create name conflict.

procedure ValidateRename(AComponent: TComponent; const CurName, NewName: string); virtual;

Description

ValidateRename checks to see if a component can rename one of its owned components, passed in AComponent, from its current name (CurName) to the string passed in NewName. If AComponent is nil or NewName is already the name of a component in the Components list, ValidateRename raises an EComponentError exception.

ValidateRename is used internally when the Name property is modified. It is not necessary to call it directly.


TComponent.WriteState

TComponent	See also

Writes the component’s data to a stream.

procedure WriteState(Writer: TWriter); virtual;

Description

WriteState is part of a sequence of calls used by the streaming system that loads and saves VCL components. WriteState is an iterative method that writes the values of all the component's published properties and other stored data to the Writer component passed as the Writer parameter. Do not call WriteState directly.

Although WriteState is virtual, it is rarely overridden. Any descendant classes overriding WriteState should end with a call to the inherited WriteState method of TComponent.


TComponent._AddRef

TComponent	See also

Increments the reference count for the number of interface references dependent on the component.

function _AddRef: Integer; stdcall;

Description

_AddRef implements the IUnknown interface method, AddRef, defined by COM. For components that support interfaces, _AddRef calls the AddRef method for the interface supported by the component. _AddRef returns the resulting value of the reference count for the component.


TComponent._Release

TComponent	See also

Decrements the reference count for the calling interface on a object.

function _Release: Integer; stdcall;

Description

_Release implements the IUnknown interface method, Release, defined by COM. For components that support interfaces, _Release calls the Release method for the interface supported by the component. If the reference count on the object falls to 0, the object is freed from memory.

_Release returns the resulting value of the reference count for the component.


Scope

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent


TContainedAction

Hierarchy	Properties	Methods	Events

TContainedAction is the base class for actions that can be grouped by category and that can appear in action lists.

Unit

ActnList

Description

TContainedAction introduces properties and methods that enable actions to appear in an action list. The properties of TContainedAction contain information about the relationship between the action and its action list. Methods of TContainedAction override those of the base class to include the action’s action list. Objects of type TContainedAction can be associated with a category of action types, as displayed in the action list component.


TContainedAction properties

TContainedAction	Alphabetically	Legend

In TContainedAction

ActionList

Category

Index

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TContainedAction properties

TContainedAction	By object	Legend

ActionList

Category

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Index

Name

Owner

Tag

VCLComObject


TContainedAction.ActionList

TContainedAction	See also

Refers to the action list that contains the action.

property ActionList: TCustomActionList;

Description

ActionList indicates which action list component contains the action. Only contained actions (instances of TContainedAction or its descendants) can appear in an action list. An action list provides a visual interface for working with actions. The action’s properties are accessible in the Object Inspector by double-clicking on the action list and selecting the action from its category.


TContainedAction.Category

TContainedAction	See also

Contains the category in which the action appears in the action list.

property Category: string;

Description

Category is the group, or category, of which the action is a part. Category appears as a heading for a column in the action list editor. Actions are categorically grouped by similarities, usually of behavior or functionality. At design-time you can modify or set a Category for an action by selecting the action from the action list, and choosing Category in the Object Inspector.


TContainedAction.Index

TContainedAction	See also

Holds the index of the action in the action list.

property Index: Integer;

Description

Index contains the indexed value that indicates the location of the action in the action list. You can change the location of an action in its list by using either the up and down arrows on either the toolbar or the speed menu of the action list editor.


TContainedAction events

TContainedAction	Alphabetically

Derived from TBasicAction

OnExecute

OnUpdate


TContainedAction events

TContainedAction	By object

OnExecute

OnUpdate


TContainedAction methods

TContainedAction	Alphabetically

In TContainedAction

Destroy

Execute

GetParentComponent

HasParent

Update

Derived from TBasicAction

Create

ExecuteTarget

HandlesTarget

RegisterChanges

UnRegisterChanges

UpdateTarget

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TContainedAction methods

TContainedAction	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Execute

ExecuteAction

ExecuteTarget

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HandlesTarget

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RegisterChanges

RemoveComponent

SafeCallException

UnRegisterChanges

Update

UpdateAction

UpdateTarget


TContainedAction.Destroy

TContainedAction	See also

Destroys the instance of the contained action.

destructor Destroy; override;

Description

If the action is contained in an action list, Destroy removes the action from that list. Then it calls the inherited Destroy.


TContainedAction.Execute

TContainedAction	See also

Indicates whether an OnExecute event handler was called.

function Execute: Boolean; override;

Description

Execute indicates whether an OnExecute event handler was called. If the action’s event handler is assigned, it is called, otherwise the action list’s event handler is called. If neither has an assigned handler for the OnExecute event, Execute delegates to the Application to execute an associated handler for the event. Execute returns True if an event handler is called.

If no OnExecute event handler is found for this action in either the action object, the action list, or the application, Execute returns false and disables the particular action for that target.


TContainedAction.GetParentComponent

TContainedAction	See also

Returns the action list that contains the action.

function GetParentComponent: TComponent; override;

Description

GetParentComponent is called by the streaming system that loads and saves VCL components. It ensures that objects are loaded and saved with their parent objects. TContainedAction overrides the inherited method to identify its associated action list as its parent.


TContainedAction.HasParent

TContainedAction	See also

Indicates whether the action is contained in an action list.

function HasParent: Boolean; override;

Description

HasParent is called by the streaming system that loads and saves VCL components. It ensures that objects are loaded and saved with their parent objects. TContainedAction overrides the inherited method to return True if the action is contained in an action list.


TContainedAction.Update

TContainedAction	See also

Indicates whether an OnUpdate event handler was called.

function Update: Boolean; override;

Description

Update indicates whether an OnUpdate event handler was called. If the action’s event handler is assigned, it is called, otherwise the action list’s event handler is called. If neither has an assigned handler for the OnUpdate event, Execute delegates to the Application to execute an associated handler for the event. Execute returns True if an event handler is called.

If no OnUpdate event handler is found for this action in either the action object, the action list, or the application, Execute returns False and disables the particular action for that target.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TBasicAction


TCollection

Hierarchy	Properties	Methods	See also

TCollection is a container for TCollectionItem objects.

Unit

classes

Description

Each TCollection holds a group of TCollectionItem objects. TCollection maintains an index of the collection items in its Items array. The Count property contains the number of items in the collection. Use the Add and Clear methods to add items to the collection and delete items from the collection.

Objects descended from TCollection can contain objects descended from TCollectionItem. For example, a TDBGridColumns object contains TColumn objects; these two classes are used by TDBGrid to represent grid columns. The following table lists each descendant of TCollection with the corresponding descendant TCollectionItem and the component that uses each pair.

TCollection descendant	TCollectionItem  descendant	Component
TAggregates	TAggregate	TClientDataSet
TCheckConstraints	TCheckConstraint	controls that use TField
TCookieCollection	TCookie	HTTP response objects
TCoolBands	TCoolBand	TCoolBar
TDataBindings	TDataBindItem	data-aware ActiveX controls
TDBGridColumns	TColumn	TDBGrid
TDependencies	TDependency	TService
TDisplayDims	TDisplayDim	TDecisionGrid
TFieldDefs	TFieldDef	TDataSet
THeaderSections	THeaderSection	THeaderControl
TIndexDefs	TIndexDef	TTable
THTMLTableColumns	THTMLTableColumn	TQueryTableProducer
TListColumns	TListColumn	TListView
TParams	TParam	TQuery , TStoredProc, TClientDataSet
TParameters	TParameter	ADO datasets and commands
TServerCollection	TServerItem	TSimpleObjectBroker
TStatusPanels	TStatusPanel	TStatusBar
TWorkAreas	TWorkArea	TListView
TWebActionItems	TWebActionItem	TWebDispatcher
The controls that use TCollection and TCollectionItem descendants have a published property that holds a collection. (For example, the Panels property of TStatusBar holds a TStatusPanels.) A standard property editor, referred to generically as the Collection editor, can be invoked from the Object Inspector to edit the items in the collection.


TCollection properties

TCollection	Alphabetically	Legend

In TCollection

Count

ItemClass

Items


TCollection properties

TCollection	By object	Legend

Count

ItemClass

Items


TCollection.Count

TCollection	See also 	Example

Returns the number of items in the collection.

property Count: Integer;

Description

Count contains the number of items in the Items array. Since Items is indexed starting with 0, the value of Count is always one greater than the index of the last member of Items.


TCollection.ItemClasss
TCollection.ItemClass

TCollection	See also

Indicates the class to which the collection’s items belong.

type TCollectionItemClass = class of TCollectionItem;

property ItemClass: TCollectionItemClass;

Description

ItemClass returns the class (descended from TCollectionItem) to which the items in the collection belong. For example, in an instance of the TCollection descendant THeaderSections, the ItemClass property returns THeaderSection.


TCollection.Items

TCollection	See also

Provides indexed access to the items in the collection.

property Items[Index: Integer]: TCollectionItem;

Description

Use Items to access individual items in the collection. The value of the Index parameter corresponds to the Index property of TCollectionItem. It represents the position of the item in the collection.


TCollection methods

TCollection	Alphabetically

In TCollection

Add

Assign

BeginUpdate

Clear

Create

Delete

Destroy

EndUpdate

FindItemID

GetNamePath

Insert

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCollection methods

TCollection	By object

Add

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

FindItemID

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCollection.Add

TCollection	See also

Creates a new TCollectionItem instance and adds it to the Items array.

function Add: TCollectionItem;

Description

Call Add to create an item in the collection. The new item is placed at the end of the Items array.

Add returns the new collection item.


TCollection.Assign

TCollection	See also

Copies the contents of another collection to the object where the method is executed.

procedure Assign(Source: TPersistent); override;

Description

Use Assign to copy the contents of one TCollection instance to another. The Assign method deletes all items from the destination collection (the object where it is executed), then adds a copy of each item in the Source collection’s Items array.


TCollection.BeginUpdate

TCollection	See also 	Example

Suspends screen repainting.

procedure BeginUpdate; virtual;

Description

The BeginUpdate method suspends screen repainting until the EndUpdate method is called. Use BeginUpdate to speed processing and avoid flicker while items are added to or deleted from a collection.


TCollection.Clear

TCollection	See also

Deletes all items from the collection.

procedure Clear;

Description

Clear empties the Items array and destroys each TCollectionItem.


TCollection.Create

TCollection	See also

Creates and initializes a collection.

type TCollectionItemClass = class of TCollectionItem;

constructor Create(ItemClass: TCollectionItemClass);

Description

The Create method takes the name of a TCollectionItem descendant class as a parameter. This parameter determines the class of the items created by the Add method.


TCollection.Delete

TCollection	See also

Deletes a single item from the collection.

procedure Delete(Index: Integer);

Description

Delete removes the collection item specified by the Index parameter, where Index is the index of the item in the Items property array.


TCollection.Destroy

TCollection	See also

Destroys the collection and each item in it.

destructor Destroy; override;

Description

Destroy calls the Clear method to free each item referenced in the Items array, then destroys the collection itself.


TCollection.EndUpdate

TCollection	See also 	Example

Re-enables screen repainting.

procedure EndUpdate; virtual;

Description

Use EndUpdate to re-enable screen repainting that was turned off with the BeginUpdate method.


TCollection.FindItemID

TCollection	See also

Returns the item with the specified ID.

function FindItemID(ID: Integer): TCollectionItem;

Description

The FindItemID method returns the item in the collection whose ID property is passed to it as a parameter. If no item has the specified ID, FindItemID returns nilNULL.


TCollection.GetNamePath

TCollection	See also

Returns a string used by the Object Inspector.

function GetNamePath: string; override;

Description

If the collection has no owner, GetNamePath returns the name of the collection’s actual (runtime) type. If the collection is owned, GetNamePath returns the owner’s name followed, if applicable, by a dot and the name of the owner’s property that holds the collection. For example, GetNamePath might return “TreeView1.Items”.


TCollection.Insert

TCollection	See also

Creates a new TCollectionItem instance and adds it to the Items array.

function Insert(Index: Integer): TCollectionItem;

Description

Call Insert to add a new item at a specified position in the collection. Existing items (starting from the specified position) are moved up in the Items array.

Insert returns the new collection item.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TCollectionItem

Hierarchy	Properties	Methods	See also

TCollectionItem represents an item in a collection.

Unit

classes

Description

A TCollection holds a group of TCollectionItem objects. TCollectionItems are created and destroyed by TCollection’s Add and Clear methods. Each TCollectionItem has a Collection property that points to the TCollection object to which the item belongs.

Objects descended from TCollection can contain objects descended from TCollectionItem. For example, a TDBGridColumns object contains TColumn objects; these two classes are used by TDBGrid to represent grid columns. For a complete list of TCollection and TCollectionItem descendants, see TCollection.


TCollectionItem properties

TCollectionItem	Alphabetically	Legend

In TCollectionItem

Collection

DisplayName

ID

Index


TCollectionItem properties

TCollectionItem	By object	Legend

Collection

DisplayName

ID

Index


TCollectionItem.Collection

TCollectionItem

Specifies the TCollection instance to which the TCollectionItem belongs.

property Collection: TCollection;

Description

Each TCollectionItem belongs to the TCollection which creates it. The Collection property points to the collection object to which the item belongs.


TCollectionItem.DisplayName

TCollectionItem

The name displayed in the Collection editor.

property DisplayName: string;

Description

DisplayName is the string that represents the item in the Collection editor. When the item is selected in the Collection editor, the DisplayName can also appear in the Object Inspector as the value of another property (for example, as the Text property of THeaderSection or TStatusPanel). By default, DisplayName is the name of the TCollectionItem descendant class of which the item is an instance.


TCollectionItem.ID

TCollectionItem	See also

A unique, permanent index for the item.

property ID: Integer;

Description

In most cases, ID is the value of the item’s Index property when it was first added to the collection. But, unlike Index values, ID values are never changed or reassigned. If an item is removed from a collection, its ID not used again.

An item’s Index may change when other items are deleted from the collection or when items are rearranged. ID provides a unique identifier for each item that is unchanged for the life of the collection.


TCollectionItem.Index

TCollectionItem	See also

Returns the item’s position in the Items array of TCollection.

property Index: Integer;

Description

Each TCollectionItem is indexed in the Items array of the TCollection to which it belongs. The Index property of the TCollectionItem contains the item’s index value in that array.

Items is a zero-based array. The first member of the collection has an index value of 0, the second member has an index value of 1, and so forth.


TCollectionItem methods

TCollectionItem	Alphabetically

In TCollectionItem

Create

Destroy

GetNamePath

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCollectionItem methods

TCollectionItem	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCollectionItem.Create

TCollectionItem	See also

Creates and initializes a TCollectionItem instance.

constructor Create(Collection: TCollection); virtual;

Description

The Create method takes as a parameter the name of a TCollection instance. Create is called by TCollection’s Add method.


TCollectionItem.Destroy

TCollectionItem	See also

Destroys the TCollectionItem instance and frees its memory.

destructor Destroy; override;

Description

Destroy is called indirectly by TCollection’s Clear method.


TCollectionItem.GetNamePath

TCollectionItem	See also

Returns a string used by the Object Inspector.

function GetNamePath: string; override;

Description

GetNamePath is for internal use only. It determines the text that represents the collection in the Object Inspector. TCollectionItem overrides GetNamePath to return the name of the collection followed by the index of the item within that collection.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


 TColorDialog

Hierarchy	Properties	Methods	Events

TColorDialog displays a modal color-selection dialog.

Unit

dialogs

Description

The TColorDialog component displays a Windows dialog box for selecting colors. The dialog does not appear at runtime until it is activated by a call to the Execute method. When the user selects a color and clicks OK, the dialog closes and the selected color is stored in the Color property.


TColorDialog properties

TColorDialog	Alphabetically	Legend

In TColorDialog

Color

CustomColors

Options

Derived from TCommonDialog

Ctl3D

Handle

HelpContext

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TColorDialog properties

TColorDialog	By object	Legend

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Ctl3D

CustomColors

DesignInfo

Handle

HelpContext

Name

Options

Owner

Tag

VCLComObject


TColorDialog.Color

TColorDialog	Example

Returns the selected color.

property Color: TColor;

Description

When the user selects a color in the dialog box and clicks OK, the selected color becomes the value of the Color property. To make a default color appear in the dialog when it opens, assign a value to Color in the Object Inspector or in program code.


TColorDialog.CustomColors

TColorDialog

Determines which custom colors are available in the dialog box.

property CustomColors: TStrings;

Description

Each custom color is represented as a string of the form ColorX=HexValue. For example, the following string sets the first custom color.

ColorA=808022

Up to 16 custom colors (ColorA through ColorP) can be set.


TColorDialog.Options

TColorDialog

Specifies options and default appearance for the dialog.

type

  TColorDialogOption = (cdFullOpen, cdPreventFullOpen, cdShowHelp, cdSolidColor, cdAnyColor);

  TColorDialogOptions = set of TColorDialogOption;

property Options: TColorDialogOptions;

Description

Use the Options property to customize the appearance and functionality of the dialog. The possible values of Options are

Value	Meaning

cdFullOpen	Displays the custom color options when the dialog opens.

cdPreventFullOpen	Disables the Define Custom Colors button in the dialog, so that the user cannot define new colors.

cdShowHelp	Adds a Help button to the dialog.

cdSolidColor	Directs Windows to use the nearest solid color to the color chosen.

cdAnyColor	Allows the user to select non-solid colors (which may have to be approximated by dithering).

By default, all of these options are off.


TColorDialog events

TColorDialog	Alphabetically	Legend

Derived from TCommonDialog

OnClose

OnShow


TColorDialog events

TColorDialog	By object	Legend

OnClose

OnShow


TColorDialog methods

TColorDialog	Alphabetically

In TColorDialog

Create

Destroy

Execute

Derived from TCommonDialog

DefaultHandler

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TColorDialog methods

TColorDialog	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Execute

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TColorDialog.Create

TColorDialog	See also

Creates and initializes a color-selection dialog.

constructor Create(AOwner: TComponent); override;

Description

Create generates a TColorDialog instance and initializes the CustomColors property.


TColorDialog.Destroy

TColorDialog	See also

Destroys the color-selection dialog and frees its memory.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Call Free instead. Free verifies that the color-selection dialog is not nil before calling Destroy.


TColorDialog.Execute
TColorDialog::.Execute

TColorDialog 	See also	Example

Displays the color-selection dialog.

function Execute: Boolean; override;

Description

Execute opens the color-selection dialog, returning True when the user selects a color and clicks OK, or False when the user cancels.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog


TColumnTitle

Hierarchy	Properties	Methods	See also

TColumnTitle represents the title of a data-grid column (TColumn).

Unit

dbgrids

Description

TDBGrid uses a TDBGridColumns to maintain a collection of TColumn objects. Each TColumn has an associated TColumnTitle that holds information about its title. The TColumnTitle instance is stored in the column’s Title property.


TColumnTitle properties

TColumnTitle	Alphabetically	Legend

In TColumnTitle

Alignment

Caption

Color

Column

Font


TColumnTitle properties

TColumnTitle	By object	Legend

Alignment

Caption

Color

Column

Font


TColumnTitle.Alignment

TColumnTitle	See also

Specifies how text is aligned within the column title.

property Alignment: TAlignment;

Description

Use Alignment to specify whether the column title is left-justified, right-justified, or centered.


TColumnTitle.Caption

TColumnTitle	See also

Specifies the text that appears at the top of the column.

property Caption: String;

Description

The Caption property contains a text string that identifies the column. If the dgTitles flag is set in the data grid’s Options property, the title appears on the form at runtime.

If the FieldName property is set in TColumn, the Caption default value comes from Field.DisplayLabel, which itself defaults to FieldName.


TColumnTitle.Color

TColumnTitle

Specifies the background color for the column title.

property Color: TColor;

Description

The Color property determines the background color of the column title. You can set Color to one of the constants defined in the Graphics unit (such as clBlue), or to an explicit RGB integer value. The default value is the grid’s FixedColor property.


TColumnTitle.Column

TColumnTitle 	See also

Specifies the TColumn object that is associated with the column title.

property Column: TColumn;

Description

Use Column to determine the column associated with the column title.


TColumnTitle.Font

TColumnTitle	See also

Controls the font in which the column title displays its caption.

property Font: TFont;

Description

The Font property points to a TFont object that determines typographic attributes of text displayed in the column title. The default value is the grid’s TitleFont property.


TColumnTitle methods

TColumnTitle	Alphabetically

In TColumnTitle

Assign

Create

DefaultAlignment

DefaultCaption

DefaultColor

DefaultFont

Destroy

RestoreDefaults

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TColumnTitle methods

TColumnTitle	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultAlignment

DefaultCaption

DefaultColor

DefaultFont

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RestoreDefaults

SafeCallException


TColumnTitle.Assign

TColumnTitle	See also

Copies the contents of the source column title to a new column title.

procedure Assign(Source: TPersistent); override;

Description

Assign copies the Alignment, Color, Caption, and Font values of the source object if it is another column title. Otherwise, it calls the inherited method, which allows properties to be copied from any object that implements its AssignTo method with a target of TColumn.


TColumnTitle.Create

TColumnTitle	See also

Creates and initializes a column title.

constructor Create(TColumn);

Description

Call Create to instantiate an instance of TColumnTitle. Create takes a TColumn instance as its argument.

Most applications need not create column title instances as these are instantiated by the associated column.


TColumnTitle.DefaultAlignment

TColumnTitle	See also

Returns the default alignment of the column title.

function DefaultAlignment: TAlignment;

Description

DefaultAlignment returns the alignment for the column that should be used if the Alignment property is not explicitly set. The DefaultAlignment property for TColumnTitle always returns taLeftJustify. Descendants of TColumnTitle can override this to compute the default alignment in an appropriate way.


TColumnTitle.DefaultCaption

TColumnTitle	See also

Returns the default caption of the column title.

function DefaultCaption: String;;

Description

DefaultCaption returns the DisplayLabel of the TField object associated with the column. If there is no dataset field associated with the column (that is, if the column’s Field property is empty), it returns the column’s FieldName.


TColumnTitle.DefaultColor

TColumnTitle	See also

Returns the default background color for the column title.

function DefaultColor: TColor;

Description

Use DefaultColor to determine the background color of the column title if the Color property is not explicitly set. DefaultColor returns the FixedColor of the data grid to which the column belongs. If the column has no associated data grid, DefaultColor returns clBtnFace.


TColumnTitle.DefaultFont

TColumnTitle	See also

Returns the default font for the column title.

function DefaultFont: TFont;

Description

Use DefaultColor to determine the font of the column title if the Font property is not explicitly set. DefaultFont returns the TitleFont of the data grid to which the column belongs. If the column has no associated data grid, DefaultFont returns the current value of the associated column’s Font property.


TColumnTitle.Destroy

TColumnTitle	See also

Destroys the column and frees its memory.

destructor Destroy; override;

Description

 Destroy eliminates the TColumnTitle instance along with its associated font (TFont).


TColumnTitle.RestoreDefaults

TColumnTitle	See also

Restores the column title’s default settings.

procedure RestoreDefaults; virtual;

Description

RestoreDefaults reinitializes the Caption and Font properties.


Scope

Published


Hierarchy

TObject

TPersistent


TColumn

Hierarchy	Properties	Methods	See also

TColumn represents a column in a data grid (TDBGrid).

Unit

dbgrids

Description

Each TDBGrid uses a TDBGridColumns to maintain a collection of TColumn objects. Each TColumn object represents the visual characteristics and data binding of a column in the grid.


TColumn properties

TColumn	Alphabetically	Legend

In TColumn

Alignment

AssignedValues

ButtonStyle

Color

DisplayName

DropDownRows

Expandable

Expanded

Field

FieldName

Font

Grid

ImeMode

ImeName

ParentColumn

PickList

PopupMenu

ReadOnly

Showing

Title

Visible

Width

Derived from TCollectionItem

Collection

ID

Index


TColumn properties

TColumn	By object	Legend

Alignment

AssignedValues

ButtonStyle

Collection

Color

DisplayName

DropDownRows

Expandable

Expanded

Field

FieldName

Font

Grid

ID

ImeMode

ImeName

Index

ParentColumn

PickList

PopupMenu

ReadOnly

Showing

Title

Visible

Width


TColumn.Alignment

TColumn	See also

Specifies how text is aligned within the column.

property Alignment: TAlignment;

Description

Use Alignment to specify whether values should be left-justified, right-justified, or centered in the column.

These are the possible values of Alignment:

Value	Meaning

taLeftJustify	Align text on the left side of the column.

taCenter	Center text in the column.


TColumn.AssignedValues

TColumn	See also

Indicates which TColumn and TColumnTitle properties have been set.

type

TColumnValue = (cvColor, cvWidth, cvFont, cvAlignment, cvReadOnly, cvTitleColor, cvTitleCaption, cvTitleAlignment, cvTitleFont, cvImeMode, cvImeName);

TColumnValues = set of TColumnValue;

property  AssignedValues: TColumnValues;

Description

The read-only AssignedValues lists properties of the column and its title (TColumnTitle) which have been set or whose default values have been changed. AssignedValues is a set of zero or more of the following:

Value	Indicates changes to

cvColor	The column’s Color property.

cvWidth	The column’s Width property.

cvFont	The column’s Font property.

cvAlignment	The column’s Alignment property.

cvReadOnly	The column’s ReadOnly property.

cvTitleColor	The column title’s Color property.

cvTitleCaption	The column title’s Caption property.

cvTitleAlignment	The column title’s Alignment property.

cvTitleFont	The column title’s Font property.

cvImeMode	The column’s ImeMode property.

cvImeName	The column’s ImeName property.

For example, if AssignedValues returns [cvColor, cvTitleCaption], then the column’s font and title caption have been changed and will no longer track with changes made to their default source.

Many column properties obtain their values from external sources, such as properties of the associated TField objects. Until a value is assigned to a column property, changes made to the property’s default source will be reflected by the column. After assignment, the column property is independent of its default source.


TColumn.ButtonStyle

TColumn	See also

Determines whether and how the user can select values for the column from a list.

type TColumnButtonStyle = (cbsAuto, cbsEllipsis, cbsNone);

property ButtonStyle: TColumnButtonStyle;

Description

The ButtonStyle property determines how users can edit the data of a data-grid column. These are the possible values of ButtonStyle:

Value	Meaning

cbsAuto	If the column is associated with a lookup field or has a value assigned to its PickList property, the grid displays a combo box in the column. The user can choose a value from the drop-down list.

cbsEllipsis	The column displays an ellipsis button that the user can click to choose a value. Clicking the ellipsis button triggers an OnEditButtonClick event.

cbsNone	No combo box or ellipsis button is provided. The user cannot select the column’s content from a list.


TColumn.Color

TColumn

Specifies the background color for the column.

property Color: TColor;

Description

The Color property determines the background color of the data-grid column. You can set Color to one of the constants defined in the Graphics unit (such as clBlue), or to an explicit RGB integer value.


TColumn.DisplayName

TColumn	See also

Indicates the name of the column as it appears in the Collection editor.

property DisplayName: String;

Description

Set DisplayName to provide the column with a logical name that. If DisplayName is not set explicitly, it has the same value as the FieldName property. If FieldName is also not set, DisplayName is a unique string based on the object’s class name (TColumn).


TColumn.DropDownRows

TColumn	See also

Specifies the number of lines displayed in the column’s drop-down list.

property DropDownRows: Cardinal;

Description

DropDownRows determines the number of lines of text displayed in the drop-down list associated with the column. This property is used only if ButtonStyle is set to cbsAuto and the column has a lookup field or pick list associated with it.


TColumn.Expandable

TColumn	See also

Specifies whether the column can be expanded to show any child field columns.

property Expandable: Boolean;

Description

Expandable will be False if the represented field is not an ADT, array, or reference field.


TColumn.Expanded

TColumn	See also

Specifies whether the column is expanded.

property Expanded: Boolean;

Description

Expanded only applies to columns that represent fields that are TObjectField descendants. When a column is expanded, a column appears for each child field of the object field. These child field columns each have a column title and appear under the column title of the parent object field. When Expanded is False, child field values are summarized in a comma-delimited string in the object field’s column, and cannot be edited.

Object fields can also be expanded and contracted at runtime through the UI by clicking on the triangle that appears next to its name in the column title.


TColumn.Field

TColumn	See also

Indicates the TField instance represented by the column.

property Field: TField;

Description

Field points to the TField object that corresponds to the dataset field displayed in the column. If the column does not correspond to a field in the dataset (for example, a calculated field), the value of Field can be nil.


TColumn.FieldName

TColumn	See also

Indicates the name of the field represented by the column.

property FieldName: String;

Description

Setting FieldName changes the Field property so that it points to the dataset field with the same name. If the dataset does not have a field with the same name, Field is set to nil.


TColumn.Font

TColumn	See also

Controls the font in which the column displays its data.

property Font: TFont;

Description

The Font property points to a TFont object that determines typographic attributes of text displayed in the column.


TColumn.Grid

TColumn	See also

Indicates the grid that contains the column.

property Grid: TCustomDBGrid;

Description

Use the Grid property to access the grid that contains the column.


TColumn.ImeMode

TColumn	See also

Determines the behavior of the input method editor (IME) when the column is edited.

property ImeMode: TImeMode;

Description

Set ImeMode to configure the way an IME processes user keystrokes when the user is editing the column. An IME is a front-end input processor for Asian language characters. The IME hooks all keyboard input, converts it to Asian characters in a conversion window, and sends the converted characters or strings on to the application.

ImeMode allows the type of conversion performed by the IME to be tailored to the input expected for the column. For example, a column that only accepts numeric input might specify an ImeMode of imClose, as no conversion is necessary for numeric input.


TColumn.ImeName

TColumn	See also

Specifies the input method editor (IME) to use for converting keyboard input to Asian language characters.

type TImeName = type string;

property ImeName: TImeName;

Description

Set ImeName to specify which IME to use for converting keystrokes when the user is editing the column. An IME is a front-end input processor for Asian language characters. The IME hooks all keyboard input, converts it to Asian characters in a conversion window, and sends the converted characters or strings on to the application.

ImeName must specify one of the IMEs that has been installed through the Windows control panel. The property inspector provides a drop-down list of all currently installed IMEs on the system. At runtime, applications can obtain a list of currently installed IMEs from the global Screen variable.

If ImeName specifies an unavailable IME, the IME that was active when the application started is used instead. No exception is generated.


TColumn.ParentColumn

TColumn	See also

Refers to the TColumn object that owns the column.

property ParentColumn: TColumn;

Description

If the column represents a child field, ParentColumn refers to the column of the object field that parents the child field.


TColumn.PickList

TColumn	See also

Lists values that the user can select for the column.

property PickList: TStrings;

Description

The PickList property points to a TStrings object. If ButtonStyle is cbsAuto, these strings appear in the drop-down list associated with the column.


TColumn.PopupMenu

TColumn	See also

Identifies the pop-up menu associated with the column.

property PopupMenu: TPopupMenu;

Description

Assign a value to PopupMenu to make a pop-up menu appear when the user clicks the right mouse button on the column. If the TPopupMenu’s AutoPopup property is True, the pop-up menu appears automatically. If the menu’s AutoPopup property is False, display the menu with a call to its Popup method.


TColumn.ReadOnly

TColumn	See also

Determines whether data displayed in the column is editable.

property ReadOnly: Boolean;

Description

If ReadOnly is set to True, data displayed in the column cannot be changed by the user at runtime. If ReadOnly is set to False (and the data grid’s Options property includes the dgEditing flag), users can edit data directly from the grid.


TColumn.Showing

TColumn	See also

Indicates whether the column is showing.

property Showing: Boolean!ALink(Boolean_Type, 1);

Description

Showing will return True if Visible is True and Expanded is False, and if the field represented is the child of an object field, if the parent column is expanded.


TColumn.Title

TColumn	See also

Indicates the TColumnTitle that represents the column’s title.

property Title: TColumnTitle;

Description

The Title property points to a TColumnTitle object that determines attributes of the column’s title. If FieldName is set, the value of FieldName becomes the default column title (TColumnTitle.Caption).

The title (TColumnTitle.Caption) appears at runtime only if the dgTitles flag is set in the data grid’s Options property.


TColumn.Visible

TColumn	See also

Specifies whether the column is visible in the grid.

property Visible: Boolean!ALink(Boolean_Type, 1);

Description

To hide a column in the grid, set Visible to False. If Visible is True, and the field’s Visible property is True, the column will appear in the grid. This property only determines whether the column is allowed to be drawn/shown. The Showing property reflects the actual displayability of the column based on additional factors.


TColumn.Width

TColumn	See also

The width of the column.

property Width: Integer;

Description

The Width property determines the width of the column, in pixels. If the dgColumnResize flag is set in the data grid’s Options property, users can resize the column at runtime.


TColumn methods

TColumn	Alphabetically

In TColumn

Assign

Create

DefaultAlignment

DefaultColor

DefaultFont

DefaultImeMode

DefaultImeName

DefaultReadOnly

DefaultWidth

Depth

Destroy

RestoreDefaults

Derived from TCollectionItem

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TColumn methods

TColumn	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultAlignment

DefaultColor

DefaultFont

DefaultHandler

DefaultImeMode

DefaultImeName

DefaultReadOnly

DefaultWidth

Depth

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RestoreDefaults

SafeCallException


TColumn.Assign

TColumn	See also

Copies the contents of the source column to a new column.

procedure Assign(Source: TPersistent); override;

Description

Assign creates a new column with the same FieldName, Title, DropDownRows, ButtonStyle, and PickList values as the source object. Color, Width, Font, Alignment, and ReadOnly are also copied if AssignedValues indicates that they have been changed.


TColumn.Create

TColumn	See also

Creates and initializes a data-grid column.

constructor Create(Collection: TCollection); override;

Description

Call Create to instantiate a TColumn object. Create should take a TDBGridColumns instance as its argument. It creates a data-grid column along with its title (TColumnTitle) and font (TFont).


TColumn.DefaultAlignment

TColumn	See also

Returns the default alignment for the column.

function DefaultAlignment: TAlignment;

Description

Use DefaultAlignment to determine the alignment of the data in the column when the Alignment property has not been explicitly set. DefaultAlignment returns the Alignmnent of the TField associated with the column. If the column has no dataset field associated with it, DefaultAlignment returns taLeftJustify.


TColumn.DefaultColor

TColumn	See also

Returns the default background color for the column.

function DefaultColor: TColor;

Description

Use Default color to determine the color of the column when the Color property is not explicitly set. DefaultColor returns the Color of the data grid to which the column belongs. If the column has no associated data grid, DefaultColor returns clWindow.


TColumn.DefaultFont

TColumn	See also

Returns the default font for data displayed in the column.

function DefaultFont: TFont;

Description

DefaultFont returns the Font of the data grid to which the column belongs. If the column has no associated data grid, DefaultFont returns the current value of the column’s Font property.


TColumn.DefaultImeMode

TColumn	See also

Describes the default behavior of the Input Method Editor (IME).

function  DefaultImeMode: TImeMode;

Description

DefaultImeMode returns the ImeMode property of the data grid to which the column belongs. If the column has no associated data grid, DefaultImeMode returns the current value of the column’s ImeMode property.


TColumn.DefaultImeName

TColumn	See also

Returns the name of the default Input Method Editor (IME).

type

  TImeName = type String;

function  DefaultImeName: TImeName;

Description

DefaultImeName returns the ImeName property of the data grid to which the column belongs. If the column has no associated data grid, DefaultImeName returns the current value of the column’s ImeName property.


TColumn.DefaultReadOnly

TColumn	See also

Returns the default ReadOnly setting for the column.

function DefaultReadOnly: Boolean;

Description

Reflects the ReadOnly state of the grid and the grid’s dataset and field.


TColumn.DefaultWidth

TColumn	See also

Returns the default width for the column.

function  DefaultWidth: Integer;

Description

The value of DefaultWidth is determined as follows:

If the column has no data grid associated with it, DefaultWidth returns 64.

If the column has an associated data grid but the Field property is empty, DefaultWidth returns data grid’s protected DefaultColWidth property. Usually, this value is 64.

If the column has an associated data field, DefaultWidth is calculated from the TField object’s DisplayWidth property using the column’s font.

If the dgTitles flag is set in the data grid’s Options property, DefaultWidth is increased (as necessary) to accommodate the column’s title caption.


TColumn.Depth

TColumn	See also

Returns the position of the column in relation to any parent columns. A column with no parent column returns 0.

function Depth: Integer;

Description

If a column does not have any parent columns, Depth returns 0.  Columns with parent columns return a number equal to the number of parents it has. For example, a parentless ADT field called Date has a Depth of 0.  Its three child fields, Month, Day, and Year, each have a Depth of 1.


TColumn.Destroy

TColumn	See also

Destroys the column and frees its memory.

destructor Destroy; override;

Description

Destroy eliminates the TColumn instance along with its title (TColumnTitle), font (TFont), and pick list (TStrings).


TColumn.RestoreDefaults

TColumn	See also

Restores the column’s default settings.

procedure RestoreDefaults; virtual;

Description

RestoreDefaults reinitializes the AssignedValues, ButtonStyle, Font, and PickList properties, freeing the pick list (TStrings) object if there is one. It also calls the RestoreDefaults method in the column’s title (TColumnTitle) to restore the default properties of the column title.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem


 TComboBox

Hierarchy	Properties	Methods	Events	See also	Example

TComboBox combines an edit box with a scrollable list.

Unit

stdctrls

Description

A TComboBox component is an edit box with a scrollable drop-down list attached to it. Users can select an item from the list or type directly into the edit box.


TComboBox properties

TComboBox	Alphabetically	Legend

Derived from TCustomComboBox

Canvas

CharCase

DropDownCount

DroppedDown

ItemHeight

ItemIndex

Items

MaxLength

SelLength

SelStart

SelText

Sorted

Style

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Text

TBDockHeight

Top

Visible

Width

WindowProc

UndockHeight

UndockWidth

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TComboBox properties

TComboBox	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

Canvas

CharCase

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

DropDownCount

DroppedDown

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

ImeMode

ImeName

ItemHeight

ItemIndex

Items

Left

LRDockWidth

MaxLength

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

SelLength

SelStart

SelText

ShowHint

Showing

Sorted

Style

TabOrder

TabStop

Tag

TBDockHeight

Text

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TComboBox events

TComboBox	Alphabetically	Legend

Derived from TCustomComboBox

OnChange

OnDrawItem

OnDropDown

OnMeasureItem

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnEndDock

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnStartDock

OnStartDrag


TComboBox events

TComboBox	By object	Legend

OnChange

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnDrawItem

OnDropDown

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMeasureItem

OnStartDock

OnStartDrag


TComboBox methods

TComboBox	Alphabetically

Derived from TCustomComboBox

Clear

Create

Destroy

Focused

SelectAll

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TComboBox methods

TComboBox	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomComboBox


TCommonCalendar

Hierarchy	Properties	Methods	Events

TCommonCalendar is the base class for the TDateTimePicker and TMonthCalendar controls.

Unit

Comctrls

Description

Use TCommonCalendar as a base class when creating custom controls that represent dates in a calendar-like format. Do not create instances of TCommonCalendar. Instead, to put a calendar control on a form, use a TCommonCalendar descendant such as TDateTimePicker or TMonthCalendar.

Note:	The VCL includes another calendar control that does not descend from TCommonCalendar. This is TCalendar, which is offered as a sample.


TCommonCalendar properties

TCommonCalendar	Alphabetically	Legend

In TCommonCalendar

CalColors

CalendarHandle

CalExceptionClass

Date

DateTime

EndDate

FirstDayOfWeek

MaxDate

MaxSelectRange

MinDate

MonthDelta

MultiSelect

ShowToday

ShowTodayCircle

WeekNumbers

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCommonCalendar properties

TCommonCalendar	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

CalColors

CalendarHandle

CalExceptionClass

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

Date

DateTime

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

EndDate

FirstDayOfWeek

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

MaxDate

MaxSelectRange

MinDate

MonthDelta

MultiSelect

Name

Owner

Parent

ParentWindow

ShowHint

Showing

ShowToday

ShowTodayCircle

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

WeekNumbers

Width

WindowProc


TCommonCalendar.CalColors

TCommonCalendar	See also

Contains the colors used for each part of the calendar.

property CalColors: TMonthCalColors;

Description

Use the CalColors property to get or set the calendar's background color, month background color, text color, title background color, title text color, and trailing text color.


TCommonCalendar.CalendarHandle

TCommonCalendar	See also

Indicates the calendar control's window handle.

property CalendarHandle: HWND;

Description

Use the CalendarHandle property to get the calendar control's window handle.

The CalendarHandle property is declared but not implemented in TCommonCalendar.

For descendants that use only one window, such as TMonthCalendar, CalendarHandle is the same as the Handle property. However, some TCommonCalendar descendants such as TDateTimePicker are implemented using more than one window. In these classes, CalendarHandle is the window handle for the portion of the control that displays date values.


TCommonCalendar.CalExceptionClass

TCommonCalendar	See also

Specifies the calendar's exception class.

property CalExceptionClass: ExceptClass;

Description

Use CalExceptionClass in a derived class determine the class used for exceptions raised by the calendar control. Descendants of TCommonCalendar initialize this value in the constructor so that when TCommonCalendar encounters an unexpected condition, it can raise the appropriate type of exception.


TCommonCalendar.Date

TCommonCalendar	See also

Indicates the date that is marked on the calendar.

property Date: TDate;

Description

Use Date to get or set the date that is marked on the calendar. The value of Date must lie within the range specified by MaxDate and MinDate.

If MultiSelect is True, the selected range of dates goes from Date to EndDate.

Note:	You can also set the marked date with the DateTime property.


TCommonCalendar.DateTime

TCommonCalendar	See also

Indicates the date that is marked on the calendar.

property DateTime: TDateTime;

Description

Use DateTime to get or set the date (and, if relevant, time) that is marked on the calendar control. The value of DateTime must lie within the range specified by MaxDate and MinDate.

If MultiSelect is True, the selected range of dates goes from DateTime to EndDate.

Note:	You can also set the marked date with the Date property.


TCommonCalendar.EndDate

TCommonCalendar	See also

Indicates the last date that in the range of selected dates.

property EndDate: TDate;

Description

Use EndDate to get or set the last selected date that is marked on the calendar. The first selected date is given by the Date property.

Before you can set the EndDate property, you must set the MultiSelect property to True.


TCommonCalendar.FirstDayOfWeek

TCommonCalendar	See also

Specifies the left-most day on the calendar.

property FirstDayOfWeek: TCalDayOfWeek;

Description

Use FirstDayOfWeek to get or set the left-most day on the calendar.

To make the left-most day adjust for the locale, set FirstDayOfWeek to dowLocaleDefault.


TCommonCalendar.MaxDate

TCommonCalendar	See also

Indicates the maximum date to which users can scroll the calendar.

property MaxDate: TDate;

Description

Use MaxDate to get or set the maximum date to which users can scroll the calendar. The value of the Date (or EndDate) property can’t exceed MaxDate.


TCommonCalendar.MaxSelectRange

TCommonCalendar	See also

Specifies the maximum number of days that can be selected.

property MaxSelectRange: Integer;

Description

Use MaxSelectRange to limit the number of days that can be selected when MultiSelect is True. To limit ranges so that they fall between specific date values, use the MaxDate and MinDate properties instead.


TCommonCalendar.MinDate

TCommonCalendar	See also

Indicates the minimum date that can be selected.

property MinDate: TDate;

Description

Use MinDate to get or set the minimum date that can be selected.


TCommonCalendar.MonthDelta

TCommonCalendar

Specifies how many months that the calendar scrolls.

property MonthDelta: Integer;

Description

Use MonthDelta to get or set the number of months that the calendar scrolls when the back and forward buttons are clicked.


TCommonCalendar.MultiSelect

TCommonCalendar	See also

Specifies whether multiple dates can be selected on the calendar.

property MultiSelect: Boolean;

Description

Use MultiSelect to specify whether the calendar represents a single date or a range of dates. When MultiSelect is True, the calendar represents the range of dates from Date to EndDate. When MultiSelect is False, the calendar represents only the value of Date.


TCommonCalendar.ShowToday

TCommonCalendar	See also

Specifies whether today's date is shown below the calendar.

property ShowToday: Boolean;

Description

Use ShowToday to specify whether today's date (according to the system clock) is shown below the calendar.


TCommonCalendar.ShowTodayCircle

TCommonCalendar	See also

Specifies whether today's date is circled on the calendar.

property ShowTodayCircle: Boolean;

Description

Use ShowTodayCircle to specify whether today's date (according to the system clock) is circled on the calendar.


TCommonCalendar.WeekNumbers

TCommonCalendar	See also

Specifies whether week numbers are shown to the left of the calendar.

property WeekNumbers: Boolean;

Description

Use WeekNumbers to indicate whether week numbers are shown to the left of the calendar. The week numbers correspond to the number of the week in the current year.


TCommonCalendar events

TCommonCalendar	Alphabetically	Legend

In TCommonCalendar

OnGetMonthInfo


TCommonCalendar events

TCommonCalendar	By object	Legend

OnGetMonthInfo


TCommonCalendar.OnGetMonthInfo

TCommonCalendar	See also

Called whenever a new month is displayed in the calendar.

property OnGetMonthInfo: TOnGetMonthInfoEvent;

Description

Use TOnGetMonthInfoEvent to initialize the display properties of a month before it is displayed in the calendar. In particular, OnGetMonthInfo allows applications to bold individual days in the calendar (such as holidays).

To specify that specific dates are to be bolded, use the BoldDays method to obtain a value that can be returned as the MonthBoldInfo parameter. For example, to bold the first and eighth days of every month that is displayed, call

BoldDays([1,8], MonthBoldInfo);

from the OnGetMonthInfo event handler.


TCommonCalendar methods

TCommonCalendar	Alphabetically	Legend

In TCommonCalendar

BoldDays

CheckEmptyDate

CheckValidDate

Create

CreateWnd

Destroy

GetCalendarHandle

GetCalStyles

MsgSetCalColors

MsgSetDateTime

MsgSetRange

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCommonCalendar methods

TCommonCalendar	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BoldDays

BringToFront

Broadcast

CanFocus

CheckEmptyDate

CheckValidDate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

CreateWnd

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetCalendarHandle

GetCalStyles

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

MsgSetCalColors

MsgSetDateTime

MsgSetRange

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TCommonCalendar.BoldDays

TCommonCalendar	See also

Encodes a set of dates for use in the OnGetMonthInfo event handler.

procedure BoldDays(Days: array of LongWord; var MonthBoldInfo: LongWord);

Description

Use BoldDays to encode the days of the current month that should appear in bold. The value returned by BoldDays can be assigned to the MonthBoldInfo parameter of an OnGetMonthInfo event handler.

Days is an array of unsigned integers corresponding to the days that should be bold.

MonthBoldInfo returns the encoding of the values that were passed in the Days array. This value can be assigned to the MonthBoldInfo parameter of the OnGetMonthInfo event handler. (or the MonthBoldInfo parameter can be passed in for this argument). You shouldn't work with the MonthBoldInfo variable directly.

For example, to encode the first and eighth days of a month, call

BoldDays([1,8], MonthBoldInfo);


TCommonCalendar.CheckEmptyDate

TCommonCalendar	See also

Clears the check box associated with the calendar.

procedure CheckEmptyDate; virtual;

Description

CheckEmptyDate is called automatically when DateTime is assigned a value that represents a time and not a date value (or Date is assigned a value of 0). As implemented in TCommonCalendar, CheckEmptyDate does nothing.

TDateTimePicker overrides CheckEmptyDate to clear the check box associated with the calendar, or raise an EDateTimeError if ShowCheckBox is False. This allows TDateTimePicker to represent time values that do not include a date portion. (When a TDateTime value represents a time and not a date, the date portion is 0).


TCommonCalendar.CheckValidDate

TCommonCalendar	See also

Confirms that a date falls between MinDate and MaxDate.

procedure CheckValidDate(Value: TDate); virtual;

Description

Calendar controls call CheckValidDate to confirm that a date falls between MinDate and MaxDate.

Value is the date to check.

If Value is outside MinDate and MaxDate, an exception of the type specified in the CalExceptionClass property is raised.


TCommonCalendar.Create

TCommonCalendar	See also

Creates an instance of TCommonCalendar.

constructor Create(AOwner: TComponent); override;

Description

Call Create to construct and initialize an instance of TCommonCalendar. The AOwner parameter assigns a value to the Owner property, which is responsible for freeing the calendar control.

Create performs the following tasks:

Calls the inherited constructor.

Sets ShowToday and ShowTodayCircle to True.

Sets ControlStyle to [csOpaque, csClickEvents, csDoubleClicks].

Sets DateTime to Now.

Sets FirstDayOfWeek to dowLocaleDefault.

Sets MaxSelectRange to 31.

Sets MonthDelta to 1.


TCommonCalendar.CreateWnd

TCommonCalendar	See also

Creates the windows control for the calendar.

procedure CreateWnd; override;

Description

CreateWnd is called automatically when the windowed control is first created or when the window must be destroyed and recreated to reflect property changes. Override CreateWnd to pass additional initialization messages to the window when it is first created.

CreateWnd calls the TWinControl CreateWnd method to generate the window, and then sends messages to initialize the control so that it reflects the current property settings.


TCommonCalendar.Destroy

TCommonCalendar	See also

Destroys the TCommonCalendar instance.

destructor Destroy; override;

Description

Do not call the TCommonCalendar destructor directly in an application. Instead, call Free, which checks that the calendar reference is not nil before calling Destroy.

Applications do not need to explicitly destroy calendar controls unless they were created without assigning an Owner.


TCommonCalendar.GetCalendarHandle

TCommonCalendar	See also

Returns the calendar control's window handle.

function GetCalendarHandle: HWND; virtual; abstract;

Description

GetCalendarHandle is the protected read implementation of the CalendarHandle property. For TCommonCalendar, this is an abstract method. It must be implemented in descendant classes.


TCommonCalendar.GetCalStyles

TCommonCalendar	See also

Returns the style flags that are used when creating the calendar’s window.

function GetCalStyles: DWORD; virtual;

Description

GetCalStyles is used internally to create the style flags that reflect the current property settings of the calendar control. These flags are or’d with style flags generated by TWinControl’s CreateParams method and assigned to the Style field of the window creation parameters.


TCommonCalendar.MsgSetCalColors

TCommonCalendar	See also

Sets the calendar's colors.

function MsgSetCalColors(ColorIndex: Integer; ColorValue: TColor): Boolean; virtual; abstract;

Description

MsgSetCalColors implements the CalColors property by sending a message to the calendar  window handle. MsgSetCalColors is an abstract method, and must be overridden in descendant objects to send the appropriate message.

The ColorIndex parameter indicates which of the TMonthCalColors properties is being set. It is one of the following values:

Value	Property

0	BackColor

1	TextColor

2	TitleBackColor

3	TitleTextColor

4	MonthBackColor

5	TrailingTextColor

The ColorValue parameter is the value that should be set.

MsgSetCalColors returns True if the color is set by the method.


TCommonCalendar.MsgSetDateTime

TCommonCalendar	See also

Sets the calendar's date/time.

function MsgSetDateTime(Value: TSystemTime): Boolean; virtual; abstract;

Description

MsgSetDateTime implements the DateTime property by sending a message to the calendar  window handle. MsgSetDateTime is an abstract method, and must be overridden in descendant objects to send the appropriate message.

The Value parameter indicates the value of DateTime as a TSystemTime value. This can be obtained from the DateTime property value by calling DateTimeToSystemTime.

MsgSetDateTime returns True if the date/time value is set by the method.


TCommonCalendar.MsgSetRange

TCommonCalendar	See also

Implements the MinDate and MaxDate properties.

function MsgSetRange(Flags: Integer; SysTime: PSystemTime; Boolean; virtual; abstract;

Description

MsgSetRange implements the MinDate and MaxDate properties by sending a message to the calendar window handle. MsgSetRange is an abstract method, and must be overridden in descendant objects to send the appropriate message.

The Flags parameter indicates what type of information is included in the SysTime array. It includes the GDTR_MIN flag if a minimum date is supplied and GDTR_MAX if a maximum date is supplied.

The SysTime parameter is a two-element array containing the minimum date as the first element and the maximum date as the second element. These values can be obtained from the MinDate and MaxDate properties by calling DateTimeToSystemTime.

MsgSetRange returns True if the range is set by the method.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCommonDialog

Hierarchy	Properties	Methods	Events	See also

TCommonDialog is the ancestor of all components that represent Windows common dialog boxes.

Unit

dialogs

Description

TCommonDialog is an abstract class that represents Windows common dialog boxes. Its descendants handle such tasks as finding and opening files, setting fonts and colors, and printing. The dialogs do not appear at runtime until activated by a call to the Execute method. Except for TFindDialog and TReplaceDialog, these dialogs are all modal.

The TCommonDialog descendants are nonvisual components that generate a single function call to COMMDLG.DLL, and are therefore less easily modified than other Delphi components. New components that encapsulate common-dialog functions should descend from TCommonDialog. Most other dialog boxes should descend from TForm.


TCommonDialog properties

TCommonDialog	Alphabetically	Legend

In TCommonDialog

Ctl3D

Handle

HelpContext

Template

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCommonDialog properties

TCommonDialog	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Ctl3D

DesignInfo

Handle

HelpContext

Name

Owner

Tag

Template

VCLComObject


TCommonDialog.Ctl3D

TCommonDialog	See also

Determines whether the dialog has a three-dimensional look.

property Ctl3D: Boolean;

Description

If Ctl3D is set to True, the dialog box and the controls in it appear three-dimensional. If Ctl3D is set to False, the dialog and its controls appear flat.

For dialogs to appear three-dimensional under Windows NT 3.51, CTL3D32.DLL must be installed in the System32 directory.


TCommonDialog.Handle

TCommonDialog	See also

Specifies the window handle of the dialog.

property Handle: HWnd;

Description

The Handle property, which provides access to the dialog’s window handle after a call to Execute, can be used in OnShow and OnClose event handlers. Handle is reset to 0 after the dialog closes.


TCommonDialog.HelpContext

TCommonDialog	See also

Specifies the context number for online Help.

property HelpContext: THelpContext;

Description

The HelpContext property is an integer value that determines which Help screen appears when the user requests context-sensitive online Help. If HelpContext is set to the default value of 0, the dialog inherits the Help context of its parent.


TCommonDialog.Template

TCommonDialog	See also

Points to a custom template for the dialog.

property Template: PChar;

Description

Template points to a resource identifier (a null-terminated string or an integer created with MAKEINTRESOURCE) that identifies a Windows dialog resource in the current HInstance module. The Execute method uses this resource to customize the appearance of the dialog.

For example, if 123 is an integer identifier in the resource file MYDLG.RES, the following code could be used customize OpenDialog1.

{$R Mydlg.res}

OpenDialog1.Template := MakeIntResource(123);

If DialogA is a string identifier in MYDLG.RES, then the following code could be used customize PrintDialog1.

{$R Mydlg.res}

PrintDialog1.Template := 'DialogA';


TCommonDialog events

TCommonDialog	Alphabetically	Legend

In TCommonDialog

OnClose

OnShow


TCommonDialog events

TCommonDialog	By object	Legend

OnClose

OnShow


TCommonDialog.OnClose

TCommonDialog	See also

Occurs when the dialog closes.

property OnClose: TNotifyEvent;

Description

Write an OnClose event handler to perform special processing when the dialog closes.


TCommonDialog.OnShow

TCommonDialog	See also

Occurs when the dialog opens.

property OnShow: TNotifyEvent;

Description

Write an OnShow event handler to perform special processing when the dialog is displayed.


TCommonDialog methods

TCommonDialog	Alphabetically	Legend

In TCommonDialog

Create

DefaultHandler

Destroy

DoClose

DoShow

Execute

MessageHook

TaskModalDialog

WndProc

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCommonDialog methods

TCommonDialog	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DoClose

DoShow

Execute

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MessageHook

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

TaskModalDialog

UpdateAction

WndProc


TCommonDialog.Create

TCommonDialog	See also

Creates and initializes a TCommonDialog instance.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a common dialog component at runtime. Dialogs added to forms or data modules at design time are created automatically.


TCommonDialog.Destroy

TCommonDialog	See also

Destroys the TCommonDialog instance and frees its memory.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Call Free instead. Free verifies that the dialog reference is not nil before calling Destroy.


TCommonDialog.DefaultHandler

TCommonDialog	See also

Sends unhandled messages to Windows for processing.

procedure DefaultHandler(var Message); override;

Description

DefaultHandler is called by Dispatch when it cannot find a method for a particular message. DefaultHandler sends these messages to the dialog’s window procedure, where they are handled by Windows.


TCommonDialog.DoClose

TCommonDialog	See also

Generates an OnClose event.

procedure DoClose; dynamic;

Description

DoClose is called automatically when the user closes the dialog. Override this method to provide additional processing other than calling the OnClose event handler. For example, to perform shutdown operations that use protected methods of the dialog class, override DoClose rather than writing an OnClose event handler (which can access only public methods).


TCommonDialog.DoShow

TCommonDialog	See also

Generates an OnShow event.

procedure DoShow; dynamic;

Description

DoShow is called automatically when the dialog is first displayed. Override this method to provide additional processing other than calling the OnShow event handler. For example, to perform initializations that use protected methods of the dialog class, override DoShow rather than writing an OnShow event handler (which can access only public methods).


TCommonDialog.Execute

TCommonDialog	See also

Displays the dialog box.

function Execute: Boolean; virtual; abstract;

Description

TCommonDialog introduces the abstract Execute method, which descendant classes use to open the dialog instance at runtime. Generally, Execute returns True when the user makes a selection and clicks OK, and returns False when the user closes the dialog without making a selection.


TCommonDialog.MessageHook

TCommonDialog 	See also

Provides special Windows message processing for the dialog.

function MessageHook(var Msg: TMessage): Boolean; virtual;

Description

MessageHook intercepts messages sent to the dialog window before the dialog’s window procedure gets them. When MessageHook handles a message, it returns True to indicate that the message should not be sent on for further processing. If the window procedure should handle the message, MessageHook Returns False.

Override MessageHook to provide extra message processing. For example, if the Template property substitutes a dialog template with additional controls, use MessageHook to handle messages from those dialog controls.

In TCommonDialog, MessageHook handles Help messages by calling the application’s HelpContext method if the HelpContext property is defined. Descendants of TCommonDialog override MessageHook to add additional message processing.


TCommonDialog.TaskModalDialog

TCommonDialog 	See also

Ensures that Windows messages are properly routed when the dialog executes.

function TaskModalDialog(DialogFunc: Pointer; var DialogData): Bool; virtual;

Description

Descendants of TCommonDialog call TaskModalDialog from their Execute methods.

TaskModalDialog

Disables other windows while the dialog is displayed.

Ensures that application windows are activated and deactivated appropriately.

Ensures that the MessageHook receives Windows messages before the dialog’s window procedure.

Calls the dialog function specified as DialogFunc, passing in the dialog-specific data provided by DialogData.


TCommonDialog.WndProc

TCommonDialog 	See also

Responds to Windows messages sent to the dialog.

procedure WndProc(var Message: TMessage); virtual;

Description

WndProc is the main window procedure for the dialog. As implemented in TCommonDialog, it simply calls the Dispatch method, where any message handlers respond to messages before the DefaultHandler method sends them on to the Windows message handler.

Override WndProc to subclass the dialog’s window procedure. To add additional message processing without interfering with the existing message handling of the dialog, override MessageHook instead.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TComponentEditor

Hierarchy	Properties	Methods	See also

TComponentEditor is the base class for all component editors.

Unit

dsgnintf

Description

Use TComponentEditor or one of its descendants as a base class when defining a design-time editor for working with a new component class. TComponentEditor implements the IComponentEditor interface.

Create a new component editor class for a component class to add verbs to its context menu, change its default double-click behavior, or allow the component to use a new clipboard format.

Once the component editor is defined, it can be registered to work with a particular component class.  A registered component editor is created for each component of that class when it is selected in the form designer.  When the component is double-clicked, the Edit method of the component editor is called.  When the user right-clicks the component, the GetVerbCount and GetVerb methods of the editor are called to build context menu. To create the association between a component editor and a component class, call RegisterComponentEditor.

Delphi provides a descendant of TComponentEditor (TDefaultEditor) which all components use if they have no registered association with a component editor.


TComponentEditor properties

TComponentEditor	Alphabetically 	Legend

In TComponentEditor

Component

Designer

Derived from TInterfacedObject

RefCount


TComponentEditor properties

TComponentEditor	By object 	Legend

Component

Designer

RefCount


TComponentEditor.Component

TComponentEditor 	See also 	Example

Provides access to the component in the form designer that uses this component editor.

property Component: TComponent;

Description

Use Component to read from and make changes to the component associated with the component editor. A component editor is created for each instance of the registered component class when it is selected in the form designer.  Component is the selected instance.

Note:	When the component editor makes changes to the component, it must call the Modified method of the form designer that is specified by the Designer property.


TComponentEditor.Designer

TComponentEditor	See also

Provides access to the form designer in the IDE.

property Designer: IFormDesigner;

Description

Use Designer to read from or make changes to the current form or module in the IDE. The IFormDesigner interface has methods that can access the components in the current unit and other units linked in by the uses clause, create or alter the methods in the current unit, and so on.

Note:	When the component editor makes changes to the component, it must call the Modified method of the IFormDesigner interface.


TComponentEditor methods

TComponentEditor	Alphabetically

In TComponentEditor

Copy

Create

Edit

ExecuteVerb

GetDesigner

GetIComponent

GetVerb

GetVerbCount

IsInInlined

PrepareItem

Derived from TInterfacedObject

AfterConstruction

BeforeDestruction

NewInstance

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

SafeCallException


TComponentEditor methods

TComponentEditor	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Copy

Create

DefaultHandler

Destroy

Dispatch

Edit

ExecuteVerb

FieldAddress

Free

FreeInstance

GetDesigner

GetIComponent

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetVerb

GetVerbCount

InheritsFrom

InitInstance

InstanceSize

IsInInlined

MethodAddress

MethodName

NewInstance

PrepareItem

SafeCallException


TComponentEditor.Copy

TComponentEditor	See also	Example

Provides an opportunity to copy the component to the clipboard in custom formats.

procedure Copy; virtual;

Description

Do not call the Copy method.  It is called automatically when the user copies the component to the clipboard.  When Copy is called, the component's filed image is already on the Clipboard. Override Copy to copy a different clipboard format, which is ignored by the designer but might be recognized by another application.


TComponentEditor.Create

TComponentEditor	See also

Instantiates a component editor.

constructor Create(AComponent: TComponent; ADesigner: IFormDesigner); virtual;

Description

Do not call the Create method  It is called automatically by the form designer to generate an instance of the component editor for a selected component. AComponent is the selected component on which the editor will operate.  ADesigner is the form designer’s interface, which can be used to obtain information about the components and methods in the designer and to create or manipulate components and methods.


TComponentEditor.Edit

TComponentEditor	See also

Responds when the user double-clicks the component in the form designer.

procedure Edit; virtual;

Description

The Object Inspector calls Edit when the user double-clicks the component. Edit executes the first verb supplied by the component editor.  That is, if GetVerbCount returns a value greater than zero, Edit calls

ExecuteVerb(0);

Override the Edit method to implement another response when the user double-clicks the component.  For example, the Edit method can bring up a dialog or design expert.


TComponentEditor.ExecuteVerb

TComponentEditor	See also	Example

Performs the action of a specified verb.

procedure ExecuteVerb(Index: Integer); virtual;

Description

The form designer calls ExecuteVerb when the user selects the verb that is returned by GetVerb(Index).  This verb is the string that appears in the corresponding position of the component’s context menu.

TComponentEditor does not supply any verbs for its component.  As a result, ExecuteVerb does nothing.  Override GetVerb to provide a set of verbs, or menu strings, that are added to the context menu which appears when the user right-clicks the component.  Override ExecuteVerb to implement a response to each of these verbs.


TComponentEditor.GetDesigner

TComponentEditor	See also

Returns the interface for the form designer.

function GetDesigner: IFormDesigner;

Description

GetDesigner implements the Designer property.


TComponentEditor.GetIComponent

TComponentEditor	See also

Returns the IComponent interface for the component specified by the Component property.

function GetIComponent: IComponent;

Description

Use GetIComponent to obtain an interface for the component being edited. While component editors can use the properties and methods of the component directly, using the Component property, the IComponent interface allows objects that only use the component editor through the IComponentEditor interface to access the component as well.


TComponentEditor.GetVerb

TComponentEditor	See also	Example

Returns the string that corresponds to the specified position of the component’s context menu.

function GetVerb(Index: Integer): string; virtual;

Description

The form designer calls GetVerb iteratively to build the context menu that appears when the user right-clicks the component.

When overriding GetVerb, adding an ampersand (&) to a verb will cause the following character to appear underlined in the context menu and to act as a shortcut key for selecting the menu item.  Be sure to add ellipses (...) to the end of a verb if its corresponding action is to bring up a dialog.


TComponentEditor.GetVerbCount

TComponentEditor	See also	Example

Returns the number of menu strings added to the context menu by the component editor.

function GetVerbCount: Integer; virtual;

Description

The form designer calls GetVerbCount when the user right-clicks the component in order to determine the number of menu items that should be added to the context menu.  It then adds the menu items by calling GetVerb for every value from 0 to GetVerbCount - 1.

TComponentEditor does not supply any verbs for its component.  As a result, GetVerbCount returns 0.  Override GetVerbCount when providing a set of verbs, or menu strings, to be added to the context menu.  When overriding GetVerbCount, override GetVerb to return the actual strings, and override ExecuteVerb to implement a response to each of these verbs.  For example, if adding two verbs to the context menu, GetVerbCount should return 2, GetVerb should return a value for an Index of 0 and for an Index of 1, and ExecuteVerb should perform the corresponding actions for an Index of 0 and for an Index of 1.


TComponentEditor.IsInInlined

TComponentEditor	See also

Indicates whether the component has the csInline flag set in its ComponentState property.

function IsInInlined: Integer; virtual;

Description

IsInInlined indicates whether the component being edited is inside a top-level component that can be modified at design time and also embedded in a form.

For instance, when a component is used on a Frame and that Frame is dropped on a Form, IsInInlined returns True for the component when it is embedded in the Frame on the Form, but returns False when the component that is only on the Frame.


TComponentEditor.PrepareItem

TComponentEditor	See also

Returns the number of menu strings added to the context menu by the component editor.

procedure PrepareItem(Index: Integer; const AItem: TMenuItem); virtual;

Description

The form designer calls PrepareItem for each verb when it constructs the context menu. This method lets the component editor make any modifications to the menu item for each verb, including adding subitems or removing the item from the context menu.

Index identifies the current verb that the form designer is adding to the context menu. This is the same index as appears for the command in the GetVerb and ExecuteVerb methods.

AItem is the menu item created by the form designer for the current verb. To add subitems, set the Items property of this menu item. To suppress the menu item, set its Visible property to False.

As implemented in TComponentEditor, PrepareItem does nothing. Override this method to customize the context menu before it is displayed.


Accessibility

Read-only


Hierarchy

TObject

TInterfacedObject


TControl

Hierarchy	Properties	Methods	Events	See also

TControl is the base class for all components that are visible at runtime.

Unit

controls

Description

Controls are visual components, meaning the user can see them and manipulate them at runtime. All controls have properties, methods, and events in common that are specific to the visual aspect of controls, such as the position of the control, the cursor or hint associated with the control’s window, methods to paint or move the control, and events to respond to mouse actions.

TControl has many protected properties and methods that are used or published by its descendants.


TControl properties

TControl	Alphabetically	Legend

In TControl

Action

ActionLink

Align

Anchors

AutoSize

BiDiMode

BoundsRect

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DesktopFont

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

HostDockSite

Hint

IsControl

Left

LRDockWidth

MouseCapture

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ScalingFlags

ShowHint

TBDockHeight

Text

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

WindowText

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TControl properties

TControl	By object	Legend

Action

ActionLink

Align

Anchors

AutoSize

BiDiMode

BoundsRect

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlState

ControlStyle

Cursor

DesignInfo

DesktopFont

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

IsControl

Left

LRDockWidth

MouseCapture

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ScalingFlags

ShowHint

Tag

TBDockHeight

Text

Top

UndockHeight

UndockWidth

VCLComObject

Visible

Width

WindowProc

WindowText


TControl.Action

TControl	Properties

Designates the action associated with the control.

property Action: TBasicAction;

Description

Action is the action object that is associated with the control. Actions allow an application to centralize the response to user commands. When a control is associated with an action, the action determines the appropriate properties and events of the control (such as whether the control is enabled or how it responds to an OnClick event).

To create actions at design time, place an action list component on a form or data module. Double click the action list to bring up the action list editor. Add actions in the editor using its context menu. Once the actions have been added using the action list editor, they appear in the drop-down list for the Action property in the Object Inspector.


TControl.ActionLink

TControl	Properties	See also

Contains the action link object associated with the control.

property ActionLink: TControlActionLink;

Description

ActionLink handles the association between the control and the action specified by the Action property. The action link determines which properties and events of the action object determine the values of corresponding properties and events of the control.

Most applications do not use the ActionLink property. Component writers can change this property in TControl descendants to be a custom descendant of TControlActionLink that handles a desired configuration of properties and events.


TControl.Align

TControl	See also 	Example

Determines how the control aligns within its container (parent control).

property Align: TAlign;

Description

Use Align to align a control to the top, bottom, left, or right of a form or panel and have it remain there even if the size of the form, panel, or component that contains the control changes. When the parent is resized, an aligned control also resizes so that it continues to span the top, bottom, left, or right edge of the parent.

For example, to use a panel component with various controls on it as a tool palette, change the panel’s Align value to alLeft. The value of alLeft for the Align property of the panel guarantees that the tool palette remains on the left side of the form and always equals the client height of the form.

The default value of Align is alNone, which means a control remains where it is positioned on a form or panel.

Tip:	If Align is set to alClient, the control fills the entire client area so that it is impossible to select the parent form by clicking on it. In this case, select the parent by selecting the control on the form and pressing Esc, or by using the Object Inspector.

Any number of child components within a single parent can have the same Align value, in which case they stack up along the edge of the parent. The child controls stack up in z-order. To adjust the order in which the controls stack up, drag the controls into their desired positions.

Note:	To cause a control to maintain a specified relationship with an edge of its parent, but not necessarily lie along one edge of the parent, use the Anchors property instead.


TControl.Anchors

TControl	See also

Specifies how the control is anchored to its parent.

property Anchors: TAnchors;

Description

Use Anchors to ensure that a control maintains its current position relative to an edge of its parent, even if the parent is resized. When its parent is resized, the control holds its position relative to the edges to which it is anchored.

If a control is anchored to opposite edges of its parent, the control stretches when its parent is resized. For example, if a control has its Anchors property set to [akLeft,akRight], the control stretches when the width of its parent changes.

Anchors is enforced only when the parent is resized. Thus, for example, if a control is anchored to opposite edges of a form at design time and the form is created in a maximized state, the control is not stretched because the form is not resized after the control is created.

Note:	If a control should maintain contact with three edges of its parent (hugging one side of the parent and stretching the length of that side), use the Align property instead. Unlike Anchors, Align allows controls to adjust to changes in the size of other aligned sibling controls as well as changes to the parent’s size.


TControl.AutoSize

TControl	See also

Specifies whether the control sizes itself automatically to accommodate its contents.

property AutoSize: Boolean;

Description

Use AutoSize to specify whether the control sizes itself automatically. When AutoSize is True, the control resizes automatically when its contents change.

By default, AutoSize is False.


TControl.BiDiMode

TControl	Properties	See also

Specifies the bi-directional mode for the control.

property BiDiMode: TBiDiMode;

Description

Use BiDiMode to enable the control to adjust its appearance and behavior automatically when the application runs in a locale that reads from right to left instead of left to right. The bi-directional mode controls the reading order for the text, the placement of the vertical scrollbar, and whether the alignment is changed.

Alignment does not change for controls that are known to contain number, date, time, or currency values. For example, with data aware controls, the alignment does not change for the following field types: ftSmallInt, ftInteger, ftWord, ftFloat, ftCurrency, ftBCD, ftDate, ftTime, ftDateTime, ftAutoInc.


TControl.BoundsRect

TControl	See also 	Example

Specifies the bounding rectangle of the control, expressed in the coordinate system of the parent control.

property BoundsRect: TRect;

Description

Use BoundsRect as a quick way to obtain the pixel locations of all corners of the control all at once.

For example, the statement

R := Control.BoundsRect;

corresponds to

R.Left := Control.Left;

R.Top := Control.Top;

R.Right := Control.Left + Control.Width;

R.Bottom := Control.Top + Control.Height;

The origin of the pixel coordinate system is in the top left corner of the parent window.


TControl.Caption

TControl	See also	Example

Specifies a text string that identifies the control to the user.

type TCaption = string;

property Caption: TCaption;

Description

Use Caption to specify the text string that labels the control.

To underline a character in a Caption that labels a component, include an ampersand (&) before the character. This type of character is called an accelerator character. The user can then select the component by pressing Alt while typing the underlined character. To display an ampersand character in the caption, use two ampersands (&&).

Note:	Controls that display text use either the Caption property or the Text property to specify the text value. Which property is used depends on the type of control. In general, Caption is used for text that appears as a window title or label, while Text is used for text that appears as the content of a control.


TControl.ClientHeight

TControl	See also

Specifies the height of the control's client area in pixels.

property ClientHeight: Integer;

Description

Use ClientHeight to read or change the height of the control’s client area.

For TControl, ClientHeight is the same as Height. Derived classes may implement a ClientHeight property that differs from Height. For example, the ClientHeight of a form is the value of the Height property minus the height of the title bar, resize border, and scrollbars.


TControl.ClientOrigin

TControl	See also

Specifies the screen coordinates (in pixels) of the top left corner of a control’s client area.

property ClientOrigin: TPoint;

Description

Read ClientOrigin to locate the top-left corner of the control’s client area. ClientOrigin returns X and Y coordinates as a TPoint type, where X specifies the horizontal coordinate of the point and Y specifies the vertical coordinate.

The screen coordinates of a control that is descended from TControl and not TWinControl are the screen coordinates of the control’s parent added to its Left and Top properties. If the control doesn’t have a parent, an EInvalidOperation exception is raised when ClientOrigin is read.


TControl.ClientRect

TControl	See also 	Example

Specifies the size (in pixels) of a control’s client area.

property ClientRect: TRect;

Description

Read ClientRect to find the size of the client area of a control. ClientRect returns a rectangle with its Top and Left fields set to zero, and its Bottom and Right fields set to the control's Height and Width, respectively. ClientRect is equivalent to Rect(0, 0, ClientWidth, ClientHeight).

Note:	ClientRect is the size of the physical client area of the control, not its logical client area. If the control supports scrolling, the ClientRect is not the entire scrolling range, but only the region that is available at any time.


TControl.ClientWidth

TControl	See also

Specifies the horizontal size of the control's client area in pixels.

property ClientWidth: Integer;

Description

Use ClientWidth to read or change the width of the control’s client area. ClientWidth is equivalent to ClientRect.Right.

For TControl, ClientWidth is the same as Width. Derived classes may implement a ClientWidth property that differs from Width. For example, the ClientWidth of a form is the value of the Width property minus the width of the resize border and scrollbars.


TControl.Color

TControl	See also 	Example

Specifies the background color of the control.

property Color: TColor;

Description

Use Color to read or change the background color of the control.

If a control's ParentColor property is True, then changing the Color property of the control's parent automatically changes the Color property of the control. When the value of the Color property is changed, the control's ParentColor property is automatically set to False.


TControl.Constraints

TControl	See also

Specifies the size constraints for the control.

property Constraints: TSizeConstraints;

Description

Use Constraints to specify the minimum and maximum width and height of the control. When Constraints contains maximum or minimum values, the control can’t be resized to violate those constraints.

Warning:	Do not set up constraints that conflict with the value of the Align or Anchors property. When these properties conflict, the response of the control to resize attempts is not well-defined.


TControl.ControlState

TControl	See also

Indicates the current state of a control at runtime.

type TControlState = set of (csLButtonDown, csClicked, csPalette, csReadingState, csAlignmentNeeded, csFocusing, csCreating, csPaintCopy, csCustomPaint, csDestroyingHandle, csDocking);

property ControlState: TControlState;

Description

Read ControlState to find out various conditions that affect the control such as whether it has been clicked or needs alignment. ControlState reflects transient conditions of an instance of the control, as opposed to attributes of the control class as a whole. ControlState consists of a set of flags drawn from the following values:

Flag	Meaning

csLButtonDown	The left mouse button was clicked and not yet released. This is set for all mouse-down events.

csClicked	The same as csLButtonDown, but only set if ControlStyle contains csClickEvents, meaning that mouse-down events are interpreted as clicks.

csPalette	The system palette has changed and the control or one of its descendants has not finished adjusting by realizing its palette.

csReadingState	The control is reading its state from a stream.

csAlignmentNeeded	The control needs to realign itself when alignment is re-enabled.

csFocusing	The application is processing messages intended to give the control focus. This does not guarantee the control will receive focus, but prevents recursive calls.

csCreating	The control and/or its owner and subcontrols are being created. This flag clears when all have finished creating.

csPaintCopy	The control is being replicated, meaning a copy of the control is being painted. The ControlStyle flag csReplicatable must be set for this state to occur.

csCustomPaint	The control is processing custom paint messages.

csDestroyingHandle	The control’s window is being destroyed.

csDocking	The control is being docked.

The flags in ControlState are specific to controls, and augment the state flags in the ComponentState property, which apply to all components.

ControlState is primarily used by component writers in the implementation of components derived from TControl.


TControl.ControlStyle

TControl	See also

Determines style characteristics of the control.

type TControlStyle = set of (csAcceptsControls, csCaptureMouse, csDesignInteractive, csClickEvents, csFramed, csSetCaption, csOpaque, csDoubleClicks, csFixedWidth, csFixedHeight, csNoDesignVisible, csReplicatable, csNoStdEvents, csDisplayDragImage, csReflector, csActionClient, csMenuEvents);

property ControlStyle: TControlStyle;

Description

Use ControlStyle to determine various attributes of the control, such as whether the control can capture the mouse or has a fixed size. The ControlStyle property contains a set of style flags indicating these attributes. The following table lists the flags and their meanings:

Flag	Meaning

csAcceptsControls	The control becomes the parent of any controls dropped on it at design time.

csCaptureMouse	The control captures mouse events when it is clicked.

csDesignInteractive	The control maps right mouse-button clicks at design time into left-button clicks to manipulate the control.

csClickEvents	The control can receive and respond to mouse clicks.

csFramed	The control has a 3D frame.

csSetCaption	The control’s Caption should match the Name property if it has not been explicitly set to something else.

csOpaque	The control completely fills its client rectangle.

csDoubleClicks	The control can receive and respond to double-click messages. Otherwise, map double-clicks into clicks.

csFixedWidth	The width of the control does not vary or scale.

csFixedHeight	The height of the control does not vary or scale.

csNoDesignVisible	The control is not visible at design time.

csReplicatable	The control can be copied using the PaintTo method to draw its image to an arbitrary canvas.

csNoStdEvents	Standard events such as mouse, key, and click events are ignored. This flag allows an application to run faster when there is no need respond to these events.

csDisplayDragImage	The control can display an image from an image list it is dragged with the mouse. Use this setting if the control implements an image list for drag-and-drop behavior.

csReflector	The control responds to Windows dialog messages, focus messages, or size change messages. Use this setting if the control can be used as an ActiveX control, so that it receives notification of these events.

csActionClient	The control is linked to an action object. This flag is set when the Action property is set, and cleared if the Action property is cleared.

csMenuEvents	The control responds to system menu commands.

ControlStyle generally describes an entire class, which all instances reflect. The flags do not change among different instances of a type of control, nor do they vary at runtime. Such transient conditions are indicated by the ControlState property.

The TControl constructor initializes ControlStyle to [csCaptureMouse,csClickEvents, csSetCaption, csDoubleClicks].

ControlStyle is primarily used by component writers when implementing components derived from TControl.


TControl.Cursor

TControl	See also 	Example

Specifies the image used to represent the mouse pointer when it passes into the region covered by the control.

property Cursor: TCursor;

Description

Change the value of Cursor to provide feedback to the user about what action is appropriate when the mouse pointer enters the control. The value of Cursor is the index of the cursor in the list of cursors maintained by the global variable, Screen. In addition to the built-in cursors provided by TScreen, applications can add custom cursors to the list.

Note:	The example shows how to make a custom cursor available to an application.


TControl.DesktopFont

TControl	See also

Specifies whether the control uses the Windows icon font when writing text.

property DesktopFont: Boolean;

Description

Set DesktopFont to True to specify that the control should use the Windows icon font for its Font property. The Windows icon font is the value of the IconFont property of the global Screen variable.

When DesktopFont is True, the control’s Font property updates every time the Windows icon font changes. This font can be changed by setting the IconFont property of the global Screen variable, or by the actions of other programs. Setting the Font property to Screen.IconFont does not allow controls to dynamically respond in this manner when the Windows icon font changes.


TControl.DockOrientation

TControl	Properties

Specifies how the control is docked relative to other controls docked in the same parent.

property DockOrientation: TDockOrientation;

Description

Use DockOrientation to determine the position of the control relative to other controls docked to the same parent. Docking zones can be arranged from left to right or from top to bottom.


TControl.DragCursor

TControl	See also

Indicates the image used to represent the mouse pointer when the control is being dragged.

property DragCursor: TCursor;

Description

Use the DragCursor property to change the cursor image presented when the control is being dragged.

Note:	To learn how to make a custom cursor available for the DragCursor property, see the Cursor property.


TControl.DragKind

TControl	See also

Specifies whether the control is being dragged normally or for docking.

property DragKind: TDragKind;

Description

Use DragKind to get or set whether the control participates in drag-and-drop operations, or drag-and-dock operations.


TControl.DragMode

TControl	See also

Determines how the control initiates drag-and-drop or drag-and-dock operations.

property DragMode: TDragMode;

Description

Use DragMode to control when the user can drag the control. Disable the drag-and-drop or drag-and-dock capability at runtime by setting the DragMode property value to dmManual. Enable automatic dragging by setting DragMode to dmAutomatic.


TControl.Enabled

TControl	See also

Controls whether the control responds to mouse, keyboard, and timer events.

property Enabled: Boolean;

Description

Use Enabled to change the availability of the control to the user. To disable a control, set Enabled to False. Disabled controls appear dimmed. If Enabled is False, the control ignores mouse, keyboard, and timer events.

To re-enable a control, set Enabled to True. The control is no longer dimmed, and the user can use the control.


TControl.Floating

TControl	See also

Indicates whether the control is floating.

property Floating: Boolean;

Description

Read Floating to determine whether a dockable control appears in a floating window, rather than docked to a parent control.

Note:	Use Floating rather than the Parent property to determine whether a control is free-floating. Floating controls may have a non-nil parent if the FloatingDockSiteClass specifies a floating window type.


TControl.FloatingDockSiteClass

TControl	See also

Specifies the class of the temporary control that hosts the control when it is floating.

type TWinControlClass = class of TWinControl;

property FloatingDockSiteClass: TWinControlClass;

Description

Use FloatingDockSiteClass to specify the class that houses the control when it is floating. When the control is undocked, a temporary control of this type is created and the control is docked to that control. When the control is docked to another control, the temporary floating dock site is freed.

If the control can float as a stand-alone window, FloatingDockSiteClass is nil.


TControl.Font

TControl	See also	Example

Controls the attributes of text written on or in the control.

property Font: TFont;

Description

To change to a new font, specify a new TFont object. To modify a font, change the value of the Charset, Color, Height, Name, Pitch, Size, or Style of the TFont object.


TControl.Height

TControl	See also	Example

Specifies the vertical size of the control in pixels.

property Height: Integer;

Description

Use the Height property to read or change the height of the control.


TControl.Hint

TControl	See also 	Example

Contains the text string that can appear when the user moves the mouse over the control.

property Hint: string;

Description

Use the Hint property to provide a string of help text either as a Help Hint, or as help text on a particular location such as a status bar.

A Help Hint is a box containing help text that appears for a control when the user moves the mouse pointer over the control and pauses momentarily. To set up Help Hints:

Specify the Hint property of each control for which a Help Hint should appear.

Set the ShowHint property of each appropriate control to True, or set the ParentShowHint property of all controls to True and set the ShowHint property of the form to True.

At runtime, set the value of the application's ShowHint property to True.

To show the Hint on a status bar or other location, use the OnHint event handler of the application. The application’s OnHint event occurs when the mouse pointer moves over the control.

Specify a hint to be used for both a Help Hint box and by an OnHint handler by specifying two values separated by a | character (the vertical bar “or” symbol). For example,

Edit1.Hint := 'Name|Enter Name in the edit box';

The 'Name' part appears in the Help Hint box and the 'Enter full name in the edit box' part can be extracted using the GetLongHint function for use in an OnHint event handler.

If Hint contains only one value, the entire string is used as a Help Hint and returned by the GetLongHint function. If a control has no Hint value specified, but its parent control does, the control uses the Hint value of the parent control (as long as the control's ShowHint property is True).

Note:	If the application's ShowHint property is False, the Help Hint won't appear, but the OnHint event handler is still called.


TControl.HostDockSite

TControl	See also

Specifies the control in which the control is docked.

property HostDockSite: TWinControl;

Description

Read HostDockSite to access the windowed control to which the control is docked. If the control is floating, HostDockSite is a temporary control of type FloatingDockSiteClass or (if there is no floating dock site class) nil.

Most applications should use the ManualDock method rather than setting HostDockSite. Setting HostDockSite automatically undocks the control from its previous host (if any) and docks it to the specified control, but does not adjust the control’s position and alignment and bypasses the standard docking events.

For dock clients, the value of HostDockSite is the same as the value of Parent. For controls that are not docking clients, HostDockSite is nil while Parent specifies the containing control.


TControl.IsControl

TControl	See also

Determines whether a form stores its form-specific properties to a stream.

property IsControl: Boolean;

Description

Use IsControl to use a form as a complex control, rather than as a desktop form. IsControl affects the way the form gets saved. When IsControl is True, form-specific properties do not get saved with the form. When IsControl is False, the form-specific properties get saved along with the other properties.

IsControl permits you to use the forms designer to create complex controls by creating those controls as forms, placing and naming their contained controls, and attaching code to events. After saving the form, edit the form as text, and in the text version set IsControl to True. The next time the form is loaded and saved, only those form properties appropriate to use as a control are stored, not the properties specific to TForm. Next, edit the form file as text, changing the type of the component from TForm to the desired control type, such as TPanel.


TControl.Left

TControl	See also 	Example

Specifies the horizontal coordinate of the left edge of a component relative to its parent.

property Left: Integer;

Description

Use the Left property to determine where the left side of the control begins or to reposition the left side of the control.

If the control is contained in another control, the Left and Top properties are relative to the parent control. If the control is contained directly by the form, the property values are relative to the form. For forms, the value of the Left property is relative to the screen in pixels.


TControl.LRDockWidth

TControl	See also

Specifies the width of the control when it is docked horizontally.

property LRDockWidth: Integer;

Description

Read LRDockWidth to get the width of the control from the last time it was docked horizontally. Set LRDockWidth to indicate the width the control should have the next time it is docked horizontally.

LRDockWidth allows a control to “remember” its docked size even when its width changes because it is undocked or docked with a vertical orientation.


TControl.MouseCapture

TControl	See also

Indicates whether the control has “captured” mouse events.

property MouseCapture: Boolean;

Description

Use MouseCapture to determine whether a control has captured the mouse. When a control captures the mouse, all subsequent mouse events go to that control until the user releases the mouse button.

A control captures the mouse when the user drags an item from it. In addition, if the control has the csCaptureMouse flag set in its ControlStyle property, it captures the mouse when the user presses the left mouse button over it, until the user releases the mouse button.


TControl.Name

TControl	See also

Specifies the name of the control as referenced in code.

property Name: TComponentName;

Description

Use the Name property to assign a new name to the control or to find out what the name of the control is.

By default, the IDE assigns sequential names based on the type of the control, such as 'Button1', 'Button2', and so on. Change these to more meaningful names that make the application’s code more readable. The Name must be a valid Object Pascal identifier.

If the control’s Caption has not already been modified, Caption is changed to match a new control name.

Warning:	Change control names only at design time.


TControl.Parent

TControl	See also 	Example

Inidicates the parent of the control.

property Parent: TWinControl;

Description

Use the Parent property to get or set the parent of this control. The parent of a control is the windowed control that contains the control. If one control (parent) contains others, the contained controls are child controls of the parent. For example, if an application includes three radio buttons in a group box, the group box is the parent of the three radio buttons, and the radio buttons are the child controls of the group box.

When creating a new control at runtime, assign a Parent property value for the new control. Usually, this is a form, panel, group box, or some control that is designed to contain another. Changing the parent of a control moves the control onscreen so that it is displayed within the new parent. When the parent control moves, the child moves with the parent.

Some controls (such as ActiveX controls) are contained in non-VCL windows rather than in a parent control. For these controls, the value of Parent is nil and the ParentWindow property specifies the non-VCL parent window.

Note:	Don't confuse the Parent property declared in TControl with the Owner property declared in TComponent. The Parent of a control is always a windowed control that visually contains the control, and which is responsible for writing the control to a stream when the form is saved. The Owner of a component is the component that was passed as a parameter in the constructor and that controls when the component is freed.


TControl.ParentBiDiMode

TControl	See also

Specifies whether the control uses its parent’s BiDiMode.

property ParentBiDiMode: Boolean;

Description

Use ParentBiDiMode to get or set whether the control uses its parent’s BiDiMode. When ParentBiDiMode is True, the control’s BiDiMode property is always equal to that of its parent. If ParentBiDiMode is False, the control uses its own BiDiMode property.

Set ParentBiDiMode to True for all controls in a form in order to ensure that the entire user interface adjusts to Middle Eastern locales in a uniform manner.

When the value of the control's BiDiMode property changes, ParentBiDiMode becomes False automatically.


TControl.ParentColor

TControl	See also

Determines where a control looks for its color information.

property ParentColor: Boolean;

Description

To have a control use the same color as its parent control, set ParentColor to True. If ParentColor is False, the control uses its own Color property.

Set ParentColor to True for all controls in order to ensure that all the controls on a form have a uniform appearance. For example, if ParentColor is True for all controls in a form, changing the background color of the form to gray causes all the controls on the form to also have a gray background.

When the value of a control's Color property changes, ParentColor becomes False automatically.


TControl.ParentFont

TControl	See also

Determines where a control looks for its font information.

property ParentFont: Boolean;

Description

To have a control use the same font as its parent control, set ParentFont to True. If ParentFont is False, the control uses its own Font property.

Set ParentFont to True for all controls in order to ensure that all the controls on a form have a uniform appearance. For example, if ParentFont is True for all controls in a form, changing the form’s Font property to 12-point Courier causes all controls on the form to use that font.

When the value of a control's Font property changes, ParentFont becomes False automatically.

When ParentFont is True for a form, the form uses the default font.


TControl.ParentShowHint

TControl	See also

Determines where a control looks to find out if its Help Hint should be shown.

property ParentShowHint: Boolean;

Description

Use ParentShowHint to ensure that all the controls on a form either uniformly show their Help Hints or uniformly don't show them.

If ParentShowHint is True, the control uses the ShowHint property value of its parent. If ParentShowHint is False, the control uses the value of its own ShowHint property.

To provide Help Hints for only selected controls on a form, set the ShowHint property for those controls that should have Help Hints to True, and ParentShowHint becomes False automatically.

Note:	Enable or disable all Help Hints for the entire application using the ShowHint property of the application object.


TControl.PopupMenu

TControl	See also 	Example

Identifies the pop-up menu associated with the control.

property PopupMenu: TPopupMenu;

Description

Assign a value to PopupMenu to make a pop-up menu appear when the user selects the control and clicks the right mouse button. If the TPopupMenu’s AutoPopup property is True, the pop-up menu appears automatically. If the menu’s AutoPopup property is False, display the menu with a call to its Popup method from the control’s OnContextPopup event handler.


TControl.ScalingFlags

TControl	See also

Reflects which attributes of the control have been scaled.

type TScalingFlags = set of (sfLeft, sfTop, sfWidth, sfHeight, sfFont);

property ScalingFlags: TScalingFlags;

Description

ScalingFlags is an internal set of flags used primarily in scaling inherited forms and their controls. Applications should not use this property without a serious need.

These are the flags and their meanings:

Flag	Meaning

sfLeft	Left side of control not yet scaled.

sfTop	Top of control not yet scaled.

sfWidth	Width of control not yet scaled.

sfHeight	Height of control not yet scaled.

sfFont	Font of control not yet scaled.


TControl.ShowHint

TControl	See also 	Example

Determines whether the control displays a Help Hint when the mouse pointer rests momentarily on the control.

property ShowHint: Boolean;

Description

The Help Hint is the value of the Hint property, which is displayed in a box just beneath the control. Use ShowHint to determine whether a Help Hint appears for the control.

To enable Help Hint for a particular control, the application ShowHint property must be True and either

the control’s own ShowHint property must be True, or

the control’s ParentShowHint property must be True and its parent's ShowHint property must be True.

For example, imagine a check box within a group box. If the ShowHint property of the group box is True and the ParentShowHint property of the check box is True, but the ShowHint property of the check box is False, the check box still displays its Help Hint.

Changing the ShowHint value automatically sets the ParentShowHint property to False.


TControl.TBDockHeight

TControl	See also

Specifies the height of the control when it is docked vertically.

property TBDockHeight: Integer;

Description

Read TBDockHeight to get the height of the control from the last time it was docked vertically. Set TBDockHeight to indicate the height the control should have the next time it is docked vertically.

TBDockHeight allows a control to “remember” its docked size even when its height changes because it is undocked or docked with a horizontal orientation.


TControl.Text

TControl	See also 	Example

Contains a text string associated with the control.

type TCaption = string;

property Text: TCaption;

Description

Use the Text property to read the Text of the control or specify a new string for the Text value. By default, Text is the control name. For edit controls and memos, the Text appears within the control. For combo boxes, the Text is the content of the edit control portion of the combo box.

Note:	Controls that display text use either the Caption property or the Text property to specify the text value. Which property is used depends on the type of control. In general, Caption is used for text that appears as a window title or label, while Text is used for text that appears as the content of a control.


TControl.Top

TControl	See also	Example

Specifies the Y coordinate of the top left corner of a control, relative to its parent or containing control in pixels.

property Top: Integer;

Description

Use Top to locate the top of the control or reposition the control to a different Y coordinate. The Top property, like the Left property, is the position of the control relative to its container. Thus, if a control is contained in a TPanel, the Left and Top properties are relative to the panel. If the control is contained directly by the form, it is relative to the form. For forms, the value of the Top property is relative to the screen in pixels.


TControl.UndockHeight

TControl	See also

Specifies the height of the control when it is floating.

property UndockHeight: Integer;

Description

Read UndockHeight to get the height of the control from the last time it was floating. Set UndockHeight to indicate the height the control should have the next time it is undocked.

UndockHeight allows a control to “remember” its floating size even when its height changes because it is docked.


TControl.UndockWidth

TControl	See also

Specifies the width of the control when it is floating.

property UndockWidth: Integer;

Description

Read UndockWidth to get the width of the control from the last time it was floating. Set UndockWidth to indicate the width the control should have the next time it is undocked.

UndockWidth allows a control to “remember” its floating size even when its width changes because it is docked.


TControl.Visible

TControl	See also	Example

Determines whether the component appears onscreen.

property Visible: Boolean;

Description

Use the Visible property to control the visibility of the control at runtime. If Visible is True, the control appears. If Visible is False, the control is not visible.

Calling the Show method sets the control's Visible property to True. Calling the Hide method sets it to False.


TControl.Width

TControl	See also

Specifies the horizontal size of the control or form in pixels.

property Width: Integer;

Description

Use the Width property to read or change the width of the control.

Note:	For tab sheet controls, changing this property at runtime has no effect.


TControl.WindowProc

TControl	See also	Example

Points to the window procedure that responds to messages sent to the control.

type TWndMethod = procedure(var Message: TMessage) of object;

property WindowProc: TWndMethod;

Description

Use the WindowProc property to temporarily replace or subclass the window procedure of the control. Component writers that are customizing the window procedure for a descendant class should override the WndProc method instead.

Before assigning a new value to WindowProc, store the original value. WindowProc is initially set to the WndProc method, so if the value has not been changed since then, the original value need not be stored. Within the procedure that is used as the new value for WindowProc, pass any unhandled messages to the original procedure that was the value of WindowProc. After completing any specialized message handling, restore the value of WindowProc to the original procedure.


TControl.WindowText

TControl	See also

Contains the text string of the control.

property WindowText: PChar;

Description

Use WindowText to determine the text associated with the control. When setting WindowText, the control frees the memory associated with the previous value of WindowText before assigning a new value. Any memory associated with WindowText is freed when the control is destroyed. By default, WindowText is the same string as the Text property. Descendants of TControl can override the Text property to implement a different value.

For an edit box, the WindowText is the content of the control. For a combo box, the text string is the content of the edit box part of the combo box. For a button, the string is the button name. For all other controls, the string is the window title.


TControl events

TControl	Alphabetically	Legend

In TControl

OnCanResize

OnClick

OnConstrainedResize

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock

OnStartDrag


TControl events

TControl	By object	Legend

OnCanResize

OnClick

OnConstrainedResize

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock

OnStartDrag


TControl.OnCanResize

TControl	See also

Occurs when an attempt is made to resize the control.

property OnCanResize: TCanResizeEvent;

Description

Use OnCanResize to adjust the way a control is resized. If necessary, change the new width and height of the control in the OnCanResize event handler. The OnCanResize event handler also allows applications to indicate that the entire resize should be aborted.

If there is no OnCanResize event handler, or if the OnCanResize event handler indicates that the resize attempt can proceed, the OnCanResize event is followed immediately by an OnConstrainedResize event.


TControl.OnClick

TControl	See also	Example

Occurs when the user clicks the control.

property OnClick: TNotifyEvent;

Description

Use the OnClick event handler to write code that responds when the user clicks the control. If the control has an associated action, and that action has an OnExecute method, the action’s OnExecute method responds to click events unless it is superseded by an OnClick event handler.

Usually OnClick occurs because the user presses and releases the primary mouse button with the mouse pointer over the control. This event can also occur when

The user selects an item in a grid, outline, list, or combo box by pressing an arrow key.

The user presses Spacebar while a button or check box has focus.

The user presses Enter when the active form has a default button (specified by the Default property).

The user presses Esc when the active form has a cancel button (specified by the Cancel property).

The user presses the accelerator key for a button or check box. For example, if the value of the Caption property of a check box is '&Bold', the B is underlined at runtime and the OnClick event of the check box is triggered when the user presses Alt+B.

The Checked property of a radio button is set to True.

The value of the Checked property of a check box is changed.

The Click method of a menu item is called.

For a form, an OnClick event occurs when the user clicks a blank area of the form or on a disabled component.


TControl.OnConstrainedResize

TControl	See also

Occurs immediately after OnCanResize.

property OnConstrainedResize: TConstrainedResizeEvent;

Description

Use OnConstrainedResize to adjust a control’s constraints when an attempt is made to resize it. Upon entry to the OnConstrainedResize event handler, the parameters of the event handler are set to the corresponding properties of the control’s Constraints object. The event handler can adjust those values before they are applied to the new height and width that is being applied to the control. (The CanAutoSize method or an OnCanResize event handler may already have adjusted this new height and width).

On exit from the OnConstrainedResize event handler, the constraints are applied to the attempted new height and width. Once the constraints are applied, the control’s height and width are changed. After the control’s height and width change, an OnResize event occurs to allow any final adjustments or responses.


TControl.OnContextPopup

TControl	See also

Occurs when the right-clicks the control or otherwise invokes the popup menu (such as using the keyboard).

property OnContextPopup: TContextPopupEvent;

Description

Write an OnContextPopup to create or display a popup menu for the control in response to user actions. OnContextPopup allows an application to centralize the response to a variety of user actions that are all intended to bring up a context menu.

This event is especially useful when the control does not have an associated popup menu (the PopupMenu property is not set) or if the AutoPopup property of the control’s associated popup menu is False. However, the OnContextPopup can also be used to override the automatic context menu that appears when the control has an associated popup menu with an AutoPopup property of True. In this last case, if the event handler displays its own menu, it should set the Handled parameter to True to suppress the default context menu.

Unless the Event handler sets the Handled parameter to True, the control looks up its associated popup menu and displays it if AutoPopup is True when the event handler exits.


TControl.OnDblClick

TControl	See also

Occurs when the user double-clicks the primary mouse button when the mouse pointer is over the control.

property OnDblClick: TNotifyEvent;

Description

Use the OnDblClick event to write code that responds to the double-click event.


TControl.OnDragDrop

TControl	See also 	Example

Occurs when the user drops an object being dragged.

type TDragDropEvent = procedure(Sender, Source: TObject; X, Y: Integer) of object;

property OnDragDrop: TDragDropEvent;

Description

Use the OnDragDrop event handler to specify what happens when the user drops an object. The Source parameter of the OnDragDrop event is the object being dropped, and the Sender is the control the object is being dropped on. The X and Y parameters are the coordinates of the mouse positioned over the control.


TControl.OnDragOver

TControl	See also 	Example

Occurs when the user drags an object over a control.

type

  TDragOverEvent = procedure(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean) of object;

property OnDragOver: TDragOverEvent;

Description

Use an OnDragOver event to signal that the control can accept a dragged object so the user can drop or dock it.

Within the OnDragOver event handler, change the Accept parameter to False to reject the dragged object. Leave Accept as True to allow the user to drop or dock the dragged object on the control.

To change the shape of the cursor, indicating that the control can accept the dragged object, change the value of the DragCursor property for the control before the OnDragOver event occurs.

The Source is the object being dragged, the Sender is the potential drop or dock site, and X and Y are screen coordinates in pixels. The State parameter specifies how the dragged object is moving over the control.

Note:	Within the OnDragOver event handler, the Accept parameter defaults to True. However, if an OnDragOver event handler is not supplied, the control rejects the dragged object, as if the Accept parameter were changed to False.


TControl.OnEndDock

TControl	See also

Occurs when the dragging of an object ends, either by docking the object or by canceling the dragging.

property OnEndDock: TEndDragEvent;

Description

Use OnEndDock to specify actions or special processing that when a drag-and-dock operation stops.


TControl.OnEndDrag

TControl	See also 	Example

Occurs when the dragging of an object ends, either by dropping the object or by canceling the dragging.

property OnEndDrag: TEndDragEvent;

Description

Use the OnEndDrag event handler to specify any special processing that occurs when dragging stops.


TControl.OnMouseDown

TControl	See also 	Example

Occurs when the user presses a mouse button with the mouse pointer over a control.

type TMouseEvent = procedure (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer) of object;

property OnMouseDown: TMouseEvent;

Description

Use the OnMouseDown event handler to implement any special processing that should occur as a result of pressing a mouse button.

The OnMouseDown event handler can respond to left, right, or center mouse button presses and shift key plus mouse-button combinations. Shift keys are the Shift, Ctrl, and Alt keys. X and Y are the pixel coordinates of the mouse pointer in the client area of the Sender.


TControl.OnMouseMove

TControl	See also 	Example

Occurs when the user moves the mouse pointer while the mouse pointer is over a control.

type TMouseMoveEvent = procedure(Sender: TObject; Shift: TShiftState; X, Y: Integer) of object;

property OnMouseMove: TMouseMoveEvent;

Description

Use the OnMouseMove event handler to respond when the mouse pointer moves after the control has captured the mouse.

Use the Shift parameter of the OnMouseDown event handler, to determine to the state of the shift keys and mouse buttons. Shift keys are the Shift, Ctrl, and Alt keys or shift key-mouse button combinations. X and Y are pixel coordinates of the new location of the mouse pointer in the client area of the Sender.


TControl.OnMouseUp

TControl	See also 	Example

Occurs when the user releases a mouse button that was pressed with the mouse pointer over a component.

type TMouseEvent = procedure (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer) of object;

property OnMouseUp: TMouseEvent;

Description

Use an OnMouseUp event handler to implement special processing when the user releases a mouse button.

The OnMouseUp event handler can respond to left, right, or center mouse button presses and shift key plus mouse-button combinations. Shift keys are the Shift, Ctrl, and Alt keys. X and Y are the pixel coordinates of the mouse pointer in the client area of the Sender.


TControl.OnResize

TControl	See also

Occurs immediately after the control is resized.

property OnResize: TNotifyEvent;

Description

Use OnResize to make any final adjustments after a control is resized.

To modify the way a control responds when an attempt is made to resize it, use the OnCanResize or OnConstrainedResize events instead.


TControl.OnStartDock

TControl	See also

Occurs when the user begins to drag a control with a DragKind of dkDock.

property OnStartDock: TStartDockEvent;

Description

Use the OnStartDock event handler to implement special processing when the user starts a drag-and-dock operation by dragging the control.

The OnStartDock event handler can create a TDragDockObject object for the DragObject parameter to specify the appearance of the dragging rectangle and how the dragged control interacts with potential docking sites . There is no need to call the Free method for the DragObject when dragging is over.

If the OnStartDock event handler sets the DragObject parameter to nil, a TDragDockObject object is automatically created.


TControl.OnStartDrag

TControl	See also

Occurs when the user begins to drag the control or an object it contains by left-clicking on the control and holding the mouse button down.

type TStartDragEvent = procedure (Sender: TObject; var DragObject: TDragObject) of object;

property OnStartDrag: TStartDragEvent;

Description

Use the OnStartDrag event handler to implement special processing when the user starts to drag the control or an object it contains. OnStartDrag only occurs if DragKind is dkDrag.

Sender is the control that is about to be dragged, or that contains the object about to be dragged.

The OnStartDrag event handler can create a TDragControlObject instance for the DragObject parameter to specify the drag cursor, or, optionally, a drag image list. There is no need to call the Free method for the DragObject when dragging is over.

If the OnStartDrag event handler sets the DragObject parameter to nil, a TDragControlObject object is automatically created and dragging begins on the control itself.


TControl methods

TControl	Alphabetically	Legend

In TControl

ActionChange

AdjustSize

AssignTo

BeginAutoDrag

BeginDrag

BringToFront

CanAutoSize

CanResize

Changed

ChangeScale

Click

ClientToScreen

ConstrainedResize

Create

DblClick

DefaultDockImage

DefaultHandler

DefineProperties

Destroy

Dock

DockTrackNoTarget

DoContextPopup

DoDock

DoEndDock

DoEndDrag

DoStartDock

DoStartDrag

DragCanceled

DragDrop

Dragging

DragOver

DrawDragDockImage

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

EraseDragDockImage

GetActionLinkClass

GetClientOrigin

GetClientRect

GetControlsAlignment

GetDeviceContext

GetDockEdge

GetDragImages

GetEnabled

GetFloating

GetFloatingDockSiteClass

GetPalette

GetParentComponent

GetPopupMenu

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

Invalidate

IsRightToLeft

Loaded

ManualDock

ManualFloat

MouseDown

MouseMove

MouseUp

Notification

PaletteChanged

Perform

PositionDockRect

ReadState

Refresh

Repaint

ReplaceDockedControl

RequestAlign

Resize

ScreenToClient

SendCancelMode

SendDockNotification

SendToBack

SetBiDiMode

SetBounds

SetDragMode

SetEnabled

SetName

SetParent

SetParentBiDiMode

SetParentComponent

SetTextBuf

SetZOrder

Show

Update

UpdateBoundsRect

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

VisibleChanging

WndProc

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TControl methods

TControl	By object	Legend

ActionChange

AdjustSize

AfterConstruction

Assign

AssignTo

BeforeDestruction

BeginAutoDrag

BeginDrag

BringToFront

CanAutoSize

CanResize

Changed

ChangeScale

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Click

ClientToScreen

ConstrainedResize

Create

DblClick

DefaultDockImage

DefaultHandler

DefineProperties

Destroy

DestroyComponents

Destroying

Dispatch

Dock

DockTrackNoTarget

DoDock

DoContextPopup

DoEndDock

DoEndDrag

DoStartDock

DoStartDrag

DragCanceled

DragDrop

Dragging

DragOver

DrawDragDockImage

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

EraseDragDockImage

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetActionLinkClass

GetClientOrigin

GetClientRect

GetControlsAlignment

GetDeviceContext

GetDockEdge

GetDragImages

GetEnabled

GetFloating

GetFloatingDockSiteClass

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetPalette

GetParentComponent

GetPopupMenu

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InstanceSize

Invalidate

IsRightToLeft

Loaded

ManualDock

ManualFloat

MethodAddress

MethodName

MouseDown

MouseMove

MouseUp

NewInstance

Notification

PaletteChanged

Perform

PositionDockRect

ReadState

Refresh

RemoveComponent

Repaint

ReplaceDockedControl

RequestAlign

Resize

SafeCallException

ScreenToClient

SendCancelMode

SendDockNotification

SendToBack

SetBiDiMode

SetBounds

SetDragMode

SetEnabled

SetName

SetParent

SetParentBiDiMode

SetParentComponent

SetTextBuf

SetZOrder

Show

Update

UpdateAction

UpdateBoundsRect

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

VisibleChanging

WndProc


TControl.ActionChange

TControl	See also

Responds when the action associated with the control changes.

procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); dynamic;

Description

ActionChange is called automatically when the action object specified by the Action property, or any of its properties, changes. By default, the control’s action link’s OnChange event handler calls ActionChange.

ActionChange updates the control properties that correspond to properties of the associated action. These properties include the Caption, Enabled, Hint, and Visible properties and the OnClick event handler.

The Sender parameter is the action object that changed. The CheckDefaults parameter indicates whether the control’s properties should all be updated or only those that have not been explicitly changed from their default values. When CheckDefaults is True, only those properties and event handlers that have not been changed from the default values are updated.


TControl.AdjustSize

TControl	See also

Sets the size of the control as determined by its AutoSize property.

procedure AdjustSize; dynamic;

Description

If the AutoSize property is True, AdjustSize is called automatically when the control needs to automatically resize itself to its contents. As implemented in TControl, AdjustSize calls SetBounds with the values of its Left, Top, Width, and Height properties. This call can result in a change of size if these values are altered in the control’s OnCanResize or OnConstrainedResize event handlers, or if the control’s OnResize event handler makes any final adjustments.

Descendant classes override AdjustSize to change the size of the control to adjust to its contents.

Component writers may call AdjustSize when making changes to a control’s contents.


TControl.AssignTo

TControl	See also

Overrides the inherited AssignTo function to enable assignments to TAction objects.

procedure AssignTo(Dest: TPersistent); override;

Description

Do not call the protected AssignTo method. The Assign method of a persistent object calls AssignTo if it is passed the control as a Source and the persistent object does not know how to copy the properties of the control. The Dest parameter is the persistent object that should have its properties copied from the control.

As implemented in TControl, AssignTo checks whether the Dest parameter is a TCustomAction object, and if so, assigns values to its Enabled, Hint, Caption, and Visible properties and its OnExecute event. This allows arbitrary controls to assign these to an associated action object.


TControl.BeginAutoDrag

TControl	See also

Called when the left mouse button is clicked on the control if DragMode is dmAutomatic.

procedure BeginAutoDrag; dynamic;

Description

Override BeginAutoDrag in a derived class to perform actions when automatic dragging begins.

As implemented in TControl, BeginAutoDrag calls BeginDrag, passing in the global Mouse variable’s DragImmediate and DragThreshold properties.


TControl.BeginDrag

TControl	See also

Starts the dragging of a control.

procedure BeginDrag(Immediate: Boolean; Threshold: Integer = -1);

Description

Call BeginDrag to start a drag operation. An application needs to call the BeginDrag method to begin dragging only when the value of the control’s DragMode is dmManual.

If the Immediate parameter is True, the mouse pointer changes to the value of the DragCursor property and dragging begins immediately. If Immediate is False, the mouse pointer doesn't change to the value of the DragCursor property and dragging doesn't begin until the user moves the mouse pointer the number of pixels specified by the Threshold parameter. If the caller passes a Threshold value less than 0 (such as the default value for this parameter), BeginDrag uses the DragThreshold property of the global Mouse variable.

Setting Immediate to False allows the control to accept mouse clicks without beginning a drag-and-drop or drag-and-dock operation.


TControl.BringToFront

TControl	See also 	Example

Puts the control in front of all other controls in its parent control.

procedure BringToFront;

Description

Call BringToFront to ensure that a form is visible or to reorder overlapping controls within a form.

The order in which controls stack on top of each other (called the Z order) depends on the order the controls are placed on the form. For example, if you put a label and an image on a form so that one is on top of the other, the one that was placed first on the form becomes the one on the bottom. Because both the label and the image are non-windowed controls, they “stack” as you would expect them to. Call the BringToFront method for the bottom object to make it appear on top.

The stacking order of two windowed controls is the same as the stacking of two non-windowed controls. For example, if you put a memo on a form, then put a check box on top of it, the check box remains on top. Calling BringToFront for the memo moves the memo so that it appears on top.

The stacking order of windowed and non-windowed controls cannot be mingled. For example, if you put a memo (a windowed control) on a form, and then put a label (a non-windowed control) on top of it, the label disappears behind the memo. Windowed controls always stack on top of non-windowed controls. In this example, calling the BringToFront method of the label does nothing, the label remains behind the memo.


TControl.CanAutoSize

TControl	See also

Indicates whether the control can resize itself automatically to accommodate its contents.

function CanAutoSize(var NewWidth, NewHeight: Integer): Boolean; virtual;

Description

CanAutoSize is called automatically when the AutoSize property is True and an attempt is made to resize the control. It allows controls to implement the AutoSize property before the resize sequence that begins with the OnCanResize and OnConstrainedResize events and ends with the OnResize event.

When CanAutoSize is called, the NewWidth and NewHeight parameters indicate the proposed new dimensions of the control. CanAutoSize adjusts these values so that the control’s size adjusts to its contents. If the adjustment results in values of NewWidth and NewHeight that differ from the control’s current width and height, CanAutoSize returns True, indicating that the resize sequence should proceed. If, after adjustment, NewWidth and NewHeight equal Width and Height, CanAutoSize returns False, and the resize sequence is aborted.

As implemented in TControl, CanAutoSize always returns True without changing NewWidth or NewHeight. Override CanAutoSize to implement the AutoSize property for a particular control class’s contents.


TControl.CanResize

TControl	See also

Generates an OnCanResize event.

function CanResize(var NewWidth, NewHeight: Integer): Boolean;

Description

CanResize is called automatically when an attempt is made to resize the control, after any autosizing has occurred. The NewWidth and NewHeight parameters specify the attempted new values for the control’s height and width. CanResize optionally adjusts the values of NewWidth and NewHeight, and returns True if the control can be resized to the returned values. CanResize returns False if the control can’t be resized.

CanResize generates an OnCanResize event. An OnCanResize event handler may change the values of NewHeight and NewWidth.


TControl.Changed

TControl	See also

Sends a CM_CHANGED message to the control.

procedure Changed;

Description

Call Changed after changing the properties of the control in a way that affects the properties of a parent object. Changed sends a CM_CHANGED message back to the control. If the control is a windowed control, this message is bubbled up to the parent so that it can make any necessary adjustments.


TControl.ChangeScale

TControl	See also

Repositions and resizes the control by a specified ratio.

procedure ChangeScale(M, D: Integer); dynamic;

Description

Use ChangeScale to rescale a control. ChangeScale modifies the position as well as the size of a control. Thus, ChangeScale modifies the control’s Top, Left, Width, and Height properties.

The M and D parameters define a fraction by which to scale the control. The M parameter is the multiplier and the D parameter is the divisor. For example, to make a control 75% of its original size, specify the value of M as 75, and the value of D as 100 (75/100). Alternately, the same results are achieved by specifying the value of M as 3, and the value of D as 4 (3/4). Both fractions are equal and result in the control being scaled by the same amount, 75%.

To scale the control to be 33% larger than its previous size, specify the value of M as 133, and the value of D as 100 (133/100). Alternately, specify the value of M as 4, and the value of D as 3 (4/3), as the fraction 133/100 is approximately equal to 4/3.

Descendants of TControl may override ChangeScale. For example, a control that defines additional font properties should scale the heights of these fonts by the M/D ratio so that all the control’s fonts scale uniformly. Similarly, any control that subdivides its client area into display regions and displays text in those regions should override ChangeScale to ensure those regions resize when the font does.

Note:	Because control sizes and coordinates are integers, scaling them by the M/D ratio incurs some degree of roundoff error. Calling ChangeScale repeatedly means that at some point the control may disappear (when the roundoff errors make the control smaller), or creep off the form (when the roundoff errors move the location of control). When rescaling a control repeatedly, consider destroying and reloading the form after several rescalings so that the coordinates are rescaled without most of the accumulating roundoff error.


TControl.Click

TControl	See also

Generates an OnClick event.

procedure Click; dynamic;

Description

Click calls any event handler attached to the OnClick event. Override Click to provide other responses in addition to the inherited event-handler call when the user clicks the control.

A control calls Click whenever it receives a left-button mouse-up message (WM_LBUTTONUP) if that message indicates that the mouse up occurred near the corresponding mouse-down. Many controls call Click in other circumstances, such as when a user types the shortcut key for a button or menu item.

See the OnClick event for a description of all occurrences that trigger click events.


TControl.ClientToScreen

TControl	See also

Translates a given point from client area coordinates to global screen coordinates.

function ClientToScreen(const Point: TPoint): TPoint;

Description

Use ClientToScreen to convert a point whose coordinates are expressed locally to the control to the corresponding point in screen coordinates. In client area coordinates (0, 0) corresponds to the upper left corner of the control's client area. In screen coordinates (0, 0) corresponds to the upper left corner of the screen.

Use ScreenToClient along with ClientToScreen to convert from one control's coordinate system to another control's coordinate system. For example,

P := TargetControl.ScreenToClient(SourceControl.ClientToScreen(P));

converts P from coordinates in SourceControl to coordinates in TargetControl.


TControl.ConstrainedResize

TControl	See also

Generates an OnConstrainedResize event.

procedure ConstrainedResize(var MinWidth, MinHeight, MaxWidth, MaxHeight: Integer); virtual;

Description

ConstrainedResize is called automatically as part of a control’s resize sequence. It generates an OnConstrainedResize event, passing in the MinWidth, MinHeight, MaxWidth, and MaxHeight parameters, which can be altered by the event handler before they are applied to the attempted resize.


TControl.Create

TControl	See also	Example

Creates an instance of TControl.

constructor Create(AOwner: TComponent); override;

Description

Call Create to construct and initialize an instance of TControl.

After calling the inherited constructor, Create initializes the control, including the following property settings:

Anchors to [akLeft, akTop].

Color to clWindow.

ControlStyle to [csCaptureMouse, csClickEvents, csSetCaption, csDoubleClick].

DragCursor to crDrag.

Enabled and Visible to True.

IsControl to False.

ParentBiDiMode, ParentColor, ParentFont, and ParentShowHint to True.

WindowProc to the WndProc method.

When overriding Create, always call the inherited Create method first, then proceed with the control's initialization. Remember to specify the override directive when overriding the Create method.

Note:	If a component's constructor allocates resources or memory, also override the destructor to free those resources.


TControl.DblClick

TControl	See also

Generates an OnDblClick event.

procedure DblClick; dynamic;

Description

DblClick calls any event handler attached to the OnDblClick event. Override DblClick to provide other responses in addition to the inherited event-handler call when the user double-clicks the control.

The DblClick method is triggered by a left-button double-click message (WM_LBUTTONDBLCLICK) from Windows.


TControl.DefaultDockImage

TControl	See also

Handles the painting and erasing of a dock image.

procedure DefaultDockImage(DragDockObject: TDragDockObject; Erase: Boolean); dynamic;

Description

The DrawDragDockImage and EraseDragDockImage methods call DefaultDockImage to paint or erase the drag image of a control while the user drags it in a drag-and-dock operation.

DragDockObject contains the drag-and-dock information for the control.

Erase specifies whether to draw or erase the image.


TControl.DefaultHandler

TControl	See also

Provides message handling for all messages that do not have specific handlers.

procedure DefaultHandler(var Message); override;

Description

Override DefaultHandler to extend the default handling of messages. DefaultHandler is the final opportunity for component writers to handle messages to controls. The method referenced by WindowProc provides the first opportunity. Individual message methods such as Click provide additional opportunities.

DefaultHandler handles the messages Windows sends to manage the control's text: WM_GETTEXT, WM_SETTEXT, and WM_GETTEXTLENGTH.


TControl.DefineProperties

TControl	See also

Provides methods to read and write the IsControl property to a stream such as a form file.

procedure DefineProperties(Filer: TFiler); override;

Description

DefineProperties is called automatically by the streaming system that loads and saves VCL components. It allows persistent objects to read and write properties that are not published. Published properties are loaded and stored automatically.

DefineProperties uses the methods of the filer passed as the Filer parameter to assign methods that can load and save the IsControl property.

Override DefineProperties to persist unpublished properties. Call the DefineBinaryProperty or DefineProperty method of the Filer parameter to assign methods that load or save property values.

Note:	When overriding this method, call the inherited DefineProperties method first.


TControl.Destroy

TControl	See also

Destroys an instance of TControl.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the control is not nil, and only then calls Destroy.

Applications should only free controls explicitly when the constructor was called without assigning an owner to the control.

Override Destroy to free any memory or resources allocated in the Create method. When declaring a Destroy method in a descendant control type, always add the override directive to the declaration and call the inherited Destroy as the last statement in the redeclared method.

When a control is created, Delphi automatically provides exception handling around the constructor call. The destructor is called if an exception escapes from the constructor. This means that the destructor code must be prepared to clean up a partially constructed instance. Check all data fields for zero before disposing of their contents.


TControl.Dock

TControl	See also

Used internally to dock the control.

procedure Dock (NewDockSite: TWinControl; ARect: TRect); dynamic;

Description

Do not call Dock. It is called automatically to implement many of the details of docking the control to a dock site.

To dock the control programmatically, use ManualDock instead.

The NewDockSite parameter specifies the docking site to which the control is being docked. The ARect parameter indicates the new dimensions of the control when it is docked to NewDockSite.


TControl.DockTrackNoTarget

TControl	See also

Handles dragging of the control over an invalid docking target.

procedure DockTrackNoTarget(Source: TDragDockObject; X, Y: Integer); dynamic;

Description

DockTrackNoTarget is called automatically when the control is dragged over an invalid docking target. It updates the docking rectangle of the TDragDockObject specified by Source to reflect the current mouse coordinates, as given by X and Y.


TControl.DoContextPopup

TControl	See also

Generates an OnContextPopup event.

procedure DoContextPopup(MousePos: TPoint; var Handled: Boolean); dynamic;

Description

OnContextPopup calls any event handler attached to the OnContextPopup event. When creating a component that descends from TControl, override OnContextPopup to provide other responses in addition to the inherited event-handler call when the user invokes the control’s context menu.

MousePos indicates the position where the user right-clicked the control. If the user invoked the context menu using the keyboard, MousePos is (-1,-1).

Handled returns a boolean value indicating whether the control should continue with its default response to the user action.


TControl.DoDock

TControl	See also

Updates the control to reflect changes that occur when it is docked.

procedure DoDock (NewDockSite: TWinControl; ARect: TRect); dynamic;

Description

DoDock is called automatically as part of the docking process. It updates the control’s dimensions and causes it to repaint.

NewDockSite is the control’s new dock site. This value can be nil or NullDockSite (a constant defined in the controls unit to indicate no dock site).

ARect specifies the control’s new dimensions once it is docked to NewDockSite.


TControl.DoEndDock

TControl	See also

Generates an OnEndDock event.

procedure DoEndDock(Target: TObject; X, Y: Integer); dynamic;

Description

OnEndDock calls any event handler attached to the OnEndDock event. When creating a component that descends from TControl, override OnEndDock to provide other responses in addition to the inherited event-handler call when the user finishes a drag-and-dock operation.


TControl.DoEndDrag

TControl	See also

Generates an OnEndDrag event.

procedure DoEndDrag(Target:TObject); X, Y: Integer); dynamic;

Description

DoEndDrag calls any event handler attached to the OnEndDrag event. When creating a component that descends from TControl, override DoEndDrag to provide other responses in addition to the inherited event-handler call when the user drops an object or cancels a drag-and-drop operation.


TControl.DoStartDock

TControl	See also

Generates an OnStartDock event.

procedure DoStartDock(var DragObject: TDragObject); dynamic;

Description

DoStartDock calls any event handler attached to the OnStartDock event. When creating a component that descends from TControl, override DoStartDock to provide other responses in addition to the inherited event-handler call when the user starts a drag-and-dock operation.


TControl.DoStartDrag

TControl	See also

Generates an OnStartDrag event.

procedure DoStartDrag(var DragObject: TDragObject); dynamic;

Description

DoStartDrag calls any event handler attached to the OnStartDrag event. When creating a component that descends from TControl, override DoStartDrag to provide other responses in addition to the inherited event-handler call when the user starts a drag-and-drop operation.


TControl.DragCanceled

TControl	See also

Provides the interface for a method that responds to the cancellation of a drag.

procedure DragCanceled; dynamic;

Description

As implemented in TControl, DragCanceled does nothing. When creating a component that descends from TControl, override DragCanceled to provide code that executes when a drag-and-drop or drag-and-dock operation is canceled.


TControl.DragDrop

TControl	See also

Generates an OnDragDrop event.

procedure DragDrop(Source: TObject; X, Y: Integer);

Description

When creating a component that descends from TControl, override DragDrop to add additional code that executes before the OnDragDrop event handler is called.

The Source parameter is the object that was dropped onto the control. The X and Y parameters are the mouse coordinates where the object was dropped.


TControl.Dragging

TControl	See also

Indicates whether a control is being dragged.

function Dragging: Boolean;

Description

Use Dragging to determine the drag state of the control. If Dragging returns True, the control is being dragged. If Dragging is False, the control is not being dragged.


TControl.DragOver

TControl	See also

Generates an OnDragOver event.

procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); dynamic;

Description

Override DragOver to add additional code that executes before the OnDragOver event handler is called.

DragOver sets the Accept parameter to True to indicate that the user can drop the dragged object on the control. It sets Accept to False to indicate that the user can’t drop the dragged object on the control.

The Source parameter is the object being dragged. The State parameter indicates how the dragged object is moving in relation to the control. X and Y indicate the current position of the mouse.


TControl.DrawDragDockImage

TControl	See also

Draws the dock image for the control.

procedure DrawDragDockImage(DragDockObject: TDragDockObject); dynamic;

Description

DrawDragDockImage is called automatically to draw the control (or, more typically, the drag rectangle) when the control is manipulated in drag-and-dock operations.

DrawDragDockImage calls DefaultDockImage to render the image.


TControl.DrawTextBiDiModeFlags

TControl	See also

Returns the text flags that reflect the current setting of the BiDiMode property.

function DrawTextBiDiModeFlags(Flags: LongInt); LongInt;

Description

Call DrawTextBiDiModeFlags to obtain a value for a canvas’s TextFlags property when drawing the control’s text or caption. The return value can also be used with the Windows API DrawText function.

Flags are the current text flags, unaltered by any bi-directional mode considerations.

DrawTextBiDiModeFlags adds or removes the DT_RIGHT or DT_RTLREADING flags based on the values returned from the UseRightToLeftAlignment and UseRightToLeftReading methods.


TControl.DrawTextBiDiModeFlagsReadingOnly

TControl	See also

Returns the text flag to add that indicates whether the control’s text should read from right to left.

function DrawTextBiDiModeFlagsReadingOnly: LongInt;

Description

Call DrawTextBiDiModeFlagsReadingOnly to determine whether the DT_RTLREADING flag should be added when calling the Windows API DrawText or when assigning the TextFlags property of a canvas.

DrawTextBiDiModeFlagsReadingOnly returns the DT_RTLREADING flag or 0, depending on the value returned from the UseRightToLeftReading method.

To obtain the text flags that indicate the bi-directional alignment as well as text direction for the control, use DrawTextBiDiModeFlags instead.


TControl.EndDrag

TControl	See also

Stops a control from being dragged any further.

procedure EndDrag(Drop: Boolean);

Description

Use EndDrag to stop a dragging operation that began with a call to the BeginDrag method.

If the Drop parameter is True, the control being dragged is dropped or docked. If the Drop parameter is False, the control is not dropped or docked and dragging is canceled.


TControl.EraseDragDockImage

TControl	See also

Erases the dock image for the control.

procedure EraseDragDockImage(DragDockObject: TDragDockObject); dynamic;

Description

DrawDragDockImage is called automatically to erase the control (or, more typically, the drag rectangle) when the control is manipulated in drag-and-dock operations.

DrawDragDockImage calls DefaultDockImage to remove the image.


TControl.GetActionLinkClass

TControl	See also

Returns the appropriate action link class that is associated with the control class.

TControlActionLinkClass = class of TControlActionLink;

function GetActionLinkClass: TControlActionLinkClass; dynamic;

Description

GetActionLinkClass returns the appropriate class type for the action link used with a control. This class is used internally to create an action link object for the control when it has an associated action. The action link links the action to the control client. Each Action link class is designed to link specific properties and event handlers of the action to its client, based on the types of properties the client supports.

As implemented in TControl, GetActionLinkClass returns the TControlActionLink class type, which associates the ShowHint, Caption, Enabled and Visible properties and the OnClick event handler. Descendants of TControl override this method to specify a descendant of TControlActionLink that handles their configuration of properties and events.


TControl.GetClientOrigin

TControl	See also

Returns the screen coordinates of the top-left corner of the control’s client area.

function GetClientOrigin: TPoint; virtual;

Description

Override GetClientOrigin to change how the ClientOrigin is calculated.

The GetClientOrigin method is the protected method for reading the ClientOrigin property. GetClientOrigin calculates the ClientOrigin by adding the control’s Left and Top values to the ClientOrigin coordinates of its parent.


TControl.GetClientRect

TControl	See also

Returns a rectangle defining the client area of the control.

function GetClientRect: TRect; virtual;

Description

Override GetClientRect to change how the client area is calculated.

The GetClientRect method is the protected method for reading the ClientRect property. GetClientRect returns a rectangle with the rectangle’s Top and Left fields set to zero, and its Bottom and Right fields set to the control's ClientHeight and ClientWidth, respectively.


TControl.GetControlsAlignment

TControl	See also

Indicates how text is aligned within the control.

function GetControlsAlignment: TAlignment; dynamic;

Description

Use GetControlsAlignment to determine the alignment of the control. For controls that do not have an Alignment property, GetControlsAlignment returns taLeftJustify.

Note:	GetControlsAlignment returns the alignment of text before it is altered by the BiDiMode property. To check if the alignment should be reversed to reflect the BiDiMode property, call UseRightToLeftAlignment.


TControl.GetDeviceContext

TControl	See also	Example

Returns a device context for the control.

function GetDeviceContext(var WindowHandle: HWnd): HDC; virtual;

Description

Call GetDeviceContext to obtain a device context and window handle. Override GetDeviceContext to change how the device context is obtained.

The window handle used by the control is returned in the WindowHandle parameter. GetDeviceContext returns the device context of this, the parent control's window.


TControl.GetDockEdge

TControl	See also

Returns the edge on which another control should be docked when it is dragged over the control.

function GetDockEdge(MousePos: TPoint): TAlign; dynamic;

Description

Use GetDockEdge to get the edge on which another control should be docked when it is dragged over the control.

MousePos is the position of the mouse.

GetDockEdge is called automatically during drag-and-dock operations involving the control.


TControl.GetDragImages

TControl	See also

Returns the control's image list containing the image to be displayed while dragging.

function GetDragImages: TDragImageList; virtual;

Description

Override GetDragImages to provide a custom image list for the control. As implemented in TControl, GetDragImages returns nil.


TControl.GetEnabled

TControl	See also

Returns the value of the Enabled property.

function GetEnabled: Boolean; virtual;

Description

GetEnabled is the read implementation of the Enabled property.

Override GetEnabled and SetEnabled to change the implementation of the Enabled property. For example, A descendant of TControl might change the way the Enabled property interacts with an associated action.


TControl.GetFloating

TControl	See also

Returns the value of the Floating property.

function GetFloating: Boolean; virtual;

Description

GetFloating is the implementation of the read-only Floating property. GetFloating returns True if the HostDockSite property is either nil or of type FloatingDockSiteClass.

Override this method to change the way a control determines if it is floating.


TControl.GetFloatingDockSiteClass

TControl	See also

Returns the class used for the control when it is floating.

function GetFloatingDockSiteClass: TWinControlClass; virtual;

Description

GetFloatingDockSiteClass is the read implementation of the FloatingDockSiteClass property. Override this method to change the implementation of FloatingDockSiteClass.


TControl.GetPalette

TControl	See also

Returns the handle to a palette for use by the control.

function GetPalette: HPALETTE; dynamic;

Description

As implemented in TControl, GetPalette returns a null handle, indicating that the control does not have a palette. Override GetPalette to implement derived objects that use a palette. Create a palette handle for the control by a call to the Windows API function CreatePalette. GetPalette should return the palette handle for the control.

Specifying the palette for a control tells the application that the control's palette needs to be realized and designates the palette to use for realization.

GetPalette is called only if the run-time video mode requires color palette support, for example, in 256-color mode.


TControl.GetParentComponent

TControl	See also

Returns the parent of the control.

function GetParentComponent: TComponent; override;

Description

GetParentComponent is called by the streaming system that loads and saves VCL components. The component returned by GetParentComponent is responsible for loading and saving the control when it is streamed in or out. As implemented in TControl, GetParentComponent returns the value of the Parent property.


TControl.GetPopupMenu

TControl	See also

Returns the pop-up menu associated with the control.

function GetPopupMenu: TPopupMenu; dynamic;

Description

Call GetPopupMenu to find the popup menu associated with the control. Override GetPopupMenu to change which popup menu is associated with the control or to specify different popup menus depending on the state of the control.

GetPopupMenu returns the value of the Popup property.


TControl.GetTextBuf

TControl	See also 	Example

Retrieves the control's text, copies it into a buffer, and returns the number of characters copied.

function GetTextBuf(Buffer: PChar; BufSize: Integer): Integer;

Description

Call GetTextBuf to retrieve the text of a control into a fixed size buffer. The text copied is the value of the Text property. GetTextBuf returns the number of characters that were actually copied, which is either the length of the Text property, or BufSize - 1, whichever is smaller.

To find out how many characters the buffer needs to hold the entire text, call the GetTextLen method before allocating a buffer for GetTextBuf.

GetTextBuf is available for compatibility with 16-bit code. Where backward compatibility is not an issue, use the Text property.


TControl.GetTextLen

TControl	See also 	Example

Returns the length of the control's text.

function GetTextLen: Integer;

Description

Call GetTextLen to find the length of the control’s text. This is the size needed for a text buffer to be used by the GetTextBuf method.


TControl.HasParent

TControl	See also

Indicates whether the control has a parent.

function HasParent: Boolean; override;

Description

HasParent indicates whether the Parent property has been assigned a value. This method is used by the VCL streaming system to determine whether the control has a parent that is responsible for writing it to a stream. As implemented in TControl, HasParent returns True if the Parent property is not nil, and False otherwise.


TControl.Hide

TControl	See also

Makes the control invisible.

procedure Hide;

Description

Call Hide to hide a control. Hide sets the Visible property of the control to False.

Although a control that is hidden is not visible, its properties and methods are still available.


TControl.InitiateAction

TControl	See also

Calls the action link’s Update method if the control is associated with an action link.

procedure InitiateAction; virtual;

Description

When the application is idle, Delphi makes a series of calls to allow controls to update their associated actions so that they reflect the current properties of the controls. The first of these is to the InitiateAction method of the each form, followed by the InitiateAction methods of its visible menus and controls.

InitiateAction calls the action’s update method indirectly (through its action link), which leads to a number of events, any of which may update the action and stop the update process:

1.	First, the action list that contains the action receives an OnUpdate event.

2.	If the action list does not handle the OnUpdate event, then the Application object receives an OnActionUpdate event.

3.	If the OnActionUpdate event handler does not update the action, the action itself receives an OnUpdate event.

4.	If that does not update the action, the active control’s UpdateAction method is called.

5. Finally, if the action is still not updated, the active form’s UpdateAction method is called.


TControl.Invalidate

TControl	See also

Tells Windows to repaint the control after other important Windows messages are handled.

procedure Invalidate; virtual;

Description

Use Invalidate when the entire control needs to be repainted. When more than one region within the control needs repainting, Invalidate will cause the entire window to be repainted in a single pass, avoiding flicker caused by redundant repaints. There is no performance penalty for calling Invalidate multiple times before the control is actually repainted.


TControl.IsRightToLeft

TControl	See also

Indicates whether the control should be reversed right to left.

function IsRightToLeft: Boolean;

Description

Use IsRightToLeft to determine whether the control should be reversed in any way because it is running on a system with a Middle Eastern locale. IsRightToLeft is intended for component writers to ease the process of implementing the BiDiMode property.

IsRightToLeft returns True if the application is running on a Middle East-enabled version of Windows and the BiDiMode property indicates that the control should make any adjustments.


TControl.Loaded

TControl	See also

Initializes the control after it is loaded from a stream.

procedure Loaded; override;

Description

Do not call Loaded. The VCL streaming system calls Loaded automatically after the control’s form is loaded into memory so that the control can complete any initializations that depend on other objects in the form.

Loaded overrides the inherited method in order to initialize the control from its associated Action. To change the properties the control copies from its action, override the ActionChange method.


TControl.ManualDock

TControl 	See also

Docks the control.

function ManualDock(NewDockSite: TWinControl; DropControl: TControl = nil; ControlSide: TAlign = alNone): Boolean;

Description

Use ManualDock to dock the control programmatically. ManualDock undocks the control from its current dock site, then docks the control to its new dock site.

NewDockSite is the control’s new dock site.

DropControl is the control in the new dock site, if any, on which to drop the control. For example, when docking to a page control, DropControl would be a tab sheet.

ControlSide specifies on which side of DropControl or NewDockSite (if DropControl is nil) the control should be docked. This value can be obtained by calling the dock site’s GetDockEdge method.


TControl.ManualFloat

TControl 	See also

Undocks the control.

function ManualFloat(ScreenPos: TRect): Boolean;

Description

Use ManualFloat to undock the control programmatically.

ScreenPos is the rectangle in which the control is displayed when it starts floating.


TControl.MouseDown

TControl	See also

Generates an OnMouseDown event.

procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); dynamic;

Description

Override the protected MouseDown method to provide other responses in addition to calling the OnMouseDown event handler when the user presses the mouse button on the control.

The Button parameter determines which mouse button the user pressed. Shift indicates which shift keys (Shift, Ctrl, or Alt) were down when the user pressed the mouse button. X and Y are the pixel coordinates of the mouse pointer within the client area of the control.

A control calls MouseDown in response to any of the Windows mouse-down messages (WM_LBUTTONDOWN, WM_MBUTTONDOWN, WM_RBUTTONDOWN), decoding the message parameters into the shift-key state and position, which it passes in the Shift, X, and Y parameters, respectively. The value of the Button parameter depends on which of the Windows messages triggered the event.


TControl.MouseMove

TControl	See also

Generates an OnMouseMove event.

procedure MouseMove(Shift: TShiftState; X, Y: Integer); dynamic;

Description

Override the protected MouseMove method to provide other responses in addition to calling the OnMouseMove event handler when the user moves the mouse.

A control calls MouseMove in response to any of the Windows mouse-move messages (WM_MOUSEMOVE), decoding the message parameters into the shift-key state and position, which it passes in the Shift, X, and Y parameters, respectively.


TControl.MouseUp

TControl	See also

Generates an OnMouseUp event.

procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); dynamic;

Description

Override the protected MouseUp method to provide other responses in addition to calling the OnMouseUp event handler when the user releases the mouse.

A control calls MouseUp in response to any of the Windows mouse-up messages (WM_LBUTTONUP, WM_MBUTTONUP, WM_RBUTTONUP), decoding the message parameters into the shift-key state and position, which it passes in the Shift, X, and Y parameters, respectively. The value of the Button parameter depends on which of the Windows messages triggered the event.


TControl.Notification

TControl	See also

Responds to notifications that components are being created or destroyed.

procedure Notification(AComponent: TComponent; Operation: TOperation); override;

Description

Notification allows TControl to update its PopupMenu property when the pop-up menu it refers to is destroyed.

Override the Notification method to respond to notifications that other components are about to be destroyed or have just been created. Use the Notification method to update controls that rely on other objects. Remove references to objects that are going away so that the control does not refer to objects that have been destroyed. For example, data-aware objects override the Notification method to update themselves when their data source is removed. Some objects respond to notifications that other objects of a specific type are being created.  For example, the session component sets the Session property of new data-aware controls to itself when the AutoSessionName property is True.

By default, components pass along the notification to their owned components, if any.


TControl.PaletteChanged

TControl	See also

Responds to changes in the system's palette by realizing the control's palette.

function PaletteChanged(Foreground: Boolean): Boolean; dynamic;

Description

Override PaletteChanged to change how the control responds to Windows notifications that the system palette is changing. TControl responds to these notifications by trying to realize the control’s palette, if any, into the current device context. If the change in the system palette causes the actual value of the control’s palette to change, PaletteChanged invalidates the control so that it can repaint with the new palette.

Windows paints the active window with a foreground palette, while other windows are forced to use background palettes. Background palettes are approximate matches to the colors specified by the control’s logical palette, given the limitations imposed by implementing the foreground palette. Windows only allows a single foreground palette.

PaletteChanged allows the control to obtain a new realization of its palette when the system palette changes. When ForeGround is True, the form has been activated and the control is specifying the new foreground palette. When ForeGround is False, another application or form has changed the foreground palette, and controls that are sensitive to the available palette should realize new background palettes to best match their logical palettes.

If the control does not have a logical palette to be realized into the current device context, GetPalette returns a handle of 0, and PaletteChanged returns False, indicating that no palette was realized. If GetPalette returns the handle to a logical palette, PaletteChanged realizes this palette into the current device context, and returns True.

Note:	PaletteChanged is called only when the runtime video mode requires palette support, such as for 256 color mode, but not 16 million color mode.


TControl.Perform

TControl	See also	Example

Responds as if the control received a specified Windows message.

function Perform(Msg: Cardinal; WParam, LParam: Longint): Longint;

Description

Call Perform to bypass the Windows message queue and send a message directly to the control’s window procedure.

Perform fills a message record (of type TMessage) with the message ID passed in the Msg parameter, the message parameters passed in WParam and LParam, and a result field of zero. Perform then passes the message record to the WindowProc method for processing.


TControl.PositionDockRect

TControl	See also

Positions the docking rectangle according to the current drag-and-dock state.

procedure PositionDockRect(DragDockObject: TDragDockObject); dynamic;

Description

Use PositionDockRect to adjust the docking rectangle of the drag-and-dock object specified by DragDockObject. DragDockObject’s DockRect property is updated to reflect the current drag-and-dock state. This updating process makes use of the UndockWidth, UndockHeight, LRDockWidth, or TBDockHeight property, as appropriate.


TControl.ReadState

TControl	See also

Prepares the control for having its properties assigned values read from a stream.

procedure ReadState(Reader: TReader); override;

Description

ReadState is part of a sequence of calls used by the streaming system that loads and saves VCL components.  It reads the values of all the control’s published properties, stored data, and owned components from the reader object passed in Reader.

Override ReadState to change the preparations the control makes as it readies itself to have its property values assigned from a stream. For example, a control might destroy temporary internal data structures or objects before new instances are loaded from the stream. Remember to include a call to the inherited method when overriding ReadState.

As implemented in TControl, ReadState assigns the Reader parameter’s Parent property to the control’s own Parent property before calling the inherited ReadState method of TComponent. Finally, ReadState synchronizes the Font, Color, and ShowHint properties with the parent control, as indicated by the ParentFont, ParentColor, and ParentShowHint properties, respectively.


TControl.Refresh

TControl	See also

Repaints the control on the screen.

procedure Refresh;

Description

Call Refresh method to repaint the control immediately. Refresh calls the Repaint method. Use the Refresh and Repaint methods interchangeably.


TControl.Repaint

TControl	See also

Forces the control to repaint its image on the screen.

procedure Repaint;

Description

Call Repaint to force the control to repaint its image immediately. If the ControlStyle property includes csOpaque, the control paints itself directly. Otherwise, the Repaint method calls the Invalidate method and then the Update method so that any visible portions of controls beneath the control will be repainted as well.


TControl.ReplaceDockedControl

TControl 	See also

Docks the control in the place where another control is already docked.

function ReplaceDockedControl(Control: TControl; NewDockSite: TWinControl; DropControl: TControl; ControlSide: TAlign): Boolean;

Description

Call ReplaceDockedControl to replace a control that is already docked while moving that control to another dock site.

Control is the control whose place this control is taking.

NewDockSite is the new dock site for the control that is replaced.

DropControl is a control in the new dock siteon which to drop the control that is replaced. For example, if NewDockSite were a page control, DropControl would be a tab sheet.

ControlSide specifies on which side of DropControl or NewDockSite (if DropControl is nil) the replaced control should be docked. This value can be obtained by calling the dock site’s GetDockEdge method.

ReplaceDockedControl does the same thing as calling the ManualDock method of the control specified by the Control parameter (using the values of NewDockSite, DropControl, and ControlSide) in addition to calling ManualDock for the control whose method this is, docking it in the current position of the Control parameter. However, calling ReplaceDockedControl is more efficient, and prevents unnecessary flicker.


TControl.RequestAlign

TControl	See also

Instructs the parent of a control to reposition the control, enforcing its Align property.

procedure RequestAlign; dynamic;

Description

Applications do not call this protected method. Controls call RequestAlign internally when changes are made to the size or position of the control, so that they remain properly aligned within the parent control.


TControl.Resize

TControl	See also

Generates an OnResize event.

procedure Resize; dynamic;

Description

Do not call Resize. It is called automatically immediately after the control’s dimensions change. Resize calls the control’s OnResize event handler if it is assigned.

Override Resize in a derived class to perform other class-specific actions after the control is resized.


TControl.ScreenToClient

TControl	See also

Converts the screen coordinates of a specified point on the screen to client coordinates.

function ScreenToClient(const Point: TPoint): TPoint;

Description

Use ScreenToClient to convert a point in screen coordinates to local, or client area, coordinates. In client area coordinates (0, 0) corresponds to the upper left corner of the control's client area. In screen coordinates (0, 0) corresponds to the upper left corner of the screen.

Use ScreenToClient along with ClientToScreen to convert from one control's coordinate system to another control's coordinate system. For example,

P := TargetControl.ScreenToClient(SourceControl.ClientToScreen(P));

converts P from coordinates in SourceControl to coordinates in TargetControl.


TControl.SendCancelMode

TControl	See also

Cancels the modal state of the control.

procedure SendCancelMode(Sender: TControl);

Description

Call SendCancelMode to cancel the modal state of the control. Various controls implemented in the VCL support a model state where the user must respond to the control before interacting with any other object on the form. An example is the dropped-down state of a combo box when the drop-down list is showing. For these controls, specific user actions send a Windows message to the control to end the model state, such as a mouse click that closes up the dropped-down list.

SendCancelMode allows an application to end the modal state of the control in the absence of a user action, or when implementing a new user interface response.


TControl.SendDockNotification

TControl	See also

Sends a Windows message to the control’s host dock site.

procedure SendDockNotification(Msg: Cardinal; WParam, LParam: Integer);

Description

Use SendDockNotification to send a Windows message to the control’s host dock site.

SendDockNotification is called automatically when the control’s text or visibility changes.


TControl.SendToBack

TControl	See also

Puts a windowed control behind all other windowed controls, or puts a non-windowed control behind all other non-windowed controls.

procedure SendToBack;

Description

Use SendToBack to change the order of overlapping controls or forms.

The order in which controls stack on top of each other (also called the Z order) depends on the order the controls are placed on the form. For example, if you put a label and an image on a form so that one is on top of the other, the one that was placed first on the form becomes the one on the bottom. Because both the label and the image are non-windowed controls, they “stack” as you would expect them to. Call the SendToBack method for the top object to move it below the other object.

The stacking order of two windowed controls is the same as the stacking of two non-windowed controls. For example, if you put a memo on a form, then put a check box on top of it, the check box remains on top. Calling SendToBack for the check box makes the memo appear on top.

The stacking order of windowed and non-windowed controls cannot be mingled. For example, if you put a memo, a windowed control, on a form, and then put a label, a non-windowed control, on top of it, the label disappears behind the memo. Windowed controls always stack on top of non-windowed controls. In this example, calling the SendToBack method of the memo does nothing, the label remains behind the memo.

If the control has the input focus when the SendToBack method executes, it loses the input focus.


TControl.SetBiDiMode

TControl	See also

Sets the control’s bi-directional mode.

procedure SetBiDiMode(Value: TBiDiMode); virtual;

Description

SetBiDiMode is the write implementation of the control’s BiDiMode property. Override this method to change the implementation of BiDiMode.


TControl.SetBounds

TControl	See also

Sets the Left, Top, Width, and Height properties all at once.

procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); virtual;

Description

Use SetBounds to change all of the component's boundary properties at one time. The same effect can be achieved by setting the Left, Top, Width, and Height properties separately, but SetBounds changes all four properties at once ensuring that the control will not repaint between changes.

Specify the values for the Left, Top, Width, and Height properties as the value of the ALeft, ATop, AWidth, and AHeight parameters, respectively.

Calling SetBounds does not necessarily result in the Left, Top, Width, and Height properties changing to the specified values. Before the properties are changed, the AutoSize or Constraints property may limit the changes, and an OnCanResize (or OnConstrainedResize) event handler may change the new values. After the control’s Left, Top, Width, and Height properties are changed, SetBounds generates an OnResize event.

Note:	Component writers can change the Left, Top, Width, and Height properties while bypassing all resize events and constraint or autosize logic by using the UpdateBoundsRect method instead.


TControl.SetDragMode

TControl	See also

Sets the drag mode for the control.

procedure SetDragMode(Value: TDragMode); virtual;

Description

SetDragMode is the protected write implementation for the DragMode property. Override SetDragMode to execute additional code when the value of the DragMode property changes.


TControl.SetEnabled

TControl	See also

Sets the value of the Enabled property.

procedure SetEnabled(Value: Boolean); virtual;

Description

SetEnabled is the protected write implementation of the Enabled property. After changing the internal representation of the Enabled property, SetEnabled sends a Windows message back to the control so that it can respond to the change. When TControl receives this message, it invalidates the control so that its appearance reflects the change (for example, so that it appears grayed). Some descendants respond to this message in other ways (for example, windowed controls ensure that a disabled control does not have focus).

Override GetEnabled and SetEnabled to change the implementation of the Enabled property. For example, A descendant of TControl might change the way the Enabled property interacts with an associated action. When overriding SetEnabled, be sure to call the inherited method.


TControl.SetName

TControl	See also

Sets the name of the control.

procedure SetName(const Value: TComponentName); override;

Description

SetName is the protected write implementation of the Name property. TControl updates the Text or Caption property, if appropriate, after changing the value of Name.

Override SetName to execute additional code when the value of the Name property changes.


TControl.SetParent

TControl	See also

Sets the parent of the control.

procedure SetParent(AParent: TWinControl); virtual;

Description

SetParent is the protected implementation of the Parent property. Override SetParent to execute additional code when the value of the Parent property changes.

The AParent parameter specifies the new parent of the control.

If the control already has a parent, SetParent removes the control from that parent's list of controls by calling the parent's RemoveControl method. If AParent is not nil, SetParent calls its InsertControl method to add the control to its list of controls.

The TControl destructor calls SetParent(nil)to remove the control from its parent's control list before destroying the component.


TControl.SetParentBiDiMode

TControl	See also

Specifies whether the control uses its parent’s BiDiMode.

procedure SetParentBiDiMode(Value: Boolean); virtual;

Description

SetParentBiDiMode is the protected write implementation of the ParentBiDiMode property.


TControl.SetParentComponent

TControl	See also

Sets the parent for the control.

procedure SetParentComponent(Value: TComponent); override;

Description

Do not call the SetParentComponent method.  It is used by the streaming system that loads and saves VCL components.  SetParentComponent makes the component specified by the Value parameter the parent of the control.

SetParentComponent calls the SetParent method only if the component specified as the parent is a windowed control.


TControl.SetTextBuf

TControl	See also

Sets the text of the control.

procedure SetTextBuf(Buffer: PChar);

Description

Call the SetTextBuf method to set the text of the control to the text in the specified buffer.

The text is set to the text in the buffer pointed to by the Buffer parameter. Buffer must point to a null-terminated string. The SetTextBuf method sends the WM_SETTEXT and CM_TEXTCHANGED messages.

Note:	The SetTextBuf method is provided for backwards compatibility only. Use the Text property instead to set the text of the control.


TControl.SetZOrder

TControl	See also

Repositions the control in its parent’s control list, thereby changing position onscreen.

procedure SetZOrder(TopMost: Boolean); dynamic;

Description

Call SetZOrder to change the Z-order of the control. To make the control the topmost control, specify the TopMost value as True. To make the control the bottommost, set TopMost to False.

After changing the order, SetZOrder invalidates the control to ensure repainting to reflect the new order.

The stacking order of windowed and non-windowed controls cannot be mingled. For example, if you put a memo, a windowed control, on a form, and then put a label, a non-windowed control, on top of it, the label disappears behind the memo. Windowed controls always stack on top of non-windowed controls. In this example, calling the SetZOrder method of the label or the memo has no effect, the label always remains behind the memo.


TControl.Show

TControl	See also

Makes a control visible.

procedure Show;

Description

Use the Show method to make visible a control that was previously hidden.

The Show method sets the control’s Visible property to True and ensures that the parent control is also visible.


TControl.Update

TControl	See also

Processes any pending paint messages immediately.

procedure Update; virtual;

Description

Call Update to force the control to be repainted before any more, possibly time-consuming, processing takes place. Use Update to provide immediate feedback to the user that cannot wait for the Windows paint message to arrive.

Update does not invalidate the control, but simply forces a repaint of any regions that have already been invalidated. Call Repaint instead to invalidate the control as well.


TControl.UpdateBoundsRect

TControl	See also

Changes the Top, Left, Width, and Height properties of the control, but doesn’t update its screen image and bypasses all resize events.

procedure UpdateBoundsRect(const R: TRect);

Description

UpdateBoundsRect is used internally by controls to stay synchronized with changes made by Windows. UpdateBoundsRect updates the properties to match those passed in the rectangle as the R parameter.


TControl.UseRightToLeftAlignment

TControl	See also

Specifies whether the control’s alignment should be reversed right-to-left.

function UseRightToLeftAlignment: Boolean; dynamic;

Description

Controls call UseRightToLeftAlignment when implementing the BiDiMode property. UseRightToLeftAlignment indicates whether the control’s alignment should be reversed right-to-left. This information can be used when painting the control or when responding to mouse events.

UseRightToLeftAlignment returns True if the application is running on a system with a Middle Eastern locale and the BiDiMode property is bdRightToLeft. Otherwise, it returns False. Descendants override UseRightToLeftAlignment if alignment in Middle Eastern locales depends on other factors.


TControl.UseRightToLeftReading

TControl	See also

Specifies whether the control is using a right-to-left reading order.

function UseRightToLeftReading: Boolean;

Description

Controls call UseRightToLeftReading when implementing the BiDiMode property. UseRightToLeftReading indicates whether the control’s text should read from right to left. This information can be used to determine which style flags to set for the control when it is created and which flags to set for drawing text.

UseRightToLeftReading returns True if the application is running on a system with a Middle Eastern locale and the BiDiMode property is not bdLeftToRight. UseRightToLeftReading returns False otherwise.


TControl.UseRightToLeftScrollBar

TControl	Methods	See also

Specifies whether the vertical scroll bar appears on the left side of the control.

function UseRightToLeftScrollBar: Boolean;

Description

Controls call UseRightToLeftScrollBar when implementing the BiDiMode property. UseRightToLeftScrollBar returns True when the vertical scroll bar appears on the left side of the control, and False when it appears on the right.

UseRightToLeftScrollBar returns True if the application is running on a system with a Middle Eastern locale and the BiDiMode property is bdRightToLeft or bdRightToLeftNoAlign.


TControl.VisibleChanging

TControl	See also

Provides the interface for a method that responds to changes in the control’s visibility.

procedure VisibleChanging; dynamic;

Description

VisibleChanging is called before the value of a control’s Visible property changes. As implemented in TControl, it does nothing. Override VisibleChanging to respond to changes in the control’s visibility. For example, if a control should not change its visibility, override VisibleChanging to raise an exception when an attempt is made to alter the control’s visibility.


TControl.WndProc

TControl	See also	Example

Provides specific message responses for the control.

procedure WndProc(var Message: TMessage); virtual;

Description

Override WndProc to change the initial Windows message handler for the control. The WindowProc property is initialized to WndProc.

WndProc implements the mouse behavior specified by the ControlStyle and DragMode properties, and updates the ControlState property. It passes any unhandled messages on to the Dispatch method.

When overriding WndProc to provide specialized responses to messages, be sure to call the inherited WndProc at the end to dispatch any unhandled messages.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent


TConversion

Hierarchy	Methods	See also

TConversion converts rich text data from one encoding format to another, at the point when the data is streamed from a storage medium that uses one format to a storage medium that uses the other.

Unit

comctrls

Description

TConversion, by itself, does not perform any conversions. It simply reads from or writes to a stream. TConversion exists primarily to provide an interface that can be overridden by derived classes that convert text from one format to another when it is streamed.

Descendants of TCustomRichEdit use TConversion when streaming text to and from files, when the files contain plain ANSI text or text in rich text format (RTF). To allow rich text edit controls to read from and write to files that use another format, derive a class from TConversion which converts between that format and RTF. Rich text edit controls can use the new class by registering it through their RegisterConversionFormat method, or by making it the default converter.


TConversion methods

TConversion	Alphabetically

In TConversion

ConvertReadStream

ConvertWriteStream

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TConversion methods

TConversion	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ConvertReadStream

ConvertWriteStream

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TConversion.ConvertReadStream

TConversion	See also

Reads BufSize bytes from Stream into the memory buffer pointed to by Buffer.

function ConvertReadStream(Stream: TStream; Buffer: PChar; BufSize: Integer): Integer; virtual;

Description

To convert text between two formats, override this method in a descendant class and convert the text in the buffer. To create a descendant class that TCustomRichEdit can use, convert the text to RTF format.

Note:	ConvertReadStream should reverse the conversion that ConvertWriteStream makes.


TConversion.ConvertWriteStream

TConversion	See also

Writes BufSize bytes to Stream from the memory buffer pointed to by Buffer.

function ConvertWriteStream(Stream: TStream; Buffer: PChar; BufSize: Integer): Integer; virtual;

Description

To convert text between two formats, override this method in a descendant class and convert the text in the buffer. To create a descendant class that TCustomRichEdit can use, convert the text from RTF format.

Note:	ConvertWriteStream should reverse the conversion that ConvertReadStream makes.


Hierarchy

TObject


 TCoolBar

Hierarchy	Properties	Methods	Events	See also

TCoolBar displays a collection of windowed controls within movable, resizable bands.

Unit

comctrls

Description

A TCoolBar contains child controls that can be moved and resized independently. Each control resides on an individual band, represented by a TCoolBand object listed in the Bands property. The user positions the controls by dragging the sizing grip to the left of each band.

The component represented by TCoolBar is sometimes referred to as a rebar.

A TCoolBar can contain objects that do not descend from TWinControl, such as TLabel or TSpeedButton. Only TWinControl descendants, however, appear on resizable bands.

To create a coolbar that acts as a docking site for tool bars and other controls, use TControlBar instead.

Note:	TCoolBar requires version 4.70 or later of COMCTL32.DLL. This file, which usually resides in the WINDOWS\SYSTEM or WINDOWS\SYSTEM32 directory, is required at both design time and runtime. Contact Microsoft for information about deploying COMCTL32.DLL.

Note:	See the Webbrows demo in the coolstuf directory for an example of using TCoolbar.


TCoolBar properties

TCoolBar	Alphabetically	Legend

In TCoolBar

Align

BandBorderStyle

BandMaximize

Bands

Bitmap

Constraints

DockSite

DragKind

FixedOrder

FixedSize

Images

ShowText

Vertical

Derived from TToolWindow

EdgeBorders

EdgeInner

EdgeOuter

Derived from TWinControl

BorderWidth

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Anchors

AutoSize

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCoolBar properties

TCoolBar	By object	Legend

Action

Align

Anchors

AutoSize

BandBorderStyle

BandMaximize

Bands

BiDiMode

Bitmap

BorderWidth

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DockSite

DoubleBuffered

DragCursor

DragKind

DragMode

EdgeBorders

EdgeInner

EdgeOuter

Enabled

FixedOrder

FixedSize

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

Images

Left

LRDockWidth

Name

Owner

Parent

ParentColor

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ShowHint

Showing

ShowText

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Vertical

Visible

VisibleDockClientCount

Width

WindowProc


TCoolBar.Align

TCoolBar	See also

Determines the alignment of the TCoolBar component.

property Align: TAlign;

Description

Use Align to align the coolbar to the top, bottom, left, or right of a form or panel and have it remain there even if the size of the form, panel, or component that contains the cool bar changes.

Setting Align to alLeft or alRight automatically sets Vertical to True (causing bands to be arranged vertically). Setting Align to alTop, alBottom, alClient, or alNone automatically sets Vertical to False.


TCoolBar.BandBorderStyle

TCoolBar	See also

Determines the border style of the bands in the TCoolBar.

property BandBorderStyle: TBorderStyle;

Description

If BandBorderStyle is bsSingle, each band in the TCoolBar has a single line around it. If BandBorderStyle is bsNone, the bands have no borders.

Note:	BandBorderStyle takes precedence over the BorderStyle property on individual cool bands. Thus, when a coolband resides in a cool bar control, its BorderStyle property has no effect.


TCoolBar.BandMaximize

TCoolBar	See also

Specifies the conditions under which a TCoolBand is maximized.

property BandMaximize: TCoolBandMaximize;

Description

Use BandMaximize to determine the user actions that maximize individual bands. When a band is maximized, it takes up as much space as possible in its row or column.

Note:	Users can’t maximize fixed-size bands.


TCoolBar.Bands

TCoolBar	See also 	Example

Lists the bands (TCoolBands) of the coolbar.

property Bands: TCoolBands;

Description

The Bands property holds a TCoolBands—that is, a collection of TCoolBand objects. At design time, you can add, remove, or modify bands with the Bands editor. To open the Bands editor, select the Bands property in the Object Inspector, then double-click in the Value column to the right or click the ellipsis (...) button.

You can also create bands simply by adding new windowed controls from the palette. When any TWinControl descendant is placed on the form as a child of the TCoolBar, a new band is created for it.


TCoolBar.Bitmap

TCoolBar	See also

Specifies the image that appears behind the bands in the TCoolBar.

property Bitmap: TBitmap;

Description

Bitmap holds a TBitmap object. It determines the image that appears behind the bands in the TCoolBar.

By default, the Bitmap image is positioned relative to the upper left corner of the TCoolBar and covers the client area, where the transparent bands allow it to display without occlusion. Setting the FixedBackground, Bitmap, or ParentBitmap properties of TCoolBand can modify this appearance.


TCoolBar.FixedOrder

TCoolBar	See also

Determines whether the user can reorder the bands in the TCoolBar.

property FixedOrder: Boolean;

Description

If FixedOrder is set to True, the user can reposition the bands by dragging them with the mouse, but cannot change their order. Bands can still be reordered from the Collection editor at design time, or by changing their Index properties in program code.


TCoolBar.FixedSize

TCoolBar	See also

Determines whether the bands automatically maintain a uniform height (or width).

property FixedHeight: Boolean;

Description

Ordinarily, when Vertical and FixedSize are both False, the height of each TCoolBand is determined by the height of the windowed control linked to it. (If there is no TWinControl component linked to a band, its height is determined by the text it contains.) When FixedSize is True, the bands are resized so that they all have the same height; increasing the height of the tallest visible band automatically increases the height of all the other bands.

When Vertical is True, these dependencies are switched. As long as FixedSize is False, the width of each band is determined by the width of the windowed control linked to it. If FixedSize and Vertical are both set to True, the bands maintain the same width; increasing the width of the widest visible band automatically increases the width of all the other bands.


TCoolBar.Images

TCoolBar	See also

Lists images available for bands in the TCoolBar.

property Images: TCustomImageList;

Description

Images is a list of bitmaps that can be displayed to the left of any band in the TCoolBar. Each band can specify an image from this list by setting its ImageIndex property.


TCoolBar.ShowText

TCoolBar	See also

Determines whether text is displayed on the bands.

property ShowText: Boolean;

Description

If ShowText is True, the Text string of each TCoolBand is displayed on the band at runtime. If ShowText is False, only the TWinControl linked to the band is displayed.


TCoolBar.Vertical

TCoolBar	See also

Determines whether the bands are arranged vertically or horizontally.

property Vertical: Boolean;

Description

If Vertical is False (the default), the bands in the TCoolBar are oriented horizontally, from left to right and top to bottom. If Vertical is True, the bands are oriented vertically, from top to bottom and left to right.


TCoolBar events

TCoolBar	Alphabetically	Legend

In TCoolBar

OnChange

Derived from TWinControl

OnDockDrop

OnDockOver

OnGetSiteInfo

OnUnDock

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock

OnStartDrag


TCoolBar events

TCoolBar	By object	Legend

OnChange

OnClick

OnContextPopup

OnDblClick

OnDockDrop

OnDockOver

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnGetSiteInfo

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock

OnStartDrag

OnUnDock


TCoolBar.OnChange

TCoolBar	See also

Occurs when the position or size of a band changes.

property OnChange: TNotifyEvent;

Description

The OnChange event occurs whenever a TCoolBand’s Break, Index, or Width property is modified at runtime. An OnChange event handler can be used, for example, to record the positions and sizes of the bands in the Windows registry.


TCoolBar methods

TCoolBar	Alphabetically

In TCoolBar

Create

Destroy

FlipChildren

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCoolBar methods

TCoolBar	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TCoolBar.Create

TCoolBar	See also	Example

Creates and initializes a TCoolBar instance.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create a cool bar at runtime. Cool bars added at design time are created automatically.

Create generates a TCoolBar object and initializes its properties. If COMCTL32.DLL cannot be found, Create raises the EComponentError exception.


TCoolBar.Destroy

TCoolBar	See also

Destroys the TCoolBar instance and frees its memory.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the coolbar reference is not nil, and only then calls Destroy.


TCoolBar.FlipChildren

TCoolBar	See also

Flips the control’s children.

procedure FlipChildren(AllLevels: Boolean); override;

Description

FlipChildren overrides the inherited method in order to prevent the flipping of the control bar’s children.

Applications call FlipChildren to flip the control’s children; that is, to move children on the left side of the control to the right side and vice versa. If an application calls the FlipChildren method of the cool bar’s parent, passing in True for the AllLevels parameter, then the cool bar’s FlipChildren method is called along with the FlipChildren method of any sibling controls. Because of their special nature, cool bar controls do not respond to the FlipChildren command.

Note:	FlipChildren does the same thing as the Flip Children command on the context menu in the IDE.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TToolWindow


TCoolBand

Hierarchy	Properties	Methods	See also

TCoolBand represents a band within a TCoolBar.

Unit

comctrls

Description

Each TCoolBar uses TCoolBands to maintain a collection of TCoolBand objects.


TCoolBand properties

TCoolBand	Alphabetically	Legend

In TCoolBand

Bitmap

BorderStyle

Break

Color

Control

FixedBackground

FixedSize

Height

HorizontalOnly

ImageIndex

MinHeight

MinWidth

ParentBitmap

ParentColor

Text

Visible

Width

Derived from TCollectionItem

Collection

DisplayName

ID

Index


TCoolBand properties

TCoolBand	By object	Legend

Bitmap

BorderStyle

Break

Collection

Color

Control

DisplayName

FixedBackground

FixedSize

Height

HorizontalOnly

ID

ImageIndex

Index

MinHeight

MinWidth

ParentBitmap

ParentColor

Text

Visible

Width


TCoolBand.Bitmap

TCoolBand	See also

Specifies the background image displayed on the band.

property Bitmap: TBitmap;

Description

Use the Bitmap property to select the image that appears on the band. The image is repeated so that it covers the band like wallpaper.

Setting the Bitmap property in the Object Inspector automatically sets ParentBitmap to False.


TCoolBand.BorderStyle

TCoolBand	See also

Specifies the border style for the band.

property BorderStyle: TBorderStyle;

Description

If BorderStyle is set to the default bsSingle, the band has a single-line border. If BorderStyle is set to bsNone, no border appears around the band.

Note: If the cool band resides in a coolbar control, the coolbar’s BandBorderStyle property takes precedence over BorderStyle.


TCoolBand.Break

TCoolBand

Causes the band to start on a new line.

property Break: Boolean;

Description

If Break is True (the default), the band starts a new line at the left side of the TCoolBar control. If Break is False, the band continues on the same line as its predecessor.


TCoolBand.Color

TCoolBand	See also

Specifies the color of the band.

property Color: TColor;

Description

Use the Color property to select the color of the band. Setting Color in the Object Inspector automatically sets ParentColor to False.


TCoolBand.Control

TCoolBand

Specifies the control that appears on the band.

property Control: TWinControl;

Description

The Control property indicates the windowed control that appears on the band. If Control is unassigned, there is no control associated with the band.


TCoolBand.FixedBackground

TCoolBand	See also

Determines whether the background is realigned within the band.

property FixedBackground: Boolean;

Description

If ParentBitmap is True, the band displays the same background as the TCoolBar that owns it. Ordinarily, when FixedBackground is True, that background is continuous over the entire TCoolBar. Setting FixedBackground to False realigns the background within the individual band, so that the TCoolBar’s Bitmap image is positioned relative to the upper left corner of the band.


TCoolBand.FixedSize

TCoolBand	See also

Determines whether the band can be resized at runtime.

property FixedSize: Boolean;

Description

Setting FixedSize to True prevents the user from resizing the band.


TCoolBand.Height

TCoolBand

Returns the height of the cool band.

property Height: Integer;

Description

Use Height to get the height of the CoolBand


TCoolBand.HorizontalOnly

TCoolBand	See also

Determines whether the band is displayed when the TCoolBar is arranged vertically.

property HorizontalOnly: Boolean;

Description

If the Vertical property of TCoolBar is True, setting HorizontalOnly to True hides the band. When TCoolBar’s Vertical property is False, HorizontalOnly has no effect.


TCoolBand.ImageIndex

TCoolBand	See also

Determines the image (from the TCoolBar.Images list) that appears on the band.

property ImageIndex: TImageIndex;

Description

The Images property of TCoolBar contains a list of bitmaps that can appear to the left of any band in the TCoolBar. To select a bitmap from the list, assign a value to the band’s ImageIndex property.


TCoolBand.MinHeight

TCoolBand	See also

Determines the minimum height for the band.

property MinHeight: Integer;

Description

The MinHeight property determines the smallest height to which the band can be resized at runtime.


TCoolBand.MinWidth

TCoolBand	See also

Determines the minimum width for the band.

property MinWidth: Integer;

Description

The MinWidth property determines the smallest width to which the band can be resized at runtime.


TCoolBand.ParentBitmap

TCoolBand	See also

Determines whether the band uses the Bitmap image of the TCoolBar that owns it.

property ParentBitmap: Boolean;

Description

If ParentBitmap is set to true, the band displays the same background image as the TCoolBar it belongs to (determined by the TCoolBar’s Bitmap property). Setting the band’s Bitmap property in the Object Inspector automatically sets ParentBitmap to False.


TCoolBand.ParentColor

TCoolBand	See also

Determines whether the band uses the color of the TCoolBar that owns it.

property ParentColor: Boolean;

Description

If ParentColor is True, the band has the same color as the TCoolBar that owns it. Setting the Color property in the Object Inspector automatically sets ParentColor to False.


TCoolBand.Text

TCoolBand	See also 	Example

Specifies the text string that appears on the band and identifies it in the Bands editor.

property Text: string;

Description

Assign a value to Text to create text that appears on the band to the left of the band’s windowed control.


TCoolBand.Visible

TCoolBand

Determines whether the band appears at runtime.

property Visible: Boolean;

Description

Use the Visible property to control the visibility of the band at runtime. If Visible is True, the band appears on the form; if Visible is False, it does not.


TCoolBand.Width

TCoolBand	See also

Specifies the width of the band.

property Width: Integer;

Description

The Width property indicates the width of the band, in pixels.


TCoolBand methods

TCoolBand	Alphabetically

In TCoolBand

Assign

Create

Destroy

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCoolBand methods

TCoolBand	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCoolBand.Assign

TCoolBand	See also

Copies the properties of one band to another.

procedure Assign(Source: TPersistent); override;

Description

Assign copies the Text and Width properties of the source band to the band where Assign is called.


TCoolBand.Create

TCoolBand

Creates and initializes a TCoolBand instance.

constructor Create(Collection: TCollection); override;

Description

Create generates a TCoolBand and initializes its properties.


TCoolBand.Destroy

TCoolBand	See also

Destroys the TCoolBand and frees its memory.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the band is not nil, and only then calls Destroy.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem


TCoolBands

Hierarchy	Properties	Methods	See also

TCoolBands is a container for TCoolBand objects.

Unit

comctrls

Description

Each TCoolBands holds a collection of TCoolBand objects in a TCoolBar. TCoolBands maintains an index of the TCoolBand objects in its Items array. The Count property contains the number of bands in the collection.


TCoolBands properties

TCoolBands	Alphabetically	Legend

In TCoolBands

CoolBar

Items

Derived from TCollection

Count

ItemClass


TCoolBands properties

TCoolBands	By object	Legend

CoolBar

Count

ItemClass

Items


TCoolBands.CoolBar

TCoolBands	See also

Provides access to the TCoolBar component that owns the TCoolBands.

property CoolBar: TCoolBar;

Description

The CoolBar property returns the TCoolBar instance to which the TCoolBands belongs.


TCoolBands.Items

TCoolBands	See also 	Example

Provides indexed access to the bands in the TCoolBands.

property Items[Index: Integer]: TCoolBand; default;

Description

The value of the Index parameter corresponds to the Index property of TCoolBand. It represents the position of the band in the TCoolBands collection.


TCoolBands methods

TCoolBands	Alphabetically

In TCoolBands

Add

Create

FindBand

Derived from TCollection

Assign

BeginUpdate

Clear

Delete

Destroy

EndUpdate

FindItemID

GetNamePath

Insert

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCoolBands methods

TCoolBands	By object

Add

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

FindBand

FindItemID

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCoolBands.Add

TCoolBands

Adds a cool band to the collection.

function Add: TCoolBand;

Description

Call Add to add a cool band to the collection.


TCoolBands.::TCoolBands
TCoolBands.Create

TCoolBands

Creates and initializes a TCoolBands instance.

constructor Create(CoolBar: TCoolBar);

Description

Create generates a TCoolBands instance and initializes its properties.


TCoolBands.FindBand

TCoolBands

Returns the band containing the specified control.

function FindBand(AControl: TControl): TCoolBand;

Description

Call FindBand to obtain the band containing the specified control.

AControl is the control.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


TCurrencyField

Hierarchy	Properties	Methods	Events	See also

TCurrencyField represents a field that contains currency values in a dataset.

Unit

db

Description

TCurrencyField is a persistent field object that encapsulates the fundamental behavior common to Currency fields. In addition to the properties, methods, and events common to all fields that are introduced by the TField, TNumericField, and TFloatField classes, TCurrencyField reimplements the properties that are used to read Currency data from and write Currency data to the underlying database table.

As with all persistent field objects, a TCurrencyField can be created at design-time using the Fields Editor or at runtime by calling the constructor for the class. Persistent field objects exist solely in the memory space of an application. Creating a persistent field object only creates an object in the application, and does not result in the creation of a field in a table.

Fields in a table can be accessed without use of persistent field objects. Virtual field objects are created to provide access to a field when the field is referenced through such means as the TDataSet.Fields property or the TDataSet.FieldByName method. However, as both the Fields property and the FieldByName method return a value of type TField, the return value must be typecast as a TCurrencyField before using any property or method specific to TCurrencyField.

TCurrencyField differs from its immediate ancestor TFloatField only in having a DataType of ftCurrency, and in formatting the value using a currency format by default. As a descendant of TFloatField, TCurrencyField includes many properties, methods, and events that are useful for managing the value and properties of a floating-point field in a database.

Do not confuse TCurrencyField with the Currency data type. Currency fields use the Double data type to store and manipulate their values. This data type is the format used by the physical database tables for currency fields. The TBCDField class uses the Currency data type to store and manipulate its value.

Currency fields can hold values in the range from (positive or negative) 5.0 * 10^-324 to 1.7 * 10^308 with an accuracy of 15 digits.


TCurrencyField properties

TCurrencyField	Alphabetically	Legend

Derived from TFloatField

AsFloat

AsInteger

AsString

AsVariant

Currency

DataSize

MaxValue

MinValue

Precision

Value

Derived from TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCurrencyField properties

TCurrencyField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

Currency

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

MaxValue

MinValue

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

Precision

ProviderFlags

ReadOnly

Required

Size

Tag

Text

ValidChars

Value

VCLComObject

Visible


TCurrencyField events

TCurrencyField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TCurrencyField events

TCurrencyField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TCurrencyField methods

TCurrencyField	Alphabetically

In TCurrencyField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCurrencyField methods

TCurrencyField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TCurrencyField.Create

TCurrencyField	See also

Creates an instance of TCurrencyField.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TCurrencyField. After calling the inherited constructor, Create sets the DataType property to ftCurrency and Currency to True.

After instantiating a TCurrencyField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TCurrencyField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TCurrencyField with a dataset component by setting its DataSet property to the name of the dataset component.

The example below creates a TCurrencyField object for a field named Amount accessed through a TQuery named Query1.

var

  T: TCurrencyField;

begin

  Query1.Close;

  T := TCurrencyField.Create(Self);

  T.FieldName := 'Amount';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TNumericField

TFloatField


TCustomActionList

Hierarchy	Properties	Methods	Events	See also

TCustomActionList is the base class for action list objects that provide the IDE user interface to actions.

Unit

ActnList

Description

TActionList is a component that allows you to work with actions at design-time. The action list editor is the user interface for working with actions. From the action list editor you can add, delete, regroup, and modify actions. TActionList maintains a list of actions that can be grouped by category. Actions in an action list are TContainedAction or descendant types.


TCustomActionList properties

TCustomActionList	Alphabetically	Legend

In TCustomActionList

ActionCount

Actions

Images

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomActionList properties

TCustomActionList	By object	Legend

ActionCount

Actions

ComObject

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

Images

Name

Owner

Tag

VCLComObject


TCustomActionList.Actions

TCustomActionList	See also

Contains an indexed list of the actions in the action list object.

property Actions[Index: Integer]: TContainedAction;

Description

Actions is an indexed property containing a list of the actions in the action list component.


TCustomActionList.ActionCount

TCustomActionList	See also

Contains the number of actions in the action list.

property ActionCount: Integer;

Description

Action count indicates how many actions are contained in the action list.


TCustomActionList.Images

TCustomActionList	See also

Contains the list of images available for actions in the action list.

property Images: TCustomImageList;

Description

Images is a list of bitmaps that can be displayed to the left of any action in the action list editor. An action is associated with an image from this image list by its ImageIndex property. This image can then appear on associated controls such as menu items, tool buttons, and so on.


TCustomActionList events

TCustomActionList	Alphabetically	Legend

In TCustomActionList

OnChange

OnExecute

OnUpdate


TCustomActionList events

TCustomActionList	By object	Legend

OnChange

OnExecute

OnUpdate


TCustomActionList.OnChange

TCustomActionList

Occurs when a change occurs in the action list.

property OnChange: TNotifyEvent;

Description

Use OnChange to write an event handler to process an action when a change occurs in the action list. Changes to the action list that trigger an OnChange event are, for example, a change to a Category.


TCustomActionList.OnExecute

TCustomActionList	See also

Occurs when an action triggers an Execute event.

property OnExecute: TActionEvent;

Description

Write an OnExecute event handler to respond when an action fires an Execute event.


TCustomActionList.OnUpdate

TCustomActionList	See also

Occurs when the action list is notified of an update by an action.

property OnUpdate: TActionEvent;

Description

Use OnUpdate to write an event handler to process an action when the action list is updated.


TCustomActionList methods

TCustomActionList	Alphabetically	Legend

In TCustomActionList

Change

Create

Destroy

ExecuteAction

GetChildren

IsShortCut

Notification

SetChildOrder

UpdateAction

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomActionList methods

TCustomActionList	By object	Legend

AfterConstruction

Assign

BeforeDestruction

Change

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

DestroyComponents

Destroying

Destroy

Dispatch

ExecuteAction

FieldAddress

FindComponent

FreeInstance

FreeNotification

FreeOnRelease

Free

GetChildren

GetInterfaceEntry

GetInterfaceTable

GetInterface

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsShortCut

MethodAddress

MethodName

NewInstance

Notification

RemoveComponent

SafeCallException

SetChildOrder

UpdateAction


TCustomActionList.Change

TCustomActionList	See also

Generates an OnChange event.

procedure Change; virtual;

Description

Change is called when a change, such as a modification to the Categories list, occurs in the action list. Change invokes an OnChange handler, if one has been assigned.


TCustomActionList.Create

TCustomActionList

Instantiates and initializes a TCustomActionList object.

constructor Create(AOwner: TComponent); override;

Description

When using the form designer, action list instances are created automatically when you drop an action list component on your form. The AOwner parameter is the owner of the action list, typically this is the form.

Create calls the inherited Create, and initializes the object by creating its sub-objects that handle the list of actions and images.


TCustomActionList.Destroy

TCustomActionListSee also

Disposes of the instance of an action list object.

destructor Destroy; override;

Description

You do not need to call the destructor for an action list if it has an owner. The list is destroyed automatically by its owner that was passed to its constructor when it was created.


TCustomActionList.ExecuteAction

TCustomActionList	See also

Occurs when one of the action objects in the list executes an action.

function ExecuteAction(Action: TBasicAction): Boolean; override;

Description

ExecuteAction is called by the Execute method of an action indicated by the Action parameter. ExecuteAction invokes the OnExecute event handler for the action list.


TCustomActionList.GetChildren

TCustomActionList

Calls the specified method for each child action of the action list.

procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;

Description

GetChildren is used by the VCL streaming system. For each action in the action list, GetChildren calls the method passed in Proc. The actions are passed to the callback in the order that they are loaded or saved by the VCL streaming system.


TCustomActionList.IsShortCut

TCustomActionList	See also

Indicates whether an input key combination is a shortcut for one of the actions in the list.

function IsShortCut(var Message: TWMKey): Boolean;

Description

IsShortCut returns True if the shortcut specified by Message is a shortcut key combination for one of the actions in the list. This function is used internally; you do not need to call it directly.


TCustomActionList.Notification

TCustomActionList	See also

Forwards notification messages to all owned components.

procedure Notification(AComponent: TComponent; Operation: TOperation); override;

Description

Notification notifies the action list that the component specified by AComponent is about to be inserted or removed, as specified by Operation. By default, components pass along the notification to their owned components, if any.

TCustomActionList overrides Notification to update the Images property when images from the list are destroyed.


TCustomActionList.SetChildOrder

TCustomActionList	See also

Changes the child action components order in the action list.

procedure SetChildOrder(Component: TComponent; Order: Integer); override;

Description

SetChildOrder changes the order in which the child action components appear in the child list. SetChildOrder is used by the VCL streaming system. You should not need to call this method directly.


TCustomActionList.UpdateAction

TCustomActionList	See also

Notifies the action list of an update from an action.

function UpdateAction(Action: TBasicAction): Boolean; override;

Description

UpdateAction is called when a change occurs in the action that requires notification of the action list for that action. Action is the action that was updated. UpdateAction calls the OnUpdate event handler and returns True if an OnUpdate handler was assigned, False otherwise.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent


TCustomStaticText

Hierarchy	Properties	Methods	See also

TCustomStaticText is the abstract base class for TStaticText.

Unit

stdctrls

Description

TCustomStaticText is the base class for TStaticText, a windowed control that displays text on a form. This component functions like TLabel, except that it has a window handle.

TCustomStaticText cannot receive focus or contain other controls.


TCustomStaticText properties

TCustomStaticText	Alphabetically	Legend

In TCustomStaticText

Alignment

AutoSize

BorderStyle

FocusControl

ShowAccelChar

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomStaticText properties

TCustomStaticText	By object	Legend

Align

Alignment

AutoSize

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

Enabled

FocusControl

Handle

Height

HelpContext

Hint

Left

Name

Owner

Parent

ParentWindow

ShowAccelChar

ShowHint

Showing

TabOrder

TabStop

Tag

Top

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TCustomStaticText.Alignment

TCustomStaticText 	See also

Determines how text is aligned within the component.

property Alignment: TAlignment;

Description

The possible values of Alignment are

Value	Meaning

taLeftJustify	Text is aligned at the left of the control.

taCenter	Text is centered in the control.

taRightJustify	Text is aligned at the right of the control.


TCustomStaticText.Autosize

TCustomStaticText	See also

Determines whether the component is automatically resized to accommodate its text.

property AutoSize: Boolean;

Description

If Autosize is True, the component is automatically resized—at runtime and design time—whenever the font size or Caption text changes.


TCustomStaticText.BorderStyle

TCustomStaticText

Determines the appearance of the control’s border.

type TStaticBorderStyle = (sbsNone, sbsSingle, sbsSunken);

property BorderStyle: TStaticBorderStyle;

Description

The possible values of BorderStyle are

Value	Meaning

sbsNone	No visible border.

sbsSingle	Single-line border.

sbsSunken	Raised border.


TCustomStaticText.FocusControl

TCustomStaticText	See also

Links the component with another windowed control.

property FocusControl: TWinControl;

Description

Use the FocusControl property to link the TCustomStaticText instance with another windowed control. If the text of Caption includes an accelerator key, the component specified by FocusControl receives focus when the accelerator is pressed.


TCustomStaticText.ShowAccelChar

TCustomStaticText	See also

Enables accelerator characters.

property ShowAccelChar: Boolean;

Description

If ShowAccelChar is True, an ampersand in the component’s Caption text appears as an underline and makes the character after it into an accelerator key. If ShowAccelChar is False, ampersands appear as ampersands.


TCustomStaticText methods

TCustomStaticText	Alphabetically

In TCustomStaticText

Create

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

Destroy

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomStaticText methods

TCustomStaticText	By object

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateControlState


TCustomStaticText.Create

TCustomStaticText	See also

Creates and initializes a TCustomStaticText instance.

constructor Create(AOwner: TComponent); override;

Description

Create calls the inherited constructor method, then initializes the TCustomStaticText instance by adding the following flags to ControlStyle: csCaptureMouse, csClickEvents, csSetCaption, csOpaque, csReplicatable, csDoubleClicks. Create also sets AutoSize and ShowAccelChar to True.


Scope

Protected

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TControlActionLink

Hierarchy	Properties	Methods	Events

TControlActionLink links action objects to clients that descend from TControl.

Unit

Controls

Description

TControlActionLink is designed to link actions to generic control clients. It overrides methods to determine whether the action and client are linked, and to ensure that action events are appropriate for properties and events of control clients.

TControlActionLink overrides methods to support linking the following actions with control client properties or events, most of which have the same name:

Caption

Enabled

Hint

Visible

OnExecute

Use TControlActionLink as a base class when creating an action link class that targets a more specific client type. Descendant classes of TControlActionLink already support certain branches of the VCL, such as TWinControl client types.


TControlActionLink properties

TControlActionLink	Alphabetically

Derived from TBasicActionLink

Action


TControlActionLink properties

TControlActionLink	By object

Action


TControlActionLink events

TControlActionLink	Alphabetically

Derived from TBasicActionLink

OnChange


TControlActionLink events

TControlActionLink	By object

OnChange


TControlActionLink methods

TControlActionLink	Alphabetically	Legend

In TControlActionLink

AssignClient

DoShowHint

IsCaptionLinked

IsEnabledLinked

IsHintLinked

IsOnExecuteLinked

IsVisibleLinked

SetCaption

SetEnabled

SetHint

SetOnExecute

SetVisible

Derived from TBasicActionLink

Create

Destroy

Execute

Update

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TControlActionLink methods

TControlActionLink	By object	Legend

AfterConstruction

AssignClient

BeforeDestruction

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

DoShowHint

Execute

FieldAddress

FreeInstance

Free

GetInterfaceEntry

GetInterfaceTable

GetInterface

InheritsFrom

InitInstance

InstanceSize

IsCaptionLinked

IsEnabledLinked

IsHintLinked

IsOnExecuteLinked

IsVisibleLinked

MethodAddress

MethodName

NewInstance

SafeCallException

SetCaption

SetEnabled

SetHint

SetOnExecute

SetVisible

Update


TControlActionLink.AssignClient

TControlActionLink	See also

Assigns a client control that is linked to the associated action.

procedure AssignClient(AClient: TObject); override;

Description

TControlActionLink overrides AssignClient to ensure that the client for the action descends from TControl. Descendants of TControlActionLink can further limit the type of client associated with the link.


TControlActionLink.DoShowHint

TControlActionLink	See also

Indicates whether the hint is shown, and modified.

function DoShowHint(var HintStr: string): Boolean; virtual;

Description

DoShowHInt determines whether a hint is shown when the mouse moves across a control. DoShowHint also provides an opportunity to modify the hint, and/or append a shortcut to the end of the hint string. If either the application, the control, or the action veto showing the hint, then the hint is not shown. DoShowHint returns True by default. You can override this function to return False if the hint is not shown or modified, or if the shortcut is not appended.


TControlActionLink.IsCaptionLinked

TControlActionLink	See also

Indicates whether the action for the caption and the client are linked.

function IsCaptionLinked: Boolean; override;

Description

IsCaptionLinked indicates whether the action, for the caption, is linked to the appropriate client property. IsCaptionLinked returns True if the client requests that the action control this event, False otherwise.


TControlActionLink.IsEnabledLinked

TControlActionLink	See also

Indicates whether the action for the enabled state and the client are linked.

function IsEnabledLinked: Boolean; override;

Description

IsEnabledLinked indicates whether the action, for the enabled state, is linked to the appropriate client property. IsEnabledLinked returns True if the client requests that the action control this event, False otherwise.


TControlActionLink.IsHintLinked

TControlActionLink	See also

Indicates whether the action for the hint and the client are linked.

function IsHintLinked: Boolean; override;

Description

IsHintLinked indicates whether the action, for the hint, is linked to the appropriate client property. IsHintLinked returns True if the client requests that the action control this event, False otherwise.


TControlActionLink.IsOnExecuteLinked

TControlActionLink	See also

Indicates whether the action for the OnExecute event handler and the client are linked.

function IsOnExecuteLinked: Boolean; override;

Description

IsOnExecuteLinked indicates whether the action, for the OnExecute event handler, is linked to the appropriate client event. IsOnExecuteLinked returns True if the client requests that the action control this event, False otherwise.


TControlActionLink.IsVisibleLinked

TControlActionLink	See also

Indicates whether the action for the visible state and the client are linked.

function IsVisibleLinked: Boolean; override;

Description

IsVisibleLinked indicates whether the action, for the visible state, is linked to the appropriate client property. IsVisibleLinked returns True if the client requests that the action control this event, False otherwise.


TControlActionLink.SetCaption

TControlActionLink	See also

Sets the caption of a control if the client is linked to the action for this event.

procedure SetCaption(const Value: string); override;

Description

SetCaption sets the caption of a control, and is called only if the client is linked for this event. Value specifies the string to which the caption should be set.


TControlActionLink.SetEnabled

TControlActionLink	See also

Sets the enabled state of a control if the client is linked to the action for this event.

procedure SetEnabled(Value: Boolean); override;

Description

SetEnabled sets the enabled state of a control, and is called only if the client is linked for this event. Value specifies whether the enabled state should be set.


TControlActionLink.SetHint

TControlActionLink	See also

Sets the hint of a control if the client is linked to the action for this event.

procedure SetHint(const Value: string); override;

Description

SetHint sets the hint of a control, and is called only if the client is linked for this event. Value specifies the string to which the hint should be set.


TControlActionLink.SetOnExecute

TControlActionLink	See also

Sets the execution event handler for a control if the client is linked to the action for this event.

procedure SetOnExecute(Value: TNotifyEvent); override;

Description

SetOnExecute sets the appropriate execution event handler of a control, and is called only if the client is linked for this event. Value specifies the procedure that should be used for this event.


TControlActionLink.SetVisible

TControlActionLink	See also

Sets the visible state of a control if the client is linked to the action for this event.

procedure SetVisible(Value: Boolean); override;

Description

SetVisible sets the visible state of a control, and is called only if the client is linked for this event. Value specifies whether the visible state should be set.


Scope

Protected


Hierarchy

TObject

TBasicActionLink

TActionLink


TControlScrollBar

Hierarchy	Properties	Methods	See also

TControlScrollBar displays a horizontal or vertical scroll bar.

Unit

forms

Description

Use TControlScrollBar to control the scrollbar in a scrolling windowed control such as TForm or TScrollBox. TControlScrollBar introduces properties that control the size of the scrollable region and the position to which that region is scrolled, and when the scrollbar appears.


TControlScrollBar properties

TControlScrollBar	Alphabetically	Legend

In TControlScrollBar

ButtonSize

Color

Increment

Kind

Margin

ParentColor

Position

Range

ScrollPos

Size

Smooth

Style

ThumbSize

Tracking

Visible


TControlScrollBar properties

TControlScrollBar	By object	Legend

ButtonSize

Color

Increment

Kind

Margin

ParentColor

Position

Range

ScrollPos

Size

Smooth

Style

ThumbSize

Tracking

Visible


TControlScrollBar.ButtonSize

TControlScrollBar	See also

Specifies the sizes of the buttons in the scroll bar.

property ButtonSize: Integer

Description

Use ButtonSize to specify the sizes of the buttons in the scroll bar. If the scroll bar is horizontal, ButtonSize is the width of the arrow buttons in pixels. If the scroll bar is vertical, ButtonSize is the height of the arrow buttons in pixels.


TControlScrollBar.Color

TControlScrollBar	See also

Specifies the scroll bar’s color.

property Color: TColor

Description

Use Color to specify the scroll bar’s color.

If the scroll bar’s ParentColor property is True, then the Color property reflects the Windows button highlight color, and changing this color in the Windows control panel automatically updates the value of Color. When the value of the Color property is changed, its ParentColor property is automatically set to False.


TControlScrollBar.Increment

TControlScrollBar 	See also	Example

Determines how far the display moves when the user clicks one of the small end arrows on the scroll bar.

type TScrollBarInc = 1..32767;

property Increment: TScrollBarInc;

Description

Use Increment to control how the scrollbar affects the scrollable region of the control. If Increment is set to 1, each click scrolls by one position; if Increment is set to 2, each click scrolls by two positions; and so forth.

Note:	Do not use the Increment property when Smooth is set to True. When Smooth is True, every time the range or visibility of the scrollbar changes, the value of Increment is dynamically recomputed.


TControlScrollBar.Kind

TControlScrollBar	See also

Determines whether the scroll bar is horizontal or vertical.

type = (sbHorizontal, sbVertical);

property Kind: ScrollBarKind;

Description

Kind indicates whether the scroll bar has a vertical or horizontal orientation. This value is initialized in the constructor, when the scroll bar is created by a scrolling windowed control for its VertScrollBar or HorzScrollBar property.

These are the possible values for Kind:

Value	Meaning

sbHorizontal	Scroll bar is horizontal

sbVertical	Scroll bar is vertical


TControlScrollBar.Margin

TControlScrollBar	See also 	Example

Determines when a scroll bar is generated.

property Margin: Word;

Description

The Margin property determines the minimum number of pixels that must separate each control from the edge of the scrolling windowed control that uses the scroll bar. At runtime, whenever a child control is less than Margin pixels from the edge and Visible is set to True, a scroll bar appears.


TControlScrollBar.ParentColor

TControlScrollBar	See also

Specifies whether the scroll bar should reflect the Windows button highlight color.

property ParentColor: Boolean;

Description

Use ParentColor to indicate that the scroll bar should always reflect the Windows button highlight color. Using ParentColor differs from setting the Color property to clBtnHighligh in that when ParentColor is True, changing the button highlight color in the Windows control panel automatically updates the value of Color.

When the value of the Color property is changed, its ParentColor property is automatically set to False.


TControlScrollBar.Position

TControlScrollBar	See also 	Example

Specifies the position of the thumb tab on the scroll bar.

property Position: Integer;

Description

Use Position to programmatically scroll the client area of the associated control. The value of Position changes (from 0 to Range) at runtime as the user scrolls the scroll bar.


TControlScrollBar.Range

TControlScrollBar	See also 	Example

Determines how far the scrolling region of the associated control can move.

property Range: Integer;

Description

Range represents the virtual size (in pixels) of the associated control’s client area. For example, if the Range of a form’s horizontal scroll bar is set to 500, and the width of the form is 200, the scroll bar’s Position can vary from 0 to 300.

If the Range of a horizontal scroll bar is less than the width of the form or scroll box, no horizontal scroll bar appears. If the Range of a vertical scroll bar is less than the height of the form or scroll box, no vertical scroll bar appears.

The value of Range is set automatically, but can be overridden in the Object Inspector or in program code.


TControlScrollBar.ScrollPos

TControlScrollBar	See also

Indicates the position of the thumb tab.

property ScrollPos: Integer;

Description

The read-only ScrollPos property returns the current value of Position when the scrollbar is visible. If the scrollbar is not visible, ScrollPos returns 0.


TControlScrollBar.Size

TControlScrollBar	See also

Specifies the scroll bar’s size.

property Size: Integer

Description

Use Size to specify the width of the scroll bar in pixels.

Note:	The length of the scroll bar is determined by the width (for horizontal scroll bars) or height (for vertical scroll bars) of the associated scrolling windowed control.


TControlScrollBar.Smooth

TControlScrollBar	See also

Specifies whether the amount the associated control scrolls is dynamically computed.

property Smooth: Boolean;

Description

Set Smooth to True to specify that the scroll bar should dynamically adjust its scrolling increment based on the size of the associated control’s client area.

When Smooth is True, clicking the end arrows of the scrollbar scrolls the associated control by approximately one tenth of its client area, and clicking the scrollbar beside the thumb tab scrolls the control by the length of the client area minus the amount scrolled by the end arrows. When Smooth is False, the Increment property controls the amount of scrolling when the user clicks the end arrows, and clicking beside the thumb tab scrolls the control by the entire length of the client area.


TControlScrollBar.Style

TControlScrollBar

Specifies the scroll bar’s style.

property Style: TScrollBarStyle

Description

Use Style to specify the scroll bar’s style. The style determines whether the scroll bar appears three-dimensional, flat, or uses hot tracking.


TControlScrollBar.ThumbSize

TControlScrollBar	See also

Specifies the length of the scroll bar’s thumb tab.

property ThumbSize: Integer

Description

Use ThumbSize to specify the length of the scroll bar’s thumb tab.


TControlScrollBar.Tracking

TControlScrollBar

Determines whether the form or scroll box moves before the thumb tab is released.

property Tracking: Boolean;

Description

Use Tracking to control whether the scrollbar and associated control repaint while the thumb tab is dragged with the mouse.  If Tracking is True, the image moves as the user drags the thumb tab. If Tracking is False, the image remains static until the thumb tab is released.

Repainting while the thumb tab is dragged can provide useful feedback to the user about how far the control has scrolled, but slows performance.


TControlScrollBar.Visible

TControlScrollBar	See also 	Example

Determines whether the scroll bar appears.

property Visible: Boolean;

Description

If Visible is set to True, a scroll bar appears whenever a visual component is less than Margin pixels from the edge of the form or scroll box. If Visible is set to False, the scroll bar is never visible. This is useful, for example, for programmatically controlling the scroll position of a form without allowing the user to control the scroll position.


TControlScrollBar methods

TControlScrollBar	Alphabetically

In TControlScrollBar

Assign

ChangeBiDiPosition

Create

IsScrollBarVisible

Derived from TPersistent

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TControlScrollBar methods

TControlScrollBar	By object

AfterConstruction

Assign

BeforeDestruction

ChangeBiDiPosition

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

IsScrollBarVisible

MethodAddress

MethodName

NewInstance

SafeCallException


TControlScrollBar.Assign

TControlScrollBar	See also

Copies the contents of a TControlScrollBar instance to another TControlScrollBar.

procedure Assign(Source: TPersistent); override;

Description

Assign copies the Visible, Range, Position, and Increment properties from the source object to the TControlScrollBar instance. If the Source parameter is not another scroll bar, Assign calls the TPersistent Assign method, which allows the source object to copy properties if it has an AssignTo method that knows how to copy to a control scroll bar.


TControlScrollBar.ChangeBiDiPosition

TControlScrollBar	See also

Changes the position of a horizontal scroll bar to match the current bi-directional mode.

procedure ChangeBiDiPosition;

Description

Use ChangeBiDiPosition to change the position of a horizontal scroll bar to reflect the current bi-directional mode of its associated scrolling windowed control.

For example, TScrollingWinControl calls ChangeBiDiPosition from its DoFlipChildren method to determine whether the scroll bar should be repositioned along with the child controls.


TControlScrollBar.IsScrollBarVisible

TControlScrollBar	See also

Returns True if the scroll bar is visible.

function IsScrollBarVisible: Boolean;

Description

Call IsScrollBarVisible to determine whether the scroll bar is visible. IsScrollBarVisible returns True if the Visible property is True and the associated scrolling windowed control contains child controls that lie within Margin pixels from the edge.


TControlScrollBar.Create

TControlScrollBar	See also

Creates a new TControlScrollBar object.

constructor Create(AControl: TScrollingWinControl; AKind: TScrollBarKind);

Description

Do not create instances of TControlScrollBar. These objects are created automatically by the scrolling windowed controls that use them.

The AControl parameter is the associated scrolling windowed control that creates the scroll bar. The AKind parameter indicates whether the scroll bar is used as a horizontal or vertical scroll bar. AKind becomes the value of the Kind property.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent


TControlCanvas

Hierarchy	Properties	Methods	Events	See also

TControlCanvas is a specialized canvas object associated with a control.

Unit

controls

Description

Use TControlCanvas as a drawing space to render the image of a control. Standard window controls such as edit controls or list boxes do not require a canvas, as they are drawn by Windows.

As a canvas, TControlCanvas provides many properties, events, and methods to aid in the creation of rich images. In addition, TControlCanvas adds properties and methods to interact with a control object, and to manage the device context associated with the control.

TControlCanvas is used by TGraphicControl and TCustomControl to provide services for rendering their images.


TControlCanvas properties

TControlCanvas	Alphabetically	Legend

In TControlCanvas

Control

Derived from TCanvas

Brush

CanvasOrientation

ClipRect

CopyMode

Font

Handle

LockCount

Pen

PenPos

Pixels

TextFlags


TControlCanvas properties

TControlCanvas	By object	Legend

Brush

CanvasOrientation

ClipRect

Control

CopyMode

Font

Handle

LockCount

Pen

PenPos

Pixels

TextFlags


TControlCanvas.Control

TControlCanvas	See also

Specifies the control associated with the control canvas object.

property Control: TControl;

Description

Read Control to gain access to the control associated with the control canvas object. Descendants of TControl that use a control canvas set the Control property to form the association. The control canvas object uses the Control property to get information from its associated control.


TControlCanvas events

TControlCanvas	Alphabetically

Derived from TCanvas

OnChange

OnChanging


TControlCanvas events

TControlCanvas	By object

OnChange

OnChanging


TControlCanvas methods

TControlCanvas	Alphabetically

In TControlCanvas

Destroy

FreeHandle

UpdateTextFlags

Derived from TCanvas

Arc

BrushCopy

Chord

CopyRect

Create

Draw

DrawFocusRect

Ellipse

FillRect

FloodFill

FrameRect

LineTo

Lock

MoveTo

Pie

PolyBezier

PolyBezierTo

Polygon

Polyline

Rectangle

Refresh

RoundRect

StretchDraw

TextExtent

TextHeight

TextOut

TextRect

TextWidth

TryLock

Unlock

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TControlCanvas methods

TControlCanvas	By object

AfterConstruction

Arc

Assign

BeforeDestruction

BrushCopy

Chord

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

CopyRect

Create

DefaultHandler

Destroy

Dispatch

Draw

DrawFocusRect

Ellipse

FieldAddress

FillRect

FloodFill

FrameRect

Free

FreeHandle

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

LineTo

Lock

MethodAddress

MethodName

MoveTo

NewInstance

Pie

PolyBezier

PolyBezierTo

Polygon

Polyline

Rectangle

Refresh

RoundRect

SafeCallException

StretchDraw

TextExtent

TextHeight

TextOut

TextRect

TextWidth

TryLock

Unlock

UpdateTextFlags


TControlCanvas.Destroy

TControlCanvas	See also

Destroys an instance of TControlCanvas.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. The controls that use a TControlCanvas object destroy it by calling Free from their own destructors. Free verifies that the TControlCanvas object is not nil and only then calls Destroy.

Destroy releases the handle to a device context (HDC) the control canvas uses before freeing the memory associated with the object.


TControlCanvas.FreeHandle

TControlCanvas	See also

Releases the handle to a device context (HDC) used by the control canvas object.

procedure FreeHandle;

Description

Call FreeHandle to free the HDC used by the control canvas. FreeHandle sets the Handle property to NULL. After calling FreeHandle, an HDC will be re-acquired if any of the drawing methods are called.

Note:	Setting the Handle property to NULL does not free the HDC. Set the Handle property to NULL rather than call FreeHandle if the HDC is release by the application.


TControlCanvas.UpdateTextFlags

TControlCanvas	See also

Updates the canvas’ text flags to reflect the associated control’s BiDiMode property.

procedure UpdateTextFlags;

Description

UpdateTextFlags is used internally to update the text flags that the canvas passes to Windows when drawing text. UpdateTextFlags uses the associated control’s UseRightToLeftReading method to ensure that it reflects the control’s BiDiMode property on the current system. If UseRightToLeftReading returns True and the application is running on a Middle Eastern system, UpdateTextFlags adds ETO_RTLREADING to the TextFlags property. Otherwise, UpdateTextFlags removes ETO_RTLREADING from TextFlags.


Description


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCanvas


TCustomActiveForm

Hierarchy	Properties	Methods	Events

TCustomActiveForm is the base class for Active Forms.

Unit

forms

Description

TCustomActiveForm is used in code that is generated automatically by the ActiveForm wizard. For more information, see Generating an ActiveX control based on a VCL form.


TCustomActiveForm properties

TCustomActiveForm	Alphabetically	Legend

In TCustomActiveForm

AxBorderStyle

Derived from TCustomForm

Active

ActiveControl	ActiveControl

ActiveMDIChild

ActiveOleControl

BorderStyle

Canvas

ClientHeight

ClientRect

ClientWidth

Designer

DropTarget

Floating

FormState

HelpFile

KeyPreview

Menu

ModalResult

Monitor

OldCreateOrder

OleFormObject

Parent

PixelsPerInch

PrintScale

Scaled

Visible

WindowState

Derived from TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

BorderWidth

Brush

ClientOrigin

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

AutoSize

BiDiMode

BoundsRect

Caption

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomActiveForm properties

TCustomActiveForm	By object	Legend

Action

Active

ActiveControl

ActiveOleControl

Align

Anchors

AutoScroll

AutoSize

AxBorderStyle

BiDiMode

BorderStyle

BorderWidth

BoundsRect

Brush

Canvas

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

Designer

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DropTarget

Enabled

Floating

FloatingDockSiteClass

Font

FormState

Handle

Height

HelpContext

HelpFile

Hint

HorzScrollBar

HostDockSite

KeyPreview

Left

LRDockWidth

Menu

ModalResult

Monitor

Name

OldCreateOrder

OleFormObject

Owner

Parent

ParentWindow

PixelsPerInch

PopupMenu

PrintScale

Scaled

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

VertScrollBar

Visible

VisibleDockClientCount

Width

WindowProc

WindowState


TCustomActiveForm.AxBorderStyle

See also

Sets the active form's border style.

property AxBorderStyle: TActiveFormBorderStyle;

Description

AxBorderStyle takes one of the following values:

Values	Meaning

afbNone	No border appears around the active form.

afbSingle	A single line border appears around the active form.

afbSunken	The active form gets a sunken border.

afbRaised	The active form gets a raised border and no caption.


TCustomActiveForm events

TCustomActiveForm	Alphabetically	Legend

Derived from TCustomForm

OnActivate

OnCreate

OnDeactivate

OnDestroy

OnPaint

Derived from TWinControl

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnMouseDown

OnMouseMove

OnMouseUp


TCustomActiveForm events

TCustomActiveForm	By object	Legend

OnActivate

OnClick

OnCreate

OnDblClick

OnDeactivate

OnDestroy

OnDragDrop

OnDragOver

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnPaint


TCustomActiveForm methods

TCustomActiveForm	Alphabetically	Legend

In TCustomActiveForm

Create

CreateParams

WantChildKey

Derived from TCustomForm

AfterConstruction

BeforeDestruction

Close

CloseQuery

CreateNew

DefaultHandler

DefocusControl

Destroy

Dock

FocusControl

GetFormImage

Hide

IsShortCut

MouseWheelHandler

Print

Release

SendCancelMode

SetFocus

SetFocusedControl

Show

ShowModal

Derived from TScrollingWinControl

DisableAutoRange

EnableAutoRange

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomActiveForm methods

TCustomActiveForm	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

Close

CloseQuery

ContainsControl

ControlAtPos

Create

CreateNew

CreateParams

CreateParented

CreateParentedControl

DefaultHandler

DefocusControl

Destroy

DestroyComponents

Destroying

DisableAlign

DisableAutoRange

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EnableAutoRange

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

FocusControl

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetFormImage

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

IsShortCut

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Print

Realign

Refresh

Release

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendCancelMode

SendToBack

SetBounds

SetFocus

SetFocusedControl

SetTextBuf

Show

ShowModal

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

WantChildKey


TCustomActiveForm.Create

See also

Creates a new TCustomActiveForm object.

constructor Create(AOwner: TComponent); override;

Description

Create performs the following tasks:

Sets the AxBorderStyle property to afbSingle.

Calls the inherited Create method.

Sets the BorderStyle property to bsNone.

Clears the BorderIcons property.

Sets the TabStop property to True.


TCustomActiveForm.Create
TCustomActiveForm.CreateParams

See also

Updates the active form's creation parameters according to the value of the AxBorderStyle property.

procedure CreateParams(var Params: TCreateParams); override;

Description

CreateParams performs the following tasks:

Calls the inherited CreateParams method.

Removes the WS_CAPTION flag from Params.Style.

Adds flags to Params.Style and Params.ExStyle according to the value of the AxBorderStyle property, as shown in the following table:

AxBorderStyle	Style	ExStyle

afbNone	Nothing	Nothing

afbSingle	WS_BORDER	Nothing

afbSunken	Nothing	WS_EX_CLIENTEDGE

afbRaised	WS_DLGFRAME	WS_EX_WINDOWEDGE

Note:	The creation parameters are not updated when the form is in design mode.


TCustomActiveForm.WantChildKey

See also

Overrides TCustomForm.WantChildKey in order to provide ActiveX functionality.

function WantChildKey(Child: TControl; var Message: TMessage): Boolean; override;

Description

Do not call WantChildKey. It is used internally to ensure that keyboard events sent to child objects are handled correctly.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TScrollingWinControl

TCustomForm


TCustomAction

Hierarchy	Properties	Methods	Events	See also

TCustomAction is the base class for actions meant to be used with menu items and controls.

Unit

ActnList

Description

TCustomAction introduces support for the properties and methods of menu items and controls that are linked to action objects. Use TCustomAction as a base class when deriving your own actions that publish specific properties of associated controls. The VCL provides a generic descendant class that publishes all of the properties of TCustomAction as well as specialized action classes for such components as datasets or text controls.

Action components are used to centralize responses to user commands, so that you can synchronize, for example, the enabled state and caption of a speed button and a menu item. The action object has a target or client that it communicates with through an action link. You can work with actions at design-time in the action list editor of an action list. The action list is a container for actions, which can be sub-grouped into categories.

Component and control properties and events that are supported in TCustomAction, either directly or through an ancestor, and published in TAction are:

Caption

Checked

Enabled

HelpContext

Hint

ImageIndex

ShortCut

Visible

OnHint

OnUpdate

OnExecute


TCustomAction properties

TCustomAction	Alphabetically	Legend

In TCustomAction

Caption

Checked

DisableIfNoHandler

Enabled

HelpContext

Hint

ImageIndex

Name

ShortCut

Visible

Derived from TContainedAction

ActionList

Category

Index

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomAction properties

TCustomAction	By object	Legend

ActionList

Caption

Category

Checked

ComObject

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

DisableIfNoHandler

Enabled

HelpContext

Hint

ImageIndex

Index

Name

Owner

ShortCut

Tag

VCLComObject

Visible


TCustomAction.Caption

TCustomAction 	See also

Contains the Caption property for the action.

property Caption: string;

Description

Caption holds the string that is the caption for the action when it is set. This string represents the Caption property of associated controls and menu items.


TCustomAction.Checked

TCustomAction 	See also	Example

Contains the Checked property for the action.

property Checked: Boolean;

Description

Checked specifies the checked state for the action. This value represents the value of the Checked property of associated controls and menu items.


TCustomAction.DisableIfNoHandler

TCustomAction	See also

Indicates whether associated components should be disabled if no handler is found.

property DisableIfNoHandler: Boolean;

Description

DisableIfNoHandler specifies whether the Enabled property of associated components should be set to False if no handler can be found for the action. These components check for an action handler in their UpdateAction method.


TCustomAction.Enabled

TCustomAction	See also

Contains the Enabled property for the action.

property Enabled: Boolean;

Description

Checked specifies the enabled state for the action. This value represents the value of the Enabled property of associated controls and menu items.


TCustomAction.HelpContext

TCustomAction	See also

Contains the HelpContext property for the action.

property HelpContext: THelpContext;

Description

HelpContext holds the value that is the help context for the action when it is set. This represents the HelpContext property of associated controls and menu items.


TCustomAction.Hint

TCustomAction	See also

Contains the Hint property for the action.

property Hint: string;

Description

Hint holds the string that is the hint for that action when it is set. This value represents the Hint property of associated controls and menu items.


TCustomAction.ImageIndex

TCustomAction	See also

Contains the ImageIndex property for the action.

property ImageIndex: TImageIndex;

Description

ImageIndex is an index into the Images property of the action list that contains the action. It identifies an image that is associated with controls and menu items that use this action.


TCustomAction.Name

TCustomAction	 See also

Name contains the name of the action as referenced by other components.

property Name: TComponentName;

Description

Use Name when referring to the action in code.

If Name is set to the same string as Caption, then the two properties become identified: That is, subsequent changes to the value of Name update the caption as well.


TCustomAction.ShortCut

TCustomAction	 See also

Contains the ShortCut property for the action.

property ShortCut: TShortCut;

Description

ShortCut holds the value that is the shortcut for the action when it is set. This represents the value of the ShortCut property on associated menu items.


TCustomAction.Visible

TCustomAction	 See also

Contains the Visible property for the action.

property Visible: Boolean;

Description

Visible specifies the visible state for the action. This represents the Visible property of associated controls or menu items.


TCustomAction events

TCustomAction	Alphabetically	Legend

In TCustomAction

OnHint

Derived from TBasicAction

OnExecute

OnUpdate


TCustomAction events

TCustomAction	By object	Legend

OnExecute

OnHint

OnUpdate


TCustomAction.OnHint

TCustomAction	 See also

Occurs when the mouse pauses over an associated control or menu item that can display a Help Hint.

THintEvent = procedure (var HintStr: string; var CanShow: Boolean) of object;

property OnHint: THintEvent;

Description

Use OnHint to override the default hint that appears when the user pauses the mouse over an associated control or menu item.

In the event handler, use HintStr to override the Hint property when displaying the hint string in a popup window. Set CanShow to indicate whether or not the hint should be shown at all.


TCustomAction methods

TCustomAction	Alphabetically	Legend

In TCustomAction

AssignTo

Create

Destroy

DoHint

Execute

SetName

Derived from TContainedAction

GetParentComponent

HasParent

Update

Derived from TBasicAction

ExecuteTarget

HandlesTarget

RegisterChanges

UnRegisterChanges

UpdateTarget

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomAction methods

TCustomAction	By object	Legend

AfterConstruction

Assign

AssignTo

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DoHint

Execute

ExecuteAction

ExecuteTarget

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HandlesTarget

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RegisterChanges

RemoveComponent

SafeCallException

SetName

UnRegisterChanges

Update

UpdateAction

UpdateTarget


TCustomAction.AssignTo

TCustomAction	See also

Copies the properties of an object to a destination object.

procedure AssignTo(Dest: TPersistent); override;

Description

AssignTo is overriden so that existing objects of type TCustomAction can be copied to other action objects of the same type. AssignTo ensures the correct assignment of property values.


TCustomAction.Create

TCustomAction	See also

Instantiates and initializes a TCustomAction object.

constructor Create(AOwner: TComponent); override;

Description

Applications do not need to call the constructor directly. Actions are created automatically when you connect an action with a client in the action list editor. If you want to create an action at runtime, use the constructor and assign a TActionList component to its action list property.

Create calls the inherited Create and then initializes the following properties:

DisableIfNoHandler to True

Enabled to True

ImageIndex to -1

Visible to True


TCustomAction.Destroy

TCustomAction	See also

Frees an instance of TCustomAction.

destructor Destroy; override;

Description

Do not call the destructor directly in an application. Instead, call Free. Free ensures that the action is not nil before calling the destructor.

If the action is contained in an action list, Destroy removes the action from that list.


TCustomAction.DoHint

TCustomAction	See also

Generates an OnHint event.

function DoHint(var HintStr: string): Boolean; dynamic;

Description

DoHint checks for an OnHint event handler and passes HintStr to it, if the handler exists. DoHint returns True if no event handler is assigned.


TCustomAction.Execute

TCustomAction	See also

Updates the action, then generates an OnExecute event.

function TCustomAction.Execute: Boolean; override;

Description

Execute ensures that the action is updated, and then generates an OnExecute event only if the Enabled property is True.


TCustomAction.SetName

TCustomAction	 See also

Sets the value of the Name property.

procedure SetName(const Value: TComponentName); override;

Description

SetName is used as the write part of the Name property. It calls the ChangeName method, which performs the actual name change. ChangeName is not virtual. SetName is overriden to modify the behavior of the Name property so that it also changes the Caption property if it is meant to be the same as Name.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TBasicAction

TContainedAction


TCustomApplicationEvents

Hierarchy	Properties	Methods	Events	See also

TCustomApplicationEvents intercepts application-level events.

Unit

Appevnts

Description

Use TCustomApplicationEvents as a base class for objects that intercept the events of the global Application object. Each event of the TApplicationEvents object is the same as the event with the same name on the Application object.

Do not create instances of TCustomApplicationEvents. Instead, use a descendant of TCustomApplicationEvents such a TApplicationEvents.


TCustomApplicationEvents properties

TCustomApplicationEvents	Alphabetically	Legend

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomApplicationEvents properties

TCustomApplicationEvents	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomApplicationEvents events

TCustomApplicationEvents	Alphabetically	Legend

In TCustomApplicationEvents

OnActionExecute

OnActionUpdate

OnActivate

OnDeactivate

OnException

OnHelp

OnHint

OnIdle

OnMessage

OnMinimize

OnRestore

OnShortCut

OnShowHint


TCustomApplicationEvents events

TCustomApplicationEvents	By object	Legend

OnActionExecute

OnActionUpdate

OnActivate

OnDeactivate

OnException

OnHelp

OnHint

OnIdle

OnMessage

OnMinimize

OnRestore

OnShortCut

OnShowHint


TCustomApplicationEvents.OnActionExecute

TCustomApplicationEvents	See also

Occurs when an action’s Execute method is called and its action list has not already handled it.

property OnActionExecute: TActionEvent;

Description

Use the OnExecute event handler to respond when a user invokes actions whose action lists do not have OnExecute event handlers.

If the action list that contains the action does not handle it in an OnExecute event handler, then the action is routed to the Application object’s OnActionExecute event. The application events object hooks this event and responds with its own OnActionExecute event handler.

The Handled parameter of the event handler returns False by default. If the handler handles the event, it should change Handled to True, thereby preventing further attempts to handle the action. When the event handler exits with Handled set to False, the event first goes to any other application events objects, and then the action’s OnExecute event occurs. If the action remains unhandled after that, the active control’s ExecuteAction method is called to allow the action to execute with an identified target. Finally, the active form’s ExecuteAction method is called if all other handlers do not handle the action.

Note:	Call the CancelDispatch method from an OnActionExecute event handler to prevent the application from forwarding the event to any other application events objects.


TCustomApplicationEvents.OnActionUpdate

TCustomApplicationEvents	See also

Occurs when an action’s Update method is called and its action list has not already handled it.

property OnActionUpdate: TActionEvent;

Description

Use the OnActionUpdate event handler to update the properties of an action when the application is idle if the action’s action list does not handle it in an OnUpdate event handler. OnActionUpdate occurs after the OnIdle event.

If the action list that contains the action does not update it in an OnUpdate event handler, the action is routed to the Application object’s OnActionUpdate event. The application events object hooks this event and responds with its own OnActionUpdate event handler.

The Handled parameter of the event handler returns False by default. If the handler updates the event, it should change Handled to True, thereby ending the processing of the action. When the event handler exits with Handled set to False, the event first goes to any other application events objects, and then the action’s OnUpdate event occurs. If the action is not updated after that, the active control’s UpdateAction method is called to allow the target to update the action. Finally, the active form’s UpdateAction method is called if all other handlers do not handle the action.

Note:	Call the CancelDispatch method from an OnActionUpdate event handler to prevent the application from forwarding the event to any other application events objects.


TCustomApplicationEvents.OnActivate

TCustomApplicationEvents	See also

Occurs when an application becomes active.

property OnActivate: TNotifyEvent;

Description

Write an OnActivate event handler to perform special processing when the application becomes active.

An application becomes active when it is initially run or when focus moves from another Windows application back to any window of the application.

Note:	Call the CancelDispatch method from an OnActivate event handler to prevent the application from forwarding the event to any other application events objects.


TCustomApplicationEvents.OnDeactivate

TCustomApplicationEvents	See also

Occurs when an application becomes inactive.

property OnDeactivate: TNotifyEvent;

Description

Write an OnDeactive event handler to perform any special processing that should occur immediately before the application is deactivated. The OnDeactivate event occurs when the user switches from the application to another Windows application.

Note:	Call the CancelDispatch method from an OnDeactivate event handler to prevent the application from forwarding the event to any other application events objects.


TCustomApplicationEvents.OnException

TCustomApplicationEvents	See also

Occurs when an unhandled exception occurs in the application.

type TExceptionEvent = procedure (Sender: TObject; E: Exception) of object;

property OnException: TExceptionEvent;

Description

Use OnException to change the default behavior that occurs when an exception is not handled by application code. The OnException event handler is called automatically in the application’s HandleException method.

OnException only handles exceptions that occur during message processing. Exceptions that occur before or after the execution of the application’s Run method do not generate OnException events.

If an exception passes through the try blocks in the application code, the application automatically calls the HandleException method. Unless the exception object is EAbort, HandleException calls the OnException handler, if one exists. Otherwise, it calls ShowException to display a message box indicating an error occurred.

The Sender parameter is the object that raised the exception, and E is the exception object.

Note:	Call the CancelDispatch method from an OnExeception event handler to prevent the application from forwarding the event to any other application events objects.


TCustomApplicationEvents.OnHelp

TCustomApplicationEvents	See also

Occurs when the application receives a request for help.

type THelpEvent = function (Command: Word; Data: Longint; var CallHelp: Boolean): Boolean of object;

property OnHelp: THelpEvent;

Description

Write an OnHelp event handler to perform special processing when the user requests help. The HelpContext and the HelpJump methods automatically trigger the OnHelp event.

Set CallHelp to True to have the application call WinHelp after the event. Set CallHelp to False to prevent the application from calling WinHelp. All application help methods go through OnHelp. The application calls WinHelp only if OnHelp’s CallHelp parameter returns True, or if no OnHelp event handler is assigned.

To find the possible values of the Command and Data parameters, search for WinHelp in the Win32 Developer's Reference Help (Win32.HLP) file, which explains the WinHelp API (application programming interface). The possible values for the Data parameter depend upon the value of the Command parameter.

The return value is True if the event handler succeeds, False if it fails.

Note:	Call the CancelDispatch method from an OnHelp event handler to prevent the application from forwarding the event to any other application events objects.


TCustomApplicationEvents.OnHint

TCustomApplicationEvents	See also

Occurs when the mouse pointer moves over a control or menu item that can display a Help Hint.

property OnHint: TNotifyEvent;

Description

Write an OnHint event handler to perform special processing when the mouse pauses over a control or menu item whose Hint property is not an empty string (‘’).

A common use of the OnHint event is to display the value of a control or menu item's Hint property as the text of a status bar (TStatusBar). The Hint property of a control can specify both a short Help Hint and a (usually) longer hint that appears elsewhere because of code in an OnHint event handler.

Note:	Call the CancelDispatch method from an OnHint event handler to prevent the application from forwarding the event to any other application events objects.


TCustomApplicationEvents.OnIdle

TCustomApplicationEvents 	See also

Occurs when an application becomes idle.

type TIdleEvent = procedure (Sender: TObject; var Done: Boolean) of object;

property OnIdle: TIdleEvent;

Description

Write an OnIdle event handler to perform special processing when an application is idle. An application is idle when it is not processing code. For example, an application is idle when it is waiting for input from the user.

TIdleEvent has a Boolean parameter Done that is True by default. When Done is True, the Windows API WaitMessage function is called after OnIdle returns. WaitMessage yields control to other applications until a new message appears in the message queue of the application. When Done is False, the application does not yield control to other applications while it is not busy.

OnIdle is called only once, as the application transitions into an idle state. It is not called continuously unless Done is set to False. Applications that set Done to False consume an inordinate amount of CPU time, which affects overall system performance.

Note:	Call the CancelDispatch method from an OnIdle event handler to prevent the application from forwarding the event to any other application events objects.


TCustomApplicationEvents.OnMessage

TCustomApplicationEvents	See also

Occurs when the application receives a Windows message.

type TMessageEvent = procedure (var Msg: TMsg; var Handled: Boolean) of object;

property OnMessage: TMessageEvent;

Description

Use OnMessage to trap any or all Windows messages posted to all windows in the application. OnMessage occurs when an application receives a Windows message. OnMessage only receives messages that are posted to the message queue, not those sent directly with the Windows API SendMessage function.

An OnMessage event handler allows an application to respond to messages other than those declared in the events for TApplication. If the application doesn't have a specific handler for an incoming message, the message is dispatched to the window for which it was intended, and Windows handles the message.

The Msg parameter identifies the Windows message, and the Handled parameter indicates whether the event handler responded to the message. Set Handled to True if the message has been completely handled, to prevent subsequent processing of the message.

Caution:	Thousands of messages per second flow though this event. Be careful when coding the handler, because it can affect the performance of the entire application.

Note:	Call the CancelDispatch method from an OnMessage event handler to prevent the application from forwarding the event to any other application events objects.


TCustomApplicationEvents.OnMinimize

TCustomApplicationEvents	See also

Occurs when an application is minimized.

property OnMinimize: TNotifyEvent;

Description

Write an OnMinimize event handler to perform special processing when the application is minimized. The application is minimized, either because the user minimizes the main window, or because of a call to the Minimize method. The application’s Icon property determines the icon that represents the minimized application.

Note:	Call the CancelDispatch method from an OnMinimize event handler to prevent the application from forwarding the event to any other application events objects.


TCustomApplicationEvents.OnRestore

TCustomApplicationEvents	See also

Occurs when the previously minimized application is restored to its normal size.

property OnRestore: TNotifyEvent;

Description

Write an OnRestore event handler to perform special processing when the application is restored from the minimized state in which it appears as an icon. An application is restored either because the user restores the application, or because the application calls the Restore method.

Note:	Don't confuse restoring an application with restoring a form or window to its original size. To minimize, maximize, and restore a window or form, change the value of the WindowState property.

Note:	Call the CancelDispatch method from an OnRestore event handler to prevent the application from forwarding the event to any other application events objects.


TCustomApplicationEvents.OnShortCut

TCustomApplicationEvents	See also

Occurs when the user presses a key (before the OnKeyDown event).

property OnShortCut: TShortCutEvent;

Description

Use OnShortCut to dispatch shortcut keystrokes before the form or its controls handle them. When the user presses a key, the application can dispatch it as a shortcut key instead of allowing the standard keystroke processing (OnKeyDown, OnKeyPress, and OnKeyUp). Built-in shortcut processing is provided for menu shortcuts and actions associated with the form. OnShortCut lets the application implement additional shortcuts.

If the OnShortCut event handler responds to the keystroke, set its Handled parameter to True. This prevents the keystroke from being passed on to menus or actions associated with the application. It also prevents the standard keystroke processing in the same way that a menu or action shortcut does.

Note:	Call the CancelDispatch method from an OnShortCut event handler to prevent the application from forwarding the event to any other application events objects.


TCustomApplicationEvents.OnShowHint

TCustomApplicationEvents	See also

Occurs when the application is about to display the hint window for a Help Hint.

type TShowHintEvent = procedure (var HintStr: string; var CanShow: Boolean; var HintInfo: THintInfo) of object;

property OnShowHint: TShowHintEvent;

Description

Write an OnShowHint event handler to change the appearance and behavior of Help Hints.

The HintStr parameter sets the text of the Help Hint. To obtain the text of a hint for a particular control, call the GetLongHint or GetShortHint function, assigning the result to HintStr. To change the text, change the value of this string.

Use the CanShow parameter to permit or prevent the Help Hint from displaying. If CanShow is True, the Help Hint displays. If it is False, the Help Hint does not appear.

The HintInfo parameter is a record that contains information about the appearance and behavior of the Help window. Change its fields to customize the way the Help Hint is displayed.

Note:	Call the CancelDispatch method from an OnShowHint event handler to prevent the application from forwarding the event to any other application events objects.


TCustomApplicationEvents methods

TCustomApplicationEvents	Alphabetically

In TCustomApplicationEvents

Activate

CancelDispatch

Create

Derived from TComponent

Destroy

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomApplicationEvents methods

TCustomApplicationEvents	By object

Activate

AfterConstruction

Assign

BeforeDestruction

CancelDispatch

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException


TCustomApplicationEvents.Activate

TCustomApplicationEvents	See also

Ensures that this is the first component to receive any application events.

procedure Activate;

Description

Call Activate to move the TCustomApplicationEvents descendant to the front of the internal list of components that respond to the application’s events. There is no need to call Activate unless the project includes more than one TCustomApplicationEvents descendant.

Typically, each form that contains a TCustomApplicationEvents descendant calls that component’s Activate method from its OnActivate event handler. This has the effect of switching the first event handler to receive an event every time the user changes the active form.

Activate does not prevent other TCustomApplicationEvents descendants from receiving events, it merely places them in the queue behind the active TCustomApplicationEvents descendant. To prevent other components from receiving the events, use the CancelDispatch method.

Warning:	Do not call Activate from an event handler that is responding to an application-level event. Such a call will cause an exception to be raised.


TCustomApplicationEvents.CancelDispatch

TCustomApplicationEvents

Prevents other TCustomApplicationEvents objects from receiving the current event.

procedure CancelDispatch;

Description

Call CancelDispatch from one of the TCustomApplicationEvents descendant’s event handlers when it handles an event. CancelDispatch prevents other TCustomApplicationEvents descendant’s from receiving the event after the current event handler exits.

CancelDispatch has no effect unless it is called from one of the component’s event handlers.


TCustomApplicationEvents.Create

TCustomApplicationEvents	See also

Creates a new TCustomApplicationEvents object.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate TCustomApplicationEvents at runtime. Components added to forms at design time are created automatically.

Create adds the component to the internal list of components that respond to the application’s events. Once the component is created, it responds to any of the application events unless another TCustomApplicationEvents component prevents it by calling CancelDispatch.


Scope

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent


TCustomCheckBox

Hierarchy	Properties	Methods	See also

TCustomCheckBox is the ancestor of all check-box components.

Unit

stdctrls

Description

TCustomCheckBox is an abstract class from which check-box components, including TCheckBox and TDBCheckBox, descend. Check boxes present the user with options that can be selected (checked) or deselected (unchecked).


TCustomCheckBox properties

TCustomCheckBox	Alphabetically	Legend

In TCustomCheckBox

Alignment

AllowGrayed

Checked

State

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomCheckBox properties

TCustomCheckBox	By object	Legend

Action

Align

Alignment

AllowGrayed

Anchors

BiDiMode

BoundsRect

Brush

Checked

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentWindow

ShowHint

Showing

State

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TCustomCheckBox.Alignment

TCustomCheckBox

Controls the position of the check box’s caption.

type TLeftRight = taLeftJustify..taRightJustify;

property Alignment: TLeftRight;

Description

If Alignment is set to taRightJustify, the caption appears to the right of the check box. If Alignment is set to taLeftJustify, the caption appears to the left of the check box.


TCustomCheckBox.AllowGrayed

TCustomCheckBox	See also 	Example

Determines whether check box can be in a “grayed” state.

property AllowGrayed: Boolean;

Description

If AllowGrayed is set to True, the check box has three possible states: checked, unchecked, and grayed. If AllowGrayed is set to False, the check box has only two possible states: checked and unchecked.


TCustomCheckBox.Checked

TCustomCheckBox	See also	Example

Specifies whether the check box appears checked.

property Checked: Boolean;

Description

Use Checked to determine whether the check box is checked or unchecked. Checked is True when the check box has a checked state, False if it is unchecked or grayed.


TCustomCheckBox.State

TCustomCheckBox	See also 	Example

Indicates whether the check box is selected, deselected, or grayed.

type TCheckBoxState = (cbUnchecked, cbChecked, cbGrayed);

property State: TCheckBoxState;

Description

Following are the possible values of State:

Value	Meaning

cbUnchecked	The check box has no check mark, indicating that the user has not selected the option.

cbChecked	The check box has a check mark in it, indicating that the user has selected the option.

cbGrayed	The check box has a check mark in it, but it is grayed.


TCustomCheckBox methods

TCustomCheckBox	Alphabetically	Legend

In TCustomCheckBox

Click

Create

CreateParams

CreateWnd

GetChecked

GetControlsAlignment

SetChecked

Toggle

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomCheckBox methods

TCustomCheckBox	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Click

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParams

CreateParented

CreateParentedControl

CreateWnd

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetChecked

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetChecked

SetFocus

SetTextBuf

Show

Toggle

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TCustomCheckBox.Click

TCustomCheckBox 	See also

Click generates an OnClick event.

procedure Click; override;

Description

The protected Click method is called automatically when the check box is clicked with the mouse. In addition to generating an OnClick event, it sends a message to the parent control’s window to indicate that the state of the check box has changed.


TCustomCheckBox.Create

TCustomCheckBox

Creates and initializes a TCustomCheckBox instance.

constructor Create(AOwner: TComponent); override;

Description

Call Create to generate a check box at runtime. For check boxes placed on forms at design time, Create is called automatically.


TCustomCheckBox.CreateParams

TCustomCheckBox	See also

Initializes a window-creation parameter record.

procedure CreateParams(var Params: TCreateParams); override;

Description

CreateParams calls the inherited constructor, then makes specific adjustments for check boxes.


TCustomCheckBox.CreateWnd

TCustomCheckBox	See also

Creates a Windows control corresponding to the check box.

procedure CreateWnd; override;

Description

CreateWnd calls the inherited method, then sends a BM_SETCHECK message to set the check state of the control.


TCustomCheckBox.GetChecked

TCustomCheckBox	See also

Returns the value of the Checked property.

function GetChecked: Boolean; override;

Description

GetChecked is the protected implementation of the Checked property. Override this method and the SetChecked method to change the Checked property in descendant classes.


TCustomCheckBox.GetControlsAlignment

TCustomCheckBox	See also

Returns the alignment of the check box caption.

function GetControlsAlignment: TAlignment; override;

Description

GetControlsAlignment indicates the alignment of the check box caption. Usually, the caption is right-justified, but if the UseRightToLeftAlignment method returns True and the check mark is on the left, then GetControlsAlignment indicates that the caption should be left-justified.


TCustomCheckBox.SetChecked

TCustomCheckBox	See also

Sets the value of the Checked property.

function SetChecked: Boolean; override;

Description

SetChecked is the protected implementation of the Checked property. Override this method and the GetChecked method to change the Checked property in descendant classes.


TCustomCheckBox.Toggle

TCustomCheckBox	See also

Changes the state of the check box.

procedure Toggle; virtual;

Description

Use the Toggle method to select or deselect the check box programmatically. Toggle switches among the valid check-box states—from checked to unchecked to grayed, or from checked to unchecked.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TButtonControl


TCustomComboBox

Hierarchy	Properties	Methods	Events	See also

TCustomComboBox is the base class for combo-box components.

Unit

stdctrls

Description

Use TCustomComboBox as a base class when defining a control that represents a specialized Windows combo box. A combo box is an edit box with a scrollable list attached to it; users can select an item from the list or type directly into the edit box.

Do not create instances of TCustomComboBox. To put a combo box in a form, use a descendant of TCustomComboBox, such as TComboBox.


TCustomComboBox properties

TCustomComboBox	Alphabetically	Legend

In TCustomComboBox

Canvas

CharCase

DropDownCount

DroppedDown

EditHandle

ItemHeight

ItemIndex

Items

ListHandle

MaxLength

SelLength

SelStart

SelText

Sorted

Style

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

AnchorsTControl_Anchors>Main

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomComboBox properties

TCustomComboBox	By object	Legend

Action

Align

AnchorsTControl_Anchors>Main

BiDiModeTControl_BiDiMode>Main

BoundsRect

Brush

Canvas

CharCase

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DropDownCount

DroppedDown

EditHandle

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

ItemHeight

ItemIndex

Items

Left

ListHandle

LRDockWidth

MaxLength

Name

Owner

Parent

ParentColor

ParentWindow

SelLength

SelStart

SelText

ShowHint

Showing

Sorted

Style

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TCustomComboBox.Canvas

TCustomComboBox	See also

Provides access to the drawing surface for owner-draw combo boxes.

property Canvas: TCanvas;

Description

Use Canvas as the drawing surface when implementing a handler for the OnDrawItem event.


TCustomComboBox.CharCase

TCustomComboBox	See also

Determines the case of the text in the combo box.

type TEditCharCase = (ecNormal, ecUpperCase, ecLowerCase);

property CharCase: TEditCharCase;

Description

Use CharCase to force the contents of the combo box into upper or lower case. The possible values of CharCase are

Value	Meaning

ecLowerCase	The text is converted to lowercase.

ecNormal	The text appears in mixed case; it is not forced into any case. This is the default setting.

ecUpperCase	The text is converted to uppercase.

When CharCase is set to ecLowerCase or ecUpperCase, the case of characters is converted as the user types into the combo box. Changing the CharCase property changes the actual text, not just its appearance; case information is lost and cannot be recaptured by changing CharCase back to ecNormal.


TCustomComboBox.DropDownCount

TCustomComboBox	See also

Specifies the maximum number of items displayed in the drop-down list.

property DropDownCount: Integer;

Description

By default, the drop-down list is long enough to contain eight items without requiring the user to scroll to see them all. To make the drop-down list smaller or larger, specify a number larger or smaller than eight as the DropDownCount value.

If the DropDownCount value is larger than the number of items in the Items property, the drop-down list will be just large enough to hold all the possible choices and no more. If the DropDownCount value is smaller then the number of item in the Items property, the drop down list will display a scroll bar.

DropDownCount is meaningful only if Style is not csSimple.


TCustomComboBox.DroppedDown

TCustomComboBox	See also

Indicates whether the drop-down list is currently displayed.

property DroppedDown: Boolean;

Description

Read DroppedDown to determine whether the drop-down list is visible. Set DropDown to drop the list down or close it up. DroppedDown is True when the drop-down list is open, and False when it is closed.

Note:	DroppedDown is meaningful only if the value of Style is not csSimple.


TCustomComboBox.EditHandle

TCustomComboBox	See also

Provides access to the window handle for the edit portion of the combo box.

property EditHandle: HWnd;

Description

Read EditHandle for Windows API calls that need a handle for the window used by the edit portion of the combo box.


TCustomComboBox.ItemHeight

TCustomComboBox	See also

Specifies the height, in pixels, of the items in the drop-down list.

property ItemHeight: Integer;

Description

Use ItemHeight to specify the height needed to draw the items in the list when Style is set to csOwnerDrawFixed. If Style is csOwnerDrawVariable, ItemHeight is the default height for drawing list items. When Style is csOwnerDrawVariable, ItemHeight can be overridden by an OnMeasureItem event handler. If Style is set to any other value, the ItemHeight property is inoperative.


TCustomComboBox.ItemIndex
TCustomComboBox.

TCustomComboBox	See also	Example

Indicates which item in the drop-down list is selected.

property ItemIndex: Integer;

Description

Read ItemIndex to determine which item in the list is the value of the combo box. This value appears in the edit box portion of the combo box. The first item in the list has index 0, the second item has index 1, and so on. If no item is selected, the value of ItemIndex is -1.

Set ItemIndex to programmatically select an item from the list.


TCustomComboBox.Items

TCustomComboBox	See also 	Example

Provides access to the list of items (strings) in the list portion of the combo box.

property Items: TStrings;

Description

Use Items to access the list of items that appears in the combo box.


TCustomComboBox.ListHandle

TCustomComboBox	See also

Provides access to the window handle for the list portion of the combo box.

property ListHandle: HWnd;

Description

Read ListHandle for Windows API calls that need a handle for the window used by the list portion of the combo box.


TCustomComboBox.MaxLength

TCustomComboBox	See also

Specifies the maximum number of characters the user can type into the edit portion of the combo box.

property MaxLength: Integer;

Description

Use MaxLength to limit the length of strings the user can type into the combo box. MaxLength does not affect the length of strings available in the list. If MaxLength is 0, there is no limit to the number of characters that can be entered.


TCustomComboBox.SelLength

TCustomComboBox	See also	Example

Specifies the length, in characters, of the selected text in the edit portion of the combo box.

property SelLength: Integer;

Description

The selected portion of the text in the edit region of the combo box is the string of SelLength characters that starts at the character specified by the SelStart property. The selected text appears highlighted in the edit region of the combo box.

To select a section of text in the edit region, first set the SelStart property to position the cursor, and then set SelLength to the number of characters that should be selected. The SelText property is the substring that is selected.


TCustomComboBox.SelStart

TCustomComboBox	See also	Example

Specifies the position of the first selected character in the edit box.

property SelStart: Integer;

Description

Read SelStart to determine where the selection starts in the Text property. The first character is designated with 0, the second with 1, and so on. When SelLength is 0, SelStart is the position of the cursor.

Set SelStart to position the cursor in the edit region of the combo box. Setting SelStart to 0 positions the cursor before the first character, setting SelStart to 1 positions the cursor before the second character, and so on.

Note:	Setting SelStart changes the SelLength property to 0. When using SelStart and SelLength to programmatically select a portion of the text in the edit region, set SelStart before setting SelLength.


TCustomComboBox.SelText

TCustomComboBox	See also

Represents the selected text in the edit region.

property SelText: string;

Description

Read SelText to obtain the text that is selected in the edit region of the combo box. When the combo box is the active control, SelText appears highlighted. Set SelText to replace the current selection with a different substring. If no text is selected when a value is assigned to SelText, the SelText string is inserted in the text at the cursor.


TCustomComboBox.Sorted

TCustomComboBox	See also 	Example

Determines whether the list portion of the combo box is alphabetized.

property Sorted: Boolean;

Description

Set Sorted to True to sort the items in the Items list alphabetically. New items added to the list while Sorted is True are inserted in the correct alphabetical position.

When Sorted is changed from False to True, the original order of the items is lost. Setting Sorted back to False does not restore the original order.


TCustomComboBox.Style

TCustomComboBox	See also

Determines the display style of the combo box.

property Style: TComboBoxStyle;

Description

Set Style to specify how the list and edit region of the combo box should appear. The TComboBoxStyle type consists of the constants csDropDown, csSimple, csDropDownList, csOwnerDrawFixed, and csOwnerDrawVariable.

When Style is csOwnerDrawFixed or csOwnerDrawVariable, the OnDrawItem event occurs when the list items need to be drawn. If Style is csOwnerDrawVariable, an OnMeasureItem event occurs as well.


TCustomComboBox events

TCustomComboBox	Alphabetically	Legend

In TCustomComboBox

OnChange

OnDrawItem

OnDropDown

OnMeasureItem


TCustomComboBox events

TCustomComboBox	By object	Legend

OnChange

OnDrawItem

OnDropDown

OnMeasureItem


TCustomComboBox.OnChange

TCustomComboBox	See also 	Example

Occurs when the user changes the text displayed in the edit region.

property OnChange: TNotifyEvent;

Description

Write an OnChange event handler to take specific action immediately after the user edits the text in the edit region or selects an item from the list. The Text property gives the new value in the edit region.

Note: OnChange only occurs in response to user actions. Changing the Text property programmatically does not trigger an OnChange event.


TCustomComboBox.OnDrawItem

TCustomComboBox	See also

Occurs when an item in an owner-draw combo box needs to be displayed.

property OnDrawItem: TDrawItemEvent;

Description

Write an OnDrawItem event handler to draw the items in the drop-down list of an owner-draw combo box. An OnDrawItem event handler can add graphic elements to the list items, or replace the list item text by graphics.

Draw the items on the Canvas using the coordinates provided by the Rect parameter. OnDrawItem occurs only if Style is set to csOwnerDrawFixed or csOwnerDrawVariable.

If an OnDrawItem event handler is not provided, the combo box fills the Rect parameter with the current brush and writes the text value of the item specified by the Index parameter.


TCustomComboBox.OnDropDown

TCustomComboBox	See also 	Example

Occurs when the user opens the drop-down list by clicking the arrow at the right of the control.

property OnDropDown: TNotifyEvent;

Description

Write an OnDropDown event handler to implement special processing that needs to occur only when the drop-down list is activated.


TCustomComboBox.OnMeasureItem

TCustomComboBox 	See also

Occurs when an item in a csOwnerDrawVariable combo box needs to be redisplayed.

type TMeasureItemEvent = procedure(Control: TWinControl; Index: Integer; var Height: Integer) of object;

property OnMeasureItem: TMeasureItemEvent;

Description

When Style is set to csOwnerDrawVariable, the OnMeasureItem event precedes OnDrawItem. Write an OnMeasureItem event handler to specify the height, in pixels, needed to draw an item in the drop-down list.

OnMeasureItem passes three parameters to its event handler:

Control	A reference to the combo box containing the item.

Index	The index of the item in the Items property.

Height	The default height of the item, in pixels.

The event handler can reset the final parameter, Height, to the appropriate value.


TCustomComboBox methods

TCustomComboBox	Alphabetically	Legend

In TCustomComboBox

Change

Clear

ComboWndProc

Create

CreateParams

CreateWnd

Destroy

DestroyWnd

DrawItem

DropDown

Focused

GetComboControl

MeasureItem

SelectAll

SetStyle

WndProc

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomComboBox methods

TCustomComboBox	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

Change

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ComboWndProc

ContainsControl

ControlAtPos

Create

CreateParams

CreateParented

CreateParentedControl

CreateWnd

DefaultHandler

Destroy

DestroyComponents

Destroying

DestroyWnd

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawItem

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

DropDown

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetComboControl

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MeasureItem

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetStyle

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

WndProc


TCustomComboBox.Change

TCustomComboBox	See also

Generates an OnChange event.

procedure Change; dynamic;

Description

Change is the protected implementation method for the OnChange event. Override this method to add additional processing when the text changes, or to block the OnChange event.

When overriding Change, call the inherited Change or Changed method.


TCustomComboBox.Clear

TCustomComboBox	See also

Deletes all text from the edit box and all items from the Items list.

procedure Clear;

Description

Call Clear to empty the combo box at runtime.


TCustomComboBox.ComboWndProc

TCustomComboBox	See also

Provides message responses for the combo box.

procedure ComboWndProc(var Message: TMessage; ComboWnd: HWnd; ComboProc: Pointer); virtual;

Description

ComboWndProc is the first procedure to receive Windows messages that are sent to the window of the edit region or list portion of the combo box. The Message parameter describes the windows message. The ComboWnd parameter is the windows handle for the edit region or list. The ComboProc parameter is a pointer to the default window procedure for the window that received the message. ComboWndProc provides default responses to focus events, mouse events, and key strokes.

Override ComboWndProc to change the way the combo box responds to Windows messages. When overriding ComboWndProc, be sure to call the inherited method to process all unhandled messages.


TCustomComboBox.Create

TCustomComboBox	See also

Creates and initializes a TCustomComboBox instance.

constructor Create(AOwner: TComponent); override;

Description

Call Create to generate a combo box at runtime. Combo boxes placed on forms at design time are created automatically.

After calling the inherited constructor, Create initializes the following properties:

ControlStyle to [csCaptureMouse, csSetCaption, csDoubleClicks, csFixedHeight, csReflector].

DropDownCount to 8 and ItemHeight to 16.

Height to 25 and Width to 145.

ParentColor to False.

Style to csDropDown.

TabStop to True.


TCustomComboBox.CreateParams

TCustomComboBox	See also

Initializes the window-creation parameter record.

procedure CreateParams(var Params: TCreateParams); override;

Description

The CreateWnd method calls CreateParams to initialize the parameters it uses to create the window for the combo box. CreateParams overrides the inherited method to implement the Style property.


TCustomComboBox.CreateWnd

TCustomComboBox	See also

Creates the Windows control that represents the combo box.

procedure CreateWnd; override;

Description

The Windows control for the combo box can be temporarily destroyed and recreated in order to set properties that require changing the window creation parameters. TCustomComboBox calls CreateWnd to create this Windows control when necessary.


TCustomComboBox.Destroy

TCustomComboBox	See also

Destroys the combo box and frees its memory.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Call Free instead. Free verifies that the combo box is not nil, and only then calls Destroy.


TCustomComboBox.DestroyWnd

TCustomComboBox	See also

Destroys the Windows control that represents the combo box.

procedure DestroyWnd; override;

Description

The Windows control for the combo box can be temporarily destroyed and recreated in order to set properties that require changing the window creation parameters. TCustomComboBox calls DestroyWnd to destroy this Windows control when necessary.

DestroyWnd saves the contents of Items list before calling the inherited DestroyWnd method. The saved list is used if the window is recreated.


TCustomComboBox.DrawItem

TCustomComboBox	See also

Generates an OnDrawItem event.

procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); virtual;

Description

When Style is csOwnerDrawFixed or csOwnerDrawVariable, DrawItem is called whenever an item in the list needs to be drawn. If an OnDrawItem event handler is assigned, DrawItem generates an OnDrawItem event, passing the Index, Rect, and State parameters to the event handler. Otherwise, OnDrawItem fills the rectangle passed in Rect and draws any text associated with the indexed item, ignoring the State parameter.

Override DrawItem to provide class-specific drawing code for the items in the list.


TCustomComboBox.DropDown

TCustomComboBox	See also

Generates an OnDropDown event.

procedure DropDown; dynamic;

Description

DropDown is the protected implementation method for the OnDropDown event. To perform additional processing or block the OnDropDown event, override DropDown.


TCustomComboBox.Focused

TCustomComboBox	See also

Indicates whether the combo box has input focus.

function Focused: Boolean; override;

Description

Call Focused to determine whether the combo box is currently the recipient of keyboard input. When Focused returns True, the combo box is the active control and keystroke messages are sent to it. When Focused is False, the combo box is not active (although it may be selected).


TCustomComboBox.GetComboControl

TCustomComboBox	See also

Returns the handle to the combo box window.

function GetComboControl: HWND; virtual;

Description

GetComboControl returns the combo box’s window handle. As implemented in TCustomComboBox, GetComboControl simply returns the value of the Handle property. Descendants can override this if another window is more appropriate.


TCustomComboBox.MeasureItem

TCustomComboBox	See also

Generates an OnMeasureItem event.

procedure MeasureItem(Index: Integer; var Height: Integer); virtual;

Description

MeasureItem is the protected implementation method for the OnMeasureItem event. Override MeasureItem to provide class-specific code to specify the size of list items when Style is csOwnerDrawVariable.


TCustomComboBox.SelectAll

TCustomComboBox	See also

Selects the entire block of text in the edit box.

procedure SelectAll;

Description

Use SelectAll to select all the text in the edit box. To select only part of the text, use the SelStart and SelLength properties.


TCustomComboBox.SetStyle

TCustomComboBox	See also

Sets the Style property.

type TComboBoxStyle = (csDropDown, csSimple, csDropDownList, csOwnerDrawFixed, csOwnerDrawVariable);

procedure SetStyle(Value: TComboBoxStyle); virtual;

Description

SetStyle is the protected implementation method for the Style property. Override SetStyle to change the implementation of the Style property.


TCustomComboBox.WndProc

TCustomComboBox	See also

Processes messages received by the combo box.

procedure WndProc(var Message: TMessage); override;

Description

WndProc is the first method to received Windows messages that are sent to the combo box. Messages sent to the child windows of the combo box (for the edit region and the list portion) go to the ComboWndProc method instead. WndProc handles messages about changes to the system colors defined in the Windows control panel, and closes up the drop-down list when the Enter key or the Escape key is pressed. All other messages are passed to Dispatch for default processing.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


 TCustomConnection

Hierarchy	Properties	Methods	Events	See also

TCustomConnection is the base class for components that connect datasets to their source of data.

Unit

db

Description

Use TCustomConnection as a base class for components that represent the source of the data contained in a dataset. This source can be a remote database server, the middle tier of a multi-tiered database application, an interface such as the one used by ActiveX Data Objects (ADO), or any other driver that provides the information represented in a dataset. TCustomConnection introduces:

Methods for connecting to and disconnecting from the source of data.

Login support for providing a user name and password when establishing a connection.

Properties for keeping track of the datasets that use the connection component.

Do not create instances of TCustomConnection. To add a component that represents the connection to a source of data, use a TCustomConnection descendant such as TDatabase, TADOConnection, or one of the MIDAS connection components such as TDCOMConnection.


TCustomConnection properties

TCustomConnection	Alphabetically	Legend

In TCustomConnection

Connected

DataSetCount

DataSets

LoginPrompt

StreamedConnected

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomConnection properties

TCustomConnection	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Connected

DataSetCount

DataSets

DesignInfo

LoginPrompt

Name

Owner

StreamedConnected

Tag

VCLComObject


TCustomConnection.Connected

TCustomConnection	See also	Example

Determines whether a connection has been established to the source of data.

property Connected: Boolean;

Description

Set Connected to True to open the connection. Set Connected to False to terminate the connection. Setting Connected to True generates a BeforeConnect event, calls the protected DoConnect method to establish the connection, and generates an AfterConnect event. In addition, when setting Connected to True, TCustomConnection may display a login dialog, depending on the value of LoginPrompt. Setting Connected to False generates a BeforeDisconnect event, calls the protected DoConnect method to drop the connection, and generates an AfterDisconnect event.

When deriving custom connection components from TCustomConnection, override GetConnected to return True when a connection is established, and override DoConnect and DoDisconnect to create and drop the connection.


TCustomConnection.DataSetCount

TCustomConnection	See also	Example

Indicates the number of active datasets associated with the connection component.

property DataSetCount: Integer;

Description

Use DataSetCount to determine the number of datasets listed by the DataSets property. Depending on the TCustomConnection descendant, DataSets may include only the active datasets that use the connection component (as is the case with TDatabase and TADOConnection), or it may list all datasets, regardless of whether they are active (as is the case with MIDAS connection components). If DataSets includes only active datasets, the value of DataSetCount changes when datasets are opened and closed.

Use DataSetCount as an upper bound when iterating through the DataSets property.


TCustomConnection.DataSets

TCustomConnection	See also 	Example

Lists the datasets currently using this connection component.

property DataSets[Index: Integer]: TDataSet;

Description

Use DataSets to access the datasets that are currently using the connection component. Depending on the TCustomConnection descendant, DataSets may include only the active datasets that use the connection component (as is the case with TDatabase and TADOConnection), or it may list all datasets, regardless of whether they are active (as is the case with MIDAS connection components). If DataSets includes only active datasets, its value changes when datasets are opened and closed.


TCustomConnection.LoginPrompt

TCustomConnection	See also

Specifies whether a login dialog appears immediately before opening a new connection.

property LoginPrompt: Boolean;

Description

Set LoginPrompt to True to provide login support when establishing a connection. When LoginPrompt is True, a dialog appears to prompt users for a name and password. When this dialog appears depends on the type of connection component:

 For TDatabase and TADOConnection, the dialog appears after the BeforeConnect event and before the AfterConnect event, unless you supply an OnLogin event handler. If there is an OnLogin event handler, that event occurs in place of the login dialog. If correct values for the user name and password are not supplied in the dialog or by the OnLogin event handler, the connection fails. This OnLogin event does not fire unless LoginPrompt is set to True.

 For MIDAS connection components, the dialog appears after the OnGetUserName event and before the BeforeConnect, AfterConnect, and OnLogin events. If the user cancels from the login dialog, no attempt is made to open a connection.

When LoginPrompt is False, the application must supply user name and password values programmatically:

For TDatabase, the user name and password can be supplied as USER NAME and PASSWORD parameters in the Params property.

For TADOConnection, the user name and password can be supplied as the ConnectionString property.

For MIDAS connection components, there is no built-in use for the user name and password supplied by the login dialog. (The UserName and Password properties of TWebConnection are unrelated).

Warning:	Storing hard-coded user name and password entries as property values or in code for an OnLogin event handler can compromise server security.


TCustomConnection.StreamedConnected

TCustomConnection	See also

Indicates whether the Connected property was True when the connection component was loaded from a stream.

property StreamedConnected: Boolean;

Description

StreamedConnected is used internally to ensure that the connection component does not open a connection until all objects on the form or data module are loaded into memory. This property is set instead of the Connected property when loading the connection component. In the Loaded method, after all objects in the form or data module have been loaded into memory, the value of StreamedConnected is used to set the Connected property.


TCustomConnection events

TCustomConnection	Alphabetically

In TCustomConnection

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnLogin


TCustomConnection events

TCustomConnection	By object

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnLogin


TCustomConnection.AfterConnect

TCustomConnection	See also

Occurs after a connection is established.

property AfterConnect: TNotifyEvent;

Description

Write an AfterConnect event handler to take application-specific actions immediately after the connection component opens a connection to the source of database information.


TCustomConnection.AfterDisconnect

TCustomConnection	See also

Occurs after the connection closes.

property AfterDisconnect: TNotifyEvent;

Description

Write an AfterDisconnect event handler to take application-specific actions after the connection component drops a connection.


TCustomConnection.BeforeConnect

TCustomConnection	See also

Occurs immediately before establishing a connection.

property BeforeConnect: TNotifyEvent;

Description

Write a BeforeConnect event handler to take application-specific actions before the connection component opens a connection to the source of database information.


TCustomConnection.BeforeDisconnect

TCustomConnection	See also	Example

Occurs immediately before the connection closes.

property AfterDisconnect: TNotifyEvent;

Description

Write a BeforeDisconnect event handler to take application-specific actions before dropping a connection.


TCustomConnection.OnLogin

TCustomConnection	See also	Example

Depends on the type of TCustomConnection descendant.

type TLoginEvent = procedure(Sender:TObject; Username, Password: string) of object;

property OnLogin: TLoginEvent;

Description

OnLogin occurs when connections are opened if the LoginPrompt property is True. The following sequence of events occurs when opening a connection to an application server:

1. An OnGetUserName event occurs, where the application can supply an initial user name for the login dialog.

2. The login dialog appears, where the user can supply a user name and password.

3. A BeforeConnect event occurs, the connection is opened, and an AfterConnect event occurs.

4. The OnLogin event occurs, where you can write code to log in to the application server using the username and password that were provided in the remote login dialog.

Note:	Do not use the OnLogin event if the connection component provides a different scheme for logging in. For example, TWebConnection uses the Username and Password properties instead.

Note:	Connection components that do not connect to an application server in a multitiered database application replace the OnLogin event defined in TCustomConnection with a different event that occurs before a connection is established.


TCustomConnection methods

TCustomConnection	Alphabetically	Legend

In TCustomConnection

Close

Create

Destroy

DoConnect

DoDisconnect

GetConnected

GetDataSet

GetDataSetCount

Loaded

Open

RegisterClient

SendConnectEvent

SetConnected

UnRegisterClient

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomConnection methods

TCustomConnection	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DoConnect

DoDisconnect

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetConnected

GetDataSet

GetDataSetCount

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Loaded

MethodAddress

MethodName

NewInstance

Open

RegisterClient

RemoveComponent

SafeCallException

SendConnectEvent

SetConnected

UnRegisterClient

UpdateAction


TCustomConnection.Close

TCustomConnection	See also

Closes the connection.

procedure Close;

Description

Call Close to disconnect from the source of database information. Before the connection component is deactivated, all associated datasets are closed. Calling Close is the same as setting the Connected property to False.

In most cases, closing a connection frees system resources allocated to the connection.

Note:	If a previously active connection is closed and then reopened, any associated datasets must be individually reopened; reopening the connection does not automatically reopen associated datasets.


TCustomConnection.Create

TCustomConnection	See also

Creates an instance of TCustomConnection.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a connection component at runtime. Connection components added to forms or data modules at design time are created automatically.

The Owner parameter specifies another component (usually a form or data module) that is responsible for freeing the connection component.


TCustomConnection.Destroy

TCustomConnection	See also

Destroys the instance of a connection component.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free, which verifies that the reference to the connection component is not nil before calling Destroy

Destroy closes all active datasets and closes its connection before freeing all internal resources.


TCustomConnection.DoConnect

TCustomConnection	See also

Provides the interface for a method that opens a connection.

procedure DoConnect; virtual;

Description

The Connected property uses DoConnect to establish a connection. Descendant classes override the DoConnect method to establish their connection as appropriate. As implemented in TCustomConnection, DoConnect does nothing.


TCustomConnection.DoDisconnect

TCustomConnection	See also

Provides the interface for a method that terminates the connection.

procedure DoDisonnect; virtual;

Description

The Connected property uses DoDisconnect to close a connection. Descendant classes override the DoDisconnect method to drop a connection. As implemented in TCustomConnection, DoDisconnect does nothing.


TCustomConnection.GetConnected

TCustomConnection	See also

Returns the value of the Connected property.

function GetConnected: Boolean; virtual;

Description

GetConnected is the protected read implementation of the Connected property. Descendant classes override this method to return True if a connection is open and False otherwise. As defined in TCustomConnection, GetConnected always returns False.


TCustomConnection.GetDataSet

TCustomConnection	See also

Returns a dataset, given its index in the DataSets property array.

function GetDataSet(Index:Integer): TDataSet; virtual;

Description

GetDataSet is the protected read implementation of the DataSets property.


TCustomConnection.GetDataSetCount

TCustomConnection	See also

Returns the value of the DataSetCount property.

function GetDataSetCount: Integer; virtual;

Description

GetDataSetCount is the protected read implementation of the DataSetCount property.


TCustomConnection.Loaded

TCustomConnection	See also

Initializes the connection component after all objects in the form or data module have been loaded.

procedure Loaded; override;

Description

Do not call the protected Loaded method. It is called automatically after the form or data module that contains the connection component has loaded all its owned objects. TCustomConnection overrides the inherited method to establish a connection if the Connected property is True.


TCustomConnection.Open

TCustomConnection	See also

Opens the connection.

procedure Open;

Description

Call Open to establish a connection to the source of database information. Open sets the Connected property to True.


TCustomConnection.RegisterClient

TCustomConnection	See also

Registers an object that uses the connection component.

procedure RegisterClient(Client: TObject, Event:TConnectChangeEvent=nil); virtual;

Description

RegisterClient is used internally to associate objects with the connection component. Registered components can supply an event handler that responds when the connection is created or terminated.

Client is the object to register. If Client is a dataset, it is added to the DataSets property.

Event is an event handler that is called after the connection is established or before it is terminated.

Datasets call this method when they use the connection component to connect to the source of their data. For BDE-enabled datasets and ADO datasets, this is when they are activated. For Client datasets, this is when the RemoteServer property is assigned.


TCustomConnection.SendConnectEvent

TCustomConnection	See also

Informs all registered clients that use the connection component when a connection is opened or closed.

procedure SendConnectEvent(Connecting: Boolean);

Description

SendConnectEvent is used internally to ensure that registered clients are informed when their connection is opened or closed. It is called automatically when the Connected property changes.

SendConnectEvent iterates through all registered clients. For each client that supplied an event handler to the RegisterClient method, SendConnectEvent calls that event handler to inform the client that a connection has just been opened (when Connecting is True) or that the connection is about to close (when Connecting is False). If the client is a dataset, it is informed about the change even if it did not supply an event handler to RegisterClient.


TCustomConnection.SetConnected

TCustomConnection	See also

Changes the value of the Connected property.

procedure SetConnected(Value: Boolean); virtual;

Description

SetConnected is the protected write implementation of the Connected property. Most descendants of TCustomConnection do not override this method to change the implementation of Connected. Instead, they override the DoConnect and DoDisconnect methods to change the way the connection is opened and closed.


TCustomConnection.UnRegisterClient

TCustomConnection	See also

Removes a registered client so that it is no longer associated with the connection component.

procedure UnRegisterClient(Client: TObject); virtual;

Description

UnRegisterClient is used internally to remove objects from the internal list of objects that are informed when a connection is created or terminated.

Client is the object that is removed from the list. It should be an object that was previously registered by a call to RegisterClient. If Client is a dataset, it is removed from the DataSets property list.

Datasets call this method when they stop using the connection component to connect to the source of their data. For BDE-enabled datasets and ADO datasets, this is when they are deactivated. For Client datasets, this is when the RemoteServer property is changed.


Scope

Published

Protected

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent


TCustomControlBar

Hierarchy	Properties	Methods	Events	See also

TCustomControlBar is the base class for control bar components.

Unit

Extctrls

Description

Use TCustomControlBar as a base class when defining control bar components. Control bars are designed to manage the layout of toolbar controls, although they can contain other controls as well. They provide a convenient docking site in applications that have dockable toolbars.

Do not create instances of TCustomControlBar. To add a control bar to a form, use TControlBar instead.


TCustomControlBar properties

TCustomControlBar	Alphabetically	Legend

In TCustomControlBar

AutoDock

AutoDrag

Picture

RowSize

RowSnap

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DockSite

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

AutoSize

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomControlBar properties

TCustomControlBar	By object	Legend

Action

Align

Anchors

AutoDock

AutoDrag

AutoSize

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DockSite

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentWindow

Picture

RowSize

RowSnap

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TCustomControlBar.AutoDock

TCustomControlBar	See also

Determines whether the control bar temporarily docks drag clients to provide visual feedback.

property AutoDock: Boolean;

Description

If AutoDock is True (the default), when a dockable object is dragged over the control bar, the control bar temporarily docks the object so that the user can see the impact of the drag operation. That is, the user can see the dock position and how other docked controls will be repositioned to make room. When the user releases the mouse, the dragged object is docked at the current spot, and any temporary dockings are canceled. However, if the user cancels the drag-and-dock operation, the dragged object reverts to its last temporary dock site rather than to its location at the start of the drag operation.

If AutoDock is False, the control bar does not temporarily dock dragged objects. Instead, the user only sees the dragging rectangle as it passes over the control bar, with no feedback as to the adjustments the control bar would make if the dragged object were released.


TCustomControlBar.AutoDrag

TCustomControlBar	See also

Specifies whether control bands can be undocked by dragging.

property AutoDrag: Boolean;

Description

Use AutoDrag to specify whether control bands are automatically undocked when the user drags them. If AutoDrag is True, control bands (TToolBar objects) are undocked when dragged off the control bar. Otherwise, control bands are kept within the control bar.


TCustomControlBar.Picture

TCustomControlBar	See also

Specifies the control bar’s picture.

property Picture: TPicture;

Description

Use Picture to specify the control bar’s picture. The picture is tiled across the control bar.


TCustomControlBar.RowSize

TCustomControlBar	See also

Specifies the height of the control bar’s rows.

type TRowSize = 1..MaxInt;

property RowSize: TRowSize;

Description

Use RowSize to specify the height of the control bar’s rows.


TCustomControlBar.RowSnap

TCustomControlBar	See also

Specifies whether controls are snapped to the control bar’s rows when docked.

property RowSnap: Boolean;

Description

Use RowSnap to specify whether controls are snapped to the control bar’s rows when docked. Controls that are snapped have their Top and Height properties set automatically to correspond to the control bar’s rows.


TCustomControlBar events

TCustomControlBar	Alphabetically	Legend

In TCustomControlBar

OnBandDrag

OnBandInfo

OnBandMove

OnBandPaint

OnPaint


TCustomControlBar events

TCustomControlBar	By object	Legend

OnBandDrag

OnBandInfo

OnBandMove

OnBandPaint

OnPaint


TCustomControlBar.OnBandDrag

TCustomControlBar	See also

Occurs when the user starts a drag operation on a specified control.

type TBandDragEvent = procedure (Sender: TObject; Control: TControl; var Drag: Boolean) of object;

property OnBandDrag: TBandDragEvent;

Description

Use OnBandDrag to conditionally allow the user to start dragging the control specified by the Control parameter. Change the Drag parameter to False to prevent the drag operation. If Drag remains True on exit from the event handler, the drag operation proceeds.


TCustomControlBar.OnBandInfo

TCustomControlBar	See also

Occurs when the control bar adjusts the docking position of a band.

property OnBandInfo: TBandInfoEvent;

Description

Write code in the OnBandInfo event handler to provide information to the control bar that it can use when arranging its bands. The OnBandInfo event handler has several parameters that can be used to return information about how the band should be positioned, including its size, inset, and number of rows.


TCustomControlBar.OnBandMove

TCustomControlBar	See also

Occurs when a control band is moving.

property OnBandMove: TBandMoveEvent;

Description

Write an OnBandMove event handler to perform actions when a band is moving.

Use OnBandMove to specify the destination rectangle for the band. For example, adjust the destination rectangle so that its right edge matches the right edge of the control bar. This means the control extends to the control bar’s right edge no matter where it is moved.


TCustomControlBar.OnBandPaint

TCustomControlBar	See also

Occurs when a control band is painted.

property OnBandPaint: TBandPaintEvent;

Description

Write an OnBandPaint event handler to customize the way the control bar draws its bands. From the event handler, you can draw to the control bar’s canvas, using the dimensions of the band that are passed in as the ARect parameter. You can change the dimensions so that the automatically drawn frame and grabber appear in a different portion of the control bar (for example, indented slightly). You can suppress the automatic painting of the frame or grabber by removing options from the Options parameter.


TCustomControlBar.OnPaint

TCustomControlBar	See also

Occurs when the control bar is painted.

property OnPaint: TNotifyEvent;

Description

Write an OnPaint event handler to change the way the control bar is rendered. When a control bar receives a Windows paint message, it first draws the background picture, if any, and then generates an OnPaint event. After the OnPaint event exits, the control bar generates an OnBandPaint event for each band, finally rendering the grabbers and frames for each band.

Use the Canvas property to draw the control bar’s image. Use the ClientRect property to obtain the dimensions on which to draw.

If the custom drawing is intended to change the appearance of individual bands, use the OnBandPaint event instead.


TCustomControlBar methods

TCustomControlBar	Alphabetically	Legend

In TCustomControlBar

AlignControls

CanAutoSize

Create

CreateParams

Destroy

DoBandMove

DoBandPaint

DockOver

DoPaletteChange

DragControl

GetControlInfo

GetPalette

GetSiteInfo

HitTest

MouseDown

MouseMove

MouseUp

Paint

PaintControlFrame

StickControls

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

GetControlsAlignment

GetTextBuf

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomControlBar methods

TCustomControlBar	By object	Legend

AfterConstruction

AlignControls

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanAutoSize

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParams

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

DoBandMove

DoBandPaint

Dock

DockDrop

DockOver

DoPaletteChange

DragControl

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlInfo

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetPalette

GetParentComponent

GetSiteInfo

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

HitTest

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseDown

MouseMove

MouseUp

MouseWheelHandler

NewInstance

Paint

PaintControlFrame

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

StickControls

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TCustomControlBar.AlignControls

TCustomControlBar	See also

Aligns controls in the control bar.

procedure AlignControls(AControl: TControl; var ARect: TRect); override;

Description

AlignControls overrides the method introduced by TWinControl to enforce the alignment of child controls in a manner appropriate to a control bar. AlignControls determines the best alignment for each control according to its size and the available space.


TCustomControlBar.CanAutoSize

TCustomControlBar	See also

Specifies whether the control bar can size itself to accomodate its contents.

function CanAutoSize(var NewWidth, NewHeight: Integer): Boolean; override;

Description

CanAutoSize is called automatically when the AutoSize property is True and an attempt is made to resize the control. It allows controls to implement the AutoSize property before the resize sequence that begins with the OnCanResize and OnConstrainedResize events and ends with the OnResize event.

When CanAutoSize is called, the NewWidth and NewHeight parameters indicate the proposed new dimensions of the control bar. CanAutoSize adjusts these values so that the control bar’s bands are all visible. CanAutoSize returns True, indicating that the resize sequence should proceed.


TCustomControlBar.Create

TCustomControlBar	See also

Creates and initializes an instance of TCustomControlBar.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a control bar at runtime. Control bars added to forms at design time are created automatically.

Create performs the following tasks:

Calls the inherited constructor.

Sets ControlStyle to [csAcceptsControls, csCaptureMouse, csClickEvents, csDoubleClicks, csOpaque];

Sets Width, Height, and RowSize to 100, 50, and 26 respectively.

Sets AutoDrag, DockSite, DoubleBuffered, and RowSnap to True.

Uses the OnChange event to adjust to changes in the Picture property.

Sets BevelKind to bkTile.

Allocates memory for TCustomControlBar properties.


TCustomControlBar.CreateParams

TCustomControlBar	See also

Sets the control bar’s window flags.

procedure CreateParams(var Params: TCreateParams); override;

Description

CreateParams overrides the inherited method in order to turn off the CS_HREDRAW and CS_VREDRAW windows flags.


TCustomControlBar.Destroy

TCustomControlBar	See also

Destroys the TCustomControlBar instance.

destructor Destroy; override;

Description

Do not call Destroy. Instead, call Free.

Destroy frees the memory allocated for the TCustomControlBar properties.


TCustomControlBar.DoBandMove

TCustomControlBar	See also

Generates an OnBandMove event.

procedure DoBandMove(Control: TControl; var ARect: TRect); virtual;

Description

Do not call DoBandMove. It is called automatically when a band is moved in the control bar.

Control is the band that is about to be moved.

ARect is the area to which the control is about to be moved. This value can be changed by the OnBandMove event handler.

Override DoBandMove to perform actions in addition to calling the OnBandMove event handler when a band is moved.


TCustomControlBar.DoBandPaint

TCustomControlBar	See also

Generates an OnBandPaint event.

procedure DoBandPaint(Control: TControl; Canvas: TCanvas; var ARect: TRect; var Options: TBandPaintOptions); virtual;

Description

Do not call DoBandPaint. It is called automatically for each band when the control bar is painted. Override DoBandPaint to provide class-specific paint code for the bands or to suppress the OnBandPaint event.

Control is the control (usually a tool bar) whose band is about to be painted.

Canvas is the control bar’s canvas. This is the canvas to use for drawing the band.

ARect is the dimensions of the band on the canvas. The OnBandPaint event handler can change this value to alter where the frame and grabber are drawn.

Options specifies which parts of the band should be drawn after DoBandPaint exits.


TCustomControlBar.DockOver

TCustomControlBar	See also

Generates an OnDockOver event and ensures proper docking of floating controls.

procedure DockOver(Source: TDragDockObject; X, Y: Integer; State: TDragState; var Accept: Boolean); override;

Description

DockOver overrides the inherited method to ensure proper docking of floating controls that are accepted by the OnDockOver event handler.


TCustomControlBar.DoPaletteChange

TCustomControlBar	See also

Prepares the control bar to realize a new palette.

function DoPaletteChange: Boolean;

Description

Call DoPaletteChange to prepare the control bar to realize a new palette. DoPaletteChange returns True if the control bar should be redrawn to reflect the new palette, and False otherwise.

DoPaletteChange is called when the Picture property changes.


TCustomControlBar.DragControl

TCustomControlBar	See also

Starts a drag operation on a control band.

function DragControl(AControl: TControl; X, Y: Integer; KeepCapture: Boolean = False): Boolean; virtual;

Description

Call DragControl to start a drag operation on a control band.

If AutoDrag is True, DragControl is called automatically when a control is undocked from the control bar.

AControl is the control on the band that should be dragged.

X and Y are the current positions of the mouse pointer.

KeepCapture indicates whether the control bar should capture the mouse when processing the drag.


TCustomControlBar.GetControlInfo

TCustomControlBar	See also

Generates an OnBandInfo event.

procedure GetControlInfo(AControl: TControl; var Insets: TRect; var PreferredSize, RowCount: Integer); virtual;

Description

GetControlInfo is called automatically when the control bar needs to arrange the position of its bands. It generates an OnBandInfo event to obtain information about a control band.

AControl is the control associated with the band being positioned.

Insets returns the margin between the edges of the control and the edges of its band.

PreferredSize returns the control’s preferred width. (The control’s width is reduced if it can’t fit inside the control bar.)

RowCount returns the number of control rows that the control spans in the control bar.


TCustomControlBar.GetPalette

TCustomControlBar	See also

Returns the control bar’s palette.

function GetPalette: HPALETTE; override;

Description

GetPalette returns the palette used for the control bar’s picture (Picture property). It is called when the control bar needs to realize its palette.


TCustomControlBar.GetSiteInfo

TCustomControlBar	See also

Returns the control bar’s dock site information.

procedure GetSiteInfo(Client: TControl; var InfluenceRect: TRect; MousePos: TPoint; var CanDock: Boolean); override;

Description

GetSiteInfo generates an OnGetSiteInfo event to allow an application to influence how controls are docked to the control bar. On return from the event handler, GetSiteInfo sets the CanDock parameter to False if the control is not floating. This prevents controls that have been docked to other dock sites from being moved to the control bar.

Client is the control that is a potential dock client.

InfluenceRect returns the dimensions where the client will be docked.

MousePos is the position of the mouse pointer.

CanDock returns whether the client is permitted to dock in the control bar.


TCustomControlBar.HitTest

TCustomControlBar	See also

Returns the control at the specified coordinates.

function HitTest(X, Y: Integer): TControl;

Description

Call HitTest to get the control at the specified coordinates.

X and Y are the coordinates.


TCustomControlBar.MouseDown

TCustomControlBar	See also

Handles mouse button clicks.

procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;

Description

MouseDown is called automatically when the user clicks the control bar with the mouse. After generating an OnMouseDown event, MouseDown determines whether a band is being dragged and if so, computes its position.

Button indicates which button was clicked.

Shift indicates the state of the Alt, Ctrl, and Shift keys and the state of the mouse buttons.

X and Y are the position where the mouse was clicked.


TCustomControlBar.MouseMove

TCustomControlBar	See also

Handles mouse movements.

procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;

Description

MouseMove generates an OnMouseMove event and then performs special processing if a control being undocked from the control bar or moved within the control bar.

Shift indicates the state of the Alt, Ctrl, and Shift keys and the state of the mouse buttons.

X and Y are the current position of the mouse.


TCustomControlBar.MouseUp

TCustomControlBar	See also

Handles releasing of a mouse button.

procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;

Description

MouseUp handles the dropping of a control onto the control bar and, once the control (if any) is docked, generates an OnMouseUp event.

Button indicates which button was released.

Shift indicates the state of the Alt, Ctrl, and Shift keys and the state of the mouse buttons.

X and Y are the position where the mouse was released.


TCustomControlBar.Paint

TCustomControlBar	See also

Paints the control bar.

procedure Paint; override;

Description

Paint is called automatically when the control bar needs to paint itself.

To customize the painting, either override the Paint method, or specify options in the OnPaint and OnBandPaint event handlers.


TCustomControlBar.PaintControlFrame

TCustomControlBar	See also

Paints a control band’s frame.

procedure PaintControlFrame(Canvas: TCanvas; AControl: TControl; var ARect: TRect); virtual;

Description

The Paint method calls PaintControlFrame for each band to render its image. PaintControlFrame generates an OnBandPaint event, and then draws the frame and grabber for the band, depending on the values returned by the event handler.

Canvas is the control bar’s canvas.

AControl is the control on the band to be painted.

ARect indicates the dimensions of the band.


TCustomControlBar.StickControls

TCustomControlBar	See also

Places controls in their final positions after a control is moved in or dropped on the control bar.

procedure StickControls; virtual;

Description

Override StickControls to specify how controls are set in their final positions after a control is moved in or dropped on the control bar.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TCustomControl

Hierarchy	Properties	Methods	See also

TCustomControl is the base class for windowed controls that need a Canvas for drawing complex visual images.

Unit

controls

Description

Standard windowed controls already “know” how to display themselves, because they are part of Windows. Thus, a button or a check box component descends directly from TWinControl. When creating original windowed controls that do not correspond to standard Windows components derive them from TCustomControl, rather than directly from TWinControl. TCustomControl makes drawing original controls easier by providing a Canvas property to manage the drawing surface and a virtual Paint method that is called to respond to WM_PAINT messages.

When creating custom controls that don’t need to receive input focus, derive them from TGraphicControl instead of TCustomControl, to avoid the overhead associated with being a windowed control. Painting a windowed control is slower than painting a graphic control.


TCustomControl properties

TCustomControl	Alphabetically	Legend

In TCustomControl

Canvas

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomControl properties

TCustomControl	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentWindow

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TCustomControl.Canvas

TCustomControl	See also 	Example

Specifies the TCanvas object that presents a drawing surface for the control.

property Canvas: TCanvas;

Description

Use the properties of the TCanvas object to draw or paint on the surface of the control. Canvas encapsulates a Windows device context, providing all the tools and methods needed for drawing and painting.

Canvas is a protected property that is usually redeclared as public in descendants of TCustomControl.


TCustomControl methods

TCustomControl	Alphabetically	Legend

In TCustomControl

Create

Destroy

Paint

PaintWindow

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomControl methods

TCustomControl	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

Paint

PaintTo

PaintWindow

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TCustomControl.Create

TCustomControl	See also

Creates an instance of TCustomControl.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a custom control at runtime. Controls placed on forms at design time are created automatically.

Create creates the canvas for the custom control after calling the inherited constructor.

Nearly every kind of control overrides Create to initialize its unique properties. When overriding the Create method, always call the inherited Create method first, then proceed with the component's initialization.


TCustomControl.Destroy

TCustomControl	See also

Destroys an instance of TCustomControl.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the reference is not nil, and only then calls Destroy.

Use Destroy to free any memory or resources allocated in the Create method. When declaring a Destroy method in a descendant control type, always add the override directive to the declaration and call the inherited Destroy as the last statement in the redeclared method.


TCustomControl.Paint

TCustomControl	See also

Renders the image of a custom control.

procedure Paint; virtual;

Description

The Paint method for TCustomControl does nothing other than provide the interface for a method that responds to WM_PAINT messages. Paint is called by the PaintWindow method, after that method has supplied the Canvas with the handle to a device context. When creating a custom control, always override Paint to draw the image of the control.


TCustomControl.PaintWindow

TCustomControl	See also

Renders the image of the control on a specified device context.

procedure PaintWindow(DC: HDC); override;

Description

PaintWindow is called automatically when a custom control receives a WM_PAINT message. PaintWindow assigns the device context specified by the DC parameter to the custom control’s canvas, calls the Paint method, and finally removes the device context. Override PaintWindow to provide additional responses to the WM_PAINT message. To draw the image of the control, override the Paint method instead.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomDBGrid

Hierarchy	Properties	Methods	Events	See also

TCustomDBGrid is the abstract base class for grid controls that display the records from a dataset in a tabular format.

Unit

dbgrids

Description

TCustomDBGrid introduces new properties, events, and methods to expand the capabilities of TCustomGrid for displaying the fields from a dataset. At runtime, users can manipulate TCustomDBGrid objects using the TDBNavigator object.

Do not create instances of TCustomDBGrid. Use TCustomDBGrid as a base class when declaring grid objects that display information from datasets. Properties and methods of TCustomDBGrid provide basic behavior that descendant classes inherit as well as behavior that components can override to customize their behavior.


TCustomDBGrid properties

TCustomDBGrid	Alphabetically	Legend

In TCustomDBGrid

Columns

DataLink

DataSource

DefaultDrawing

FieldCount

Fields

IndicatorOffset

LayoutLock

Options

ReadOnly

SelectedField

SelectedIndex

SelectedRows

TitleFont

UpdateLock

Derived from TCustomGrid

EditorMode

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

HostDockSite

Height

Hint

Left

LRDockWidth

Name

Parent

ParentColor

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomDBGrid properties

TCustomDBGrid	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Columns

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DataLink

DataSource

DefaultDrawing

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

EditorMode

Enabled

FieldCount

Fields

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

IndicatorOffset

LayoutLock

Left

LRDockWidth

Name

Options

Owner

Parent

ParentColor

ParentWindow

ReadOnly

SelectedField

SelectedIndex

SelectedRows

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

TitleFont

Top

UndockHeight

UndockWidth

UpdateLock

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TCustomDBGrid.Columns

TCustomDBGrid	See also

Describes the display attributes and field bindings of the columns.

property Columns: TDBGridColumns;

Description

Use Columns to read or set the field bindings and display attributes of the columns in the data-aware grid. Columns is an indexed collection of TColumn objects. Use the properties of the TColumn objects to specify the display attributes or field bindings of individual columns in the grid. The field binding of a column designates a field within the dataset specified by the DataSource property.

Columns can be set at design time through the Columns editor, or programmatically at runtime.


TCustomDBGrid.DataLink

TCustomDBGrid	See also

Helps the data-aware grid manage its link to the data source and respond to data events.

property DataLink: TGridDataLink;

Description

Applications should not need to use the DataLink property. It is exposed as a protected property so that component writers can use descendants of TGridDataLink to respond to additional data events.

DataLink helps TCustomDBGrid to

•	Resolve the field bindings specified by Columns with the fields in the dataset.

•	Respond to changes in the values of fields.

•	Respond to changes in record currency.

•	Respond to changes in the editing state of the dataset.

•	Keep track of unposted edits and discard or post them as appropriate.


TCustomDBGrid.DataSource

TCustomDBGrid	See also	Example

Identifies the link to the dataset where the data-aware grid finds its data.

property DataSource: TDataSource;

Description

Set DataSource to the TDataSource object that links to the dataset where the data-aware grid should fetch its data. DataSource allows the data-aware grid to read from, write to, and navigate around the dataset.


TCustomDBGrid.DefaultDrawing

TCustomDBGrid	See also

Indicates whether the cells in the data-aware grid are drawn automatically.

property DefaultDrawing: Boolean;

Description

Set DefaultDrawing to True to allow the data-aware grid to draw the data in the cells of the grid automatically. Set DefaultDrawing to False to turn off the default drawing when providing customized painting in an OnDrawColumnCell event handler or an OnDrawDataCell event handler.

When DefaultDrawing is True, the data-aware grid fetches the data for each cell from the appropriate entry in the Fields array, and writes it to the cell. It then draws the focus rectangle if the cell has focus, or if the cell is selected and the Options property includes dgAlwaysShowSelection.

When DefaultDrawing is False, the data-aware grid draws the appropriate background color on the cell and sets up the brush and font described by the appropriate TColumn object. However, the value of the field is not written to the cell, and no focus rectangle is drawn.


TCustomDBGrid.FieldCount

TCustomDBGrid	See also	Example

Specifies the number of fields (columns) displayed in the grid.

property FieldCount: Integer;

Description

Use FieldCount to iterate through all the field components indexed by the Fields property. FieldCount may differ from the number of fields in the underlying dataset because the grid may contain calculated fields, and not all fields in the dataset are necessarily shown in the grid. Individual fields are removed and calculated fields are added using the Columns editor at design time.

FieldCount is the same as the number of columns at runtime. At design time, the grid may contain empty columns.


TCustomDBGrid.Fields

TCustomDBGrid	See also	Example

Provides indexed access to the field components that correspond to the columns.

property Fields[Index: Integer]: TField;

Description

Use Fields to gain direct access to the field component in the dataset for a particular column in the grid. The field for the first data column is obtained using an Index of 0, the field for the second data column using an Index of 1, and so on. The range for Index is 0.. FieldCount - 1.

The first data column in the grid may not be the same as the first column in the grid. If Options includes dgIndicator, the first column in the grid will be a non-scrolling columns that contains the current row indicator.

The individual field components in Fields can be used to obtain information such as the value of the field on the current record, its preferred display width, or the string to draw when displaying or editing the field. Use the field component to write values directly to the dataset without using the editor in the cell.

Note:	If the column in the grid represents a calculated field, there is no field component for that column in the dataset. Fields returns nil when the Index specifies the column that contains a calculated field. To obtain the field component for a calculated field, use the GetColField method.


TCustomDBGrid.IndicatorOffset

TCustomDBGrid	See also

Indicates the index of the first column in the grid that contains data.

property IndicatorOffset: Byte;

Description

Use IndicatorOffset to convert between the positions of the columns in the Columns property and the columns drawn on the data-aware grid. IndicatorOffset is 1 if the Options property includes dgIndicator, because the first column of the grid is used for the current row indicator. IndicatorOffset is 0 if all columns contain data.


TCustomDBGrid.LayoutLock

TCustomDBGrid	See also

Counts the number of times BeginLayout has been called without an EndLayout or CancelLayout call.

property LayoutLock: Byte;

Description

Use LayoutLock to determine when the column bindings change. Whenever a column width or binding changes or the fields in the data source change, the BeginLayout method is called. BeginLayout increments LayoutLock to keep track of the fact that the column bindings are changing. When changes are complete, the EndLayout method is called. EndLayout decrements LayoutLock. When LayoutLock returns to 0, the data-aware grid knows that all changes are complete, and the Fields and Columns properties are updated.


TCustomDBGrid.Options

TCustomDBGrid 	See also

Specifies various display and behavioral properties of the data-aware grid.

type

  TDBGridOption = (dgEditing, dgAlwaysShowEditor, dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgRowSelect, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit, dgMultiSelect);

TDBGridOptions = set of TDBGridOption;

property Options: TDBGridOptions;

Description

Set Options to include the desired properties for the data-aware grid. Options is a set drawn from the following values:

Value	Meaning

dgEditing	The user can edit data using the grid. dgEditing is ignored if Options includes dgRowSelect.

dgAlwaysShowEditor	 The grid is always in edit mode. That is, the user does not have to press Enter or F2 before editing the contents of a cell. dgAlwaysShowEditor does nothing unless dgEditing is also included in Options. dgAlwaysShowEditor is ignored if Options includes dgRowSelect.

dgTitles	Titles appear at the top of the columns in the grid.

dgIndicator	A small pointer appears in the first column to indicate which row is current.

dgColumnResize	Columns that are bound to fields can be resized or moved.

dgColLins	Lines appear between columns in the grid.

dgRowLines	Lines appear between the rows of the grid.

dgTabs	The user can navigate through the grid using the Tab and Shift+Tab keys.

dgRowSelect	The user can select an entire row, as well as selecting individual cells. If Options includes dgRowSelect, dgEditing and dgAlwaysShowEditor are ignored.

dgAlwaysShowSelection	The selected cell displays the focus rectangle even when the grid does not have focus.

dgConfirmDelete	A message box appears, asking for confirmation, when the user types Ctrl+Delete to delete a row in the grid.

dgCancelOnExit	When the user exits the grid from an inserted record to which the user made no modifications, the inserted record is not posted to the dataset. This prevents the inadvertent posting of empty records.

dgMultiSelect	More than one row in the grid can be selected at a time.


TCustomDBGrid.ReadOnly

TCustomDBGrid	See also

Indicates whether the grid is used for display only, or whether the user can edit data using the grid.

property ReadOnly: Boolean;

Description

Set ReadOnly to True to prevent users from changing the data in the dataset. Set ReadOnly to False to allow users to edit data using the grid.

When ReadOnly is True, users cannot use the Insert key to insert a new row in the grid or use the Down Arrow key to add a row to the end of the grid.


TCustomDBGrid.SelectedField

TCustomDBGrid	See also	Example

Specifies the field component for the currently selected cell in the grid.

property SelectedField: TField;

Description

Set SelectedField to move focus to a particular field in the grid. Read SelectedField to obtain access to the field component for the currently selected cell. If there is not currently selected cell, SelectedField is nil. For example, when an entire row is selected, SelectedField is nil.


TCustomDBGrid.SelectedIndex

TCustomDBGrid	See also	Example

Specifies the index of the currently selected column in the Columns array.

property SelectedIndex: Integer;

Description

Set SelectedIndex to move focus to a column in the grid that is identified by position. Read SelectedIndex to determine which column in the grid has focus. A value of 0 indicates the first data column, 1 is the second data column, and so on. SelectedIndex is -1 if there is no currently selected column.

If the Options property includes dgIndicator, the index of the data column given by SelectedIndex will differ from the index of the physical column in the grid.

To access the field component for the selected column, use the SelectedField property.


TCustomDBGrid.SelectedRows

TCustomDBGrid	See also	Example

Specifies a set of bookmarks for all the records in the dataset that correspond to rows selected in the grid.

property SelectedRows: TBookmarkList;

Description

Use the properties and methods of the TBookmarkList object returned by SelectedRows to

Determine the number of rows in the grid that are selected.

Determine whether the current record in the dataset is selected.

Determine whether a particular record in the dataset is selected.

Delete all selected rows from the dataset.

SelectedRows is only meaningful when the Options property includes dgRowSelect and dgMultiSelect.


TCustomDBGrid.TitleFont

TCustomDBGrid	See also

Describes the font used to draw the column titles in the grid.

property TitleFont: TFont;

Description

Set TitleFont to change the font used to draw the column headings. TitleFont is only meaningful if the Options property includes dgTitles.


TCustomDBGrid.UpdateLock

TCustomDBGrid	See also

Counts the number of times BeginUpdate is called without a corresponding call to EndUpdate.

property UpdateLock: Byte;

Description

UpdateLock prevents the grid from repainting while the data in the grid changes. Whenever a change is made that affects the data that is drawn in the grid, the BeginUpdate method is called. BeginUpdate increments UpdateLock to keep track of the fact that the contents of the grid are changing. When changes are complete, the EndUpdate method is called. EndUpdate decrements UpdateLock.

When UpdateLock returns to 0, the data-aware grid can repaint its cells. When UpdateLock is greater than 0, the grid defers repaints. UpdateLock prevents the grid from flickering when the grid is resized or the user scrolls through the data.


TCustomDBGrid events

TCustomDBGrid	Alphabetically	Legend

In TCustomDBGrid

OnCellClick

OnColEnter

OnColExit

OnColumnMoved

OnDrawColumnCell

OnDrawDataCell

OnEditButtonClick

OnTitleClick


TCustomDBGrid events

TCustomDBGrid	By object	Legend

OnCellClick

OnColEnter

OnColExit

OnColumnMoved

OnDrawColumnCell

OnDrawDataCell

OnEditButtonClick

OnTitleClick


TCustomDBGrid.OnCellClick

TCustomDBGrid	See also

Occurs when the user releases the mouse in one of the cells of the grid.

type TDBGridClickEvent = procedure (Column: TColumn) of object;

property OnCellClick: TDBGridClickEvent;

Description

Write an OnCellClick event handler to take specific action when the user clicks in one of the cells of the data-aware grid. The Column parameter is the TColumn object that corresponds to the column where the mouse was when the user released the left mouse button.

OnCellClick occurs when the user releases the mouse. To take action when the user clicks down on the mouse, use the OnColEnter event.

OnCellClick will not occur when the mouse is released at the end of resizing a row or column, or when the cell is being edited.


TCustomDBGrid.OnColEnter

TCustomDBGrid	See also	Example

Occurs when focus moves to a new cell in the grid.

property OnColEnter: TNotifyEvent;

Description

Write an OnColEnter event handler to take specific action when a new cell has just been selected. Focus moves to a cell when

•	The user navigates to the cell using the keyboard. For example, when the user uses the Tab key, or the Home key.

•	The user clicks the mouse button down in the cell.

•	The SelectedField or SelectedIndex property is set.

Read the SelectedField or SelectedIndex property to determine which cell was just entered.


TCustomDBGrid.OnColExit

TCustomDBGrid	See also	Example

Occurs just before a cell in the grid loses input focus.

property OnColExit: TNotifyEvent;

Description

Write an OnColExit event handler to take specific action when a cell is about to lose focus. For example, use OnColExit to post edits to the underlying dataset when the user leaves a cell, rather than waiting for the user to leave the record.

A cell loses focus when

•	The user navigates out of the cell using the keyboard. For example, when the user presses the Tab key or the Home key.

•	The user clicks the mouse button down in another cell.

•	The SelectedField or SelectedIndex property is set.

When the selected cell in the data-aware grid changes, first the OnColExit event occurs. Then the values of SelectedField and SelectedIndex are updated. Finally the OnColEnter event occurs. Thus, in an OnColExit event handler, the SelectedField or SelectedIndex property can be used to determine which column is about to lose focus.


TCustomDBGrid.OnColumnMoved

TCustomDBGrid	See also

Occurs when the user moves a column using the mouse.

type TMovedEvent = procedure (Sender: TObject; FromIndex, ToIndex: Longint) of object;

property OnColumnMoved: TMovedEvent;

Description

Write an OnColumnMoved event handler to take specific action just after a column in the grid has been moved. The FromIndex parameter gives the position the column previously occupied in the Columns array. The ToIndex parameter gives the position the column now occupies.

OnColumnMoved can only occur when the Options property includes dgColumnResize.


TCustomDBGrid.OnDrawColumnCell

TCustomDBGrid	See also

Occurs when the grid needs to paint a cell.

Type

  TDrawColumnCellEvent = procedure (Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState) of object;

property OnDrawColumnCell: TDrawColumnCellEvent;

Description

Write an OnDrawColumnCell event handler to provide customized drawing for the data in the cells of the grid. Draw on the cell using the methods of the Canvas property.

The Rect parameter indicates the location of the cell on the canvas. The DataCol parameter is the index of the column in the Columns array. The Column parameter is the TColumn object that describes the display attributes and field binding for the cell. The State parameter indicates whether the cell has input focus, whether the cell is selected, and whether the cell is a fixed (non-data) cell such as a column header.

An OnDrawColumnCell event handler can call the DefaultDrawColumnCell method to instruct the data-aware grid to write the data value in the cell. The OnDrawColumnCell event handler can augment the DefaultDrawColumnCell method to provide visual indications of selection and focus.

If DefaultDrawing is True, the data will already be drawn in the cell before the OnDrawColumnCell event, and the grid draws a focus rectangle around selected cells after the OnDrawColumnCell event.

Note:	If the Columns property has a State property of csDefault, the OnDrawDataCell event occurs before the OnDrawColumnCell. The OnDrawDataCell event is obsolete, and only included for backward compatibility. Do not set both an OnDrawDataCell event handler and an OnDrawColumnCell event handler.


TCustomDBGrid.OnDrawDataCell

TCustomDBGrid	See also	Example

Occurs when the grid needs to paint a cell if the State property of Columns is csDefault.

type

  TDrawDataCellEvent = procedure (Sender: TObject; const Rect: TRect; Field: TField; State: TGridDrawState) of object;

property OnDrawDataCell: TDrawDataCellEvent;

Description

Do not write an OnDrawDataCell event handler. OnDrawDataCell is obsolete and included for backward compatibility. Instead, write an OnDrawColumnCell event handler.


TCustomDBGrid.OnEditButtonClick

TCustomDBGrid	See also

Occurs when the user presses the ellipsis button in a grid column.

property OnEditButtonClick: TNotifyEvent;

Description

Write an OnEditButtonClick event handler to bring up an appropriate list or dialog when the user presses the ellipsis button in a grid cell. The OnEditButtonClick event handler can set the value of the field based on the user response to the list or dialog. Use the SelectedField property to access the TField component whose value should be set.


TCustomDBGrid.OnTitleClick

TCustomDBGrid	See also

Occurs when the user releases the mouse in one of the column headers.

Type

  TDBGridClickEvent = procedure (Column: TColumn) of object;

property OnTitleClick: TDBGridClickEvent;

Description

Write an OnTitleClick event handler to take specific action when the user clicks in one of the column headers. The Column parameter is the TColumn object that corresponds to the column where the mouse was when the user released the left mouse button.


TCustomDBGrid methods

TCustomDBGrid	Alphabetically	Legend

In TCustomDBGrid

AcquireLayoutLock

BeginColumnDrag

BeginLayout

BeginUpdate

CalcSizingState

CalcTitleRec

CancelLayout

CanEditAcceptKey

CanEditModify

CanEditShow

CellClick

CheckColumnDrag

ColEnter

ColExit

ColumnAtDepth

ColumnMoved

ColWidthsChanged

Create

CreateColumns

CreateEditor

CreateWnd

DataToRawColumn

DefaultDrawColumnCell

DefaultDrawDataCell

DefaultHandler

DeferLayout

DefineFieldMap

DefineProperties

Destroy

DrawCell

DrawColumnCell

DrawDataCell

EditButtonClick

EndColumnDrag

EndLayout

EndUpdate

ExecuteAction

GetColField

GetEditLimit

GetEditMask

GetEditText

GetFieldValue

HighlightCell

InvalidateTitles

KeyDown

KeyPress

LayoutChanged

LinkActive

Loaded

MouseDown

MouseUp

Notification

RawToDataColumn

Scroll

SetColumnAttributes

SetEditText

ShowPopupEditor

StoreColumns

TopLeftChanged	TimedScroll

TitleClick

UpdateAction

UseRightToLeftAlignmentForField

ValidFieldIndex

Derived from TCustomGrid

MouseCoord

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomDBGrid methods

TCustomDBGrid	By object	Legend

AcquireLayoutLock

AfterConstruction

Assign

BeforeDestruction

BeginColumnDrag

BeginDrag

BeginLayout

BeginUpdate

BringToFront

Broadcast

CalcSizingState

CalcTitleRec

CancelLayout

CanEditAcceptKey

CanEditModify

CanEditShow

CanFocus

CellClick

CheckColumnDrag

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ColEnter

ColExit

ColumnAtDepth

ColumnMoved

ColWidthsChanged

ContainsControl

ControlAtPos

Create

CreateColumns

CreateEditor

CreateParented

CreateParentedControl

CreateWnd

DataToRawColumn

DefaultDrawColumnCell

DefaultDrawDataCell

DefaultHandler

DeferLayout

DefineFieldMap

DefineProperties

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawCell

DrawColumnCell

DrawDataCell

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EditButtonClick

EnableAlign

EndColumnDrag

EndDrag

EndLayout

EndUpdate

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetColField

GetControlsAlignment

GetEditLimit

GetEditMask

GetEditText

GetFieldValue

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

HighlightCell

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

InvalidateTitles

IsRightToLeft

KeyDown

KeyPress

LayoutChanged

LinkActive

Loaded

ManualDock

ManualFloat

MethodAddress

MethodName

MouseCoord

MouseDown

MouseUp

MouseWheelHandler

NewInstance

Notification

PaintTo

Perform

RawToDataColumn

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

Scroll

ScrollBy

SendToBack

SetBounds

SetColumnAttributes

SetEditText

SetFocus

SetTextBuf

Show

ShowPopupEditor

StoreColumns

TimedScroll

TitleClick

TopLeftChanged

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftAlignmentForField

UseRightToLeftReading

UseRightToLeftScrollBar

ValidFieldIndex


TCustomDBGrid.AcquireLayoutLock

TCustomDBGrid	See also

Calls BeginLayout if the table is not currently being reformatted.

function  AcquireLayoutLock: Boolean;

Description

Applications cannot call this protected method. AcquireLayoutLock is called before recomputing Columns when the fields in the dataset change or when the Columns property changes. AcquireLayoutLock returns True if the table is not already being laid out, to indicate that the computation of Columns should proceed. AcquireLayoutLock prevents the computation of Columns from looping endlessly because of the changes that must occur during the computation.


TCustomDBGrid.BeginColumnDrag

TCustomDBGrid	See also

Starts the dragging of a column in the grid.

function BeginColumnDrag(var Origin, Destination: Integer; const MousePt: TPoint): Boolean; dynamic;

Description

Call BeginColumnDrag to start a drag operation. BeginColumnDrag enables the grid to control where the column can be dropped. It is exposed as a protected method so that descendants of TCustomDBGrid can customize column dragging in a grid.


TCustomDBGrid.BeginLayout

TCustomDBGrid	See also

Increments the LayoutLock property when the column bindings or fields in the dataset change.

procedure BeginLayout;

Description

Applications cannot call this protected method. Data-aware grids call BeginLayout internally before making changes to the Columns property or any of the individual TColumn objects in Columns. Once the change is complete, the data-aware grid calls EndLayout. If the response to the change must be canceled or postponed, the grid calls CancelLayout.

Each call to BeginLayout increments the LayoutLock property. Each call to EndLayout or CancelLayout decrements the LayoutLock property. If LayoutLock returns to 0 in a call to EndLayout, the Fields property is updated to match both the bindings of the Columns property and the fields available in the dataset. The Columns property is then updated in turn to match the Fields property. This ensures that the Columns property matches both the specified column bindings and the fields available in the dataset.


TCustomDBGrid.BeginUpdate

TCustomDBGrid	See also

Increments the UpdateLock property when the data in the grid changes.

procedure BeginUpdate;

Description

Applications cannot call this protected method. Data-aware grids call BeginUpdate internally before making changes that affect the data that is drawn in the grid. Once the change is complete, the data-aware grid calls EndUpdate, which decrements the UpdateLock property.

While UpdateLock is greater than 0, the grid does not repaint its cells. BeginUpdate and EndUpdate prevent the grid from flickering when the grid is resized or the user scrolls through the data.


TCustomDBGrid.CalcSizingState

TCustomDBGrid	See also

Determines the appearance of the mouse cursor during resizing.

procedure CalcSizingState(X, Y: Integer; var State: TGridState; var Index: Longint; var SizingPos, SizingOfs: Integer; var FixedInfo: TGridDrawInfo); override;

Description

Use CalcSizingState to determine if the mouse cursor should be changed to a resize or drag cursor based on where the mouse is in the grid. For example, cursor over a grid line, in the fixed cell region, and column resize is enabled = resize cursor.


TCustomDBGrid.CalcTitleRec

TCustomDBGrid	See also

Calculates the rectangular region that covers the cell indicated by the column and row parameters.

function CalcTitleRec(Col: TColumn; ARow: Integer; var MasterCol: TColumn): TRect;

Description

In ADT datasets with ObjectView set to True, the rectangle covering a cell may be larger than the cell itself, covering several cells.  The MasterCol parameter returns the dbgrid column object that determines the drawing behaviors of the calculated rectangle.  For example, if the column parameter is an ADT child field, MasterCol will point to the column containing the ADT child field's parent field, or grandparent, depending on the Row param.  Row 0 would return the outermost parent of the ADT child, and would return a rectangle that spans all of the ADT children of that parent.  If the current column is not an ADT child, MasterCol returns nil.


TCustomDBGrid.CancelLayout

TCustomDBGrid	See also

Decrements the LayoutLock property.

procedure CancelLayout;

Description

Applications cannot call this protected method. Data-aware grids call CancelLayout internally when postponing the recomputation of Columns.

Each call to BeingLayout increments the LayoutLock property. Each call to EndLayout or CancelLayout decrements the LayoutLock property. If LayoutLock returns to 0 in a call to CancelLayout, the Columns property is not updated. CancelLayout is called from the DeferLayout method to decrement the LayoutLock and prevent the recomputation of Columns until a more appropriate time.


TCustomDBGrid.CanEditAcceptKey

TCustomDBGrid	See also

Indicates whether the Key parameter can be entered into the current cell.

function  CanEditAcceptKey(Key: Char): Boolean; override;

Description

Data-aware grids use CanEditAcceptKey internally to determine whether keys typed by the user are valid for the field represented by the current cell. CanEditAcceptKey calls the IsValidChar method of the field component associated with the column that has input focus.

CanEditAcceptKey provides a crude validation of keyboard input. More refined validation is provided when the value in the cell is written to the record in the dataset, or by an edit mask.


TCustomDBGrid.CanEditModify

TCustomDBGrid	See also

Indicates whether the current column of the grid can be edited.

function  CanEditModify: Boolean; override;

Description

Data-aware grids use CanEditModify internally to determine whether to allow the user to edit the current cell. CanEditModify returns True if the field in the current column can be edited. CanEditModify returns False if the field cannot be edited. If the dataset is not in edit mode, CanEditModify will attempt to put it in edit mode.

Note:	CanEditModify returns False when the current field is a binary large object (BLOB) field. BLOB fields can only be edited through the clipboard or by streaming.


TCustomDBGrid.CanEditShow

TCustomDBGrid	See also

Indicates whether the inplace edit control can be created to allow editing.

function CanEditShow: Boolean; override;

Description

TCustomDBGrid overrides the inherited method to prevent the inplace edit control from coming up while the layout of the grid is being recomputed.

Grid controls call CanEditShow internally before creating the editor for a cell. CanEditShow is called after the grid has determined that the field can be edited by calling CanEditModify.


TCustomDBGrid.CellClick

TCustomDBGrid	See also

Generates an OnCellClick event.

procedure CellClick(Column: TColumn); dynamic;

Description

Applications cannot directly call CellClick. It is exposed as a protected method so that descendants can call the OnCellClick event handler in response to other events or override the response when the user releases the mouse in a cell of the grid.


TCustomDBGrid.CheckColumnDrag

TCustomDBGrid	See also

CheckColumnDrag validates whether the column currently selected for dragging can be dropped at the current location.

function CheckColumnDrag(var Origin, Destination: Integer; const MousePt: TPoint): Boolean; dynamic;

Description

Use CheckColumnDrag to validate that the column currently selected for dragging can be dropped at the current location.  CheckColumnDrag can change the Origin (the column being dragged) and/or the Destination (the drop target), as needed, to keep the grid's columns in order.


TCustomDBGrid.ColEnter

TCustomDBGrid	See also

Generates an OnColEnter event.

procedure ColEnter; dynamic;

Description

Applications cannot directly call ColEnter. It is exposed as a protected method so that descendants can call the OnCellEnter event handler in response to other events or override the response when a cell in the grid is selected.


TCustomDBGrid.ColExit

TCustomDBGrid	See also

Generates an OnColExit event.

procedure ColExit; dynamic;

Description

Applications cannot directly call ColExit. It is exposed as a protected method so that descendants can call the OnColExit event handler in response to other events or override the response when a cell in the grid loses focus.


TCustomDBGrid.ColumnAtDepth

TCustomDBGrid	See also

Returns the column object associated with nth parent field of the given column.

function ColumnAtDepth(Col: TColumn; ADepth: Integer): TColumn;

Description

ColumnAtDepth is used to calculate MasterCol used in the CalcTitleRec method.


TCustomDBGrid.ColumnMoved

TCustomDBGrid	See also

Generates an OnColumnMoved event.

procedure ColumnMoved(FromIndex, ToIndex: Longint); override;

Description

Applications cannot directly call ColumnMoved. It is exposed as a protected method so that descendants can call the OnColumnMoved event handler in response to other events or override the response after a column in the grid is moved.


TCustomDBGrid.ColWidthsChanged

TCustomDBGrid	See also

Updates the column widths in the Columns property when the user resizes the columns.

procedure ColWidthsChanged; override;

Description

Applications cannot directly call ColWidthsChanged. It is called automatically when the user resizes the columns in the grid. ColWidthsChanged overrides the inherited method to update the column widths in the Columns property.


TCustomDBGrid.Create

TCustomDBGrid	See also

Creates and initializes an instance of TCustomDBGrid.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a data-aware grid at runtime. Grids placed on a form at design time are created automatically.

Pass a single Component as a parameter to provide the grid with an Owner that is responsible for freeing the grid.After calling the inherited constructor, Create creates the helper objects used by the data-aware grid and initializes

Color to clWindow, and ParentColor to False.

DefaultDrawing to True.

Options to [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgConfirmDelete, dgCancelOnExit].


TCustomDBGrid.CreateColumns

TCustomDBGrid	See also

Creates the TDBGridColumns object that stores the column descriptors for the grid.

function  CreateColumns: TDBGridColumns; dynamic;

Description

Applications cannot call CreateColumns. It is exposed as a protected method so that component writers can substitute a descendant of TDBGridColumns to manage the column descriptors of a data-aware grid.


TCustomDBGrid.CreateEditor

TCustomDBGrid	See also

Creates the inplace editor that allows the cells of the grid to be edited.

function CreateEditor: TInplaceEdit; override;

Description

CreateEditor overrides the inherited method to create a data-aware descendant of TInplaceEdit.


TCustomDBGrid.CreateWnd

TCustomDBGrid	See also

Creates the window used to display the data-aware grid.

procedure CreateWnd; override;

Description

The Windows control for the grid can be temporarily destroyed and recreated in order to set properties that require changing the window creation parameters.  TCustomDBGrid calls CreateWnd to create this Windows control when necessary.

CreateWnd overrides the inherited method to set up the relationship between the visual display and the data source after the window is created.


TCustomDBGrid.DataToRawColumn

TCustomDBGrid	See also

Converts a column index in the Columns property to the index of the corresponding column in the visual display.

function DataToRawColumn(ACol: Integer): Integer;

Description

Applications cannot call this protected method. It is used internally to allow the data-aware grid to adjust to the presence or absence of the column that contains the row indicator.


TCustomDBGrid.DefaultDrawColumnCell

TCustomDBGrid	See also

Draws the text in a column cell.

procedure DefaultDrawColumnCell(const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);

Description

Call DefaultDrawColumnCell from an OnDrawColumnCell event handler to lookup up the text representation of a field and write it to the cell. DefaultDrawColumnCell does exactly what the grid does when the DefaultDrawing property is True, except it never draws a focus rectangle on selected cells.

The Rect parameter is the position of the cell on the canvas. The DataCol parameter is the index of the column in the Columns array. The Column parameter is the TColumn object that describes the display attributes and field binding for the cell. The State parameter indicates whether the cell has input focus, whether the cell is selected, and whether the cell is a fixed (non-data) cell such as a column header.


TCustomDBGrid.DefaultDrawDataCell

TCustomDBGrid	See also	Example

Draws the text in a column cell.

procedure DefaultDrawDataCell(const Rect: TRect; Field: TField; State: TGridDrawState);

Description

Call DefaultDrawDataCell from an OnDrawDataCell event handler to lookup up the text representation of a field and write it to the cell. Unlike what the grid draws when the DefaultDrawing property is True, DefaultDrawDataCell gets the alignment for the text from the field component rather than the column descriptor, and it never draws a focus rectangle on selected cells.

The Rect parameter gives the position of the cell on the canvas. The Field parameter gives the field component that provides the data and alignment for the cell. The State parameter indicates whether the cell has input focus, whether the cell is selected, and whether the cell is a fixed (non-data) cell such as a column header.


TCustomDBGrid.DefaultHandler

TCustomDBGrid	See also

Displays the popup menu when a column is right-clicked.

procedure DefaultHandler(var Msg); override;

Description

DefaultHandler is the last method to receive Windows messages that are sent to the grid. After calling the inherited method and allowing it to process the message, DefaultHandler checks if the Msg parameter indicates the right mouse button was released over a column with a popup menu. If the column has a popup menu with its AutoPopup property set to True, DefaultHandler displays the popup menu.

When overriding DefaultHandler, be sure to call the inherited method for all unhandled messages.


TCustomDBGrid.DeferLayout

TCustomDBGrid	See also

Decrements the LayoutLock property and posts a message to the grid to trigger a new layout sequence at a more appropriate time.

procedure DeferLayout;

Description

Applications cannot call this protected method. Data-aware grids call DeferLayout internally to postpone the recomputation of the Columns property after the dataset changes when it is inappropriate to recompute columns immediately.

DeferLayout calls CancelLayout to decrement the LayoutLock property which was incremented in response to the change in the dataset. It then posts a message to the grid which will trigger another layout attempt at a later point in time. When the message is received, the grid calls BeginLayout and then either EndLayout or DeferLayout, depending on whether it is an appropriate time to proceed with the computation of Columns.


TCustomDBGrid.DefineFieldMap

TCustomDBGrid	See also

Builds the Fields array from the Columns property and the data source.

procedure DefineFieldMap; virtual;

Description

Applications cannot call this protected method. DefineFieldMap rebuilds the Fields array to reflect the fields from the data source that correspond to the columns in the Columns property. After calling DefineFieldMap, the Columns property should be updated to use the field components in the Fields array. This ensures that the Columns property reflects any changes imposed by the dataset.


TCustomDBGrid.DefineProperties

TCustomDBGrid	See also

Defines a savable version of the Columns property when necessary.

procedure DefineProperties(Filer: TFiler); override;

Description

DefineProperties overrides the inherited method to load and save the Columns property if the columns have been customized.


TCustomDBGrid.Destroy

TCustomDBGrid	See also

Destroys an instance of TCustomDBGrid.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the data-aware grid is not nil, and only then calls Destroy. Destroy frees all the helper objects used by the grid.


TCustomDBGrid.DrawCell

TCustomDBGrid	See also

Draws the cell specified by the ACol and ARow parameters.

procedure DrawCell(ACol, ARow: Longint; ARect: TRect; AState: TGridDrawState); override;

Description

DrawCell overrides the inherited method to use the Columns property when drawing cells in the grid.

DrawCell sets up the font and brush and paints the background of the cell. If the DefaultDrawing property is True, DrawCell fetches the data for the cell and writes it to the position described by the ARect parameter. Whether DefaultDrawing is True or False, DrawCell generates the OnDrawDataCell and OnDrawColumnCell events. Finally, if DefaultDrawing is True and either the cell has focus or the cell is selected and Options includes dgAlwaysShowSelection, DrawCell draws a focus rectangle around the cell.


TCustomDBGrid.DrawColumnCell

TCustomDBGrid	See also

Generates an OnDrawColumnCell event.

procedure DrawColumnCell(const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); dynamic;

Description

Applications cannot call DrawColumnCell directly. It is exposed as a protected method so that descendants can call the OnDrawColumnCell event handler or override the method to block the event.


TCustomDBGrid.DrawDataCell

TCustomDBGrid	See also

Generates an OnDrawDataCell event.

procedure DrawDataCell(const Rect: TRect; Field: TField; State: TGridDrawState); dynamic;

Description

Applications cannot call DrawDataCell directly. It is exposed as a protected method so that descendants can call the OnDrawDataCell event handler or override the method to block the event.


TCustomDBGrid.EditButtonClick

TCustomDBGrid	See also

Generates an OnEditButtonClick event.

procedure EditButtonClick; dynamic;

Description

Applications cannot call EditButtonClick directly. It is exposed as a protected method so that descendants can call the OnEditButtonClick event handler or override the method to block the event.


TCustomDBGrid.EndColumnDrag

TCustomDBGrid	See also

Ends the dragging of a column in the grid.

function EndColumnDrag(var Origin, Destination: Integer; const MousePt: TPoint): Boolean; dynamic;

Description

Call EndColumnDrag to end a drag operation. EndColumnDrag enables the grid to control where the column can be dropped. It is exposed as a protected method so that descendants of TCustomDBGrid can customize column dragging in a grid.


TCustomDBGrid.EndLayout

TCustomDBGrid	See also

Decrements the LayoutLock property and recomputes the Columns property if LayoutLock reaches 0.

procedure EndLayout;

Description

Applications cannot call this protected method. Data-aware grids call Endlayout internally after changes to the Columns property or the dataset. EndLayout decrements the LayoutLock property which was previously incremented by BeingLayout before the Columns property was changed or when notification of the change to the dataset was received.

If LayoutLock returns to 0, EndLayout updates the Fields property to match both the bindings of the Columns property and the fields available in the dataset. The Columns property is then updated in turn to match the Fields property. This ensures that the Columns property matches both the specified column bindings and the fields available in the dataset.


TCustomDBGrid.EndUpdate

TCustomDBGrid	See also

Decrements the UpdateLock property.

procedure EndUpdate;

Description

Applications cannot call this protected method. Data-aware grids call EndUpdate internally after making changes that affect the data that is drawn in the grid. EndUpdate returns the UpdateLock to the state it was in before the BeginUpdate method was called at the start of the changes.

While UpdateLock is greater than 0, the grid does not repaint its cells. When UpdateLock returns to 0, painting is reenabled. BeginUpdate and EndUpdate prevent the grid from flickering when the grid is resized or the user scrolls through the data.


TCustomDBGrid.ExecuteAction

TCustomDBGrid	See also

Executes an action with the DB grid as its target.

function ExecuteAction(Action: TBasicAction): Boolean; override;

Description

ExecuteAction is called automatically when the user invokes an action with the DB grid as its target. The Action parameter specifies the action that was invoked. ExecuteAction returns a boolean value indicating whether the action was successfully executed.

ExecuteAction first calls the inherited method, which checks whether the action knows how to execute with the grid as a target. If this does not successfully dispatch the action, ExecuteAction attempts to invoke the action with the grids associated dataset as a target.


TCustomDBGrid.GetColField

TCustomDBGrid	See also

Returns the field component that represents the binding of a specified column.

function GetColField(DataCol: Integer): TField;

Description

Call GetColField to obtain the field component for a column in the data-aware grid. The DataCol parameter is the index of the column in the Columns property, where 0 is the first column, 1 is the second column, and so on.

Unlike the Fields property, GetColField will return field components for columns that do not represent fields in the dataset, such as calculated fields. GetColField will return nil if no field is associated with the column or if the dataset is not active.


TCustomDBGrid.GetEditLimit

TCustomDBGrid	See also

Limits the number of characters that can be typed into cells representing string fields.

function  GetEditLimit: Integer; override;

Description

GetEditLimit is called by the inplace editor to determine if a limit should be placed on the number of characters a user can type into a cell. GetEditLimit sets no limits except when the selected cell represents a string field.


TCustomDBGrid.GetEditMask

TCustomDBGrid	See also

Returns the input mask associated with the field for the selected cell.

function GetEditMask(ACol, ARow: Longint): String; override;

Description

The inplace editor calls GetEditMask to obtain any input mask associated with the field binding of the indicated cell. GetEditMask returns the EditMask property of the field component from the Columns array.

The ACol and ARow parameters indicate the index of the row and column of the cell in the grid. The ACol parameter is not the same as the index of the column in the Columns array if the Options property includes dgIndicator.


TCustomDBGrid.GetEditText

TCustomDBGrid	See also

Returns the value of the indicated cell formatted for editing.

function GetEditText(ACol, ARow: Longint): String; override;

Description

The inplace editor calls GetEditText to obtain the text for the indicated cell. GetEditText locates the field component for the cell from the Columns array and returns its value formatted for editing.

The ACol and ARow parameters indicate the index of the row and column of the cell in the grid. The ACol parameter is the “raw” column index, which is not the same as the index of the column in the Columns array if the Options property includes dgIndicator.

Note:	The string returned by GetEditText may differ from the string returned by the GetFieldValue method if the field formats its value differently for editing and display.


TCustomDBGrid.GetFieldValue

TCustomDBGrid	See also

Returns the value of the indicated cell formatted for display.

function GetFieldValue(ACol: Integer): string;

Description

The DefaultDrawColumnCell method calls GetFieldValue to obtain the text that should be displayed in a cell. Applications do not call this protected method.

The ACol parameter is the index of the column in the columns array. If the Options property includes dgIndicator, this is not the same as the index of the column in the physical display.


TCustomDBGrid.HighlightCell

TCustomDBGrid	See also

Indicates whether a specified cell should be highlighted when it is drawn.

function  HighlightCell(DataCol, DataRow: Integer; const Value: String; AState: TGridDrawState): Boolean; virtual;

Description

Applications cannot call this protected method. It is called internally by the DrawCell method to determine whether the cell specified by the DataCol and DataRow parameters should be highlighted. HighlightCell returns True if the cell has focus, the cell is selected and Options includes dgAlwaysShowSelection, or the cell is in a selected row and Options includes dgRowSelect.


TCustomDBGrid.InvalidateTitles

TCustomDBGrid

Invalidates the column titles so that they will be repainted.

procedure InvalidateTitles;

Description

Call InvalidateTitles to cause the column titles to be repainted.


TCustomDBGrid.KeyDown

TCustomDBGrid	See also

Provides special processing when the user presses down on a key.

procedure KeyDown(var Key: Word; Shift: TShiftState); override;

Description

Applications cannot call KeyDown. It is called automatically when the user presses a key, before the KeyPress method is called.

KeyDown generates an OnKeyDown event and then responds to the following keystrokes:

Keystroke	Response

UpArrow	Move to the previous row. If Options includes dgRowSelect, select it.

Ctrl+UpArrow	Move to the first row in the grid. Deselect any selected rows.

DownArrow	Move to the next row. If Options includes dgRowSelect, select it.

Ctrl+DownArrow	Move to the last row in the grid. Deselect any selected rows.

PageUp	Move up by the number of records shown in the grid. Deselect any selected rows.

Ctrl+PageUp	Move to the first row in the grid. Deselect any selected rows.

PageDown	Move down by the number of records shown in the grid. Deselect any selected rows.

LeftArrow	Move left one column. If Options includes dgRowSelect, move to the previous row without selecting it.

Ctrl+LeftArrow	Move to the first column in the current row.

RightArrow	Move right one column. If Options includes dgRowSelect, move to the next row without selecting it.

Ctrl+RightArrow	Move to the last column in the current row.

Home	Move to the first column of the current row. If Options includes dgRowSelect or the grid has only one column, move to the first record in the dataset. Deselect any selected rows.

Ctrl+Home	Move to the first record in the dataset. Deselect any selected rows.

End	Move to the last column of the current row. If Options includes dgRowSelect or the grid has only one column, move to the last record in the dataset. Deselect any selected rows.

Ctrl+End	Move to the last record in the dataset. Deselect any selected rows.

Tab	Move to the next cell in the grid.

Shift+Tab	Move to the previous cell in the grid.

Ctrl+Delete	Delete the current selection.

Insert	Insert a new row above the current one, and move to it. Deselect any selected rows.

Escape	Cancel any unposted edits. Deselect any selected rows.

F2	Put the grid in edit mode.


TCustomDBGrid.KeyPress

TCustomDBGrid	See also

Responds when the user presses a key.

procedure KeyPress(var Key: Char); override;

Description

When the user presses a key, first the KeyDown method is called, then the KeyPress method, and finally the KeyUp method when the user releases the key. KeyPress overrides the inherited method to post edits to the database when the user presses Return.


TCustomDBGrid.LayoutChanged

TCustomDBGrid	See also

Recomputes the Columns property.

procedure LayoutChanged; virtual;

Description

Applications cannot call this protected method. It is called automatically in response to changes the affect the layout of the columns. These include

•	Changes to the fields in the dataset.

•	Changes in the Options property that affect the layout.

•	Changes to the TitleFont property.

LayoutChanged calls AcquireLayoutLock to initiate the changes to Columns. If AcquireLayoutLock does not indicate that the call to LayoutChanged is recursive, LayoutChanged calls EndLayout to perform the actual computation.


TCustomDBGrid.LinkActive

TCustomDBGrid	See also

Recomputes the Columns property and the vertical scrollbar of the grid.

procedure LinkActive(Value: Boolean); virtual;

Description

Applications cannot call this protected method. It is called automatically when the dataset is opened. LinkActive calls LayoutChanged to recompute the Columns property, and adjusts the vertical scrollbar for the data in the dataset.


TCustomDBGrid.Loaded

TCustomDBGrid	See also

Sets up the Columns property once the data grid and all its child components are loaded.

procedure Loaded; override;

Description

Applications cannot call this protected method. Loaded overrides the inherited method to lay out the grid once all of its parts have been loaded.


TCustomDBGrid.MouseDown

TCustomDBGrid	See also

Provides special processing when the user clicks on the mouse.

procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;

Description

MouseDown is called automatically when the user presses the mouse button. If the mouse is pressed in the row or column resize region of the grid, MouseDown posts any pending edits and calls the inherited method to handle the resize. When Options includes dgRowSelect, MouseDown selects the row that received the click, or toggles its selection state if the Ctrl key is pressed. If the mouse is clicked in a data cell, MouseDown tries to put the grid into edit mode.


TCustomDBGrid.MouseUp

TCustomDBGrid	See also

Provides special processing when the user releases the mouse button.

procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;

Description

MouseUp is called automatically when the user releases the mouse button. After calling the inherited method, MouseUp locates the cell which was under the mouse when it was released. MouseUp generates an OnTitleClick or OnCellClick event, depending on the location of the mouse.


TCustomDBGrid.Notification

TCustomDBGrid	See also

Responds to notifications that components are about to be destroyed.

procedure Notification(AComponent: TComponent; Operation: TOperation); override;

Description

After calling the inherited method, Notification

•	Checks if the pop-up menu for any of its columns is going away, and if so, resets the PopupMenu property of the column object.

•	Checks if the data source is going away, and if so, sets the DataSource property to nil.

•	Checks if any of the field components associated with its columns is going away, and if so, removes the column from the layout.


TCustomDBGrid.RawToDataColumn

TCustomDBGrid	See also

Converts the index of a column in the visual display to the corresponding index in the Columns property.

function RawToDataColumn(ACol: Integer): Integer;

Description

Applications cannot call this protected method. It is used internally to allow the data-aware grid to adjust to the presence or absence of the column that contains the row indicator.


TCustomDBGrid.Scroll

TCustomDBGrid	See also

Updates the image of the grid to reflect a new record position.

procedure Scroll(Distance: Integer); virtual;

Description

Scroll is called in response to changes in the current record in the dataset. Scroll updates the image in the grid, scrolling the data if necessary.


TCustomDBGrid.SetColumnAttributes

TCustomDBGrid	See also

Sets the column widths and disables tabbing to cells that can’t be edited.

procedure SetColumnAttributes; virtual;

Description

Applications cannot call this protected method. It is called automatically when the Columns property is recomputed, to adjust the column widths and ensure that the user can only tab to fields that can be edited.


TCustomDBGrid.SetEditText

TCustomDBGrid	See also

Updates the edited version of the current cell’s data.

procedure SetEditText(ACol, ARow: Longint; const Value: String); override;

Description

SetEditText is called by the inplace editor so that the grid can store the new value for the current cell. The grid stores this value until the user moves to a new cell or presses Escape. If the user moves to a new cell, this value is written to the record in the database. If the user presses Escape, the value is discarded.


TCustomDBGrid.ShowPopupEditor

TCustomDBGrid	See also

Displays the nested dataset associated with Column in a new window.

procedure ShowPopupEditor(Column: TColumn; X: Integer = Low(Integer); Y: Integer = Low(Integer)); dynamic;

Description

Call ShowPopupEditor to display a nested dataset or ADT in a new grid in a new window.  Column is the column that is representing the dataset or reference field of the dataset.

For example, if the seventh column in the grid represents a dataset field, the following code displays the dataset associated with that field for the current record.

DBGrid1.ShowPopupEditor(DBGrid1.Columns[7]);

ShowPopupEditor expects the TColumn object field type passed to be ftDataSet.

When the ellipis button in the grid cell of a nested dataset or reference field is clicked, EditButtonClick is called. If the grid’s OnEditButtonClick event has an event handler, that event is fired and ShowPopupEditor is not called. If the event handler is not assigned, ShowPopupEditor is called.

The X and Y parameters are screen coordinates to position the popup editor form. Defaults to positioning the form below the cell in the grid.


TCustomDBGrid.StoreColumns

TCustomDBGrid	See also

Indicates whether the columns of the grid are stored when the grid is saved, or whether they are generated dynamically.

function StoreColumns: Boolean;

Description

StoreColumns causes the Columns property to be stored only when the Columns property has a State property of csCustomized. The State property for Columns indicates whether the columns are generated automatically from the fields in the dataset, or if they are specified programmatically or by the Columns editor.


TCustomDBGrid.TimedScroll

TCustomDBGrid	See also

Moves the current record in response to the user dragging the mouse outside of the data cells.

type TGridScrollDirection = set of (sdLeft, sdRight, sdUp, sdDown);

procedure TimedScroll(Direction: TGridScrollDirection); override;

Description

If the Direction parameter includes sdUp, TimedScroll moves the dataset to the first visible record in the grid. If the Direction parameter includes sdDown, TimedScroll moves the dataset to the last visible record in the grid. After adjusting the current record, TimedScroll calls the inherited method to update the image.


TCustomDBGrid.TitleClick

TCustomDBGrid	See also

Generates an OnTitleClick event.

procedure TitleClick(Column: TColumn); dynamic;

Description

Applications cannot call TitleClick directly. It is exposed as a protected method so that descendants can call the OnTitleClick event handler or override the method to block the event.


TCustomDBGrid.TopLeftChanged

TCustomDBGrid	See also

Updates the position of the inplace editor when the grid scrolls.

procedure TopLeftChanged; override;

Description

TopLeftChanged is called whenever the LeftCol or TopRow property changes.  InvalidateTitles and the inherited method TopLeftChanged method are called.


TCustomDBGrid.UpdateAction

TCustomDBGrid	See also

Updates an action to reflect the current state of the grid.

function UpdateAction(Action: TBasicAction): Boolean; override;

Description

UpdateAction is called automatically when the application is idle allow the grid to set action properties to reflect the current state of the grid. The Action parameter is the action to be updated. UpdateAction returns a boolean that indicates whether the action was updated by the grid.

As implemented in TCustomDBGrid, UpdateAction checks whether the action relies on the state of the associated dataset, and if so, updates the action accordingly.


TCustomDBGrid.UseRightToLeftAlignmentForField

TCustomDBGrid	See also

Indicates whether the alignment of a specified field should be changed from left-aligned to right-aligned.

function UseRightToLeftAlignmentForField(const AField: TField; Alignment: TAlignment): Boolean;

Description

Call UseRightToLeftAlignmentForField when drawing field values to honor the current setting of the BiDiMode property. UseRightToLeftAlignment returns True if the application is running in a mideast locale (where alignment should be reversed), the field contains text (as opposed to numeric or date/time values), and the specified alignment is not taCenter.


TCustomDBGrid.ValidFieldIndex

TCustomDBGrid	See also

Indicates whether an index into the columns array refers to a valid field in the dataset.

function ValidFieldIndex(FieldIndex: Integer): Boolean;

Description

Call ValidFieldIndex to determine whether a column displays data from a field in the dataset. ValidFieldIndex returns True if the column is associated with a database field. ValidFieldIndex returns False if the column is a calculated field or if the field for the column is undefined.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGrid


TCustomDockForm

Hierarchy	Properties	Methods

The default floating dock site class for TControl objects.

Unit

Forms

Description

When a control is created, TCustomDockForm is the type assigned to the FloatingDockSiteClass property for the control,

You can use TCustomDockForm as the basis for your own floating dock site class, and then assign the new class to the a control’s FloatingDockSiteClass property.


TCustomDockForm properties

TCustomDockForm	Alphabetically	Legend

Derived from TCustomForm

Active

ActiveControl

ActiveOleControl

BorderStyle

Canvas

ClientRect

Designer

DropTarget

Floating

FormState

FormStyle

HelpFile

KeyPreview

Menu

ModalResult

Monitor

OleFormObject

Parent

PixelsPerInch

WindowState

Derived from TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

Brush

ClientOrigin

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

Caption

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomDockForm properties

TCustomDockForm	By object	Legend

Action

Active

ActiveControl

ActiveOleControl

Align

Anchors

AutoScroll

BiDiMode

BorderStyle

BoundsRect

Brush

Canvas

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

Designer

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DropTarget

Enabled

Floating

FloatingDockSiteClass

Font

FormState

FormStyle

Handle

Height

HelpContext

HelpFile

Hint

HorzScrollBar

HostDockSite

KeyPreview

Left

LRDockWidth

Menu

ModalResult

Monitor

Name

OleFormObject

Owner

Parent

ParentWindow

PixelsPerInch

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

VertScrollBar

Visible

VisibleDockClientCount

Width

WindowProc

WindowState


TCustomDockForm methods

TCustomDockForm	Alphabetically	Legend

In TCustomDockForm

Create

DoAddDockClient

DoRemoveDockClient

GetSiteInfo

Loaded

Derived from TCustomForm

AfterConstruction

BeforeDestruction

Close

CloseQuery

CreateNew

DefaultHandler

DefocusControl

Destroy

Dock

FocusControl

GetFormImage

Hide

IsShortCut

MouseWheelHandler

Print

Release

SendCancelMode

SetFocus

SetFocusedControl

Show

ShowModal

WantChildKey

Derived from TScrollingWinControl

DisableAutoRange

EnableAutoRange

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomDockForm methods

TCustomDockForm	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

Close

CloseQuery

ContainsControl

ControlAtPos

Create

CreateNew

CreateParented

CreateParentedControl

DefaultHandler

DefocusControl

Destroy

DestroyComponents

Destroying

DisableAlign

DisableAutoRange

Dispatch

DoAddDockClient

Dock

DockDrop

DoRemoveDockClient

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EnableAutoRange

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

FocusControl

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetFormImage

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetSiteInfo

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

IsShortCut

Loaded

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Print

Realign

Refresh

Release

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendCancelMode

SendToBack

SetBounds

SetFocus

SetFocusedControl

SetTextBuf

ShowModal

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

WantChildKey


TCustomDockForm.Create

TCustomDockForm	Methods

Creates an instance of TCustomDockForm.

constructor Create(AOwner: TComponent); override;

Description

AOwner is the dock form’s owner.

Create performs the following tasks:

Sets AutoScroll to False.

Sets BorderStyle to bsSizeToolWin.

Sets DockSite to True.

Sets FormStyle to fsStayOnTop.


TCustomDockForm.DoAddDockClient

TCustomDockForm	Methods

Performs actions when a control is docked to the dock form.

procedure DoAddDockClient(Client: TControl; const ARect: TRect); override;

Description

Client is the control being docked on the dock form.

ARect is the area in which Client is being docked.

DoAddDockClient sets the dock form’s caption to the client’s caption, if it is the first client. Then DoAddDockClient sets the Align property of the client to alClient and calls the inherited DoAddDockClient method.


TCustomDockForm.DoRemoveDockClient

TCustomDockForm	Methods

Performs actions when a control is undocked from the dock form.

procedure DoRemoveDockClient(Client: TControl); override;

Description

Client is the control being undocked.

DoRemoveDockClient calls the inherited DoRemoveDockClient method. Then, if the dock form contains no more clients, DoRemoveDockClient calls the Release method.


TCustomDockForm.GetSiteInfo

TCustomDockForm	Methods

Returns docking information for the dock form.

procedure GetSiteInfo(Client: TControl; var InfluenceRect: TRect; MousePos: TPoint); var CanDock: Boolean); override;

Description

GetSiteInfo overrides the inherited method, setting CanDock to True if the dock form contains one or more clients.


TCustomDockForm.Loaded

TCustomDockForm	Methods

Specifies actions to perform when the dock form is loaded.

procedure Loaded; override;

Description

Loaded calls the inherited method. Then Loaded sets the dock form’s active control, if possible.


Scope

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TScrollingWinControl

TCustomForm


TCustomEdit

Hierarchy	Properties	Methods	Events	See also

TCustomEdit is the base class from which all edit-box and memo controls are derived.

Unit

stdctrls

Description

TCustomEdit encapsulates the behavior common to all components for editing text by introducing methods and properties that provide

Basic text editing functions such as selecting text, modifying selected text, and case conversions.

Ability to respond to changes in the contents of the text.

Access control of the text for making it read-only or introducing a password character to hide the actual value.

Do not create instances of TCustomEdit. Use TCustomEdit as a base class when declaring control objects that permit the user to enter or modify text. Properties and methods of TCustomEdit provide basic behavior that descendant classes inherit as well as behavior that components can override to customize their behavior.


TCustomEdit properties

TCustomEdit	Alphabetically	Legend

In TCustomEdit

AutoSelect

AutoSize

BorderStyle

CanUndo

CharCase

HideSelection

MaxLength

Modified

OEMConvert

PasswordChar

ReadOnly

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomEdit properties

TCustomEdit	By object	Legend

Action

Align

Anchors

AutoSelect

AutoSize

BiDiMode

BorderStyle

BoundsRect

Brush

CanUndo

CharCase

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

HideSelection

Hint

HostDockSite

Left

LRDockWidth

MaxLength

Modified

Name

OEMConvert

Owner

Parent

ParentWindow

PasswordChar

ReadOnly

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TCustomEdit.AutoSelect

TCustomEdit	See also

Determines whether all the text in the edit control is automatically selected when the control gets focus.

property AutoSelect: Boolean;

Description

Set AutoSelect to select all the text when the edit control gets focus. AutoSelect only applies to single-line edit controls.

Use AutoSelect when the user is more likely to replace the text in the edit control than to append to it.


TCustomEdit.AutoSize

TCustomEdit	See also 	Example

Determines whether the height of the edit control automatically resizes to accommodate the text.

property AutoSize: Boolean;

Description

Use AutoSize to make the edit control adjust its size automatically so the client area accommodates the height of the text. When AutoSize is False, the edit control has a fixed height. When AutoSize is True, the size of the control is readjusted whenever a change occurs that could affect the height of the control, such as a change to the font or border style.

Note:	AutoSize only adjusts the height of the edit control. Even with AutoSize set to True, text in the edit control may appear truncated if it extends beyond the width of the control.


TCustomEdit.BorderStyle

TCustomEdit

Determines whether the edit control has a single line border around the client area.

property BorderStyle: TBorderStyle;

Description

Use BorderStyle to affect the sharpness with which the client area of the edit control stands out. BorderStyle can have a value of either bsSingle or bsNone. If BorderStyle is bsSingle, the edit control has a single-line border around the client area. If BorderStyle is bsNone, there will be no border.


TCustomEdit.CanUndo

TCustomEdit	See also

Indicates whether the edit control contains changes that can be backed out.

property CanUndo: Boolean;

Description

Read CanUndo to determine whether the user has made any changes to the text that can be undone by calling the Undo method.  This is useful when enabling or disabling menu items that correspond to these commands.


TCustomEdit.CharCase

TCustomEdit	See also

Determines the case of the text within the edit control.

type TEditCharCase = (ecNormal, ecUpperCase, ecLowerCase);

property CharCase: TEditCharCase;

Description

Use CharCase to force the contents of the edit control to assume a particular case. The possible values of CharCase are as follows:

Value	Meaning

ecLowerCase	The text is converted to lowercase.

ecNormal	The text appears in mixed case. It is not forced into any case.

ecUpperCase	The text is converted to uppercase.

When CharCase is set to ecLowerCase or ecUpperCase, the case of characters is converted as the user types them into the edit control. Changing the CharCase property to ecLowerCase or ecUpperCase changes the actual contents of the text, not just the appearance. Any case information is lost and can’t be recaptured by changing CharCase to ecNormal.


TCustomEdit.HideSelection

TCustomEdit	See also

Determines whether the visual indication of the selected text remains when focus shifts to another control.

property HideSelection: Boolean;

Description

Set HideSelection to False to provide visual feedback of the selected portion of the text even when the edit control does not have focus. Set HideSelection to True to show the selection only when the edit control has focus. HideSelection does not affect the actual value of the selection, only the visual indication. Always setting HideSelection to False can make forms with many edit controls look too busy.


TCustomEdit.MaxLength

TCustomEdit	See also

Specifies the maximum number of characters the user can enter into the edit control.

property MaxLength: Integer;

Description

Use MaxLength to limit the number of characters that can be entered into the edit control. A value of 0 indicates that there is no application-defined limit on the length.

Use MaxLength to limit the length of the text in an edit control if that text will be copied into a fixed-length buffer.

Note:	Setting MaxLength will not truncate the existing text, it merely prevents the user from adding more text after reaching the limit of MaxLength characters.

Note:	Even when MaxLength is 0, there may be limitations imposed by the operating system on the number of characters that may be entered into an edit control.


TCustomEdit.Modified

TCustomEdit	See also

Indicates whether the user edited the text of the edit control.

property Modified: Boolean;

Description

Use Modified to determine whether the Text property of the edit control changed. If an application directly alters the Text property of an edit control, it should set the Modified property to True.


TCustomEdit.OEMConvert

TCustomEdit	See also

Determines whether characters typed in the edit control are converted from ANSI to OEM and then back to ANSI.

property OEMConvert: Boolean;

Description

To ensure that any characters typed in the edit control can be unambiguously converted to the OEM character set, set OEMconvert to True. This causes all characters to be converted from ANSI to OEM and then back to ANSI as they are typed. Set OEMconvert to False to avoid the overhead of this conversion when it does not matter whether the text can be unambiguously mapped to an OEM string.

OEMConvert is most useful for edit controls used to enter file names when the application does not use Unicode file names.


TCustomEdit.PasswordChar

TCustomEdit	See also

Indicates the character, if any, to display in place of the actual characters typed in the control.

property PasswordChar: Char;

Description

Use the PasswordChar property to create an edit control that displays a special character in place of any entered text. If PasswordChar is set to the null character (ANSI character zero), the edit control displays its text normally. If PasswordChar is any other character, the edit control displays PasswordChar in place of each character typed. PasswordChar affects the appearance of the edit control only. The value of the Text property reflects the actual characters that are typed.


TCustomEdit.ReadOnly

TCustomEdit	See also

Determines whether the user can change the text of the edit control.

property ReadOnly: Boolean;

Description

To restrict the edit control to display only, set the ReadOnly property to True. Set ReadOnly to False to allow the contents of the edit control to be edited.

Setting ReadOnly to True ensures that the text is not altered, while still allowing the user to select text. The selected text can then be manipulated by the application, or copied to the Clipboard.


TCustomEdit.SelLength

TCustomEdit	See also 	Example

Specifies the number of characters that are selected.

property SelLength: Integer;

Description

Read SelLength to determine the length, in characters, of the selected text. Set SelLength to change the selection to consist of the first SelLength characters starting at SelStart.

Note:	Setting SelLength to a value greater than the number of characters from SelStart to the end of the text results in the selection of all characters from SelStart to the end of the text. Reading SelLength immediately after setting it to a value greater than the number of available characters returns the number of characters actually selected, not the value that was just set.


TCustomEdit.SelStart

TCustomEdit	See also 	Example

Specifies the position of the first selected character in the text.

property SelStart: Integer;

Description

Read SelStart to determine the position of the first selected character, where 0 indicates the first character. If there is no selected text, SelStart indicates the position of the cursor. Set SelStart to remove the current selection and position the cursor just before the indicated character.

To select a particular range of the text, first set SelStart to position the cursor, and then set SelLength to extend the selection.


TCustomEdit.SelText

TCustomEdit	See also 	Example

Specifies the selected portion of the edit control’s text.

property SelText: string;

Description

Read SelText to determine the value of the selected text. Set SelText to replace the selected text with a new string. If there is no selection, but the edit control has focus, set SelText to insert a new string into the text at the cursor.


TCustomEdit events

TCustomEdit	Alphabetically	Legend

In TCustomEdit

OnChange


TCustomEdit events

TCustomEdit	By object	Legend

OnChange


TCustomEdit.OnChange

TCustomEdit	See also

Occurs when the text for the edit control may have changed.

property OnChange: TNotifyEvent;

Description

Write an OnChange event handler to take specific action whenever the text for the edit control may have changed. Use the Modified property to see if a change actually occurred. The Text property of the edit control will already be updated to reflect any changes. This event provides the first opportunity to respond to modifications that the user types into the edit control.


TCustomEdit methods

TCustomEdit	Alphabetically	Legend

In TCustomEdit

Change

Clear

ClearSelection

ClearUndo

CopyToClipboard

Create

CreateParams

CreateWindowHandle

CreateWnd

CutToClipboard

DefaultHandler

DestroyWnd

DoSetMaxLength

GetSelLength

GetSelStart

GetSelText

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelLength

SetSelStart

SetSelTextBuf

Undo

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomEdit methods

TCustomEdit	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

Change

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClearSelection

ClearUndo

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

Create

CreateParams

CreateParented

CreateParentedControl

CreateWindowHandle

CreateWnd

CutToClipboard

DefaultHandler

Destroy

DestroyComponents

Destroying

DestroyWnd

DisableAlign

Dispatch

Dock

DockDrop

DoSetMaxLength

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetSelLength

GetSelStart

GetSelText

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelLength

SetSelStart

SetSelTextBuf

SetTextBuf

Show

Undo

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TCustomEdit.Change

TCustomEdit	See also

Generates an OnChange event.

procedure Change; dynamic;

Description

Applications do not call the Change method directly. It is triggered automatically by Windows events. Change is exposed as a protected method so that derived classes can make additional responses when the text changes beyond invoking the OnChange event handler. If Derived classes that override the Change method do not call the inherited method, the OnChange event handler will not be called.


TCustomEdit.Clear

TCustomEdit	See also

Deletes all text from the edit control.

procedure Clear; virtual;

Description

Use Clear to replace the Text property with an empty string. Clear removes all text, not just the selected text. To remove just the selected text, use ClearSelection.


TCustomEdit.ClearSelection

TCustomEdit	See also

Removes the selected text from the edit control.

procedure ClearSelection;

Description

Use ClearSelection to delete the selected text from the edit control. If no text is selected, ClearSelection does nothing. If all of the text is selected, ClearSelection clears all text, like the Clear method.

Note:	Calling ClearSelection does the same thing as sending the edit control a WM_CLEAR message.


TCustomEdit.ClearUndo

TCustomEdit	See also

Clears the undo buffer so that no changes to the text can be backed out.

procedure ClearUndo;

Description

Use ClearUndo to commit changes to the Text property.  After calling ClearUndo, the CanUndo property is False and the Undo method does nothing.


TCustomEdit.CopyToClipboard

TCustomEdit	See also 	Example

Copies the selected text in the edit control to the Clipboard in CF_TEXT format.

procedure CopyToClipboard;

Description

Use CopyToClipboard to replace the contents of the Clipboard with the selected text. CopyToClipbard does not clear the Clipboard if no text is selected. If no text is selected, CopyToClipboard does nothing.

Note:	Calling CopyToClipboard does the same thing as sending the edit control a WM_COPY message.


TCustomEdit.Create

TCustomEdit	See also	Example

Creates an instance of TCustomEdit.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TCustomEdit.

After calling the inherited constructor, Create initializes

•	AutoSelect to True.

•	AutoSize to True.

•	BorderStyle to bsSingle.

•	ControlStyle to [csClickEvents, csDoubleClicks, csFixedHeight, csSetCaption].

•	Height and Width to 25 and 121.

•	HideSelection to True.

•	ParentColor to False.

•	TabStop to True.

Derived objects that override the Create method should call the inherited Create before performing any additional initialization.


TCustomEdit.CreateParams
TCustomEdit.

TCustomEdit	See also

Initializes a window-creation parameter record passed in the Params parameter.

procedure CreateParams(var Params: TCreateParams); override;

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle. TCustomEdit overrides the inherited method to specify a scrollable single-line edit control that reflects the current values of the BorderStyle, HideSelections, PasswordChar, and ReadOnly properties.


TCustomEdit.CreateWindowHandle

TCustomEdit	See also

Creates a Windows control to represent the control.

procedure CreateWindowHandle(const Params: TCreateParams); override;

Description

CreateWindowHandle calls the inherited CreateWindowHandle method after working around a Win95 bug involving setting the read-only style on machines with Far East locales.


TCustomEdit.CreateWnd

TCustomEdit	See also

Creates a Windows control corresponding to the edit control.

procedure CreateWnd; override;

Description

CreateWnd is called when the edit control is created, and whenever a change to the edit control requires the window to be recreated. After calling the inherited method, CreateWnd sends the newly created window messages to enforce the MaxLength and PasswordChar properties.


TCustomEdit.CutToClipboard

TCustomEdit	See also 	Example

Copies the selected text to the Clipboard in CF_TEXT format and then deletes the selection.

procedure CutToClipboard;

Description

Use CutToClipboard to replace the contents of the Clipboard with the selected text while clearing the selected text. If no text is selected, CutToClipboard does nothing.


TCustomEdit.DefaultHandler

TCustomEdit	See also

Provides message handling for all messages that the control does not fully process itself.

procedure DefaultHandler(var Message); override;

Description

Override DefaultHandler to change the default message handling for the edit control. The Message parameter can be cast to a TMessage type, to obtain the WParam, LParam, and Result of the message. If the Result of the message is non-zero, the message has already been handled. Set the Result field to a non-zero value to prevent further processing of the message by the inherited method.

Calling inherited in a message-handling method results in a call to the ancestor's DefaultHandler method if that ancestor does not specify a handler for the message being handled.


TCustomEdit.DestroyWnd

TCustomEdit	See also

Destroys the Windows control that corresponds to the edit control.

procedure DestroyWnd; override;

Description

The Windows control for the edit box can be temporarily destroyed and recreated in order to set properties that require changing the window creation parameters.  When this happens, DestroyWnd is called.

Before the window is destroyed, DestroyWnd saves a copy of any properties that are needed to recreate the window after it is destroyed.


TCustomEdit.DoSetMaxLength

TCustomEdit	See also

Sets the MaxLength property.

procedure DoSetMaxLength(Value: Integer); virtual;

Description

DoSetMaxLength is the property access function for the MaxLength property. It is exposed as a protected method so that descendants of TCustomEdit can customize the implementation of the MaxLength property.

DoSetMaxLength sends an EM_LIMITTEXT message to the window of the edit control.


TCustomEdit.GetSelLength

TCustomEdit	See also

Returns the SelLength property.

function GetSelLength: Integer; virtual;

Description

GetSelLength is the property access function for the SelLength property. It is exposed as a protected method so that descendants of TCustomEdit can customize the implementation of the SelLength property.

GetSelLength sends an EM_GETSEL message to the window of the edit control and returns the difference between the starting position and the ending position.


TCustomEdit.GetSelStart

TCustomEdit	See also

Returns the SelStart property.

function GetSelStart: Integer; virtual;

Description

GetSelStart is the property access method for the SelStart property. It is exposed as a protected method so that descendants of TCustomEdit can customize the implementation of the SelStart property.

GetSelLength sends an EM_GETSEL message to the window of the edit control and returns the starting position.


TCustomEdit.GetSelText

TCustomEdit	See also

Returns the SelText property.

function GetSelText: string; virtual;

Description

GetSelText is the property access method for the SelText property. It is exposed as a protected method so that descendants of TCustomEdit can customize the implementation of the SelText property.


TCustomEdit.GetSelTextBuf

TCustomEdit	See also 	Example

Copies the selected text into a buffer and returns the number of characters copied.

function GetSelTextBuf(Buffer: PChar; BufSize: Integer): Integer; virtual;

Description

Use GetSelTextBuf to copy the selected text into a character buffer. If there is no selection, the buffer receives an empty string. If the selection contains more than (BufSize - 1) characters, only the first (BufSize - 1) characters are copied. GetSelTextBuf returns the number of characters that were actually copied into the buffer.


TCustomEdit.PasteFromClipboard

TCustomEdit	See also 	Example

Pastes the contents of the Clipboard into edit control, replacing the current selection.

procedure PasteFromClipboard;

Description

Use PasteFromClipboard to replace the selected text with the contents of the Clipboard, or, if no text is selected, to insert the contents of the Clipboard at the cursor. If the Clipboard is empty, or if it does not contain anything in CF_TEXT format, PasteFromClipbard does nothing.

Note:	Calling PasteFromClipboard does the same thing as sending the edit control a WM_PASTE message.


TCustomEdit.SelectAll

TCustomEdit	See also 	Example

Selects all text in the edit control.

procedure SelectAll;

Description

Use SelectAll to select all text in the edit control. To select only part of the text, use the SelStart and SelLength properties.


TCustomEdit.SetSelLength

TCustomEdit	See also

Sets the SelLength property.

procedure SetSelLength(Value: Integer); virtual;

Description

SetSelLength is the property access method for the SelLength property. It is exposed as a protected method so that descendants of TCustomEdit can customize the implementation of the SelLength property.

SetSelLength sends an EM_SETSEL message to the window of the edit control, specifying a selection that begins at SelStart and ends at SelStart + Value.


TCustomEdit.SetSelStart

TCustomEdit	See also

Sets the SelStart property.

procedure SetSelStart(Value: Integer); virtual;

Description

SetSelStart is the property access method for the SelStart property. It is exposed as a protected method so that descendants of TCustomEdit can customize the implementation of the SelStart property.

SetSelLength sends an EM_SETSEL message to the window of the edit control to position the cursor on the position indicated by Value.


TCustomEdit.SetSelTextBuf

TCustomEdit	See also

Replaces the selected text with a null-terminated string.

procedure SetSelTextBuf(Buffer: PChar);

Description

Use SetSelTextBuf to replace the current selection by the contents of the null-terminated string pointed to by Buffer. If no text is selected, the contents of Buffer are inserted at the cursor. SetSelTextBuf does the same thing as setting the SelText property, except that it takes a PChar rather than a string.


TCustomEdit.Undo

TCustomEdit	See also

Backs out all changes in the undo buffer.

procedure Undo;

Description

Call Undo to cancel all changes made to the Text property since the last call to the ClearUndo method. If ClearUndo was never called, Undo backs out all changes.

To determine whether there are any changes in the undo buffer, check the CanUndo property.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomForm

Hierarchy	Properties	Methods	Events	See also

TCustomForm is the abstract base class from which to derive a window such as a form or dialog.

Unit

forms

Description

Derive from TCustomForm to create a custom window. The TCustomForm descendant can contain other objects, such as TButton, TCheckBox, and TComboBox objects.


TCustomForm properties

TCustomForm	Alphabetically	Legend

In TCustomForm

Active

ActiveControl

ActiveMDIChild

ActiveOleControl

BorderIcons

BorderStyle

Canvas

ClientHandle

ClientHeight

ClientRect

ClientWidth

DefaultMonitor

Designer

DropTarget

Floating

FormState

FormStyle

HelpFile

Icon

KeyPreview

MDIChildCount

MDIChildren

Menu

ModalResult

Monitor

ObjectMenuItem

OldCreateOrder

OleFormObject

Parent

ParentBiDiMode

PixelsPerInch

Position

PrintScale

Scaled

TileMode

Visible

WindowMenu

WindowState

Derived from TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

Brush

ClientOrigin

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiModeBoundsRect

Caption

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent	ParentFont

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomForm properties

TCustomForm	By object	Legend

Action

Active

ActiveControl

ActiveMDIChild

ActiveOleControl

Align

Anchors

AutoScroll

BiDiMode

BorderIcons

BorderStyle

BoundsRect

Brush

Canvas

Caption

ClientHandle

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DefaultMonitor

Designer

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DropTarget

Enabled

Floating

FloatingDockSiteClass

Font

FormState

FormStyle

Handle

Height

HelpContext

HelpFile

Hint

HorzScrollBar

HostDockSite

Icon

KeyPreview

Left

LRDockWidth

MDIChildCount

MDIChildren

Menu

ModalResult

Monitor

Name

ObjectMenuItem

OldCreateOrder

OleFormObject

Owner

Parent

ParentBiDiMode

ParentWindow

PixelsPerInch

PopupMenu

Position

PrintScale

Scaled

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

TileMode

Top

UndockHeight

UndockWidth

VCLComObject

VertScrollBar

Visible

VisibleDockClientCount

Width

WindowMenu

WindowProc

WindowState


TCustomForm.Active

TCustomForm	See also

Specifies whether the form has focus.

property Active: Boolean;

Description

Use Active to determine whether the form has focus.  The Active Form receives all keyboard input.  If it has a title bar, it is drawn using the active colors specified in the Control panel.

If Active is True , the form has focus; if Active is False, the form does not have focus.


TCustomForm.ActiveControl

TCustomForm	See also 	Example

Specifies the control that has focus on the form.

property ActiveControl: TWinControl;

Description

Use ActiveControl to get or set the control that has focus on the form. Only one control can have focus at a given time in an application.

If the form does not have focus, ActiveControl is the control on the form that will receive focus when the form receives focus.

Note:	When focus shifts to another control, ActiveControl is updated before the OnExit event occurs.


TCustomForm.ActiveMDIChild

TCustomForm	See also

Specifies the MDI child that has focus.

property ActiveMDIChild: TForm;

Description

Use ActiveMDIChild to get the MDI child that has focus.

If the form is not an MDI parent (that is, if the FormStyle property of the form is not fsMDIForm), ActiveMDIChild returns nil.


TCustomForm.ActiveOleControl

TCustomForm	See also

Specifies the OLE control on the form that reacts to changes in focus.

property ActiveOLEControl: TWinControl;

Description

Use ActiveOLEControl to get or set an OLE control on the form that reacts to changes in focus.

If ActiveOLEControl is not nil, the user interface for the specified OLE control is deactivated when it is not focused. Also, when the form receives or loses focus, the document window for the specified OLE control is activated or deactivated respectively.


TCustomForm.BorderIcons

TCustomForm	See also 	Example

Specifies which icons appear on the title bar of the form.

type TBorderIcon = (biSystemMenu, biMinimize, biMaximize, biHelp);

TBorderIcons = set of TBorderIcon;

property BorderIcons:TBorderIcons;

Description

Use BorderIcons to get or set the icons that appear on the title bar of the form. BorderIcons can include any of the following TBorderIcons values:

Value	Meaning

biSystemMenu	The form has a Control menu (also known as a System menu).

biMinimize	The form has a Minimize button

biMaximize	The form has a Maximize button

biHelp	If BorderStyle is bsDialog or biMinimize and biMaximize are excluded, a question mark appears in the form's title bar and when clicked, the cursor changes to crHelp; otherwise,no question mark appears.

Note:	Certain combinations of the BorderIcons and BorderStyle properties are mutually exclusive. For example, BorderIcons biMax, biMin with BorderStyle of bsDialog are mutually exclusive.


TCustomForm.BorderStyle

TCustomForm	See also

Specifies the appearance and behavior of the form border.

property BorderStyle: TFormBorderStyle;

Description

Use BorderStyle to get or set the appearance and behavior of the form border. BorderStyle can be any of the following TFormBorderStyle values:

Value	Meaning

bsDialog	Not resizeable; standard dialog box border

bsSingle	Not resizeable; single-line border

bsNone	Not resizeable; no visible border line

bsSizeable	Standard resizeable border

bsToolWindow	like bsSingle but with a smaller caption

bsSizeToolWin	like bsSizeable with a smaller caption

Note:	Changing the border style of an MDI child form to bsDialog or bsNone has no effect.


TCustomForm.Canvas

TCustomForm	See also 	Example

Provides access to the drawing area of the form.

property Canvas: TCanvas;

Description

Use TCanvas to draw on the client area of the form. Canvas is often used in the OnPaint event handler.


TCustomForm.ClientHandle

TCustomForm	See also

Provides access to the handle of the form’s internal MDI client window.

property ClientHandle: HWND;

Description

Use ClientHandle to get the handle for the form’s internal MDI client window.

ClientHandle is meaningful only if the form is an MDI parent (that is, if the form’s FormStyle property is set to fsMDIForm).

Note:	Use the Handle property to get the handle to the form window itself.


TCustomForm.ClientHeight

TCustomForm	See also	Example

Specifies the height (in pixels) of the form’s client area.

property ClientHeight: Integer;

Description

Use ClientHeight to determine the height (in pixels) of the form’s client area. The client area is the usable area inside the form's border, excluding the title bar, scroll bars, and so on.

Set ClientHeight to change the height of the form’s window based on the desired client area. To change the height of the form’s window based on the total size of the window (including the border, menu, status bar and so on), use the Height property instead.


TCustomForm.ClientRect

TCustomForm	See also

Specifies the dimensions of the form’s client area.

property ClientRect: TRect;

Description

Use ClientRect to get or set the form’s client area. The client area is the usable area inside the form's border.

ClientRect is equivalent to Rect(0,0,ClientWidth, ClientHeight).


TCustomForm.ClientWidth

TCustomForm	See also 	Example

Specifies the width (in pixels) of the form’s client area.

property ClientWidth: Integer;

Description

Use ClientWidth to determine the width (in pixels) of the form’s client area. The client area is the usable area inside the form's border. Set ClientWidth to change the width of the form’s window based on the desired client area.  To change the width of the form’s window based on the total size of the window (including the border, status bar and so on), use the Width property instead.


TCustomForm.DefaultMonitor

TCustomForm	See also

Specifies the monitor on which the form appears.

type TDefaultMonitor = (dmDesktop, dmPrimary, dmMainForm, dmActiveForm);

property DefaultMonitor: TDefaultMonitor;

Description

Use DefaultMonitor to associate a form with a particular monitor in a multi-monitor application. The following table lists the possible values:

Value	Meaning

dmDesktop	No attempt is made to position the form on a specific monitor.

dmPrimary	The form is positioned on the first monitor listed in the global screen object’s Monitors property.

dmMainForm	The form appears on the same monitor as the application’s main form.

dmActiveForm	The form appears on the same monitor as the currently active form.

Note:	DefaultMonitor has no effect if the application does not have a main form.


TCustomForm.Designer

TCustomForm	See also

Specifies the designer interface for the form.

property Designer: IDesigner;

Description

The Designer property is used internally at design time. Never assign a value to this property. This is done automatically by the form designer. Only use this property when designing classes for use in the form designer, such as property editors and component editors.


TCustomForm.DropTarget

TCustomForm	See also

Specifies whether the form is the target of a drag-and-drop operation.

property DropTarget: Boolean;

Description

Use DropTarget to determine whether the form is currently the target of a drag-and-drop operation.


TCustomForm.Floating

TCustomForm	See also

Indicates whether the form is docked to another window.

property Floating: Boolean;

Description

Read Floating to determine whether the form is a free-floating window or docked to another window. Floating is True when the form window is not docked. Floating is False if the form is docked in another window.


TCustomForm.FormState

TCustomForm	See also

Indicates transitional state information about the form.

type TFormState = set of (fsCreating, fsVisible, fsShowing, fsModal, fsCreatedMDIChild, fsActivated);

property FormState: TFormState;

Description

Read FormState to determine the state of the form. FormState indicates when the form is in various transitional states or when certain Windows operations have occurred. The following table lists the values that can be included in a form’s state:

Value	Meaning

fsCreating	The form’s constructor is currently executing.

fsVisible	The form’s Windows is visible. This state is used to update the Visible property.

fsShowing	The form’s WindowState property is changing. This state is used to prevent WindowState changes from interfering with a transition that is in progress.

fsModal	The form was created as a modal window.

fsCreatedMDIChild	The form is an MDI parent window. This state is only set once the MDI client window has been created.

fsActivated	The form has received a CM_ACTIVATE message (because it received focus or the application became active) but has not yet called the Activate method to generate an OnActivate event.


TCustomForm.FormStyle

TCustomForm	See also	Example

Determines the form’s style.

type TFormStyle = (fsNormal, fsMDIChild, fsMDIForm, fsStayOnTop);

property FormStyle: TFormStyle;

Description

Use FormStyle to get or set the form’s style. FormStyle is one of the following values:

Value	Meaning

fsNormal	The form is neither an MDI parent window nor an MDI child window.

fsMDIChild	The form is an MDI child window.

fsMDIForm	The form is an MDI parent window.

fsStayOnTop	This form remains on top of the desktop and of other forms in the project, except any others that also have FormStyle set to fsStayOnTop. If one fsStayOntop form launches another, neither form will consistently remain on top.

If the form is the main form of an MDI application, its FormStyle property must be set to fsMDIForm.

Note:	It is not advisable to change FormStyle at runtime.


TCustomForm.HelpFile

TCustomForm	See also

Specifies the name of the file the application uses to display Help.

property HelpFile: string;

Description

Use HelpFile for forms that have a help file to use with the Windows Help system. Windows selects Help topics from the specified file.


TCustomForm.Icon

TCustomForm	See also 	Example

Specifies the icon that appears when the form is minimized.

property Icon: TIcon;

Description

Set the Icon property to provide an icon for the form. If Icon is not set, Windows provides a default icon when the form is minimized.


TCustomForm.KeyPreview

TCustomForm	See also 	Example

Specifies whether the form should receive keyboard events before the active control.

property KeyPreview: Boolean;

Description

If KeyPreview is True, keyboard events occur on the form before they occur on the active control. (The active control is specified by the ActiveControl property.)

If KeyPreview is False, keyboard events occur only on the active control.

Navigation keys (Tab, BackTab, the arrow keys, and so on) are unaffected by KeyPreview because they do not generate keyboard events.

KeyPreview is False by default.


TCustomForm.MDIChildCount

TCustomForm	See also 	Example

Specifies the number of open MDI child forms.

property MDIChildCount: Integer;

Description

Use MDIChildCount to get the number of open MDI child forms.

MDIChildCount is meaningful only if the form is an MDI parent (that is, if the form’s FormStyle property is set to fsMDIForm).


TCustomForm.MDIChildren

TCustomForm	See also 	Example

Provides indexed access to all MDI child forms.

property MDIChildren[I: Integer]: TForm;

Description

Use MDIChildren to access a child form.

I is the index of the child form to access. The order of MDI children changes as different MDI forms are activated. Initially, forms are listed in creation order, with new forms being added to the end of the array. Whenever an MDI child is activated, however, it moves to the front of the list. Thus, use I to index over all forms in the array, but not to refer to a specific form.

MDIChildren is meaningful only if the form is an MDI frame (that is, if the form’s FormStyle property is set to fsMDIForm).


TCustomForm.Menu

TCustomForm	See also	Example

Specifies the form’s main menu.

property Menu: TMainMenu;

Description

Use Menu to get or set the form’s main menu. At design time, Menu is set to the first TMainMenu component added to the form.


TCustomForm.ModalResult

TCustomForm	See also 	Example

Represents the return value of a form that is used as a modal dialog.

property ModalResult: TModalResult;

Description

Use ModalResult to close the form when it is displayed modally.

By default, ModalResult is mrNone. Set ModalResult to any nonzero value to close the form. The value assigned to ModalResult becomes the return value of the ShowModal function call used to display the form.

Note:	This property is modified automatically by some components such as the TButton object. See TButton.ModalResult for details.


TCustomForm.Monitor

TCustomForm	See also

Provides access to the monitor on which the form appears.

property Monitor: TMonitor;

Description

Use Monitor to access information about the monitor on which the form appears if the application runs on a multi-monitor system. The monitor is determined by the DefaultMonitor property.


TCustomForm.ObjectMenuItem

TCustomForm	See also

Represents an OLE object menu item that reacts to selections of OLE objects.

property ObjectMenuItem: TMenuItem;

Description

Use ObjectMenuItem to get or set a menu item that becomes enabled or disabled when an OLE object on the form is selected or unselected respectively.

The OLE object menu item can be used for standard OLE commands, such as Activate or Convert. (The implementations of these commands are provided by the OLE server.)


TCustomForm.OldCreateOrder

TCustomForm	See also

Specifies when OnCreate and OnDestroy events occur.

property OldCreateOrder: Boolean;

Description

When OldCreateOrder is False (the default) the OnCreate event occurs after all constructors are finished (from the AfterConstruction method) and the OnDestroy event occurs before any destructors are called (from the BeforeDestruction method).

This timing differs from Delphi version 3 and previous, where the OnCreate event occurred when the TCustomForm constructor executed and the OnDestroy event occurred when the TCustomForm destructor executed. Applications that require the OnCreate event and OnDestroy events to occur from the constructor and destructor of the form can set OldCreateOrder to True.


TCustomForm.OleFormObject

TCustomForm	See also

Specifies the IOleForm interface for an in-place OLE object contained in the form.

property OleFormObject: IOleForm;

Description

OleFormObject is used to communicate resize and destroy notifications when a form is used as a frame for an in-place OLE object.


TCustomForm.Parent

TCustomForm	See also

Specifies the windowed control that contains the form.

property Parent: TWinControl;

Description

Use the Parent property to embed the form in another control (usually another form). Changing the Parent property moves the form to a new container.

Many forms do not have a Parent. For example, forms that appear directly on the Windows desktop have Parent set to nil.


TCustomForm.ParentBiDiMode

TCustomForm	See also

Specifies whether the control uses its parent’s BiDiMode.

property ParentBiDiMode: Boolean;

Description

If the Parent property is nil and the ParentBiDiMode is True, the form’s BiDiMode property is set equal to the global Application object’s BiDiMode property.  If the Parent property is not nil and the ParentBiDiMode is True, then the form’s BiDiMode property is set equal to the parent’s BiDiMode property.


TCustomForm.PixelsPerInch

TCustomForm	See also

Represents the proportion of the font on the system on which the form was designed.

property PixelsPerInch: Integer;

Description

Use PixelsPerInch at runtime to change how the form is scaled to the current screen resolution. If PixelsPerInch is changed from its default value, the form will not have the same proportion on every screen resolution.

At design time, PixelsPerInch is set automatically when the form is saved. Changes to PixelsPerInch made in the Object Inspector only affect the form at runtime.

The form’s Scaled property must be True for PixelsPerInch to have an effect.


TCustomForm.Position

TCustomForm	See also

Represents the size and placement of the form.

type TPosition = (poDesigned, poDefault, poDefaultPosOnly, poDefaultSizeOnly, poScreenCenter, poDesktopCenter, poMainFormCenter, poOwnerFormCenter);

property Position: TPosition;

Description

Use Position to get or set the size and placement of the form. Position can have one of the following TPosition values:

Value	Meaning

poDesigned	The form appears positioned on the screen and with the same height and width as it had at design time.

poDefault	The form appears in a position on the screen and with a height and width determined by Windows. Each time you run the application, the form moves slightly down and to the right. The right side of the form is always near the far right side of the screen, and the bottom of the form is always near the bottom of the screen, regardless of the screen's resolution.

poDefaultPosOnly	The form displays with the size you created it at design time, but Windows chooses its position on the screen. Each time you run the application, the form moves slightly down and to the right. When the form can no longer move down and to the right and keep the same size while remaining entirely visible on the screen, the form displays at the top-left corner of the screen.

poDefaultSizeOnly	The form appears in the position you left it at design time, but Windows chooses its size. The right side of the form is always near the far right side of the screen, and the bottom of the form is always near the bottom of the screen, regardless of the screen's resolution.

poScreenCenter	The form remains the size you left it at design time, but is positioned in the center of the screen. In multi-monitor applications, the form may be moved from this center position so that it falls entirely on one monitor, as specified by the DefaultMonitor property.

poDesktopCenter	The form remains the size you left it at design time, but is positioned in the center of the screen. No adjustments are made for multi-monitor applications.

poMainFormCenter	The form remains the size you left it at design time, but is positioned in the center of the application’s main form. No adjustments are made for multi-monitor applications. This position should only be used with secondary forms. If set for a main form, it acts like poScreenCenter.

poOwnerFormCenter	The form remains the size you left it at design time, but is positioned in the center of the form specified by the Owner property. If the Owner property does not specify a form, this position acts like poMainFormCenter.


TCustomForm.PrintScale

TCustomForm	See also

Represents the proportions of a printed form.

type TPrintScale = (poNone, poProportional, poPrintToFit);

property PrintScale: TPrintScale;

Description

Use PrintScale to get or set the proportions of the printed form. PrintScale can have one of the following TPrintScale values:

Value	Meaning

poNone	No special scaling occurs; therefore, the printed form and how the form appears onscreen may appear squished or stretched.

poProportional	The form is printed so that the printed image is approximately the same visible size as on the screen (WYSIWYG). The form image is scaled so that the printed image is approximately the same visible size as on the screen.

poPrintToFit	The form is printed using the same screen proportions, but in a size that just fits the printed page.


TCustomForm.Scaled

TCustomForm	See also

Specifies whether the form is sized according to the value of the PixelsPerInch property.

property Scaled: Boolean;

Description

If Scaled is True, and the value of PixelsPerInch differs from the current system settings, the form is scaled to a new size. If Scaled is False, no scaling occurs.


TCustomForm.TileMode

TCustomForm	See also	Example

Represents how MDI child forms are arranged when the Tile method is called.

type TTileMode = (tbHorizontal, tbVertical);

property TileMode: TTileMode;

Description

TileMode can have one of the following TTileMode values:

Value	Meaning

tbHorizontal	Each form stretches across the width of the parent form

tbVertical	Each form stretches along the height of the parent form

TileMode is meaningful only if the form is an MDI child (that is, if the form’s FormStyle property is set to fsMDIChild).


TCustomForm.Visible

TCustomForm	See also 	Example

Indicates whether the form is visible.

property Visible: Boolean;

Description

Use Visible to determine whether the form is visible.

If Visible is True, the form is visible unless it is completely obscured by other forms. If Visible is False, the form is not visible.

The Show and ShowModal methods set Visible to True and bring the form to the front of all open windows.


TCustomForm.WindowMenu

TCustomForm	See also

Specifies the Window menu for an MDI parent form.

property WindowMenu: TMenuItem;

Description

Use WindowMenu to get or set the Window menu for an MDI parent form. The Window menu is a standard menu in MDI applications. It contains commands that let the user manage the windows in the application. Menu items usually include Cascade, Arrange Icons, Tile, and so on.

The Window menu also lists (at the bottom) the child windows that are currently open in the application. When the user selects one of these windows from the menu, the window becomes the active window in the application.

Although this menu is commonly called the Window menu, it can have any name that corresponds to an existing menu item on the menu bar. The names of open child forms are merged onto the menu automatically at run-time.

WindowMenu is meaningful only if the form is an MDI parent (that is, if the form’s FormStyle property is set to fsMDIForm).


TCustomForm.WindowState

TCustomForm	See also

Represents how the form appears on the screen.

property WindowState: TWindowState;

Description

Use WindowMenu to get or set whether the form appears on the screen in its minimized, maximized, or normal state.


TCustomForm events

TCustomForm	Alphabetically	Legend

In TCustomForm

OnActivate

OnClose

OnCloseQuery

OnCreate

OnDeactivate

OnDestroy

OnHelp

OnHide

OnPaint

OnShortCut	OnShow

Derived from TWinControl

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnCanResize

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnMouseDown

OnMouseMove

OnMouseUp

OnResize


TCustomForm events

TCustomForm	By object	Legend

OnActivate

OnCanResize

OnClick

OnClose

OnCloseQuery

OnCreate

OnDblClick

OnDeactivate

OnDestroy

OnDragDrop

OnDragOver

OnHelp

OnHide

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnPaint

OnResize

OnShortCut

OnShow


TCustomForm.OnActivate

TCustomForm	See also 	Example

Occurs when the form becomes active.

property OnActivate: TNotifyEvent;

Description

Use OnActivate to perform special processing when the form receives focus. A form becomes active when focus is transferred to it (when the user clicks on the form, for example).

For MDI child windows (forms with FormStyle property values of fsMDIChild), OnActivate occurs only when focus is shifted from one child to another. If focus is shifted from a non-MDI child window to an MDI child, the OnActivate event occurs for the MDI parent form.

Note:	The OnActivate event of the application (TApplication), not the form, occurs when Windows switches control from another application.


TCustomForm.OnClose

TCustomForm	See also 	Example

Occurs when the form closes.

type

  TCloseAction = (caNone, caHide, caFree, caMinimize);

  TCloseEvent = procedure(Sender: TObject; var Action: TCloseAction) of object;

property OnClose: TCloseEvent;

Description

Use OnClose to perform special processing when the form closes. The OnClose event specifies which event handler to call when a form is about to close. The handler specified by OnClose might, for example, test to make sure all fields in a data-entry form have valid contents before allowing the form to close.

A form is closed by the Close method or when the user chooses Close from the form's system menu.

The TCloseEvent type points to a method that handles the closing of a form. The value of the Action parameter determines if the form actually closes. These are the possible values of Action:

Value	Meaning

caNone	The form is not allowed to close, so nothing happens.

caHide	The form is not closed, but just hidden. Your application can still access a hidden form.

caFree	The form is closed and all allocated memory for the form is freed.

caMinimize	The form is minimized, rather than closed. This is the default action for MDI child forms.

If a form is an MDI child form, and its BorderIcons property is biMinimize, then the default Action is caMinimize. If a MDI child form does not have these settings, the default Action is caNone, meaning that nothing happens when the user attempts to close the form.

If a form is an SDI child form, Action defaults to caHide.

To close and form and free it in an OnClose event, set Action to caFree.


TCustomForm.OnCloseQuery

TCustomForm	See also 	Example

Occurs when the Close method is called or when the user chooses Close from the form's System menu.

type TCloseQueryEvent = procedure(Sender: TObject; var CanClose: Boolean) of object;

property OnCloseQuery: TCloseQueryEvent;

Description

Use OnCloseQuery to specify the conditions under which the form can close. An OnCloseQuery event handler contains a Boolean CanClose variable that determines whether a form is allowed to close. Its default value is True.

You can use an OnCloseQuery event handler to ask users if they are sure they really want the form closed immediately. For example, you can use the handler to display a message box that prompts the user to save a file before closing the form.

The TCloseQueryEvent type points to the method that determines whether a form can be closed. The value of the CanClose parameter determines if the form can close or not.


TCustomForm.OnCreate

TCustomForm	See also 	Example

Occurs when the form is created.

property OnCreate: TNotifyEvent;

Description

Use OnCreate to perform special processing when the form is created and is invoked by TCustomForm’s constructor. Either implement this event or override the constructor of the form; do not do both. Any objects created in the OnCreate event should be freed by the OnDestroy event.

When a form is being created and its Visible property is True, the following events occur in the order listed:

1. OnCreate
2. OnShow
3. OnActivate
4. OnPaint


TCustomForm.OnDeactivate

TCustomForm	See also

Occurs when the form loses focus.

property OnDeactivate: TNotifyEvent;

Description

Use OnDeactivate to perform special processing when the form transitions from being the active form to another form in the same application becoming the active form. If activation goes to another application, this event is not triggered. To determine if another application has become active, Use the TApplication object’s OnDeactivate event.


TCustomForm.OnDestroy

TCustomForm	See also 	Example

Occurs when the form is destroyed.

property OnDestroy: TNotifyEvent;

Description

Use OnDestroy to perform special processing when the form is destroyed. Either implement this event or override the destructor of the class, but not both. This event should destroy any objects created in the OnCreate event.


TCustomForm.OnHelp

TCustomForm	See also

Occurs when the form receives a request for help.

type THelpEvent = function (Command: Word; Data: Longint; var CallHelp: Boolean): Boolean of object;

property OnHelp: THelpEvent;

Description

Use OnHelp to write an event handler to perform special processing when help is requested.


TCustomForm.OnHide

TCustomForm	See also 	Example

Occurs when the form is hidden (that is, when its Visible property is set to False).

property OnHide: TNotifyEvent;

Description

Use OnHide to perform special processing when the form is hidden (that is, when the form’s Visible property is set to False).


TCustomForm.OnPaint

TCustomForm	See also 	Example

Occurs when the form is redrawn.

property OnPaint: TNotifyEvent;

Description

Use OnPaint to perform special processing when the form is redrawn. Any special painting on the form should be done in this event. OnPaint occurs before any controls on the form are painted.

If you use the form’s Canvas property outside the OnPaint event, it will be erased and drawn-over by the next OnPaint event.


TCustomForm.ShortCut
TCustomForm.OnShortCut

TCustomForm	See also	Example

Occurs when the user presses a key (before the OnKeyDown event).

property OnShortCut: TShortCutEvent;

Description

Use OnShortCut to dispatch shortcut keystrokes before the form handles them. When the user presses a key, the form can dispatch it as a shortcut key instead of allowing the standard keystroke processing (OnKeyDown, OnKeyPress, and OnKeyUp). Built-in shortcut processing is provided for menu shortcuts and actions associated with the form. OnShortCut allows the form to implement additional shortcuts.

If the OnShortCut implements a response to the keystroke, set the Handled parameter of the event handler to True. This prevents the keystroke from being passed on to menus or actions associated with the form. It also prevents the standard keystroke processing in the same way that a menu or action shortcut does.


TCustomForm.OnShow

TCustomForm	See also 	Example

Occurs when the form is shown (that is, when its Visible property is set to True).

property OnShow: TNotifyEvent;

Description

Use OnShow to perform special processing when the form is shown (that is, when the form’s Visible property is set to True).


TCustomForm methods

TCustomForm	Alphabetically	Legend

In TCustomForm

Activate

ActiveChanged

AfterConstruction

AlignControls

BeforeDestruction

BeginAutoDrag

ChangeScale

Close

CloseQuery

Create

CreateNew

CreateParams

CreateWindowHandle

CreateWnd

Deactivate

DefaultHandler

DefineProperties

DefocusControl

Destroy

DestroyWindowHandle

Dock

DoClose

DoCreate

DoDestroy

DoDock

DoHide

DoShow

FocusControl

GetChildren

GetClientRect

GetFoating

GetFormImage

Hide

IsShortCut

Loaded

MouseWheelHandler

Notification

Paint

PaintWindow

PaletteChanged

Print

QueryInterface

ReadState

Release

RequestAlignRequestAlign

SendCancelMode

SetChildOrder

SetFocus

SetFocusedControl

SetParent

SetParentBiDiMode

Show

ShowModal

UpdateActions

UpdateWindowState

ValidateRename

VisibleChanging

WantChildKey

WndProc

Derived from TScrollingWinControl

DisableAutoRange

EnableAutoRange

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomForm methods

TCustomForm	By object	Legend

Activate

ActiveChanged

AfterConstruction

AlignControls

Assign

BeforeDestruction

BeginAutoDrag

BeginDrag

BringToFront

Broadcast

CanFocus

ChangeScale

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

Close

CloseQuery

ContainsControl

ControlAtPos

Create

CreateNew

CreateParams

CreateParented

CreateParentedControl

CreateWindowHandle

CreateWnd

Deactivate

DefaultHandler

DefineProperties

DefocusControl

Destroy

DestroyComponents

Destroying

DestroyWindowHandle

DisableAlign

DisableAutoRange

Dispatch

Dock

DockDrop

DoClose

DoCreate

DoDestroy

DoDock

DoHide

DoShow

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EnableAutoRange

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

FocusControl

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetChildren

GetClientRect

GetControlsAlignment

GetFoating

GetFormImage

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

IsShortCut

Loaded

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

Notification

Paint

PaintTo

PaintWindow

PaletteChanged

Perform

Print

QueryInterface

ReadState

Realign

Refresh

Release

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

RequestAlignRequestAlign

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendCancelMode

SendToBack

SetBounds

SetChildOrder

SetFocus

SetFocusedControl

SetParent

SetParentBiDiMode

SetTextBuf

Show

ShowModal

Update

UpdateAction

UpdateActions

UpdateControlState

UpdateWindowState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

ValidateRename

VisibleChanging

WantChildKey

WndProc


TCustomForm.Activate

TCustomForm	See also

Generates an OnActivate event.

procedure Activate; dynamic;

Description

The form component calls Activate in response to the CM_ACTIVATE message, sent when a form gets the focus either because of a change in active windows within an application or because of the application becoming active.

The default Activate method calls any event handler attached by the user to the OnActivate event.  Override this method to change the response to CM_ACTIVATE messages.


TCustomForm.ActiveChanged

TCustomForm	See also

Responds when the active control on the form changes.

procedure ActiveChanged; dynamic;

Description

As implemented in TCustomForm, ActiveChange ignores changes in the active control. Override this method in a descendant class to execute some action when the active control on the form changes.


TCustomForm.AfterConstruction

TCustomForm	See also

Generates an OnCreate event.

procedure AfterConstruction; override;

Description

AfterConstruction is called after the form’s constructor is finished. Do not call it explicitly in applications. TCustomForm overrides AfterConstruction to generate an OnCreate event if OldCreateOrder is False.


TCustomForm.AlignControls

TCustomForm	See also

Aligns all child controls of the form that fall within a specified rectangle.

procedure AlignControls(AControl: TControl; var ARect: TRect); override;

Description

Use AlignControls to align all controls within an area of the form. Specify the area in which to align the controls as the value of the Rect parameter.

AlignControls uses the Align property value for each child control to determine how to align it. The AControl parameter can be nil. If you specify a control in AControl, that control takes precedence in alignment over other, similarly aligned controls.


TCustomForm.BeforeDestruction

TCustomForm	See also

Generates an OnDestroy event.

procedure BeforeDestruction; override;

Description

BeforeDestruction is called immediately before the form’s destructor. Do not call it explicitly in applications. TCustomForm overrides BeforeDestruction to generate an OnDestroy event if OldCreateOrder is False.


TCustomForm.BeginAutoDrag

TCustomForm	See also

Responds when the user starts dragging the form if DragMode is dmAutomatic.

procedure BeginAutoDrag; override;

Description

BeginAutoDrag suppresses the default behavior of the BeginAutoDrag method. This is because forms do not change the mouse cursor when dragged.


TCustomForm.ChangeScale

TCustomForm	See also

Repositions and resizes the form by the ratio M/D, adjusting its client area and font size as needed.

procedure ChangeScale(M, D: Integer); override;

Description

The ScaleBy method calls ChangeScale to perform its rescaling. TCustomForm overrides ChangeScale to rescale any scrollbars and child controls before rescaling itself.


TCustomForm.Close

TCustomForm	See also 	Example

Closes the form.

procedure Close;

Description

Call Close to close a form.

Close calls the CloseQuery method to determine if the form can close. If CloseQuery returns False, the close operation is aborted. Otherwise, the OnClose event occurs.

Note:	When the main form of the application closes, the application terminates.


TCustomForm.CloseQuery

TCustomForm	See also

Indicates whether the form can close.

function CloseQuery: Boolean; virtual;

Description

Use CloseQuery to determine whether the form can close. If the form can close, CloseQuery returns True; otherwise, CloseQuery returns False.

For an MDI parent form, CloseQuery calls the CloseQuery method on the form’s MDI children to determine the return value.


TCustomForm.Create

TCustomForm	See also

Creates and initializes a new TForm object.

constructor Create(AOwner: TComponent); override;

Description

Use Create to instantiate a TForm object or descendant of TForm at runtime. AOwner is the owner of the TCustomForm object.

For descendants of TCustomForm that are not TForm objects, use CreateNew instead.  Calling Create for a TCustomForm descendant that is not a TForm will raise an exception.


TCustomForm.CreateNew

TCustomForm	See also

Creates and initializes a new form.

constructor CreateNew(AOwner: TComponent; Dummy: Integer = 0); virtual;

Description

Use CreateNew instead of Create to create a form without using the associated .DFM file to initialize it. Always use CreateNew if the TCustomForm descendant is not a TForm object or a descendant of TForm.

CreateNew bypasses the streaming in of the previously-associated .DFM file; therefore, you must stream in an external .DFM to bind the visual components with their classes. WriteComponentResFile and ReadComponentResFile must bracket CreateNew. The following code sequence

1. streams-out an external .DFM file;
2. creates a new form disassociated from any .DFM resource file;
3. streams-in the external .DFM file and binds it to this new form.

WriteComponentResFile('Temp.dfm', Form1);

…

Form2 := TForm.CreateNew(Application);

ReadComponentResFile('Temp.dfm', Form2);

Warning	Using CreateNew instead of Create can cause unpredictable results because most forms are written assuming their controls will be created from the .DFM file.

CreateNew is called by the Create method. After calling the inherited constructor, CreateNew initializes:

•	the Left, Top, Width, and Height properties to 0, 0, 320, and 240, respectively.

•	the WindowState property to wsNormal, the Visible property to False, the Ctrl3d property to True, the BorderIcons property to [biSystemMenu, biMinimize, biMaximize], and the BorderStyle property to bsSizeable.

•	the ParentColor to False, the ParentFont to False.

•	the ControlStyle property to [csAcceptsControls, csCaptureMouse, csClickEvents, csSetCaption, csDoubleClicks].

•	the PixelsPerInch property to the value of the Screen.PixelsPerInch property and the PrintScale property to poProportional.

Finally, CreateNewTCustomForm adds the new form to the list of forms maintained by the global instance of TScreen.

The first argument, AOwner, is the owner of the form (usually the application or another form is the owner).The second argument, Dummy, defaults to 0 and is not used by this constructor. The system will pass 0 by default if this constructor is passed only the first argument, AOwner.


TCustomForm.TCustomForm
TCustomForm.CreateParams

TCustomForm	See also

Initializes the window-creation parameter record when the form window is created.

procedure CreateParams(var Params: TCreateParams); override;

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle. TCustomForm overrides CreateParams to customize the way the form creates its Windows representation after calling the inherited method. You should never need to override this method in the context of a form class.

The TCreateParams type is a data structure holding information needed when telling Windows to create a window handle. The fields of a TCreateParams record become the parameters to a call to the CreateWindowEx API function.


TCustomForm.CreateWindowHandle

TCustomForm	See also

Creates a form window given a set of window-creation parameters.

procedure CreateWindowHandle(const Params: TCreateParams); override;

Description

The CreateWnd method calls CreateWindowHandle to create the form window once it has been specified in the window-creation parameters. CreateWindowHandle creates the window by calling the CreateWindowEx API function, passing parameters from the record passed in the Params parameter. CreateWindowHandle removes the CS_HREDRAW and CS_VREDRAW class styles from the window class.

The TCreateParams type is a data structure holding information needed when telling Windows to create a window handle.


TCustomForm.CreateWnd

TCustomForm	See also

Creates the form window.

procedure CreateWnd; override;

Description

CreateWnd is called when the form is created, and whenever a change to the form requires the window to be recreated. CreateWnd first calls the inherited CreateWnd, and then sends the newly created window messages to request notification of Windows events, and, if the window is being recreated, reloads the form from a memory stream.


TCustomForm.Deactivate

TCustomForm	See also

Generates an OnDeactivate event.

procedure Deactivate; dynamic;

Description

The form component calls Deactivate in response to the CM_DEACTIVATE message, sent when a form gets the focus either because of a change in active windows within an application or because of the application becoming active.

The default Deactivate method calls any event handler attached by the user to the OnDeactivate event.  Override this method to block the OnDeactivate event or provide additional responses to the loss of activation.


TCustomForm.DefaultHandler

TCustomForm	See also

Provides message handling for all messages that the form does not fully process.

procedure DefaultHandler(var Message); override;

Description

Override DefaultHandler to change the default message handling for the form. This is seldom necessary because messages can be handled by creating message methods.

DefaultHandler passes any otherwise-unhandled messages to the form's window procedure by calling the CallWindowProc API function.

Note:	Calling inherited in a message-handling method results in a call to the ancestor's DefaultHandler method unless that ancestor specifies a handler for the message.


TCustomForm.DefineProperties

TCustomForm	See also

Designates methods for storing a form's unpublished data on a stream such as a form file.

procedure DefineProperties(Filer: TFiler); override;

Description

DefineProperties calls the inherited method and calls the filer object's DefineProperty method for the PixelsPerInch and TextHeight properties. TForm descendants can also specify methods that read and write data other than properties by overriding the DefineProperties method.


TCustomForm.DefocusControl

TCustomForm	See also

Removes focus from a control on the form.

procedure DefocusControl(Control: TWinControl; Removing: Boolean);

Description

Use DefocusControl to remove focus from a control on the form. This method is used internally by the VCL.

Control is the control from which to remove focus. If Control is the form’s active control, the form’s ActiveControl property is set to nil.

Removing is a Boolean value specifying whether to set focus to the control’s parent.


TCustomForm.Destroy

TCustomForm	See also

Removes the form from memory.

destructor Destroy; override;

Description

Do not call Destroy. Instead, call Release, which posts a CM_RELEASE message to the form. The handler for CM_RELEASE calls the Free method, which in turn calls Destroy.

Destroy performs the following tasks:

Calls the OnDestroy event handler for the form and for the object associated with the OleFormObject property (if that property is not nil).

Frees memory associated with helper objects.

Calls the inherited destructor.


TCustomForm.DestroyWindowHandle

TCustomForm	See also

Destroys the window created in the CreateWindowHandle method.

procedure DestroyWindowHandle; override;

Description

DestroyWindowHandle is called automatically to destroy the window associated with a form before destroying the form.


TCustomForm.Dock

TCustomForm	See also

Handles automatic docking of the form into other windows.

procedure Dock(NewDockSite: TWinControl; ARect: TRect); override;

Description

Do not call Dock. It is called automatically when the form is released on a docking site that will accept it. To dock a form programmatically, use the ManualDock method instead.


TCustomForm.DoClose

TCustomForm	See also

Generates an OnClose event.

type  TCloseAction = (caNone, caHide, caFree, caMinimize);

procedure DoClose(var Action: TCloseAction); dynamic;

Description

DoClose is called automatically when the form closes. It calls the OnClose event handler if it is assigned.

Override this method to suppress the OnClose event or to add class-specific processing when the form closes. Set the Action parameter to indicate how the form should be closed. For details on the possible values, see the OnClose event.


TCustomForm.DoCreate

TCustomForm	See also

Generates an OnCreate event.

procedure DoCreate; virtual;

Description

DoCreate is called automatically when the form is created. It calls the OnCreate event handler if it is assigned, wrapping the call in an exception handling layer in case the event handler raises an exception. Finally, it updates the Visible property based on the fsVisible flag in the form’s FormState.


TCustomForm.DoDestroy

TCustomForm	See also

Generates an OnDestroy event.

procedure DoDestroy; virtual;

Description

DoDestroy is called automatically when the form is freed. It calls the OnDestroy event handler if it is assigned, wrapping the call in an exception handling layer in case the event handler raises an exception.


TCustomForm.DoDock

TCustomForm	See also

Makes all necessary adjustments when the form is docked to another window.

procedure DoDock(NewDockSite: TWinControl; var ARect: TRect); override;

Description

DoDock is called automatically after the form is docked or undocked. It adjusts the borders of the form to reflect its new status.

The NewDockSite parameter is the window in which the form is docked. If the form has been undocked and is now floating, NewDockSite is nil.

The ARect parameter specifies the new boundaries of the form.


TCustomForm.DoHide

TCustomForm	See also

Generates an OnHide event.

procedure DoHide; dynamic;

Description

The form component calls DoHide in response to the CM_SHOWINGCHANGED message, sent when the application shows or hides the form.

The default DoHide method calls any event handler attached by the user to the OnHide event.  Override DoHide to block the OnHide event or introduce additional responses when the form is hidden.


TCustomForm.DoShow

TCustomForm	See also

Generates an OnShow event.

procedure DoShow; dynamic;

Description

The form component calls DoShow in response to the CM_SHOWINGCHANGED message, sent when the application shows or hides the form.

The default DoShow method calls any event handler attached by the user to the OnShow event.  Override DoShow to block the OnShow event or introduce additional responses when the form is shown.


TCustomForm.FocusControl

TCustomForm	See also

Sets focus to a control on the form.

procedure FocusControl(Control: TWinControl);

Description

Use FocusControl to set focus to a control on the form.

Control is a TWinControl object encapsulating the control upon which to set focus. FocusControl sets the ActiveControl property.


TCustomForm.GetChildren

TCustomForm	See also

Returns the "child" components of the form; that is, those components that return the form from their GetParentComponent method.

procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;

Description

GetChildren is called by the streaming system that loads and saves VCL components. By default, GetChildren returns no children.

Override GetChildren for form classes that do not use the .DFM file to manage the creation of child components. For each component contained in the form, GetChildren should call the method passed in Proc. These calls must occur in creation order, the order the child components appear in a form file.


TCustomForm.GetClientRect

TCustomForm	See also

Returns the value of the ClientRect property.

function GetClientRect: TRect; override;

Description

GetClientRect is the protected access function for the ClientRect property. Override this method to change the way the client area of the form is defined.


TCustomForm.GetFloating

TCustomForm	See also

Returns the value of the Floating property.

function GetFloating: Boolean; override;

Description

GetFloating is the protected access function for the Floating property. Override this method in descendants that implement floating windows in some class-specific way.


TCustomForm.GetFormImage

TCustomForm	See also 	Example

Returns a bitmap of the form.

function GetFormImage: TBitmap;

Description

Use the GetFormImage method to obtain a bitmap of the form.


TCustomForm.Hide

TCustomForm	See also 	Example

Hides the form.

procedure Hide;

Description

Hide sets the Visible property to False.


TCustomForm.IsShortCut

TCustomForm	See also

Processes shortcut keys when the form has focus.

function IsShortCut(var Message: TWMKey): Boolean; dynamic;

Description

IsShortCut is called automatically when the user presses a key while the form has focus. It allows the form to dispatch shortcut keys and bypass the standard keystroke processing (OnKeyDown, OnKeyPress, and OnKeyUp events).

The Message parameter encapsulates the Windows message describing the keypress. If a shortcut for the key exists, IsShortCut executes the appropriate command and returns True. Otherwise IsShortCut returns False.

IsShortCut generates an OnShortCut event to allow the developer to insert shortcuts for the form. If the keystroke is not handled in an OnShortCut event handler, IsShortCut checks for any shortcuts associated with the form’s menus and actions.


TCustomForm.Loaded

TCustomForm	See also

Performs fix-ups when the form is first loaded into memory.

procedure Loaded; override;

Description

Loaded overrides the inherited method to give focus to the ActiveControl if it is assigned. Before assigning focus, Loaded calls the inherited method to perform any lower-level initialization.


TCustomForm.MouseWheelHandler

TCustomForm	See also

Directs mouse wheel messages to the appropriate control.

procedure MouseWheelHandler(var Message: TMessage); override;

Description

MouseWheelHandler is called automatically when the form or any windowed control contained in the form receives a message from a mouse wheel. The Message parameter encapsulates the message.

As implemented in TCustomForm, MouseWheelHandler performs no special processing, but simply redirects the message to the active control by calling its Perform method. By default, the Perform method generates the appropriate mouse wheel events.


TCustomForm.Notification

TCustomForm	See also

Responds to notifications that objects are about to be inserted or removed.

procedure Notification(AComponent: TComponent; Operation: TOperation); override;

Description

Notification is called when the component specified by AComponent is about to be inserted or removed, as specified by Operation. By default, forms pass along the notification to their owned components, if any. In addition, TCustomForm.Notification makes internal adjustments if the main menu is added or deleted.

A form can, if needed, override Notification to make other adjustments when components are inserted or removed. In particular, if a form has object fields or properties that contains references to other components, it might check the notifications of component removals and invalidate those references as needed.


TCustomForm.Paint

TCustomForm	See also

Generates an OnPaint event.

procedure Paint; dynamic;

Description

The form component calls Paint in response to the WM_PAINT message (sent when the window needs to be painted) before rendering all controls on the form.

The default Paint method calls any event handler attached by the user to the OnPaint event.  Override Paint to block the OnPaint event or to draw additional features before or after the OnPaint event.


TCustomForm.PaintWindow

TCustomForm	See also

Repaints the contents of the form before all child controls are painted.

procedure PaintWindow(DC: HDC); override;

Description

PaintWindow sets up the Canvas for painting and generates an OnPaint event at runtime or draws the designer grid at design time.  After PaintWindow has painted the form window, all child controls are painted.


TCustomForm.PaletteChanged

TCustomForm	See also

Responds to changes in the system's palette by realizing the control's palette as returned from GetPalette.

function PaletteChanged(Foreground: Boolean): Boolean; override;

Description

PaletteChanged is called automatically when the system palette changes. The Foreground parameter indicates whether the palette realization should treat this control's palette as being in the foreground or the background. The return value from PaletteChanged indicates whether the form actually realized its palette, returning True only if the form has an associated palette.

Most applications should not need to alter the default behavior of PaletteChanged.


TCustomForm.Print

TCustomForm	See also

Prints the form.

procedure Print; virtual;

Description

Call Print to print the form. Print uses the GetFormImage method to obtain a bitmap of the form and draws that to the printer’s HDC.


TCustomForm.QueryInterface

TCustomForm	See also

Returns a reference to a specified interface if that interface is supported by the form.

type HResult = Longint;

function QueryInterface(const IID: TGUID; out Obj): HResult; override;

Description

For forms that support interfaces, QueryInterface calls the QueryInterface method of the interface supported by the form. QueryInterface returns a reference to the interface specified by the IID parameter, as the Obj parameter. If the form does not support the interface, the Obj parameter is nil.

QueryInterface returns S_OK if the Obj parameter is successfully assigned.


TCustomForm.ReadState

TCustomForm	See also

Reads the form's published properties, stored data, and owned components from a reader object.

procedure ReadState(Reader: TReader); override;

Description

ReadState is part of a sequence of calls used by the streaming system that loads and saves VCL components.  It reads the values of all the component's published properties, stored data, and owned components from the reader object passed in Reader. Do not call ReadState directly.

Any descendant classes overriding ReadState should end with a call to the inherited ReadState method.


TCustomForm.Release

TCustomForm	See also

Destroys the form and frees its associated memory.

procedure Release;

Description

Use Release to destroy the form and free its associated memory.

Release does not destroy the form until all event handlers of the form and event handlers of components on the form have finished executing. Any event handlers of the form should use Release instead of Free. Failing to do so could lead to an access violation.


TCustomForm.RequestAlign

TCustomForm	See also

Instructs the form’s parent (if any) to reposition the form, enforcing its Align property.

procedure RequestAlign; override;

Description

RequestAlign is called internally when changes are made to the size or position of the form, so that it remains properly aligned within a dock site or properly positioned on the screen.


TCustomForm.Resizing

TCustomForm

Makes any required adjustments when the form changes size.

procedure Resizing(State: TWindowState); override;

Description

This protected method is called automatically when the form is resized, including when it is maximized, minimized, or restored to normal size. Resizing adjusts the size and position of any child controls that are aligned to the form.

The State parameter indicates the state of the form after the resize.


TCustomForm.SendCancelMode

TCustomForm	See also

Cancels modes on the form.

procedure SendCancelMode(Sender: TControl);

Description

Use SendCancelMode to release the mouse capture and cancel scroll bar input and menu processing on the form.


TCustomForm.SetChildOrder

TCustomForm	See also

Changes the order in which Child appears when GetChildren is called.

procedure SetChildOrder(Child: TComponent; Order: Integer); override;

Description

Use SetChildOrder to change the order in which child components are loaded and saved. The Child moves as if it were an item in a list object: items previously below the child's old position move up, and those below the new position move down.


TCustomForm.SetFocus

TCustomForm	See also

Sets focus to the form.

procedure SetFocus;

Description

Use SetFocus to give the form input focus. SetFocus calls the SetFocus method of the active control, if one exists. To determine whether the form has focus, use the Active property.


TCustomForm.SetFocusedControl

TCustomForm	See also

Sets focus to a control on the form.

function SetFocusedControl(Control: TWinControl): Boolean; virtual;

Description

Use SetFocusedControl to give a control on the form input focus.  SetFocusedControl returns False if the Control specified by the Control parameter was already in the process of receiving focus, True otherwise.

Note:	A return value of True does not indicate the control has successfully received input focus.  If the Control can’t have focus (for example, if it is not visible), SetFocusedControl will still return True, indicating that an attempt was made.


TCustomForm.SetParent

TCustomForm	See also

Sets the Parent property.

procedure SetParent(AParent: TWinControl); override;

Description

SetParent is the protected implementation of the Parent property. It overrides the inherited method to regenerate the form’s window when the Parent property is changed to nil.


TCustomForm.SetParentBiDiMode

TCustomForm	See also

Sets the ParentBiDiMode property.

procedure SetParentBiDiMode(Value: Boolean); override;

Description

SetParentBiDiMode is the protected implementation of the ParentBiDiMode property. It overrides the inherited method to obtain the BiDiMode property of the application if the form does not have a parent.


TCustomForm.Show

TCustomForm	See also	Example

Shows the form.

procedure Show;

Description

Use Show to set the form’s Visible property to True and to bring the form to the front of other forms on the screen.


TCustomForm.ShowModal

TCustomForm	See also 	Example

Shows a form as a modal dialog.

function ShowModal: Integer; virtual;

Description

Use ShowModal to show a form as a modal form.  When the form is shown in a modal state, the application can’t continue to run until the form is closed.

To close a modal form, set its ModalResult property to a nonzero value.

ShowModal returns value to which the ModalResult property is set when it closes the form.


TCustomForm.UpdateActions

TCustomForm	See also

Updates all actions associated with the form.

procedure UpdateActions; virtual;

Description

UpdateActions is called automatically when the application is idle to allow all components in the form an opportunity to update any actions for which the component is a target. This allows actions to be checked, grayed, and so on to reflect the current state of their targets.

UpdateActions updates all actions associated with the form, its menus, and the components contained in the form.


TCustomForm.UpdateWindowState

TCustomForm	See also

Updates the WindowState property to reflect the current state of the form.

procedure UpdateWindowState;

Description

UpdateWindowState ensures that the WindowState property reflects the current state of the form.


TCustomForm.ValidateRename

TCustomForm	See also

Determines if a form can rename one of its owned components.

procedure ValidateRename(AComponent: TComponent; const CurName, NewName: string); override;

Description

The ValidateRename method checks to see if a form can rename one of its owned components, passed in AComponent, from its current name (CurName) to the string passed in NewName. If AComponent is nil or NewName is already the name of a component in the form’s list, ValidateRename raises an EComponentError exception.


TCustomForm.VisibleChanging

TCustomForm	See also

Responds just before the form changes the value of its Visible property.

procedure VisibleChanging; override;

Description

This protected method raises an exception if, for some reason, the form should not change its visible state.


TCustomForm.WantChildKey

TCustomForm

Indicates whether the form processes keyboard input for a control it owns.

function WantChildKey(Child: TControl; var Message: TMessage): Boolean; virtual;

Description

WantChildKey is called by any control that the form owns when the control receives keyboard input. If WantChildKey returns True, the control performs no further processing in response to the keyboard input, instead deferring to its parent form to respond to the keystroke. In its default implementation, WantChildKey always returns False; it is overridden in TActiveForm to implement certain ActiveX functionality.


TCustomForm.WndProc

TCustomForm	See also

Provides specific message responses for the form.

procedure WndProc(var Message: TMessage); override;

Description

WndProc is the first method that receives messages for a form. After calling the inherited method, WndProc performs some window activation, focus, and position message handling necessary to keep in sync with Windows. Override WndProc to change how the form responds to Windows messages.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TScrollingWinControl


TCustomFrame

Hierarchy	Properties	Methods	See also

TCustomFrame is the base class from which TFrame descends.

Unit

forms

Description

TCustomFrame reimplements TScrollingWinControl's constructor and related methods for Delphi frames.


TCustomFrame properties

TCustomFrame	Alphabetically	Legend

Derived from TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomFrame properties

TCustomFrame	By object	Legend

Action

Align

Anchors

AutoScroll

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HorzScrollBar

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentWindow

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

VertScrollBar

Visible

VisibleDockClientCount

Width

WindowProc


TCustomFrame methods

TCustomFrame	Alphabetically	Legend

In TCustomFrame

Create

CreateParams

GetChildren

Derived from TScrollingWinControl

AdjustClientRect

AlignControls

AutoScrollEnabled

AutoScrollInView

ChangeScale

CreateWnd

Destroy

DisableAutoRange

DoFlipChildren

EnableAutoRange

Resizing

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomFrame methods

TCustomFrame	By object	Legend

AdjustClientRect

AfterConstruction

AlignControls

Assign

AutoScrollEnabled

AutoScrollInView

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ChangeScale

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParams

CreateParented

CreateParentedControl

CreateWnd

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

DisableAutoRange

Dispatch

Dock

DockDrop

DoFlipChildren

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EnableAutoRange

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetChildren

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

Resizing

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TCustomFrame.Create

TCustomFrame	See also

Creates and initializes a TCustomFrame object.

constructor Create(AOwner: TComponent); override;

Description

Use Create to create and initialize a frame.

AOwner is the component that owns the frame.


TCustomFrame.CreateParams

TCustomFrame	See also

Initializes frame creation parameters for efficient redrawing.

procedure CreateParams(var Params: TCreateParams); override;

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle.


TCustomFrame.GetChildren

TCustomFrame	See also

Calls a specified method for each child of the frame.

procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;

Description

GetChildren is called by the VCL streaming system that loads and saves components. Applications seldom need to call this routine.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TScrollingWinControl


TCustomGroupBox

Hierarchy	Properties	Methods	See also

TCustomGroupBox is the abstract base class for all group-box components.

Unit

stdctrls

Description

Group boxes are visual components that act as containers for sets of related controls, such as radio buttons. Group boxes may also contain other group boxes. TCustomGroupBox is the abstract class from which all group-box components—including TGroupBox, TRadioGroup, and TDBRadioGroup—descend.


TCustomGroupBox properties

TCustomGroupBox	Alphabetically	Legend

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomGroupBox properties

TCustomGroupBox	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentWindow

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TCustomGroupBox methods

TCustomGroupBox	Alphabetically	Legend

In TCustomGroupBox

AdjustClientRect

Create

CreateParams

Paint

Derived from TCustomControl

Destroy

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomGroupBox methods

TCustomGroupBox	By object	Legend

AdjustClientRect

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParams

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

Paint

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TCustomGroupBox.AdjustClientRect

TCustomGroupBox	See also

Adjusts the ClientRect property for ideosyncrasies of the window.

procedure AdjustClientRect(var Rect: TRect); override;

Description

AdjustClientRect is called internally when the group box needs accurate information on where to place child controls within the client area. It indents the client rectangle slightly so that child controls are not placed on the frame (or caption) of the group box.


TCustomGroupBox.Create
TCustomGroupBox.CreateTCustomGroupBox	See also

Creates and initializes a TCustomGroupBox instance.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a group box at runtime. Group boxes placed on forms at design time are created automatically.

After calling the inherited constructor, Create initializes the ControlStyle property by turning on the following flags: csAcceptsControls, csCaptureMouse, csClickEvents, csSetCaption, csDoubleClicks, and csReplicatable. Create also sets the Width and Height properties to 185 and 105 pixels, respectively.


TCustomGroupBox.CreateParams

TCustomGroupBox	See also

Initializes a window-creation parameter record passed in the Params parameter.

procedure CreateParams(var Params: TCreateParams); override;

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle. Override CreateParams to customize the way a group box creates its Windows representation. When overriding CreateParams, always call the inherited method first to set the default values, then make any desired adjustments.

Specify the parameter record as the value of the Params parameter. The TCreateParams type is a data structure holding information needed when telling Windows to create a window handle. The fields of a TCreateParams record become the parameters to a call to the CreateWindowEx API function.

TCustomGroupBox adjusts the window style by turning off the CS_HREDRAW and CS_VREDRAW flags.


TCustomGroupBox.Paint

TCustomGroupBox	See also

Renders the onscreen image of the group box.

procedure Paint; override;

Description

Paint draws a border around the group box and fills in the caption. If Ctl3D (a protected property, inherited from TWinControl) is set to True, then Paint draws the border with a three-dimensional look.


Scope

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TCustomGrid

Hierarchy	Properties	Methods	See also

TCustomGrid is the base type for all components that present information in a two-dimensional grid.

Unit

grids

Description

Use TCustomGrid as a base class when defining components that represent information in a tabular format. TCustomGrid introduces properties and methods to control the appearance and behavior of the grid, including responses to mouse actions and user editing.

Do not create instances of TCustomGrid. Instead, put a grid control in a form by instantiating a descendant of TCustomGrid. Use TDrawGrid to represent non-textual material in a tabular grid. For text, use a TStringGrid object. If the text represents field values from a dataset, use TDBGrid.


TCustomGrid properties

TCustomGrid	Alphabetically	Legend

In TCustomGrid

BorderStyle

Col

ColCount

ColWidths

DefaultColWidth

DefaultDrawing

DefaultRowHeight

EditorMode

FixedColor

FixedCols

FixedRows

GridHeight

GridLineWidth

GridWidth

HitTest

InplaceEditor

LeftCol

Options

Row

RowCount

RowHeights

ScrollBars

Selection

TabStops

TopRow

VisibleColCount

VisibleRowCount

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ShowHint

Top

TBDockHeight

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomGrid properties

TCustomGrid	By object	Legend

Action

Align

Anchors

BiDiMode

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Col

ColCount

Color

ColWidths

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DefaultColWidth

DefaultDrawing

DefaultRowHeight

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

EditorMode

Enabled

FixedColor

FixedCols

FixedRows

Floating

FloatingDockSiteClass

GridHeight

GridLineWidth

GridWidth

Handle

Height

HelpContext

Hint

HitTest

HostDockSite

InplaceEditor

Left

LeftCol

LRDockWidth

Name

Options

Owner

Parent

ParentColor

ParentWindow

Row

RowCount

RowHeights

ScrollBars

Selection

ShowHint

Showing

TabOrder

TabStop

TabStops

Tag

TBDockHeight

Top

TopRow

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleColCount

VisibleDockClientCount

VisibleRowCount

Width

WindowProc


TCustomGrid.BorderStyle

TCustomGrid	See also

Determines whether a single line border is drawn around the grid.

property BorderStyle: TBorderStyle;

Description

Set BorderStyle to bsSingle to add a single line border around the grid’s image. Set BorderStyle to bsNone to omit the border.

The visual effect of BorderStyle is influenced by the value of the Ctrl3D property. Experiment with different combinations of BorderStyle and Ctrl3D to achieve the desired look.


TCustomGrid.Col

TCustomGrid	See also	Example

Specifies the index of the column that contains the selected cell.

property Col: Longint;

Description

Use Col at runtime to determine the current column in the grid. Setting Col moves focus to the cell in the current row that is in the new column. The first column has an index of 0, the second column an index of 1, and so on.

The selected cell in the grid can be located by reading the Col property and the Row property to obtain the indexes of its column and row. When focus moves to the grid, the selected cell gets input focus.


TCustomGrid.ColCount

TCustomGrid	See also 	Example

Specifies the number of columns in the grid.

property ColCount: Longint;

Description

Read ColCount to determine the number entries in the ColWidths array. Set ColCount to add or delete columns at the righthand side of the grid. The value of ColCount includes any fixed columns at the left of the grid as well as the scrollable columns in the body of the grid.


TCustomGrid.ColWidths

TCustomGrid	See also

Indicates the width (in pixels) of all the columns in the grid.

property ColWidths[Index: Longint]: Integer;

Description

Read ColWidths to determine the width of the cells in the column specified by the Index parameter. An index of 0 refers to the first column. Set ColWidths at runtime to change the width of an individual column.

If the width of a column has not been set explicitly by resizing with the mouse, or by using the ColWidths property, its width is DefaultColWidth.

Use the ColCount property to determine the number of entries in the ColWidths array.


TCustomGrid.DefaultColWidth

TCustomGrid	See also	Example

Determines the width (in pixels) of all columns that have not been explicitly resized.

property DefaultColWidth: Integer;

Description

Set DefaultColWidth to change the size of all columns in the grid. When DefaultColWidth is set, columns that have been resized using the mouse or by setting the ColWidths property are given the DefaultColWidth as well.

When new columns are added to the grid using the ColCount property, they are created with a width of DefaultColWidth.


TCustomGrid.DefaultDrawing

TCustomGrid	See also

Determines whether the Cells are painted when the grid is drawn.

property DefaultDrawing: Boolean;

Description

Set DefaultDrawing to True to have the grid automatically paint the cells in the grid, including adding the background color, the 3-D effects on the fixed cells, and the focus rectangle around the selected cell. Set DefaultDrawing to False to skip the painting of the cells when the grid is drawn.

When DefaultDrawing is False, the cells should be painted using the DrawCell method. For TCustomGrid, DrawCell is an abstract method. Descendants of TCustomGrid use DrawCell to provide their own customized drawing code, or to generate an OnDrawCell event.


TCustomGrid.DefaultRowHeight

TCustomGrid	See also

Specifies the height (in pixels) of all rows that have not been explicitly resized.

property DefaultRowHeight: Integer;

Description

Set DefaultRowHeight to change the size of all rows in the grid. When DefaultRowHeight is set, rows that have been resized using the mouse or by setting the RowHeights property are given the DefaultRowHeight as well.

When new rows are added to the grid using the RowCount property, they are created with a height of DefaultRowHeight.


TCustomGrid.EditorMode

TCustomGrid	See also

Determines whether the current cell can be edited.

property EditorMode: Boolean;

Description

Set EditorMode to True, at runtime, to put the grid in edit mode. When EditorMode is True, the user can edit cells in the grid. When the user presses F2, EditorMode is set to True. When the user presses Enter, the value of EditorMode is toggled.

Note:	EditorMode has no effect if the Options property does not include goEditing or if the Options property includes goAlwaysShowEditor.


TCustomGrid.FixedColor

TCustomGrid	See also

Specifies the background color of the fixed rows and columns in the grid.

property FixedColor: TColor;

Description

Set FixedColor to specify the color for the nonscrolling cells in the grid. The scrolling region of the grid is drawn using the Color property.


TCustomGrid.FixedCols

TCustomGrid	See also

Specifies the number of columns on the left of the grid that cannot be scrolled.

property FixedCols: Integer;

Description

Set FixedCols to create or get rid of nonscrolling columns. Nonscrolling columns appear at the left of the grid, and are always visible, even when the user scrolls the other columns in the grid. Use nonscrolling columns for displaying row titles or row numbers, or to implement a scroll lock that the user can set.

Nonscrolling columns are visually distinct from the scrollable columns in the grid. They are painted with a separate background color, and their cells have a raised, 3-D look when the Ctrl3D property is True.

Note:	Grids must include at least one scrolling column. Do not set FixedCols to a value greater than ColCount - 1.


TCustomGrid.FixedRows

TCustomGrid	See also

Specifies the number of rows on the top of the grid that cannot be scrolled.

property FixedRows: Integer;

Description

Set FixedRows to create or get rid of nonscrolling rows. Nonscrolling rows appear at the top of the grid, and are always visible, even when the user scrolls the other rows in the grid. Use nonscrolling rows for displaying column titles or column numbers.

Nonscrolling rows are visually distinct from the scrollable rows in the grid. They are painted with a separate background color, and their cells have a raised, 3-D look when the Ctrl3D property is True.

Note:	Grids must include at least one scrolling row. Do not set FixedRows to a value greater than RowCount - 1.


TCustomGrid.GridHeight

TCustomGrid	See also

Specifies the height of the grid in pixels.

property GridHeight: Integer;

Description

Read GridHeight to determine the size of the grid. If GridHeight is less than the value of ClientHeight, all of the rows of the grid appear in the control with an empty region below the grid. If the underlying grid is too tall to appear in the control, GridHeight is the same as ClientHeight, and the user must scroll to see the entire contents of the grid.


TCustomGrid.GridLineWidth

TCustomGrid	See also	Example

Specifies the width (in pixels) of the lines that separate the cells of the grid.

property GridLineWidth: Integer;

Description

Set GridLineWidth to make the lines that separate the cells in the grid heavier or lighter. When GridLineWidth is zero, no separators are drawn between the cells of the grid.

GridLineWidth will have no effect if the Options property does not include goFixedHorzLine, goFixedVertLine, goHorzLine, or goVertLine.

Note:	Even when GridLineWidth is zero, the cells in the fixed rows and columns of the grid will appear distinct if the Ctrl3D property is True. Set Ctrl3D to False to remove the raised effect that separates the cells in the fixed region of the grid.

Note:	Values greater than 3 pixels are not recommended for applications that will run on Windows 95 because of distortions that can appear.


TCustomGrid.GridWidth

TCustomGrid	See also

Specifies the width of the grid in pixels.

property GridWidth: Integer;

Description

Read GridWidth to determine the size of the grid. If GridWidth is less than the value of ClientWidth, all of the columns of the grid appear in the control with an empty region to the right of the grid. If the underlying grid is too wide to appear in the control, GridWidth is the same as ClientWidth, and the user must scroll to see the entire contents of the grid.


TCustomGrid.HitTest

TCustomGrid	See also

Indicates the current position of the mouse cursor.

property HitTest: TPoint;

Description

Read HitTest to determine the position of the mouse when it is over the grid or when the grid has captured the mouse. HitTest may represent a position that is not within the client area of the grid control if the user is moving or resizing the rows or columns, or if the user is selecting a range of cells using the mouse. HitTest is the position of the mouse cursor in the coordinate system where (0,0) is the upper left corner of the grid control’s client area.


TCustomGrid.InplaceEditor

TCustomGrid	See also

Designates the edit control the grid uses to allow users to edit the contents of the selected cell.

property InplaceEditor: TInplaceEdit;

Description

Read InplaceEditor to gain direct access to the edit control that sits on top of the selected cell when the grid is in edit mode. The inplace editor is created the first time the grid is put in edit mode. It is not destroyed until the grid is destroyed. The grid moves the editor when the selected cell changes. The grid hides the editor’s window when the grid goes out of edit mode.


TCustomGrid.LeftCol

TCustomGrid	See also

Specifies the index of the first visible scrollable column in the grid.

property LeftCol: Longint;

Description

Read LeftCol to determine the index of the first column in the scrollable region that is visible. Set LeftCol to scroll the columns in the grid so that the column with index LeftCol is the first column after the fixed columns.


TCustomGrid.Options

TCustomGrid 	See also

Specifies various display and behavioral properties of the grid.

type

  TGridOption = (goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goDrawFocusSelected, goRowSizing, goColSizing, goRowMoving, goColMoving, goEditing, goTabs, goRowSelect, goAlwaysShowEditor, goThumbTracking);

TGridOptions = set of TGridOption;

property Options: TGridOptions;

Description

Set Options to include the desired properties for the grid. Options is a set drawn from the following values:

Value	Meaning

goFixedVertLine	Vertical lines are drawn to separate the fixed (nonscrolling) columns in the grid.

goFixedHorzLine	Horizontal lines are drawn to separate the fixed (nonscrolling) rows in the grid.

goVertLine	Vertical lines are drawn to separate the scrollable columns in the grid.

goHorzLine	Horizontal lines are drawn to separate the scrollable rows in the grid.

goRangeSelect	Users can select ranges of cells at one time. goRangeSelect is ignored if Options includes goEditing.

goDrawFocusSelected	Cells with input focus are drawn the with a special highlight color, just like selected cells without input focus. If goDrawFocusSelected is not included, the cell with input focus is distinguished by a focus rectangle, not by a special background color.

goRowSizing	Scrollable rows can be individually resized.

goColSizing	Scrollable columns can be individually resized.

goRowMoving	Scrollable rows can be moved using the mouse.

goColMoving	Scrollable columns can be moved using the mouse.

goEditing	Users can edit the contents of cells. When goEditing is included in Options, goRangeSelect has no effect.

goTabs	Users can navigate through the cells in the grid using Tab and Shift+Tab.

goRowSelect	Entire rows are selected rather than individual cells. If goRowSelect is included in Options, goAlwaysShowEditor has no effect.

goAlwaysShowEditor	The grid is locked into edit mode. The user does not need to use Enter or F2 to turn on EditorMode. If Options does not include goEditing, goAlwaysShowEditor has no effect. If Options includes goRowSelect, goAlwaysShowEditor has no effect.

goThumbTracking	The grid image updates while the user is dragging the thumb of the scrollbar. If goThumbTracking is not included, the image does not update until the user releases the thumb in a new position.


TCustomGrid.Row

TCustomGrid	See also 	Example

Specifies the index of the row that contains the selected cell.

property Row: Longint;

Description

Use Row at runtime to determine the current row in the grid. Setting Row moves focus to the cell in the current column that is in the new row. The first row has an index of 0, the second row an index of 1, and so on.

The selected cell in the grid can be located by reading the Row property and the Col property to obtain the indexes of its row and column. When focus moves to the grid, the selected cell gets input focus.


TCustomGrid.RowCount

TCustomGrid	See also 	Example

Specifies the number of rows in the grid.

property RowCount: Longint;

Description

Read RowCount to determine the number entries in the RowHeights array. Set RowCount to add or delete rows at the bottom of the grid. The value of RowCount includes any fixed rows at the top of the grid as well as the scrollable rows in the body of the grid.


TCustomGrid.RowHeights

TCustomGrid	See also

Gives the height (in pixels) of all rows in the grid.

property RowHeights[Index: Longint]: Integer;

Description

Read RowHeights to determine the height of the cells in the row specified by the Index parameter. An index of 0 refers to the first row. Set RowWidths at runtime to change the height of an individual row.

If the height of a row has not been set explicitly by resizing with the mouse, or by using the RowHeights property, it’s height is DefaultRowHeight.

Use the RowCount property to determine the number of entries in the RowHeights array.


TCustomGrid.ScrollBars

TCustomGrid	See also

Specifies whether the grid includes horizontal and vertical scroll bars.

type

  TScrollStyle = (ssNone, ssHorizontal, ssVertical, ssBoth);

property ScrollBars: TScrollStyle;

Description

Use ScrollBars to give the grid horizontal or vertical scroll bars. ScrollBars can take one of the following values:

Value	Meaning

ssNone	The grid has no scroll bars.

ssHorizontal	The grid has a single scroll bar on the bottom edge.

ssVertical	The grid has a single scroll bar on the right edge.

ssBoth	The grid has a scroll bar on both the bottom and right edges.

Note:	If all the cells in the grid fit in the ClientWidth, no horizontal scrollbar appears, even if ScrollBars is ssHorizontal or ssBoth. If all the cells fit in the ClientHeight, no vertical scrollbar appears, even if ScrollBars is ssVertical or ssBoth.


TCustomGrid.Selection

TCustomGrid	See also	Example

Indicates the boundaries of the current selection.

type TGridCoord = record

    X: Longint;

    Y: Longint;

  end;

type TGridRect = record

    case Integer of

      0: (Left, Top, Right, Bottom: Longint);

      1: (TopLeft, BottomRight: TGridCoord);

  end;

property Selection: TGridRect;

Description

Set Selection to select a range of cells in the grid. Selection can either represent the first column, first row, last column and last row in the grid, or the row and column coordinates of the upper left and bottom right cells in the selected region.

Selection can only indicate more than one cell when Options includes goRangeSelect.


TCustomGrid.TabStops

TCustomGrid	See also

Indicates whether the user can tab to specified columns in the grid.

property TabStops[Index: Longint]: Boolean;

Description

Set TabStops to False to remove the column identified by Index from the tab order. The first column in the grid is identified by an Index of 0.

Note:	When the Options property does not include goTabs, the user can’t tab to any column, even if TabStops is True.


TCustomGrid.TopRow

TCustomGrid	See also	Example

Specifies the index of the first visible scrollable row in the grid.

property TopRow: Longint;

Description

Read TopRow to determine the index of the first row in the scrollable region that is visible. Set TopRow to scroll the rows in the grid so that the row with index TopRow is the first row after the fixed rows.


TCustomGrid.VisibleColCount

TCustomGrid	See also

Indicates the number of scrollable columns visible in the grid.

property VisibleColCount: Integer;

Description

Use VisibleColCount to determine the number of scrollable columns fully visible in the grid. VisibleColCount does not include the fixed columns counted by the FixedCols property. It does not include any partially visible columns on the right edge of the grid.


TCustomGrid.VisibleRowCount

TCustomGrid	See also

Indicates the number of scrollable rows visible in the grid.

property VisibleColCount: Integer;

Description

Use VisibleRowCount to determine the number of scrollable rows fully visible in the grid. VisibleRowCount does not include the fixed rows counted by the FixedRows property. It does not include any partially visible rows on the bottom of the grid.


TCustomGrid methods

TCustomGrid	Alphabetically	Legend

In TCustomGrid

AdjustSize

BeginColumnDrag

BeginRowDrag

BoxRect

CalcDrawInfo

CalcFixedInfo

CalcSizingState

CanEditAcceptKey

CanEditModify

CanEditShow

CanGridAcceptKey

CellRect

CheckColumnDrag

CheckRowDrag

ColumnMoved

ColWidthsChanged

Create

CreateEditor

CreateParams

DefineProperties

DeleteColumn

DeleteRow

Destroy

DoExit

DoMouseWheelDown

DoMouseWheelUp

DrawCell

EndColumnDrag

EndRowDrag

GetEditLimit

GetEditMask

GetEditText

GetGridHeight

GetGridWidth

HideEditor

InvalidateCell

InvalidateCol

InvalidateEditor

InvalidateRow

KeyDown

KeyPress

MouseCoord

MouseDown

MouseMove

MouseUp

MoveColRow

MoveColumn

MoveRow

Paint

RowHeightsChanged

RowMoved

ScrollData

SelectCell

SetEditText

ShowEditor

ShowEditorChar

SizeChanged

Sizing

TimedScroll

TopLeftChanged

UpdateDesigner

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

IsRightToLeft

InitiateAction

ManualDock

ManualFloat

Perform

ReplaceDockedControl

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

ExecuteAction

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomGrid methods

TCustomGrid	By object	Legend

AdjustSize

AfterConstruction

Assign

BeforeDestruction

BeginColumnDrag

BeginDrag

BeginRowDrag

BoxRect

BringToFront

Broadcast

CalcDrawInfo

CalcFixedInfo

CalcSizingState

CanEditAcceptKey

CanEditModify

CanEditShow

CanFocus

CanGridAcceptKey

CellRect

CheckColumnDrag

CheckRowDrag

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ColumnMoved

ColWidthsChanged

ContainsControl

ControlAtPos

Create

CreateEditor

CreateParams

CreateParented

CreateParentedControl

DefaultHandler

DefineProperties

DeleteColumn

DeleteRow

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DoExit

DoMouseWheelDown

DoMouseWheelUp

DragDrop

Dragging

DrawCell

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndColumnDrag

EndDrag

EndRowDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetEditLimit

GetEditMask

GetEditText

GetGridHeight

GetGridWidth

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

HideEditor

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

InvalidateCell

InvalidateCol

InvalidateEditor

InvalidateRow

IsRightToLeft

KeyDown

KeyPress

ManualDock

ManualFloat

MethodAddress

MethodName

MouseCoord

MouseDown

MouseMove

MouseUp

MouseWheelHandler

MoveColRow

MoveColumn

MoveRow

NewInstance

Paint

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

RowHeightsChanged

RowMoved

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

ScrollData

SelectCell

SendToBack

SetBounds

SetEditText

SetFocus

SetTextBuf

Show

ShowEditor

ShowEditorChar

SizeChanged

Sizing

TimedScroll

TopLeftChanged

Update

UpdateAction

UpdateControlState

UpdateDesigner

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TCustomGrid.AdjustSize

TCustomGrid	See also

Adds or deletes rows or columns from the grid.

procedure AdjustSize(Index, Amount: Longint; Rows: Boolean); reintroduce; dynamic;

Description

Grid components call AdjustSize internally to fix up the number of rows or columns when the user resizes them using the mouse. Index is the index of the row or column where the insertion or deletion should begin. Amount is the number of rows or columns to insert (Amount > 0) or delete (Amount < 0). Rows is a boolean that indicates whether the rows or the columns are changing.


TCustomGrid.BeginColumnDrag

TCustomGrid	See also

Starts the dragging of a column in the grid.

function BeginColumnDrag(var Origin, Destination: Integer; const MousePt: TPoint): Boolean; dynamic;

Description

Call BeginColumnDrag to start a drag operation. BeginColumnDrag enables the grid to control where the column can be dropped. It is exposed as a protected method so that descendants of TCustomGrid can customize column dragging in a grid.


TCustomGrid.BeginRowDrag

TCustomGrid	See also

Starts the dragging of a row in the grid.

function BeginRowDrag(var Origin, Destination: Integer; const MousePt: TPoint): Boolean; dynamic;

Description

Call BeginRowDrag to start a drag operation. BeginRowDrag enables the grid to control where the row can be dropped. It is exposed as a protected method so that descendants of TCustomGrid can customize row dragging in a grid.


TCustomGrid.BoxRect

TCustomGrid	See also

Returns the screen coordinates of a specified set of cells.

function BoxRect(ALeft, ATop, ARight, ABottom: Longint): TRect;

Description

Call BoxRect to obtain the screen coordinates, in pixels, of the cells that run from the column with index ALeft to the column with index ARight and the row with index ATop to the row with index ABottom. The coordinates of cells that are not visible onscreen are not included in the final rectangle.


TCustomGrid.CalcDrawInfo

TCustomGrid	See also

Calculates the pixel locations of the grid boundaries.

TGridAxisDrawInfo = record

    EffectiveLineWidth: Integer;

    FixedBoundary: Integer;

    GridBoundary: Integer;

    GridExtent: Integer;

    LastFullVisibleCell: Longint;

    FullVisBoundary: Integer;

    FixedCellCount: Integer;

    FirstGridCell: Integer;

    GridCellCount: Integer;

    GetExtent: TGetExtentsFunc;

end;

TGridDrawInfo = record

  Horz, Vert: TGridAxisDrawInfo;

end;

procedure CalcDrawInfo(var DrawInfo: TGridDrawInfo);

Description

Use CalcDrawInfo to determine the pixel locations of the major grid boundaries in the X and Y directions, including things like the first visible column/row, the last visible column/row, the pixel extent of the fixed column/row, etc.


TCustomGrid.CalcFixedInfo

TCustomGrid	See also

Calculates the pixel locations of the fixed cells.

TGridAxisDrawInfo = record

    EffectiveLineWidth: Integer;

    FixedBoundary: Integer;

    GridBoundary: Integer;

    GridExtent: Integer;

    LastFullVisibleCell: Longint;

    FullVisBoundary: Integer;

    FixedCellCount: Integer;

    FirstGridCell: Integer;

    GridCellCount: Integer;

    GetExtent: TGetExtentsFunc;

end;

TGridDrawInfo = record

  Horz, Vert: TGridAxisDrawInfo;

end;

procedure CalcFixedInfo(var DrawInfo: TGridDrawInfo);

Description

Use CalcDrawInfo to determine the pixel locations of the fixed cells in the X and Y directions.


TCustomGrid.CalcSizingState

TCustomGrid	See also

Determines the appearance of the mouse cursor during resizing.

TGridState = (gsNormal, gsSelecting, gsRowSizing, gsColSizing, gsRowMoving, gsColMoving);

TGridAxisDrawInfo = record

    EffectiveLineWidth: Integer;

    FixedBoundary: Integer;

    GridBoundary: Integer;

    GridExtent: Integer;

    LastFullVisibleCell: Longint;

    FullVisBoundary: Integer;

    FixedCellCount: Integer;

    FirstGridCell: Integer;

    GridCellCount: Integer;

    GetExtent: TGetExtentsFunc;

end;

TGridDrawInfo = record

  Horz, Vert: TGridAxisDrawInfo;

end;

procedure CalcSizingState(X, Y: Integer; var State: TGridState; var Index: Longint; var SizingPos, SizingOfs: Integer; var FixedInfo: TGridDrawInfo); virtual;

Description

Use CalcSizingState to determine if the mouse cursor should be changed to a resize or drag cursor based on where the mouse is in the grid. For example, cursor over a grid line, in the fixed cell region, and column resize is enabled = resize cursor.


TCustomGrid.CanEditAcceptKey

TCustomGrid	See also

Indicates whether the Key parameter can be entered into the current cell.

function CanEditAcceptKey(Key: Char): Boolean; dynamic;

Description

CanEditAcceptKey provides a simple screening of keyboard input while the user is editing the contents of a cell. The CanEditAcceptKey method for TCustomGrid always returns True. Descendants of TCustomGrid override this method to screen out illegal characters.

More refined validation can be obtained by using an edit mask.


TCustomGrid.CanEditModify

TCustomGrid	See also

Indicates whether the current cell in the grid can be edited.

function CanEditModify: Boolean; dynamic;

Description

Grid components use CanEditModify internally to determine whether to allow the user to edit the current cell. CanEditModify returns True unless the inplace editor has disallowed editing for the cell.


TCustomGrid.CanEditShow

TCustomGrid	See also

Indicates whether the inplace edit control can be created to allow editing.

function  CanEditShow: Boolean; dynamic;

Description

Grid controls call CanEditShow internally before creating the editor for a cell. CanEditShow is called after the grid has determined that the field can be edited by calling CanEditModify.

CanEditShow returns False if the Options property does not indicate that the grid allows editing, or if it indicates that the grid permits row selection. Otherwise, if the Options property indicates that the grid is locked in edit mode, or if the grid has input focus, CanEditShow returns True. If the grid is not locked in edit mode and the grid does not have input focus, CanEditShow returns False.


TCustomGrid.CanGridAcceptKey

TCustomGrid	See also

Indicates whether the grid should respond to a given key combination.

function CanGridAcceptKey(Key: Word; Shift: TShiftState): Boolean; dynamic;

Description

Grid controls call CanGridAcceptKey internally to screen key combinations when the user first presses a key. The CanGridAcceptKey method for TCustomGrid always returns True. Descendants of TCustomGrid override this method to screen out irrelevant key combinations, or key combinations that indicate actions which would violate the Options or mode of the grid.


TCustomGrid.CellRect

TCustomGrid	See also

Returns the screen coordinates of a cell in the grid.

function CellRect(ACol, ARow: Longint): TRect;

Description

Call CellRect to obtain the boundaries, in pixels, of the cell in the column and row indicated by the ACol and ARow parameters. The top left cell is specified when ACol and ARow are set to zero.

If the indicated cell is not visible, CellRect returns an empty rectangle.


TCustomGrid.CheckColumnDrag

TCustomGrid	See also

CheckColumnDrag validates whether the column currently selected for dragging can be dropped at the current location.

function CheckColumnDrag(var Origin, Destination: Integer; const MousePt: TPoint): Boolean; dynamic;

Description

Use CheckColumnDrag to validate that the column currently selected for dragging can be dropped at the current location.  CheckColumnDrag can change the Origin (the column being dragged) and/or the Destination (the drop target), as needed, to keep the grid's columns in order.


TCustomGrid.CheckRowDrag

TCustomGrid	See also

CheckRowDrag validates whether the row currently selected for dragging can be dropped at the current location.

function CheckRowDrag(var Origin, Destination: Integer; const MousePt: TPoint): Boolean; dynamic;

Description

Use CheckRowDrag to validate that the row currently selected for dragging can be dropped at the current location.  CheckRowDrag can change the Origin (the row being dragged) and/or the Destination (the drop target), as needed, to keep the grid's rows in order.


TCustomGrid.ColumnMoved

TCustomGrid	See also

Provides the interface for a method that responds when the position of a column changes.

procedure ColumnMoved(FromIndex, ToIndex: Longint); dynamic;

Description

ColumnMoved is called immediately after a column in the grid has moved. The FromIndex parameter is the old index of the column, and the ToIndex parameter is the new index. The ColumnMoved method of TCustomGrid does nothing. Descendants of TCustomGrid override this method to make internal adjustments or to generate an OnColumnMoved event.


TCustomGrid.ColWidthsChanged

TCustomGrid	See also

Responds when the column widths change.

procedure ColWidthsChanged; dynamic;

Description

ColWidthsChanged is called immediately after the column widths change. The change can result from setting the ColWidths property, from setting the DefaultColWidth property, from moving one of the columns, or from resizing the columns with the mouse.

ColWidthsChanged adjusts the scroll bar and the position of the inplace editor to take into account the new column size and positions of the columns.


TCustomGrid.Create

TCustomGrid	See also

Creates an instance of TCustomGrid.

constructor Create(AOwner: TComponent); override;

Description

 Call Create to create a grid control at runtime. Grid controls placed on a form at design time are created automatically.

Pass a single Component as a parameter to provide the grid with an Owner that is responsible for freeing the grid.After calling the inherited constructor, Create initializes

BorderStyle property to bsSingle.

ColCount and RowCount to 5.

Color to clWindow and FixedColor to clBtnFace.

ControlStyle to [csCaptureMouse, csOpaque, csDoubleClicks, csFramed]

DefaultColWidth to 64 and DefaultRowHeight to 24.

DefaultDrawing to True.

EditorMode to False.

FixedCols and FixedRows to 1.

GridLineWidth to 1.

Options to [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect]

ParentColor to False.

ScrollBars to ssBoth.

TabStop to True.


TCustomGrid.CreateEditor

TCustomGrid	See also

Creates the inplace editor control.

function CreateEditor: TInplaceEdit; virtual;

Description

Grid controls call CreateEditor internally the first time the grid goes into edit mode. CreateEditor is exposed as a protected method so that descendants of TCustomGrid can substitute a specialized descendant of TInplaceEdit to handle cell editing.


TCustomGrid.CreateParams

TCustomGrid	See also

Initializes the window-creation parameter record.

procedure CreateParams(var Params: TCreateParams); override;

Description

The CreateWnd method is called internally to specify the properties of the window that implements this control. These properties are set in the window-creation parameter record passed as Params. The fields of this record become the parameters to a call to the CreateWindowEx API function.

After calling the inherited method, CreateParams adjusts the value of Params to request that the grid receive double click messages, and to implement the values of the Ctrl3D, ScrollBars, and BorderStyle properties.


TCustomGrid.DefineProperties

TCustomGrid	See also

Adds the ColWidths and RowHeights properties to the values saved with the grid.

procedure DefineProperties(Filer: TFiler); override;

Description

DefineProperties overrides the inherited method to save the ColWidths and RowHeights properties with the grid when they contain values other than the default widths and heights.


TCustomGrid.DeleteColumn

TCustomGrid	See also

Deletes a specified column from the grid.

procedure DeleteColumn(ACol: Longint);

Description

Call DeleteColumn to remove a column from the middle of the grid. Provide the index of the column to remove as ACol. To remove the last column from the grid, set the ColCount property instead.


TCustomGrid.DeleteRow

TCustomGrid	See also

Deletes a specified from the grid.

procedure DeleteRow(ARow: Longint);

Description

Call DeleteRow to remove a row from the middle of the grid. Provide the index of the row to remove as ARow. To remove the last row from the grid, set the RowCount property instead.


TCustomGrid.Destroy

TCustomGrid	See also

Destroys an instance of TCustomGrid.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the grid reference is not nil, and only then calls Destroy.


TCustomGrid.DoExit

TCustomGrid	See also

Hides the inplace editor when selection moves to another control in a form.

procedure DoExit; override;

Description

After calling the inherited method, which generates an OnExit event, DoExit hides the inplace editor unless the Options property includes goAlwaysShowEditor.


TCustomGrid.DoMouseWheelDown

TCustomGrid	See also

Performs tasks when the mouse wheel is rotated downward.

function DoMouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean; override;

Description

Override DoMouseWheelDown to perform tasks when the mouse wheel is rotated downward.

DoMouseWheeldown should return False if the message should be handled by the control’s parent.

By default, DoMouseWheelDown calls the OnMouseDown event handler and returns False.


TCustomGrid.DoMouseWheelUp

TCustomGrid	See also

Performs tasks when the mouse wheel is rotated upward.

function DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean; override;

Description

Override DoMouseWheelUp to perform tasks when the mouse wheel is rotated downward.

DoMouseWheeldown should return False if the message should be handled by the control’s parent.

By default, DoMouseWheelUp calls the OnMouseUp event handler and returns False.


TCustomGrid.DrawCell

TCustomGrid	See also

Provides the abstract prototype for a method that draws the contents of a cell in the grid.

procedure DrawCell(ACol, ARow: Longint; ARect: TRect; AState: TGridDrawState); virtual; abstract;

Description

Descendants of TCustomGrid implement the DrawCell method to draw the contents of the cell or to generate an OnDrawCell event. If the DefaultDrawing property is True, the background of the cell is painted before DrawCell is called, and the 3D effects of the fixed cells or the focus rectangle around the focused cell are drawn after DrawCell.

The ACol and ARow parameters give the column and row indexes of the cell that should be drawn. The ARect parameter gives the boundaries of the cell in the coordinates of the canvas. The AState parameter indicates whether the cell is selected, whether the cell has input focus, and whether the cell is in the fixed, non-scrolling portion of the grid.


TCustomGrid.EndColumnDrag

TCustomGrid	See also

Ends the dragging of a column in the grid.

function EndColumnDrag(var Origin, Destination: Integer; const MousePt: TPoint): Boolean; dynamic;

Description

Call EndColumnDrag to end a drag operation. EndColumnDrag enables the grid to control where the column can be dropped. It is exposed as a protected method so that descendants of TCustomGrid can customize column dragging in a grid.


TCustomGrid.EndRowDrag

TCustomGrid	See also

Ends the dragging of a row in the grid.

function EndRowDrag(var Origin, Destination: Integer; const MousePt: TPoint): Boolean; dynamic;

Description

Call EndRowDrag to end a drag operation. EndRowDrag enables the grid to control where the row can be dropped. It is exposed as a protected method so that descendants of TCustomGrid can customize row dragging in a grid.


TCustomGrid.GetEditLimit

TCustomGrid	See also

Provides the interface for a method that limits the number of characters the user can type into cells.

function GetEditLimit: Integer; dynamic;

Description

The inplace editor calls GetEditLimit to determine if a limit should be placed on the number of characters a user can type into a cell. GetEditLimit sets no limits. Descendants of TCustomGrid override this method to limit the text for certain cells.


TCustomGrid.GetEditMask

TCustomGrid	See also

Provides the interface for a method that returns an input mask for the specified cell.

function  GetEditMask(ACol, ARow: Longint): String; dynamic;

Description

The inplace editor calls GetEditMask to obtain any input mask associated with the cell specified by the ACol and ARow parameters. GetEditMask returns an empty string, indicating that the cell has no input mask. Descendants of TCustomGrid override this method to provide an input mask or generate an OnGetEditMask event.


TCustomGrid.GetEditText

TCustomGrid	See also

Returns the value of the indicated cell formatted for editing.

function  GetEditText(ACol, ARow: Longint): String; dynamic;

Description

The inplace editor calls GetEditText to obtain the text for the indicated cell. GetEditText returns an empty string. Descendants of TCustomGrid override the GetEditText method to return a string that represents the contents of the cell indicated by the ACol and ARow parameters.


TCustomGrid.GetGridHeight

TCustomGrid	See also

Returns the value of the GridHeight property.

function GetGridHeight: Integer;

Description

GetGridHeight is the protected property access method for the GridHeight property. It computes the value of the GridHeight property based on the row heights, separator width, and the size of the control.


TCustomGrid.GetGridWidth

TCustomGrid	See also

Returns the value of the GridWidth property.

function GetGridWidth: Integer;

Description

GetGridWidth is the protected property access method for the GridWidth property. It computes the value of the GridWidth property based on the column widths, separator width, and the size of the control.


TCustomGrid.HideEditor

TCustomGrid	See also

Hides the inplace editor when it is not in use.

procedure HideEditor;

Description

Grid controls call HideEditor when the grid goes out of edit mode. HideEditor hides the window of the inplace editor.


TCustomGrid.InvalidateCell

TCustomGrid	See also

Invalidates the region occupied by a cell so that it will be repainted with the next Windows paint message.

procedure InvalidateCell(ACol, ARow: Longint);

Description

Call InvalidateCell when the contents of a cell change so that the cell will need to be repainted. The ACol parameter is the column index of the cell, and the ARow parameter is the row index.


TCustomGrid.InvalidateCol

TCustomGrid	See also

Invalidates the region occupied by a column so that it will be repainted with the next Windows paint message.

procedure InvalidateCol(ACol: Longint);

Description

Call InvalidateCol when a column changes so that the area it occupies will need to be repainted. The ACol parameter is the column index.


TCustomGrid.InvalidateEditor

TCustomGrid	See also

Causes the inplace editor to repaint itself, moving to a new location if necessary.

procedure InvalidateEditor;

Description

InvalidateEditor is called when the selected cell changes while the grid is in edit mode.


TCustomGrid.InvalidateRow

TCustomGrid	See also

Invalidates the region occupied by a row so that it will be repainted with the next Windows paint message.

procedure InvalidateRow(ARow: Longint);

Description

Call InvalidateRow when a row changes so that the area it occupies will need to be repainted. The ARow parameter is the row index.


TCustomGrid.KeyDown

TCustomGrid	See also

Provides special processing when the user presses a key.

procedure KeyDown(var Key: Word; Shift: TShiftState); override;

Description

After generating an OnKeyDown event, KeyDown calls CanGridAcceptKey to screen out problematic key combinations. KeyDown moves to the appropriate cell in response to navigational key combinations, or sets the EditorMode property to True when the user presses F2.


TCustomGrid.KeyPress

TCustomGrid	See also

Provides special processing when the user presses a key.

procedure KeyPress(var Key: Char); override;

Description

After generating an OnKeyPress event, KeyPress toggles the EditorMode property when the user presses the Enter key. KeyPress is called after the KeyDown method, but before the user releases the key.


TCustomGrid.MouseCoord

TCustomGrid	See also

Returns the row and column indexes of the cell that contains a point specified in screen coordinates.

type TGridCoord = record

    X: Longint;

    Y: Longint;

  end;

function MouseCoord(X, Y: Integer): TGridCoord;

Description

Call MouseCoord to locate the column and row of the cell which contains a given screen coordinate. Usually, MouseCoord is used to locate the cell that is under the mouse.


TCustomGrid.MouseDown

TCustomGrid	See also

Provides special processing when the user presses a mouse button.

procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;

Description

MouseDown hides the editor window so that it can move selection to the cell that receives the mouse click. If the mouse lands in the hot region for beginning a move or resize of a row or column, MouseDown starts the move or resize, and provides visual feedback by changing the cursor. If the editor window was hidden, it is brought back up in its new location. Finally, MouseDown generates an OnMouseDown event.


TCustomGrid.MouseMove

TCustomGrid	See also

Provides special processing when the user moves the mouse.

procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;

Description

If the grid is in the middle of moving or resizing a row or column, or in the middle of selecting a range of cells using the mouse, MouseMove calculates the changes implied by the mouse move and provides visual feedback to the user. Finally, MouseMove generates an OnMouseMove event.


TCustomGrid.MouseUp

TCustomGrid	See also

Provides special processing when the user releases the mouse button.

procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;

Description

MouseUp finishes a move or resize operation on a row or column, or if the user is selecting a range of cells using the mouse, MouseUp finishes the select operation. Finally, MouseUp generates an OnMouseUp event.


TCustomGrid.MoveColRow

TCustomGrid	See also

Selects the cell indicated by the ACol and ARow parameters.

procedure MoveColRow(ACol, ARow: Longint; MoveAnchor, Show: Boolean);

Description

Grid controls call MoveColRow internally when changing the selected cell or cells. MoveColRow selects the indicated cell, but does not take care of removing any previous selection.

The ACol and ARow parameters are the column index and the row index of the cell to be selected. The MoveAnchor parameter indicates whether the new cell becomes the upper left corner of the selected region. MoveAnchor is True unless MoveColRow is called when extending a multicell selected region. The Show parameter indicates whether MoveColRow should ensure that the newly selected cell is visible.


TCustomGrid.MoveColumn

TCustomGrid	See also

Moves a column to a new position.

procedure MoveColumn(FromIndex, ToIndex: Longint);

Description

Call MoveColumn to move the column identified by the FromIndex parameter to the position specified by the ToIndex parameter.


TCustomGrid.MoveRow

TCustomGrid	See also

Moves a row to a new position.

procedure MoveRow(FromIndex, ToIndex: Longint);

Description

Call MoveRow to move the row identified by the FromIndex parameter to the position specified by the ToIndex parameter.


TCustomGrid.Paint

TCustomGrid	See also

Draws the image of the grid control on the screen.

procedure Paint; override;

Description

Paint is called when the grid receives a Windows paint message. Paint draws the grid, calling the DrawCell method when it is time to paint the contents of each cell. If DefaultDrawing is False, Paint does not draw the background of the cells, provide the raised 3D effects on the fixed cells, or draw the focus rectangle around the selected cell when it has focus.


TCustomGrid.RowHeightsChanged

TCustomGrid	See also

Responds when the row heights change.

procedure RowHeightsChanged; dynamic;

Description

RowHeightsChanged is called immediately after the row heights change. The change can result from setting the RowHeights property, from setting the DefaultRowHeight property, from moving one of the rows, or from resizing the rows with the mouse.

RowHeightsChanged adjusts the scroll bar and the position of the inplace editor to take into account the new row size and positions of the rows.


TCustomGrid.RowMoved

TCustomGrid	See also

Provides the interface for a method that responds when the position of a row changes.

procedure RowMoved(FromIndex, ToIndex: Longint); dynamic;

Description

RowMoved is called immediately after a row in the grid changes position. The FromIndex parameter is the old index of the row, and the ToIndex parameter is the new index. The RowMoved method of TCustomGrid does nothing. Descendants of TCustomGrid override this method to make internal adjustments or to generate an OnRowMoved event.


TCustomGrid.ScrollData

TCustomGrid	See also

Scrolls the visual image of the cells in the grid.

procedure ScrollData(DX, DY: Integer);

Description

Grid controls call ScrollData internally when the nonfixed rows or columns scroll. ScrollData updates the image of the grid.


TCustomGrid.SelectCell

TCustomGrid	See also

Determines whether a particular cell in the grid can be selected.

function SelectCell(ACol, ARow: Longint): Boolean; virtual;

Description

Grid controls call SelectCell internally before attempting to move selection to a the cell identified by the ACol and ARow parameters. ACol and ARow are the column and row indexes for the cell, where the first column has index 0, and the top row has index 0.

The SelectCell method for TCustomGrid always returns True, allowing the cell to be selected. Descendants of TCustomGrid override this method to check the properties of the information displayed in the cell or generating an OnSelectCell event.


TCustomGrid.SetEditText

TCustomGrid	See also

Provides the interface for a method that updates the text associated with a cell.

procedure SetEditText(ACol, ARow: Longint; const Value: string); dynamic;

Description

SetEditText is called by the inplace editor so that the grid can store the new value for the current cell. The SetEditText method for TCustomGrid does nothing. Descendants of TCustomGrid override this method to update an internal representation of the cell’s value, or to generate an OnSetEditText event.


TCustomGrid.ShowEditor

TCustomGrid	See also

Displays the inplace editor when the grid enters edit mode.

procedure ShowEditor;

Description

Grid controls call ShowEditor when the grid enters edit mode. ShowEditor displays the window of the inplace editor over the currently selected cell. If the inplace editor does not yet exist, ShowEditor creates it.


TCustomGrid.ShowEditorChar

TCustomGrid	See also

Displays the inplace editor, with its text set to the specified character.

procedure ShowEditorChar(Ch: Char);

Description

Grid controls call ShowEditorChar when the user types a character into a cell and the editor is not already showing. ShowEditorChar displays the window of the inplace editor over the currently selected cell, and sets its text property to the character Ch. If the inplace editor does not yet exist, ShowEditorChar creates it.


TCustomGrid.SizeChanged

TCustomGrid	See also

Responds to changes in the size of the grid.

procedure SizeChanged(OldColCount, OldRowCount: Longint); dynamic;

Description

SizeChanged provides the interface for a method that responds to changes in the number of rows or columns in the grid. The SizeChanged method of TCustomGrid does nothing. Descendants of TCustomGrid override this method to make internal adjustments or generate events.


TCustomGrid.Sizing

TCustomGrid	See also

Indicates whether the indicated coordinates are on one of the resize hot zones of the graph.

function Sizing(X, Y: Integer): Boolean;

Description

Grid controls call Sizing internally with the coordinates of a mouse click to determine whether the user is about to resize a row or column.


TCustomGrid.TimedScroll

TCustomGrid	See also

Extends a move, resize, or selection out of the scrollable region when the user drags the mouse in a direction where the grid is scrolled.

type TGridScrollDirection = set of (sdLeft, sdRight, sdUp, sdDown);

procedure TimedScroll(Direction: TGridScrollDirection); dynamic;

Description

TimedScroll is called periodically as the user continues to drag with the mouse outside of the scrollable cells in the grid. TimedScroll does nothing unless the user is moving a row or column, resizing a row or column, or selecting a multiple cell region using the mouse. TimedScroll scrolls the cells in the grid to allow the operation to continue into the portion of the grid that was hidden due to scrolling.


TCustomGrid.TopLeftChanged

TCustomGrid	See also

Updates the position of the inplace editor when the grid scrolls.

procedure TopLeftChanged; dynamic;

Description

Grid controls call TopLeftChanged internally, whenever the LeftCol or TopRow property changes.

Descendants of TCustomGrid override this method to make additional adjustments or to generate an OnTopLeftChanged event.


TCustomGrid.UpdateDesigner

TCustomGrid	See also

Notifies the designer when rows and columns of the grid are moved or resized.

procedure UpdateDesigner;

Description

At design time, the designer automatically keeps track of property changes so that it can prompt the user to save any changes. Moving or resizing the rows and columns of the grid using the mouse bypasses this system. When such changes occur, UpdateDesigner notifies the designer that the properties of the grid have changed and that the changes should be saved.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TCustomHotKey

Hierarchy	Properties	Methods

TCustomHotKey is the base class for objects that wrap the Windows hot key Common Control.

Unit

comctrls

Description

TCustomHotKey is an abstract class that encapsulates behavior of an object that is used to set a shortcut property at runtime. Hot key objects are used to perform an action quickly by enabling users to link the hot key to a combination of keystrokes that will execute the action. TCustomHotKey introduces properties to:

Associate the hot key with keystrokes to perform an action

Select a key combination at design time

Invalidate specific modifier keys

To change the key combination at runtime hold down the Alt, Ctrl or Shift keys or combinations of them and type a letter or number. The hot key property can then be assigned to the shortcut property of a menu item, for example.

Hot key classes that descend from TCustomHotKey inherit the basic functionality of TCustomHotKey. Use TCustomHotKey as a base class for deriving specialized hot key objects.


TCustomHotKey properties

TCustomHotKey	Alphabetically	Legend

In TCustomHotKey

AutoSize

HotKey

InvalidKeys

Modifiers

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomHotKey properties

TCustomHotKey	By object	Legend

Action

Align

Anchors

AutoSize

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

HotKey

InvalidKeys

Left

LRDockWidth

Modifiers

Name

Owner

Parent

ParentWindow

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

Visible


TCustomHotKey.AutoSize

TCustomHotKey

Determines whether the hot key automatically changes its height to accomodate the font size.

property AutoSize: Boolean;

Description

Use AutoSize to fully display the font on the hot key control. When AutoSize is True, the height of the hot key changes to display the key combinations typed in it. When AutoSize is False, the hot key remains the same height, regardless of any font changes. The default value is True.


TCustomHotKey.HotKey

TCustomHotKey	See also 	Example

Contains the current key combination of the hot key control.

property HotKey: TShortCut;

Description

Use HotKey to set or change the key combination associated with the hot key. Alt+A is the default. To modify the value of HotKey either edit it directly or set the value of the Modifiers property. At runtime HotKey is reset when the hot key has focus and the user presses valid key combinations.


TCustomHotKey.InvalidKeys

TCustomHotKey	See also 	Example

Allows you to specify that one or more modifier keys should be considered invalid.

type

  THKInvalidKey = (hcNone, hcShift, hcCtrl, hcAlt, hcShiftCtrl, hcShiftAlt, hcCtrlAlt, hcShiftCtrlAlt);

THKInvalidKeys = set of THKInvalidKey;

property InvalidKeys: THKInvalidKeys;

Description

Use InvalidKeys to select which modifier keys are not allowed. If this property is set, a default modifier should also be specified in the Modifiers property. When the invalid key is selected, the default modifier is displayed in its place.

THKInvalidKey is the type of the InvalidKeys property. These are the possible values:

Value	Meaning

hcNone	Unmodified keys are invalid.

hcShift	The Shift key is invalid as a modifier.

hcCtrl	The Ctrl key is invalid as a modifier.

hcAlt	The Alt key is invalid as a modifier.

hcShiftCtrl	The Shift+Ctrl key combination is invalid as a modifier.

hcShiftAlt	The Shift+Alt key combinations invalid as a modifier.

hcCtrlAlt	The Ctrl+Alt key combination is invalid as a modifier.

hcShiftCtrlAlt	The Shift+Ctrl+Alt key combination is invalid as a modifier.

The default values are hcNone and hcShift.


TCustomHotKey.Modifiers

TCustomHotKey 	Example

Specifies the key or keys that are used in combination with a  non-modifier key.

type

  THKModifier = (hkShift, hkCtrl, hkAlt, hkExt);

  THKModifiers = set of THKModifier;

property Modifiers: THKModifiers;

Description

Use Modifiers to select a modifier key such as Ctrl, Alt, or Shift for the hot key. These are the possible values:

Value	Meaning

hkShift	The Shift key is used as a modifier.

hkCtrl	The Ctrl key is used as a modifier.

hkAlt	The Alt key is used as a modifier.

hkExt	The Extra key is used as a modifier.

The default value is hkAlt.

Modifier keys are used with other non-modifier keys such as character and function keys, arrow keys, and so on. More than one modifier key can be used.


TCustomHotKey methods

TCustomHotKey	Alphabetically

In TCustomHotKey

Create

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomHotKey methods

TCustomHotKey	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TCustomHotKey.Create

TCustomHotKey	See also

Instantiates a hot key control.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a hot key control at runtime. For hot key controls created at design time, Create is called automatically.

Create allocates memory for a hot key control and calls the inherited Create. Then it sets default values for the Width and Height properties, and initializes the following properties:

TabStop to True

ParentColor to False

AutoSize to True

InvalidKeys to hcNone and hcShift

Modifiers to [hkAlt]

HotKey to 'Alt+A'


Scope

Protected

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomIniFile

Hierarchy	Properties	Methods	See also

TCustomIniFile is the abstract base type for components that encapsulate access to 16-bit Windows 3.x INI files or provide similar access to the system registry on 32-bit platforms.

Unit

inifiles

Description

Use TCustomIniFile as a base class when defining components that access INI files. TCustomIniFile introduces properties and methods to handle storage and retrieval of application-specific information and settings in a Windows 3.x INI file.

Do not create instances of TCustomIniFile. Instead, use or create descendants of TCustomIniFile, such as TIniFile and TMemIniFile.

Note:	TCustomIniFile is supported only for migration purposes and backward compatibility. 32-bit Windows replaces INI files with a system registry where all applications store and retrieve their settings. Applications that target 32-bit Windows should use the system registry instead of INI files. Applications that use both INI files and the system registry can use descendants of TCustomIniFile to handle both media in a unified manner.

Delphi provides objects for handling the system registry, such as TRegistry. TRegistryIniFile also encapsulates the registry, but provides an easier migration path for existing Windows 3.1 applications that are upgraded 32-bit Windows.


TCustomIniFile properties

TCustomIniFile	Alphabetically	Legend

In TCustomIniFile

FileName


TCustomIniFile properties

TCustomIniFile	By object	Legend

FileName


TCustomIniFile.FileName

TCustomIniFile	See also

Contains the name of the INI file from which to read and to which to write application-specific information.

property FileName: String;

Description

Inspect FileName to retrieve the name of the INI file used by the application for its application settings and information. The methods that read and write INI file information automatically handle opening and closing the file specified by FileName.

FileName is read-only. The name of the INI file the object uses is supplied as the parameter for the Create method.

Note:	Usually INI files are stored in the \WINDOWS directory. To work with an INI file in another location, specify the full path name of the file in the FileName parameter passed to the Create method of TCustomIniFile.


TCustomIniFile methods

TCustomIniFile	Alphabetically

In TCustomIniFile

Create

DeleteKey

EraseSection

ReadBool

ReadDate

ReadDateTime

ReadFloat

ReadInteger

ReadSection

ReadSections

ReadSectionValues

ReadString

ReadTime

SectionExists

UpdateFile

ValueExists

WriteBool

WriteDate

WriteDateTime

WriteFloat

WriteInteger

WriteString

WriteTime

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCustomIniFile methods

TCustomIniFile	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

DeleteKey

Destroy

Dispatch

EraseSection

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadBool

ReadDate

ReadDateTime

ReadFloat

ReadInteger

ReadSection

ReadSections

ReadSectionValues

ReadString

ReadTime

SafeCallException

SectionExists

UpdateFile

ValueExists

WriteBool

WriteDate

WriteDateTime

WriteFloat

WriteInteger

WriteString

WriteTime


TCustomIniFile.Create

TCustomIniFile	See also	Example

Creates a TCustomIniFile object for an application.

constructor Create(const FileName String);

Description

Do not instantiate a TCustomIniFile. Instead, create descendant class or use one of the built-in descendant classes, such as TIniFile or TMemIniFile. Create constructs a TCustomIniFile object for an application. Create inherits Create from TObject, and creates an additional property, FileName, which is used to specify the name of the INI file to use.

Note:	Usually INI files are stored in the \WINDOWS directory. To work with an INI file in another location, specify the full path name of the file in FileName.


TCustomIniFile.DeleteKey

TCustomIniFile	See also 	Example

Erases the data value associated with an INI file entry.

procedure DeleteKey(const Section, Ident: String); virtual; abstract;

Description

Call DeleteKey to erase a data value associated with an INI file entry. Section is string containing the name of an INI file section, and Ident is a string containing the name of the key from for which to set a nil value.

Note:	Attempting to erase a data value in a non-existent section or attempting to erase data from a non-existent key are not errors. In these cases, DeleteKey creates the section and key and sets its initial value to an empty value.


TCustomIniFile.EraseSection

TCustomIniFile	See also

Erases an entire section of an INI file.

procedure EraseSection(const Section: String); virtual; abstract;

Description

Call EraseSection to remove a section, all its keys, and their data values from an INI file. Section identifies the INI file section to remove. If a section cannot be removed, an exception is raised.


TCustomIniFile.ReadBool

TCustomIniFile	See also 	Example

Retrieves a Boolean value from an INI file.

function ReadBool (const Section, Ident: String; Default: Boolean): Boolean; virtual;

Description

Call ReadBool to read a Boolean value from an INI file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the Boolean value. Default is the Boolean value to return if the:

Section does not exist.

Key does not exist.

Data value for the key is not assigned.


TCustomIniFile.ReadDate

TCustomIniFile	See also

Retrieves a date value from an INI file.

function ReadDate (const Section, Ident: string; Default: TDateTime): TDateTime; virtual;

Description

Call ReadDate to read a date value from an INI file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the date value. Default is the date value to return if the:

Section does not exist.

Key does not exist.

Data value for the key is not assigned.


TCustomIniFile.ReadDateTime

TCustomIniFile	See also

Retrieves a date-time value from an INI file.

function ReadDateTime (const Section, Ident: String; Default: TDateTime): TDateTime; virtual;

Description

Call ReadDateTime to read a date-time value from an INI file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the date-time value. Default is the date-time value to return if the:

Section does not exist.

Key does not exist.

Data value for the key is not assigned.


TCustomIniFile.ReadFloat

TCustomIniFile	See also

Retrieves a float value from an INI file.

function ReadFloat (const Section, Ident: String; Default: Double): Double; virtual;

Description

Call ReadFloat to read a float value from an INI file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the float value. Default is the float value to return if the:

Section does not exist.

Key does not exist.

Data value for the key is not assigned.


TCustomIniFile.ReadInteger

TCustomIniFile	See also 	Example

Retrieves an integer value from an INI file.

function ReadInteger(const Section, Ident: String; Default: Longint): Longint; virtual;

Description

Call ReadInteger to read an integer value from an INI file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the value. Default is the integer value to return if the:

Section does not exist.

Key does not exist.

Data value for the key is not assigned.


TCustomIniFile.ReadSection

TCustomIniFile	See also

Reads all the key names from a specified section of an INI file into a string list.

procedure ReadSection (const Section: String; Strings: TStrings); virtual; abstract;

Description

Call ReadSection to retrieve the names of all keys within a specified section of an INI file into a string list object.

Section identifies the section from which to retrieve a list of key names. Strings specifies the string object to hold the retrieved names. Strings can point to a TString object such as a string list, or to a component property, such as Items for a TListBox component, that is a TString object itself.


TCustomIniFile.ReadSections

TCustomIniFile	See also

Reads the names of all sections in an INI file into a string list.

procedure ReadSections(Strings: TStrings); virtual; abstract;

Description

Call ReadSections to retrieve the names of all sections in an INI file into a string list object.

Strings specifies the string object to hold the retrieved names. Strings can point to a TString object, or to a component property, such as Items for a TListBox component, that is a TString object itself.


TCustomIniFile.ReadSectionValues

TCustomIniFile	See also 	Example

Reads the values from all keys within a section of an INI file into a string list.

procedure ReadSectionValues(const Section: String; Strings: TStrings); virtual; abstract;

Description

Call ReadSectionValues to read the values from all keys within a specified section of an INI file into a string list object. Section identifies the section in the file from which to read key values. Strings is the string list object into which to read the values.

Strings specifies the string object to hold the retrieved names. Strings can point to a TString object, or to a component property, such as Items for a TListBox component, that is a TString object itself.


TCustomIniFile.ReadString

TCustomIniFile	See also 	Example

Retrieves a string value from an INI file.

function ReadString(const Section, Ident, Default: String): String; virtual; abstract;

Description

Call ReadString to read a string value from an INI file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the value. Default is the string value to return if the:

Section does not exist.

Key does not exist.

Data value for the key is not assigned.


TCustomIniFile.ReadTime

TCustomIniFile	See also

Retrieves a time value from an INI file.

function ReadTime (const Section, Ident: String; Default: TDateTime): TDateTime; virtual;

Description

Call ReadTime to read a time value from an INI file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the time value. Default is the time value to return if the:

Section does not exist.

Key does not exist.

Data value for the key is not assigned.


TCustomIniFile.SectionExists

TCustomIniFile	See also

Indicates whether a section exists in the INI file.

function SectionExists (const Section: String): Boolean;

Description

Use SectionExists to determine whether a section exists within the INI file specified in FileName.

Section is the INI file section SectionExists determines the existence of.

SectionExists returns a Boolean value that indicates whether the section in question exists.


TCustomIniFile.UpdateFile

TCustomIniFile	See also

Flushes buffered INI file data to disk.

function UpdateFile; virtual; abstract;

Description

Call UpdateFile to flush buffered reads from and writes to the INI file to disk. UpdateFile is useful under Windows95, but has no effect under Windows NT as NT does not buffer INI file reads and writes.


TCustomIniFile.ValueExists

TCustomIniFile	See also

Indicates whether a key exists in the INI file.

function ValueExists (const Section, Ident: String): Boolean;

Description

Use ValueExists to determine whether a key exists in the INI file specified in Filename.

Section is the section in the INI file in which to search for the key.

Ident is the name of the key to search for.

ValueExists returns a Boolean value that indicates whether the key exists in the specified section.


TCustomIniFile.WriteBool

TCustomIniFile	See also 	Example

Writes a Boolean value to an INI file.

procedure WriteBool(const Section, Ident: String; Value: Boolean); virtual;

Description

Call WriteBool to write a Boolean value to an INI file. Section identifies the section in the file that contain the key to which to write. Ident is the name of the key for which to set a value. Value is the Boolean value to write.

Note:	Attempting to write a data value to a non-existent section or attempting to write data to a non-existent key are not errors. In these cases, WriteBool creates the section and key and sets its initial value to Value.


TCustomIniFile.WriteDate

TCustomIniFile	See also

Writes a date value to an INI file.

procedure WriteDate(const Section, Ident: String; Value: TDateTime); virtual;

Description

Call WriteDate to write a date value to an INI file. Section identifies the section in the file that contain the key to which to write. Ident is the name of the key for which to set a value. Value is the date value to write.

Note:	Attempting to write a data value to a non-existent section or attempting to write data to a non-existent key are not errors. In these cases, WriteDate creates the section and key and sets its initial value to Value.


TCustomIniFile.WriteDateTime

TCustomIniFile	See also

Writes a date-time value to an INI file.

procedure WriteDateTime(const Section, Ident: String; Value: TDateTime); virtual;

Description

Call WriteDateTime to write a date-time value to an INI file. Section identifies the section in the file that contain the key to which to write. Ident is the name of the key for which to set a value. Value is the date-time value to write.

Note:	Attempting to write a data value to a non-existent section or attempting to write data to a non-existent key are not errors. In these cases, WriteDateTime creates the section and key and sets its initial value to Value.


TCustomIniFile.WriteFloat

TCustomIniFile	See also

Writes a float value to an INI file.

procedure WriteFloat(const Section, Ident: String; Value: Double); virtual;

Description

Call WriteFloat to write a float value to an INI file. Section identifies the section in the file that contain the key to which to write. Ident is the name of the key for which to set a value. Value is the float value to write.

Note:	Attempting to write a data value to a non-existent section or attempting to write data to a non-existent key are not errors. In these cases, WriteFloat creates the section and key and sets its initial value to Value.


TCustomIniFile.WriteInteger

TCustomIniFile	See also 	Example

Writes an integer value to an INI file.

procedure WriteInteger(const Section, Ident: String; Value: Longint); virtual;

Description

Call WriteInteger to write an integer value to an INI file. Section identifies the section in the file that contain the key to which to write. Ident is the name of the key for which to set a value. Value is the integer value to write.

Note:	Attempting to write a data value to a non-existent section or attempting to write data to a non-existent key are not errors. In these cases, WriteInteger creates the section and key and sets its initial value to Value.


TCustomIniFile.WriteString

TCustomIniFile	See also 	Example

Writes a string value to an INI file.

procedure WriteString(const Section, Ident, Value: String); virtual; abstract;

Description

Call WriteString to write a string value to an INI file. Section identifies the section in the file that contain the key to which to write. Ident is the name of the key for which to set a value. Value is the string value to write.

Note:	Attempting to write a data value to a non-existent section or attempting to write data to a non-existent key are not errors. In these cases, WriteString creates the section and key and sets its initial value to Value.


TCustomIniFile.WriteTime

TCustomIniFile	See also

Writes a time value to an INI file.

procedure WriteTime(const Section, Ident: String; Value: TDateTime); virtual;

Description

Call WriteTime to write a time value to an INI file. Section identifies the section in the file that contain the key to which to write. Ident is the name of the key for which to set a value. Value is the time value to write.

Note:	Attempting to write a data value to a non-existent section or attempting to write data to a non-existent key are not errors. In these cases, WriteTime creates the section and key and sets its initial value to Value.


Accessibility

Read-only


Hierarchy

TObject


TCustomImageList

Hierarchy	Properties	Methods	Events	See also

TCustomImageList is the abstract base class for collections of same-sized images, each of which can be referred to by its index.

Unit

imglist

Description

Image lists are used to efficiently manage large sets of icons or bitmaps. All images in an image list are contained in a single, wide bitmap in screen device format. An image list may also include a monochrome bitmap that contains masks that are combined with the images to produce a transparent effect such as is common in icons.


TCustomImageList properties

TCustomImageList	Alphabetically	Legend

In TCustomImageList

AllocBy

BkColor

BlendColor

Count

DrawingStyle

Handle

Height

ImageType

Masked

ShareImages

Width

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TCustomImageList properties

TCustomImageList	By object	Legend

AllocBy

BkColor

BlendColor

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Count

DesignInfo

DrawingStyle

Handle

Height

ImageType

Masked

Name

Owner

ShareImages

Tag

VCLComObject

Width


TCustomImageList.AllocBy

TCustomImageList	See also

Sets the number of images by which the image list will grow when it needs to make room for new images.

property AllocBy: Integer;

Description

Use the AllocBy method to specify the number of new images that can be added to the resized image list.


TCustomImageList.BkColor

TCustomImageList	See also

Determines which background color to use when drawing an image.

property BkColor: TColor;

Description

Use BkColor to specify the color used for the masked regions of the images in the list.  When BkColor is clNone, the image is drawn transparently using the mask to define the transparent areas. Otherwise, the value of BkColor appears in the masked out portions.

Note:	BkColor has no effect when the Masked property is False.


TCustomImageList.BlendColor

TCustomImageList	See also

Determines which foreground color to use when drawing an image.

property BlendColor: TColor;

Description

Set BlendColor to cause the images in the list to be combined with the specified color when the DrawingStyle is dsFocus or dsSelected.  More of BlendColor is combined with the images when DrawingStyle is dsSelected.  clNone specifies no blend color while clDefault specifies the system highlight .


TCustomImageList.Count

TCustomImageList	See also

Specifies the number of images in the image list.

property Count: Integer;

Description

Use Count when iterating through the images in the image list.  Retrieve the individual images using the GetBitmap method.  Draw individual images using the Draw method.


TCustomImageList.DrawingStyle

TCustomImageList	See also

Specifies the style to be used when the image list is drawing an image.

type TDrawingStyle = (dsFocus, dsSelected, dsNormal, dsTransparent);

property DrawingStyle: TDrawingStyle;

Description

Use the DrawingStyle property to control how the image is to appear. These are the possible values:

Value	Meaning

dsFocused	Draws the image blending 25% with the color specified by the BlendColor property. This only affects image lists that contain masks.

dsSelected	Draws the image blending 50% with the color specified by the BlendColor property. This only affects image lists that contain masks.

dsNormal	Draws the image using the color specified in the BkColor property. If the BkColor is clNone, the image is drawn transparently using the mask.

dsTransparent	Draws using the mask regardless of the BkColor setting.


TCustomImageList.Handle

TCustomImageList	See also

Designates the handle for the image list.

property Handle: HImageList;

Description

Handle is the Windows image list object handle.  Use this handle when calling Windows API functions that require it.


TCustomImageList.Height

TCustomImageList	See also

Specifies the height of images within the image list.

property Height: Integer;

Description

Use the Height property to specify the height of images before any are added to the image list. The image list is cleared when this value changes.


TCustomImageList.ImageType

TCustomImageList	See also

Determines whether the image list uses the image or the associated image mask when drawing.

type TImageType = (itImage, itMask);

property ImageType: TImageType;

Description

Use the ImageType property to control how the image is to appear. These are the possible values

Value	Meaning

itImage	Draws the image.

itMask	Draws the mask.


TCustomImageList.Masked

TCustomImageList	See also

Specifies whether the image list includes masks that can be combined with the images.

property Masked: Boolean;

Description

Set the Masked property to True to combine the images with masks.  The masked portion of the bitmap will be drawn transparently, or replaced by the color specified by the BkColor property.


TCustomImageList.ShareImages

TCustomImageList	See also

Specifies whether the image list destroys its handle when the image list is destroyed.

property ShareImages: Boolean;

Description

Set the ShareImages property to False to ensure that the handle to the image list is freed when the image list is destroyed.


TCustomImageList.Width

TCustomImageList	See also

Specifies the width of all images within the image list.

property Width: Integer;

Description

Use the Width property to specify the width of images before any are added to the image list. The image list is cleared when this value changes.


TCustomImageList events

TCustomImageList	Alphabetically

In TCustomImageList

OnChange


TCustomImageList events

TCustomImageList	By object

OnChange


TCustomImageList.OnChange

Occurs when the image list changes.

property OnChange: TNotifyEvent;

Description

Write an OnChange event handler to execute code when the image list changes. Any objects registered with the RegisterChanges method will also be notified.


TCustomImageList methods

TCustomImageList	Alphabetically	Legend

In TCustomImageList

Add

AddIcon

AddImages

AddMasked

Assign

AssignTo

Change

Clear

Create

CreateSize

DefineProperties

Delete

Destroy

DoDraw

Draw

DrawOverlay

FileLoad

GetBitmap

GetHotSpot

GetIcon

GetImageBitmap

GetImages

GetInstRes

GetMaskBitmap

GetResource

HandleAllocated

HandleNeeded

Initialize

Insert

InsertIcon

InsertMasked

Move

Overlay

RegisterChanges

Replace

ReplaceIcon

ReplaceMasked

ResInstLoad

ResourceLoad

UnRegisterChanges

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomImageList methods

TCustomImageList	By object	Legend

Add

AddIcon

AddImages

AddMasked

AfterConstruction

Assign

AssignTo

BeforeDestruction

Change

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

CreateSize

DefaultHandler

DefineProperties

Delete

Destroy

DestroyComponents

Destroying

Dispatch

DoDraw

Draw

DrawOverlay

ExecuteAction

FieldAddress

FileLoad

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetBitmap

GetHotSpot

GetIcon

GetImageBitmap

GetImages

GetInstRes

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetMaskBitmap

GetNamePath

GetParentComponent

GetResource

HandleAllocated

HandleNeeded

HasParent

InheritsFrom

Initialize

InitInstance

Insert

InsertComponent

InsertIcon

InsertMasked

InstanceSize

MethodAddress

MethodName

Move

NewInstance

Overlay

RegisterChanges

RemoveComponent

Replace

ReplaceIcon

ReplaceMasked

ResInstLoad

ResourceLoad

SafeCallException

UnRegisterChanges

UpdateAction


TCustomImageList.Add

TCustomImageList	See also

Adds an Image and its Mask to the image list object.

function Add(Image, Mask: TBitmap): Integer;

Description

Use the Add method to add images with their masks to an image list. It returns the index of the added image, or -1 if it fails. When the Masked property of the image list is False, the second bitmap handle is ignored; it can be set to nil.


TCustomImageList.AddIcon

TCustomImageList	See also

Adds an icon to the image list object.

function AddIcon(Image: TIcon): Integer;

Description

Use the AddIcon method to add the icon specified by the Image parameter to an image list. AddIcon returns the index of the added image, or -1 if it fails.


TCustomImageList.AddImages

TCustomImageList	See also

Adds images from another image list to the image list object.

procedure AddImages(Value: TCustomImageList);

Description

Use the AddImages method to add the images from another image list. Value specifies the source image list. AddImages returns -1 if it fails, 0 if it’s successful.


TCustomImageList.AddMasked

TCustomImageList	See also

Adds an image to the image list along with a color which is used to generate the transparent mask.

function AddMasked(Image: TBitmap; MaskColor: TColor): Integer;

Description

AddMasked is similar to Add except that a mask bitmap is not specified. Instead, a color that the system combines with the image bitmap to automatically generate the masks is specified. Each pixel of the specified color in the image bitmap is changed to black, and the corresponding bit in the mask is set to one. As a result, any pixel in the image that matches the specified color is transparent when the image is drawn. AddMasked returns -1 if it fails, 0 if it’s successful.


TCustomImageList.Assign

TCustomImageList	See also

Copies the information from one image list to another.

procedure Assign(Source: TPersistent); override;

Description

If Source is another TImageList object, Assign discards any current image information and replaces it with the information from Source. If Source is any other type of object, Assign calls its inherited method. Use this method to copy one object's information to another.


TCustomImageList.AssignTo

TCustomImageList	See also

Copies the image list’s properties to another image list.

procedure AssignTo(Dest: TPersistent); override;

Description

Applications do not call the protected AssignTo method. Instead, call the public Assign method of the destination image list. AssignTo is called when the image list is passed as the Source parameter of another object’s Assign method and that Assign method can’t copy information to the image list. The object whose Assign method was called is passed as the Dest parameter. AssignTo gives the image list an opportunity to copy properties to objects that were not created with the image list in mind.


TCustomImageList.Change

TCustomImageList	See also

Generates an OnChange event.

procedure change;

Description

Change calls the OnChange event handler if it is assigned.  Override Change to block this event or provide additional responses to changes in the image list.


TCustomImageList.Clear

TCustomImageList	See also

Clears all images from the image list.

procedure Clear;

Description

Use the Clear method to remove all images from the image list. Use the Delete method to delete one image from the image list.


TCustomImageList.Create

TCustomImageList	See also

Creates an empty image list.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate an image list at runtime. ImageLists placed on forms or data modules at design time are created automatically.  Specify the owner of the new imagelist using the AOwner parameter.

The new imagelist contains no images and has a default size of 16 by 16 pixels.


TCustomImageList.CreateSize

TCustomImageList	See also

Creates an empty image list of a specified size.

constructor CreateSize(AWidth, AHeight: Integer);

Description

Use CreateSize to create an image list object at runtime with an image size other than the default of 16 x 16 pixels. The initial size of the image list is determined by the AHeight and AWidth parameters. The height and width can be altered after the image list has been created using the Width and Height properties.


TCustomImageList.DefineProperties

TCustomImageList	See also

Allows bitmap data to be saved and loaded.

procedure DefineProperties(Filer: TFiler)override;

Description

After calling the inherited method, DefineProperties calls Filer’s DefineBinaryProperty method, which enables the filer to load and save the bitmap data as it were a property.


TCustomImageList.Delete

TCustomImageList	See also

Deletes a particular image from the image list.

procedure Delete(Index: Integer);

Description

Use the Delete method to delete an image specified by Index in the image list. Use the Clear method to delete all images in the image list.


TCustomImageList.Destroy

TCustomImageList	See also

Destroys the image list and releases the memory allocated to it.

destructor Destroy;

Description

Destroy first calls UnRegisterChanges to unregister any objects registered to receive notification when the image list changed, and frees all helper objects associated with the image list.

Destroy seldom needs to be called. However, when an image list is constructed without an owner by the Create or CreateSize method, call Free to release memory and dispose of the object. Free checks to see if the pointer is nil before calling Destroy.


TCustomImageList.DoDraw

TCustomImageList	See also

Draws the specified image onto the provided Canvas in the indicated style.

procedure DoDraw(Index: Integer; Canvas: TCanvas; X, Y: Integer; Style: Cardinal; Enabled: Boolean); virtual;

Description

The public Draw method uses this protected method to draw one of the images in the image list onto Canvas. The image specified by the Index parameter is drawn at the position X, Y. The Style parameter encodes the values of the DrawingStyle and ImageType properties. If the Enabled parameter is False, a gray-mapped version of the image is drawn.


TCustomImageList.Draw

TCustomImageList	See also 	Example

Draws the image specified by the Index parameter onto the provided Canvas.

procedure Draw(Canvas: TCanvas; X, Y, Index: Integer; Enabled: Boolean=True);

Description

Use the Draw method to draw one of the images in the image list onto Canvas. The image is drawn at the position X, Y according to the style set in the DrawingStyle property. When the Enabled parameter is False, the image is drawn as a grayed image. Because Enabled has a default value of True, this parameter can be omitted if the image should not be grayed.


TCustomImageList.DrawOverlay

TCustomImageList	See also

Draws an image and an overlay onto the provided Canvas.

type TOverlay = 0..3;

procedure DrawOverlay(Canvas: TCanvas; X, Y: Integer; ImageIndex: Integer; Overlay: TOverlay);

Description

An overlay mask is an image drawn transparently over another image. Any image can be used as an overlay mask. To draw an overlay mask over an image use the DrawOverlay method with the index of the overlay mask. The Overlay method must be called first to allow an image to be used as an overlay.


TCustomImageList.FileLoad

TCustomImageList	See also

Loads a resourced image into the image list.

function FileLoad(ResType: TResType; Name: string; MaskColor: TColor): Boolean;

Description

Use the FileLoad method to load a bitmap, cursor, or icon from a reource file. Use ResType to specify the type of resource. Use Name to identify the resource by name, or, if the resource has no name, by converting its number using MAKEINTRESOURCE. Use MaskColor to set the transparent color for the images. FileLoad returns True if successful.

Note:	Within a package, FileLoad will return an error. GetInstRes must be used to load a resource from within a package.


TCustomImageList.GetBitmap

TCustomImageList	See also

Retrieves a specified image as a bitmap.

procedure GetBitmap(Index: Integer; Image: TBitmap);

Description

Use the GetBitmap method to obtain a particular image in the image list as a bitmap object. Index denotes the index of the image. The bitmap is returned as the Image parameter.


TCustomImageList.GetHotSpot

TCustomImageList	See also

Returns the hot spot location associated with the current drag image.

function GetHotSpot: TPoint;

Description

Use the GetHotSpot method to obtain the position of the hot spot of the current drag image.


TCustomImageList.GetIcon

TCustomImageList	See also

Returns the image specified by Index as an icon into the Image parameter.

procedure GetIcon(Index: Integer; Image: TIcon);

Description

Use the GetIcon method to obtain a particular image in the image list as an icon.


TCustomImageList.GetInstRes

TCustomImageList	See also

Loads a specified bitmap, cursor, or icon resource into the image list.

type

  TLoadResource = (lrDefaultColor, lrDefaultSize, lrFromFile, lrMap3DColors, lrTransparent, lrMonoChrome);

  TLoadResources = set of TLoadResource;

function GetInstRes(Instance:THandle; ResType: TResType; Name: string; Width: Integer; LoadFlags: TLoadResources; MaskColor: TColor): Boolean;

Description

Use the GetInstRes method to load bitmap, cursor, or icon resource into an image list.

Use Instance to specify the instance handle of the resource module. Use ResType to indicate the type of resource (rtBitmap, rtCursor or rtIcon). Use Name to identify the resource by name, or, if the resource has no name, by converting its number using MAKEINTRESOURCE. Use MaskColor to set the transparent color for the image. LoadFlags specifies how to load the image. A combination of the following values can be used.

Value	Meaning

lrNone	No specific resource flags.

lrDefaultColor	Use the color format of the display.

lrDefaultSize	Use system metrics for Height and Width if the Width parameter to GetResource is 0. If the Width parameter is 0 and this option is not specified for cursors and icons, the resources width and height will be used.

lrFromFile	Loads the resource from the specified file.

lrMap3DColors	Replaces the images gray shades with the 3D windows colors.

lrTransparent	Replaces the color table entry for the first pixel of the resource with the default window color (COLOR_WINDOW). This applies only to images with color tables.

lrMonoChrome	Loads the resource as black and white.

Note:	GetInstRes must be used to load a resource from within a package. Within a package, GetResouce or FileLoad returns an error.


TCustomImageList.GetImageBitmap

TCustomImageList	See also

Returns a handle to a bitmap containing all of the images in the image list.

function GetImageBitmap: HBITMAP;

Description

Use the GetImageBitmap method to obtain a bitmap that contains all images in the image list. GetImageBitmap returns 0 if unsuccessful.


TCustomImageList.GetImages

TCustomImageList	See also

Returns a specified image and its mask as bitmaps.

procedure GetImages(Index: Integer; Image, Mask: TBitmap);

Description

Use GetImages to obtain the image (and its mask) identified by the Index parameter. The Image is returned as the Image parameter, and the Mask as the Mask parameter.


TCustomImageList.GetMaskBitmap

TCustomImageList	See also

Returns a handle to a bitmap containing all masks for images in the image list.

function GetMaskBitmap: HBITMAP;

Description

Use the GetMaskBitmap to obtain a bitmap that contains all masks in the image list. GetMaskBitmap returns 0 if unsuccessful.


TCustomImageList.GetResource

TCustomImageList	See also

Loads the specified bitmap, cursor, or icon resource into the image list.

type

  TLoadResource = (lrDefaultColor, lrDefaultSize, lrFromFile, lrMap3DColors, lrTransparent, lrMonoChrome);

  TLoadResources = set of TLoadResource;

function GetResource(ResType: TResType; Name: string; Width: Integer; LoadFlags: TLoadResources; MaskColor: TColor): Boolean;

Description

Use the GetResource method to load bitmap, cursor, or icon resource into an image list.

Note:	Within a package, GetResouce returns an error. GetInstRes must be used to load a resource from within a package.

ResType specifies the type of graphical resource that is to be loaded into the image list and can be rtBitmap, rtCursor or rtIcon. Use Name to identify the resource by name, or, if the resource has no name, by converting its number using MAKEINTRESOURCE. Use MaskColor to set the transparent color for the images in the file. LoadFlags specifies how to load the image. A combination of the following values can be used.

Value	Meaning

lrNone	No specific resource flags.

lrDefaultColor	Use the color format of the display.

lrDefaultSize	Use system metrics for Height and Width if the Width parameter to GetResource is 0. If the Width parameter is 0 and this option is not specified for cursors and icons, the resources width and height will be used.

lrFromFile	Loads the resource from the specified file.

lrMap3DColors	Replaces the images gray shades with the 3D windows colors.

lrTransparent	Replaces the color table entry for the first pixel of the resource with the default window color (COLOR_WINDOW). This applies only to images with color tables.

lrMonoChrome	Loads the resource as black and white.


TCustomImageList.HandleAllocated

TCustomImageList	See also

Indicates whether a window handle exists for the image list.

function HandleAllocated: Boolean;

Description

Use HandleAllocated to determine if a handle exists for the image list. HandleAllocated returns True if the Windows image list has been created and a handle is available, False otherwise. HandleAllocated doesn’t create a handle if it doesn’t already exist.

Note:	Getting the Handle property of creates the Windows image list automatically if it didn't previously exist, and returns the resulting handle.


TCustomImageList.HandleNeeded

TCustomImageList	See also

Creates an image list handle for the image list if one doesn't already exist.

procedure HandleNeeded;

Description

Use HandleNeeded to create a Windows image list for the image list component when one doesn’t already exist. This method is called automatically when an image list’s handle property is accessed.


TCustomImageList.Initialize

TCustomImageList	See also

Initializes a newly allocated image list.

procedure Initialize;

Description

Initialize is called from the Create and CreateSize constructors of the image list. It sets numerous image list properties to their default values and creates instances of helper objects used internally.


TCustomImageList.Insert

TCustomImageList	See also

Inserts a bitmap and its mask into the image list following a specified image.

procedure Insert(Index: Integer; Image, Mask: TBitmap);

Description

Use the Insert method to insert a bitmap and its mask into the image list.  The image is inserted following the image specified by Index.


TCustomImageList.InsertIcon

TCustomImageList	See also

Inserts an icon at a specified position in the image list.

procedure InsertIcon(Index: Integer; Image: TIcon);

Description

Use the InsertIcon method to insert an icon into the image list. The icon is inserted following the image specified by Index.


TCustomImageList.InsertMasked

TCustomImageList	See also

Inserts a bitmap at a specified position, creating the mask from a specified transparent color.

procedure InsertMasked(Index: Integer; Image: TBitmap; MaskColor: TColor);

Description

Use the InsertMasked method to insert a masked image into the image list. The new image is inserted following the image specified by Index. Use MaskColor to identify the color in the image used to generate the Mask.


TCustomImageList.Move

TCustomImageList	See also

Moves a specified image to another position.

procedure Move(CurIndex, NewIndex: Integer);

Description

Use the Move method to move an image to another position in the image list. Specify the current position using CurIndex, and the new position using NewIndex.


TCustomImageList.Overlay

TCustomImageList	See also

Adds the index of an image to the list of images to be used as overlay masks.

type TOverlay = 0..3;

function Overlay(ImageIndex: Integer; Overlay: TOverlay): Boolean;

Description

An overlay mask is an image drawn transparently over another image. Any image can be used as an overlay mask. To draw an overlay mask over an image use the DrawOverlay method with the index of the overlay mask. If successful, Overlay returns True.

Up to four indices can be added to the list.


TCustomImageList.RegisterChanges

TCustomImageList	See also

Registers an object to be notified when changes occur in the image list.

procedure RegisterChanges(Value: TChangeLink);

Description

Use the RegisterChanges method to have an object notified whenever changes occur in the image list. The TChangeLink's OnChange event is called whenever a change in the image list occurs.

Create a change link object for each object that should be notified of changes. Register each object by calling RegisterChanges and passing its change link object as the Value parameter. The OnChange event of all registered change link objects is then triggered when a change occurs in the image list. Any code assigned to the OnChange event handlers will execute.


TCustomImageList.Replace

TCustomImageList	See also

Replaces an image in the image list with a new image and mask.

procedure Replace(Index: Integer; Image, Mask: TBitmap);

Description

Use the Replace method to replace the image at the Index position in the image list with a new Image and overlay Mask.


TCustomImageList.ReplaceIcon

TCustomImageList	See also

Replaces an image in the image list with an icon.

procedure ReplaceIcon(Index: Integer; Image: TIcon);

Description

Use the ReplaceIcon method to replace the Image at the Index position in the image list with a new icon.


TCustomImageList.ReplaceMasked

TCustomImageList	See also

Replaces an image in the image list with a new image and mask.

procedure ReplaceMasked(Index: Integer; NewImage: TBitmap; MaskColor: TColor);

Description

Use the ReplaceMasked method to replace the image at Index position within the image list with a new image and mask created using the MaskColor for transparency.


TCustomImageList.ResInstLoad

TCustomImageList	See also

Loads a resource into the image list.

function ResInstLoad(Instance: THandle; ResType: TResType; Name: string; MaskColor: TColor): Boolean;

Description

Use the ResoInstLoad method to load a resource of type TResType into the image list. Use Instance to specify the instance handle of the resource module, and Name to identify the resource within that module. MaskColor is used to create the mask for the resulting image. ResInstLoad should be used rather than ResouceLoad to load a resource from within a package.

ResInstLoad returns True if it is successful, False otherwise.


TCustomImageList.ResourceLoad

TCustomImageList	See also

Loads a resource into the image list.

function ResourceLoad(ResType: TResType; Name: string; MaskColor: TColor): Boolean;

Description

Use the ResourceLoad method to load a resource of type TResType into the image list. Use Name to identify the resource. MaskColor is used to create the mask for the resulting image. ResourceLoad returns True if successful, False otherwise.

Note:	Within a package, ResouceLoad will return an error. ResInstLoad must be used to load a resource from within a package.


TCustomImageList.UnRegisterChanges

TCustomImageList	See also

Removes an object from the list of objects to be notified when the image list changes.

procedure UnRegisterChanges(Value: TChangeLink);

Description

Use the UnRegisterChanges method to unregister a TChangeLink object. The object will no longer receive notification when the image list changes.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent


TCustomLabel

Hierarchy	Properties	Methods	See also

TCustomLabel is the base class for non-windowed controls that display text on a form.

Unit

stdctrls

Description

Use TCustomLabel as a base class when defining objects that display text that users can’t edit. TCustomLabel introduces several new properties and methods to control the appearance of the text.

TCustomLabel is not a descendant of TWinControl, so it does not have its own window and can’t receive direct input from the keyboard. To define an object that responds to direct keyboard input in addition to displaying text, use TCustomStaticText as a base class.

Do not create instances of TCustomLabel. To put a label on a form, use a TLabel object.


TCustomLabel properties

TCustomLabel	Alphabetically	Legend

In TCustomLabel

Alignment

AutoSize

FocusControl

Layout

ShowAccelChar

Transparent

WordWrap

Derived from TGraphicControl

Canvas

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomLabel properties

TCustomLabel	By object	Legend

Action

Align

Alignment

Anchors

AutoSize

BiDiMode

BoundsRect

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlState

ControlStyle

Cursor

DesignInfo

DockOrientation

Enabled

Floating

FloatingDockSiteClass

FocusControl

Height

Hint

HostDockSite

Layout

Left

LRDockWidth

Name

Owner

Parent

ShowAccelChar

ShowHint

Tag

TBDockHeight

Top

Transparent

UndockHeight

UndockWidth

VCLComObject

Visible

Width

WindowProc

WordWrap


TCustomLabel.Alignment

TCustomLabel	See also

Controls the horizontal placement of the text within the label.

property Alignment: TAlignment;

Description

Set Alignment to specify how the text of the label is justified within the ClientRect of the label control.

The effect of the Alignment property is more obvious if the WordWrap property is True and the label includes more than one line of text.


TCustomLabel.AutoSize

TCustomLabel	See also 	Example

Determines whether the size of the label automatically resizes to accommodate the text.

property AutoSize: Boolean;

Description

Use AutoSize to make the label adjust its size automatically so the client area accommodates the height and width of the text. When AutoSize is False, the label is fixed in size. When AutoSize is True, the size of the label readjusts whenever the text changes. The size of the label is also readjusts when the Font property changes.

When WordWrap is True, the width of the label is fixed. If AutoSize is also True, changes to the text cause the label to change in height. When AutoSize is True and WordWrap is False, the font determines the height of the label, and changes to the text cause the label to change in width.


TCustomLabel.FocusControl

TCustomLabel	See also

Designates a windowed control associated with the label.

property FocusControl: TWinControl;

Description

Set FocusControl to the windowed control that should receive focus when the user presses the accelerator key specified by the label. Specify an accelerator key by preceding a character in the label text with an ampersand (&) and setting the ShowAccelChar property to True.


TCustomLabel.Layout

TCustomLabel	See also

Specifies the vertical placement of the text within the label.

type TTextLayout = (tlTop, tlCenter, tlBottom);

property Layout: TTextLayout;

Description

Set Layout to specify how the text of the label is placed within the ClientRect of the label control. Layout is the vertical analog to the Alignment property.

Layout can be one of the following values:

Value	Meaning

tlTop	The text appears at the top of the label.

tlCenter	The text is vertically centered in the label.

tlBottom	The text appears along the bottom of the label.


TCustomLabel.ShowAccelChar

TCustomLabel	See also 	Example

Determines how an ampersand in the label text is displayed.

property ShowAccelChar: Boolean;

Description

Set ShowAccelChar to True to allow the label to display an underlined accelerator key value. When ShowAccelChar is True, any character preceded by an ampersand (&) appears underlined. If the FocusControl property is set, the windowed control specified by the FocusControl property receives input focus when the user types that underlined character. To display an ampersand when ShowAccelChar is True, use two ampersands (&&) to stand for the single ampersand that is displayed.

Set ShowAccelChar to False to display the label text with all ampersands appearing as ampersands. When ShowAccelChar is False, the value of the FocusControl property is not used.


TCustomLabel.Transparent

TCustomLabel	See also

Specifies whether controls that sit below the label on a form can be seen through the label.

property Transparent: Boolean;

Description

Set Transparent to True to prevent the label from obscuring other controls on the form. For example, if the label is used to add text to a graphic, set Transparent to True so that the label does not stand out as a separate object.

Writing text so that the background is transparent is slower than writing text when Transparent is False. If the label is not obscuring a complicated image, performance can be improved by setting the background color of the label to match the object beneath it and setting Transparent to False.


TCustomLabel.WordWrap

TCustomLabel	See also

Specifies whether the label text wraps when it is too long for the width of the label.

property WordWrap: Boolean;

Description

Set WordWrap to True to allow the label to display multiple line of text. When WordWrap is True, text that is too wide for the label control wraps at the right margin and continues in additional lines.

Set WordWrap to False to limit the label to a single line. When WordWrap is False, text that is too wide for the label appears truncated.


TCustomLabel methods

TCustomLabel	Alphabetically	Legend

In TCustomLabel

AdjustBounds

Create

DoDrawText

GetLabelText

Loaded

Notification

Paint

SetAutoSize

Derived from TGraphicControl

Destroy

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

Invalidate

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

Repaint

ReplaceDockedControl

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomLabel methods

TCustomLabel	By object	Legend

AdjustBounds

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Dock

DoDrawText

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetLabelText

GetNamePath

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InstanceSize

Invalidate

IsRightToLeft

Loaded

ManualDock

ManualFloat

MethodAddress

MethodName

NewInstance

Notification

Paint

Perform

Refresh

RemoveComponent

Repaint

ReplaceDockedControl

SafeCallException

ScreenToClient

SendToBack

SetAutoSize

SetBounds

SetTextBuf

Show

Update

UpdateAction

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TCustomLabel.AdjustBounds

TCustomLabel	See also

Resizes the label when the text changes.

procedure AdjustBounds; dynamic;

Description

When the text in the label or the font changes, AdjustBounds is implicitly called. It redraws the text in the client area, and then resizes the label if the AutoSize property is True.

When WordWrap is True, the width of the label is fixed. If AutoSize is also True, changes to the text cause the label to change in height. When AutoSize is True and WordWrap is False, the height of the label is determined by the font, and changes to the text cause the label to change in width.

Override AdjustBounds to make additional adjustments when the text changes.


TCustomLabel.Create

TCustomLabel	See also

Creates and initializes an instance of TCustomLabel.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create an instance of TCustomLabel at runtime. Labels placed on forms at design time are created automatically.

After calling the inherited constructor, Create initializes the following properties:

•	AutoSize to True.

•	ShowAccelChar to True.

•	ControlStyle to [csOpaque, csReplicatable].

•	Width to 65 and Height to 17.


TCustomLabel.DoDrawText

TCustomLabel	See also

Renders the text in the client area.

procedure DoDrawText(var Rect: TRect;Flags: Longint); dynamic;

Description

When the label needs to draw itself, DoDrawText is implicitly called. DoDrawText uses the Windows API function, DrawText, to render the caption in the client area.

The first parameter, Rect, specifies the boundaries of the text within the client area. The second parameter, Flags, specifies how the text is aligned within those boundaries, how tab characters are handled, etc. See the Microsoft Windows API DrawText function for all the possible values of Flags.

Override DoDrawText to render text differently.


TCustomLabel.GetLabelText

TCustomLabel	See also

Returns the value of the Caption property.

function GetLabelText: string; virtual;

Description

Call GetLabelText to obtain the string that appears as the text of the label. GetLabelText is exposed as a protected method so that descendants can override this method to display text other than the value of the Caption property.


TCustomLabel.Loaded

TCustomLabel	See also

Adjusts the size of the label when it is first loaded. .

procedure Loaded; override;

Description

The protected loaded method is called immediately after a saved version of the label is loaded into memory. TCustomLabel uses this method to adjust the size of the label to the text it contains if the AutoSize property is True.


TCustomLabel.Notification

TCustomLabel	See also

Responds to notifications when objects are about to be created or destroyed.

procedure Notification(AComponent: TComponent; Operation: TOperation); override;

Description

Notification is called automatically when components are created or destroyed. After calling the inherited method, Notification checks whether the windowed control specified by the FocusControl property is about to be destroyed. If the windowed control is going away, Notification sets the FocusControl property to nil.


TCustomLabel.Paint

TCustomLabel	See also

Draws the image of the label.

procedure Paint; override;

Description

Paint is called automatically when the label receives a WM_PAINT message from its Parent. Paint writes the text returned by the GetLabelText method.


TCustomLabel.SetAutoSize

TCustomLabel	See also

Sets the AutoSize property.

procedure SetAutoSize(Value: Boolean); virtual;

Description

SetAutoSize is the protected access method for the AutoSize property. It is exposed as a protected method so that descendants can override it to change the implementation of the AutoSize property.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl


TCustomListBox

Hierarchy	Properties	Methods	Events	See also

TCustomListBox is the base class for list-box objects that are wrappers for Windows list box controls.

Unit

stdctrls

Description

TCustomListBox encapsulates behavior common to all list box controls. List box objects are used to display a scrollable list from which users can select one or more items. Use a list box control to limit the user to selecting from a list of items. Items can be added at design time or at runtime.

As a wrapper for a list box TCustomListBox introduces methods for:

Displaying, sorting, selecting, manipulating and querying items in the list.

Creating owner-draw style list boxes that can display graphical images such as icons and bitmaps.

Creating multiple-column and multiple-selection lists.

By default TCustomListBox is a standard list box that displays items as text strings. These items are contained in a TStrings object, and the methods of the TStrings object are used to add, insert or delete a string. The following code demonstrates adding a new string to the list box:

MyListBox.Items.Add('New item');

Descendants of TCustomListBox inherit the basic functionality of TCustomListBox. Some descendants also have specialized behavior and can be linked to file, directory, drive or database information. Use these list boxes to easily access and list this type of information.

A combo box is a list box with an edit control and an optional drop down style for the list. Use a combo box to allow users to type their selection into an edit box or to save space on a form by having the list drop down.

For lists of items that require a matrix or expandable tree-like structure, use list views or tree views. These controls allow the grouping of items under column headings or in expandable and contractible rows.

Component Writers’ notes

For component writers wanting to create a customized list box objects, use TCustomListBox as a base class for deriving specialized list box objects.


TCustomListBox properties

TCustomListBox	Alphabetically	Legend

In TCustomListBox

BorderStyle

Canvas

Columns

ExtendedSelect

IntegralHeight

ItemHeight

ItemIndex

Items

MultiSelect

SelCount

Selected

Sorted

Style

TabWidth

TopIndex

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ShowHint

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomListBox properties

TCustomListBox	By object	Legend

Action

Align

Anchors

BiDiMode

BorderStyle

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Columns

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

ExtendedSelect

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

IntegralHeight

ItemHeight

ItemIndex

Items

Left

LRDockWidth

MultiSelect

Name

Owner

Parent

ParentColor

ParentWindow

SelCount

Selected

ShowHint

Showing

Sorted

Style

TabOrder

TabStop

TabWidth

Tag

TBDockHeight

Top

TopIndex

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TCustomListBox.BorderStyle

TCustomListBox	See also

Determines whether the list box has a border.

property BorderStyle: TBorderStyle;

Description

Use BorderStyle to change the appearance of the outer boundary of the list box control. A list box can have a single border (bsSingle) or no visible border (bsNone).


TCustomListBox.Canvas

TCustomListBox	See also 	Example

Provides a drawing surface when implementing a handler for the OnDrawItem event of an owner-draw list box.

property Canvas: TCanvas;

Description

Canvas is only useful for applications that control the drawing of list box items, that is, for owner-draw list boxes. Canvas is used to draw graphical images that can be used as items in a list box.

By default a TControlCanvas object is created for the Canvas property in the list box constructor. To create an owner-draw list box that uses a canvas, set the Style property accordingly.


TCustomListBox.Columns

TCustomListBox	See also

Specifies the number of columns, in a multi-column list box, that are visible without having to scroll.

property Columns: Integer;

Description

Use Columns to specify the number of columns, in a multi-column list box, that are visible without having to use the horizontal scrollbar.

Multi-column list boxes have a horizontal scrollbar that allows users to view multiple columns as they wrap. The default value for Columns is 0, meaning that the list box is not multi-column. That is, users can scroll only vertically and the list of items will not wrap.

For Columns values greater than 0, multiple columns accommodate the items as they wrap beyond the bottom of the list box. The Columns property specifies the number of columns that are visible without having to horizontally scroll the list box.

The width of each column depends upon both the Width property and the number of Columns.


TCustomListBox.ExtendedSelect

TCustomListBox	See also

Determines if the user can select a sequential range of items in the list box.

property ExtendedSelect: Boolean;

Description

ExtendedSelect works with the MultiSelect property. If ExtendedSelect is True and MultiSelect is True, the user can select an item then hold down the Shift key and select another and all the items in between the two selected items also become selected.

If the user doesn’t hold down the Shift or Ctrl key while selecting a second item, the first selected item becomes unselected—in other words, the user must use the Ctrl key to select multiple noncontiguous items, or the Shift key to select a range of items.

If ExtendedSelect is False and MultiSelect is True, the user can select multiple items without using the Shift or Ctrl key, but they can’t select a range of items in one operation.

If MultiSelect is False, the setting of ExtendedSelect has no effect as the user will not be able to select more than one item at a time in the list box.


TCustomListBox.IntegralHeight

TCustomListBox	See also

Determines whether the list box displays the partial items.

property IntegralHeight: Boolean;

Description

IntegralHeight controls the height of the list box itself.

When IntegralHeight is True, and the Style property is lsOwnerDrawFixed, the list box height will always be a multiple of the ItemHeight property value. In this case, items will never be partially displayed.

If IntegralHeight is False, the list box height can be set to any value, but the last item may not be fully displayed.

If the Style property value of the list box is lbOwerDrawVariable, setting the IntegralHeight property to True has no effect.


TCustomListBox.ItemHeight

TCustomListBox	See also

Specifies the height in pixels of an item in an owner-draw list box.

property ItemHeight: Integer;

Description

Use ItemHeight to control the height of an item in a list box when the Style property is lsOwnerDrawFixed. The ItemHeight property can also affect the height of the list box itself. When the IntegralHeight property is True, the height of the list box is always an increment of the ItemHeight value.

If the Style property is lsStandard or lsOwnerDrawVariable, the value of ItemHeight is ignored.


TCustomListBox.ItemIndex

TCustomListBox	See also 	Example

Specifies the ordinal number of the selected item in the list box’s item list.

property ItemIndex: Integer;

Description

Use ItemIndex to select an item at runtime. Set the value of ItemIndex to the index of the item to be selected. The ItemIndex of the first item in the list box is 0. If no item is selected, the value is -1, which is the default value unless MultiSelect is True.

If the value of the MultiSelect property is True the user can select more than one item in the list box. In this case, the ItemIndex value is the index of the selected item that has focus. If MultiSelect is True, ItemIndex defaults to 0.


TCustomListBox.Items

TCustomListBox	See also 	Example

Contains the strings that appear in the list box.

property Items: TStrings;

Description

Use Items to add, insert, delete and move items. By default, the items in a list box are of type TStrings. Use this item type to access its methods or properties to manipulate the items in the list.

For example, the following code adds the text in the edit box to the list box as an item:

ListBox1.Items.Add(Edit1.Text);


TCustomListBox.MultiSelect

TCustomListBox	See also

Determines whether the user can select more than one element at a time.

property MultiSelect: Boolean;

Description

Set MultiSelect to True to allow the user to select multiple items. If MultiSelect if False, multiple items cannot be selected in the list box at the same time.

MultiSelect allows users to select multiple non-sequential items. It does not allow users to select a range of items in one operation, as does the ExtendedSelect property.

When MultiSelect is True and multiple items are selected, the value of the ItemIndex property, which indicates the index of the Selected item, is the index of the selected item that has focus.


TCustomListBox.SelCount

TCustomListBox	See also

Indicates the number of items that are selected when multiple selections are allowed.

property SelCount: Integer;

Description

SelCount is read-only. Use SelCount to find the number of selected items in the list box when the MultiSelect property is True.

When the MultiSelect property is False, SelCount is always –1.


TCustomListBox.Selected

TCustomListBox	See also 	Example

Indicates whether a particular item is selected.

property Selected[Index: Integer]: Boolean;

Description

Use Selected to query the state of a particular item in the list box. If the item specified by the Index parameter is selected in the list box, the value of the Selected property is True. If the specified item is not selected, Selected is False.

The Index parameter is the item referenced by its position in the list box, with the first item having an Index value of 0.

An item is selected when the user highlights it. More than one item in the list box can be selected by setting the MultiSelect property to True. In this case, the Selected item is the one that has focus.


TCustomListBox.Sorted

TCustomListBox	See also 	Example

Specifies whether the items in a list box are arranged alphabetically.

property Sorted: Boolean;

Description

Use Sorted to sort the items by setting its value to True. If Sorted is False, the items are unsorted. When Sorted is True, items are automatically added or inserted into the list box in alphabetical order.


TCustomListBox.Style

TCustomListBox	See also

Determines whether the list box is standard or owner-draw.

type TListBoxStyle = (lbStandard, lbOwnerDrawFixed, lbOwnerDrawVariable);

property Style: TListBoxStyle;

Description

Use Style to specify whether the list box is a standard list box that displays text strings, or an owner-draw list box that can display graphical images. By default, Style is lbStandard, meaning that the list box displays each item as a string.

Owner-draw list boxes let you display items in some nonstandard way. In this case, you must write the code. To create owner-draw list boxes, set the value of Style to lbOwnerDrawFixed or lbOwnerDrawVariable. The following table lists the values for the TListBoxStyle type of the Style property:

Value	Meaning

lbStandard	All items are strings, with each item the same height.

lbOwnerDrawFixed	Each item in the list box is the height specified by the ItemHeight property.

lbOwnerDrawVariable	Items in the list box can be of varying heights.

Owner-draw list boxes require more programming because the application needs information on how to render the image for each item in the list.

Each time an item is displayed in an lbOwnerDrawFixed list box, the OnDrawItem event occurs. The event handler for OnDrawItem draws the specified item. The ItemHeight property determines the height of each of the items.

Each time an item is displayed in an lbOwnerDrawVariable list box, two events occur. The first is the OnMeasureItem event. The code for the OnMeasureItem handler can set the height of each item. Then the OnDrawItem event occurs. The code for the OnDrawItem handler draws each item in the list box using the size specified by the OnMeasureItem handler.


TCustomListBox.TabWidth

TCustomListBox

Specifies the size of the tabs in the list box.

property TabWidth: Integer;

Description

Set TabWidth to control the number of dialog base units displayed for each tab character that appears in the strings of a list box.

If TabWidth is set to 0, which is the default setting, the tabs default to the width specified by Windows, which is two dialog base units.


TCustomListBox.TopIndex

TCustomListBox	See also 	Example

Specifies the index number of the item that appears at the top of the list box.

property TopIndex: Integer;

Description

Use TopIndex property to find or set the first item displayed at the top of the list box. TopIndex can be used, for example, to change the topmost item to a different item in the list.


TCustomListBox events

TCustomListBox	Alphabetically	Legend

In TCustomListBox

OnDrawItem

OnMeasureItem


TCustomListBox events

TCustomListBox	By object	Legend

OnDrawItem

OnMeasureItem


TCustomListBox.OnDrawItem

TCustomListBox	See also 	Example

Occurs when an item in an owner-draw list box needs to be redisplayed.

property OnDrawItem: TDrawItemEvent;

Description

Use OnDrawItem to write a handler for drawing of the items in list boxes with the Style values lbOwnerDrawFixed or lbOwnerDrawVariable. OnDrawItem occurs whenever the list box needs to display an item. OnDrawItem occurs only for owner-draw list boxes.

The size of the rectangle that contains the item is determined either by the ItemHeight property for fixed owner-draw list boxes or by the response to the OnMeasureItem event for variable owner-draw list boxes.


TCustomListBox.OnMeasureItem

TCustomListBox	See also 	Example

Occurs when the application needs to redisplay an item in a variable height owner-draw list box.

type TMeasureItemEvent = procedure(Control: TWinControl; Index: Integer; var Height: Integer) of object;

property OnMeasureItem: TMeasureItemEvent;

Description

Use OnMeasureItem to write a handler to measure items to be drawn in a list box with a Style property value of lbOwnerDrawVariable.

OnMeasureItem is of type TMeasureItemEvent which contains three parameters describing the item to measure:

Control, specifying the control containing the item.

Index, specifying the index of the item in the control.

Height, specifying the height of the item.

The Index parameter identifies the position of the item in the list box.

The Height parameter should specify the height in pixels that the given item will occupy in the control. The Height parameter is passed by reference (a var parameter), which initially contains the default height of the item or the height of the item text in the control’s font. The handler can set Height to a value appropriate to the contents of the item, such as the height of a graphical image to be displayed within the item.

After the OnMeasureItem event occurs, the OnDrawItem event occurs, rendering the item with the measured size.


TCustomListBox methods

TCustomListBox	Alphabetically	Legend

In TCustomListBox

Clear

Create

CreateParams

CreateWnd

DeleteString

Destroy

DestroyWnd

DragCanceled

DrawItem

GetItemData

ItemAtPos

ItemRect

MeasureItem

ResetContent

SetItemData

WndProc

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

Before Destruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomListBox methods

TCustomListBox	By object	Legend

AfterConstruction

Assign

Before Destruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParams

CreateParented

CreateParentedControl

CreateWnd

DefaultHandler

DeleteString

Destroy

DestroyComponents

Destroying

DestroyWnd

DisableAlign

Dispatch

Dock

DockDrop

DragCanceled

DragDrop

Dragging

DrawItem

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetItemData

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ItemAtPos

ItemRect

ManualDock

ManualFloat

MeasureItem

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

ResetContent

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetItemData

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

WndProc


TCustomListBox.Clear

TCustomListBox	See also

Deletes all items from the list box.

procedure Clear;

Description

Use Clear to delete all of the items in the list box at once. Although the items in a standard list box are of type TStrings, use the Clear method of the list box rather than calling the Clear method of the Items property.  This allows descendants of TCustomListBox to perform any other necessary clean-up in the Clear method, in addition to deleting the items from the Items property. Thus, applications should use

ListBox1.Clear;

rather than

ListBox1.Items.Clear;


TCustomListBox.Create

TCustomListBox	See also

Instantiates a list box control.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a list box control at runtime. For list boxes created at design time, Create is called automatically.

Create allocates memory for a list box control, and calls the inherited constructor. Then it:

Initializes values for its Width, Height and ItemHeight properties.

Sets ParentColor to False, and TabStop and ExtendedSelect to True.

Sets the ControlStyle for the list box.

Sets the BorderStyle property to bsSingle.

Creates a TControlCanvas object for the Canvas property.

Creates a TStrings type of object for the Items property.


TCustomListBox.CreateParams

TCustomListBox	See also

Initializes the window-creation parameter record passed in the Params parameter.

procedure CreateParams(var Params: TCreateParams); virtual;

Description

CreateParams is used to pass information, in its Params parameter, to CreateWindowHandle when the list box control is created.

TCustomListBox overrides CreateParams to customize the representation of the window. It uses information from the list box Columns, ExtendedSelect, IntegralHeight, MultiSelect, Sorted and Style properties and sets WS_HSCROLL, WS_VSCROLL, LBS_HASSTRINGS and LBS_NOTIFY Windows styles for creation of the list box.

When overriding CreateParams, always call the inherited method first to set the default values, then make any desired adjustments.


TCustomListBox.CreateWnd

TCustomListBox	See also

Creates a Windows control corresponding to the list box component.

procedure CreateWnd; virtual;

Description

CreateWnd is called automatically when the list box must be displayed. CreateWnd calls the inherited CreateWnd method, which calls

CreateParams to initialize the window-creation parameters.

CreateWindowHandle to create the window handle for the control.

TCustomListBox.CreateWnd additionally sets up the list box position, tabs, items, and columns.


TCustomListBox.DeleteString

TCustomListBox

Deletes a string from the list box.

procedure DeleteString(Index: Integer); dynamic;

Description

DeleteString deletes the string, specified by the Index parameter, from the list box control.


TCustomListBox.Destroy

TCustomListBox	See also

Destroys the instance of a list box control.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, an application should call Free. Free checks that the list box reference is not nil before it calls Destroy.

Destroy frees the memory associated with the objects for the Canvas and Items properties. Then it calls the inherited destructor to destroy the list box object.


TCustomListBox.DestroyWnd

TCustomListBox	See also

Saves the list box items in a string list before calling the inherited DestroyWnd method.

procedure DestroyWnd; virtual;

Description

DestroyWnd saves the list box text string items in the Items property to internal storage in a TStringList object that it creates. It then calls the inherited DestroyWnd method to destroy the windowed control’s window handle and free associated device contexts.


TCustomListBox.DragCanceled

TCustomListBox	See also

Sends a mouse message canceling the drag-and-drop operation.

procedure DragCanceled; dynamic;

Description

DragCanceled is called in response to the cancellation of a drag-and-drop operation that had started. Users can cancel the operation by dropping the item over a component that does not accept the item, or by pressing Esc while dragging.

Delphi calls the DragCanceled method before invoking the OnEndDrag event.


TCustomListBox.DrawItem

TCustomListBox	See also

Generates an OnDrawItem event.

procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); virtual;

Description

DrawItem is called whenever a visual aspect of an owner-draw list box changes. The list box calls DrawItem for each visible item in its list, passing the index of the item in the Index parameter.

By default, the DrawItem method for a list box calls any event handler attached to the component's OnDrawItem event. If there is no handler attached, DrawItem fills the rectangle passed in Rect and draws any text associated with the indexed item. The default drawing ignores the State parameter, although State is passed along to attached event handlers.


TCustomListBox.GetItemData

TCustomListBox	See also

Returns a 32-bit value associated with the specified item in a list box.

function GetItemData(Index: Integer): LongInt; dynamic;

Description

Use GetItemData to retrieve the data associated with a particular item in a list box. This value can be displayed as that list box item, or can be a value (such as a pointer) associated with the list box item.


TCustomListBox.ItemAtPos

TCustomListBox	See also 	Example

Returns the index of the list box item indicated by the coordinates of a point on the control.

function ItemAtPos(Pos: TPoint; Existing: Boolean): Integer;

Description

Use ItemAtPos to detect if an item exists at a particular point in the control.

The Pos parameter is the point in the control in window coordinates. If Pos is beyond the last item in the list box, the value of the Existing variable determines the returned value. If Existing is set to True, ItemAtPos returns -1, indicating that no item exists at that point. If Existing is set to False, ItemAtPos returns the index of the last item in the list box plus one.


TCustomListBox.ItemRect

TCustomListBox	See also 	Example

Returns the rectangle that surrounds the item specified in the Item parameter.

function ItemRect(Item: Integer): TRect;

Description

Use ItemRect to get the coordinates of a particular item in the list box. For example, ItemRect is used internally by the ItemAtPos method.

The Item parameter is the ItemIndex of the item whose position is queried.


TCustomListBox.MeasureItem

TCustomListBox	See also

Generates an OnMeasureItem event.

procedure MeasureItem(Index: Integer; var Height: Integer); virtual;

Description

MeasureItem is called whenever a visual aspect of a variable owner-draw list box changes and the csOwnerDrawVariable Style is set.

Before drawing its items, a variable owner-draw list box calls MeasureItem once for each visible item, passing the index of the item to measure, and the default height of the item. Since Height is passed by reference (a var parameter), MeasureItem can increase or reduce the height of each item as needed.

By default the MeasureItem method does nothing except call any event handler attached to the OnMeasureItem event. Override MeasureItem to change or add functionality to the default behavior.


TCustomListBox.ResetContent

TCustomListBox	See also

Removes all of the items from a list box.

procedure ResetContent; dynamic;

Description

ResetContent is used to remove the items from the list box. ResetContent is used, for example, by the Clear method.


TCustomListBox.SetItemData

TCustomListBox	See also

Sets the 32-bit value associated with the specified item in a list box.

procedure SetItemData(Index: Integer; AData: LongInt); dynamic;

Description

Use SetItemData to set the data associated with a particular item in a list box. This value can be displayed as that list box item, or can be a value (such as a pointer) represented by the list box item.


TCustomListBox.WndProc

TCustomListBox	See also	Example

Handles Windows messages.

procedure WndProc(var Message: TMessage); virtual;

Description

WndProc overrides the inherited WndProc to provide specialized responses to messages that allows the list box to handle auto drag mode itself. Then it calls the inherited WndProc to handle all other messages.

When overriding the WndProc method, be sure to call the inherited WndProc at the end to dispatch any other messages.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomListView

Hierarchy	Properties	Methods	Events	See also

TCustomListView is the base type for all list view components, including TListView.

Unit

comctrls

Description

Use TCustomListView as a base class when defining a control that displays a list of items. TCustomListView allows a list of items to be displayed in columns with column headers and sub-items, or vertically or horizontally, with small or large icons.

Do not create instances of TCustomListView. To put a list view on a form, use a descendant of TCustomListView, such as TListView.


TCustomListView properties

TCustomListView	Alphabetically	Legend

In TCustomListView

AllocBy

BorderStyle

BoundingRect

Canvas

Checkboxes

Column

ColumnClick

Columns

DropTarget

FlatScrollBars

FullDrag

GridLines

HideSelection

HotTrack

HotTrackStyles

HoverTime

IconOptions

ItemFocused

Items

LargeImages

MultiSelect

OwnerData

OwnerDraw

ReadOnly

RowSelect

SelCount

Selected

ShowColumnHeaders

ShowWorkAreas

SmallImages

SortType

StateImages

TopItem

ViewOrigin

ViewStyle

VisibleRowCount

WorkAreas

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomListView properties

TCustomListView	By object	Legend

Action

Align

AllocBy

Anchors

BiDiMode

BorderStyle

BoundingRect

BoundsRect

Brush

Canvas

Checkboxes

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Column

ColumnClick

Columns

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DropTarget

Enabled

FlatScrollBars

Floating

FloatingDockSiteClass

FullDrag

GridLines

Handle

Height

HelpContext

HideSelection

Hint

HostDockSite

HotTrack

HotTrackStyles

HoverTime

IconOptions

ItemFocused

Items

LargeImages

Left

LRDockWidth

MultiSelect

Name

Owner

OwnerData

OwnerDraw

Parent

ParentWindow

ReadOnly

RowSelect

SelCount

Selected

ShowColumnHeaders

ShowHint

Showing

ShowWorkAreas

SmallImages

SortType

StateImages

TabOrder

TabStop

Tag

TBDockHeight

Top

TopItem

UndockHeight

UndockWidth

VCLComObject

ViewOrigin

ViewStyle

Visible

VisibleDockClientCount

VisibleRowCount

Width

WindowProc

WorkAreas


TCustomListView.AllocBy

TCustomListView	See also

Indicates the number of items the list view can store in memory.

property AllocBy: Integer;

Description

Set AllocBy to the total number of items in the list before adding a large number of items to the list view. AllocBy allows the list view to allocate the memory for items in a single block at once rather than bit by bit as items are added.


TCustomListView.BorderStyle

TCustomListView

Determines whether the list view displays a single line border.

property BorderStyle: TBorderStyle;

Description

Use BorderStyle to affect the sharpness with which the list view control stands out on a form. BorderStyle can have a value of either bsSingle or bsNone. If BorderStyle is bsSingle, the list view is drawn with a single-line border. If BorderStyle is bsNone, there will be no border.


TCustomListView.BoundingRect

TCustomListView	See also

Denotes the bounding rectangle for the items in the list view.

property BoundingRect: TRect;

Description

Read BoundingRect to obtain the screen coordinates of a rectangle that encloses all the items in the list view. BoundingRect allows an application to adjust the size of the control to fit the items or to determine whether the mouse is over any of the list items.

Note:	To use BoundingRect, the list view’s ViewStyle property must be either vsIcon or vsSmallIcon.


TCustomListView.Canvas

TCustomListView	See also

Gives access to the list view's canvas.

property Canvas: TCanvas;

Description

Use the Canvas property to paint to the list view's canvas during the OnCustomDraw, OnCustomDrawItem, and OnCustomDrawSubItem events.


TCustomListView.CheckBoxes

TCustomListView	See also

Specifies whether check boxes appear next to the items in the list view.

property Checkboxes: Boolean;

Description

Set CheckBoxes to True to make check boxes appear next to the list items when ViewStyle is vsList or vsReport. Each line in the list displays a single check box.


TCustomListView.Column

TCustomListView	See also	Example

Describes the column specified by the Index parameter.

property Column[Index: Integer]: TListColumn;

Description

Read Column to access the TListColumn object that describes the column attributes of a column in a report style list view. The Index parameter is the index of the column in the Columns property array.

Note:	Column is only relevant when the value of the ViewStyle property is vsReport.


TCustomListView.ColumnClick

TCustomListView	See also

Determines whether the column header behaves like a button.

property ColumnClick: Boolean;

Description

Use ColumnClick to specify whether the OnColumnClick event should occur when the user clicks on the column header. When ColumnClick is True, the OnColumnClick occurs when the column header is clicked with the mouse. When ColumnClick is False, the OnColumnClick event never occurs.

Note:	For column clicks to work, the column headers must be displayed. To display the headers set the ShowColumnHeaders property to True and the ViewStyle property to vsReport.


TCustomListView.Columns

TCustomListView	See also 	Example

Describes the properties of the columns in the list view.

property Columns: TListColumns;

Description

Use Columns to add or delete columns in the list view, or to edit their display properties. When setting Columns at design time a ListView Columns Editor dialog appears. This dialog allows columns to be added or deleted, and the display properties of individual columns to be changed. At runtime use the Caption, Alignment, and Width properties of the TListColumn objects accessed by the Columns property to change the appearance of the column headers.

Note:	To display the columns, set the ViewStyle property to vsReport and the ShowColumnHeaders property to True.


TCustomListView.DropTarget

TCustomListView	See also

Specifies which item in the list is the target of a drag and drop operation.

property DropTarget: TListItem;

Description

Read DropTarget to determine whether an item in the list is the target of a drag and drop operation. Set DropTarget to change whether a particular item in the list can be the drop target of a dragged item.

Note:	DropTarget only indicates the list item that appears to the user as a drop target. The application must still implement the drag-and-drop behavior for the item.


TCustomListView.FlatScrollBars

TCustomListView

Specifies whether the list view's scroll bars are flat.

property FlatScrollBars: Boolean;

Description

Use FlatScrollBars to get or set whether the list view's scroll bars are flat. Flat scroll bars do not have the bevelled borders used for the three-dimensional effect.

Note:	List views only support flat scroll bars if the system has version 472 or later of comctl32.dll.


TCustomListView.FullDrag

TCustomListView	See also

Specifies whether headers are repainted when they are dragged.

property FullDrag: Boolean;

Description

Use FullDrag to get or set whether headers are repainted when they are dragged.

Note:	To display the column headers, set the ViewStyle property to vsReport and the ShowColumnHeaders property to True.


TCustomListView.GridLines

TCustomListView	See also

Determines whether lines are drawn separating items in the list.

property GridLines: Boolean;

Description

Set GridLines to True to add lines that separate the items in the list view. The value of GridLines is ignored unless ViewStyle is vsList or vsReport.


TCustomListView.HideSelection

TCustomListView	See also

Determines whether the list view gives a visual indication of which item is selected when focus shifts to another control.

property HideSelection: Boolean;

Description

Set HideSelection to False to provide visual feedback of the selected item in the list even when the list view does not have focus. Set HideSelection to True to show the selection only when the list view has focus. HideSelection does not affect the actual value of the selection, only the visual indication. Always setting HideSelection to False can make forms with many list views look too busy.


TCustomListView.HotTrack

TCustomListView	See also

Specifies whether list items are highlighted when the mouse passes over them.

property HotTrack: Boolean;

Description

Set HotTrack to True to provide visual feedback about which item is under the mouse. When HotTrack is True, the HoverTime property controls whether pausing the mouse over an item causes it to be selected. When HotTrack is False, there is no visual feedback when the mouse passes over items and users can’t select items by pausing the mouse.

To specify hot tracking styles, use the HotTrackStyles property.


TCustomListView.HotTrackStyles

TCustomListView	See also

Specifies the hot tracking styles.

property HotTrackStyles: TListHotTrackStyles;

Description

Use HotTrackStyles to specify the hot tracking styles. The hot tracking style indicates the type of feedback that the list view gives when the mouse passes over list items. This feedback can be a change of the mouse cursor or underline of the list items.

To turn hot tracking on, set HotTrack to True.


TCustomListView.HoverTime

TCustomListView	See also

Specifies how long the user must pause with the mouse before an item is selected.

property HoverTime: Integer;

Description

Use HoverTime to indicate how long (in milliseconds) the user must pause with the mouse before an item is selected. If HoverTime is –1 (the default value), a default time period must elapse.

HoverTime has no effect unless the HotTrack property is True.


TCustomListView.IconOptions

TCustomListView	See also

Determines how icons displayed in the list view are arranged.

property IconOptions: TIconOptions;

Description

Set the properties of the TIconOptions object that is the value of IconOptions to specify how the icons in the list view should be arranged. The ViewStyle of the list view must be set to either vsIcon or vsSmallIcons for these options to affect the control.


TCustomListView.ItemFocused

TCustomListView	See also

Indicates which item, if any, has focus.

property ItemFocused: TListItem;

Description

Read ItemFocused to determine which item, if any, can be edited by the user. Set ItemFocused to set focus to an item in the list. When an item has focus, it appears surrounded by a standard focus rectangle. If no item has focus, ItemFocused returns nil. Only one item can have focus at a time.


TCustomListView.Items

TCustomListView	See also	Example

Contains the list of items displayed by the list view.

property Items: TListItems;

Description

Use Items to directly access the TListItem objects that represent the items in the list. Setting this property at design time brings up the ListView Items Editor. Use this dialog to add or delete items or subitems, and to edit their display properties. At runtime, use each item's Caption, ImageIndex and StateIndex properties to change the appearance of the list items.


TCustomListView.LargeImages

TCustomListView	See also 	Example

Provides a list of icon images to display for each item in the list when ViewStyle is vsIcon.

property LargeImages: TCustomImageList;

Description

Set LargeImages to specify the bitmaps that should be displayed next to items in the list when ViewStyle is vsIcon. Each item in the Items list can be associated with a bitmap in this image list by setting its ImageIndex property.


TCustomListView.MultiSelect

TCustomListView	See also

Determines whether the user can select more than one list item at a time.

property MultiSelect: Boolean;

Description

Set MultiSelect to specify whether users can multiselect items in the list. If MultiSelect is True, the user can select multiple items. If MultiSelect if False, only one item can be selected at a time.


TCustomListView.OwnerData

TCustomListView	See also

Specifies whether the list view control is virtual.

property OwnerData: Boolean;

Description

Set OwnerData to True to specify that the list view is virtual. A virtual list view can contain a huge number of items (specifically, up to a DWORD). However, you must manage the items of a virtual list view using the OnData, OnDataFind, OnDataHint, and OnDataStateChange event handlers. For example, you must explicitly provide a value to a list item’s StateIndex property if it is to display a check box.

When creating a virtual list view, you must set the Count property for the Items to the number of items in the virtual list.

The only information contained in a virtual list view control is the selection and focus information.

To improve the peformance of a virtual list view control, cache items for quick retrieval. The OnDataHint event can help optimize retrieval from the cache.

Note:	Virtual list views need not be owner-drawn. The OnData, OnDataFind, OnDataHint, and OnDataStateChange events enable the list view’s default drawing, if desired.


TCustomListView.OwnerDraw

TCustomListView	See also

Specifies whether the list view control handles its own painting.

property OwnerDraw: Boolean;

Description

Set OwnerDraw to True to allow the list view to receive custom draw events (OnCustomDraw, OnCustomDrawItem, and OnCustomDrawSubItem). When OwnerDraw is True, the list view receives custom draw messages instead of rendering its own image.

Note:	This property is not related to the custom data services, which are encapsulated by the OwnerData property and its corresponding events and methods.


TCustomListView.ReadOnly

TCustomListView	See also

Determines whether the user can change the contents of the control.

property ReadOnly: Boolean;

Description

Use ReadOnly to determine whether the list view can be used to enter data. If ReadOnly is True, the list view displays values that the user can’t edit. If ReadOnly is False, the user can modify the contents. If ReadOnly is False, the OnEditing and OnEdited events occur when the user begins and finishes editing the list item, respectively.


TCustomListView.RowSelect

TCustomListView	See also

Determines whether an entire row in the list view can be selected.

property RowSelect: Boolean;

Description

Set RowSelect to True to allow entire rows to be selected when the ViewStyle property is vsReport. To allow multiple rows to be selected, use the MultiSelect property.


TCustomListView.SelCount

TCustomListView	See also

Specifies the number of selected items in the list view.

property SelCount: Integer;

Description

Read SelCount to determine the number of items that are currently selected. When SelCount is 1, use the Selected property to access the selected item. To locate the selected items when SelCount is greater than one, check the Selected property of the list items, beginning with the item specified by the Selected property.

Note:	SelCount can only exceed 1 if the MultiSelect property is True.


TCustomListView.Selected

TCustomListView	See also 	Example

Indicates the first selected item in the list view.

property Selected: TListItem;

Description

Read Selected to access the properties of the first selected item in the list. If SelCount is 0, Selected is nil. If SelCount is greater than 1, subsequent selected items can be located by checking the Selected property of the items found using the GetNextItem method.

Set the Selected property to select an item in the list. If MultiSelect is True, setting Selected adds an item to the selection. If MultiSelect is False, setting Selected changes the selection. Setting Selected to nil deselects all items in the list.

When an item is selected, the OnChanging and OnChange events are generated.


TCustomListView.ShowColumnHeaders

TCustomListView	See also

Determines whether the column headers are displayed.

property ShowColumnHeaders: Boolean;

Description

Set ShowColumnHeaders to specify whether the columns in the list view should display column headers. A column header is a panel with a caption that identifies the category of items in the column of the list view. Headers are useful for labeling columns of subitems that provide additional information in a list view. Use the Columns property to create or add headers.

Note:	To use columns in a list view, the ViewStyle property must be set to vsReport.


TCustomListView.ShowWorkAreas

TCustomListView	See also

Determines whether the visual properties of work areas are displayed.

property ShowWorkAreas: Boolean;

Description

Set ShowWorkAreas to specify whether the list view should paint each work area in its own color and labeled by its display name. If the list view’s WorkAreas property includes any work areas, the icons in the list view are always grouped visually by these work areas. ShowWorkAreas determines whether the properties of individual work area components are used to make each area stand out visually.

When ShowWorkAreas is True, each work area is painted in the color specified by its Color property and labeled by the string in its DisplayName property. When ShowWorkAreas is False, icons appear grouped by work areas, but there is no other visual indication.

Note:	To use work areas in a list view, the ViewStyle property must be set to vsIcon or vsSmallIcon.


TCustomListView.SmallImages

TCustomListView	See also 	Example

Provides a list of icon images to display for each item in the list when ViewStyle is not vsIcon.

property SmallImages: TCustomImageList;

Description

Set SmallImages to specify the icons that should be displayed next to items in the list when ViewStyle is vsSmallIcon, vsList, or vsReport. Each item in the Items list can be associated with an icon in this image list by setting its ImageIndex property.


TCustomListView.SortType

TCustomListView 	See also

Determines if and how the items in the list are automatically sorted.

type TSortType = (stNone, stData, stText, stBoth);

property SortType: TSortType;

Description

Set SortType to specify the order of items in the list. If SortType is not stNone, the list items in the Items property are automatically sorted. Once a list view is sorted, the original order is lost. That is, setting the SortType back to stNone will not restore the original order of items. These are the possible values:

Value	Meaning

stNone	No sorting is done.

stData	Items are sorted based on the Data property of the TListItem objects. An OnCompare event handler must be provided to compare Data values.

stText	Items are sorted based on the Caption property of the TListItem objects.

stBoth	Items are sorted based on both the Data and Caption properties of the TListItem objects. The Data values are ignored unless an OnCompare event handler is provided.

Note:	If the list view uses work areas, sorting items only compares each item to the other items in its work area.


TCustomListView.StateImages

TCustomListView	See also

Provides a list of additional icon images to display next to each item in the list view.

property StateImages: TCustomImageList;

Description

Set StateImages to specify the icons that should be displayed next to items in the list. Each item in the Items list can be associated with an icon in this image list by setting its StateIndex property.


TCustomListView.TopItem

TCustomListView	See also

Indicates the topmost visible item in the list view.

property TopItem: TListItem;

Description

Read TopItem to determine the first item in the list view that the user can see. TopItem reflects how far the list view has been scrolled.

TopItem is only implemented when ViewStyle is vsReport or vsList. For vsIcon and vsSmallIcon view styles, use the ViewOrigin property to determine the scroll position.


TCustomListView.ViewOrigin

TCustomListView	See also

Designates the coordinates of the upper left corner of the list, relative to the visible area of the list view control.

property ViewOrigin: TPoint;

Description

Read ViewOrigin to determine the logical origin of the list image. When the list view is not scrolled, ViewOrigin is (0,0). Otherwise, use the x coordinate to determine the number of pixels the view is scrolled horizontally, and the y coordinate to determine the number of pixels the view is scrolled vertically.

ViewOrigin is only implemented when ViewStyle is vsIcon or vsSmallIcon. For vsReport or vsList, use the TopItem property instead.


TCustomListView.ViewStyle

TCustomListView	See also	Example

Determines how the list items are displayed.

type TViewStyle = (vsIcon, vsSmallIcon, vsList, vsReport);

property ViewStyle: TViewStyle;

Description

Set ViewStyle to control the visual display of items in a list view. The items can be displayed as a set of movable icons, or as columns of text. These are the possible values:

Value	Meaning

vsIcon	Each item appears as a full-sized icon with a label below it. The user can drag the items to any location in the list view window.

vsSmallIcon	Each item appears as a small icon with the label to the right of it. The user can drag the items to any location.

vsList	Each item appears as a small icon with a label to the right of it. Items are arranged in columns and cannot be dragged by the user.

vsReport	Each item appears on its own line with information arranged in columns. The leftmost column contains the small icon and label, and subsequent columns contain subitems as specified by the application. Unless ShowColumnHeaders is False, each column has a header.


TCustomListView.VisibleRowCount

TCustomListView	See also

Indicates number of items that can fit vertically in the visible area of a list view.

property VisibleRowCount: Integer;

Description

Read VisibleRowCount to determine the number of items from a single column that can appear in the visible area of a list view when the ViewStyle is either vsList or vsReport. Only fully visible items are counted. If VisibleRowCount is less than the total number of items in a column, use the TopItem property to determine if the list view is scrolled.


TCustomListView.WorkAreas

TCustomListView	See also

Defines separate working areas that divide the list view’s client area.

property WorkAreas: TWorkAreas;

Description

Use WorkAreas to define separate work areas that divide the client area of the list view when the ViewStyle property is vsIcon or vsSmallIcon. Work areas are rectangular regions that the list view uses to arrange its icons. Each icon falls into a single work area, which is specified by its WorkArea property. Within each work area, icons are arranged in rows (or columns), wrapping at the right (or bottom) edge of the work area. If a work area is larger than the client area of the list view, the list view adds a scroll bar.

If WorkAreas contains no TWorkArea objects, the list view arranges icons based on its client area.

Note:	It is possible to create overlapping work areas, but this is not recommended. Icons that fall in the intersection of two or more work areas become members of the work area with the lowest index.


TCustomListView events

TCustomListView	Alphabetically	Legend

In TCustomListView

OnAdvancedCustomDraw

OnAdvancedCustomDrawItem

OnAdvancedCustomDrawSubItem

OnChange

OnChanging

OnColumnClick

OnColumnDragged

OnColumnRightClick

OnCompare

OnCustomDraw

OnCustomDrawItem

OnCustomDrawSubItem

OnData

OnDataFind

OnDataHint

OnDataStateChange

OnDeletion

OnDrawItem

OnEdited

OnEditing

OnGetImageIndex

OnGetSubItemImage

OnInfoTip

OnInsert

OnSelectItem


TCustomListView events

TCustomListView	By object	Legend

OnAdvancedCustomDraw

OnAdvancedCustomDrawItem

OnAdvancedCustomDrawSubItem

OnChange

OnChanging

OnColumnClick

OnColumnDragged

OnColumnRightClick

OnCompare

OnCustomDraw

OnCustomDrawItem

OnCustomDrawSubItem

OnData

OnDataFind

OnDataHint

OnDataStateChange

OnDeletion

OnDrawItem

OnEdited

OnEditing

OnGetImageIndex

OnGetSubItemImage

OnInfoTip

OnInsert

OnSelectItem


TCustomListView.OnAdvancedCustomDraw

TCustomListView	See also

Occurs at discrete points during the rendering of an owner-draw list view.

type TLVAdvancedCustomDrawEvent = procedure(Sender: TCustomListView; const ARect: TRect; Stage: TCustomDrawStage; var DefaultDraw: Boolean) of object;

property OnAdvancedCustomDraw: TLVAdvancedCustomDrawEvent;

Description

Write an OnAdvancedCustomDraw event handler to draw to customize the painting of the list view at various stages before its items are drawn. OnAdvancedCustomDraw occurs only if the OwnerDraw property is True.

Sender is the list view that is about to be painted.

ARect indicates the dimensions of the list view on its Canvas.

Stage indicates the current stage in the drawing process. Note that the cdPreErase and cdPostErase stages do not receive event notification. The background must be drawn when the item is rendered.

DefaultDraw is used only when Stage is cdPrePaint. It indicates whether the list view should continue with the default painting after the event handler exits. Set DefaultDraw to False to prevent the drawing of the list view after event handler exits. If DefaultDraw remains set to True, the list view continues with the default painting process.

Note:	OnAdvancedCustomDraw occurs at various stages during the paint process. If you are only writing code to execute immediately prior to rendering the list view, it is more efficient to use the OnCustomDraw event.


TCustomListView.OnAdvancedCustomDrawItem

TCustomListView	See also

Occurs at discrete stages during the painting of an item in an owner-draw list view.

type TLVAdvancedCustomDrawItemEvent = procedure(Sender: TCustomListView; Item: TListItem; State: TCustomDrawState; Stage: TCustomDrawStage; var DefaultDraw: Boolean) of object;

property OnAdvancedCustomDrawItem: TLVAdvancedCustomDrawItemEvent;

Description

Write an OnAdvancedCustomDrawItem event handler to customize the drawing of individual items on the list view's canvas (using the Canvas property). OnAdvancedCustomDrawItem occurs at various stages in the rendering of a list item when the OwnerDraw property is True.

Sender is the list view whose item is drawn.

Item is the item that is currently being painted.

State indicates the state of the item, so that the event handler can adjust the image to reflect whether the item is selected, disabled, hot, and so on.

Stage indicates the current stage in drawing the list item. Note that the cdPreErase and cdPostErase stages do not receive event notification. The background must be drawn when the item is rendered.

DefaultDraw is used only when Stage is cdPrePaint. Set DefaultDraw to False if you don't want the control to paint the item’s text after the event handler exits. If DefaultDraw remains True, the list view adds the item’s text to the image on the canvas.

Note:	OnAdvancedCustomDrawItem occurs at various stages during the paint process. If you are only writing code to execute immediately prior to rendering the list item, it is more efficient to use the OnCustomDrawItem event.


TCustomListView.OnAdvancedCustomDrawSubItem

TCustomListView	See also

Occurs at discrete stages during the painting of a subitem in an owner-drawn list view.

type TLVAdvancedCustomDrawSubItemEvent = procedure(Sender: TCustomListView; Item: TListItem; SubItem: Integer; State: TCustomDrawState; Stage: TCustomDrawStage; var DefaultDraw: Boolean) of object;

property OnAdvancedCustomDrawSubItem: TLVAdvancedCustomDrawSubItemEvent

Description

Write an OnCustomDrawSubItem event handler to customize the drawing of subitems that appear in additional columns to the right of each item when ViewStyle is vsReport. Use the list view’s Canvas property as a drawing surface. OnAdvancedCustomDrawItem occurs at various stages in the rendering of a subitems when the OwnerDraw property is True.

The Sender Parameter specifies the list view that owns the subitems.

The Item parameter is the current Item being drawn.

The SubItem parameter is the index of the subitem of that list item in its SubItems property.

The State property indicates various attributes that can affect the way the subitem is drawn.

The Stage property indicates the current stage in the painting process. Note that the cdPreErase and cdPostErase stages do not receive event notification. The background must be drawn when the item is rendered.

DefaultDraw is only used when Stage is cdPrepaint. Set DefaultDraw to False to prevent the list view from adding the subitem’s text after the event handler exits.

Note:	OnAdvancedCustomDrawSubItem occurs at various stages during the paint process. If you are only writing code to execute immediately prior to rendering the subitem, it is more efficient to use the OnCustomDrawSubItem event.


TCustomListView.OnChange

TCustomListView	See also

Occurs immediately after an item in the list changes.

type TLVChangeEvent = procedure(Sender: TObject; Item: TListItem; Change: TItemChange) of object;

property OnChange: TLVChangeEvent;

Description

Write an OnChange event handler to respond to changes in the list items. OnChange allows a response once the list has been successfully changed.

The Item parameter is the list item that just changed. The Change parameter indicates the type of change that just occurred. Change is ctText if the Caption property of the item changed. Change is ctImage if the ImageIndex property of the item changed or the appropriate image list changed in the list view. Change is ctState if the Cut, Focused, or Selected property of the item changed.


TCustomListView.OnChanging

TCustomListView	See also

Occurs when an item in the list is about to change.

type TLVChangingEvent = procedure(Sender: TObject; Item: TListItem; Change: TItemChange; var AllowChange: Boolean) of object;

property OnChanging: TLVChangingEvent;

Description

Write an OnChanging event handler to conditionally block changes to an item in the list. Set the AllowChange parameter to False to prevent the change from taking place. The Item parameter is the list item that is about to change. The Change parameter indicates the type of change that is about to happen.


TCustomListView.OnColumnClick

TCustomListView	See also	Example

Occurs when the user clicks on a column header in a list view.

type TLVColumnClickEvent = procedure(Sender: TObject; Column: TListColumn) of object;

property OnColumnClick: TLVColumnClickEvent;

Description

Write an OnColumnClick event handler to respond to right clicks made in the column header when ViewStyle is vsReport. The Column parameter is the TListColumn object from the Columns property that describes the column that was clicked.

OnColumnClick only occurs when ViewStyle is vsReport and ShowColumnHeaders is True.


TCustomListView.OnColumnDragged

TCustomListView	See also

Occurs when a column is dragged to a new position.

property  property OnColumnDragged: TNotifyEvent;

Description

Write an OnColumnDragged event handler to respond when the user drags a column to a new position. OnColumnDragged occurs after all columns are in their new positions but before the list view repaints to reflect the change.

OnColumnClick only occurs when ViewStyle is vsReport and ShowColumnHeaders is True.

Tip:	To uniquely identify columns so that you can recognize them after they are repositioned, use the list column’s Tag property.


TCustomListView.OnColumnRightClick

TCustomListView	See also

Occurs when the user right clicks on a column header in a list view.

type TLVColumnRClickEvent = procedure(Sender: TObject; Column: TListColumn; Point: TPoint) of object;

property OnColumnRightClick: TLVColumnRClickEvent;

Description

Write an OnColumnRightClick event handler to respond to right clicks made in the column header when ViewStyle is vsReport.

The Sender parameter is the list view that the user clicked.

The Column parameter is the TListColumn object from the Columns property for the column that was clicked.

The point parameter indicates where the user clicked the mouse, in client coordinates.

OnColumnRightClick only occurs when ViewStyle is vsReport, and ShowColumnHeaders is True, and ColumnRightClick is True.


TCustomListView.OnCompare

TCustomListView	See also	Example

Occurs to when two items need to be compared during a sort of the list.

type TLVCompareEvent = procedure(Sender: TObject; Item1, Item2: TListItem; Data: Integer; var Compare: Integer) of object;

property OnCompare: TLVCompareEvent;

Description

Write an OnCompare event handler to implement a sort order for the list. An OnCompare event handler is called when the SortType property is stData or stBoth, when the AlphaSort method is called, or when the CustomSort method is called without a SortProc parameter.

The OnCompare event handler compares the list items passed as the Item1 and Item2 parameters. If Item1 is the same as Item2 in the sort order, set the Compare parameter to 0. If Item1 is less than Item2, set the Compare parameter to a value less than 0. If Item1 is greater than Item2, set the Compare parameter to a value greater than 0. The Data parameter is 0 when the event handler is called to maintain the sort order of a list view with a SortType of stData or stBoth. Similarly, when OnCompare occurs in response to the AlphaSort method, the Data parameter is 0. When OnCompare occurs in response to the CustomSort method, the Data parameter is the value of the LParam parameter of CustomSort.


TCustomListView.OnCustomDraw

TCustomListView	See also

Occurs when an owner-draw list view must be rendered.

type TLVCustomDrawEvent = procedure(Sender: TCustomListView; const ARect: TRect; var DefaultDraw: Boolean) of object;

property OnCustomDraw: TLVCustomDrawEvent;

Description

Write an OnCustomDraw event handler to draw to the list view's Canvas before its items are painted. OnCustomDraw occurs only if the OwnerDraw property is True.

Sender is the list view that is about to be painted.

ARect indicates the dimensions of the list view on its Canvas.

DefaultDraw indicates whether the list view should continue with the default painting after the event handler exits. Set DefaultDraw to False to prevent the drawing of the list view after event handler exits. If DefaultDraw remains set to True, the list view continues with the default painting process.

Note:	OnCustomDraw occurs immediately prior to the rendering of the list view control. To augment the default drawing process at other stages (such as when the background is erased or after the list view is drawn), use the OnAdvancedCustomDraw event instead.


TCustomListView.OnCustomDrawItem

TCustomListView	See also

Occurs when an item in an owner-draw list view must be rendered.

type TLVCustomDrawItemEvent = procedure(Sender: TCustomListView; Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean) of object;

property OnCustomDrawItem: TLVCustomDrawItemEvent;

Description

Write code in an OnCustomDrawItem handler to draw individual items on the list view's canvas (using the Canvas property) before an item is painted.

Sender is the list view whose item is to be drawn.

Item is the item that should be rendered.

State indicates the state of the item, so that the event handler can adjust the image to reflect whether the item is selected, disabled, hot, and so on.

Set DefaultDraw to False if you don't want the control to paint the item’s text after the event handler exits. If DefaultDraw remains True, the list view adds the item’s text to the image on the canvas.

Note:	OnCustomDrawItem occurs immediately prior to the rendering of each list item. To augment the default drawing process at other stages (such as after the list item is drawn), use the OnAdvancedCustomDrawItem event instead.


TCustomListView.OnCustomDrawSubItem

TCustomListView	See also

Occurs when a subitem must be rendered in an owner-draw list view.

type TLVCustomDrawSubItemEvent = procedure(Sender: TCustomListView; Item: TListItem; SubItem: Integer; State: TCustomDrawState; var DefaultDraw: Boolean) of object;

property OnCustomDrawSubItem: TLVCustomDrawSubItemEvent

Description

Write code in an OnCustomDrawSubItem handler to draw to the subitems that appear in additional columns to the right of each item when ViewStyle is vsReport. Use the list view’s Canvas property as a drawing surface.

The Sender Parameter specifies the list view that owns the subitems. The Item parameter is the current Item being drawn. The SubItem parameter is the index of the subitem of that list item in its SubItems property. The State property indicates various attributes that can affect the way the subitem is drawn. Set DefaultDraw to False to prevent the list view from adding the subitem’s text after the event handler exits.

Note:	OnCustomDrawSubItem occurs immediately prior to the rendering of each subitem. To augment the default drawing process at other stages (such as after the subitem is drawn), use the OnAdvancedCustomDrawSubItem event instead.


TCustomListView.OnData

TCustomListView	See also

Occurs immediately before an item is displayed in the list view control.

property OnData: TLVOwnerDataEvent;

Description

Use OnData to customize an item before it is displayed in the list view control. Set the properties of the list item in the event handler so that they appear correctly when the item is drawn.

OnData occurs only if OwnerData is True.


TCustomListView.OnDataFind

TCustomListView	See also

Occurs when the list view control receives a search request, such as when the FindData and FindCaption methods are called.

property OnDataFind: TLVOwnerDataFindEvent;

Description

Use OnDataFind to locate an item and return custom data associated with it.

OnDataFind occurs only if OwnerData is True.


TCustomListView.OnDataHint

TCustomListView	See also

Occurs when the contents of the list view change, such as when the user scrolls the list view.

property OnDataHint: TLVOwnerDataHintEvent;

Description

Use OnDataHint to update a range of items before the OnData event occurs. This method of updating items is more efficient than individually updating items in the OnData event handler. The range of items specified in the OnDataHint does not always match the range of items for which the OnData event handler is called; therefore, you must be prepared to update individual items in the OnData event handler as well.

OnDataHint occurs only if OwnerData is True.


TCustomListView.OnDataStateChange

TCustomListView	See also

Occurs when a range of items change states.

property OnDataStateChange: TLVOwnerDataStateChangeEvent;

Description

Use OnDataStateChange to respond when an item’s state changes.

OnDataStateChange occurs only if OwnerData is True.


TCustomListView.OnDeletion

TCustomListView	See also

Occurs when an item in the list view is about to be deleted.

type TLVDeletedEvent = procedure(Sender: TObject; Item: TListItem) of object;

property OnDeletion: TLVDeletedEvent;

Description

Write an OnDeletion event handler to respond when an item in the list is about to be deleted. The Item parameter is the TListItem object from the Items property that is about to be deleted.


TCustomListView.OnEdited

TCustomListView	See also

Occurs immediately after the user edits an item’s Caption property.

type TLVEditedEvent = procedure(Sender: TObject; Item: TListItem; var S: string) of object;

property OnEdited: TLVEditedEvent;

Description

Write an OnEdited event to take specific action when a user has finished editing the text of a list item. An OnEdited event handler can respond to the value the user typed, or change the value that is assigned to the list item’s Caption property. For example, if an OnEdited event handler can check the validity of the string typed by the user, and only allow the Caption property to be changed if the new value is valid.

The Item parameter is the list item that was just edited. The S parameter is the new value the user typed for the item’s Caption property. Change the value of S to override the value the user typed. When OnEdited occurs, the item’s Caption property has not yet been changed, so S can still be compared to the original value of Caption.

This event can occur only if ReadOnly is set to False.


TCustomListView.OnDrawItem

TCustomListView	See also

Occurs when an item should be drawn in the list view.

property OnDrawItem: TLVDrawItemEvent;

Description

Write code in an OnDrawItem handler to manually draw items in the list view.

This event occurs only if OwnerDraw is True.


TCustomListView.OnEditing

TCustomListView	See also

Occurs when the user starts to edit a list item’s Caption property.

type TLVEditingEvent = procedure(Sender: TObject; Item: TListItem; var AllowEdit: Boolean) of object;

property OnEditing: TLVEditingEvent;

Description

Write an OnEditing event handler to take specific action just before a user edits a list item’s Caption property. To prevent the user from editing the item specified by the ListItem parameter, set the AllowEdit parameter to False.

This event can occur only if the ReadOnly property is set to False.


TCustomListView.OnGetImageIndex

TCustomListView	See also

Occurs when an item is about to be displayed in the list view control.

property OnGetImageIndex: TLVNotifyEvent;

Description

Use OnGetImageIndex to dynamically assign an ImageIndex to the item before it is displayed in the list view control.


TCustomListView.OnGetSubItemImage

TCustomListView	See also

Occurs when a sub item is about to be displayed in the column of a list view control.

type TLVSubItemImageEvent = procedure(Sender: TObject; Item: TListItem; SubItem: Integer; var ImageIndex: Integer) of object;

property OnGetSubItemImage: TLVSubItemImageEvent;

Description

Use OnGetSubItemImage to dynamically assign an image to a subitem before it is displayed in the column of a list view control. This event overrides the value specified by the list item’s SubItemImages property.

The Sender parameter is the list view that is being painted.

The Item parameter is the item whose sub item is being painted.

The SubItem parameter identifies the sub item from the list item’s SubItems property.

The ImageIndex parameter is an index into the list view’s SmallImages property. On entry to the event handler, ImageIndex is initialized to the value specified by the list item’s SubItemImages property for the subitem. Use this event handler to change that value or to suppress the image by setting ImageIndex to –1.

Note:	OnGetSubItemImage only occurs if the list view’s ViewStyle property is vsReport and the current list item’s SubItems property contains sub items.


TCustomListView.OnInfoTip

TCustomListView	See also

Occurs when the user pauses the mouse over an item in the list view.

type TLVInfoTipEvent = procedure(Sender: TObject; Item: TListItem; var InfoTip: string) of object;

property OnInfoTip: TLVInfoTipEvent;

Description

Use OnInfoTip to provide help hints that are specific to individual items in the list view.

By default, when Help hints are enabled (that is, when ShowHint is True), the list view displays the hint specified by its Hint property. OnInfoTip allows the list view to override this value to specify a hint that is specific to the item under the mouse.

The Sender parameter is the list view under the mouse.

The Item parameter is the list item under the mouse.

The InfoTip parameter returns a string that appears in a help hint window.  On entry to the event handler, InfoTip is the item’s Caption. If the event handler assigns an empty string, no hint is displayed.  Otherwise, a hint window appears that displays the value of InfoTip.


TCustomListView.OnInsert

TCustomListView	See also

Occurs immediately after a new item is inserted into the list view.

type = procedure(Sender: TObject; Item: TListItem) of object;

property OnInsert: TLVDeletedEvent;

Description

Write an OnInsert event handler to respond when an item has just been added to the list. The Item parameter is the TListItem object that was added to the Items property.


TCustomListView.OnSelectItem

TCustomListView	See also

Occurs when an item is selected in the list view control.

property OnSelectItem: TLVSelectItemEvent;

Description

Use OnSelectItem to perform actions when an item is selected.


TCustomListView methods

TCustomListView	Alphabetically	Legend

In TCustomListView

AlphaSort

Arrange

CanChange

CanEdit

Change

ChangeScale

ColClick

ColRightClick

ColumnsShowing

Create

CreateListItem

CreateParams

CreateWnd

CustomDraw

CustomDrawItem

CustomDrawSubItem

CustomSort

Delete

Destroy

DestroyWnd

DoEndDrag

DoInfoTip

DoStartDrag

DrawItem

Edit

FindCaption

FindData

GetDragImages

GetHitTestInfoAt

GetItemAt

GetItemIndex

GetNearestItem

GetNextItem

GetSearchString

InsertItem

IsCustomDrawn

IsEditing

MouseUp

Notification

OwnerDataFetch

OwnerDataFind

OwnerDataHint

OwnerDataStateChange

Scroll

StringWidth

UpdateColumn

UpdateColumns

UpdateItems

WndProc

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomListView methods

TCustomListView	By object	Legend

AfterConstruction

AlphaSort

Arrange

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanChange

CanEdit

CanFocus

Change

ChangeScale

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ColClick

ColRightClick

ColumnsShowing

ContainsControl

ControlAtPos

Create

CreateListItem

CreateParams

CreateParented

CreateParentedControl

CreateWnd

CustomDraw

CustomDrawItem

CustomDrawSubItem

CustomSort

DefaultHandler

Delete

Destroy

DestroyComponents

Destroying

DestroyWnd

DisableAlign

Dispatch

Dock

DockDrop

DoEndDrag

DoInfoTip

DoStartDrag

DragDrop

Dragging

DrawItem

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

Edit

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindCaption

FindChildControl

FindComponent

FindData

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetDragImages

GetHitTestInfoAt

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetItemAt

GetItemIndex

GetNamePath

GetNearestItem

GetNextItem

GetParentComponent

GetSearchString

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InsertItem

InstanceSize

Invalidate

IsCustomDrawn

IsEditing

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseUp

MouseWheelHandler

NewInstance

Notification

OwnerDataFetch

OwnerDataFind

OwnerDataHint

OwnerDataStateChange

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

Scroll

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

StringWidth

Update

UpdateAction

UpdateColumn

UpdateColumns

UpdateControlState

UpdateItems

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

WndProc


TCustomListView.AlphaSort

TCustomListView	See also	Example

Sorts the items in the list view.

function AlphaSort: Boolean;

Description

Call AlphaSort to sort the items in the manner maintained automatically when the SortType property is not stNone. If an OnCompare event handler is assigned, AlphaSort uses that event handler to define the sort order. Otherwise, AlphaSort sorts all list items alphabetically in ascending order. If successful, the method returns True.


TCustomListView.Arrange

TCustomListView 	See also

Arranges icons in a list view that has a ViewStyle of vslcon or vsSmallIcon.

type TListArrangement = (arAlignBottom, arAlignLeft, arAlignRight, arAlignTop, arDefault, arSnapToGrid);

procedure Arrange(Code: TListArrangement);

Description

Call Arrange to clean up the arrangement of the icons when the ViewStyle property is vslcon or vsSmallIcon. The Code parameter specifies how to arrange the icons. These are the possible values for the Code parameter:

Value	Meaning

arAlignBottom	Aligns items along the bottom edge of the list view.

arAlignLeft	Aligns items along the left edge of the window.

arAlignRight	Aligns items along the right edge of the window.

arAlignTop	Aligns items along the top edge of the window.

arDefault	Aligns items according to the style associated with the list view when the window was created. For TCustomListView, this is aligned along the top.

arSnapToGrid	Snaps all icons to the nearest grid position.


TCustomListView.CanChange

TCustomListView	See also

Specifies whether the properties of a list item can be changed.

function CanChange(Item: TListItem; Change: Integer): Boolean; dynamic;

Description

CanChange is called automatically when an attempt is made to change the item specified by the Item parameter. The Change parameter is a Windows-defined constant that specifies the type of change that was attempted. CanChange generates an OnChanging event to determine whether the change should be permitted. CanChange returns True if the change can proceed. CanChange returns False if the change should be blocked. CanChange always returns True if there is no OnChanging event handler.

Override CanChange to add additional logic to determine whether a change should proceed or to block the OnChanging event.


TCustomListView.CanEdit

TCustomListView	See also

Specifies whether the text of a list item can be changed by the user.

function CanEdit(Item: TListItem): Boolean; dynamic;

Description

CanEdit is called automatically when the user attempts to edit the text of the list item specified by the Item parameter. CanEdit generates an OnEditing event to determine whether to allow the user to edit the item. CanEdit returns True if the user can proceed. CanEdit returns False if the user should be blocked from editing the item. CanEdit always returns True if there is no OnEditing event handler.

Override CanEdit to add additional logic to determine whether an item can be edited or to block the OnEditing event.


TCustomListView.Change

TCustomListView	See also

Generates an OnChange event.

procedure Change(Item: TListItem; Change: Integer); dynamic;

Description

Change is called automatically after the properties of the item specified by the Item parameter change. The Change parameter is a Windows-defined constant that specifies the type of change that occurred.

Override Change to perform other actions when the list items change or to block the OnChange event.


TCustomListView.ChangeScale

TCustomListView	See also

Repositions and resizes the list view by a specified ratio.

procedure ChangeScale(M, D: Integer); override;

Description

Use ChangeScale to rescale a list view. ChangeScale modifies the position as well as the size of the list view. Thus, ChangeScale modifies the Top, Left, Width, and Height properties.

The M and D parameters define a fraction by which to scale the list view. The M parameter is the multiplier and the D parameter is the divisor. For example, to make a control 75% of its original size, specify the value of M as 75, and the value of D as 100 (75/100). Alternately, the same results are achieved by specifying the value of M as 3, and the value of D as 4 (3/4). Both fractions are equal and result in the control being scaled by the same amount, 75%.

To scale the list view to be 33% larger than its previous size, specify the value of M as 133, and the value of D as 100 (133/100). Alternately, specify the value of M as 4, and the value of D as 3 (4/3), as the fraction 133/100 is approximately equal to 4/3.

Note:	Because control sizes and coordinates are integers, scaling them by the M/D ratio incurs some degree of roundoff error. Calling ChangeScale repeatedly means that at some point the control may disappear (when the roundoff errors make the control smaller), or creep off the form (when the roundoff errors move the location of control). When rescaling a control repeatedly, consider destroying and reloading the form after several rescalings so that the coordinates are rescaled without most of the accumulating roundoff error.


TCustomListView.ColClick

TCustomListView	See also

Generates an OnColumnClick event.

procedure ColClick(Column: TListColumn); dynamic;

Description

ColClick is called automatically when the user clicks on a column header if the ColumnClick and ShowColumnHeaders properties are True and the ViewStyle property is vsReport. Override ColClick to take additional action when the user clicks on a column header or to conditionally block the OnColumnClick event.


TCustomListView.ColRightClick

TCustomListView	See also

Generates an OnColumnRightClick event.

procedure ColRightClick(Column: TListColumn, Point:TPoint); dynamic;

Description

ColRightClick is called automatically when the user clicks on a column header with the right mouse button if the ShowColumnHeaders properties is True and the ViewStyle property is vsReport. Override ColRightClick to take additional action when the user right clicks on a column header or to conditionally block the OnColumnRightClick event.


TCustomListView.ColumnsShowing

TCustomListView	See also

Indicates whether the ViewStyle property is vsReport.

function ColumnsShowing: Boolean;

Description

Call ColumnsShowing to determine whether the list view displays its items in columns. ColumnsShowing returns True if the value of ViewStyle is vsReport, False otherwise.


TCustomListView.Create

TCustomListView	See also	Example

Creates and initializes an instance of TCustomListView.

constructor Create(AOwner: TListItems);

Description

Call Create to instantiate a list view at runtime. List view controls placed on forms at design time are created automatically.

After calling the inherited constructor, Create initializes the list view’s properties.


TCustomListView.CreateListItem

TCustomListView	See also

Creates a list item for the collection specified by the Items property.

function CreateListItem: TListItem; virtual;

Description

Call CreateListItem to create a TListItem object that will be added to the Items collection. CreateListItem creates the list item but does not insert it into the collection.


TCustomListView.CreateParams

TCustomListView	See also

Initializes the window-creation parameter record.

procedure CreateParams(var Params: TCreateParams); override;

Description

CreateParams is called automatically to initialize the window-creation parameters when the list view needs to create its window. CreateParams overrides the inherited method to specify a list view window that implements the property settings of the list view control.

When overriding the CreateParams method, be sure to call the inherited method before changing any of the values in the Params parameter.


TCustomListView.CreateWnd

TCustomListView	See also

Creates the window used by the list view.

procedure CreateWnd; override;

Description

CreateWnd creates the list view’s window, based on the parameter values provided by the CreateParams method. CreateWnd then sends messages to the newly created window so that it reflects the current property settings of the list view object.


TCustomListView.CustomDraw

TCustomListView	See also

Generates an OnCustomDraw or OnAdvancedCustomDraw event.

function CustomDraw(const ARect: TRect; Stage: TCustomDrawStage): Boolean; virtual;

Description

CustomDraw generates an OnCustomDraw or OnAdvancedCustomDraw event (depending on the drawing stage and the existence of the event handler). It returns a value indicating whether the list view should continue with the default drawing behavior (True) or not (False).


TCustomListView.CustomDrawItem

TCustomListView	See also

Generates an OnCustomDrawItem or OnAdvancedCustomDrawItem event.

function CustomDrawItem(Item: TListItem; State: TCustomDrawState; Stage: TCustomDrawStage): Boolean; virtual;

Description

CustomDraw generates an OnCustomDrawItem or OnAdvancedCustomDrawItem event (depending on the drawing stage and the existence of the event handler) It returns a value indicating whether the list view should continue by drawing the text of the item (True) or not (False).


TCustomListView.CustomDrawSubItem

TCustomListView	See also

Generates an OnCustomDrawSubItem or OnAdvancedCustomDrawSubItem event.

function CustomDrawSubItem(Item: TListItem; SubItem: Integer; State: TCustomDrawState; Stage: TCustomDrawStage): Boolean; virtual;

Description

CustomDrawSubItem generates an OnCustomDrawSubItem  or OnAdvancedCustomDrawSubItem event, depending on the current painting stage and the existence of an event handler. It returns a value indicating whether the list view should continue by drawing the text of the subitem (True) or not (False).


TCustomListView.CustomSort

TCustomListView	See also 	Example

Sorts the items in the list using the specified ordering function.

type TLVCompare = function(lParam1, lParam2, lParamSort: Integer): Integer stdcall;

function CustomSort(SortProc: TLVCompare; lParam: Longint): Boolean;

Description

Call CustomSort to sort the items in the list using the ordering function defined by the SortProc parameter. The SortProc parameter specifies an ordering function that compares the list items passed as lParam1 and lParam2. The ordering function returns an integer that indicates whether lParam1 is the same as lParam2 (return value is 0), lParam1 is greater than lParam2 (return value is greater than 0), or lParam1 is less than lParam2 (return value is less than 0). The lParam parameter of CustomSort is an optional value that is passed as the third parameter to the ordering function.

If the SortProc parameter is nil, CustomSort compares the list items by generating an OnCompare event. This allows the OnCompare event handler to provide different ordering criteria (such as ascending vs. descending order), based on the value of the lParam parameter.

If the ordering function is not provided and there is no OnCompare event handler, CustomSort sorts items alphabetically by their Caption values.

CustomSort returns True if the list is successfully sorted.


TCustomListView.Delete

TCustomListView	See also

Removes an item from the list view and frees the associated memory.

procedure Delete(Item: TListItem); dynamic;

Description

Call Delete to remove an item from the list view. Delete generates an OnDeletion event before freeing the list item.


TCustomListView.Destroy

TCustomListView	See also

Destroys an instance of TCustomListView.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead, call Free, which checks that the list item is not nil before calling Destroy


TCustomListView.DestroyWnd

TCustomListView	See also

Destroys the window referenced by the list view’s window handle.

procedure DestroyWnd; override;

Description

Before the window is destroyed, DestroyWnd saves a copy of the list view in internal storage. The inherited method then frees any device contexts, and destroys the window.


TCustomListView.DoEndDrag

TCustomListView	See also

Generates an OnEndDrag event.

procedure DoEndDrag(Target: TObject; X, Y: Integer); override;

Description

After generating an OnEndDrag event, DoEndDrag clears the internal variables used to track which item is the drop target.


TCustomListView.DoInfoTip

TCustomListView	See also

Generates an OnInfoTip event.

procedure DoInfoTip(Item: TListItem; var InfoTip: string); virtual;

Description

DoInfoTip is called automatically when the mouse pauses over the list item specified by the Item parameter. It generates an OnInfoTip event, allowing the event handler to change the value of the InfoTip parameter.


TCustomListView.DoStartDrag

TCustomListView	See also

Generates an OnStartDrag event and begins tracking the drop target.

procedure DoStartDrag(var DragObject: TDragObject); override;

Description

DoStartDrag is called automatically when the user starts dragging a list item with the mouse. After generating an OnStartDrag event, DoStartDrag generates a drag image and begins calculating drop target positions.


TCustomListView.DrawItem

TCustomListView	See also

Paints a list view item.

type TOwnerDrawState = set of (odSelected, odGrayed, odDisabled, odChecked, odFocused);

procedure DrawItem(Item: TListItem; Rect: TRect; State: TOwnerDrawState); virtual;

Description

Override DrawItem in a derived class to specify the painting process for items in the list view control.

To allow the default painting to occur, use CustomDrawItem instead.


TCustomListView.Edit

TCustomListView	See also

Sets the Caption property of a list item after the user has edited it.

procedure Edit(const Item: TLVItem); dynamic;

Description

Edit is called automatically when the user finishes editing the label of a list item. Edit obtains the newly edited value from the Windows list item and generates an OnEdited event. After allowing the OnEdited event handler to change the value supplied by the user, Edit sets the Caption property of the list item.


TCustomListView.FindCaption

TCustomListView	See also

Returns a list view item, if any, with the specified caption.

function FindCaption(StartIndex: Integer; Value: string; Partial, Inclusive, Wrap: Boolean): TListItem;

Description

Call FindCaption to search for a list view item labeled by the string specified as the Value parameter. If the Inclusive parameter is True, the list item specified by StartIndex is the first item checked. Otherwise, the search starts on the next item. If the Wrap parameter is True, the search continues at the top of the list if a match has not been found before reaching the bottom. FindCaption returns the first item with the Caption property equal to Value. If the Partial parameter is True, a Caption matches if it starts with the substring Value. If Partial is False, the Caption must match Value exactly. If no item is found, FindCaption returns nil.


TCustomListView.FindData

TCustomListView	See also

Returns a list view item, if any, associated with the specified data.

function FindData(StartIndex: Integer; Value: Pointer; Inclusive, Wrap: Boolean): TListItem;

Description

Call FindData to locate a list view item with its Data property equal to the Value parameter. If the Inclusive parameter is True, the list item specified by StartIndex is the first item checked. Otherwise, the search starts on the next item. If the Wrap parameter is True, the search continues at the top of the list if a match has not been found before reaching the bottom. FindData returns the first item with a Data property equal to the Value parameter. If no item is found, FindData returns nil.


TCustomListView.GetDragImages

TCustomListView	See also

Returns a drag cursor if a list item is being dragged.

function GetDragImages: TDragImageList; override;

Description

GetDragImages is called automatically to obtain a list of drag images when the user drags the mouse with the button held down. If the user is dragging a list item, GetDragImages returns the drag image list that is created when the user starts dragging a list item. If the user did not start dragging the mouse over a list item, GetDragImages returns nil.


TCustomListView.GetHitTestInfoAt

TCustomListView	See also

Returns information about the specified point in the list view’s client area.

function GetHitTestInfoAt(X, Y: Integer): THitTests;

Description

Use GetHitTestInfoAt to determine what elements of the list view lie under the point specified by the X and Y parameters.

X is the x-coordinate of the point.

Y is the y-coordinate of the point.


TCustomListView.GetItemAt

TCustomListView	See also

Returns the list item at the specified position.

function GetItemAt(X, Y: Integer): TListItem;

Description

Call GetItemAt to obtain the TListItem object for the list item found at the position specified by the X and Y parameters. X and Y specify the coordinates of the position, in pixels, relative to the top left corner of the list view. If there is no item at the location, GetItemAt returns nil.


TCustomListView.GetItemIndex

TCustomListView	See also

Returns the index of the specified item in the Items property array.

function GetItemIndex(Value: TListItem): Integer;

Description

Call GetItemIndex to determine the position of a list item, where 0 is the index of the first item, 1 is the index of the second item, and so on. If the item specified by the Value property is not in the list view, GetItemIndex returns -1.


TCustomListView.GetNearestItem

TCustomListView	See also

Returns the list item nearest a specified point, in a particular direction.

function GetNearestItem(Point: TPoint; Direction: TSearchDirection): TListItem;

Description

Call GetNearestItem to locate a list item from a position specified in pixel coordinates relative to the top left corner of the list view. GetNearestItem starts looking at the position specified by the Point parameter, and moves in the direction indicated by the Direction parameter until it locates a list item.

If no item is found, GetNearestItem returns nil.


TCustomListView.GetNextItem

TCustomListView 	See also

Returns the next list item after the StartItem in the specified direction.

function GetNextItem(StartItem: TListItem; Direction: TSearchDirection; States: TItemStates): TListItem;

Description

Call GetNextItem to find the next list item after StartItem in the direction given by the Direction parameter. Only items in the state indicated by the States parameter are considered.


TCustomListView.GetSearchString

TCustomListView	See also

Returns the incremental search string of a list view control.

function GetSearchString: string;

Description

Call GetSearchString to obtain the character sequence typed by the user while the list view has input focus. Each time the user types a character, the list view appends the character to the search string and searches for a matching item. A timeout period of less than a second is associated with each character that the user types. If the timeout period elapses before the user types another character, the incremental search string is reset. If the system finds a match, it selects the item and, if necessary, scrolls it into view.


TCustomListView.InsertItem

TCustomListView	See also

Generates an OnInsert event.

procedure InsertItem(Item: TListItem); dynamic;

Description

List view objects call InsertItem internally when new items are added to the Items property list. Override the InsertItem method to cause descendant classes to take specific action in addition to this event when new items are inserted, or to block the OnInsert event from occurring.


TCustomListView.IsCustomDrawn

TCustomListView	See also

Determines when custom draw events are generated.

function IsCustomDrawn(Target: TCustomDrawTarget; Stage: TCustomDrawStage): Boolean;

Description

TCustomListView checks IsCustomDrawn to determine when to generate the OnCustomDraw, OnAdvancedCustomDraw, OnCustomDrawItem, OnAdvancedCustomDrawItem, OnCustomDrawSubItem, and OnAdvancedCustomDrawSubItem events. IsCustomDrawn returns True when the list view should generate an event.

The Target parameter indicates whether the list view is about to draw the entire control, an item, or a subitem. IsCustomDrawn does not return True unless the list view has an appropriate event handler for the target.

The Stage parameter indicates the current stage in the process of painting the list view. IsCustomDrawn returns True if the stage is cdPrePaint or if there is an Advanced custom draw event handler for the Target.


TCustomListView.IsEditing

TCustomListView	See also

Indicates whether any item in the list view is being edited.

function IsEditing: Boolean;

Description

Call IsEditing to determine whether the user is editing the caption of any of the items in the list.  IsEditing returns True if the user is editing an item, False otherwise.


TCustomListView.MouseUp

TCustomListView	See also

Generates an OnMouseUp event.

procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;

Description

TCustomListView overrides the protected MouseUp method to suppress the OnMouseUp event when a click is not on a list item.

MouseUp is called internally in response to any of the Windows mouse-up messages (WM_LBUTTONUP, WM_MBUTTONUP, WM_RBUTTONUP), decoding the message parameters into the shift-key state and position, which it passes in the Shift, X, and Y parameters, respectively. The value of the Button parameter depends on which of the Windows messages triggered the event.


TCustomListView.Notification

TCustomListView	See also

Responds to notifications that components are about to be created or destroyed.

procedure Notification(AComponent: TComponent; Operation: TOperation); override;

Description

After calling the inherited method, Notification checks whether the image list specified by the LargeImages, SmallImages, or StateImages property is about to be destroyed. If so, Notification sets the appropriate property to nil.


TCustomListView.OwnerDataFetch

TCustomListView	See also

Customizes a list view item before it is displayed.

type

  TItemRequests = (irText, irImage, irParam, irState, irIndent);

  TItemRequest = set of TItemRequests;

function OwnerDataFetch(Item: TListItem; Request: TItemRequest): Boolean; virtual;

Description

OwnerDataFetch initializes an item before it is drawn in a list view control. The Item parameter specifies the item that is about to be drawn. The Request parameter indicates the type of information that should be initialized. OwnerDataFetch returns True if the specified item should be displayed, and False if the item should not be drawn.

As implemented in TCustomListView, OwnerDataFetch generates an OnData event, passing the Item parameter to the event handler and ignoring the Request parameter.

OwnerDataFetch is called only if OwnerData is True.


TCustomListView.OwnerDataFind

TCustomListView	See also

Searches for an item in the list view control.

function OwnerDataFind(Find: TItemFind; const FindString: string; const FindPosition: TPoint; FindData: Pointer; StartIndex: Integer; Direction: TSearchDirection; Wrap: Boolean): Integer; virtual;

Description

Override OwnerDataFind in a derived class to implement the searching capabilities of a virtual list view control (that is, when OwnerData is True).

OwnerDataFind is called when the virtual list view must find an item; for example, OwnerDataFind is called when a user attempts an incremental search.

Find specifies the type of search to perform (any of ifData, ifPartialString, ifExactString, ifNearest).

FindString specifies the item text to search for. FindString is ignored unless Find contains ifPartialString or ifExactString.

FindPosition specifies the point from which to start the search. FindPosition is ignored unless Find contains ifNearest

FindData specifies the item data to search for. FindData is ignored unless Find contains ifData.

StartIndex specifies the index of the item from which the search should start.

Direction specifies the direction for the search (sdLeft, sdRight, sdAbove, sdBelow, or sdAll).

Wrap specifies whether the search should continue from the start of the list view control if no match is found.

OwnerDataFind should return the index of the found item. If no item is found, OwnerDataFind should return –1.


TCustomListView.OwnerDataHint

TCustomListView	See also

Specifies a range of items that might be fetched.

function OwnerDataHint(StartIndex, EndIndex: Integer): Boolean; virtual;

Description

Override OwnerDataHint in a derived class to customize a range of items before OwnerDataFetch is called on them.

This method of customizing items is more efficient than individually updating items in the OwnerDataFetch method. However, the range of items does not always match what is handled by the OwnerDataFetch method; therefore, you must be prepared to update individual items in the OwnerDataFetch method as well.

StartIndex is the index of the first item that might be fetched.

EndIndex is the index of the last item that might be fetched.

OwnerDataHint is called only if OwnerData is True.


TCustomListView.OwnerDataStateChange

TCustomListView	See also

Specifies items that have changed states.

function OwnerDataStateChange(StartIndex, EndIndex: Integer; OldState, NewState: TItemStates): Boolean; virtual;

Description

Override OwnerDataStateChange in a derived class to update items in a virtual list view control with their new states.

StartIndex is the index of the first item that has changed.

EndIndex is the index of the last item that has changed.

OldState is the old state of the items.

NewState is the new state of the items.

OwnerDataStateChange is called only if OwnerDataFetch is True.


TCustomListView.Scroll

TCustomListView	See also

Scrolls the content of a list view by the indicated amount.

procedure Scroll(DX, DY: Integer);

Description

Call Scroll to scroll the content of a list view by DX pixels horizontally and DY pixels vertically.


TCustomListView.StringWidth

TCustomListView	See also

Returns the width of a string, using the list view’s current font.

function StringWidth(S: string): Integer;

Description

Call StringWidth to determine the space, in pixels, required to display a string using the list view’s current font.


TCustomListView.UpdateColumn

TCustomListView	See also

Updates the image of the column indicated by Index.

procedure UpdateColumn(AnIndex: Integer);

Description

UpdateColumn is called automatically when the display properties of a column in the list view change. UpdateColumn adjusts the image of the column to match the properties of the TListColumn object indexed by the AnIndex parameter in the Columns property.

UpdateColumn does nothing if ColumnsShowing returns False.


TCustomListView.UpdateColumns

TCustomListView	See also

Causes the list view control to update the image of all columns.

procedure UpdateColumns;

Description

UpdateColumns is called automatically when the properties of several columns in the list view change. UpdateColumn adjusts the image of every column to match the properties of the corresponding TListColumn object listed in the Columns property.

UpdateColumns does nothing if ColumnShowing returns False.


TCustomListView.UpdateItems

TCustomListView	See also

Redraws a range of items, starting at FirstIndex and ending at LastIndex.

procedure UpdateItems(FirstIndex, LastIndex: Integer);

Description

Call UpdateItems after making changes that affect the display image of the list items in the specified range.


TCustomListView.WndProc

TCustomListView	See also

Provides specific message responses for the list view.

procedure WndProc(var Message: TMessage); override;

Description

WndProc overrides the inherited method to prevent the list view from redrawing while the items are being updated.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomMaskEdit

Hierarchy	Properties	Methods	See also

TCustomMaskEdit is the base type for edit controls that provide a mask for checking the validity of text typed into the control.

Unit

mask

Description

TCustomMaskEdit introduces new properties and methods to expand the capabilities of TCustomEdit for validity checking using an edit mask. To create an edit control that takes advantage of the masking capabilities of TCustomMaskEdit, use a TMaskEdit object. To create an edit control that does not validate the input, use the TEdit object instead.

Do not create instances of TCustomMaskEdit. Use TCustomMaskEdit as a base class when declaring control objects that implement a masked edit control. Properties and methods of TCustomMaskEdit provide basic behavior that descendant classes inherit as well as behavior that components can override to customize their behavior.


TCustomMaskEdit properties

TCustomMaskEdit	Alphabetically	Legend

In TCustomMaskEdit

EditMask

EditText

IsMasked

MaskState

MaxLength

Text

Derived from TCustomEdit

CanUndo

Modified

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomMaskEdit properties

TCustomMaskEdit	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

CanUndo

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

EditMask

EditText

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

IsMasked

Left

LRDockWidth

MaskState

MaxLength

Modified

Name

Owner

Parent

ParentWindow

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Text

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TCustomMaskEdit.EditMask

TCustomMaskEdit	See also	Example

Specifies the mask that represents what text is valid for the masked edit control.

property EditMask: string;

Description

Use EditMask to restrict the characters a user can enter into the masked edit control to valid characters and formats. If the user attempts to enter an invalid character, the edit control does not accept the character. Validation is performed on a character-by-character basis by the ValidateEdit method.

A mask consists of three fields with semicolons separating the fields. The first part of the mask is the mask itself. The second part is the character that determines whether the literal characters of a mask are saved as part of the data. The third part of the mask is the character used to represent unentered characters in the mask.

These are the special characters used in the first field of the mask:

Character	Meaning in mask

 !	If a ! character appears in the mask, optional characters are represented in the EditText as leading blanks. If a ! character is not present, optional characters are represented in the EditText as trailing blanks.

 >	If a > character appears in the mask, all characters that follow are in uppercase until the end of the mask or until a < character is encountered.

 <	If a < character appears in the mask, all characters that follow are in lowercase until the end of the mask or until a > character is encountered.

 <>	If these two characters appear together in a mask, no case checking is done and the data is formatted with the case the user uses to enter the data.

\	The character that follows a \ character is a literal character. Use this character to use any of the mask special characters as a literal in the data.

 L	The L character requires an alphabetic character only in this position. For the US, this is A-Z, a-z.

 l	The l character permits only an alphabetic character in this position, but doesn't require it.

A	The A character requires an alphanumeric character only in this position. For the US, this is A-Z, a-z, 0-9.

 a	The a character permits an alphanumeric character in this position, but doesn't require it.

C	The C character requires an arbitrary character in this position.

 c	The c character permits an arbitrary character in this position, but doesn't require it.

 0	The 0 character requires a numeric character only in this position.

 9	The 9 character permits a numeric character in this position, but doesn't require it.

#	The # character permits a numeric character or a plus or minus sign in this position, but doesn't require it.

:	The : character is used to separate hours, minutes, and seconds in times. If the character that separates hours, minutes, and seconds is different in the regional settings of the Control Panel utility on your computer system, that character is used instead.

 /	The / character is used to separate months, days, and years in dates. If the character that separates months, days, and years is different in the regional settings of the Control Panel utility on your computer system, that character is used instead.

 ;	The ; character is used to separate the three fields of the mask.

 _	The _ character automatically inserts spaces into the text. When the user enters characters in the field, the cursor skips the _ character.

Any character that does not appear in the preceding table can appear in the first part of the mask as a literal character. Literal characters must be matched exactly in the edit control. They are inserted automatically, and the cursor skips over them during editing. The special mask characters can also appear as literal characters if preceded by a backslash character (\).

The second field of the mask is a single character that indicates whether literal characters from the mask should be included as part of the text for the edit control. For example, the mask for a telephone number with area code could be the following string:

(000)_000-0000;0;*

The 0 in the second field indicates that the Text property for the edit control would consist of the 10 digits that were entered, rather than the 14 characters that make up the telephone number as it appears in the edit control.

A 0 in the second field indicates that literals should not be included, any other character indicates that they should be included. The character to indicate whether literals should be included can be changed in the EditMask property editor, or programmatically by changing the MaskNoSave typed constant.

The third field of the mask is the character that appears in the edit control for blanks (characters that have not been entered). By default, this is the same as the character that stands for literal spaces. The two characters appear the same in an edit window. However, when a user edits the text in a masked edit control, the cursor selects each blank character in turn, and skips over the space character.

Setting EditMask to an empty string removes the mask.

Note:	When working with multibyte character sets, such as Japanese shift-JIS, each special mask character represents a single byte. To specify double-byte characters using the L, l, A, a, C, or c specifiers, the mask characters must be doubled as well. For example, LL would represent two single-byte alphabetic characters or a one double-byte character. Only single-byte literal characters are supported.


TCustomMaskEdit.EditText

TCustomMaskEdit	See also

Specifies the text that appears in the window of the masked edit control.

property EditText: string;

Description

EditText is the value of the text for the edit control after it is formatted using the EditMask. Before the text is fully entered into a masked edit control, the EditText includes a blank character for each unentered character. As characters are entered, the blank characters in the EditText are replaced by the values that the user types.

If literal mask characters are included in the text, and no character is substituted for blanks, the values of EditText and Text are the same.

Note:	EditText only applies at runtime.


TCustomMaskEdit.IsMasked

TCustomMaskEdit	See also 	Example

Indicates whether a mask exists for the edit control.

property IsMasked: Boolean;

Description

Read IsMasked to determine whether the EditMask property has been set. If IsMasked is True, the control has a mask, and input is validated at runtime. If IsMasked is False, the control does not restrict editing at runtime.


TCustomMaskEdit.MaskState

TCustomMaskEdit	See also

Indicates state information about how the mask is being applied.

type TMaskedState = set of (msMasked, msReEnter, msDBSetText);

property MaskState: TMaskedState;

Description

MaskState is used internally to determine appropriate actions based on how the mask is currently being applied. MaskState is a set drawn from among the following values:

Value	Meaning

msMasked	A mask has been assigned. MaskState includes msMasked when IsMasked is True.

msReEnter	An invalid character has been rejected and the next edit should be a valid replacement character.

msDBSetText	The text comes from a database field and should not be validated.

MaskState is exposed as a protected property so that derived classes can maintain and use this state information in the implementation of properties and methods.


TCustomMaskEdit.MaxLength

TCustomMaskEdit	See also

Specifies the maximum number of characters that can appear in the edit control.

property MaxLength: Integer;

Description

MaxLength is the length of the EditText. Set MaxLength to limit the number of characters that can appear in the edit control when there is no EditMask. If there is an EditMask, MaxLength is implied by the mask itself, and cannot be changed. The EditText contains blank characters for each character that has not been entered, padding the end or beginning of every optional section, so it remains constant in length.


TCustomMaskEdit.Text

TCustomMaskEdit	See also

Denotes the underlying text for the masked edit control before the mask has been applied.

property Text: string;

Description

Use Text to determine the underlying value of the text before it has been formatted by the mask. Text may differ from the EditText visible in the masked edit control if the mask specifies that literal characters should be removed, if the mask includes spaces, or if the mask includes characters that have not yet been filled in by the user. Text will not contain the blank characters, spaces will not be replaced by _, and literal characters in the mask will be removed if the mask indicates they should be.

When setting Text, the value of the text is formatted using the mask, and the resulting EditText is used to update the window.

If there is no mask, Text is the text that appears in the edit control.


TCustomMaskEdit methods

TCustomMaskEdit	Alphabetically	Legend

In TCustomMaskEdit

CheckCursor

Clear

Create

EditCanModify

GetFirstEditChar

GetLastEditChar

GetMaxChars

GetNextEditChar

GetPriorEditChar

GetSel

GetTextLen

KeyDown

KeyPress

KeyUp

ReformatText

Reset

SetCursor

SetSel

ValidateEdit

ValidateError

Derived from TCustomEdit

ClearSelection

ClearUndo

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Undo

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomMaskEdit methods

TCustomMaskEdit	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

CheckCursor

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClearSelection

ClearUndo

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

Create

CreateParented

CreateParentedControl

CutToClipboard

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EditCanModify

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetFirstEditChar

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetLastEditChar

GetMaxChars

GetNamePath

GetNextEditChar

GetParentComponent

GetPriorEditChar

GetSel

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

KeyDown

KeyPress

KeyUp

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

PasteFromClipboard

Perform

Realign

ReformatText

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

Reset

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetCursor

SetFocus

SetSel

SetSelTextBuf

SetTextBuf

Show

Undo

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

ValidateEdit

ValidateError


TCustomMaskEdit.CheckCursor

TCustomMaskEdit	See also

Moves the cursor to the closest editable character and selects it if nothing is currently selected.

procedure CheckCursor;

Description

CheckCursor is called whenever the position of the cursor may have changed. It ensures that at least one character is always selected. Because editing a masked edit control consists of replacing the blank characters in the mask, there must always be a selection to replace. The selection corresponds to one or more nonliteral characters in the mask, which are either blank or contain characters for the user to re-enter.


TCustomMaskEdit.Clear

TCustomMaskEdit	See also

Sets the Text property to an empty string.

procedure Clear; override;

Description

Use Clear to remove all text that was entered into the masked edit control. Clear sets the value of Text to an empty string. It does not clear the EditMask. If the edit control has a mask, EditText is not empty, but has all non-literal characters replaced by blanks.


TCustomMaskEdit.Create

TCustomMaskEdit	See also

Creates an instance of TCustomMaskEdit.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a masked edit control. Create initializes the MaskState and blank substitution character after calling the inherited constructor.


TCustomMaskEdit.EditCanModify

TCustomMaskEdit	See also

Permits the user to edit the Text.

function EditCanModify: Boolean; virtual;

Description

The EditCanModify method defined by TCustomMaskEdit always returns True, allowing the Text to be edited. EditCanModify exists primarily to provide an interface for a method that can conditionally disallow changes to the Text by returning False.


TCustomMaskEdit.GetFirstEditChar

TCustomMaskEdit	See also

Returns the index in the EditMask of the first nonliteral character.

function GetFirstEditChar: Integer;

Description

Use GetFirstEditChar to find the first position of the EditMask where the user can modify the EditText. 0 specifies the first character, 1 the second character, and so on. If there is no mask, GetFirstEditChar returns zero.

Use GetFirstEditChar as a starting point for programmatically processing all the nonliteral characters in the EditText. Use GetNextEditChar to continue to loop through the editable characters in the EditText, and GetLastEditChar to determine when all nonliteral characters have been processed.


TCustomMaskEdit.GetLastEditChar

TCustomMaskEdit	See also

Returns the index in the EditMask of the last nonliteral character.

function GetLastEditChar: Integer;

Description

Use GetLastEditChar to find the last position of the EditMask where the user can modify the EditText. 0 specifies the first character, 1 the second character, and so on. If there is no mask, GetLastEditChar returns the length of the text.


TCustomMaskEdit.GetMaxChars

TCustomMaskEdit	See also

Returns the length of the EditText.

function GetMaxChars: Integer;

Description

If there is a mask, GetMaxChars returns the length of the EditText, including all blanks. This is the same as MaxLength, because editing in a masked edit control consists of replacing nonliteral characters. If there is no mask, GetMaxChars returns the length of the text in the window. In this case, the value returned by GetMaxChars may be less than MaxLength, which is the maximum number of characters that can be entered into the edit control.


TCustomMaskEdit.GetNextEditChar

TCustomMaskEdit	See also

Returns the first index of a nonliteral character equal to or greater than an offset.

function GetNextEditChar(Offset: Integer): Integer;

Description

Call GetNextEditChar to find the first position of the EditMask at or following Offset where the user can modify the EditText. 0 specifies the first character, 1 the second character, and so on. If there is no nonliteral character at or following Offset, GetNextEditChar returns MaxLength.

Use GetNextEditChar to loop through the editable characters in the EditText, starting with the value returned by GetFirstEditChar and using GetLastEditChar to determine when all nonliteral characters have been processed.


TCustomMaskEdit.GetPriorEditChar

TCustomMaskEdit	See also

Returns the first index of a nonliteral character equal to or less than an offset.

function GetPriorEditChar(Offset: Integer): Integer;

Description

Call GetPriorEditChar to find the first position of the EditMask at or preceding Offset, where the user can modify the EditText. 0 specifies the first character, 1 the second character, and so on. If there is no nonliteral character at or preceding Offset, GetPriorEditChar returns the index of the first editable character following Offset.


TCustomMaskEdit.GetSel

TCustomMaskEdit	See also

Returns the endpoints of the current selection in the EditText.

procedure GetSel(var SelStart: Integer; var SelStop: Integer);

Description

Use GetSel to obtain the indexes of the first and last selected characters of the EditText, where 0 is the index of the first character. Not all the characters in the selection will necessarily be editable, if the mask contains literal characters. Do not use the resulting indexes on the Text property if there is a mask, because the EditText may contain blanks or nonliteral characters not found in the Text.

To programmatically change the selected text, use GetNextEditChar to cycle through the editable characters of the selection from SelStart to SelStop.


TCustomMaskEdit.GetTextLen

TCustomMaskEdit	See also

Returns the length of the underlying text.

function GetTextLen: Integer;

Description

Use GetTextLen to determine the length of the underlying text for the masked edit control. The underlying text has not been formatted for display by the mask, and may differ from the EditText that appears in the window of the control.


TCustomMaskEdit.KeyDown

TCustomMaskEdit	See also

Supplements the inherited KeyDown to process navigation keys and the Delete key.

procedure KeyDown(var Key: Word; Shift: TShiftState); override;

Description

After calling the inherited KeyDown, KeyDown ensures that moving the cursor within the masked edit control places the cursor on an editable character, and that deleting the current selection replaces nonliteral characters with blanks. Derived objects can override this method to further supplement the processing that takes place when the user presses a key down.


TCustomMaskEdit.KeyPress

TCustomMaskEdit	See also

Supplements the inherited method to process the Esc and Enter keys.

procedure KeyPress(var Key: Char); override;

Description

After calling the inherited method, KeyPress calls the Reset method in response to the Esc key, or calls the ValidateEdit method in response to the Enter key. Derived classes can override this method to further supplement the processing of specific keystrokes.


TCustomMaskEdit.KeyUp

TCustomMaskEdit	See also

Supplements the inherited method to process the Ctrl+Left and Ctrl+Right key combinations.

procedure KeyUp(var Key: Word; Shift: TShiftState); override;

Description

After calling the inherited method, KeyUp makes sure that selection using the Ctrl+Left and Ctrl+Right key combinations ends with an editable selection in the edit window. Derived classes can override this method to further supplement the processing that takes place when the user releases a key.


TCustomMaskEdit.ReformatText

TCustomMaskEdit	See also

Applies the mask NewMask to the underlying text, and updates the internal representation of the mask.

procedure ReformatText(const NewMask: string);

Description

ReformatText does the bulk of the work of setting the EditMask property at runtime. ReformatText should not be used in place of the EditMask property, however, as it does not deal with the MaskState property or the positioning of the cursor.


TCustomMaskEdit.Reset

TCustomMaskEdit	See also

Returns the EditText to its value at the time when the edit control last lost focus.

procedure Reset; virtual;

Description

Reset cancels the most recent edits to the masked edit control. The EditText returns to the value at the time the control last lost focus, not the time when it first regained focus. Thus, any changes to the EditText that occurred programmatically while the edit control did not have focus will also be discarded.


TCustomMaskEdit.SetCursor

TCustomMaskEdit	See also

Moves the cursor to the first editable character at or before Pos, and selects that character.

procedure SetCursor(Pos: Integer);

Description

SetCursor handles positioning of the cursor within the EditText so that it is always on an editable character. It also ensures that at least one character is always selected. Because editing a masked edit control consists of replacing the blank characters in the mask, there must always be a selection to replace. The selection corresponds to one or more nonliteral characters in the mask, which are either blank or contain characters for the user to re-enter.


TCustomMaskEdit.SetSel

TCustomMaskEdit	See also

Selects characters in the EditText from SelStart to SelStop.

procedure SetSel(SelStart: Integer; SelStop: Integer);

Description

SetSel selects the indicated range of characters in the EditText, regardless of whether any of them are editable. If SelStart is the same as SelStop, SetSel positions the cursor at the SelStart character. When using SetSel, leave the cursor in an editable position if the intent is to create a selection for the user to replace.

SetSel can be used to select non-editable characters that can then be captured by using the SelText property or by copying to the Clipboard. Once the selection has been captured, return the cursor to an editable position by calling CheckCursor.


TCustomMaskEdit.ValidateEdit

TCustomMaskEdit	See also

Validates the EditText against the current mask.

procedure ValidateEdit; virtual;

Description

ValidateEdit attempts to validate the EditText after each keystroke, and when the user attempts to leave the masked edit field. If the EditText does not match the specifications of the EditMask, ValidateEdit calls ValidateError to raise an exception, and returns the cursor to the first position where the EditText did not comply with the EditMask.


TCustomMaskEdit.ValidateError

TCustomMaskEdit	See also

Beeps and raises an EDBEditError exception.

procedure ValidateError; virtual;

Description

ValidateEdit calls ValidateError when the EditText fails to comply with the EditMask.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit


TCustomMemo

Hierarchy	Properties	Methods	See also

TCustomMemo is the abstract base type for memo components, which are multiline edit boxes, including TMemo and TDBMemo.

Unit

stdctrls

Description

TCustomMemo introduces new properties and methods to expand the capabilities of TCustomEdit for handling multiline edit boxes.

Do not create instances of TCustomMemo. Use TCustomMemo as a base class when declaring control objects that implement a multiline edit control. Properties and methods of TCustomMemo provide basic behavior that descendant classes inherit as well as behavior that components can override to customize their behavior.


TCustomMemo properties

TCustomMemo	Alphabetically	Legend

In TCustomMemo

Alignment

CaretPos

Lines

ScrollBars

WantReturns

WantTabs

WordWrap

Derived from TCustomEdit

CanUndo

Modified

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Text

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomMemo properties

TCustomMemo	By object	Legend

Action

Align

Alignment

Anchors

BiDiMode

BoundsRect

Brush

CanUndo

CaretPos

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

Left

Lines

LRDockWidth

Modified

Name

Owner

Parent

ParentWindow

ScrollBars

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Text

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

WantReturns

WantTabs

Width

WindowProc

WordWrap


TCustomMemo.Alignment

TCustomMemo	See also

Determines how the text is aligned within the memo control.

property Alignment: TAlignment;

Description

Use Alignment to change the way the text is formatted by the memo control. Alignment can take one of the following values:

Value	Meaning

taLeftJustify	Align text to the left side of the control

taCenter	Center text horizontally in the control.

taRightJustify	Align text to the right side of the control.


TCustomMemo.CaretPos

TCustomMemo	See also

Indicates the position of the caret in the client area of the memo.

property CaretPos: TPoint;

Description

Use CaretPos to determine the coordinates of the cursor. CaretPos indicates the X and Y position (in terms of lines and characters) relative to the client origin of the memo.

To determine the position of the caret in terms of characters of text only (rather than X/Y location), use the SelStart property.


TCustomMemo.Lines

TCustomMemo	See also 	Example

Contains the individual lines of text in the memo control.

property Lines: TStrings;

Description

Use Lines to manipulate text in an memo control on a line-by-line basis. Lines is a TStrings object, so the TStrings methods may be used for Lines to perform manipulations such as counting the lines of text, adding new lines, deleting lines, or replacing lines with new text.

To work with all the text at once, use the Text property. To manipulate individual lines of text, the Lines property works better.


TCustomMemo.ScrollBars

TCustomMemo	See also	Example

Determines whether the memo control has any scroll bars.

type TScrollStyle = (ssNone, ssHorizontal, ssVertical, ssBoth);

property ScrollBars: TScrollStyle;

Description

Use ScrollBars to give a multiline edit control horizontal or vertical scroll bars. ScrollBars can take one of the following values:

Value	Meaning

ssNone	The control has no scroll bars.

ssHorizontal	The control has a single scroll bar on the bottom edge.

ssVertical	The control has a single scroll bar on the right edge.

ssBoth	The control has a scroll bar on both the bottom and right edges.


TCustomMemo.WantReturns

TCustomMemo	See also

Determines whether the user can insert return characters into the text.

property WantReturns: Boolean;

Description

Set WantReturns to True to allow users to enter return characters into the text. Set WantReturns to False to allow the form to handle return characters instead.

For example, in a form with a default button (such as an OK button) and a memo control, if WantReturns is False, pressing Enter chooses the default button. If WantReturns is True, pressing Enter inserts a return character in the text.

Note:	If WantReturns is False, users can still enter return characters into the text by pressing Ctrl+Enter.


TCustomMemo.WantTabs

TCustomMemo	See also

Determines whether the user can insert tab characters into the text.

property WantTabs: Boolean;

Description

Set WantTabs to True to allow users to enter tab characters into the text. Set WantTabs to False if you want the tab character to select the next control on the form instead.

Note:	If WantTabs is True, users can tab into the edit control, but they can’t tab out.


TCustomMemo.WordWrap

TCustomMemo	See also

Determines whether the edit control inserts soft carriage returns so text wraps at the right margin.

property WordWrap: Boolean;

Description

Set WordWrap to True to make the edit control wrap text at the right margin so it fits in the client area. The wrapping is cosmetic only--the text does not include any return characters that were not explicitly entered. Set WordWrap to False to have the edit control show a separate line only where return characters were explicitly entered into the text.

Note:	There should be no use for a horizontal scroll bar if WordWrap is True.


TCustomMemo methods

TCustomMemo	Alphabetically	Legend

In TCustomMemo

Create

CreateParams

CreateWindowHandle

Destroy

GetCaretPos

GetControlsAlignment

KeyPress

Loaded

SetAlignment

SetLines

SetScrollBars

SetWordWrap

Derived from TCustomEdit

Clear

ClearSelection

ClearUndo

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Undo

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomMemo methods

TCustomMemo	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClearSelection

ClearUndo

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

Create

CreateParams

CreateParented

CreateParentedControl

CreateWindowHandle

CutToClipboard

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetCaretPos

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

KeyPress

Loaded

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetAlignment

SetBounds

SetFocus

SetLines

SetScrollBars

SetSelTextBuf

SetTextBuf

SetWordWrap

Show

Undo

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TCustomMemo.Create

TCustomMemo	See also

Creates and initializes an instance of TCustomMemo.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TCustomMemo object. After calling the inherited constructor, Create adjusts some of the properties so that the control starts with the following values:

•	AutoSelect is True.

•	AutoSize is False.

•	BorderStyle is bsSingle.

•	ControlStyle is [csClickEvents, csDoubleClicks, csFixedHeight, csSetCaption]

•	Height and Width are 89 and 188.

•	HideSelection is True.

•	ParentColor is False.

•	TabStop is True.

•	WantReturns is True.

•	WordWrap is True.

Derived objects that override the Create method should call the inherited Create before making any additional initializations.


TCustomMemo.CreateParams

TCustomMemo	See also

Initializes a window-creation parameter record passed in the Params parameter.

procedure CreateParams(var Params: TCreateParams); override;

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle. TCustomEdit overrides the inherited method to specify a scrollable multiline edit control. The Params parameter is updated to reflect the current values of the Alignment, ScrollBars, and WordWrap properties, in addition to the BorderStyle, HideSelection, PasswordChar, and ReadOnly properties that the inherited method specifies.


TCustomMemo.CreateWindowHandle

TCustomMemo	See also

Creates a window based on the window-creation parameter record.

procedure CreateWindowHandle(const Params: TCreateParams); override

Description

The CreateWnd method calls CreateWindowHandle to create the edit control window once it has been specified in the window-creation parameters. CreateWindowHandle creates the window by calling the CreateWindowEx API function, passing parameters from the record passed in the Params parameter. CreateWindowHandle overrides the inherited method to interpret the Caption in Params as the initial text rather than as the window caption.


TCustomMemo.Destroy

TCustomMemo	See also

Destroys an instance of TCustomMemo.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the TCustomMemo reference is not nil, and only then calls Destroy.

Destroy frees the TStrings object that implements the Lines property before calling the inherited destructor.


TCustomMemo.GetCaretPos

TCustomMemo	See also

Returns the value of the CaretPos property.

function GetCaretPos: TPoint; virtual;

Description

GetCaretPos is the protected implementation of the CaretPos property. Override this method to change the way the caret position is computed.


TCustomMemo.GetControlsAlignment

TCustomMemo	See also

Returns the alignment of the memo’s text.

function GetControlsAlignment: TAlignment; override;

Description

GetControlsAlignment indicates the alignment of the memo’s text. It returns the value of the Alignment property.


TCustomMemo.KeyPress

TCustomMemo	See also

Ensures that return characters are not entered into the text when WantReturns is False.

procedure KeyPress(var Key: Char); override;

Description

KeyPress is called automatically when the user presses a key. After calling the inherited KeyPress, which calls the OnKeyPress event handler, KeyPress discards return characters when WantReturns is False.


TCustomMemo.Loaded

TCustomMemo	See also

Initializes the memo control when it is first loaded into memory.

procedure Loaded; override;

Description

Loaded overrides the default so that the Modified property is set to False after loading the control from a stream. Derived classes can override the Loaded method to perform additional initializations after the control is loaded.


TCustomMemo.SetAlignment

TCustomMemo	See also

Sets the Alignment property.

procedure SetAlignment(Value: TAlignment);

Description

SetAlignment is exposed as a protected method so derived classes can customize their implementation of the Alignment property.


TCustomMemo.SetLines

TCustomMemo	See also

Sets the Lines property.

procedure SetLines(Value: TStrings);

Description

SetLines is exposed as a protected method so derived classes can customize their implementation of the Lines property.


TCustomMemo.SetScrollBars

TCustomMemo	See also

Sets the ScrollBars property.

type TScrollStyle = (ssNone, ssHorizontal, ssVertical, ssBoth);

procedure SetScrollBars(Value: TScrollStyle);

Description

SetScrollBars is exposed as a protected method so derived classes can customize their implementation of the ScrollBars property.


TCustomMemo.SetWordWrap

TCustomMemo	See also

Sets the WordWrap property.

procedure SetWordWrap(Value: Boolean);

Description

SetWordWrap is exposed as a protected method so derived classes can customize their implementation of the WordWrap property.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit


TCustomMemoryStream

Hierarchy	Properties	Methods	See also

TCustomMemoryStream is an abstract base class used as the common ancestor for memory streams.

Unit

classes

Description

Use TCustomMemoryStream as a base class when defining a stream object that can transfer data that is stored in memory. Memory streams are useful for providing file-like access to data that is stored in a less accessible medium. Data can be moved to an internal memory buffer when the memory stream is created. After manipulating the data in a memory stream, the data can be written out to its actual storage medium when the memory stream is destroyed.

Do not instantiate an instance of TCustomMemoryStream. It is an abstract class that implements behavior common to all memory streams. To work with an instance of a memory stream, use one of the descendants of TCustomMemoryStream, such as TMemoryStream or TResourceStream.


TCustomMemoryStream properties

TCustomMemoryStream	Alphabetically	Legend

In TCustomMemoryStream

Memory

Derived from TStream

Position

Size


TCustomMemoryStream properties

TCustomMemoryStream	By object	Legend

Memory

Position

Size


TCustomMemoryStream.Memory

TCustomMemoryStream	See also

Provides direct access to the memory pool allocated for the memory stream.

property Memory: Pointer;

Description

Use Memory to get access to the memory for the stream. The memory for the stream holds the data that is being transferred by means of the memory stream. Size is the number of bytes of Memory that were allocated, and Position is the current position within Memory.

Note:	Memory is a read-only property. Memory can be used to change the contents of the memory, but to set the actual memory the stream works with, descendants of TCustomMemoryStream must assign a pointer to a memory buffer by calling the SetPointer method.


TCustomMemoryStream methods

TCustomMemoryStream	Alphabetically	Legend

In TCustomMemoryStream

Read

SaveToFile

SaveToStream

Seek

SetPointer

Derived from TStream

CopyFrom

FixupResourceHeader

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

Write

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TCustomMemoryStream methods

TCustomMemoryStream	By object	Legend

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

CopyFrom

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

FixupResourceHeader

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Read

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

SafeCallException

SaveToFile

SaveToStream

Seek

SetPointer

Write

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader


TCustomMemoryStream.Read

TCustomMemoryStream	See also

Reads up to Count bytes from the memory stream into Buffer and advances the current position of the stream by the number of bytes read.

function Read(var Buffer; Count: Longint): Longint; override;

Description

Use Read to read the contents of the memory stream into a buffer, starting at the current position. Read will read up to Count bytes from the current position in Memory. If Count bytes extends beyond the end of the memory buffer, Read will only transfer the data up to the end of the associated memory buffer. Read returns the number of bytes actually transferred to Buffer, and advances the current position accordingly. If the return value is less than Count, it means that reading reached the end of the stream data.

All the other data-reading methods of the memory stream (ReadBuffer, ReadComponent) call Read to do the actual reading.

Note:	Read treats Count as an upper bound. The ReadBuffer method, by contrast, raises an exception if Count bytes cannot be read.


TCustomMemoryStream.SaveToFile

TCustomMemoryStream	See also

Writes the entire contents of the memory stream to the file with a given file name.

procedure SaveToFile(const FileName: string);

Description

Use SaveToFile to write the contents of Memory to a file. SaveToFile allows an application to write out the contents of the memory stream without having to explicitly create and free a file stream object. If the named file cannot be created or opened, SaveToFile raises an EFCreateError exception.


TCustomMemoryStream.SaveToStream

TCustomMemoryStream	See also

Writes the entire contents of the memory stream to the stream object specified by Stream.

procedure SaveToStream(Stream: TStream);

Description

Use SaveToStream to copy data that is stored in memory into another storage medium. SaveToStream writes the entire contents of Memory into the indicated stream object, starting at the current position in the stream that was passed as a parameter.

When the Stream parameter is a TFileStream object, SaveToStream does much the same thing as the SaveToFile method. However, SaveToStream writes to the current position in the target stream. Thus, for example, SaveToStream can be used to append the contents of Memory to a file stream, rather than replace the contents of the file the way SaveToFile does.

If the entire contents of the memory stream cannot be written to the target stream, SaveToStream raises an EWriteError exception.


TCustomMemoryStream.Seek

TCustomMemoryStream	See also	Example

Moves the current position of the stream by Offset bytes, relative to the origin specified by Origin.

function Seek(Offset: Longint; Origin: Word): Longint; override;

Description

Use Seek to move the current position within the memory stream by the indicated offset. Seek allows an application to read from or write to a particular location within the Memory associated with the memory stream.

If Offset is a negative number, the seek is backward from the specified origin. The following table shows the different values of Origin and their meanings for seeking.

Value	Meaning

soFromBeginning	Offset is from the beginning of Memory. Seek moves to the position Offset. Offset must be >= 0.

soFromCurrent	Offset is from the current position. Seek moves to Position + Offset.

soFromEnd	Offset is from the end of Memory. Offset must be <= 0 to indicate a number of bytes before the end of the memory buffer.

Seek returns the new value of the Position property.

Note:	Seek does no error checking on the value provided for Offset. Do not call seek with an offset that would move the current position less than 0 (before the start of Memory) or greater than Size (beyond the end of the memory buffer).


TCustomMemoryStream.SetPointer

TCustomMemoryStream	See also

Replaces the memory buffer associated with the memory stream.

procedure SetPointer(Ptr: Pointer; Size: Longint);

Description

Use SetPointer to set the internal memory buffer, Memory, to be the value passed in by Ptr. Size is the number of bytes Ptr points to.

Descendants of TCustomMemoryStream should use SetPointer to associate the memory stream with the memory buffer that holds the data for the memory stream.

Note:	SetPointer does not free the existing value of Memory, if any, when it replaces the memory buffer. Descendants of TCustomMemoryStream that use SetPointer to replace the stream’s memory pool should free the memory pointed to by the Memory property before calling SetPointer to replace the memory buffer.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TStream


TCustomOutline

Hierarchy	Properties	Methods	Events	See also

TCustomOutline is the base class for controls that display outline nodes (TOutlineNode objects).

Unit

outline

Description

Use TCustomOutline as a base class when defining a control that displays outline nodes in a two-dimensional layout. TCustomOutline introduces the ability to manage a hierarchy of outline nodes, including the ability to control the appearance and layout of those nodes and to expand or collapse branches of the outline tree.

Do not create instances of TCustomOutline. To add an outline control to a form, use the TOutline object, which publishes many of the properties, events, and methods of TCustomOutline.


TCustomOutline properties

TCustomOutline	Alphabetically	Legend

In TCustomOutline

ItemCount

ItemHeight

Items

ItemSeparator

Lines

Options

OutlineStyle

PictureClosed

PictureLeaf

PictureMinus

PictureOpen

PicturePlus

SelectedItem

Style

Derived from TCustomGrid

Row

Derived from TCustomControl

Canvas

Derived from TWinControl

Brush

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomOutline properties

TCustomOutline	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

ItemCount

ItemHeight

Items

ItemSeparator

Left

Lines

LRDockWidth

Name

Options

OutlineStyle

Owner

Parent

ParentWindow

PictureClosed

PictureLeaf

PictureMinus

PictureOpen

PicturePlus

Row

SelectedItem

ShowHint

Showing

Style

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TCustomOutline.ItemCount

TCustomOutline	See also

Indicates the number of nodes in the outline.

property ItemCount: LongInt;

Description

Read ItemCount to determine the number of nodes in the outline. Use ItemCount with the Items property array to iterate over all nodes in the outline.

Note:	Reading ItemCount can be computationally expensive, as it causes all the indexes used by the outline to be updated.


TCustomOutline.ItemHeight

TCustomOutline	See also

Specifies the height of each node in the outline.

property ItemHeight: Integer;

Description

Set ItemHeight to the height, in pixels, of each node in the outline. Changing the ItemHeight property also changes the font used to display the nodes.


TCustomOutline.Items

TCustomOutline	See also

Lists the nodes in the outline.

property Items[Index: LongInt]: TOutlineNode; default;

Description

Use Items to access a node in the outline. Each item is a TOutlineNode object.

Index is a number specifying the node to return, where Items[0] refers to the root, Items[1] is the first (topmost) node, and so on.

Items is the default property of TCustomOutline. This means that the name of the property may be omitted in code. Thus the line

Outline1.Items[1].Text := Edit1.Text;

can also be written

Outline1[1].Text := Edit1.Text;


TCustomOutline.ItemSeparator

TCustomOutline	See also

Specifies a delimiting string for outline nodes.

property ItemSeparator: string;

Description

Set ItemSeparator to the string that should appear between node names in the path description of any individual node in the outline. ItemSeparator is used to implement the FullPath read method of TOutlineNode.

ItemSeparator is initialized to the backslash (\) character when the TCustomOutline object is created.


TCustomOutline.Lines

TCustomOutline	See also

Lists the Text property values of all nodes in the outline.

property Lines: TStrings;

Description

Read Lines to obtain a text representation of the outline. Set Lines to fill the outline from a set of text strings. Each string in the Lines property represents a node in the outline. Lines does not include the root node.

Leading tabs and spaces are converted into levels of the outline. Text without any leading tabs or spaces becomes level 1 items. For example, the following set of strings represents an outline with three first level children descended from the root, and an additional, second level child on the first and third nodes:

ChildA

 ChildA1

ChildB

ChildC

 ChildC1

The Lines property is primarily useful for filling an outline with items at design time. While Lines can be used to access the individual nodes at run time, it is much quicker to access an item with the Items property.


TCustomOutline.Options

TCustomOutline	See also

Determines how the nodes in the outline are drawn.

property Options: TOutlineOptions;

Description

Set Options to any combination of the following values:

Value	Meaning

ooDrawTreeRoot	The first item (Index value of 1) is connected to the root item by the outline tree. This means that the tree will extend from the top of the outline to all the first level items. Without ooDrawTreeRoot, all first level items appear leftmost in the outline, not connected by the tree.

ooDrawFocusRect	The outline draws a focus rectangle around the selected item.

ooStretchBitmaps	The outline stretches the standard bitmaps (PictureLeaf, PictureOpen, PictureClosed, PicturePlus, PictureMinus) to fit in the size of the item, determined by the size of the Font of the Text. Without ooStretchBitmap, the bitmaps  will be cropped if larger than the height of the item text, or won't fill up the entire item space if smaller than the text.


TCustomOutline.OutlineStyle

TCustomOutline	See also

Specifies how the outline tree is displayed.

property OutlineStyle: TOutlineStyle;

Description

Set OutlineStyle to one of the following values:

Value	Meaning

osText	Displays node text (specified in TOutlineNode::Text) only.

osPlusMinusText	Displays plus picture (specified in PicturePlus), minus picture (specified in PictureMinus), and node text (specified in TOutlineNode::Text).

osPictureText	Displays open picture (specified in PictureOpen), closed picture (specified in PictureClosed), leaf picture (specified in PictureLeaf) and node text (specified in TOutlineNode::Text).

osPlusMinusPictureText	Displays plus picture (specified in PicturePlus), minus picture (specified in PictureMinus), open picture (specified in PictureOpen), closed picture (specified in PictureClosed), leaf picture (specified in PictureLeaf), and node text (specified in TOutlineNode::Text).

osTreeText	Displays lines connecting outline nodes and node text (specified in TOutlineNode::Text).

osTreePictureText	Displays lines connecting outline nodes, open picture (specified in PictureOpen), closed picture (specified in PictureClosed), leaf picture (specified in PictureLeaf), and node text (specified in TOutlineNode::Text).

Note:	If the Style property is otOwnerDraw, the value of OutlineStyle is ignored. The connecting lines, node bitmaps, and node text must all be drawn in an OnDrawItem event handler.


TCustomOutline.PictureClosed

TCustomOutline	See also

Specifies the bitmap used to represent a collapsed node that has subitems.

property PictureClosed: TBitmap;

Description

By default, PictureClosed is a closed file folder bitmap. Set PictureClosed to change the bitmap used for collapsed nodes.

Note:	The bitmap is not displayed in the outline unless the OutlineStyle property is set to osPictureText, osPlusMinusPictureText, or osTreePictureText.


TCustomOutline.PictureLeaf

TCustomOutline	See also

Specifies the bitmap used to represent an item that does not have subitems.

property PictureLeaf: TBitmap;

Description

By default, PictureLeaf is a document bitmap. Set PictureLeaf to change the bitmap used for leaf nodes.

Note:	The bitmap is not displayed in the outline unless the OutlineStyle property is set to osPictureText, osPlusMinusPictureText, or osTreePictureText.


TCustomOutline.PictureMinus

TCustomOutline	See also

Specifies the bitmap used to represent an expanded item that has subitems.

property PictureMinus: TBitmap;

Description

By default, PictureMinus is a minus sign (-). Set PictureMinus to change the bitmap used for collapsible nodes.

Note:	The bitmap is not displayed in the outline unless the OutlineStyle property is set to osPlusMinusPictureText or osPlusMinusText.


TCustomOutline.PictureOpen

TCustomOutline	See also

Specifies the bitmap used to represent an expanded item that has subitems.

property PictureOpen: TBitmap;

Description

By default, the PictureOpen property is an open file folder. Set PictureOpen to change the bitmap used for expanded nodes.

Note:	The bitmap is not displayed in the outline unless the OutlineStyle property is set to osPictureText, osPlusMinusPictureText, or osTreePictureText.


TCustomOutline.PicturePlus

TCustomOutline	See also

Specifies the bitmap used to represent a collapsed item that has subitems.

property PicturePlus: TBitmap;

Description

By default, the PicturePlus property is a plus sign (+). Set PicturePlus to change the bitmap used for collapsed nodes.

Note:	The bitmap will not be displayed in the outline unless the OutlineStyle property is set to osPlusMinusPictureText or osPlusMinusText.


TCustomOutline.SelectedItem

TCustomOutline	See also

Specifies the index of the selected node.

property SelectedItem: LongInt;

Description

Read SelectedItem to determine the Index of the selected node. If no node is selected, SelectedItem is 0. Set SelectedItem to set focus to a particular node in the outline.


TCustomOutline.Style

TCustomOutline	See also

Determines whether the nodes and tree are drawn automatically.

property Style: TOutlineType;

Description

By default, Style is osStandard, meaning that the outline displays items in the style determined by the OutlineStyle property. Set Style to otOwnerDraw to create owner-draw outlines, meaning that items must be drawn on the canvas of the outline by code in an OnDrawItem event handler.

Owner-draw outlines can display items other than the Text of a node and the standard bitmaps specified in the PictureClosed, PictureOpen, PictureMinus, PicturePlus, and PictureLeaf properties. Owner-draw outlines require more programming, however, as the application must specify how to render the image for each node in an OnDrawItem event handler.


TCustomOutline events

TCustomOutline	Alphabetically	Legend

In TCustomOutline

OnCollapse

OnDrawItem

OnExpand


TCustomOutline events

TCustomOutline	By object	Legend

OnCollapse

OnDrawItem

OnExpand


TCustomOutline.OnCollapse

TCustomOutline	See also

Occurs immediately after a node in the outline is collapsed.

EOutlineChange = procedure (Sender: TObject; Index: LongInt) of object;

property OnCollapse:EOutlineChange;

Description

Write an OnCollapse event handler to perform special processing when a node in the outline is collapsed. The Sender parameter is the outline, and the Index parameter is the index of the node that was just collapsed.


TCustomOutline.OnDrawItem

TCustomOutline	See also

Occurs when a node must be drawn in an owner-draw outline.

property OnDrawItem: TDrawItemEvent;

Description

When the Style property is set to otOwnerDraw, specify an OnDrawItem event handler to render the image of each node in the outline. An OnDrawItem event handler can display items other than the Text of a node and the standard bitmaps specified in the PictureClosed, PictureOpen, PictureMinus, PicturePlus, and PictureLeaf properties.

Draw the image of the node specified by the Index parameter onto the canvas of the outline.


TCustomOutline.OnExpand

TCustomOutline	See also

Occurs immediately after a node in the outline is expanded.

EOutlineChange = procedure (Sender: TObject; Index: LongInt) of object;

property OnExpand:EOutlineChange;

Description

Write an OnExpand event handler to perform special processing when a node in the outline is expanded. The Sender parameter is the outline, and the Index parameter is the index of the node that was just expanded.


TCustomOutline methods

TCustomOutline	Alphabetically	Legend

In TCustomOutline

Add

AddChild

AddChildObject

AddObject

BadIndex

BeginUpdate

Clear

Click

Collapse

Create

DblClick

DefineProperties

Delete

DeleteNode

Destroy

DrawCell

EndUpdate

Expand

FullCollapse

FullExpand

GetDataItem

GetItem

GetNodeDisplayWidth

GetTextItem

GetVisibleNode

Insert

InsertObject

KeyDown

KeyPress

Loaded

LoadFromFile

LoadFromStream

MouseDown

Move

SaveToFile

SaveToStream

SetDisplayWidth

SetGoodIndex

SetLevel

SetUpdateState

Derived from TCustomGrid

MouseCoord

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomOutline methods

TCustomOutline	By object	Legend

Add

AddChild

AddChildObject

AddObject

AfterConstruction

Assign

BadIndex

BeforeDestruction

BeginDrag

BeginUpdate

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Click

ClientToScreen

Collapse

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DblClick

DefaultHandler

DefineProperties

Delete

DeleteNode

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawCell

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

EndUpdate

ExecuteAction

Expand

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

FullCollapse

FullExpand

GetControlsAlignment

GetDataItem

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetItem

GetNamePath

GetNodeDisplayWidth

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextItem

GetTextLen

GetVisibleNode

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

Insert

InsertComponent

InsertControl

InsertObject

InstanceSize

Invalidate

IsRightToLeft

KeyDown

KeyPress

Loaded

LoadFromFile

LoadFromStream

ManualDock

ManualFloat

MethodAddress

MethodName

MouseCoord

MouseDown

MouseWheelHandler

Move

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

SaveToFile

SaveToStream

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetDisplayWidth

SetFocus

SetGoodIndex

SetLevel

SetTextBuf

SetUpdateState

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TCustomOutline.Destroy

TCustomOutline

Destroys an instance of TCustomOutline.

destructor Destroy; override;

Description

Destroy frees all memory associated with the outline. While Destroy frees the TOutlineNode objects that comprise the outline, any objects associated with those nodes are not freed.


TCustomOutline.Add

TCustomOutline	See also

Adds a node to the outline.

function Add(Index: LongInt; const Text: string): LongInt;

Description

Use Add to add a TOutlineNode object to the outline. Text specifies the Text property value of the new node.

Index specifies where to add the new node. The new node is positioned in the outline as the last sibling of the node identified by Index. To add nodes to the beginning of the outline, specify zero (0) as the Index parameter.

Nodes that appear after the new node are moved down one row and reindexed in the Items property array with valid Index values. If BeginUpdate has been called, the Items array is not reindexed until the EndUpdate method is called.

Add returns the Index property of the new node.


TCustomOutline.AddChild

TCustomOutline	See also

Adds a child node to a node in the outline.

function AddChild(Index: LongInt; const Text: string): LongInt;

Description

Use AddChild to add a TOutlineNode object as the child of a node in the outline. Text specifies the Text property value of the new node.

Index specifies where to add the new node. The new node is positioned in the outline as the last child of the node identified by Index. To add nodes to the top level of the outline (off the root), specify zero (0) as the Index parameter.

Nodes that appear after the new node are moved down one row and reindexed in the Items property array with valid Index values. If BeginUpdate has been called, the Items array is not reindexed until the EndUpdate method is called.

AddChild returns the Index property of the new node.


TCustomOutline.AddChildObject

TCustomOutline	See also

Adds a child node containing data to a node in the outline.

function AddChildObject(Index: LongInt; const Text: string; const Data: Pointer): LongInt;

Description

Use AddChildObject to add a TOutlineNode object as the child of a node in the outline and assign it a data pointer. Text specifies the value of the Text property for the new node. Data specifies the value of the Data property for the new node.

Index specifies where to add the new node. The new node is positioned in the outline as the last child of the node identified by Index. To add nodes to the top level of the outline (off the root), specify zero (0) as the Index parameter.

Nodes that appear after the new node are moved down one row and reindexed in the Items property array with valid Index values. If BeginUpdate has been called, the Items array is not reindexed until the EndUpdate method is called.

AddChildObject returns the Index property of the new node.


TCustomOutline.AddObject

TCustomOutline	See also

Adds a node containing data to the outline.

function AddObject(Index: LongInt; const Text: string; const Data: Pointer): LongInt;

Description

Use AddObject to add a TOutlineNode object to the outline and assign it a data pointer. Text specifies the value of the Text property for the new node. Data specifies the value of the Data property for the new node.

Index specifies where to add the new node. The new node is positioned in the outline as the last sibling of the node identified by Index. To add nodes to the beginning of the outline, specify zero (0) as the Index parameter.

Nodes that appear after the new node are moved down one row and reindexed in the Items property array with valid Index values. If BeginUpdate has been called, the Items array is not reindexed until the EndUpdate method is called.

AddChild returns the Index property of the new node.


TCustomOutline.BadIndex

TCustomOutline	See also

Indicates whether a node’s index is up to date.

function BadIndex(Value: TOutlineNode): Boolean;

Description

Use BadIndex to determine whether the Index property of the TOutlineNode object specified by the Value parameter accurately reflects the position of the node in the outline.

If nodes are added or removed after a call to BeginUpdate, the indexes may be out of date until the EndUpdate method is called.


TCustomOutline.BeginUpdate

TCustomOutline	See also

Prevents the updating of the outline until the EndUpdate method is called.

procedure BeginUpdate;

Description

Call BeginUpdate before adding, removing, or moving multiple outline items. BeginUpdate speeds processing time by deferring repaints and the adjustment of index values until EndUpdate is called.

Note:	Make sure that EndUpdate is called after all changes have been made to the nodes in the Items array.


TCustomOutline.Clear

TCustomOutline

Removes all items from the outline.

procedure Clear;

Description

Call Clear to empty the outline of all its nodes. Clear frees the memory for the removed items but not any memory for associated data.


TCustomOutline.Click

TCustomOutline	See also

Updates the SelectedItem property.

procedure Click; override;

Description

Click is called automatically when the user clicks the mouse on a node in the outline. Click updates the SelectedItem property before the OnClick event handler is called by the inherited method.


TCustomOutline.Collapse

TCustomOutline	See also

Generates an OnCollapse event.

procedure Collapse(Index: LongInt); dynamic;

Description

Collapse is called automatically after a node in the outline is collapsed. It calls the OnCollapse event handler if it is assigned.

Override the Collapse method to provide additional processing after nodes in the outline have been collapsed, or to block the OnCollapse event.


TCustomOutline.DblClick

TCustomOutline	See also

Expands or collapses the selected node.

procedure DblClick; override;

Description

DblClick is called automatically when the user double clicks the mouse on a node in the outline. After calling the OnDblClick event handler, DblClick updates the SelectedItem property and expands the selected node if it is collapsed or collapses the selected node if it is expanded.


TCustomOutline.DefineProperties

TCustomOutline	See also

Creates a binary property for customized bitmap values.

procedure DefineProperties(Filer: TFiler); override;

Description

The streaming system calls DefineProperties to allow the outline to define new properties that should be saved with the outline object. DefineProperties checks whether the outline uses any bitmaps other than the default values of PictureClosed, PictureLeaf, PictureMinus, PictureOpen, and PicturePlus. If the outline has customized any of these bitmaps, DefineProperties uses the DefineBinaryProperty method of the Filer parameter to create a binary property for the customized values.


TCustomOutline.Delete

TCustomOutline	See also

Deletes a node from the outline.

procedure Delete(Index: LongInt);

Description

Call Delete to remove a node and all its descendants from the outline. Index is the index of the node to delete.

Delete removes the node and its children, frees all associated memory, and then calls DeleteNode to update the indexes and make sure that SelectedItem is valid.


TCustomOutline.DeleteNode

TCustomOutline	See also

Fixes up the outline after a node has been deleted.

procedure DeleteNode(Node: TOutlineNode; CurIndex: LongInt);

Description

DeleteNode is called automatically whenever a node in the outline is destroyed. It fixes up the index and makes sure that the SelectedItem property is valid.

To Delete a node from the outline, call the Delete method of the outline or the Free method of the TOulineNode object.


TCustomOutline.DrawCell

TCustomOutline	See also

Draws a node in the outline.

procedure DrawCell(ACol, ARow: Longint; ARect: TRect; AState: TGridDrawState); override;

Description

DrawCell is called automatically whenever the outline needs to draw a node. If the Style property is otOwnerDraw and an OnDrawItem event handler has been supplied, DrawCell generates an OnDrawItem event. Otherwise, DrawCell draws the node in the manner indicated by the OutlineStyle property.


TCustomOutline.EndUpdate

TCustomOutline	See also

Performs the reindexing and repaints deferred by a call to BeginUpdate.

procedure EndUpdate;

Description

Call EndUpdate at the end of a segment of code that began with a call to BeginUpdate. Every time BeginUpdate is called, an internal counter is incremented. When EndUpdate is called, the counter is decremented. When every call to BeginUpdate has been matched by a call to EndUpdate, EndUpdate fixes up the indexes and repaints the outline.


TCustomOutline.Expand

TCustomOutline	See also

Generates an OnExpand event.

procedure Expand(Index: LongInt); dynamic;

Description

Expand is called automatically after a node in the outline is expanded. It calls the OnExpand event handler if it is assigned.

Override the Expand method to provide additional processing after nodes in the outline have been expanded, or to block the OnExpand event.


TCustomOutline.FullCollapse

TCustomOutline	See also

Causes all top-level nodes in the outline to collapse.

procedure FullCollapse;

Description

Call FullCollapse to shrink the outline as much as possible. FullCollapse sets the Expanded property of each TOutlineNode that is a direct descendant of the root of the outline to false. This causes all the descendants of these top-level nodes to be hidden. Depending on the value of OutlineStyle, each collapsed top-level node is then represented with the PictureClosed bitmap and/or the PicturePlus bitmap.


TCustomOutline.FullExpand

TCustomOutline	See also

Expands every node in the outline.

procedure FullExpand;

Description

Call FullExpand to show all nodes in the outline. FullExpand calls the FullExpand method of the root node. This causes the Expanded property of all nodes in the outline to be set to true. Every node in the Items array appears fully expanded in the outline. Depending on the value of OutlineStyle, each node that has descendants is then represented with the PictureOpen bitmap and/or the PictureMinus bitmap. The appearance of leaf nodes is unaffected.


TCustomOutline.GetDataItem

TCustomOutline	See also

Returns the index of the first node in the outline that has the Value pointer as its Data property.

function GetDataItem(Value: Pointer): Longint;

Description

Call GetDataItem to locate the node that corresponds to the Value parameter. GetDataItem returns an index into the Items property array.


TCustomOutline.GetItem

TCustomOutline	See also

Returns the index of the node at the position indicated by the X and Y parameters.

function GetItem(X, Y: Integer): LongInt;

Description

Call GetItem to locate the node at the specified screen pixel coordinates. GetItem returns an index into the Items property array.


TCustomOutline.GetNodeDisplayWidth

TCustomOutline	See also

Returns the length of the row containing a specified node.

function GetNodeDisplayWidth(Node: TOutlineNode): Integer;

Description

Call GetNodeDisplayWidth to determine the length, in pixels, of the line in the outline that contains the node specified by the Node parameter. GetNodeDisplayWidth adjusts for the lines and bitmaps specified by the OutlineStyle property.


TCustomOutline.GetTextItem

TCustomOutline	See also

Returns the index of the first node in the outline with the Value parameter as its Text property.

function GetTextItem(const Value: string): Longint;

Description

Call GetTextItem to locate the node that corresponds to the Value parameter. GetTextItem returns an index into the Items property array.


TCustomOutline.GetVisibleNode

TCustomOutline	See also

Returns the TOutlineNode object for the node indicated by a position in the image of the outline.

function GetVisibleNode(Index: LongInt): TOutlineNode;

Description

Call GetVisibleNode to locate a node with the position given by the Index parameter, where all nodes that are hidden because their parent node is collapsed are ignored. An Index of 0 indicates the first visible node, an Index of 1 indicates the second visible node, and so on. If the outline is fully expanded, GetVisibleNode returns the value of Items[Index+1].


TCustomOutline.Insert

TCustomOutline	See also

Inserts a node at a specified position.

function Insert(Index: LongInt; const Text: string): LongInt;

Description

Use Insert to add a TOutlineNode object to the outline. Text specifies the Text property value of the new node.

Index specifies where to add the new node. The new node is positioned in the outline in the position currently occupied by the node identified by Index. The new node is inserted at the same level as the node currently identified by Index, so that the original node and the new node are siblings and share the same parent. To add nodes to the beginning of the outline, specify zero (0) as the Index parameter.

Nodes that appear after the new node, including the one specified by Index before Insert is called, are moved down one row and reindexed in the Items property array with valid Index values. If BeginUpdate has been called, the Items array is not reindexed until the EndUpdate method is called.

Insert returns the Index property of the new node.


TCustomOutline.InsertObject

TCustomOutline	See also

Inserts a node containing data at a specified position.

function InsertObject(Index: LongInt; const Text: string; const Data: Pointer): LongInt;

Description

Use InsertObject to add a TOutlineNode object to the outline and assign it a data pointer. Text specifies the value of the Text property for the new node. Data specifies the value of the Data property for the new node.

Index specifies where to add the new node. The new node is positioned in the outline in the position currently occupied by the node identified by Index. The new node is inserted at the same level as the node currently identified by Index, so that the original node and the new node are siblings and share the same parent. To add nodes to the beginning of the outline, specify zero (0) as the Index parameter.

Nodes that appear after the new node, including the one specified by Index before Insert is called, are moved down one row and reindexed in the Items property array with valid Index values. If BeginUpdate has been called, the Items array is not reindexed until the EndUpdate method is called.

Insert returns the Index property of the new node.


TCustomOutline.KeyDown

TCustomOutline	See also

Provides special processing when the user presses a key.

procedure KeyDown(var Key: Word; Shift: TShiftState); override;

Description

KeyDown is called automatically when the user presses a key. After calling the inherited method, which generates an OnKeyDown event, KeyDown processes the following keystrokes:

Key	Behavior

Home	Selects the first node in the outline.

End	Selects the last node in the outline.

Return	Toggles the selected node between its collapsed and expanded states.

Ctrl+*	Fully expands the outline.

Right arrow	Selects the first child of the selected node.

Left arrow	Selects the parent of the selected node.

Ctrl+Up arrow	Selects the node following the selected node.

Ctrl+Down arrow	Selects the node preceding the selected node.


TCustomOutline.KeyPress

TCustomOutline	See also

Provides special processing when a key is pressed.

procedure KeyPress(var Key: Char); override;

Description

KeyPress is called automatically after the user presses a key but before it is released. After calling the inherited method, which generates an OnKeyPress event, KeyPress processes the following characters :

Key	Behavior

+	Expands the selected node.

-	Collapses the selected node.

*	Fully expands the outline.


TCustomOutline.Loaded

TCustomOutline	See also

Sets up the outline after it has been streamed in.

procedure Loaded; override;

Description

The streaming system calls Loaded after the outline has been fully loaded into memory. Loaded makes sure that all indexes are correct, loads any custom bitmaps that replaced the default values, and selects the first node in the outline.


TCustomOutline.LoadFromFile

TCustomOutline	See also

Loads the outline from a text image stored in a file.

procedure LoadFromFile(const FileName: string);

Description

Call LoadFromFile to fill an outline from the file specified by the FileName parameter. Each line in the file represents a node in the outline. The file does not include the root node.

Leading tabs and spaces are converted into levels of the outline. Text without any leading tabs or spaces becomes level 1 items. For example, the following set of strings represents an outline with three first level children descended from the root, and an additional, second level child on the first and third nodes:

ChildA

 ChildA1

ChildB

ChildC

 ChildC1

To fill the outline from a text image read from a stream, use the LoadFromStream method. To fill the outline from a text image represented as a TStrings object, use the Lines property.


TCustomOutline.LoadFromStream

TCustomOutline	See also

Loads the outline from a text image read from a stream.

procedure LoadFromStream(Stream: TStream);

Description

Call LoadFromStream to fill an outline from the stream specified by the Stream parameter. For example, use LoadFromStream to load an outline from an image stored in a database table, using a TBlobStream object. Each node in the outline is separated by a newline character. The stream does not provide the root node.

Leading tabs and spaces are converted into levels of the outline. Text without any leading tabs or spaces becomes level 1 items. For example, the following set of strings represents an outline with three first level children descended from the root, and an additional, second level child on the first and third nodes:

ChildA

 ChildA1

ChildB

ChildC

 ChildC1

To fill the outline from a text image read from a file, use the LoadFromFile method. To fill the outline from a text image represented as a TStrings object, use the Lines property.


TCustomOutline.MouseDown

TCustomOutline	See also

Updates the SelectedItem property.

procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;

Description

After calling the inherited method to generate an OnMouseDown event and locate the line under the mouse, MouseDown sets the SelectedItem property to the node in the line under the mouse.


TCustomOutline.Move

TCustomOutline	See also

Repositions a node in the outline.

procedure Move(Destination, Source: LongInt; AttachMode: TAttachMode);

Description

Call Move to reposition the node with the index specified by the Source parameter to the position indicated by the Destination parameter. The meaning of the Destination parameter depends on the value of the AttachMode parameter.


TCustomOutline.SaveToFile

TCustomOutline	See also

Saves the Lines property to a file.

procedure SaveToFile(const FileName: string);

Description

Call SaveToFile to save a text image of the outline to the file specified by the FileName parameter. The image saved is the value of the Lines property, where each line of the file represents a node, and each level of the outline is represented by a tab character.

To write the outline to an arbitrary stream, use the SaveToStream method.


TCustomOutline.SaveToStream

TCustomOutline	See also

Writes the Lines property to a stream.

procedure SaveToStream(Stream: TStream);

Description

Call SaveToStream to write a text image of the outline to the stream specified by the Stream parameter. The image saved is the value of the Lines property, where each line of text represents a node, and each level of the outline is represented by a tab character.

To write the outline to a file, use the SaveToFile method.


TCustomOutline.SetDisplayWidth

TCustomOutline	See also

Sets the display width of the outline.

procedure SetDisplayWidth(Value: Integer);

Description

Call SetDisplayWidth to set the width of the image of the outline to the number of pixels specified by the Value parameter. Value should large enough to display the most deeply nested node. Use the GetNodeDisplayWidth method to determine the size needed to display the visible nodes.

If the display width is greater than the client width of the control, users can scroll the image to view the entire width.


TCustomOutline.SetGoodIndex

TCustomOutline	See also

Rturns the first node in the Items array that must be re-indexed to make the index of the Value parameter correct.

function SetGoodIndex(Value: TOutlineNode): TOutlineNode;

Description

Call SetGoodIndex to determine how much of the Items array must be re-indexed after changing the nodes in the outline. All nodes from the root to the value returned by SetGoodIndex do not need to be re-indexed.


TCustomOutline.SetLevel

TCustomOutline	See also

Sets the level of an outline node.

procedure SetLevel(Node: TOutlineNode; CurLevel, NewLevel: Cardinal);

Description

Call SetLevel to change the nesting depth of the node specified by the Node parameter. CurLevel is the node’s current level and NewLevel is the node’s new level.

For example, consider the outline specified by the following value of Lines:

NodeA

 NodeB

  NodeC

 NodeD

Calling SetLevel for NodeD with CurLevel set to 2 and NewLevel set to 4 results in the outline with the following value of Lines:

NodeA

 NodeB

  NodeC

   NodeD

That is, the parent of NodeD was changed from NodeA to NodeC.


TCustomOutline.SetUpdateState

TCustomOutline	See also

Enables or disables the maintenance of the node indexes.

procedure SetUpdateState(Value: Boolean);

Description

Call SetUpdateState with Value set to true to block the recomputation of indexes. Call SetUpdateState with Value set to false to recompute all indexes in the outline and enable the maintenance of indexes with every change to the nodes in the outline.

Unlike calls to BeginUpdate and EndUpdate, calls to SetUpdateState do not nest: Calling SetUpdateState with Value set to false always recomputes the indexes regardless of the number of previous calls to SetUpdateState with Value set to true.

Note:	Calling SetUpdateState takes precedence over any enabling or disabling of index maintenance provided by BeginUpdate or EndUpdate.


TCustomOutline.Create

TCustomOutline	See also

Creates an instance of TCustomOutline.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TCustomOutline object at runtime. Outlines placed on forms at design time are created automatically.

Create initializes the outline object, setting the values of some internal properties, as well as setting

Color to clWindow and ParentColor to false.

Height to 97 and Width to 121.

ItemSeparator to ’\’.

Options to [ooDrawTreeRoot, ooDrawFocusRect].

OutlineStyle to osTreePictureText.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGrid


TCustomPanel

Hierarchy	Properties	Methods	See also

TCustomPanel is the abstract base class for all panel components.

Unit

extctrls

Description

Use TCustomPanel as a base class when defining objects that include other controls as constituent parts. Panel components are controls can contain other controls, grouping them together.

When a panel is aligned with the form using the Align property, it maintains the same relative position to the form even when the form is resized. For example, a panel can be aligned so that it always remains on the top of the form, even when the user changes the shape and size of the form. This makes panels useful for implementing components that act like tool bars or status bars. For example, construct a tool bar or tool palette by adding speed buttons to a panel that execute commands or set modes.


TCustomPanel properties

TCustomPanel	Alphabetically	Legend

In TCustomPanel

Alignment

BevelInner

BevelOuter

BevelWidth

BorderStyle

BorderWidth

FullRepaint

Locked

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomPanel properties

TCustomPanel	By object	Legend

Action

Align

Alignment

Anchors

BevelInner

BevelOuter

BevelWidth

BiDiMode

BorderStyle

BorderWidth

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

FullRepaint

Handle

Height

HelpContext

Hint

HostDockSite

Left

Locked

LRDockWidth

Name

Owner

Parent

ParentColor

ParentWindow

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TCustomPanel.Alignment

TCustomPanel	See also

Determines how caption is aligned within the panel.

property Alignment: TAlignment;

Description

Use the Alignment property to specify if the caption of a panel appears on the left, right, or center of the panel. For example, to use a panel as a status bar that displays the TApplication.Hint property as the panel’s Caption property, set Alignment to taLeftJustify to place the hint text on the left side of the panel.


TCustomPanel.BevelInner

TCustomPanel	See also 	Example

Determines the style of the inner bevel of a panel.

type TPanelBevel = TBevelCut;

property BevelInner: TPanelBevel;

Description

Use BevelInner to provide the panel with a three-dimensional bevelled look. A panel component has two bevels, an outer bevel drawn next to the border of the control, and an inner bevel drawn inside the outer bevel, separated by the number of pixels specified in the BorderWidth property. The width of the bevels, if they are drawn, is the BevelWidth property.

The BevelInner property determines the style of the inner bevel of a panel component.


TCustomPanel.BevelOuter

TCustomPanel	See also 	Example

Determines the style of the outer bevel of a panel.

type TPanelBevel = TBevelCut;

property BevelInner: TPanelBevel;

Description

Use BevelOuter to provide the panel with a three-dimensional bevelled look. A panel component has two bevels, an outer bevel drawn next to the border of the control, and an inner bevel drawn inside the outer bevel, separated by the number of pixels specified in the BorderWidth property. The width of the outer bevel is specified in the BevelWidth property in pixels.


TCustomPanel.BevelWidth

TCustomPanel	See also 	Example

Determines the width, in pixels, of both the inner and outer bevels of a panel.

type TBevelWidth = 1..MaxInt;

property BevelWidth: TBevelWidth;

Description

Use BevelWidth to specify how wide the inner or outer bevel should be. Don’t confuse BevelWidth, which is the width of the bevels, with BorderWidth, which is the space between the bevels.

If both the BevelInner and BevelOuter properties are bvNone, BevelWidth has no effect. To remove both bevels, set the BevelInner and BevelOuter properties to bvNone, rather than setting the BevelWidth to 0, as this involves less overhead when painting.


TCustomPanel.BorderStyle

TCustomPanel	See also

Determines the style of the line drawn around the perimeter of the panel control.

property BorderStyle: TBorderStyle;

Description

Use BorderStyle to specify whether the panel has a single line drawn around it. These are the possible values:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border

Don’t confuse the line drawn around the panel with the BorderWidth of the panel. The BorderWidth of the panel is the distance between the outer and inner bevels.


TCustomPanel.BorderWidth

TCustomPanel	See also 	Example

Specifies the distance, in pixels, between the outer and inner bevels.

property BorderWidth: TBorderWidth;

Description

Use BorderWidth to specify how wide the border around the panel should be. A value of 0 means no border should appear.

The border of a panel is the area between the outer and inner bevels. It is visible only if the inner bevel is raised or lowered, but affects the inset of the caption within the panel even if BevelInner is bvNone. If the Alignment property is not taCenter, the Caption will be aligned to the inner edge of the border. This edge is BorderWidth pixels in from the outer bevel if BevelInner is bvNone. It is the inner edge of the inner bevel otherwise.

Don’t confuse the border of the panel with line drawn around the panel itself. The line around the panel is specified by the BorderStyle property.


TCustomPanel.FullRepaint

TCustomPanel	See also

Determines whether the Invalidate method is called when the custom panel receives a WM_SIZE message.

property FullRepaint: Boolean;

Description

Set FullRepaint to True to cause the panel and all the controls it contains to be repainted when the panel is resized. If FullRepaint is False, the panel and its controls are not repainted.


TCustomPanel.Locked

TCustomPanel	See also

Determines whether a panel that is being used as a toolbar is replaced by a toolbar supplied by an OLE server.

property Locked: Boolean;

Description

Set the Locked property to False when the panel is used as a toolbar by a TOleContainer component. Any panels aligned to a TOleContainer are assumed to be replaceable toolbars unless the Locked property is True. Prevent the panel from being replaced by an OLE server’s toolbar by setting the panel's Locked property to True.

Note:	An OLE application's toolbars must be in panels aligned to a side of the form (that is, their Align properties must be set to alTop, alBottom, alLeft, or alRight).


TCustomPanel methods

TCustomPanel	Alphabetically	Legend

In TCustomPanel

AdjustClientRect

CanAutoSize

Create

CreateParams

GetControlsAlignment

Paint

Derived from TCustomControl

Destroy

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomPanel methods

TCustomPanel	By object	Legend

AdjustClientRect

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanAutoSize

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParams

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

Paint

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TCustomPanel.AdjustClientRect

TCustomPanel	See also

Adjusts the ClientRect property for the ideosyncrasies of the window.

procedure AdjustClientRect(var Rect: TRect); override;

Description

AdjustClientRect is called internally when the panel needs accurate information on where to place child controls within the client area. AdjustClientRect reduces ClientRect by the width of the inner and outer bevels so that child objects are not placed on the beveled region.


TCustomPanel.CanAutoSize

TCustomPanel	See also

Adjusts the way the panel responds to resize attempts.

function CanAutoSize(var NewWidth, NewHeight: Integer): Boolean; override;

Description

CanAutoSize is called automatically when the AutoSize property is True and an attempt is made to resize the panel. It allows the panel to implement the AutoSize property before the resize sequence that begins with the OnCanResize and OnConstrainedResize events and ends with the OnResize event.

When CanAutoSize is called, the NewWidth and NewHeight parameters indicate the proposed new dimensions of the panel. CanAutoSize adjusts these values so that the panel’s size adjusts to its contents. If the adjustment results in values of NewWidth and NewHeight that differ from the panel’s current width and height, CanAutoSize returns True, indicating that the resize sequence should proceed. If, after adjustment, NewWidth and NewHeight equal Width and Height, CanAutoSize returns False, and the resize sequence is aborted.


TCustomPanel.Create

TCustomPanel	See also

Creates and initializes an instance of TCustomPanel.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a panel at runtime. Panels placed in forms at design time do not need to be explicitly created because they are created automatically.

After calling the inherited constructor, Create initializes the following properties:

Alignment to taCenter.

BevelOuter to bvRaised and BevelWidth to 1.

BorderStyle to bsNone.

Color to BtnFace.

ControlStyle to [csAcceptsControls, csCaptureMouse, csClickEvents, csOpaque, csSetCaption, csDoubleClick, csReplicatable].

FullRepaint to True.

Height to 41 and Width to 185.


TCustomPanel.CreateParams

TCustomPanel	See also

Initializes a window-creation parameter record passed in the Params parameter.

procedure CreateParams(var Params: TCreateParams); override;

Description

CreateParams is called automatically to initialize the window-creation parameters whenever the window for the panel needs to be created. CreateParams overrides the inherited method to implement the BorderStyle property.


TCustomPanel.GetControlsAlignment

TCustomPanel	See also

Returns the alignment of text in the panel.

function GetControlsAlignment: TAlignment; override;

Description

GetControlsAlignment returns the value of the Alignment property.


TCustomPanel.Paint

TCustomPanel	See also

Renders the image of the panel.

procedure Paint; override;

Description

Override the Paint method to change the way the panel is drawn. The Paint method for custom panels draws the bevels of the panel, sets the brush and font for the panel, and fills in the interior of the panel before calling the Windows API DrawText function to draw the Caption.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TCustomRadioGroup

Hierarchy	Properties	Methods	See also

TCustomRadioGroup is the base class for radio-group components.

Unit

extctrls

Description

Radio groups are collections of radio buttons in a single group box. TCustomRadioGroup is the class from which radio-group components—including TRadioGroup and TDBRadioGroup—descend.

Radio buttons that are contained directly in the same control component are said to be “grouped.” When the user checks a radio button, all other radio buttons in its group become unchecked. Hence, two radio buttons on a form can be checked at the same time only if they are placed in separate containers, such as group boxes.

If the BiDiMode changes, the positions of the radio buttons are flipped.


TCustomRadioGroup properties

TCustomRadioGroup	Alphabetically	Legend

In TCustomRadioGroup

Columns

ItemIndex

Items

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomRadioGroup properties

TCustomRadioGroup	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Columns

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

ItemIndex

Items

Left

LRDockWidth

Name

Owner

Parent

ParentWindow

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TCustomRadioGroup.Columns

TCustomRadioGroup

Specifies number of columns in the radio group.

property Columns: Integer

Description

The Columns property determines the number of columns in the radio group. Its value can range from 1 to 16. The default value is 1, which means that the radio buttons are arranged in a single vertical line.


TCustomRadioGroup.ItemIndex

TCustomRadioGroup 	Example

Indicates which radio button in the group is currently selected.

property ItemIndex: Integer

Description

ItemIndex holds the ordinal number of the selected radio button in the Items list. (The first button is 0.) The value of ItemIndex changes at runtime as the user selects radio buttons. If you want one of the buttons to appear selected when the application starts, assign that button to ItemIndex at design time; otherwise, leave ItemIndex set to the default value of -1, which means that no button is selected.


TCustomRadioGroup.Items

TCustomRadioGroup	See also 	Example

Lists the radio buttons in the radio group.

property Items: TStrings

Description

Items holds a TStrings object that lists the captions of the radio buttons in the group. In TCustomRadioGroup descendants TRadioGroup and TDBRadioGroup, where this property is published, radio buttons can be added or removed by editing the Items list from the Object Inspector.

Note:	The items in a radio-group object are special instances of TRadioButton generated by TCustomRadioGroup. Independently created TRadioButton instances cannot be included in a radio group.


TCustomRadioGroup methods

TCustomRadioGroup	Alphabetically	Legend

In TCustomRadioGroup

CanModify

Create

Destroy

FlipChildren

GetChildren

Loaded

ReadState

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomRadioGroup methods

TCustomRadioGroup	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

CanModify

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetChildren

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

Loaded

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

ReadState

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TCustomRadioGroup.CanModify

TCustomRadioGroup	See also

Determines whether the user can select a different radio button in the group.

function CanModify: Boolean; virtual;

Description

Event handlers call CanModify to verify that the user is allowed to select a different radio button in the group. As defined in TCustomRadioGroup, this method always returns True; override it to return False in situations where the user should not be able to make changes.


TCustomRadioGroup.Create

TCustomRadioGroup	See also

Creates and initializes a TCustomRadioGroup instance.

constructor Create(AOwner: TComponent); override;

Description

Create calls the inherited constructor method and initializes TCustomRadioGroup’s properties. It sets the ControlStyle property’s csSetCaption and csDoubleClicks flags.


TCustomRadioGroup.Destroy

TCustomRadioGroup 	See also

Destroys the TCustomRadioGroup instance and the radio buttons it contains.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the radio group is not nil, and only then calls Destroy.

Destroy frees the memory for each item in the group, then calls the inherited destructor method.


TCustomRadioGroup.FlipChildren

TCustomRadioGroup 	See also

Flips the control’s children.

procedure FlipChildren(AllLevels: Boolean); override;

Description

FlipChildren overrides the inherited FlipChildren method in order to disable the flipping.

To flip the children of a radio group, use the BiDiMode property.


TCustomRadioGroup.GetChildren

TCustomRadioGroup	See also

Prevents the streaming system from loading and saving child controls in the usual fashion.

procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;

Description

GetChildren is called in the streaming sequence that loads and saves VCL components. Because radio groups load and save their buttons using the ReadState and WriteState methods, TCustomRadioGroup overrides TWinControl to disable the GetChildren method.


TCustomRadioGroup.Loaded

TCustomRadioGroup	See also

Initializes the radio group after it is loaded into memory.

procedure Loaded; override;

Description

Do not call Loaded. The VCL streaming system calls Loaded automatically after the radio group’s form is loaded into memory so that it can complete any initializations that depend on other objects in the form.

Loaded overrides the inherited method to ensure that the buttons in the group are properly arranged.


TCustomRadioGroup.ReadState

TCustomRadioGroup	See also

Reads the radio group’s data from a stream.

procedure ReadState(Reader: TReader); override;

Description

ReadState is part of a sequence of calls used by the streaming system that loads and saves VCL components.  It reads the values of all the radio groups published properties, stored data, and owned components from the reader object passed in Reader. Do not call ReadState directly.

ReadState calls the inherited ReadState method to read the radio group’s published properties and other stored data to a reader object. It then initializes and redraws the buttons in the group.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGroupBox


TCustomRichEdit

Hierarchy	Properties	Methods	Events	See also

TCustomRichEdit is the abstract base type for rich edit controls such as TRichEdit.

Unit

comctrls

Description

TCustomRichEdit introduces new properties and methods to expand the capabilities of TCustomMemo for rich text.

Do not create instances of TCustomRichEdit. Use TCustomRichEdit as a base class when declaring control objects that implement rich text capabilities in an edit control. Properties and methods of TCustomRichEdit provide basic behavior that descendant classes inherit as well as behavior that components can override to customize their behavior.


TCustomRichEdit properties

TCustomRichEdit	Alphabetically	Legend

In TCustomRichEdit

DefAttributes

DefaultConverter

HideScrollBars

HideSelection

Lines

PageRect

Paragraph

PlainText

SelAttributes

SelLength

SelStart

SelText

Derived from TCustomMemo

CaretPos

Derived from TCustomEdit

CanUndo

Modified

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Text

Top

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomRichEdit properties

TCustomRichEdit	By object	Legend

Align

BoundsRect

Brush

CanUndo

CaretPos

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ControlCount

Controls

ControlState

ControlStyle

Cursor

DefAttributes

DefaultConverter

DesignInfo

Enabled

Handle

Height

HelpContext

HideScrollBars

HideSelection

Hint

Left

Lines

Modified

Name

Owner

PageRect

Paragraph

Parent

ParentWindow

PlainText

SelAttributes

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TCustomRichEdit.DefAttributes

TCustomRichEdit	See also	Example

Describes the rich text characteristics of the default font for the rich edit control

property DefAttributes: TTextAttributes;

Description

Use DefAttributes to discover or set the default font characteristics that the rich edit control uses for newly inserted text. These are the characteristics of the text before any special attributes have been applied. Once any special attributes are applied to a portion of text, no text from that point on is considered to have the default attributes, even if the attributes match the DefAttributes.

For example, if a rich edit control has had no attributes applied, the entire text has the default attributes. Selecting a portion of text in the middle and applying a specific attribute (such as a font change) results in three sections: a first section with the default attributes, a middle section with the applied attribute, and a final section with a non-default set of attributes that match the default attributes. Changing the DefAttributes property affects only the first section.

When inserting new text, the font characteristics of the new text will match the font characteristics at the cursor position, or, if the typing replaces a selection, the font characteristics of the selected text. New text will only have the default attributes when typed into the section of text that has the default attributes.

Note:	DefAttributes is available only at runtime.


TCustomRichEdit.DefaultConverter

TCustomRichEdit	See also

Specifies the class of the TConversion object that is used to convert between native file format and the internal format of a rich text control when working with files that do not have a registered extension.

type TConversionClass = class of TConversion;

property DefaultConverter: TConversionClass;

Description

Use DefaultConverter to specify the type of conversion to use when streaming text to or from files that do not have a registered extension. If DefaultConverter is not set, TCustomRichEdit uses TConversion, which performs no actual conversion. TCustomRichEdit encodes text attributes in rich-text format (RTF). Thus, unrecognized file extensions lead to no conversion, which works for files that contain plain text or any subset of RTF format.

To support streaming to or from files that encode rich text characteristics in some other format, register a conversion format with the file extension used by those files. Use DefaultConverter only to change the conversion that is used for unrecognized file extensions.

Note:	Use the Lines property to stream the text to or from a file.


TCustomRichEdit.HideScrollBars

TCustomRichEdit	See also	Example

Determines whether the scroll bars disappear when not needed.

property HideScrollBars;

Description

Use HideScrollBars to determine whether the scroll bars disappear from the edit control when the text appears completely within the edit window. Set HideScrollBars to False to prevent the scroll bars from flashing on and off when the contents of the rich edit control change.

HideScrollBars does nothing when the ScrollBars property is set to ssNone (The default for TRichEdit).


TCustomRichEdit.HideSelection

TCustomRichEdit	See also	Example

Determines whether the visual indication of the selected text remains when focus shifts to another control.

property HideSelection: Boolean;

Description

Set HideSelection to False when it is important to provide visual feedback of the selected portion of the text even when the edit control does not have focus. Set HideSelection to True to make the visual indication of selection appear only when the edit control has focus. HideSelection does not affect the actual value of the selection, only the visual indication. Always setting HideSelection to False can make forms containing many edit controls look busy.


TCustomRichEdit.Lines

TCustomRichEdit	See also	Example

Contains the individual lines of text in the rich text edit control.

property Lines: TStrings;

Description

Use Lines to manipulate the text in the rich text edit control on a line by line basis. Lines is a TStrings object, so TStrings methods may be used for Lines to perform manipulations such as counting the lines of text, adding lines, deleting lines, or replacing the text in lines.

To work with the text as one chunk, use the Text property. To manipulate individual lines of text, the Lines property works better.


TCustomRichEdit.PageRect

TCustomRichEdit	See also

Specifies the dimensions, in twips, of the logical page size used when printing the contents of a rich text edit control.

property PageRect: TRect;

Description

Use PageRect to specify the logical page size used when formatting the contents of the rich edit control for printing. Specify the dimensions in twips (1/20 of a point).


TCustomRichEdit.Paragraph

TCustomRichEdit	See also	Example

Specifies the formatting information for the current paragraphs.

property Paragraph: TParaAttributes;

Description

Read Paragraph to get the TParaAttributes object used by the rich edit control to specify paragraph formatting information. Use the TParaAttributes object to read or write the paragraph formatting information for the current paragraph. Paragraph formatting information includes alignment, indentation, numbering, and tabs.

Paragraph is a read-only property, because a TCustomRichEdit object has only one TParaAttributes object, which cannot be changed. The attributes of the current paragraphs, however, can be changed, by setting the properties of the TParaAttributes object. These can be set one by one, or all can be set to the value of an existing TParaAttributes object by using Paragraph.Assign.

The current paragraphs are the paragraphs that contain the selected text. If no text is selected, the current paragraph is the one containing the cursor.

Note:	Paragraph is available only at runtime.


TCustomRichEdit.PlainText

TCustomRichEdit	See also	Example

Controls whether the rich edit control treats the text as plain text or rich text when streaming to or from a file.

property PlainText: Boolean;

Description

To write the rich text in the control to a plain text file, set PlainText to True before streaming the text to a file. To ignore the rich text information encoded in a file, set PlainText to True before streaming the text to the control. To stream in the rich text attributes encoded in a file, or save the encoding of the rich text attributes to a file, set PlainText to False.

If the rich text attributes of a file are encoded in some format other than rich text format (RTF), it is necessary to use a converter on the text, even when PlainText is True.

Note:	Rich edit controls do not directly support streaming. Use the Lines property to stream to or from a file.


TCustomRichEdit.SelAttributes

TCustomRichEdit	See also	Example

Describes the rich text characteristics of the selected text in the rich edit control.

property SelAttributes: TTextAttributes;

Description

Use SelAttributes to discover or set the font characteristics of the currently selected text. SelAttributes is a TTextAttributes object, which specifies characteristics such as font face, color, size, style, and pitch. To change a single attribute of the currently selected text, read SelAttributes, and set one of its properties. To change all of the attributes of the currently selected text, set SelAttributes to a TTextAttributes object that represents the desired configuration of attributes. If no text is selected, SelAttributes represents the attributes of the cursor position.

When inserting new text, the font characteristics of the new text will match SelAttributes.

Note:	SelAttributes is available only at runtime.


TCustomRichEdit.SelLength

TCustomRichEdit	See also	Example

Specifies the number of characters that are selected.

property SelLength: Integer;

Description

Read SelLength to determine the length, in characters, of the selected text. Set SelLength to change the selection to consist of the first SelLength characters starting at SelStart.

Note:	Setting SelLength to a value greater than the number of characters from SelStart to the end of the text results in the selection of all characters from SelStart to the end of the text. Reading SelLength immediately after setting it to a value greater than the number of available characters returns the number of characters actually selected, not the value that was just set.


TCustomRichEdit.SelStart

TCustomRichEdit	See also	Example

Specifies the position of the first selected character in the text.

property SelStart: Integer;

Description

Read SelStart to determine the position of the first selected character, where 0 indicates the first character. If there is no selected text, SelStart indicates the position of the cursor. Set SelStart to remove the current selection and position the cursor just before the indicated character.

To select a particular range of the text, first set SelStart to position the cursor, and then set SelLength to extend the selection.


TCustomRichEdit.SelText

TCustomRichEdit	See also

Denotes the selected portion of the edit control’s text.

property SelText: string;

Description

Read SelText to determine the value of the selected text. Set SelText to replace the selected text with a new string. If there is no selection, but the edit control has focus, set SelText to insert a new string into the text at the cursor.


TCustomRichEdit events

TCustomRichEdit	Alphabetically	Legend

In TCustomRichEdit

OnProtectChange

OnResizeRequest

OnSaveClipboard

OnSelectionChange


TCustomRichEdit events

TCustomRichEdit	By object	Legend

OnProtectChange

OnResizeRequest

OnSaveClipboard

OnSelectionChange


TCustomRichEdit.OnProtectChange

TCustomRichEdit	See also

Occurs when a user attempts to modify text that is marked as protected.

type TRichEditProtectChange = procedure(Sender: TObject; StartPos, EndPos: Integer; var AllowChange: Boolean) of object;

property OnProtectChange: TRichEditProtectChange;

Description

Write an OnProtectChange event handler to allow modification of text with the protected attribute. The StartPos and EndPos parameters indicate the beginning and end of the range of text that would be affected by the modification, where 0 is the first character in the text. To allow modification of protected text, set AllowChange to True.

To set or unset the protected attribute for a section of text, select the text and use the Protected property of the rich edit control’s SelAttributes property. To cause text to have the protected attribute by default, use the Protected property of the rich edit object’s DefAttributes property.


TCustomRichEdit.OnResizeRequest

TCustomRichEdit	See also 	Example

Occurs when the text has grown either smaller or larger than the control's window size.

type TRichEditResizeEvent = procedure(Sender: TObject; Rect: TRect) of object;

property OnResizeRequest: TRichEditResizeEvent;

Description

Write an OnResizeRequest event handler to respond to notifications that the edit control is trying to resize due to changes in the text. The Rect parameter gives the desired bounding rectangle that will display all the text, in screen coordinates.


TCustomRichEdit.OnSaveClipboard

TCustomRichEdit	See also

Occurs when the window of the edit control is about to be destroyed and the edit control has delayed rendering of text copied to the clipboard..

type TRichEditSaveClipboard = procedure(Sender: TObject; NumObjects, NumChars: Integer; var SaveClipboard: Boolean) of object;

property OnSaveClipboard: TRichEditSaveClipboard;

Description

Write an OnSaveClipboard event handler to respond to notifications that the window of the edit control is about to be destroyed and the Clipboard needs information from the edit control. The parameter NumObjects is the number of objects on the Clipboard, and NumChars is the number of characters on the Clipboard. To clear all information about the edit control from the Clipboard, set SaveClipboard to False.


TCustomRichEdit.OnSelectionChange

TCustomRichEdit	See also	Example

Occurs when the current selection changes.

property OnSelectionChange: TNotifyEvent;

Description

Write an OnSelectionChange event handler to respond to changes in the selected text. Changes in selection can occur when the user changes the selection using the mouse or keyboard, or when the selection is changed through the SelText property. Portions of the selection can be changed through the Lines property.


TCustomRichEdit methods

TCustomRichEdit	Alphabetically	Legend

In TCustomRichEdit

Clear

Create

CreateParams

CreateWnd

Destroy

DestroyWnd

DoSetMaxLength

FindText

GetCaretPos

GetSelLength

GetSelStart

GetSelText

GetSelTextBuf

Print

RegisterConversionFormat

RequestSize

SelectionChange

SetSelLength

SetSelStart

Derived from TCustomEdit

ClearSelection

ClearUndo

CopyToClipboard

CutToClipboard

PasteFromClipboard

SelectAll

SetSelTextBuf

Undo

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomRichEdit methods

TCustomRichEdit	By object	Legend

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClearSelection

ClearUndo

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

Create

CreateParams

CreateParented

CreateWnd

CutToClipboard

DefaultHandler

Destroy

DestroyComponents

Destroying

DestroyWnd

DisableAlign

Dispatch

DoSetMaxLength

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

FindText

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetCaretPos

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetSelLength

GetSelStart

GetSelText

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

PasteFromClipboard

Perform

Print

Realign

Refresh

RegisterConversionFormat

RemoveComponent

RemoveControl

Repaint

RequestSize

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SelectionChange

SendToBack

SetBounds

SetFocus

SetSelLength

SetSelStart

SetSelTextBuf

SetTextBuf

Show

Undo

Update

UpdateControlState


TCustomRichEdit.Clear

TCustomRichEdit	See also

Deletes all text from the rich edit control.

procedure Clear; override;

Description

Use Clear to replace the Text property with an empty string. Clear removes all text, not just the selected text. To remove just the selected text, use ClearSelection.


TCustomRichEdit.Create

TCustomRichEdit	See also

Creates an instance of TCustomRichEdit.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create an instance of TCustomRichEditat runtime. For TCustomRichEdit objects placed on forms at design time, Create is called automatically.

 Create overrides the inherited constructor to allocate helper objects that manage the rich text attributes of the text.


TCustomRichEdit.CreateParams

TCustomRichEdit	See also

Initializes a window-creation parameter record passed in the Params parameter.

procedure CreateParams(var Params: TCreateParams); override;

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle. TCustomRichEdit overrides the inherited method to specify a Windows rich edit control.


TCustomRichEdit.CreateWnd

TCustomRichEdit	See also

Creates a Windows control corresponding to the edit control.

procedure CreateWnd; override;

Description

The CreateWnd method is called when the rich edit control is created, and whenever a change to the rich edit control requires the window to be recreated. CreateWnd first calls the inherited CreateWnd, and then sends the newly created window messages to request notification of Windows events, and, if the window is being recreated, reloads the rich text from a memory stream.


TCustomRichEdit.Destroy

TCustomRichEdit	See also

Destroys an instance of TCustomRichEdit.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TCustomRichEdit reference is not nil and only then calls Destroy.

Destroy overrides the inherited method to destroy all the helper objects that were allocated to manage the rich text, before calling the inherited destructor.


TCustomRichEdit.DestroyWnd

TCustomRichEdit	See also

Destroys the rich edit control’s window.

procedure DestroyWnd; override;

Description

DestroyWnd is called automatically when the rich edit control is destroyed or when its window must be temporarily destroyed and recreated to implement a property change. Before the window is destroyed, DestroyWnd saves a copy of the control's text in a memory stream, frees any device contexts, and finally calls DestroyWindowHandle.


TCustomRichEdit.DoSetMaxLength

TCustomRichEdit	See also

Sets the MaxLength property.

procedure DoSetMaxLength(Value: Integer); override;

Description

DoSetMaxLength overrides the inherited method to implement the MaxLength property for a rich edit window. DoSetMaxLength sends an EM_EXLIMITTEXT message to the window of the rich edit control.


TCustomRichEdit.FindText

TCustomRichEdit	See also 	Example

Searches a given range in the text for a target string.

type

  TSearchType = (stWholeWord, stMatchCase);

  TSearchTypes = set of TSearchType;

function FindText(const SearchStr: string; StartPos, Length: Integer; Options: TSearchTypes): Integer;

Description

Use FindText to search a range of text in a rich edit control for the string specified by the SearchStr parameter. Only the text in the range starting at the position StartPos and continuing through the next Length positions will be searched. Use Options to specify whether the search should match whole words only and whether the search should be case sensitive.  FindText returns the position of the search string, where 0 is the position of the first character in the rich edit control (as opposed to the first position in the search range).  If the search string does not appear in the indicated range, FindText returns -1.

Use FindText rather than programmatically searching through the text of the control, to keep from being thrown off by the encoding of rich text characteristics.


TCustomRichEdit.GetCaretPos

TCustomRichEdit	See also

Returns the cursor position.

function GetCaretPos: TPoint; override;

Description

Use GetCaretPos to get the cursor position.


TCustomRichEdit.GetSelLength

TCustomRichEdit	See also

Returns the SelLength property.

function GetSelLength: Integer; override;

Description

GetSelLength overrides the inherited method to implement the SelLength property for a rich edit window. GetSelLength sends an EM_EXGETSEL message to the window of the edit control and returns the difference between the starting position and the ending position.


TCustomRichEdit.GetSelStart

TCustomRichEdit	See also

Returns the SelStart property.

function GetSelStart: Integer; override;

Description

GetSelStart overrides the inherited method to implement the SelStart property for a rich edit window. GetSelLength sends an EM_EXGETSEL message to the window of the edit control and returns the starting position.


TCustomRichEdit.GetSelText

TCustomRichEdit	See also

Returns the SelText property.

function GetSelText: string; override;

Description

GetSelText overrides the inherited method to implement the SelText property for a rich edit window. GetSelText sends an EM_GETSELTEXT message to the window of the rich edit control.


TCustomRichEdit.GetSelTextBuf

TCustomRichEdit	See also

Copies the selected text into a buffer and returns the number of characters copied.

function GetSelTextBuf(Buffer: PChar; BufSize: Integer): Integer; override;

Description

Use GetSelTextBuf to copy the selected text into a character buffer. If there is no selection, the buffer receives an empty string. If the selection contains more than (BufSize - 1) characters, only the first (BufSize - 1) characters are copied. GetSelTextBuf returns the number of characters that were actually copied into the buffer.


TCustomRichEdit.Print

TCustomRichEdit	See also	Example

Formats and prints the contents of the rich edit control.

procedure Print(const Caption: string); virtual;

Description

Use Print to print the contents of a rich edit control. The Caption parameter specifies the title that appears on the printed output.


TCustomRichEdit.RegisterConversionFormat

TCustomRichEdit	See also

Registers an association between a file extension and a TConversion object that can convert between the native file format and rich text format (RTF).

type TConversionClass = class of TConversion;

class procedure RegisterConversionFormat(const AExtension: string; AConversionClass: TConversionClass);

Description

Rich edit controls encode text attributes in RTF format. To read from or write to files that encode text attributes in some other format, a converter is required. The converter is a descendant of TConversion that translates between the native file format and RTF when the text is streamed in or out. RegisterConversionFormat sets up an association between a file extension and a converter, so that all attempts to stream between a file with that extension and a rich edit control automatically invoke the appropriate converter.

Note:	Use the Lines property to stream the text to or from a file.


TCustomRichEdit.RequestSize

TCustomRichEdit	See also

Responds to messages from Windows when the text has grown either smaller or larger than the window size.

procedure RequestSize(const Rect: TRect); virtual;

Description

RequestSize merely calls the OnResizeRequest event handler. RequestSize is exposed as a protected method so that derived classes can change the response to Windows messages about an impending window resize. When overriding RequestSize, include a call to the OnResizeRequest event handler.


TCustomRichEdit.SelectionChange

TCustomRichEdit	See also

Responds to messages from Windows that the selection has changed.

procedure SelectionChange; dynamic;

Description

SelectionChange merely calls the OnSelectionChange event handler. SelectionChange is exposed as a protected method so that derived classes can change the response to Windows messages about selection changes. When overriding SelectionChange, include a call to the OnSelectionChange event handler.


TCustomRichEdit.SetSelLength

TCustomRichEdit	See also

Sets the SelLength property.

procedure SetSelLength(Value: Integer); override;

Description

SetSelLength overrides the inherited method to implement the SelLength property for a rich edit window. SetSelLength sends an EM_EXSETSEL message to the window of the edit control, specifying a selection that begins at SelStart and ends at SelStart + Value.


TCustomRichEdit.SetSelStart

TCustomRichEdit	See also

Returns the SelStart property.

procedure SetSelStart(Value: Integer); override;

Description

SetSelStart overrides the inherited method to implement the SelStart property for a rich edit window. SetSelLength sends an EM_EXSETSEL message to the window of the edit control to position the cursor on the position indicated by Value.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMemo


TCustomTabControl

Hierarchy	Properties	Methods	Events	See also

TCustomTabControl is the base type for tab-control components such as TTabControl and TPageControl.

Unit

comctrls

Description

Use TCustomTabControl as a base class when defining a control that includes a set of notebook style tabs across the top. TCustomTabControl introduces many properties, methods, and events to manage appearance and behavior of the tabs, and to respond when the user selects one of the tabs.


TCustomTabControl properties

TCustomTabControl	Alphabetically	Legend

In TCustomTabControl

Canvas

DisplayRect

HotTrack

Images

MultiLine

MultiSelect

OwnerDraw

RaggedRight

ScrollOpposite

Style

TabHeight

TabIndex

TabPosition

Tabs

TabWidth

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomTabControl properties

TCustomTabControl	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DisplayRect

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

HotTrack

Images

Left

LRDockWidth

MultiLine

MultiSelect

Name

Owner

OwnerDraw

Parent

ParentWindow

RaggedRight

ScrollOpposite

ShowHint

Showing

Style

TabHeight

TabIndex

TabOrder

TabPosition

Tabs

TabStop

TabWidth

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TCustomTabControl.Canvas

TCustomTabControl	See also

Gives access to the tab control’s canvas.

property Canvas: TCanvas;

Description

Use Canvas to paint to the tab control’s canvas during the OnDrawTab event.


TCustomTabControl.DisplayRect

TCustomTabControl	See also

Specifies the bounding rectangle of a tab control client area.

property DisplayRect: TRect;

Description

Use DisplayRect to obtain the coordinates, in pixels, of the portion of the tab control that represents the contents of the tab pages. The appearance of this portion of the tab control does not change when different tabs are selected.

Use DisplayRect rather than the ClientRect property to determine the portion of the tab control that can contain other objects.


TCustomTabControl.HotTrack

TCustomTabControl	See also

Determines whether labels on the tab under the mouse are automatically highlighted.

property HotTrack: Boolean;

Description

Set HotTrack to True to provide visual feedback to the user about which tab would be selected if the mouse button is clicked. HotTrack is especially useful when the tab control contains multiple rows of tabs.


TCustomTabControl.Images

TCustomTabControl	See also

Specifies the images that are drawn in the tabs.

property Images: TCustomImageList;

Description

Use Images to specify the images that are drawn in the tabs.

The image index corresponds to the tab in which the image is displayed.

To customize which image is displayed in which tab, override the OnGetImageIndex event in a derived class.


TCustomTabControl.MultiLine

TCustomTabControl	See also	Example

Determines whether the tabs can appear on more than one row.

property MultiLine: Boolean;

Description

Use MultiLine to determine how the tabs are displayed. If MultiLine is True, the tabs are displayed on more than one row when the number of tabs exceeds the number that fits across the top of the tab control. How many rows is determined by how many tabs are in the tab control. If MultiLine is False, the tabs are displayed on one row only, and the user must scroll the displayed scroll arrows to view all the tabs.


TCustomTabControl.MultiSelect

TCustomTabControl	See also	Example

Specifies whether multiple tabs can be selected.

property MultiSelect: Boolean;

Description

Use MultiSelect to get or set whether multiple tabs can be selected.

MultiSelect can only be True if Style is tsFlatButtons or tsButtons.


TCustomTabControl.OwnerDraw

TCustomTabControl	See also

Specifies whether the tab control handles its own painting.

property OwnerDraw: Boolean;

Description

Set OwnerDraw to True to override any default painting behavior.


TCustomTabControl.RaggedRight

TCustomTabControl

Specifies whether rows of tabs stretch to fill the width of the control.

property RaggedRight: Boolean;

Description

Use RaggedRight to get or set whether rows of tabs stretch to fill the width of the control.


TCustomTabControl.ScrollOpposite

TCustomTabControl	See also

Determines how the rows of tabs are scrolled in a muliline tab control.

property ScrollOpposite: Boolean;

Description

Set ScrollOpposite to determine where previous rows of tabs in a multi-line tab control move when the user selects a tab in another row. When ScrollOpposite is True, previous rows of tabs are moved to the bottom of the tab control if TabPosition is tpTop, or to the top if TabPosition is tpBottom. When ScrollOpposite is False, previous rows of tabs are moved to the back of all other rows of tabs.

For example, in a tab control with three rows of tabs at the top, if the user selects a tab in the second row, ScrollOpposite determines where the first row moves. If ScrollOpposite is True, the second row now appears at the front (bottom) row on top of the tab control, followed by the third row behind (above) it. The first row moves to the bottom of the tab control. If ScrollOpposite is False, the first row moves to the back (top), so that the tab control displays the second row in front (at the bottom of the tab region), followed by the third row (now in the middle), followed by the first row.

Note:	Setting ScrollOpposite to True automatically sets the MultiLine property to True.


TCustomTabControl.Style

TCustomTabControl

Specifies the style of the tab control.

property Style: TTabStyle;

Description

Use Style to determine the appearance of the tabs. These can appear as notebook tabs or as buttons.


TCustomTabControl.TabHeight

TCustomTabControl	See also	Example

Specifies the height, in pixels, of the tabs in the tab control.

property TabHeight: Smallint;

Description

Set TabHeight to control the height of the tabs that appear above the client region of the tab control. The TabHeight property is the vertical size in pixels of the individual tabs. If TabHeight is set to 0, the tabs automatically size themselves to fit their text.


TCustomTabControl.TabIndex

TCustomTabControl	See also	Example

Identifies the selected tab on a tab control.

property TabIndex: Integer;

Description

Read TabIndex to determine which tab was selected by the user. TabIndex is the index of the tab in the list of labels maintained by the Tabs property. The first (leftmost) tab has a TabIndex of 0, the next has 1, and so on. If no tabs are selected, TabIndex has a value of -1.

Set TabIndex to programmatically change the selected tab in the tab control.


TCustomTabControl.TabPosition

TCustomTabControl	See also

Determines whether tabs appear at the top or bottom.

type TTabPosition = (tpTop, tpBottom, tpLeft, tpRight);

property TabPosition: TTabPosition;

Description

Set TabPosition to tpTop to display the tabs at the top of the tab control. Set TabPosition to tpBottom to display the tabs at the bottom. If the ScrollOpposite property is True, tabs can appear at both top and bottom, with the row containing the current tab and all subsequent rows on the side indicated by TabPosition.

Due to a limitation in the windows common control, if TabPosition is tpLeft or tpRight, Font must be a True Type font. Otherwise, tab text may paint incorrectly.


TCustomTabControl.Tabs

TCustomTabControl	See also	Example

Contains the list of text strings that label the tabs of the tab control.

property Tabs: TStrings;

Description

Use Tabs to access the labels of the tabs in the tab control, or any objects associated with those tabs using the Objects property of the Tabs object. Add new strings to the Tabs property to add new tabs to the tab control. Rearrange the Tabs list to rearrange the tabs in the tab control.


TCustomTabControl.TabWidth

TCustomTabControl	See also	Example

Specifies the horizontal size, in pixels, of the tabs in the tab control.

property TabWidth: Smallint;

Description

Set TabWidth to control the width of the tabs that appear above the client region of the tab control. The TabWidth property is the horizontal size in pixels of the individual tabs. If TabWidth is set to 0, the tabs automatically size themselves to fit their text.


TCustomTabControl events

TCustomTabControl	Alphabetically	Legend

In TCustomTabControl

OnChange

OnChanging

OnDrawTab

OnGetImageIndex


TCustomTabControl events

TCustomTabControl	By object	Legend

OnChange

OnChanging

OnDrawTab

OnGetImageIndex


TCustomTabControl.OnChange

TCustomTabControl	See also	Example

Occurs after a new tab is selected.

property OnChange: TNotifyEvent;

Description

Write an OnChange event handler to take specific action immediately after the selected tab changes. Use the TabIndex property to determine which tab is now selected. This is the opportunity to make any changes to the control that reflect the new state implied by the selected tag.

Before the value of TabIndex changes, an OnChanging event occurs.


TCustomTabControl.OnChanging

TCustomTabControl	See also	Example

Occurs immediately before a new tab is selected.

type TTabChangingEvent = procedure (Sender: TObject; var AllowChange: Boolean) of object;

property OnChanging: TTabChangingEvent;

Description

Write an OnChanging event handler to take specific action immediately before the selected tab changes. Set the AllowChange parameter to False to prevent the change.

Use an OnChanging event handler to prevent the user from leaving a tab setting until certain conditions have been met. An OnChanging event handler can also be used to save information about the current state of the tab control before it is changed by a new tab selection.


TCustomTabControl.OnDrawTab

TCustomTabControl	See also

Occurs when a tab is about to be drawn.

property OnDrawTab: TDrawTabEvent;

Description

Use OnDrawTab to customize the painting of tabs.

You can paint the tab using the Canvas property.


TCustomTabControl.OnGetImageIndex

TCustomTabControl	See also

Occurs when a tab is about to display its associated image.

property OnGetImageIndex: TTabGetImageEvent;

Description

Override GetImageIndex in a derived class to specify the default ImageIndex for a given TabIndex.

By default, GetImageIndex returns TabIndex. Therefore, the tab at index 0 will be associated with an image index of 0, the tab at index 1 will be associated with an image index of 1, and so on.

Return -1 to specify no image for the tab.

The images are specified in the Images property.


TCustomTabControl methods

TCustomTabControl	Alphabetically	Legend

In TCustomTabControl

AdjustClientRect

CanChange

CanShowTab

Change

Create

CreateParams

CreateWnd

Destroy

DrawTab

GetHitTestInfoAt

GetImageIndex

IndexOfTabAt

Loaded

Notification

RowCount

ScrollTabs

TabRect

UpdateTabImages

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomTabControl methods

TCustomTabControl	By object	Legend

AdjustClientRect

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanChange

CanFocus

CanShowTab

Change

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParams

CreateParented

CreateParentedControl

CreateWnd

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTab

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetHitTestInfoAt

GetImageIndex

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

IndexOfTabAt

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

Loaded

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

Notification

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

RowCount

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

ScrollTabs

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TabRect

Update

UpdateAction

UpdateControlState

UpdateTabImages

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TCustomTabControl.AdjustClientRect

TCustomTabControl	See also

Calculates the control’s display area given a rectangle.

procedure AdjustClientRect(var Rect: TRect); override;

Description

AdjustClientRect is called internally when the tab control needs accurate information on where to place child controls within the client area. As implemented in TCustomTabControl, returns the DisplayRect property as the Rect parameter.


TCustomTabControl.CanChange

TCustomTabControl	See also

Determines whether the selected tab can be changed.

function CanChange: Boolean;

Description

CanChange is called automatically when an attempt is made to change the selected tab. CanChange generates an OnChanging event so that an OnChanging event handler can prevent the selection from changing. If there is no OnChanging event handler, CanChange returns True, allowing the change.

Override CanChange to specify additional processing before the OnChanging event handler executes or to block the OnChanging event.


TCustomTabControl.CanShowTab

TCustomTabControl	See also

Indicates whether the tab can be selected.

function CanShowTab(TabIndex: Integer): Boolean;

Description

Call CanShowTab to determine whether a tab can be selected or accessed. CanShowTab is exposed as a protected method so that descendants can override this method to provide application-specific criteria that determines whether a tab is accessible.

TabIndex is the index of the tab in the list of labels maintained by the Tabs property.

CanShowTab returns a Boolean value that indicates whether the tab specified in TabIndex can be accessed.

Tip:	CanShowTab can be used with such methods as TWinControl.CanFocus, to determine whether the tab can both be accessed and can receive focus. Criteria for an overridden CanShowTab might include checking whether the tab is enabled.


TCustomTabControl.Change

TCustomTabControl	See also

Generates an OnChange event.

procedure Change;

Description

Change is called automatically when the selected tab changes. Override Change to specify additional processing before the OnChange event handler executes, or to block the OnChange event.


TCustomTabControl.Create

TCustomTabControl	See also

Creates and initializes an instance of TCustomTabControl.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a tab control at runtime. Tab controls placed on forms at design time are created automatically. Create calls the inherited Create method and sets the initial values for the tab control, including the creation of a tab list that contains the text strings for the tabs.


TCustomTabControl.CreateParams

TCustomTabControl	See also

Sets up the window-creation parameters for the tab control.

procedure CreateParams(var Params: TCreateParams); override;

Description

Tab controls call CreateParams internally when the window for the tab control must be generated. CreateParams overrides the inherited method to specify a tab control window with the current property settings.


TCustomTabControl.CreateWnd

TCustomTabControl	See also

Creates the window for a tab control.

procedure CreateWnd; override;

Description

CreateWnd is called automatically when the tab control’s window is recreated. CreateWnd calls the inherited CreateWnd method, before assigning any saved tab text strings in internal storage.


TCustomTabControl.Destroy

TCustomTabControl	See also

Destroys an instance of TCustomTabControl.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, use Free. Free checks that the tab control is not nil, and only then calls Destroy. Destroy frees the tab list that holds the list of text strings for the tabs and calls the inherited destructor.


TCustomTabControl.DrawTab

TCustomTabControl	See also

Draws a tab.

procedure DrawTab(TabIndex: Integer; const Rect: TRect; Active: Boolean); virtual;

Description

Override DrawTab in a derived class to control the painting of tabs.

TabIndex is the index of the tab that requires painting.

Rect is the area in which the tab should be painted.

Active is whether the tab is active.

Use the Canvas property to paint the tab.


TCustomTabControl.GetHitTestInfoAt

TCustomTabControl	See also

Returns information about the location of a point relative to the client area of the tab control.

function GetHitTestInfoAt(X, Y: Integer): THitTests;

Description

Call GetHitTestInfoAt to determine what portion of the tab control, if any, sits under the point specified by the X and Y parameters.

GetHitTestInfo returns a THitTests type. This set describes the possible elements under the mouse. When interpreting these values, each tab can be considered an “item” of the tab control.


TCustomTabControl.GetImageIndex

TCustomTabControl	See also

Generates an OnGetImageIndex event

function GetImageIndex(TabIndex: Integer): Integer; virtual;

Description

Override GetImageIndex in a derived class to specify the index of the image to display for a particular tab.

TabIndex is the index of the tab that is about to be displayed.

Integer is the index of the image in the Images property that will be displayed in the tab.


TCustomTabControl.IndexOfTabAt

TCustomTabControl	See also

Indicates the index of the tab at a specified point.

function IndexOfTabAt(X, Y: Integer): Integer;

Description

Use IndexOfTabAt to locate which tab is at the point specified by X and Y. If the point with X-coordinate X and Y-coordinate Y is over a tab, IndexOfTabAt returns the 0-offset index of that tab in the Tabs property (TTabControl) or in the Pages property (TPageControl). If the point defined by X and Y is not over a tab, IndexOfTabAt returns –1.


TCustomTabControl.Loaded

TCustomTabControl	See also

Overrides the inherited Loaded method.

procedure Loaded; override;

Description

Loaded updates the tab images once the form is fully loaded into memory.


TCustomTabControl.Notification

TCustomTabControl	See also

Responds to notifications when objects are created or destroyed.

procedure Notification(AComponent: TComponent; Operation: TOperation); override;

Description

Notification checks whether the notification indicates that the component that implements the Images property is about to be destroyed, and if so, sets that property to nil.


TCustomTabControl.RowCount

TCustomTabControl	See also

Returns the number of rows in a multiline tab control.

function RowCount: Integer;

Description

Use RowCount to determine the number of rows of tabs in the tabbed control. RowCount always returns 1 if the MultiLine property is False.


TCustomTabControl.ScrollTabs

TCustomTabControl	See also

Scrolls the tabs that are visible when the tab control is not multi-line.

procedure ScrollTabs(Delta: Integer);

Description

Call ScrollTabs to change the tabs that are visible in the tab control. When Delta is positive, Delta additional tabs to the right are scrolled into view. When Delta is negative, the tabs to the left are scrolled into view, with the absolute value of Delta indicating how many tabs are scrolled. If there are fewer than the absolute value of Delta tabs in the indicated direction, ScrollTabs scrolls as far as possible.

ScrollTabs has no effect if there are no scrolled tabs, either because the control is wide enough to display all tabs or because the MultiLine property is True.

Note:	ScrollTabs scrolls the visible tabs. It does not change the current selection. Calling ScrollTabs may scroll the selected tab out of view.


TCustomTabControl.TabRect

TCustomTabControl	See also

Returns the bounding rectangle for a specified tab.

function TabRect(Index: Integer): TRect;

Description

Use TabRect to determine the current position of the tab with the specified index. Index is the  0-offset index of a tab in the Tabs property (TTabControl) or in the Pages property (TPageControl). TabRect returns the bounding rectangle (in client coordinates) of the specified tab.


TCustomTabControl.UpdateTabImages

TCustomTabControl	See also

Updates the tab images.

procedure UpdateTabImages;

Description

UpdateTabImages is called automatically to update the tab images after streaming in the control.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomTreeView

Hierarchy	Properties	Methods	Events	See also

TCustomTreeView is the base type for tree-view components such as TTreeView.

Unit

comctrls

Description

Use TCustomTreeView as a base class when defining components that present information in a hierarchical structure with nodes that can be expanded or collapsed. Most of the properties defined in TCustomTreeView are protected so that you can choose whether to publish them in your own tree view components.

Do not create instances of TCustomTreeView. To add a tree view control to a form, use TTreeView.


TCustomTreeView properties

TCustomTreeView	Alphabetically	Legend

In TCustomTreeView

AutoExpand

BorderStyle

Canvas

ChangeDelay

DragMode

DropTarget

HideSelection

HotTrack

Images

Indent

Items

ReadOnly

RightClickSelect

RowSelect

Selected

ShowButtons

ShowLines

ShowRoot

SortType

StateImages

ToolTips

TopItem

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomTreeView properties

TCustomTreeView	By object	Legend

Action

Align

Anchors

AutoExpand

BiDiMode

BorderStyle

BoundsRect

Brush

Canvas

ChangeDelay

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragMode

DropTarget

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

HideSelection

Hint

HostDockSite

HotTrack

Images

Indent

Items

Left

LRDockWidth

Name

Owner

Parent

ParentWindow

ReadOnly

RightClickSelect

RowSelect

Selected

ShowButtons

ShowHint

Showing

ShowLines

ShowRoot

SortType

StateImages

TabOrder

TabStop

Tag

TBDockHeight

ToolTips

Top

TopItem

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TCustomTreeView.AutoExpand

TCustomTreeView	See also

Specifies whether the nodes in the tree view automatically expand and collapse depending on the selection.

property AutoExpand: Boolean;

Description

Set AutoExpand to True to cause the selected item to expand and the unselected items to collapse.


TCustomTreeView.BorderStyle

TCustomTreeView	See also

Determines whether the tree view control has a border.

property BorderStyle: TBorderStyleTBorderStyle;

Description

Set BorderStyle to specify whether the tree view control should be outlined with a single-line border. These are the possible values:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border


TCustomTreeView.Canvas

TCustomTreeView	See also	Example

Provides access to the canvas.

property Canvas: TCanvas;

Description

Use the Canvas property to paint to the canvas from the OnCustomDraw and OnCustomDrawItem event handlers.


TCustomTreeView.ChangeDelay

TCustomTreeView	See also

Specifies the delay between when a node is selected and when the OnChange event occurs.

property ChangeDelay: Integer;

Description

Use ChangeDelay to get or set the delay, in milliseconds, between when a node is selected and when the OnChange event occurs.

Set the ChangeDelay to 50 milliseconds to emulate the behavior of the tree-view control used in Windows Explorer.


TCustomTreeView.DragMode

TCustomTreeView	See also

Determines whether drag-and-drop (or drag-and-dock) operations occur automatically.

property DragMode: TDragMode;

Description

Use the DragMode property to control when the user is able to drag the items in the tree view. When DragMode is dmAutomatic, a drag-and-drop operation begins automatically when the user drags on a treeview item. Disable this drag-and-drop capability at runtime by setting the DragMode property value to dmManual.

Note:	When DragKind is dkDock, the automatic drag-and-dock operation applies to the treeview as a whole, not to individual items.


TCustomTreeView.DropTarget

TCustomTreeView	See also

Specifies which item in the tree view appears as the target of a drag and drop operation.

property DropTarget: TTreeNode;

Description

Read DropTarget to determine whether a node in the tree view is drawn as the target of a drag and drop operation. Set DropTarget when specifying a particular node in the tree view as the drop target of a dragged item.

Note:	When DropTarget is set, the application must still handle the actual logic of accepting the dragged object by the indicated node.


TCustomTreeView.HideSelection

TCustomTreeView	See also

Determines whether a selected node appears selected when the focus shifts to another control.

property HideSelection: Boolean;

Description

Use HideSelection to specify whether the user is given visual feedback about the current selection in the tree view when it does not have focus. If True, the selected node is not visually distinct from other nodes until focus returns to the control. If False, the node always appears selected.


TCustomTreeView.HotTrack

TCustomTreeView	See also

Specifies whether list items are highlighted when the mouse passes over them.

property HotTrack: Boolean;

Description

Set HotTrack to True to provide visual feedback about which item is under the mouse. Set HotTrack to False to suppress the visual feedback about which item is under the mouse.


TCustomTreeView.Images

TCustomTreeView	See also

Determines which image list is associated with the tree view.

property Images: TCustomImageList;

Description

Use Images to provide a customized list of bitmaps that can be displayed to the left of a node’s label. Individual nodes specify the image from this list that should appear by setting their ImageIndex property.


TCustomTreeView.Indent

TCustomTreeView	See also	Example

Specifies the amount of indentation in pixels when a list of child nodes is expanded.

property Indent: Integer;

Description

Use Indent to determine how far child nodes are indented from their parent nodes when the parent is expanded.


TCustomTreeView.Items

TCustomTreeView	See also 	Example

Lists the individual nodes that appear in the tree view control.

property Items: TTreeNodes;

Description

Individual nodes in a tree view are TTreeNode objects. These individual nodes can be accessed by using the Items property along with the item's index into the tree view. For example, to access the second item in the tree view, you could use the following code.

MyTreeNode := TreeView1.Items[1];

When setting this property at design-time in the Object Inspector the TreeView Items Editor appears. Use the New Item and New SubItem buttons to add items to the tree view. Use the Text property to modify what text is displayed in the label of the item.

At run-time nodes can be added and inserted by using the TTreeNodes methods AddChildFirst, AddChild, AddChildObjectFirst, AddChildObject, AddFirst, Add, AddObjectFirst, AddObject and Insert.

Note:	Accessing tree view items by index can be time-intensive, particularly when the tree view contains many items. For optimal performance, try to design your application so that it has as few dependencies on the tree view’s item index as possible.


TCustomTreeView.ReadOnly

TCustomTreeView	See also

Determines whether the user can edit the node labels.

property ReadOnly: Boolean;

Description

Use ReadOnly to specify whether the user can edit the nodes of the tree view. If ReadOnly is True, the user can expand and collapse nodes, but can’t edit their labels. If ReadOnly is False, the user can edit the labels as well. The default value is False.


TCustomTreeView.RightClickSelect

TCustomTreeView	See also

Determines whether the Selected property returns nodes that are selected using the right mouse button.

property RightClickSelect: Boolean;

Description

Use RightClickSelect to allow the Selected property to indicate nodes the user clicks with the right mouse button.  If RightClickSelect is True, the value of Selected is the value of the node last clicked with either the right or left mouse button.  If RightClickSelect is False, the value of Selected is the node last clicked using the left mouse button.

RightClickSelect affects only the value of the Selected property.  It does not cause the tree view to highlight a new node if the node is selected using the right mouse button.

Note:	RightClickSelect must be set to True before the user right-clicks the tree view for it to affect the value of the Selected property.


TCustomTreeView.RowSelect

TCustomTreeView	See also

Specifies whether the entire row of the selected item is highlighted.

property RowSelect: Boolean;

Description

Set RowSelect to True to cause the entire row of the selected item to be highlighted.

RowSelect is ignored if ShowLines is True.


TCustomTreeView.Selected

TCustomTreeView	See also 	Example

Specifies the selected node in the tree view.

property Selected: TTreeNode;

Description

Read Selected to access the selected node of the tree view. If there is no selected node, the value of Selected is nil.

Set Selected to set a node in the tree view. When a node becomes selected, the tree view's OnChanging and OnChanged events occur. Also, if the specified node is the child of a collapsed parent item, the parent's list of child items is expanded to reveal the specified node. In this case, the tree views OnExpanded and OnExpanding events occur as well.

Note:	If the RightClickSelect property is True, the value of Selected is the last node that was clicked in the tree view, even if it was clicked with the right mouse button.  This may differ from the node that is highlighted to indicate selection.


TCustomTreeView.ShowButtons

TCustomTreeView	See also

Specifies whether to display plus (+) and minus (-) buttons to the left side of each parent item.

property ShowButtons: Boolean;

Description

If ShowButtons is True, a button will appear to the left of each parent item. The user can click the button to expand or collapse the child items as an alternative to double-clicking the parent item.


TCustomTreeView.ShowLines

TCustomTreeView	See also

Specifies whether to display the lines that link child nodes to their corresponding parent nodes.

property ShowLines: Boolean;

Description

If ShowLines is True, lines linking child nodes to their parent nodes are displayed. Nodes at the root of the hierarchy are not automatically linked. To link nodes at the root, the ShowRoot property must also be set to True.


TCustomTreeView.ShowRoot

TCustomTreeView	See also

Specifies whether lines connecting top-level nodes are displayed.

property ShowRoot: Boolean;

Description

To show lines connecting top-level nodes to a single root, set the tree view's ShowRoot and ShowLines properties to True.


TCustomTreeView.SortType

TCustomTreeView	See also

Determines if and how the nodes in a tree view are automatically sorted.

type TSortType = (stNone, stData, stText, stBoth);

property SortType: TSortType;

Description

Once a tree view is sorted, the original hierarchy is lost. That is, setting the SortType back to stNone will not restore the original order of items. These are the possible values:

Value	Meaning

stNone	No sorting is done.

stData	The items are sorted when the Data object or SortType is changed.

stText	The items are sorted when the Caption or SortType is changed.

stBoth	The items are sorted when either the Data object, the Caption or SortType is changed

Optionally, the OnCompare event can be hooked to handle comparisons. The OnCompare event will be called to compare two nodes for sorting.


TCustomTreeView.StateImages

TCustomTreeView	See also

Determines which image list to use for state images.

property StateImages: TCustomImageList;

Description

Use StateImages to provide a set of bitmaps that reflect the state of tree view nodes. The state image appears as an additional image to the left of the item's icon.


TCustomTreeView.ToolTips

TCustomTreeView	See also

Specifies whether the items in the tree view have tooltips.

property ToolTips: Boolean;

Description

Set ToolTips to True to specify that items in the tree view control have tooltips (Help Hints).

Specify the ToolTip text in an OnHint event handler using the Hint property.


TCustomTreeView.TopItem

TCustomTreeView	See also

Specifies the topmost node that appears in the tree view.

property TopItem: TTreeNode;

Description

When TopItem is changed, the tree view scrolls vertically so that the specified node is topmost in the list view.


TCustomTreeView events

TCustomTreeView	Alphabetically	Legend

In TCustomTreeView

OnAdvancedCustomDraw

OnAdvancedCustomDrawItem

OnChange

OnChanging

OnCollapsed

OnCollapsing

OnCompare

OnCustomDraw

OnCustomDrawItem

OnDeletion

OnEdited

OnEditing

OnExpanded

OnExpanding

OnGetImageIndex

OnGetSelectedIndex


TCustomTreeView events

TCustomTreeView	By object	Legend

OnAdvancedCustomDraw

OnAdvancedCustomDrawItem

OnChange

OnChanging

OnCollapsed

OnCollapsing

OnCompare

OnCustomDraw

OnCustomDrawItem

OnDeletion

OnEdited

OnEditing

OnExpanded

OnExpanding

OnGetImageIndex

OnGetSelectedIndex


TCustomTreeView.OnAdvancedCustomDraw

TCustomTreeView	See also

Occurs at discrete stages during the painting of the tree view control.

property OnAdvancedCustomDraw: TTVAdvancedCustomDrawEvent;

Description

Write an OnAdvancedCustomDraw event handler to paint an owner-drawn tree view. Use the Canvas property as a drawing surface when painting the image of the tree view.

To paint individual items, use the OnAdvancedCustomDrawItem or OnCustomDrawItem event instead.

Note:	OnAdvancedCustomDraw occurs at several stages during the paint process, not just immediately prior to the default rendering. If you only need to use the cdPrePaint stage, it is more efficient to use the OnCustomDraw event.


TCustomTreeView.OnAdvancedCustomDrawItem

TCustomTreeView	See also

Occurs at discrete stages during the painting of tree view nodes.

property OnCustomDrawItem: TTVCustomDrawItemEvent;

Description

Write an OnAdvancedCustomDrawItem event handler to customize the painting of individual items in the tree view.

Note:	OnAdvancedCustomDrawItem occurs at several stages during the paint process and allows you to suppress the default painting of tree node images while still allowing the default painting of the node. If you only need to use the cdPrePaint stage and do not want to suppress only the painting of tree node images, it is more efficient to use the OnCustomDrawItem event.


TCustomTreeView.OnChange

TCustomTreeView	See also

Occurs whenever the selection has changed from one node to another.

type TTVChangedEvent = procedure(Sender: TObject; Node: TTreeNode) of object;

property OnChange: TTVChangedEvent;

Description

Write an OnChange event handler to take specific action when the selected node changes. The Sender parameter is the tree view whose selected node changes, and the Node parameter is the newly selected node.

Note:	The OnChange event does not occur for nodes selected using the right mouse button when RightClickSelect is True.  To respond to changes in the value of the Selected property when RightClickSelect is True, use the OnMouseUp event.


TCustomTreeView.OnChanging

TCustomTreeView	See also

Occurs when the selection is about to change from one node to another.

type TTVChangingEvent = procedure(Sender: TObject; Node: TTreeNode; var AllowChange: Boolean) of object;

property OnChanging: TTVChangingEvent;

Description

Write an OnChanging event handler to selectively prevent selection from moving to specific nodes.

The TTVChangingEvent type points to a method that is called when the selection is about to be changed from one node to another. Set AllowChange to False, to prevent selection from moving to a new node. The Node parameter specifies the node that is about to be selected.


TCustomTreeView.OnCollapsed

TCustomTreeView	See also

Occurs after a node has been collapsed.

property OnCollapsed: TTVExpandedEvent;

Description

Write an OnCollapsed event handler to respond after a node in the tree view collapses. The Node parameter is the node whose children are no longer visible.


TCustomTreeView.OnCollapsing

TCustomTreeView	See also

Occurs when a node is about to be collapsed.

type TTVCollapsingEvent = procedure(Sender: TObject; Node: TTreeNode; var AllowCollapse: Boolean) of object;

property OnCollapsing: TTVCollapsingEvent;

Description

The TTVCollapsingEvent type points to a method that is called when a node is about to be collapsed. Set the AllowCollapse parameter to False to prevent the node specified by the Node parameter from being collapsed.


TCustomTreeView.OnCompare

TCustomTreeView	See also

Occurs when two nodes must be compared during a sort of the nodes in the tree view.

type TTVCompareEvent = procedure(Sender: TObject; Node1, Node2: TTreeNode; Data: Integer; var Compare: Integer) of object;

property OnCompare: TTVCompareEvent;

Description

Write an OnCompare event handler to customize the sort order of the nodes in the tree view. Set the Compare parameter to a value less than 0 if Node1 is less than Node2. Set Compare to 0 if Node1 is equivalent to Node2, and set Compare to a value greater than 0 if Node1 is greater than Node2. If an OnCompare event handler is not provided, tree view nodes are sorted alphabetically, based on their labels.


TCustomTreeView.OnDeletion

TCustomTreeView	See also

Occurs when a node in the tree view is deleted.

property OnDeletion: TTVExpandedEvent;

Description

Write an OnDeletion event handler to respond when a node is deleted from the tree view control.


TCustomTreeView.OnCustomDraw

TCustomTreeView	See also	Example

Occurs immediately prior to painting the tree view control.

property OnCustomDraw: TTVCustomDrawEvent;

Description

Write an OnCustomDraw event handler to paint an owner-drawn tree view. Use the Canvas property as a drawing surface when painting the image of the tree view.

To paint individual items, use the OnCustomDrawItem event instead.

Note:	OnCustomDraw only occurs prior to painting the tree view control. To customize the painting at other stages of the paint process (such as after the default drawing), use OnAdvancedCustomDraw instead.


TCustomTreeView.OnCustomDrawItem

TCustomTreeView	See also	Example

Occurs immediately prior to painting a node in a tree view control.

property OnCustomDrawItem: TTVCustomDrawItemEvent;

Description

Write an OnCustomDrawItem event handler to paint individual items in the tree view, or to provide a background to the item before the default rendering of the item.

Note:	OnCustomDrawItem only occurs prior to painting individual tree items. To customize the painting of items at other stages of the paint process (such as after the item is painted), use OnAdvancedCustomDrawItem instead.


TCustomTreeView.OnEdited

TCustomTreeView	See also

Occurs after the user edits the Text property of a node.

type TTVEditedEvent = procedure(Sender: TObject; Node: TTreeNode; var S: string) of object;

property OnEdited: TTVEditedEvent;

Description

Write an OnEdited event handler to respond to changes the user makes to the node labels. The Node parameter is the node whose label was edited. The S parameter is the new value of the node’s Text property. The node’s label can be changed in an OnEdited event handler before the user’s edits are committed. This event can occur only if ReadOnly is set to False.


TCustomTreeView.OnEditing

TCustomTreeView	See also

Occurs when the user starts to edit the Text property of a node.

type TTVEditingEvent = procedure(Sender: TObject; Node: TTreeNode; var AllowEdit: Boolean) of object;

property OnEditing: TTVEditingEvent;

Description

Write an OnEditing event handler to determine whether the user is allowed to edit the label of a specific node in the tree view. Set the AllowEdit parameter to False to prevent the user from editing the node specified by the Node parameter. To disallow editing of all nodes in the tree view, use the ReadOnly property instead.


TCustomTreeView.OnExpanded

TCustomTreeView	See also

Occurs after a node is expanded.

property OnExpanded: TTVExpandedEvent;

Description

Write an OnExpanded event handler to respond when a node in the tree view is expanded. The Node parameter specifies the node whose children are now displayed to the user.


TCustomTreeView.OnExpanding

TCustomTreeView	See also

Occurs when a node is about to be expanded.

type TTVExpandingEvent = procedure(Sender: TObject; Node: TTreeNode; var AllowExpansion: Boolean) of object;

property OnExpanding: TTVExpandingEvent;

Description

Write an OnExpanding event handler to determine whether a node can be expanded. Set the AllowExpansion parameter to False to prevent the node from expanding.


TCustomTreeView.OnGetImageIndex

TCustomTreeView	See also

Occurs when the tree view looks up the ImageIndex of a node.

property OnGetImageIndex: TTVExpandedEvent;

Description

Write an OnGetImageIndex event handler to change the image index for the particular node before it is drawn. For example, the bitmap of a node can be changed to indicate a different state for the node.


TCustomTreeView.OnGetSelectedIndex

TCustomTreeView	See also

Occurs when the tree view looks up the SelectedIndex of a node.

property OnGetSelectedIndex: TTVExpandedEvent;

Description

Write an OnGetSelectedIndex event handler to change the selected image index of a node before it is drawn.


TCustomTreeView methods

TCustomTreeView	Alphabetically	Legend

In TCustomTreeView

AlphaSort

CanChange

CanCollapse

CanEdit

CanExpand

Change

Collapse

Create

CreateNode

CreateParams

CreateWnd

CustomDraw

CustomDrawItem

CustomSort

Delete

Destroy

DestroyWnd

Edit

Expand

FullCollapse

FullExpand

GetDragImages

GetHitTestInfoAt

GetImageIndex

GetNodeAt

GetSelectedIndex

IsCustomDrawn

IsEditing

Loaded

LoadFromFile

LoadFromStream

SaveToFile

SaveToStream

WndProc

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetDragMode

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DoEndDrag

DoStartDrag

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomTreeView methods

TCustomTreeView	By object	Legend

AfterConstruction

AlphaSort

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanChange

CanCollapse

CanEdit

CanExpand

CanFocus

Change

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

Collapse

ContainsControl

ControlAtPos

Create

CreateNode

CreateParams

CreateParented

CreateParentedControl

CreateWnd

CustomDraw

CustomDrawItem

CustomSort

DefaultHandler

Delete

Destroy

DestroyComponents

Destroying

DestroyWnd

DisableAlign

Dispatch

Dock

DockDrop

DoEndDrag

DoStartDrag

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

Edit

EnableAlign

EndDrag

ExecuteAction

Expand

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

FullCollapse

FullExpand

GetControlsAlignment

GetDragImages

GetHitTestInfoAt

GetImageIndex

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetNodeAt

GetParentComponent

GetSelectedIndex

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsCustomDrawn

IsEditing

IsRightToLeft

Loaded

LoadFromFile

LoadFromStream

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

SaveToFile

SaveToStream

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetDragMode

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

WndProc


TCustomTreeView.AlphaSort

TCustomTreeView	See also

Sorts all nodes alphabetically by label in the tree view control.

function AlphaSort: Boolean;

Description

Call AlphaSort to sort the nodes of the tree view. If successful, AlphaSort returns True. To have the tree view maintain all nodes in a sorted order (for example, when the user edits the labels), use the SortType property.


TCustomTreeView.CanChange

TCustomTreeView	See also

Generates an OnChanging event.

function CanChange(Node: TTreeNode): Boolean; dynamic;

Description

CanChange is called automatically whenever an attempt is made to change the selected node. The Node parameter indicates the currently selected node. CanChange returns True if selection can move away from the specified node, False otherwise.

If there is no OnChanging event handler, CanChange returns True.

Override this method to make additional, class-specific responses in addition to the OnChanging event or to suppress the OnChanging event.


TCustomTreeView.CanCollapse

TCustomTreeView	See also

Generates an OnCollapsing event.

function CanCollapse(Node: TTreeNode): Boolean; dynamic;

Description

CanCollapse is called automatically whenever an attempt is made to collapse the node specified by the Node parameter. CanCollapse returns True if node can be collapsed, False otherwise.

If there is no OnCollapsing event handler, CanCollapse returns True.

Override this method to make additional, class-specific responses in addition to the OnCollapsing event or to suppress the OnCollapsing event.


TCustomTreeView.CanEdit

TCustomTreeView	See also

Generates an OnEditing event.

function CanEdit(Node: TTreeNode): Boolean; dynamic;

Description

CanEdit is called automatically whenever an attempt is made to edit the node specified by the Node parameter. CanEdit returns True if the user can edit the specified node, False otherwise.

If there is no OnEditing event handler, CanEdit returns True.

Override this method to make additional, class-specific responses in addition to the OnEditing event or to suppress the OnEditing event.


TCustomTreeView.CanExpand

TCustomTreeView	See also

Generates an OnExpanding event.

function CanExpand(Node: TTreeNode): Boolean; dynamic;

Description

CanExpand is called automatically whenever an attempt is made to expand the node specified by the Node parameter. CanExpand returns True if node can be expanded, False otherwise.

If there is no OnExpanding event handler, CanExpand returns True.

Override this method to make additional, class-specific responses in addition to the OnExpanding event or to suppress the OnExpanding event.


TCustomTreeView.Change

TCustomTreeView	See also

Generates an OnChange event.

procedure Change(Node: TTreeNode); dynamic;

Description

Change is called automatically whenever the selected node changes. The Node parameter indicates the newly selected node.

Override this method to make additional, class-specific responses in addition to the OnChange event or to suppress the OnChange event.


TCustomTreeView.Collapse

TCustomTreeView	See also

Generates an OnCollapsed event.

procedure Collapse(Node: TTreeNode); dynamic;

Description

Collapse is called automatically after the node specified by the Node parameter collapses.

Override this method to make additional, class-specific responses in addition to the OnCollapsed event or to suppress the OnCollapsed event.


TCustomTreeView.Create

TCustomTreeView	See also

Creates an instance of a TTreeView control.

constructor Create(AOwner: TComponent);

Description

Call Create to instantiate a tree view at runtime. Tree view controls placed on forms at design time are created automatically. After calling the inherited constructor, Create initializes many properties the control, including setting BorderStyle to bsSingle and setting ShowButtons, ShowRoot, ShowLines, and HideSelection to True.


TCustomTreeView.CreateNode

TCustomTreeView	See also

Creates a new TTreeNode instance with the TTreeNodes specified by Items as its Owner.

function CreateNode: TTreeNode; virtual;

Description

Do not call CreateNode. The TTreeNodes object specified by the Items property uses this method in the implementation of its Add, AddFirst, AddChild, AddChildFirst, AddObject, AddObjectFirst, AddChildObject, and AddChildObjectFirst methods. To create a new node for the tree view, use one of these methods instead. These methods ensure that the node is inserted properly and its properties reflect its position in the tree view.


TCustomTreeView.CreateParams

TCustomTreeView	See also

Initializes a window-creation parameter record.

procedure CreateParams(var Params: TCreateParams); override;

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle.

CreateParams fills in the parameter record that is passed as the value of the Params parameter. This data structure holds information needed when telling Windows to create a window handle. The fields of a TCreateParams record become the parameters to a call to the CreateWindowEx API function.

CreateParams sets the value of the Params parameter to reflect the current property settings of the tree view.


TCustomTreeView.CreateWnd

TCustomTreeView	See also

Creates the window used by the tree view component.

procedure CreateWnd; override;

Description

CreateWnd is called automatically when the tree view is first created or when the window must be destroyed and recreated to reflect property changes.

CreateWnd first calls the CreateParams method to initialize the window-creation parameters, then calls CreateWindowHandle to create the window for the control. If the tree view’s window was temporarily destroyed and recreated, CreateWnd reads various property settings from an in-memory cache where they were stored while there was no window. CreateWnd then sends a series of Windows messages to the newly-created tree view control to initialize its property settings.


TCustomTreeView.CustomSort

TCustomTreeView	See also 	Example

Sorts the nodes in the tree view into a customized sort order.

type TTVCompare = function(lParam1, lParam2, lParamSort: Longint): Integer stdcall;

function CustomSort(SortProc: TTVCompare; Data: Longint): Boolean;

Description

Use CustomSort to sort the nodes of the tree view where the sort order is defined by the SortProc parameter. The lParam1 and lParam2 parameters of the sort procedure can be cast to TTreeNode objects are compared. The lParamSort parameter of the sort procedure is the value of Data parameter of CustomSort. The sort procedure should return a value less than 0 if lParam1 should come before lParam2, should return 0 if the two values are equivalent, and should return a value greater than 0 if lParam1 should follow lParam2.

If the SortProc parameter is nil, the default AlphaSort method is called.

Note:	To have the tree view sort all nodes automatically (for example, when the user edits the labels), use the SortType property instead, and provide an OnCompare event handler.


TCustomTreeView.CustomDraw

TCustomTreeView	See also

Generates an OnCustomDraw or OnAdvancedCustomDraw event.

function CustomDraw(const ARect: TRect; Stage: TCustomDrawStage): Boolean; virtual;

Description

CustomDraw is called automatically at discrete stages in the painting process. It determines what event handlers, if any, are appropriate for the current drawing stage, and generates the appropriate events.

ARect is the boundaries of the tree view in the coordinates of the Canvas property.

Stage is the current stage of the painting process.

CustomDraw returns True if the tree view should continue with the default painting process, False if the method has completely rendered the tree view and there is no more painting to be done.


TCustomTreeView.CustomDrawItem

TCustomTreeView	See also

Generates an OnCustomDrawItem or OnAdvancedCustomDrawItem event.

function CustomDrawItem(Node: TTreeNode; State: TCustomDrawState; Stage: TCustomDrawStage var PaintImages: Boolean): Boolean; virtual;

Description

CustomDrawItem is called automatically at discrete stages during the painting of tree nodes. It determines what event handlers, if any, are appropriate for the current drawing stage, and generates the appropriate events.

Node is the item that is about to be painted.

State is the item's current state: one or more of dsSelected, dsGrayed, dsDisabled, dsChecked, dsFocused, dsDefault, dsHot, dsMarked, dsIndeterminate.

Stage is the current stage of the painting process.

PaintImages returns a value that indicates whether the tree view should paint the images associated with the current node. This value is only meaningful when Stage is csPrePaint.

CustomDrawItem returns True if the tree view should continue with the default rendering of the item, False if the method completely handled painting the item and there is nothing left to paint.


TCustomTreeView.Delete

TCustomTreeView	See also

Generates an OnDeletion event.

procedure Delete(Node: TTreeNode); dynamic;

Description

Delete is called automatically immediately before the node specified by the Node parameter is deleted.

Override this method to make additional, class-specific responses in addition to the OnDeletion event or to suppress the OnDeletion event.


TCustomTreeView.Destroy

TCustomTreeView	See also

Destroys the tree view control and is called by the Delete method.

destructor Destroy; override;

Description

Do not call the destructor directly in an application. Instead, use the Free method. Free checks that the tree view is not nil, and only then calls Destroy.


TCustomTreeView.DestroyWnd

TCustomTreeView	See also

Destroys the control's window.

procedure DestroyWnd; override;

Description

DestroyWnd is called when the tree view needs to replace its window.  For example, changing properties that are implemented by window parameter settings require the tree view to be destroyed and then recreated using the CreateWnd method.

Before the window is destroyed, DestroyWnd saves information about the tree view’s items in memory, frees any device contexts, and finally calls DestroyWindowHandle.  When the window is recreated, the stored items are added to the new window.


TCustomTreeView.DoEndDrag

TCustomTreeView	See also

Generates an OnEndDrag event.

procedure DoEndDrag(Target: TObject; X, Y: Integer); override;

Description

DoEndDrag is called automatically when the user stops dragging the tree view or one of its items. The drag operation may end either because the treeview was dropped on the object specified by Target, or because the user canceled the drag operation (if Target is nil).

Override DoEndDrag to perform any additional adjustments when the user stops dragging the tree view.


TCustomTreeView.DoStartDrag

TCustomTreeView	See also

Generates an OnStartDrag event.

procedure DoStartDrag(DragObject: TDragObject); override;

Description

DoStartDrag is called automatically when the user starts dragging the tree view or one of its items. It generates an OnStartDrag event, and then identifes the node (if any) that is being dragged. If the user is dragging a node (as opposed to the entire tree view), DoStartDrag generates an image for the node drag.

Override DoStartDrag to perform any additional adjustments when the user starts a drag-and-drop operation.


TCustomTreeView.Edit

TCustomTreeView	See also

Generates an OnEdited event.

procedure Edit(const Item: TTVItem); dynamic;

Description

Edit is called automatically when the user edits the text of a tree view node. The Item parameter is the record supplied by the Windows control that identifies the node that was edited and the new value of its text. Edit unpacks this information into the parameters of an OnEdited event handler, and allows the event handler to change the value of the node’s text.


TCustomTreeView.Expand

TCustomTreeView	See also

Generates an OnExpanded event.

procedure Expand(Node: TTreeNode); dynamic;

Description

Expand is called automatically after the node specified by the Node parameter expands.

Override this method to make additional, class-specific responses in addition to the OnExpanded event or to suppress the OnExpanded event.


TCustomTreeView.FullCollapse

TCustomTreeView	See also

Collapses all the nodes within a tree view control.

procedure FullCollapse;

Description

Call FullCollapse to hide all the nodes in the tree view except those at the first level.


TCustomTreeView.FullExpand

TCustomTreeView	See also

Expands all nodes within the tree view control.

procedure FullExpand;

Description

Call FullExpand to display all the nodes in the tree view. If ShowButtons is True, all buttons will change from '+' to '-'.


TCustomTreeView.GetDragImages

TCustomTreeView	See also

Returns the image list to be displayed during drag operations.

function GetDragImages: TDragImageList; override;

Description

GetDragImages is called automatically during drag-and-drop operations to allow the tree view to supply an image that is displayed while the tree view or one of its items is dragged. If an item (and not the entire tree view) is being dragged, GetDragImages returns the image for the node that was generated by the DoStartDrag method.


TCustomTreeView.GetHitTestInfoAt

TCustomTreeView	See also 	Example

Returns information about the location of a point relative to the client area of the tree view control.

function GetHitTestInfoAt(X, Y: Integer): THitTests;

Description

Call GetHitTestInfoAt to determine what portion of the tree view, if any, sits under the point specified by the X and Y parameters. For example, use GetHitTestInfoAt to provide feedback about how to expand or collapse nodes when the mouse is over the relevant portions of the tree view.

GetHitTestInfo returns a THitTests type. This set describes the possible tree view elements under the mouse.


TCustomTreeView.GetImageIndex

TCustomTreeView	See also 	Example

Generates an OnGetImageIndex event.

procedure GetImageIndex(Node: TTreeNode); virtual;

Description

Call GetImageIndex to set the image index of a tree node. GetImageIndex as implemented in TCustomTreeView does nothing except invoke the handler for the OnGetImageIndex event, if one is assigned.

Descendants can override GetImageIndex to provide a class-specific implementation for setting the tree node’s image index.

Node is the tree node in which the image index is set.


TCustomTreeView.GetNodeAt

TCustomTreeView	See also 	Example

Returns the node that is found at the specified position.

function GetNodeAt(X, Y: Integer): TTreeNode;

Description

Call GetNodeAt to access the node at the position specified by the X and Y parameters. X and Y specify the position in pixels relative to the top left corner of the tree view. If there is no node at the location, GetNodeAt returns nil.


TCustomTreeView.GetSelectedIndex

TCustomTreeView	See also 	Example

Generates an OnGetSelectedIndex event.

procedure GetSelectedIndex(Node: TTreeNode); virtual;

Description

Call GetSelectedIndex to set the image index of a tree node when the tree node is selected. GetSelectedIndex invokes the handler for the OnGetSelectedIndex event, if one is assigned.

Descendants can override GetSelectedIndex to implement a class-specific method of setting the selected tree node’s image index.

Node is the tree node in which the image index is set.


TCustomTreeView.IsCustomDrawn

TCustomTreeView	See also

Specifies when the tree view should generate a custom draw event.

function IsCustomDrawn(Target: TCustomDrawTarget; Stage: TCustomDrawStage): Boolean;

Description

TCustomTreeView checks IsCustomDrawn to determine when to generate an OnCustomDraw, OnAdvancedCustomDraw, OnCustomDrawItem, or OnAdvancedCustomDrawItem event. IsCustomDrawn returns True when the tree view should generate an event.

The Target parameter indicates whether the tree view is about to draw the entire tree or about to draw a node. IsCustomDrawn does not return True unless the tree view has an appropriate event handler for the target.

The Stage parameter indicates the current stage in the process of painting the tree view. IsCustomDrawn returns True if the stage is cdPrePaint or if there is an advanced custom draw event handler for the target.


TCustomTreeView.IsEditing

TCustomTreeView	See also

Indicates whether a node is currently being edited by the user.

function IsEditing: Boolean;

Description

IsEditing returns True if any node label in the tree view is being edited.


TCustomTreeView.Loaded

TCustomTreeView	See also

Initializes the tree view after it is loaded from a stream.

procedure Loaded; override;

Description

Do not call Loaded. The VCL streaming system calls Loaded automatically after the tree view’s form is loaded into memory so that the tree view can complete any initializations that depend on other objects in the form.

Loaded ensures that the tree view appears fully expanded when it is first loaded into the designer.


TCustomTreeView.LoadFromFile

TCustomTreeView	See also

Reads the file specified in FileName and loads the data into the tree view.

procedure LoadFromFile(const FileName: string);

Description

Use the LoadFromFile method to retrieve tree view data from a file and load into a tree view.


TCustomTreeView.LoadFromStream

TCustomTreeView	See also

Reads tree view data from a stream and stores the contents in the tree view.

procedure LoadFromStream(Stream: TStream);

Description

Use LoadFromStream to read the nodes of the tree view from the specified stream. For example, an application can save the information displayed in a tree view as the data in a Binary Large Object (BLOB) field. LoadFromStream can retrieve the data using a TBlobStream object.


TCustomTreeView.SaveToFile

TCustomTreeView	See also

Saves a the tree view to the file specified in FileName.

procedure SaveToFile(const FileName: string);

Description

Use the SaveToFile method to store tree view data to a text file. The nodes can later be reloaded from the file into a new tree view object using the LoadFromFile method.


TCustomTreeView.SaveToStream

TCustomTreeView	See also

Writes the data in the tree view to the stream passed as the Stream parameter.

procedure SaveToStream(Stream: TStream);

Description

Use the SaveToStream method to stream out tree view data. It can be streamed back in to another tree view object using the LoadFromStream method.


TCustomTreeView.SetDragMode

TCustomTreeView	See also

Sets the drag mode for the tree view.

procedure SetDragMode(Value: TDragMode); override;

Description

SetDragMode is the protected write implementation for the DragMode property. It sends a message to the tree view window to suppress automatic drag behavior when DragMode is set to dmManual.


TCustomTreeView.WndProc

TCustomTreeView	See also

Provides specific message responses for the control.

procedure WndProc(var Message: TMessage); override;

Description

WndProc is the initial Windows message handler for the control. The WindowProc property is initialized to point to the WndProc method.

WndProc adjusts for some Windows message idiosyncrasies before calling the WndProc method inherited from TWinControl.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomUpDown

Hierarchy	Properties	Methods	Events	See also

TCustomUpDown is the base type for up-down size controls such as TUpDown.

Unit

comctrls

Description

Use TCustomUpDown as a base class when defining up-down controls such as the arrows that appear in a spin box. Up-down controls allow users to change the size of a numerical value by clicking on arrow buttons. TCustomUpDown introduces several properties, events, and methods to associate an up-down control with another control in a form and to communicate the size changes specified by the user.

Do not create instances of TCustomUpDown. To put an up-down control in a form, use TUpDown.


TCustomUpDown properties

TCustomUpDown	Alphabetically	Legend

In TCustomUpDown

AlignButton

ArrowKeys

Associate

Increment

Max

Min

Orientation

Position

Thousands

Wrap

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UnDockHeight

UnDockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TCustomUpDown properties

TCustomUpDown	By object	Legend

Action

Align

AlignButton

Anchors

ArrowKeys

Associate

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

Increment

Left

LRDockWidth

Max

Min

Name

Orientation

Owner

Parent

ParentWindow

Position

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Thousands

Top

UnDockHeight

UnDockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc

Wrap


TCustomUpDown.AlignButton

TCustomUpDown	See also

Specifies the position of the up-down control relative to its companion control.

type TUDAlignButton = (udLeft, udRight);

property AlignButton: TUDAlignButton;

Description

Set AlignButton to indicate where to position the up-down control. The up-down control appears attached to the outer edge of the control specified by the Associate property. These are the possible values:

Value	Meaning

udLeft	Position the up-down control on the left edge of the companion control.

udRight	Position the up-down control on the right edge of the companion control.

The up-down control resizes itself to the height of the companion control.


TCustomUpDown.ArrowKeys

TCustomUpDown	See also

Determines whether the up-down control receives input from the Up arrow and Down arrow keys.

property ArrowKeys: Boolean;

Description

Use ArrowKeys to specify whether the up-down control responds to keyboard input. ArrowKeys is used only when the up-down control is associated with a companion control. When ArrowKeys is True, the up-down control responds to the Up arrow and Down arrow keys, even when its companion control has input focus. When ArrowKeys is False, the user must click the buttons of the up-down control with the mouse. To set a companion control use the Associate property.

Note:	Up-down controls can respond to only the Up and Down arrow keys, even when the value of Orientation is udHorizontal.


TCustomUpDown.Associate

TCustomUpDown	See also

Specifies a companion control for the up-down control.

property Associate: TWinControl;

Description

Use Associate to link the up-down control to a companion control (sometimes called a buddy window). The up-down control automatically positions itself on the outer edge of the companion control and adjusts its height to match the companion control.

At design-time the companion control does not move with the up-down control. To keep the up-down control and its companion control together at design time, either multi-select both controls before moving them, or first move the companion control and then reset the Associate property for the up-down control.


TCustomUpDown.Increment

TCustomUpDown	See also

Specifies the amount the Position value changes each time the up or down button is pressed.

property Increment: Integer;

Description

Use Increment to control the granularity of changes the up-down control can make. Set Increment to indicate the number of units between Min and Max the Position moves whenever the user clicks on one of the arrow buttons. Increment represents the mapping between the units used to specify Min, Max, and Position, and the logical units represented by the up-down control.


TCustomUpDown.Max

TCustomUpDown	See also

Specifies the maximum value of the Position property.

property Max: SmallInt;

Description

Use Max to provide an upper limit to the range of values the Position property can assume.


TCustomUpDown.Min

TCustomUpDown	See also

Specifies the minimum value of the Position property.

property Min: SmallInt;

Description

Use Min to provide a lower limit to the range of values the Position property can assume.


TCustomUpDown.Orientation

TCustomUpDown	See also

Specifies the direction that the arrow keys point.

type TUDOrientation = (udHorizontal, udVertical);

property Orientation: TUDOrientation;

Description

Use Orientation to determine the orientation of the arrow buttons. These are the possible values:

Value	Meaning

udHorizontal	The arrow buttons point to the left and right, and appear side by side.

udVertical	The arrow buttons point up and down and are stacked vertically.

Note:	Even when the Orientation is udHorizontal, the up-down control can respond only to the Up and Down arrow keys.


TCustomUpDown.Position

TCustomUpDown	See also

Specifies the current value represented by the up-down control.

property Position: SmallInt;

_Description

Use Position to get or change the value the up-down control represents. Position must be a value between Min and Max.

When the Associate property specifies an edit control, its text is automatically set to the value of Position. When Position changes, the text of the edit control is updated. If the Associate property is nil, use the OnClick event to respond to changes in the value of Position.


TCustomUpDown.Thousands

TCustomUpDown	See also

Determines whether a thousands separator appears between every three digits of a decimal string.

property Thousands: Boolean;

Description

Use Thousands to control the formatting of the text of the companion control of the up-down control. If Thousands is True, a separator appears between every three digits. The numeric value that is displayed by the companion control is given by the Position property.


TCustomUpDown.Wrap

TCustomUpDown 	See also

Specifies how the up-down control handles attempts to exceed the value of Max or Min.

property Wrap: Boolean;

Description

Use Wrap to specify whether the up-down control treats the range determined by the Max and Min properties as a continuous loop. If Wrap is True, the value of Position becomes the value of the Min property when the user increments Position beyond the value of Max, and becomes the value of Max when the user decrements Position beyond the value of Min.


TCustomUpDown events

TCustomUpDown	Alphabetically	Legend

In TCustomUpDown

OnChanging

OnChangingEx

OnClick


TCustomUpDown events

TCustomUpDown	By object	Legend

OnChanging

OnChangingEx

OnClick


TCustomUpDown.OnChanging

TCustomUpDown	See also

Occurs when the position of an up-down control is about to change.

type TUDChangingEvent = procedure (Sender: TObject; var AllowChange: Boolean) of object;

property OnChanging: TUDChanginEvent;

Description

Write an OnChanging event handler to conditionally disallow changes to the value of Position. Set the AllowChange parameter to False to prevent a change to the current value of Position.

OnChanging occurs both when the user clicks the arrow buttons of the up-down control and when an attempt is made to change the value of Position programmatically. To determine which button the user clicked, use the OnChangingEx event or the OnClick event, both of which follow the OnChanging event.


TCustomUpDown.OnChangingEx

TCustomUpDown	See also

Occurs when the position of an up-down control is about to change.

type

  TUDChangingEventEx = procedure (Sender: TObject; var AllowChange: Boolean; NewValue: SmallInt; Direction: TUpDownDirection) of object;

property OnChangingEx: TUDChanginEventEx;

Description

Write an OnChangingEx event handler to conditionally disallow changes to the value of Position. Set the AllowChange parameter to False to prevent a change to the current value of Position.

Sender is the updown control that received the event. This may be in response to a user click on the arrow buttons or an attempt to change the value of Position programmatically.

AllowChange returns a value that indicates whether the change is permitted.

NewValue indicates the new value of Position if the change is allowed.

Direction indicates whether the value of Position is to be increased or decreased.


TCustomUpDown.OnClick

TCustomUpDown	See also 	Example

Occurs when the user clicks an arrow button.

type

  TUDBtnType = (btNext, btPrev);

  TUDClickEvent = procedure (Sender: TObject; Button: TUDBtnType) of object;

property OnClick: TUDClickEvent

Description

Write an OnClick event handler to take specific action when the user clicks one of the arrow buttons. If the Associate property is not used to automatically update the text of an edit control when the value of Position changes, use the OnClick event handler to respond to changes just before the value of Position is changed.

The Button parameter specifies how the value of Position is about to change. When Button is btNext, the Up or Right arrow was clicked, and the value of Position is about to increase by Increment. When Button is btPrev, the Down or Left arrow was clicked, and the value of Position is about to decrease by Increment.


TCustomUpDown methods

TCustomUpDown	Alphabetically	Legend

In TCustomUpDown

CanChange

Click

Create

CreateParams

CreateWnd

DoCanChange

Notification

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

Destroy

DisableAlign

DockDrop

EnableAlign

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetTextBuf

GetTextLen

Hide

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeConstruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomUpDown methods

TCustomUpDown	By object	Legend

AfterConstruction

Assign

BeforeConstruction

BeginDrag

BringToFront

Broadcast

CanChange

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Click

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParams

CreateParented

CreateParentedControl

CreateWnd

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

DoCanChange

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

Notification

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomUpDown

Update

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TCustomUpDown.CanChange

TCustomUpDown	See also

Indicates whether the value of Position can be changed.

function CanChange: Boolean;

Description

CanChange is called automatically when the user clicks the arrow buttons or an attempt is made to change the value of Position programmatically. CanChange generates an OnChanging event followed by an OnChangingEx event. It allows the change unless an OnChanging or OnChangingEx event handler prevents it.


TCustomUpDown.Click

TCustomUpDown	See also

Generates an OnClick event.

type TUDBtnType = (btNext, btPrev);

procedure Click(Button: TUDBtnType); reintroduce; dynamic;

Description

Click is called automatically when the user clicks an arrow button or presses an Up or Down arrow key. Override this method to specify special processing that should occur before the OnClick event handler executes, or to block the OnClick event. The Button parameter specifies which button was clicked: btNext refers to the Up or Right arrow, and btPrev refers to the Down or Left arrow.


TCustomUpDown.Create

TCustomUpDown	See also

Creates and initializes an instance of TCustomUpDown.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate an up-down control at runtime. Up-down controls placed on forms at design time are created automatically.

After calling the inherited constructor, Create initializes the following properties:

Height and Width are given values based on the size of scroll bar arrows.

ArrowKeys is set to True

Max is set to 100 and Increment is set to 1.

AlignButton is set to udRight and Orientation is set to udVertical.

Thousands is set to True


TCustomUpDown.CreateParams

TCustomUpDown	See also

Initializes the window creation parameters for the up-down control.

procedure CreateParams(var Params: TCreateParams); override;

Description

CreateParams is called automatically before the window for an up-down control is created. CreateParams calls the inherited method, then sets the Params parameter to reflect the values of the AlignButton, ArrowKeys, Orientation, Thousands, and Wrap properties.


TCustomUpDown.CreateWnd

TCustomUpDown	See also

Creates the window used by the up-down control.

procedure CreateWnd; override;

Description

After calling the inherited method to create the up-down control’s window, CreateWnd sends the newly created windows messages so that it reflects the current values of the Associate, Increment, Max, Min, and Position properties.


TCustomUpDown.DoCanChange

TCustomUpDown	See also

Indicates whether the value of Position can be changed.

function DoCanChange(NewVal: SmallInt; Delta: SmallInt): Boolean;

Description

DoCanChange is called automatically when the user clicks the arrow buttons or an attempt is made to change the value of Position programmatically. DoCanChange stores the value of the NewVal and Delta parameters and then calls CanChange to generate an OnChanging event followed by an OnChangingEx event. It allows the change to position unless an OnChanging or OnChangingEx event handler prevents it.

NewVal specifies the proposed new value of Position if the change is allowed.

Delta indicates the size of the change, where positive values increase Position and negative values decrease Position.

DoCanChange returns True if the change is allowed, False otherwise.


TCustomUpDown.Notification

TCustomUpDown	See also

Responds to notifications when components are about to be created or destroyed.

procedure Notification(AComponent: TComponent; Operation: TOperation); override;

Description

After calling the inherited method, Notification checks whether the control specified by the Associate property is about to be destroyed, and if so, sets the Associate property to nil.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


 TDatabase

Hierarchy	Properties	Methods	Events	See also

TDatabase provides discrete control over a connection to a single database in a BDE-based database application.

Unit

dbtables

Description

Use TDatabase when a BDE-based database application requires any of the following control over a database connection:

Persistent database connections

Customized database server logins

Transaction control

Application-specific BDE aliases

TDatabase is especially important for the control it permits over database transaction processing with the BDE when connected to a remote SQL database server.

Note:	Explicit declaration of a TDatabase component for each database connection in an application is optional if the application does not need to explicitly control that connection. If a TDatabase component is not explicitly declared and instantiated for a database connection, a temporary database component with a default set of properties is created for it at runtime.


TDatabase properties

TDatabase	Alphabetically	Legend

In TDatabase

AliasName

Connected

DatabaseName

DataSets

Directory

DriverName

Exclusive

Handle

HandleShared

InTransaction

IsSQLBased

KeepConnection

Locale

Params

Session

SessionAlias

SessionName

ReadOnly

Temporary

TraceFlags

TransIsolation

In TCustomConnection

DataSetCount

LoginPrompt

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDatabase properties

TDatabase	By object	Legend

AliasName

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Connected

DatabaseName

DataSetCount

DataSets

DesignInfo

Directory

DriverName

Exclusive

Handle

HandleShared

InTransaction

IsSQLBased

KeepConnection

Locale

LoginPrompt

Name

Owner

Params

ReadOnly

Session

SessionAlias

SessionName

Tag

Temporary

TraceFlags

TransIsolation

VCLComObject


TDatabase.AliasName

TDatabase	See also

Specifies the Borland Database Engine (BDE) alias used by this database connection.

property AliasName: String;

Description

Use AliasName to specify the name of an existing BDE alias for the database component. A BDE alias contains database configuration information for connection to a specific kind of database, such as InterBase, dBASE, or Paradox. The configuration information associated with a BDE alias differs by database type.

If an application sets AliasName, any value previously assigned to the DriverName property is cleared because the alias automatically specifies a driver name as one of its parameters. Other alias connection information is stored in the Params property when AliasName is set.

Note:	Attempting to set AliasName when the Connected property is True raises an exception.

Note:	An application can specify the DatabaseName, DriverName, and Params properties rather than setting AliasName if the desired BDE alias configuration does not already exist. An application can also provide an application-specific “alias” name by setting DatabaseName when AliasName is already set.

Tip:	At design time double-click a TDatabase component to invoke the Database editor and set the AliasName.


TDatabase.Connected

TDatabase	See also	Example

Indicates whether or not a database connection is active.

property Connected: Boolean;

Description

Set Connected to True to establish a database connection without opening a dataset. Set Connected to False to close a database connection. An application can check Connected to determine the current status of a database connection. If Connected is True, the database connection is active; if False, and the KeepConnection property is also False, then the connection is inactive.

Note:	Set KeepConnection to True to avoid having to log in to the server each time a database connection is reopened.


TDatabase.DatabaseName

TDatabase	See also

Specifies the name of the database to associate with this database component.

property DatabaseName: string;

Description

Use DatabaseName to specify the name of the database to use with a database component. If DatabaseName is the same as an existing Borland Database Engine (BDE) alias, then the AliasName and DriverName properties need not be set. If DatabaseName does not match an existing BDE alias, then either the application must also supply a valid alias in the AliasName property in addition to the DatabaseName, or it must supply the DriverName and Params properties.

DatabaseName can be a fully qualified path name when connecting to a Paradox or dBASE database.

Note:	Attempting to set DatabaseName when the Connected property is True raises an exception.

Tip:	At design time double-click a TDatabase component to invoke the Database editor and set the DatabaseName.


TDatabase.DataSets

TDatabase	See also 	Example

Provides an indexed array of all active datasets for a database component.

property DataSets[Index: Integer]: TDBDataSet;

Description

Use DataSets to access active datasets associated with a database component. An active dataset is one that is currently open.


TDatabase.Directory

TDatabase	See also

Specifies the working directory for a Paradox or dBASE database.

property Directory: String;

Description

Use Directory at runtime to change or retrieve the working directory for a Paradox or dBASE database. This is the location these databases use to create temporary tables at runtime.

Ordinarily a directory location is specified in the PATH parameter of the database alias (specified by the AliasName property). At runtime, however, some applications may need to change the working directory after a database is opened.

To change the value of Directory at runtime, a database must already be open, or an exception is raised. Clearing the current value of Directory sets its value to the original working directory specified when the database was first opened.

Note:	Do not use Directory when connected to remote databases. An exception is raised in these circumstances. An exception is also raised if an application accesses Directory when the database is closed.


TDatabase.DriverName

TDatabase	See also

Specifies the name of the BDE driver for the database.

property DriverName: String;

Description

Use DriverName to specify the name of the BDE driver to use for databases connections that do not specify an AliasName, but that do specify a DatabaseName. DriverName must be a valid BDE driver (for instance, STANDARD, ORACLE, SYBASE, or INTERBASE).

Note:	If an application sets DriverName, it must also specify connection parameters in the Params property. Ordinarily the alias specified in the AliasName property supplies connection parameters, but when DriverName is set, the AliasName property is automatically cleared to avoid BDE driver name contention.

Attempting to set DriverName when the Connected property is True raises an exception.

Tip:	At design time double-click a TDatabase component to invoke the Database editor and set the DriverName.


TDatabase.Exclusive

TDatabase	See also

Enables an application to gain sole access to a database.

property Exclusive: Boolean;

Description

Use Exclusive to prevent other applications from accessing a Paradox or dBASE database while this application is using it. Before opening the database, set Exclusive to True. The default value for Exclusive is False, allowing other applications to use the opened database.

When Exclusive is True and the application successfully opens the database, no other application can access it. If the database for which the application has requested exclusive access is already in use by another application, an exception is raised. To handle such exceptions, write an exception handler. All tables in the database are effectively opened exclusively, as other applications would be prevented from opening the database and the tables would be inaccessible.

A table database must be closed before changing the setting of the Exclusive property. Do not set Exclusive to True at design time if you also intend to set the Connected property to True at design time. In this case an exception is raised because the database is already in use by the IDE.

Note:	An application can attempt to set Exclusive to True for SQL databases, but some SQL servers do not support exclusive database-locking. Others may grant an exclusive read/write lock, but still permit read-only access to other applications. For more information about exclusive locking of databases for a specific server, see the server’s documentation.


TDatabase.Handle

TDatabase	See also

Specifies the Borland Database Engine (BDE) database handle.

type HDBIDB: Longint;

property Handle: HDBIDB;

Description

Use Handle only to bypass TDatabase methods and make direct calls to the directly to the BDE API. Many BDE function calls require a handle parameter. Handle is assigned an initial value when a database is opened.

Note:	Do not use this property unless an application requires BDE functionality not available through standard Delphi components.


TDatabase.HandleShared

TDatabase	See also

Specifies whether or not to share a database handle.

property HandleShared: Boolean;

Description

Use HandleShared to indicate that a database component can share its BDE handle in a session component. Set HandleShared to True to avoid namespace conflicts for database components that appear in a remote data module, or that appear in data modules you inherit from the Object Repository.


TDatabase.InTransaction

TDatabase	See also

Indicates whether a database transaction is in progress or not.

property InTransaction: Boolean

Description

Examine InTransaction at run-time to determine if a database transaction is currently in progress. InTransaction is True if a transaction is in progress, False otherwise.

The value of InTransaction cannot be changed directly. Calling StartTransaction sets InTransaction to True. Calling Commit or Rollback sets InTransaction to False.


TDatabase.IsSQLBased

TDatabase	See also

Indicates if a database component is using either the Borland Database Engine (BDE) SQL Links driver or the BDE ODBC socket.

property IsSQLBased: Boolean;

Description

Examine IsSQLBased at runtime to determine if a database connection is using a BDE SQL Links driver, the ODBC socket, or the Paradox, dBASE, and ASCII text file STANDARD driver. If IsSQLBased is True, the connection is using an SQL Links driver or is using the ODBC socket to communicate with a third-party ODBC driver. If the connection uses the STANDARD driver, IsSQLBased is False.


TDatabase.KeepConnection

TDatabase	See also

Specifies whether an application remains connected to a database even if no datasets are open.

property KeepConnection: Boolean;

Description

Use KeepConnection to specify whether an application remains connected to a database even if no datasets are currently open. When KeepConnection is True (the default) the connection is maintained. For connections to remote database servers, or for applications that frequently open and close datasets, set KeepConnection to True to reduce network traffic, speed up applications, and avoid logging in to the server each time the connection is reestablished.

When KeepConnection is False a connection is dropped when there are no open datasets. Dropping a connection releases system resources allocated to the connection, but if a dataset is later opened that uses the database, the connection must be reestablished and initialized.

Note:	The KeepConnection setting for temporary database components created automatically as needed is determined by the KeepConnections property of TSession.


TDatabase.Locale

TDatabase	See also

Identifies the Borland Database Engine (BDE) language driver for the database component.

type TLocale: Pointer;

property Locale: TLocale;

Description

Examine Locale to determine the BDE language driver used by the database component. Applications that make direct calls to the BDE may also need to pass Locale information as an API function parameter.

Language driver information may also be available as one of the values in the Params property when a database component is using a BDE alias.

Note:	Do not use this property unless an application requires BDE functionality not available through standard Delphi components.


TDatabase.Params

TDatabase	See also

Contains database connection parameters for the Borland Database Engine (BDE) alias associated with the database component.

property Params: TStrings;

Description

Use Params to examine or specify database connection parameters, such as path name, server name, schema-caching size, language driver, user name, and password. Actual parameters in Params differ depending on the current BDE alias and driver for the database component.

Params is a list of string items, each representing a different database connection parameter. If the AliasName property specifies a valid BDE alias, then Params automatically contains the parameters defined for that alias. If, instead of providing an alias, an application uses the DriverName property to provide a local alias, the application must provide Params values directly.

Note:	Applications can use Params to override the default settings supplied by a BDE alias.

Tip:	At design time double-click a TDatabase component to invoke the Database editor and set Params.


TDatabase.ReadOnly

TDatabase	See also

Specifies that the database connection provides read-only access.

property ReadOnly: Boolean;

Description

Use ReadOnly to specify whether the database connection should allow the application to update the tables and other metadata in the database. Set ReadOnly before opening the database.

When ReadOnly is False (the default), the application can modify tables and database metadata (like indexes). When ReadOnly is True, applications can browse tables but cannot update them. The application is also prevented from creating or deleting metadata objects like tables and indexes.

Note:	A ReadOnly property value of True should be used when accessing a dBASE or Paradox database on a read-only storage medium, such as a CD.

Note:	For SQL databases, if ReadOnly is True, you must also explicitly set the ReadOnly property to True for dataset components like TTable and TQuery.


TDatabase.Session

TDatabase	See also

Points to the session component with which this database component is associated.

property Session: TSession

Description

Use Session to determine the session component that controls the database component. By default, a database component is associated with the default session component, Session, that is automatically created for all database applications. To assign a database component to a different session in a multi-threaded application, specify the name of a different session component in the SessionName property.


TDatabase.SessionAlias

TDatabase	See also

Specifies whether or not a database component is using a session alias.

property SessionAlias: Boolean;

Description

Examine SessionAlias to see if a database component is using a session alias. If SessionAlias is True, a session alias is in use. If False, a session alias is not in use.

A session alias is automatically created for a database component if it

•	Uses the DriverName and Params properties instead of the AliasName property, and the Params property contains any parameters.

•	Overrides Params values supplied by a BDE alias in AliasName.

A session alias may also be created if an application permits the user to log into a server using a different user name than the one specified in the Params property.

A session alias exists only while the application is running. It is not stored in the BDE configuration file, and cannot be accessed from outside the application.


TDatabase.SessionName

TDatabase	See also 	Example

Identifies the name of the session used by this database component.

property SessionName: String;

Description

Use SessionName to specify the session with which a database component is associated. If SessionName is blank, a database component is automatically associated with the default session, Session.

To associate a database component with a different session in a database application SessionName must matches the SessionName property of an existing session component.


TDatabase.Temporary

TDatabase	See also

Indicates whether a database component is a temporary one, created by the system as needed, or a persistent one explicitly created, managed, and freed within the application.

property Temporary: Boolean;

Description

Examine Temporary to determine if a database component is a temporary one, created by the system as needed, or a persistent one explicitly created, managed, and freed within the application. Temporary is True if the system created the component, False otherwise.

A temporary database component is created when a dataset is opened and the dataset is not already associated with an existing database component. If Temporary remains True, then a temporary database component is freed when the dataset is closed. An application can prevent the destruction of a temporary database component by setting Temporary to False while the dataset is active, but the application is then responsible for closing the database when it is no longer needed.


TDatabase.TraceFlags

TDatabase	See also

Specifies the database operations to track with the SQL Monitor at runtime.

type

  TTraceFlag = (tfQPrepare, tfQExecute, tfError, tfStmt, tfConnect, tfTransact, tfBlob, tfMisc, tfVendor, tfDataIn, tfDataOut);

  TTraceFlags = set of TTraceFlag;

property TraceFlags: TTraceFlags;

Description

Use TraceFlags to specify which database operations the SQL Monitor should track in an application at runtime. TraceFlags is only meaningful for the SQL Monitor, which is provided to enable performance tuning and SQL debugging when working with remote SQL database servers.

Note:	Normally trace options are set from the SQL Monitor rather than setting TraceFlags in application code.

The value of a session component’s TraceFlags property determines the initial settings of the TraceFlags property for database components associated with the session.

The TTraceFlags type defines the individual values that can be included in the TraceFlags property. The following table summarizes those values:

Values	Meaning

tfQPrepare	Monitor Prepare statements.

tfQExecute	Monitor ExecSQL statements.

tfError	Monitor server error messages. Such messages may include an error code.

tfStmt	Monitor all SQL statements.

tfConnect	Monitor database connect and disconnect operations, including allocation of connection handles, and freeing connection handles.

tfTransact	Monitor transaction statements, such as StartTransaction, Commit, and Rollback.

tfBlob	Monitor operations on blob data types.

tfMisc	Monitor any statements not covered by other flag options.

tfVendor	Monitor direct API function calls to the database server.

tfDataIn	Monitor data received from a server.

tfDataOut	Monitor data sent to a server.

Because TraceFlags is a set property, an application can specify different combinations of flags to monitor different combinations of statements. For example, the following statement limits monitoring to database connections and SQL statement preparation:

TraceFlags := [tfConnect, tfQPrepare];


TDatabase.TransIsolation

TDatabase	See also

Specifies the transaction isolation level for transactions managed by the Borland Database Engine (BDE).

type TTransIsolation = (tiDirtyRead, tiReadCommitted, tiRepeatableRead);

property TransIsolation: TTransIsolation;

Description

Use TransIsolation to specify the transaction isolation level for database transactions managed by the BDE. Transaction isolation level determines how a transaction interacts with other simultaneous transactions when they work with the same tables, and how much a transaction sees of the work performed by other transactions.

Note:	Applications that use passthrough SQL for handling transactions must pass a transaction isolation level directly to the database server using the appropriate SQL statement.

TransIsolation can be any one of the three values summarized in the following table:

Isolation level	Meaning

tiDirtyRead	Permits reading of uncommitted changes made to the database by other simultaneous transactions. Uncommitted changes are not permanent, and might be rolled back (undone) at any time. At this level a transaction is least isolated from the effects of other transactions.

tiReadCommitted	Permits reading of committed (permanent) changes made to the database by other simultaneous transactions. This is the default TransIsolation property value.

tiRepeatableRead	Permits a single, one-time reading of the database. The transaction cannot see any subsequent changes made by other simultaneous transactions. This isolation level guarantees that once a transaction reads a record, its view of that record does not change unless it makes a modification to the record itself. At this level, a transaction is most isolated from other transactions.

Different database servers support different levels of transaction isolation. If an application sets TransIsolation to an unsupported level for a remote SQL server, the BDE uses the next highest level supported by that server. The following table summarizes the isolation levels supported by the servers recognized by the BDE:

Server	Specified Level	Actual Level
Oracle	tiDirtyRead tiReadCommitted tiRepeatableRead	tiReadCommitted tiReadCommitted tiRepeatableRead (READONLY)
Sybase, MS-SQL	tiDirtyRead tiReadCommitted tiRepeatableRead	tiReadCommitted tiReadCommitted Not supported
DB2	tiDirtyRead tiReadCommitted tiRepeatableRead	tiDirtyRead tiReadCommitted tiRepeatableRead
Informix	tiDirtyRead tiReadCommitted tiRepeatableRead	tiDirtyRead tiReadCommitted tiRepeatableRead
InterBase	tiDirtyRead tiReadCommitted tiRepeatableRead	tiReadCommitted tiReadCommitted tiRepeatableRead
Paradox, dBASE, Access, FoxPro	tiDirtyRead tiReadCommitted tiRepeatableRead	tiDirtyRead Not supported Not supported
Note:	For local transactions against Paradox and dBASE, TransIsolation must be set to tiDirtyRead. Otherwise, an exception is raised.

If an application uses ODBC to interface with a server, the ODBC driver must also support the isolation level. For more information about supported isolation levels, see the documentation for the ODBC driver in question.


TDatabase events

TDatabase	Alphabetically	Legend

In TDatabase

OnLogin

Derived from TCustomConnection

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect


TDatabase events

TDatabase	By object	Legend

AfterConnect

AfterDisconnect

BeforeConnect

BeforeDisconnect

OnLogin


TDatabase.OnLogin

TDatabase	See also

Occurs when an application connects to a database.

type TDatabaseLoginEvent = procedure(Database: TDatabase; LoginParams: TStrings) of object;

property OnLogin: TDatabaseLoginEvent;

Description

Write an OnLogin event handler to take specific actions when an application attempts to connect to a database. By default, a database login is required. The current USERNAME is read from the Params property, and a standard Login dialog box opens. The dialog prompts for a user name and password combination, and then uses the values entered by the user to set the USERNAME and PASSWORD values in the Params property. These values are then passed to the remote server.

Applications that provide alternative OnLogin event handlers must set the USERNAME and PASSWORD values in LoginParams. LoginParams is a temporary string list and is freed automatically when no longer needed.


TDatabase methods

TDatabase	Alphabetically

In TDatabase

ApplyUpdates

CloseDataSets

Commit

Create

Destroy

Execute

FlushSchemaCache

Rollback

StartTransaction

ValidateName

In TCustomConnection

Close

Open

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDatabase methods

TDatabase	By object

AfterConstruction

ApplyUpdates

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

CloseDataSets

Commit

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Execute

ExecuteAction

FieldAddress

FindComponent

FlushSchemaCache

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Open

RemoveComponent

Rollback

SafeCallException

StartTransaction

UpdateAction

ValidateName


TDatabase.ApplyUpdates

TDatabase	See also	Example

Posts pending cached updates for specified datasets to the database server.

procedure ApplyUpdates(const DataSets: array of TDBDataSet);

Description

Call ApplyUpdates to post pending cached updates for a specific set of open datasets to the database server. ApplyUpdates is only meaningful if the CachedUpdates property of a specified dataset is True.

DataSets is a list of dataset names specifying the datasets for which to post pending updates. DataSets need not list every currently open dataset. For each listed dataset ApplyUpdates calls the dataset’s ApplyUpdates and CommitUpdates methods to post that dataset’s pending cached updates.

Applying updates is a two-phase process that takes place within the context of the database component’s transaction control. When an application calls ApplyUpdates, the following events take place:

1	A database transaction starts.

2	Cached updates are written to the database (Phase 1).

If the database write is successful:

1  Database changes are committed, ending the transaction.

2  Cached updates are committed, clearing the internal cache buffer (Phase 2).

If the database write fails database changes are rolled back, ending the transaction.

The two-phased approach allows for effective error recovery, especially when updating multiple and interrelated datasets (for example, the datasets associated with a master/detail form).


TDatabase.CloseDataSets

TDatabase	See also

Closes all datasets associated with the database component without disconnecting from the database server.

procedure CloseDatasets;

Description

Call CloseDataSets to close all active datasets without disconnecting from the database server. Ordinarily, when an application calls Close, all datasets are closed, and the connection to the database server is dropped. Calling CloseDataSets instead of Close ensures that an application can close all active datasets without having to reconnect to the database server at a later time.


TDatabase.Commit

TDatabase	See also 	Example

Permanently stores updates, insertions, and deletions of data associated with the current transaction, and ends the current transactions.

procedure Commit;

Description

Call Commit to permanently store to the database server all updates, insertions, and deletions of data associated with the current transaction and then end the transaction. The current transaction is the last transaction started by calling StartTransaction.

Note:	Before calling Commit, an application may check the status of the InTransaction property. If an application calls Commit and there is no current transaction, an exception is raised.


TDatabase.Create

TDatabase	See also

Creates an instance of a TDatabase component.

constructor Create(AOwner: TComponent);

Description

Call Create to instantiate a database component at runtime. An application can create a database component in order to control the component’s existence and set its properties and events, or an application can let Delphi create temporary database components as needed at runtime.

Create instantiates a database component and:

Sets the Session property to the active session.

Sets the SessionName property to the name of the active session component.

Adds this component to the list of database components for the session.

Creates an empty list of dataset components for the DataSets property.

Creates an empty string list for the Params property.

Sets the LoginPrompt property and the KeepConnection property to True.

Sets the Locale property to the locale of the session.

Sets the TransIsolation property to tiReadCommitted.


TDatabase.Destroy

TDatabase	See also

Destroys the instance of a database component.

destructor Destroy;

Description

Do not call Destroy directly in an application. Instead, call Free, which verifies that the database reference is not nil before calling Destroy

Destroy closes all active datasets and disconnects from the database server, if necessary. It then frees the string resources allocated for the Params and DataSets properties before calling its inherited destructor.


TDatabase.Execute

TDatabase	See also	Example

Executes an SQL statement.

function Execute(const SQL: string; Params: TParams = nil; Cache: Boolean = False; Cursor: phDBICur = nil): Integer;

Description

Use Execute to execute an SQL statement against the database without the overhead of using a TQuery object.

SQL is a String value containing the statement to be executed.

Params is a value of type TParams and lists any parameters used by the SQL statement. Parameter binding is by index only (not by name), so the order of parameters is important and the order of the TParam objects in Params corresponds to the order of the parameters in the SQL statement. Use properties and methods of TParams to create a TParams object and add one TParam object for each parameter. Use properties and methods of TParam like the AsString property to give each parameter a value prior to calling Execute. If the SQL statement does not include any parameters, pass a nil value for Params.

Cache specifies whether the prepared SQL statement is cached for reuse within the current transaction. Caching statements can speed their processing if they are used more than once in a transaction.

Cursor allows you to execute SELECT statements against an existing Borland Database Engine (BDE) dataset. If SQL is a SELECT statement, Cursor returns the BDE cursor to the result set. Cursor is a pointer to a handle to the BDE cursor and may be assigned to a pre-existing dataset component (like TTable). The result set returned in Cursor is always read-only. If the SQL statement does not return a result set, pass a nil value for Cursor.

Execute returns the number of records affected by executing the SQL statement.


TDatabase.FlushSchemaCache

TDatabase	See also

Flushes the cached schema information for a table.

procedure FlushSchemaCache(const TableName: String);

Description

Call FlushSchemaCache if the schema information for an SQL table is changed (for example, because a field, index, or table is added to or dropped from a database).

When an application opens an SQL table, schema information that describes the field names, field types, and index information is stored in memory. If an application changes the schema for an SQL table, it should call FlushSchemaCache to update the schema information in memory.


TDatabase.Rollback

TDatabase	See also 	Example

Cancels all updates, insertions, and deletions for the current transaction and ends the transaction.

procedure Rollback;

Description

Call Rollback to cancel all updates, insertions, and deletions for the current transaction and to end the transaction. The current transaction is the last transaction started by calling StartTransaction.

Note:	Before calling Rollback, an application may check the status of the InTransaction property. If an application calls Rollback and there is no current transaction, an exception is raised.


TDatabase.StartTransaction

TDatabase	See also 	Example

Begins a new transaction against the database server.

procedure StartTransaction;

Description

Call StartTransaction to begin a new transaction against the database server. Before calling StartTransaction, an application should check the status of the InTransaction property and adjust the setting of the TransIsolation property as desired. If InTransaction is True, indicating that a transaction is already in progress, a subsequent call to StartTransaction without first calling Commit or Rollback to end the current transaction raises an exception.

Updates, insertions, and deletions that take place after a call to StartTransaction are held by the server until an application calls Commit to save the changes or Rollback is to cancel them.


TDatabase.ValidateName

TDatabase	See also 	Example

Raises an exception if a specified database is already open in the active session.

procedure ValidateName(const Name: String);

Description

Call ValidateName to prevent duplicate access to a database from within a single session. Name is a string containing the name of the database to test. If the database is already open, ValidateName raises the EDatabaseError exception. If the database is not open, the procedure returns, and the application continues processing.

Note:	Most applications should not need to call this method directly. It is called automatically each time a database is opened.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomConnection


TDataLink

Hierarchy	Properties	Methods	See also

TDataLink is a helper class used by data-aware objects to coordinate the actions of TDataSource and TDataSet, and to respond to data events.

Unit

db

Description

Use TDataLink or one of its descendants in any data-aware object that implements a DataSource property to represent its link to a dataset or that needs to respond to data events.

The constructor of the data-aware object should call the constructor of TDataLink, and initialize any relevant properties. The data-aware object can then link to a TDataSource by using the DataSource property of the TDataLink.

Data-aware objects that link to a single field in a dataset should use a TFieldDataLink instead.


TDataLink properties

TDataLink	Alphabetically	Legend

In TDataLink

Active

ActiveRecord

BOF

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

Eof

ReadOnly

RecordCount

VisualControl


TDataLink properties

TDataLink	By object	Legend

Active

ActiveRecord

BOF

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

Eof

ReadOnly

RecordCount

VisualControl


TDataLink.Active

TDataLink	See also

Specifies whether or not the dataset that TDataLink manages is active.

property Active: Boolean;

Description

Read Active to determine whether the dataset for this TDataLink is Active. When Active is False, the dataset is closed, and the dataset cannot read data from or write data to the database. When Active is True, data can be read from and written to the dataset.


TDataLink.ActiveRecord

TDataLink	See also

Specifies the index of the current record within the internal set of records buffer maintained by the dataset for the Owner of the TDataLink object.

property ActiveRecord: Integer;

Description

Use ActiveRecord to discover or set the current record in the set of one or more records managed by the dataset. The set of records managed by the dataset corresponds to the number of records from the dataset visible at one time. For example, when the TDataLink object is owned by a data-aware grid, the set of records managed by the dataset corresponds to the number of rows shown by the grid, and the ActiveRecord represents the current row.


TDataLink.Bof

TDataLink	See also

Indicates whether or not a cursor is positioned at the first record in a dataset.

property Bof: Boolean;

Description

Inspect BOF to determine if the cursor is positioned at the first record in the dataset component associated with the TDataLink. If BOF is True, the cursor is unequivocally on the first row in the dataset. BOF is also True when:

A dataset is first opened.

A call is made to the dataset’s First method.

A call is made to the dataset’s Prior method, and the method fails (because the cursor is already on the first row in the dataset).

A call is made to the dataset’s SetRange, resulting in an empty result set.

BOF is False in all other cases. An application should assume BOF is False unless one of the conditions above is met and the application tests the property directly.

Tip:	If both Eof and BOF are True, a dataset or range is empty.


TDataLink.BufferCount

TDataLink	See also

Specifies the size of the set of records maintained by the dataset for the Owner of the TDataLink object.

property BufferCount: Integer;

Description

Set BufferCount to tell the dataset how many records to buffer together to service the owner of the TDataLink object. For example, a data-aware grid sets BufferCount to the number of rows visible in the grid.

Read BufferCount to iterate through all the records buffered by the dataset for the owner of the TDataLink object. For example, a data-aware object can paint itself by cycling through the set of records, moving the ActiveRecord to visit each record in turn.


TDataLink.DataSet

TDataLink	See also

Specifies the TDataSet object that represents the data that this TDataLink is tracking.

property DataSet: TDataSet;

Description

Read DataSet to determine the dataset that this TDataLink is helping to manage. The TDataLink responds to data events that are received by the DataSet, and makes changes to the dataset on behalf of the object that owns the TDataLink object.


TDataLink.DataSource

TDataLink	See also

Specifies the TDataSource object that the Owner of the TDataLink uses to connect to the dataset.

property DataSource: TDataSource;

Description

Use DataSource to determine or set the TDataSource object that connects to the dataset. TDataLink responds to data events that the DataSource receives.

Note:	To implement the DataSource property of a data-aware object which owns a TDataLink or its descendant, create a method that gets or sets the DataSource property of the TDataLink-derived member.


TDataLink.DataSourceFixed

TDataLink	See also

Indicates whether the DataSource property can be set.

property DataSourceFixed: Boolean;

Description

Use DataSourceFixed to determine whether the DataSource property can be changed. By default, DataSourceFixed is False, allowing the DataSource property to be changed.

When there is a chance that an asynchronous event might change the DataSource before an operation completes, set DataSourceFixed to True before performing the operation to ensure that the DataSource is constant throughout the operation. After the data operation is complete, DataSourceFixed can be set back to False.

Set DataSourceFixed to prevent the DataSource of a data-aware object that owns the TDataLink from being changed once it is set.


TDataLink.Editing

TDataLink	See also

Indicates whether the DataSource is in edit mode.

property Editing: Boolean;

Description

Read Editing to determine whether the DataSource is inserting a new record into the dataset, or modifying the current record. To change the dataset into edit mode, and hence the Editing property to True, use the Edit method.


TDataLink.Eof

TDataLink	See also

Indicates whether or not a cursor is positioned at the last record in a dataset.

property Eof: Boolean;

Description

Inspect Eof to determine if the cursor is positioned at the last record in the dataset component associated with the TDataLink. If Eof is True, the cursor is unequivocally on the last row in the dataset. Eof is also True when:

The associated dataset is empty.

A call is made to to the dataset’s Last method.

A call is made to the dataset’s Next method, and the method fails (because the cursor is already on the last row in the dataset).

A call to the dataset’s SetRange method is made resulting in an empty result set.

Eof is False in all other cases. An application should assume Eof is False unless one of the conditions above is met and the application tests the property directly.

Tip:	If both Eof and BOF are True, a dataset or range is empty.


TDataLink.ReadOnly

TDataLink	See also

Indicates whether the dataset for this TDataLink can be modified.

property ReadOnly: Boolean;

Description

Use ReadOnly to determine whether the dataset for this TDataLink can be modified. Setting ReadOnly to True causes any subsequent calls to the Edit method to fail, and changes the DataSource out of an editing state if it is in one. Setting ReadOnly to False enables changes to the data in the dataset.


TDataLink.RecordCount

TDataLink	See also

Indicates the number of records in the internal record buffer maintained for the Owner of the TDataLink object by the dataset.

property RecordCount: Integer;

Description

Read RecordCount to determine the number of actual records in the buffer maintained by the dataset for the Owner of this TDataLink.

In most cases, RecordCount is the same as BufferCount. RecordCount indicates the number of records actually in the record buffer of the dataset, as opposed to the number of records that the dataset can possibly maintain. For example, a data-aware grid with four rows could have one record actually showing data. In this case, BufferCount would be 4, while RecordCount would be 1.


TDataLink.VisualControl

TDataLink	See also

Indicates whether a visual control uses the datalink.

property VisualControl: Boolean;

Description

Descendants of TDataLink set VisualControl to indicate whether the control that uses the link is a visual control. A value of True indicates a visual control.


TDataLink methods

TDataLink	Alphabetically	Legend

In TDataLink

ActiveChanged

CheckBrowseMode

Create

DataSetChanged

DataSetScrolled

Destroy

Edit

EditingChanged

ExecuteAction

FocusControl

LayoutChanged

RecordChanged

UpdateData

UpdateAction

UpdateRecord

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDataLink methods

TDataLink	By object	Legend

ActiveChanged

AfterConstruction

Assign

BeforeDestruction

CheckBrowseMode

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DataSetChanged

DataSetScrolled

DefaultHandler

Destroy

Dispatch

Edit

EditingChanged

ExecuteAction

FieldAddress

FocusControl

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

LayoutChanged

MethodAddress

MethodName

NewInstance

RecordChanged

SafeCallException

UpdateData

UpdateAction

UpdateRecord


TDataLink.ActiveChanged

TDataLink	See also

Responds to changes in the Active property.

procedure ActiveChanged;

Description

The ActiveChanged method defined by TDataLink merely provides an interface for a method that can respond to changes in the Active property. Derived objects that do not need to respond to such changes can allow the inherited method to ignore them.


TDataLink.CheckBrowseMode

TDataLink	See also

Allows the data-aware object to respond just before an event that changes the dataset.

procedure CheckBrowseMode;

Description

The CheckBrowseMode method defined by TDataLink merely provides an interface for a method that can update any state information just before a change to the dataset occurs. Derived objects that do not need to respond to these events can allow the inherited method to ignore them.


TDataLink.Create

TDataLink	See also

Creates an instance of TDataLink.

constructor Create;

Description

Create is called from the constructor of any data-aware object that uses a TDataLink to implement its DataSource property.

After calling the inherited constructor, Create initializes the BufferCount property to 1. Data-aware objects that use a TDataLink object to manage their link to a DataSource should change the BufferCount property to the number or records they represent, after calling the inherited constructor.


TDataLink.DataSetChanged

TDataLink	See also

Responds to changes in the dataset.

procedure DataSetChanged;

Description

DataSetChanged responds to changes to the contents of the dataset. Anything that changes the contents of the dataset, whether it is editing the data, inserting or deleting records, or changing the key triggers this method. Changes specific to the representation of the data within the data-aware object, such as scrolling the dataset or changing the layout of data elements within the object, also trigger this method. DataSetChanged simply calls RecordChanged. Derived classes can override this procedure to make additional adjustments to changes in the dataset.


TDataLink.DataSetScrolled

TDataLink	See also

Allows a response to scrolling the representation of the dataset within the data-aware object.

procedure DataSetScrolled(Distance: Integer);

Description

DataSetScrolled ignores the Distance parameter and calls DataSetChanged. Derived classes can override this procedure to make additional adjustments when the dataset scrolls.


TDataLink.Destroy

TDataLink	See also

Destroys an instance of TDataLink.

destructor Destroy;

Description

Do not call Destroy directly in an application. Instead, call the Free method. Free checks that the TDataLink reference is not nil and only then calls Destroy.

Before calling the inherited destructor, Destroy removes any reference to the TDataLink from the data source object.

The TDataLink object should be destroyed in the destructor of its Owner, where that Owner calls Create from its constructor.


TDataLink.Edit

TDataLink	See also

Attempts to drive the data source into an editing state if it is not already in one.

function Edit: Boolean;

Description

Use Edit to try to ensure that the current record can be modified. A return value of True indicates that the data source was already in an editing state, or that it was successfully changed to allow editing. A return value of False indicates that the data source could not be changed to allow editing. For example, if the ReadOnly property is True, Edit will not allow editing and will return False.


TDataLink.EditingChanged

TDataLink	See also

Responds to changes in the editing state of the data source.

procedure EditingChanged;

Description

The EditingChanged method defined by TDataLink merely provides an interface for a method that can respond to changes in the editing state of the data source. EditingChanged is called immediately after the Editing property has changed its value. Derived objects that do not need to respond to such changes can allow the inherited method to ignore them.


TDataLink.ExecuteAction

TDataLink	See also

Invokes an action with the TDBEdit as its target.

function ExecuteAction(Action: TBasicAction): Boolean;

Description

ExecuteAction is called automatically when the user invokes an action with the TDataLink as a target. The Action parameter specifies the action that was invoked. ExecuteAction returns True if the action was successfully dispatched, and False if the TDataLink could not handle the action.


TDataLink.FocusControl

TDataLink	See also

Provides the interface for a method to force focus to the data-aware component associated with the TDataLink.

type TFieldRef = ^TField;

procedure FocusControl(Field: TFieldRef);

Description

The FocusControl method defined by TDataLink merely provides an interface for a method that can force the input focus to a data-aware object associated with the TDataLink. Derived objects that do not need this capability can allow the inherited method to ignore the request.


TDataLink.LayoutChanged

TDataLink	See also

Responds to changes in the representation of the data by the data-aware object.

procedure LayoutChanged; virtual;

Description

The LayoutChanged method simply calls the DataSetChanged method. LayoutChanged is intended to provide an interface for a method that can respond after changes in the representation of the data by the data-aware object. An example of such a change would be changing the number or order of the columns in a TCustomDBGrid.


TDataLink.RecordChanged

TDataLink	See also

Responds to changes in the contents of the current record or field of the dataset.

procedure RecordChanged(Field: TField);

Description

The RecordChanged method defined by TDataLink merely provides an interface for a method that can respond to changes to the contents of the current record. RecordChanged is called after changes have been posted to the current record in the dataset, and from DataSetChanged.

The Field parameter indicates which field of the current record has changed in value. If Field is nil, any number of fields within the current record may have changed.

Derived objects that do not need to respond to such changes can allow the inherited method to ignore them.


TDataLink.UpdateAction

TDataLink	See also

Updates an action to reflect the current state of the TDataLink.

function UpdateAction(Action: TBasicAction): Boolean;

Description

UpdateAction is called automatically when the application is idle to give the TDataLink an opportunity to update associated actions. This allows actions to be grayed, checked, or to otherwise reflect the status of the TDataLink they target.

The Action parameter specifies the action component that should be updated. UpdateAction returns True if the action component now reflects the state of the component, and False if it did not know how to update the action.


TDataLink.UpdateData

TDataLink	See also

Provides an interface for writing edits to a record in the dataset.

procedure UpdateData;

Description

The UpdateData method defined by TDataLink merely provides an interface for a method that writes updates to the current record in the dataset while avoiding calls to RecordChanged that posting the changes may trigger. Derived objects that do not need to write edits to the dataset can allow the inherited method to do nothing.


TDataLink.UpdateRecord

TDataLink	See also

Responds to notifications that edits should be posted to the dataset.

procedure UpdateRecord;

Description

UpdateRecord calls UpdateData after guarding against calls to RecordChanged, which may arise while UpdateData is executing.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink

TDetailDataLink


TDataModule

Hierarchy	Properties	Methods	Events	See also

TDataModule centralizes the handling of nonvisual components in an application.

Unit

forms

Description

Use a TDataModule object in an application to provide a location for centralized handling of nonvisual components. Typically these are data access components (TSession, TSessionList, TDatabase, TTable, TQuery, TStoredProc, and TBatchMove), but they can also be other nonvisual components, such as TTimer, TOpenDialog, TImageList, or TOleContainer).

At design time a TDataModule object provides a visual container into which a developer can place nonvisual components, set their properties, and write event handlers for them. To create a data module at design time, choose File | New Data Module.

In the unit file for the data module a developer may also place any business rules that are to be applied to the application.

To make the data module available to another unit in the application, select that unit, then choose File|Use Unit to add the data module to the uses clause for the unit.


TDataModule properties

TDataModule	Alphabetically	Legend

In TDataModule

DesignOffset

DesignSize

OldCreateOrder

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDataModule properties

TDataModule	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

DesignOffset

DesignSize

Name

OldCreateOrder

Owner

Tag

VCLComObject


TDataModule.DesignOffset

TDataModule	See also

Specifies the design offset for the data module at design time.

property DesignOffset: TPoint;

Description

An application should never need to set this value. It is used to control the position of the data module at design time.


TDataModule.DesignSize

TDataModule	See also

Specifies the design size for the data module at design time.

property DesignSize: TPoint;

Description

An application should never need to set this value. It controls the size of the data module window at design time.


TDataModule.OldCreateOrder

TDataModule	See also

Specifies when OnCreate and OnDestroy events occur.

property OldCreateOrder: Boolean;

Description

When OldCreateOrder is False (the default) the OnCreate event occurs after all constructors are finished (from the AfterConstruction method) and the OnDestroy event occurs before any destructors are called (from the BeforeDestruction method).

This timing differs from Delphi version 3 and previous, where the OnCreate event occurred when the TDataModule constructor executed and the OnDestroy event occurred when the TDataModule destructor executed. Applications that require the OnCreate event and OnDestroy events to occur from the constructor and destructor of the data module can set OldCreateOrder to True.


TDataModule events

TDataModule	Alphabetically	Legend

In TDataModule

OnCreate

OnDestroy


TDataModule events

TDataModule	By object	Legend

OnCreate

OnDestroy


TDataModule.OnCreate

TDataModule	See also

Occurs when an application instantiates a data module.

property OnCreate: TNotifyEvent;

Description

Write an OnCreate event handler to take specific actions when an application instantiates a data module. For example, if a data module contains database and dataset components, an application may establish a database connection immediately. If the data module contains timers, the application may initialize them.


TDataModule.OnDestroy

TDataModule	See also

Occurs when the data module is about to be destroyed.

property OnDestroy: TNotifyEvent;

Description

Write an OnDestroy event handler to take specific actions when an application frees a data module. For example, if the unit code for the data module instantiates any objects of its own, such as string lists, the OnDestroy event handler can be used to free those objects.


TDataModule methods

TDataModule	Alphabetically

In TDataModule

AfterConstruction

BeforeDestruction

Create

CreateNew

Destroy

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataModule methods

TDataModule	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateNew

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TDataModule.AfterConstruction

TDataModule	See also

Generates an OnCreate event.

procedure AfterConstruction; override;

Description

AfterConstruction is called after the data module’s constructor has finished. Do not call it explicitly in applications.

TDataModule overrides AfterConstruction to generate an OnCreate event when OldCreateOrder is False.


TDataModule.BeforeDestruction

TDataModule	See also

Generates an OnDestroy event.

procedure BeforeDestruction; override;

Description

BeforeDestruction is called immediately before the data module’s destructor. Do not call it explicitly in applications.

TDataModule overrides BeforeDestruction to generate an OnDestroy event when OldCreateOrder is False.


TDataModule.Create

TDataModule	See also

Creates an instance of a data module.

constructor Create(AOwner: TComponent);

Description

Call Create to instantiate a data module at runtime if it was not created at design time. Create calls CreateNew. If an error occurs, an exception is raised. Otherwise, if OldCreateOrder is True, Create calls the OnCreate event handler for the data module if one is assigned to it.


TDataModule.CreateNew

TDataModule	See also

Creates an instance of a data module and registers with the global screen object.

constructor CreateNew(AOwner: TComponent; Dummy: Integer = 0); virtual;

Description

Use CreateNew instead of Create to create a data module without using the associated .DFM file to initialize it.

Warning:	Using CreateNew instead of Create can cause unpredictable results because most data modules are written assuming their controls will be created from the .DFM file.

CreateNew calls the inherited constructor, and then informs the global screen object of the existence of the data module.

The first argument, AOwner, is the owner of the data module (usually the application). The second argument, Dummy, defaults to 0 and is not used by this constructor. The system passes 0 by default if this constructor is passed only the first argument, AOwner.

CreateNew bypasses the streaming in of the previously associated .DFM file. Therefore, you must stream in an external .DFM to bind the visual components with their classes. WriteComponentResFile and ReadComponentResFile must bracket CreateNew. The following code sequence

1. streams-out an external .DFM file.

2. creates a new data module disassociated from any .DFM resource file;

3. streams-in the external .DFM file and binds it to this new data module.

WriteComponentResFile('Temp.dfm', DataModule1);

…

DataModule2 := TDataModule.CreateNew(Application);

ReadComponentResFile('Temp.dfm', DataModule2);


TDataModule.Destroy

TDataModule	See also

Destroys the instance of the data module.

destructor Destroy;

Description

Do not call Destroy directly. Instead call Free, which checks that the data module reference is not nil before calling Destroy.

Before calling the inherited destructor, Destroy removes any fixup references, calls its OnDestroy event handler (if one is defined and OldCreateOrder is True), and informs the global screen variable that the data module is going away.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TDataSet

Hierarchy	Properties	Methods	Events	See also

TDataSet is the base class for all dataset components that represent data in rows and columns.

Unit

db

Description

TDataSet encapsulates a database-engine independent set of properties, events, and methods for working with data.

Many of the properties, events, and methods in TDataSet are abstract. Abstract declarations are declarations without implementations. At the TDataSet level they cannot be used or accessed. Developers must use or derive descendants of TDataSet that declare and implement these abstract methods. Many of the other TDataSet methods are declared and implemented in TDataSet as virtual methods, but the implementations are merely stubs that are reimplemented in descendants such as TClientDataSet, TBDEDataSet, TDBDataSet, TQuery, TStoredProc, and TTable.

Single-tiered applications that use flat-file data and multi-tiered database applications that use distributed datasets access their data using TClientDataSet, a direct descendant of TDataSet. Developers who develop their own distributed dataset objects should derive them from TClientDataSet as well.

Applications that base their data access on ActiveX Data Objects (ADO) use TADODataSet, another direct descendant of TDataSet, or the more specific descendants TADOTable and TADOQuery.

Traditional single-tiered and two-tiered database applications that access data through the Borland Database Engine (BDE) use TQuery, TStoredProc, or TTable objects. Developers who create custom dataset components that use the BDE directly in a client application derive them from TBDEDataSet, TDBDataSet, TQuery, TStoredProc, or TTable.


TDataSet properties

TDataSet	Alphabetically	Legend

In TDataSet

Active

ActiveRecord

AggFields

AutoCalcFields

BlobFieldCount

BlockReadSize

Bof

Bookmark

BookmarkSize

BufferCount

Buffers

CalcBuffer

CalcFieldsSize

CanModify

Constraints

CurrentRecord

DataSetField

DataSource

DefaultFields

Designer

Eof

FieldCount

FieldDefList

FieldDefs

FieldList

FieldNoOfs

Fields

FieldValues

Filter

Filtered

FilterOptions

Found

InternalCalcFields

Modified

Name

NestedDataSetClass

NestedDataSets

ObjectView

RecNo

RecordCount

RecordSize

Reserved

SparseArrays

State

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDataSet properties

TDataSet	By object	Legend

Active

ActiveRecord

AggFields

AutoCalcFields

BlobFieldCount

BlockReadSize

Bof

Bookmark

BookmarkSize

BufferCount

Buffers

CalcBuffer

CalcFieldsSize

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

CurrentRecord

DataSetField

DataSource

DefaultFields

Designer

DesignInfo

Eof

FieldCount

FieldDefList

FieldDefs

FieldList

FieldNoOfs

Fields

FieldValues

Filter

Filtered

FilterOptions

Found

InternalCalcFields

Modified

Name

NestedDataSetClass

NestedDataSets

ObjectView

Owner

RecNo

RecordCount

RecordSize

Reserved

SparseArrays

State

Tag

VCLComObject


TDataSet.Active

TDataSet	See also 	Example

Specifies whether or not a dataset is open.

property Active: Boolean;

Description

Use Active to determine or set a dataset’s connection to data in a database. When Active is False, the dataset is closed; the dataset cannot read data from or write data to the database. When Active is True, data can be read from and written to the database.

Setting Active to True

Triggers the BeforeOpen event handler if one is defined for the dataset.

Sets the dataset state to dsBrowse.

Opens a cursor into the dataset.

Triggers the After Open event handler if one is defined for the dataset.

If an error occurs while opening the dataset, dataset state is set to dsInactive, and the cursor is closed.

An application must set Active to False before changing other properties that affect the status of the database or the controls that display data in an application.

Note:	Calling the Open method sets Active to True; calling the Close method sets Active to False.


TDataSet.ActiveRecord

TDataSet	See also

Indicates the index of the active record in the internal cache of records.

property ActiveRecord: Integer;

Description

TDataSet maintains an internal cache of records from the underlying database table. For example, if the dataset is used to populate a data-aware grid, the cache includes a record for each row in the grid. ActiveRecord indicates the offset in this cache of the record buffer for the active record. This active record is the value returned by the public ActiveBuffer method.


TDataSet.AggFields

TDataSet	See also

Contains the aggregate fields.

property AggFields: TFields;

Description

Some TDataSet descendants, such as TClientDataSet, support aggregate fields. Aggregate fields summarize data over groups of records from the dataset (as opposed to calculated fields, which can only summarize data over the fields of a single record). AggFields is a collection of all such aggregate fields that are supported by the dataset.

Note:	The Fields property is a collection of all the dataset’s fields that are not aggregate fields. Thus, AggFields and Fields are mutually exclusive collections of the dataset’s fields. These two properties contain all of the dataset’s fields between them.


TDataSet.AutoCalcFields

TDataSet	See also

Determines when the OnCalcFields event is triggered.

property AutoCalcFields: Boolean;

Description

Set AutoCalcFields to control when the OnCalcFields event is triggered to update calculated fields during dataset processing. A calculated field is one that derives its value from the values of one or more fields in the active record, sometimes with additional processing.

When AutoCalcFields is True (the default), OnCalcFields is triggered when:

The dataset is opened.

The dataset is put into dsEdit state.

Focus moves from one visual control to another, or from one column to another in a data-aware grid and modifications were made to the record.

A record is retrieved from a database.

If an application permits users to change data, OnCalcFields is frequently triggered. In these cases an application may set AutoCalcFields to False to reduce the frequency with which AutoCalcFields is called. When AutoCalcFields is False, OnCalcFields is not called when changes are made to individual fields within a record.


TDataSet.BlobFieldCount

TDataSet

Indicates the number of columns in the dataset that represent Binary large object (BLOB) fields.

property BlobFieldCount: Integer;

Description

Descendants of TDataSet use BlobFieldCount when determining how to handle BLOB information.


TDataSet.BlockReadSize

TDataSet	See also

Determines how many record buffers are read in each block.

property BlockReadSize: Integer;

Description

Set BlockReadSize when to scan through the entire dataset quickly without updating data-aware controls. When BlockReadSize is greater than zero and Next is called, data-aware controls are not updated and data events are not triggered. Set BlockReadSize to zero to disable block read mode. The dataset State is dsBlockRead when BlockReadSize is greater than zero.


TDataSet.Bof

TDataSet	See also 	Example

Indicates whether or not a cursor is positioned at the first record in a dataset.

property Bof: Boolean;

Description

Test Bof (beginning of file) to determine if the cursor is positioned at the first record in a dataset. If Bof is True, the cursor is unequivocally on the first row in the dataset. Bof is True when an application

Opens a dataset.

Calls a dataset’s First method.

Call a dataset’s Prior method, and the method fails (because the cursor is already on the first row in the dataset).

Calls SetRange on an empty range or dataset.

Bof is False in all other cases.


TDataSet.Bookmark

TDataSet	See also

Specifies the current bookmark in the dataset.

type TBookmarkStr: string;

property Bookmark: TBookmarkStr;

Description

Bookmark gets or sets the current bookmark in a dataset. A bookmark marks a location in a dataset so that an application can easily return to that location quickly.

An application can read Bookmark to retrieve the bookmark associated with the current record, and it can position the cursor in the dataset by assigning a saved bookmark value to this property.


TDataSet.BookmarkSize

TDataSet	See also

Indicates the number of bytes used to represent a bookmark.

property BookmarkSize: Integer;

Description

Bookmarks mark a location in a dataset so that an application can easily return to that location quickly. Descendants of TDataSet can use different mechanisms for storing enough information to identify records when applications set bookmarks. BookmarkSize indicates the number of bytes required to specify bookmark information for a particular dataset.


TDataSet.BufferCount

TDataSet	See also

Indicates the number of records in the internal cache.

property BufferCount: Integer;

Description

TDataSet maintains an internal cache of records from the underlying database table. For example, if the dataset is used to populate a data-aware grid, the cache includes a record for each row in the grid. BufferCount indicates the size of this cache. An associated TDataLink object determines the value of BufferCount.


TDataSet.Buffers

TDataSet	See also

Provides indexed access to the record buffers in the internal cache.

property Buffers[Index: Integer]: PChar;

Description

TDataSet maintains an internal cache of records from the underlying database table. For example, if the dataset is used to populate a data-aware grid, the cache includes a record for each row in the grid. Each entry in Buffers points to a record buffer in the internal cache. The BufferCount property specifies the total number of record buffers in the cache.


TDataSet.CalcBuffer

TDataSet	See also

Points to the record buffer used during an OnCalcFields event.

property CalcBuffer: PChar;

Description

Datasets use CalcBuffer to retrieve and store values when in the dsCalcFields state. The values of lookup fields and calculated fields are set in CalcBuffer, based on data field values retrieved from this buffer.

Most applications do not need to explicitly reference CalcBuffer. It is used automatically when the dataset is in the dsCalcFields state.


TDataSet.CalcFieldsSize

TDataSet	See also

Indicates the number of bytes in a record buffer dedicated to storing calculated fields and lookup fields.

property CalcFieldsSize: Integer;

Description

TDataSet uses CalcFieldsSize to determine whether there are any calculated fields or lookup fields to calculate. Descendants of TDataSet use this property when locating fields in a record buffer.


TDataSet.CanModify

TDataSet	See also

Indicates whether the database underlying a dataset permits write access to data.

property CanModify: Boolean;

Description

This property is always True for an instance of TDataSet. Descendant classes, such as TQuery, TStoredProc, and TTable, redeclare and reimplement this property to perform meaningful tests to determine whether a dataset has write access to data.


TDataSet.Constraints

TDataSet	See also

Specifies record-level constraints that must be met when editing the data.

property Constraints: TCheckConstraints;

Description

Use Constraints to read or add record-level constraints to the dataset. Record-level constraints usually impose relationships between the fields in a single record. Constraints that limit the value of a single field should be added to the individual field components.


TDataSet.CurrentRecord

TDataSet	See also

Indicates the index of the current record in the internal cache of record buffers.

property CurrentRecord: Integer;

Description

TDataSet maintains an internal cache of records from the underlying database table. For example, if the dataset is used to populate a data-aware grid, the cache includes a record for each row in the grid. CurrentRecord indicates the offset in this cache of the record buffer for the current record.

The current record is the record currently in use by the dataset. This can differ from the active record (which the end user sees as active) when the dataset performs operations involving other records. For example, when painting a data-aware grid, CurrentRecord cycles through all the visible records, while ActiveRecord remains constant.


TDataSet.DataSetField

TDataSet	See also

Indicates the persistent TDataSetField object that owns the nested dataset.

property DataSetField: TDataSetField;

Description

Use DataSetField when the dataset is the nested detail set of another dataset, such as an Oracle8 nested dataset. Read DataSetField to access the data set field component in the master dataset that comprises this dataset. Set DataSetField to a field component in the master dataset to assign this dataset as the value of that field component.

Note:	When setting the DataSetField property, the dataset must be of (or a descendant of) the class specified by the master dataset’s NestedDataSetClass property. Otherwise, setting DataSetField raises an exception. Further, setting DataSetField to a TDataSetField that is contained in the same dataset raises an exception (A dataset can’t be nested in itself).


TDataSet.DataSource

TDataSet	See also

Represents the data source of another dataset that supplies values to the dataset.

property DataSource: TDataSource;

Description

As implemented in TDataSet, the DataSource property is always nil.

Descendant dataset classes that support specifying a data source redeclare and implement methods for getting and setting the DataSource property.


TDataSet.DefaultFields

TDataSet	See also

Indicates whether a dataset’s underlying field components are generated dynamically when the dataset is opened.

property DefaultFields Boolean;

Description

Read DefaultFields to determine whether a dataset uses dynamically generated field components or persistent field components. If DefaultFields is True, the dataset uses dynamically allocated field components. If DefaultFields is False, the dataset uses persistent field components.

Unless persistent field components are assigned to a dataset at design time using the Fields editor, the dataset creates dynamic field components based on the structure of its underlying database table or tables when it is opened.


TDataSet.Designer

TDataSet	See also

Returns a pointer to the Dataset designer for the dataset.

property Designer: TDataSetDesigner;

Description

Use Designer to determine whether the dataset is currently being designed and, if so, to access the dataset designer. When a dataset designer, such as the Fields editor, is created for a dataset at design time, it sets the Designer property to itself. When the dataset designer is destroyed, the Designer property is set back to nil. A Dataset designer enables a developer to specify the fields that belong to a dataset at design time.


TDataSet.Eof

TDataSet	See also 	Example

Indicates whether or not a cursor is positioned at the last record in a dataset.

property Eof: Boolean;

Description

Test Eof (end-of-file) to determine if the cursor is positioned at the last record in a dataset. If Eof is True, the cursor is unequivocally on the last row in the dataset. Eof is True when an application:

Opens an empty dataset.

Calls a dataset’s Last method.

Call a dataset’s Next method, and the method fails (because the cursor is already on the last row in the dataset).

Calls SetRange on an empty range or dataset.

Eof is False in all other cases.

Tip:	If both Eof and Bof are True, the dataset or range is empty.


TDataSet.FieldCount

TDataSet	See also 	Example

Indicates the number of field components associated with the dataset.

property FieldCount: Integer;

Description

Examine FieldCount to determine the number of fields listed by the Fields property. For datasets with dynamically created fields, FieldCount may differ each time a dataset is opened. For datasets with persistent fields, FieldCount should be unchanged each time a dataset is open.

Note:	FieldCount includes only the fields listed by the Fields property. Any aggregated fields listed by the AggFields property are not included in the count.


TDataSet.FieldDefList

TDataSet	See also

Points to the list of field definitions for the dataset.

property FieldDefList: TFieldDefList;

Description

FieldDefList points to an internal list of field definitions for the dataset. FieldDefList represents a flattened view of the data, meaning that object fields in the dataset may be represented by several simple field definitions that represent the constituents of the object field. To determine the definitions in a hierarchical view, use FieldDefs instead.

To access fields and field values in a dataset, use the Fields, AggFields, and FieldValues properties, and the FieldByName method.


TDataSet.FieldDefs

TDataSet	See also	Example

Points to the list of field definitions for the dataset.

property FieldDefs: TFieldDefs;

Description

FieldDefs lists the field definitions for a dataset. While an application can examine FieldDefs to explore the field definitions for a dataset, it should not change these definitions unless creating a new table with CreateTable or CreateDataSet.

To access fields and field values in a dataset, use the Fields, AggFields, and FieldValues properties, and the FieldsByName method.

Note:	If the dataset includes object field descendants, FieldDefs represents a hierarchical view of the data, meaning that the definitions include object field definitions. To determine the definitions in a flattened view, use FieldDefList instead.


TDataSet.FieldList

TDataSet	See also

Lists the field components of a dataset.

property FieldList: TFieldList;

Description

FieldList contains the names of all field components in the dataset. The fields are stored sequentially, or flattened out, meaning any child fields of an object field are stored as siblings in the TFieldList.Fields array.


TDataSet.FieldNoOfs

TDataSet	See also

Specifies the offset needed to convert indexes in the Fields property to field numbers.

property FieldNoOfs: Integer;

Description

Add FieldNoOfs to a field index to obtain its FieldNo property.


TDataSet.Fields

TDataSet	See also 	Example

Lists all non-aggregate field components of the dataset.

property Fields: TFields;

Description

Use Fields to access field components. If fields are generated dynamically at runtime, the order of field components in Fields corresponds directly to the order of columns in the table or tables underlying a dataset. If a dataset uses persistent fields, then the order of field components corresponds to the ordering of fields specified in the Fields editor at design time.

When ObjectView is True, the fields are stored hierarchically, meaning any child fields of an object field are referenced by the object field and don’t appear sequentially after the object field in the TFields.Fields array. When ObjectView is False, the fields are stored sequentially, or flattened out, meaning any child fields of an object field are stored sequentially in the TFields.Fields array.

Accessing fields with the Fields property is useful for applications that:

Iterate over some or all fields in a dataset.

Work with underlying tables whose internal data structure is unknown at runtime.

If an application knows the data types of individual fields, then it can read or write individual field values through the Fields property. For example, the following statement assigns a field value to the Text property of an edit box:

Edit1.Text := CustTable.Fields.Fields[6].AsString;

Note:	The preferred method for retrieving and assigning field values is to use persistent fields or the FieldByName method.

The next statements assigns a value from an edit box to a field:

CustTable.Edit;

CustTable.Fields.Fields[6].AsString := Edit1.Text;

CustTable.Post;

Note:	The AggFields property is a collection of all the dataset’s aggregated fields. Thus, AggFields and Fields are mutually exclusive collections of the dataset’s fields. These two properties contain all of the dataset’s fields between them.


TDataSet.FieldValues

TDataSet	See also 	Example

Provides access to the values for all fields in the active record for the dataset

property FieldValues[const FieldName: string]: Variant; default;

Description

Use FieldValues to read and write values for fields in a dataset. FieldName is the name of a field to read from or write to.

FieldValues reads from and writes to fields whether FieldName represents simple field names, qualified field names for subfields of an object field, or aggregated fields such as can be found in the AggFields property. Because of this flexibility, it is often preferable to use the FieldValues property (or the FieldByName method) rather than the Fields, FieldList, or AggFields properties, all of which present a more limited selection of the dataset’s fields.

FieldValues accepts and returns a Variant, so it can handle and convert fields of any type. Because FieldValues is the default property for TDataSet, you can omit the property name when referencing this property. For example, the following statements are semantically identical and write the value from an edit box into an integer field:

Customers.FieldValues['CustNo'] := Edit1.Text;

Customers['CustNo'] := Edit1.Text;

The next statement reads a string value from a field into an edit box:

Edit1.Text := Customers['Company'];

Note:	Because FieldValues always uses Variants, it may be a somewhat slower method of accessing data, than using a field’s native format (i.e., using a field’s AsXXX property), especially in applications that process large amounts of data.


TDataSet.Filter

TDataSet	See also

Specifies the text of the current filter for a dataset.

property Filter: string;

Description

Use Filter to specify a dataset filter. When filtering is applied to a dataset, only those records that meet a filter’s conditions are available to an application. Filter contains the string that describes the filter condition. For example, the following filter condition displays only those records where the State field is 'CA' or 'MA':

State = 'CA' or State = 'MA'

When a filter is set, Blank records do not appear unless explicitly included in the filter.  For example:

State <> 'CA' or State = NULL

When a field name contains spaces, you must enclose the field name in brackets. For example:

[Home State] = 'CA' or [Home State] = 'MA'

Filter expressions on remote SQL tables and on client datasets support field comparisons. For example:

Field1 > Field2

Field comparisons are not supported against local tables (Paradox, dBASE, Access, FoxPro).

The FilterOptions property controls case sensitivity and filtering on partial comparisons.

Tip:	Applications can set Filter at runtime to change the filtering condition for a dataset at (for example, in response to user input).


TDataSet.Filtered

TDataSet	See also

Specifies whether or not filtering is active for a dataset.

property Filtered: Boolean;

Description

Check Filtered to determine whether or not dataset filtering is in effect. If Filtered is True, then filtering is active. To apply filter conditions specified in the Filter property or the OnFilterRecord event handler, set Filtered to True.

Note:	When filtering is enabled, user edits to a record may mean that the record no longer meets a filter’s test condition. The next time an attempt is made to the read the record from the dataset while the filter is in effect, the record is not visible. If that happens, the next record that passes the filter condition becomes the active record.


TDataSet.FilterOptions

TDataSet	See also

Specifies whether or not filtering is case insensitive, and whether or not partial comparisons are permitted when filtering records.

property FilterOptions: TFilterOptions;

Description

Set FilterOptions to specify whether or not filtering is case insensitive when filtering on string or character fields, and whether or not partial comparisons for matching filter conditions is allowed.

By default, FilterOptions is set to an empty set. For filters based on string fields, set FilterOptions to foCaseInsensitive to catch all variations on a string regardless of capitalization.

When a string in a filter ends with an asterisk (*), it can be used to match partial strings. To disable matching of partial strings and to treat the asterisk as a literal character in string comparisons, set FilterOptions to include foNoPartialCompare.


TDataSet.Found

TDataSet	See also

Indicates whether or not moving to a different record is successful.

property Found: Boolean;

Description

Check the status of Found to determine if a call to FindFirst, FindLast, FindNext or, FindPrior succeeds. If Found is True, success is indicated. If False, the move to a different record failed.


TDataSet.InternalCalcFields

TDataSet	See also

Indicates whether the dataset includes internally calculated fields.

property InternalCalcFields: Boolean;

Description

Read InternalCalcFields to discover if the dataset includes fields whose values are provided by the data source but that are not a fields in the physical database table or query. Internally calculated fields are calculated by SQL servers or the Borland Database Engine in a live query view.

On TClientDataSet, internally calculated fields are stored with the rest of the data, allowing the developer to sort and filter on the calculated fields. However, internally calculated fields on client datasets are not updated when the data they depend on is updated.

Note:	Do not confuse internally calculated fields with calculated fields, which are computed in an OnCalcFields event.


TDataSet.Modified

TDataSet	See also

Indicates whether the active record is modified.

property Modified: Boolean;

Description

Check Modified to determine if the active record is modified. If Modified is True, the active record is modified. If False, the active record is not modified.

Note:	In general, an application need not check the status of Modified. Properties, events, and methods of TDataSet and its descendants that modify records generally check this status automatically and take appropriate actions based on its value.


TDataSet.Name

TDataSet	See also

Designates the name of the dataset as referenced by other components.

property Name: TComponentName;

Description

Use Name to change the name of a dataset to reflect its purpose in the current application. By default, the IDE assigns sequential names based on the type of the component, such as 'Table1', 'Table2', and so on.

When the name of the dataset is changed at design time, if any of the field components use the dataset name as a prefix to the field name, these field names are updated as well.


TDataSet.NestedDataSetClass

TDataSet	See also

Indicates the class type to use when creating nested datasets.

property NestedDataSetClass: TClass;

Description

Use NestedDataSetClass to specify the class to be used for nested datasets. By default, this value is the same as the class of the dataset instance.

NestedDataSetClass is used to check that nested detail sets are the appropriate type when they are assigned to a data set field (by assigning a value to their DataSetField property).


TDataSet.NestedDataSets

TDataSet	See also

Lists all nested datasets.

property NestedDataSets: TList;

Description

NestedDataSets is a list of the nested detail sets belonging to the data set. Each entry in the list is a dataset of the type specified by NestedDataSetClass.

Do not use NestedDataSets to assign values to dataset fields. Instead, set the DataSetField property of the detail set to reference the appropriate field component.


TDataSet.ObjectView

TDataSet	See also

Specifies whether fields are to be stored hierarchically or flattened out in the Fields property.

property ObjectView: Boolean;

Description

ObjectView affects the way the Fields property stores object fields and the way data-aware grids display ADT and array fields.

When ObjectView is True, the fields are stored hierarchically in the Fields property, meaning any child fields of an object field are referenced by the object field and don’t appear sequentially after the object field in the TFields.Fields array. When ObjectView is False, the fields are stored sequentially in the Fields property, meaning any child fields of an object field are stored after the object field as siblings in the Fields array.

When ObjectView is False, object field types, such as TADTField, are not created. This switch is provided for increased compatibility with older data-aware controls, which may not be able to handle object field types properly. The default is False for TBDEDataSet, and True for TClientDataSet.

Note:	If the ObjectView property of the TTable or TQuery provided to a TClientDataSet is False, then the TClientDataSet’s ObjectView property always acts as False, since the data received is already flattened.


TDataSet.RecNo

TDataSet	See also

Indicates the active record in the dataset.

property RecNo: Integer;

Description

As implemented in TDataSet, the value of RecNo is always -1. Ordinarily an application does not access RecNo at the TDataSet level. Instead a redeclared and implemented RecNo property in a descendant class such as TTable is accessed. RecNo provides a fallback property for derived datasets that do not support record numbers.


TDataSet.RecordCount

TDataSet	See also

Indicates the total number of records associated with the dataset.

property RecordCount: Integer;

Description

As implemented in TDataSet, RecordCount is always -1. Ordinarily an application does not access RecordCount at the TDataSet level. Instead a redeclared and implemented RecordCount property in a descendant class such as TTable is accessed. RecordCount provides a fallback property for derived dataset classes that do not reimplement the property access method.


TDataSet.RecordSize

TDataSet	See also

Indicates the size of a record in the dataset.

property RecordSize: Word;

Description

RecordSize is an abstract property that is redeclared and implemented in descendant objects derived from TDataSet. For TDataSet, RecordSize is meaningless.


TDataSet.Reserved

TDataSet

For internal use only.

property Reserved: Pointer;

Description

Do not use the Reserved property. It is for internal use only.


TDataSet.SparseArrays

TDataSet	See also

Determines whether a unique TField object is created for each element of an array field.

property SparseArrays: Boolean;

Description

When opening a table or client data set with an array field, SparseArrays determines whether a unique field component is created for each element of the array field. The default is False, where a TField descendant is created for each element of the array field. If you plan to bind data-aware controls to elements of the array field, SparseArrays must be set to False. Setting SparseArrays to True conserves memory, but does not allow applications to gain a reference to an element of the array field.


TDataSet.State

TDataSet	See also 	Example

Indicates the current operating mode of the dataset.

property State: TDataSetState;

Description

Examine State to determine the current operating mode of the dataset. State determines what can be done with data in a dataset, such as editing existing records or inserting new ones. The dataset state constantly changes as an application processes data.

Opening a dataset changes State from dsInactive to dsBrowse. An application can call Edit to put a dataset into dsEdit state, or call Insert to put a dataset into dsInsert state. If a dataset is a TTable object, an application can call SetKey or SetRange to put the dataset into dsSetKey state.

Posting or canceling edits, insertions, or deletions, changes State from its current state to dsBrowse. Closing a dataset changes its state to dsInactive.

Some states, such as dsCalcFields, dsFilter, dsNewValue, dsOldValue, and dsCurValue cannot be seen or set directly by an application. These states are automatically set when OnCalcField and OnFilterRecord events occur, or when an application accesses certain field properties.


TDataSet events

TDataSet	Alphabetically

In TDataSet

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TDataSet events

TDataSet	By object

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TDataSet.AfterCancel

TDataSet	See also	Example

Occurs after an application completes a request to cancel modifications to the active record.

property AfterCancel: TDataSetNotifyEvent;

Description

Write an AfterCancel event handler to take specific action after an application cancels changes to the active record. AfterCancel is called by the Cancel method after it updates the cursor position, releases the lock on the active record if necessary, and sets the dataset state to dsBrowse. If an application requires additional processing before returning control to a user after a Cancel event, code it in the AfterCancel event.


TDataSet.AfterClose

TDataSet	See also

Occurs after an application closes a dataset.

property AfterClose: TDataSetNotifyEvent;

Description

Write an AfterClose event handler to take specific action immediately after an application closes a dataset. For example, as a security measure, an application might clear a PASSWORD entry from the Params property of a database component when the dataset is closed.

AfterClose is called after a dataset is closed and the dataset state is set to dsInactive.


TDataSet.AfterDelete

TDataSet	See also 	Example

Occurs after an application deletes a record.

property AfterDelete: TDataSetNotifyEvent;

Description

Write an AfterDelete event handler to take specific action immediately after an application deletes the active record in a dataset. AfterDelete is called by Delete after it deletes the record, sets the dataset state to dsBrowse, and repositions the cursor on the record prior to the one just deleted.


TDataSet.AfterEdit

TDataSet	See also 	Example

Occurs after an application starts editing a record.

property AfterEdit: TDataSetNotifyEvent;

Description

Write an AfterEdit event handler to take specific action immediately after dataset enters edit mode. AfterEdit is called by Edit after it enables editing of a record, recalculates calculated fields, and calls the data event handler to process a record change.


TDataSet.AfterInsert

TDataSet	See also 	Example

Occurs after an application inserts a new record.

property AfterInsert: TDataSetNotifyEvent;

Description

Write an AfterInsert event handler to take specific action immediately after an application inserts a record. The Insert and Append methods generate an AfterInsert event after inserting or appending a new record.


TDataSet.AfterOpen

TDataSet	See also 	Example

Occurs after an application completes opening a dataset and before any data access occurs.

property AfterOpen: TDataSetNotifyEvent;

Description

Write an AfterOpen event handler to take specific action immediately after an application opens the dataset. AfterOpen is called after the cursor for the dataset is opened and the dataset is put into dsBrowse state. For example, an AfterOpen event handler might check the system registry to determine the last record touched in the dataset the previous time the application ran, and position the cursor at that record.


TDataSet.AfterPost

TDataSet	See also 	Example

Occurs after an application writes the active record to the database or cache returns to browse state.

property AfterPost: TDataSetNotifyEvent;

Description

Write an AfterPost event handler to take specific action immediately after an application posts a change to the active record. AfterPost is called after a modification, deletion, or insertion is made to a record.


TDataSet.AfterRefresh

TDataSet	See also

Occurs after an application refreshes the data in the dataset.

property AfterRefresh: TDataSetNotifyEvent;

Description

Write an AfterRefresh event handler to take specific action immediately after an application has updated the records in the dataset. AfterRefresh is generated by calls to the Refresh method.


TDataSet.AfterScroll

TDataSet	See also

Occurs after an application scrolls from one record to another.

property AfterScroll: TDataSetNotifyEvent;

Description

Write an AfterScroll event handler to take specific action immediately after an application scrolls to another record as a result of a call to the First, Last, MoveBy, Next, Prior, FindKey, FindFirst, FindNext, FindLast, FindPrior, and Locate methods. AfterScroll is called after all other events triggered by these methods and any other methods that switch from record to record in the dataset.


TDataSet.BeforeCancel

TDataSet	See also

Occurs before an application executes a request to cancel changes to the active record.

property BeforeCancel: TDataSetNotifyEvent;

Description

Write a BeforeCancel event to take specific action before an application carries out a request to cancel changes. BeforeCancel is called by the Cancel method before it cancels a dataset operation such as Edit, Insert, or Delete.

An application might use the BeforeCancel event to record a user’s changes in an undo buffer.


TDataSet.BeforeClose

TDataSet	See also	Example

Occurs before an application executes a request to close the dataset.

property BeforeClose: TDataSetNotifyEvent;

Description

Write a BeforeClose event to take specific action before an application closes a dataset. Calling Close or setting the Active property to False results in a call to the BeforeClose event handler.


TDataSet.BeforeDelete

TDataSet	See also

Occurs before an application attempts to delete the active record.

property BeforeDelete: TDataSetNotifyEvent;

Description

Write a BeforeDelete event handler to take specific action before an application deletes the active record. BeforeDelete is called by Delete before it actually deletes a record.

Making use of this event an application might, for example, display a dialog box asking for confirmation before deleting the record. On denial of confirmation, the application could abort the deletion by calling the Abort procedure.


TDataSet.BeforeEdit

TDataSet	See also

Occurs before an application enters edit mode for the active record.

property BeforeEdit: TDataSetNotifyEvent;

Description

Write a BeforeEdit event handler to take specific action before an application enables editing of the active record. For example, an application might keep a log of database edits, and therefore might record the edit request, time, and user in a BeforeEdit event before entering edit state.


TDataSet.BeforeInsert

TDataSet	See also 	Example

Occurs before an application enters insert mode.

property BeforeInsert: TDataSetNotifyEvent;

Description

Write a BeforeInsert event handler to take specific action before an application inserts or appends a new record. The Insert or Append method generates a BeforeInsert method before it sets the dataset into dsInsert state.


TDataSet.BeforeOpen

TDataSet	See also

Occurs before an application executes a request to open a dataset.

property BeforeOpen: TDataSetNotifyEvent;

propertyreadwrite

Description

Write a BeforeOpen event handler to take specific action before an application opens a dataset for viewing or editing. BeforeOpen is triggered when an application sets the Active property to True for a dataset or an application calls Open.


TDataSet.BeforePost

TDataSet	See also 	Example

Occurs before an application posts changes for the active record to the database or cache.

property BeforePost: TDataSetNotifyEvent;

Description

Write a BeforePost event handler to take specific action before an application posts dataset changes to the database. BeforePost is triggered when an application calls the Post method. Post checks to make sure all required fields are present, then calls BeforePost before posting the record.

An application might use BeforePost to perform validity checks on data changes before posting them to the database. If it encountered a validity problem, it could call Abort to cancel the Post operation.


TDataSet.BeforeRefresh

TDataSet	See also

Occurs immediately before an application refreshes the data in the dataset.

property BeforeRefresh: TDataSetNotifyEvent;

Description

Write a BeforeRefresh event handler to take specific action immediately before an application updates the records in the dataset. BeforeRefresh is generated by calls to the Refresh method.


TDataSet.BeforeScroll

TDataSet	See also

Occurs before an application scrolls from one record to another.

property BeforeScroll: TDataSetNotifyEvent;

Description

Write a BeforeScroll event handler to take specific action immediately before an application scrolls to another record as a result of a call to the First, Last, MoveBy, Next, Prior, FindKey, FindFirst, FindNext, FindLast, FindPrior, and Locate methods. BeforeScroll is called before all other events triggered by these methods and any other methods that switch from record to record in the dataset.


TDataSet.OnCalcFields

TDataSet	See also

Occurs when an application recalculates calculated fields.

property OnCalcFields: TDataSetNotifyEvent;

Description

Write an OnCalcFields event handler to take specific action when an application recalculates calculated fields. A calculated field is one that derives its value from the values in one or more fields in the dataset, sometimes with additional processing.

When the AutoCalcFields property is True, OnCalcFields is triggered when:

A dataset is opened.

A dataset is put into dsEdit state.

Focus moves from one visual control to another, or from one column to another is a data-aware grid control and modifications were made to the record.

A record is retrieved from a database.

Note:	When the AutoCalcFields property is True, an OnCalcFields event handler should not modify the dataset (or a linked dataset if it is part of a master-detail relationship), because such modifications retrigger the OnCalcField event, leading to recursion.

If an application permits users to change data, OnCalcFields is frequently triggered. To reduce the frequency with which OnCalcFields occurs, set AutoCalcFields to False. When AutoCalcFields is False, OnCalcFields is not called when changes are made to individual fields within a record.

Warning:	When the dataset is the master table of a master-detail relationship, OnCalcFields occurs before detail sets have been synchronized with the master table.


TDataSet.OnDeleteError

TDataSet	See also

Occurs when an application attempts to delete a record and an exception is raised.

type TDataSetErrorEvent = procedure(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction) of object;

property OnDeleteError: TDataSetErrorEvent;

Description

Write an OnDeleteError event handler to handle exceptions that occur when an attempt to delete a record fails.

DataSet is the dataset that failed to delete a record. E is a pointer to the database error object that contains the exception error message so that an application can display an error message. Action indicates how the dataset should respond to the error.

When OnDeleteError is first invoked, Action is always set to daFail. If the error handler can correct the error condition that caused the handler to be invoked, set Action to daRetry before exiting the handler. When Action is daRetry, the delete operation is tried again. If the error condition cannot be corrected, the display of the error message can be suppressed, if desired, by setting Action to daAbort instead of daFail.


TDataSet.OnEditError

TDataSet	See also

Occurs when an application attempts to modify or insert a record and an exception is raised.

type TDataSetErrorEvent = procedure(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction) of object;

property OnEditError: TDataSetErrorEvent;

Description

Write an OnEditError event handler to handle exceptions that occur when an attempt to edit a record fails.

DataSet is the dataset that failed in editing a record. E is a pointer to the database error object that contains the exception error message so that an application can display an error message. Action indicates how the dataset should respond to the error.

When the OnEditError event handler is first invoked, Action is always set to daFail. If the error handler can correct the error condition that caused the handler to be invoked, set Action to daRetry before exiting the handler. When Action is daRetry, the edit operation is tried again. If an error condition cannot be corrected, the display of the error message can be suppressed, if desired, by setting Action to daAbort instead of daFail.


TDataSet.OnFilterRecord

TDataSet	See also 	Example

Occurs each time a different record in the dataset becomes the active record and filtering is enabled.

type TFilterRecordEvent = procedure(DataSet: TDataSet; var Accept: Boolean) of object;

property OnFilterRecord: TFilterRecordEvent;

Description

Write an OnFilterRecord event handler to specify for each record in a dataset whether it should be visible to the application. To indicate that a record passes the filter condition, an OnFilterRecord event handler must set the Accept parameter to True. To exclude a record, set the Accept parameter to False.

Filtering is enabled if the Filtered property is True. When an application is processing a filter, the State property for the dataset is dsFilter.

Use an OnFilterRecord event handler to filter records using a criterion that can’t be implemented using the Filter property.  For example, using the Filter property, field comparisons are not supported against local tables (Paradox, dBASE, Access, FoxPro), but an OnFilterRecord event handler can implement any criterion at all.

Note:	Be sure that the interactions between the Filter property and the OnFilterRecord event handler do not result in an empty filter set when they are used simultaneously in an application.


TDataSet.OnNewRecord

TDataSet	See also

Occurs when an application inserts or appends a new dataset record.

property OnNewRecord: TDataSetNotifyEvent;

Description

Write an OnNewRecord event handler to take specific actions as an application inserts or appends a new record. OnNewRecord is called as part of the actual insert or append process. An application might use the OnNewRecord event to set initial values for a record or as a way of implementing cascading insertions in related datasets.


TDataSet.OnPostError

TDataSet	See also

Occurs when an application attempts to modify or insert a record and an exception is raised.

type TDataSetErrorEvent = procedure(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction) of object;

property OnPostError: TDataSetErrorEvent;

Description

Write an OnPostError event handler to handle exceptions that occur when an attempt to post a record fails.

DataSet is the dataset that failed to post a record. E is a pointer to the database error object that contains the exception error message so that an application can display an error message. Action indicates how the dataset should respond to the error.

When OnPostError is first invoked, Action is always set to daFail. If the error handler can correct the error condition that caused the handler to be invoked, set Action to daRetry before exiting the handler. When Action is daRetry, the post operation is tried again. If an error condition cannot be corrected, the display of the error message can be suppressed, if desired, by setting Action to daAbort instead of daFail.


TDataSet methods

TDataSet	Alphabetically

In TDataSet

ActiveBuffer

Append

AppendRecord

BookmarkValid

Cancel

CheckBrowseMode

ClearFields

Close

CompareBookmarks

ControlsDisabled

Create

CreateBlobStream

CursorPosChanged

Delete

Destroy

DisableControls

Edit

EnableControls

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBlobFieldData

GetBookmark

GetCurrentRecord

GetDetailDataSets

GetDetailLinkFields

GetFieldData

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsEmpty

IsLinkedTo

IsSequenced

Last

Locate

Lookup

MoveBy

Next

Open

Post

Prior

Refresh

Resync

SetFields

Translate

UpdateCursorPos

UpdateRecord

UpdateStatus

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataSet methods

TDataSet	By object

ActiveBuffer

AfterConstruction

Append

AppendRecord

Assign

BeforeDestruction

BookmarkValid

Cancel

CheckBrowseMode

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClearFields

Close

CompareBookmarks

ControlsDisabled

Create

CreateBlobStream

CursorPosChanged

DefaultHandler

Delete

Destroy

DestroyComponents

Destroying

DisableControls

Dispatch

Edit

EnableControls

ExecuteAction

FieldAddress

FieldByName

FindComponent

FindField

FindFirst

FindLast

FindNext

FindPrior

First

Free

FreeBookmark

FreeInstance

FreeNotification

FreeOnRelease

GetBlobFieldData

GetBookmark

GetCurrentRecord

GetDetailDataSets

GetDetailLinkFields

GetFieldData

GetFieldList

GetFieldNames

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GotoBookmark

HasParent

InheritsFrom

InitInstance

Insert

InsertComponent

InsertRecord

InstanceSize

IsEmpty

IsLinkedTo

IsSequenced

Last

Locate

Lookup

MethodAddress

MethodName

MoveBy

NewInstance

Next

Open

Post

Prior

Refresh

RemoveComponent

Resync

SafeCallException

SetFields

Translate

UpdateAction

UpdateCursorPos

UpdateRecord

UpdateStatus


TDataSet.ActiveBuffer

TDataSet	See also

Returns a pointer to the buffer for the active record.

function ActiveBuffer: PChar;

Description

ActiveBuffer is used internally by many dataset methods to ensure that the active buffer points to the buffer for the active record. If an application uses existing dataset methods, the active buffer is always set correctly, so there is usually no need to call ActiveBuffer directly.

ActiveBuffer is also used by bookmarking methods to index into the active record buffer to retrieve bookmark information.

Applications that provide custom dataset routines may need to call ActiveBuffer to access the buffer data.


TDataSet.Append

TDataSet	See also 	Example

Adds a new, empty record to the end of the dataset.

procedure Append;

Description

Call Append to:

1	Open a new, empty record at the end of the dataset.

2	Set the active record to the new record.

After a call to Append, an application can enable users to enter data in the fields of the record, and can then post those changes to the database using Post (or ApplyUpdates if cached updating is enabled). A newly appended record is posted to the database in one of three ways:

For indexed Paradox and dBASE tables, the record is inserted into the dataset in a position based on its index.

For unindexed Paradox and dBASE tables, the record is added to the end of the dataset.

For SQL databases, the physical location of the appended record is implementation-specific. For indexed tables, the index is updated with the new record information.


TDataSet.AppendRecord

TDataSet	See also 	Example

Adds a new, populated record to the end of the dataset and posts it to the database.

procedure AppendRecord(const Values: array of const);

Description

Call AppendRecord to create a new, empty record at the end of the dataset, populate it with the field values in Values, and post the values to the database.

A newly appended record is posted to the database in one of three ways:

For indexed Paradox and dBASE tables, the record is inserted into the dataset in a position based on its index.

For unindexed Paradox and dBASE tables, the record is added to the end of the dataset.

For SQL databases, the physical location of the append is implementation-specific. For indexed tables, the index is updated with the new record information.

The newly appended record becomes the active record.


TDataSet.BookmarkValid

TDataSet	See also

Indicates the validity of a specified bookmark.

function BookmarkValid(Bookmark: TBookmark): Boolean; virtual;

Description

This function returns False in all cases, indicating that any bookmark is invalid because the TDataSet class does not implement support for bookmarks.

Descendant classes that implement bookmark support override BookmarkValid to test bookmarks for validity and indicate when a bookmark is valid by returning True.


TDataSet.Cancel

TDataSet	See also

Cancels modifications to the active record if those changes are not yet posted.

procedure Cancel; virtual;

Description

Call Cancel to undo modifications made to one or more fields belonging to the active record. As long as those changes are not already posted to the database, Cancel returns the record to its previous state, and sets the dataset state to dsBrowse.

Typically Cancel is used to back out of changes in response to user request, or in field validation routines that back out illegal field values. The TDBNavigator object contains a Cancel button that calls Cancel.


TDataSet.CheckBrowseMode

TDataSet	See also

Automatically posts or cancels data changes when an application changes which record in the dataset is the active record.

procedure CheckBrowseMode;

Description

CheckBrowseMode is used internally by many dataset methods to ensure that modifications to the active record are posted to the database when a dataset’s state is dsEdit, dsInsert, or dsSetKey state and a method switches to a different record.

If State is dsEdit or dsInsert, CheckBrowseMode calls UpdateRecord, and then, if the Modified property for the dataset is True, calls Post. If Modified is False, CheckBrowseMode calls Cancel.

If State is dsSetKey, CheckBrowseMode calls Post.

If State is dsInactive, CheckBrowseMode raises an exception.

If an application uses existing dataset methods, CheckBrowseMode is always called when necessary, so there is usually no need to call CheckBrowseMode directly.

Applications that provide custom dataset routines may need to call CheckBrowseMode inside those routines to guarantee that changes are posted to the database when switching to a different record.


TDataSet.ClearFields

TDataSet	See also

Clears the contents of all fields for the active record.

procedure ClearFields;

Description

Call ClearFields to erase the current contents of all fields for the active record. If the dataset is not in either dsInsert or dsEdit state, ClearFields raises an exception.

If a SetKey operation is not under way, ClearFields recalculates all calculated fields, and generates an OnDataChange event on the data source component associated with the dataset.


TDataSet.Close

TDataSet	See also

Closes a dataset.

procedure Close;

Description

Call Close to set the Active property of a dataset to False. When Active is False, the dataset is closed; it cannot read data from or write data to the database.

An application must set Active to False before changing other properties that affect the status of the database or the controls that display data in an application. For example, to change the DataSource property for a dataset, the dataset must be closed. Closing the dataset puts it into the dsInactive state and closes the BDE cursor.


TDataSet.CompareBookmarks

TDataSet	See also

Implements a virtual function to compare two bookmarks.

function CompareBookmarks(Bookmark1, Bookmark2: TBookmark): Integer; virtual;

Description

As implemented in TDataSet, CompareBookmarks always returns 0, indicating no difference between the bookmarks. This is because TDataSet does not implement support for bookmarks.

Descendant classes that provide bookmark support override this method to return a value less than 0 if Bookmark1 is less than Bookmark2, 0 if the bookmarks are identical, and a value greater than 0 if Bookmark1 is greater than Bookmark2.


TDataSet.ControlsDisabled

TDataSet	See also

Indicates whether data-aware controls do not update their display to reflect changes to the dataset.

function ControlsDisabled: Boolean;

Description

Call ControlsDisabled to determine if the updating of data display in data-aware controls is currently disabled. If ControlsDisabled is True, controls are currently disabled. ControlsDisabled is True as long as the reference count that keeps track of disabling for the dataset is greater than zero. This count is incremented every time the DisableControls procedure is called and decremented when EnableControls is called. Applications should call DisableControls to improve performance and prevent constant updates during automated iterations through records in the dataset.

In complex applications, when controls may be disabled multiple times by different processes, you can use ControlsDisabled as a check in a procedure to reenable controls should each call to DisableControls not be paired with a subsequent call to EnableControls. For example,

procedure ReEnableControls (DataSet: TDataSet);

begin

while DataSet.ControlsDisabled do

  DataSet.EnableControls;

end;


TDataSet.Create

TDataSet	See also

Creates an instance of a TDataSet component.

constructor Create(AOwner: TComponent);

Description

Call Create to instantiate a dataset component at runtime. TDataSet contains abstract methods, and is not intended to be used in applications. Instead, applications instantiate dataset descendants such as TClientDataSet, TADODataSet, TTable, TQuery, or TStoredProc.

Create creates the empty field and field definition lists, empty field buffers, and initializes default property values (such as setting AutoCalcFields to True).


TDataSet.CreateBlobStream

TDataSet	See also

Provides the interface for a method that creates a blob stream for a Binary large object (BLOB) field in the dataset.

function CreateBlobStream(Field: TField; Mode: TBlobStreamMode): TStream; virtual;;

Description

Call CreateBlobStream to obtain a stream for reading and writing the value of the field specified by the Field parameter. The Mode parameter indicates whether the stream will be used for reading the field’s value (bmRead), writing the field’s value (bmWrite), or modifying the field’s value (bmReadWrite).

Blob streams are created in a specific mode for a specific field on a specific record. Applications should create a new blob stream every time the record in the dataset changes rather than reusing an existing blob stream.

As implemented in TDataSet, CreateBlobStream always returns nil. Descendants of TDataSet override this method to create the TStream descendant that reads and writes BLOB data in the format that dataset type uses to store BLOB fields.

Tip:	It is preferable to call CreateBlobStream rather than creating a blob stream directly in code. This ensures that the stream is appropriate to the dataset, and may also ensure that datasets that do not always store BLOB data in memory fetch the blob data before creating the stream.


TDataSet.CursorPosChanged

TDataSet	See also

Marks the internal cursor position as invalid.

procedure CursorPosChanged;

Description

CursorPosChanged is an internal method that invalidates the variable that tracks the physical cursor position relative to the logical cursor position. CurPosChanged is called by the Locate and Lookup methods prior to searching for a requested record. These methods, if successful, reposition the cursor at the first matching record found.


TDataSet.Delete

TDataSet	See also

Deletes the active record and positions the cursor on the next record.

procedure Delete;

Description

Call Delete to remove the active record from the database. If the dataset is inactive, Delete raises an exception. Otherwise Delete:•	Verifies that the dataset is not empty (and raises an exception if it is).

Calls CheckBrowseMode to post any pending changes to a prior record if necessary.

Calls the BeforeDelete event handler.

Deletes the record.

Frees the buffers allocated for the record.

Puts the dataset into dsBrowse mode.

Resynchronizes the dataset to position the cursor on the next undeleted record.

Calls the AfterDelete event handler.


TDataSet.Destroy

TDataSet	See also

Destroys the TDataSet instance.

destructor Destroy;

Description

Do not call Destroy directly in an application. Usually destruction of datasets is handled automatically by Delphi. If an application creates its own instances of a dataset, however, and does not assign an Owner that is responsible for freeing the dataset, then the application should call Free, which checks that the dataset reference is not nil before calling Destroy.

Destroy performs the following tasks:

Closes the dataset.

Frees the Dataset Designer for the dataset, if it exists.

Disassociated the dataset from its data source components and frees the memory allocated for them.

Destroys the fields and field definitions associated with the dataset and frees the memory allocated to them.

Calls the inherited destructor.


TDataSet.DisableControls

TDataSet	See also 	Example

Disables data display in data-aware controls associated with the dataset.

procedure DisableControls;

Description

Call DisableControls prior to iterating through a large number of records in the dataset to prevent data-aware controls from updating every time the active record changes. Disabling controls prevents flicker and speeds performance because data does not need to be written to the display.

If controls are not already disabled, DisableControls records the current state of the dataset, broadcasts the state change to all associated data-aware controls and detail datasets, and increments the dataset’s disabled count variable. Otherwise, DisableControls just increments the disabled count variable.

The disabled count is used internally by other methods and objects to determine whether to display data in data-aware controls. When the disable count variable is greater than zero, data is not displayed.

If the dataset is the master of a master/detail relationship, calling DisableControls also disables the master/detail relationship. Setting BlockReadSize instead of calling DisableControls updates the detail datasets as you scroll through the dataset, but does not update data-aware controls.

Note:	DisableControls can safely be called when controls are already disabled. In complex applications there may be separate operations that are sometimes nested, both of which need to disable controls.


TDataSet.Edit

TDataSet	See also 	Example

Enables editing of data in the dataset.

procedure Edit;

Description

Call Edit to permit editing of the active record in a dataset. Edit determines the current state of the dataset. If the dataset is empty, Edit calls Insert. Otherwise Edit

Calls CheckBrowseMode to post any pending changes to a prior record if necessary.

Calls the BeforeEdit event handler.

Retrieves the record.

Puts the dataset into dsEdit state, enabling the application or user to modify fields in the record.

Broadcasts the state change to associated controls.

Calls the AfterEdit event handler.


TDataSet.EnableControls

TDataSet	See also 	Example

Re-enables data display in data-aware controls associated with the dataset.

procedure EnableControls;

Description

Call EnableControls to permit data display in data-aware controls after a prior call to DisableControls. EnableControls decrements the disabled count variable for the dataset if it is not already zero. If the disable count variable is zero, EnableControls updates the current state of the dataset, if necessary, and then tells associated controls to re-enable display.


TDataSet.FieldByName

TDataSet	See also 	Example

Finds a field based on its name.

function FieldByName(const FieldName: string): TField;

Description

Call FieldByName to retrieve field information for a field when only its name is known. FieldName is the name of an existing field. FieldByName returns the TField component for the specified field. If the specified field does not exist, FieldByName raises an EDatabaseError exception.

FieldName can be the name of a simple field, the name of a subfield of an object field that has been qualified by the parent field’s name, or the name of an aggregated field. Because of this flexibility, it is often preferable to use FieldByName rather than the Fields property or the AggFields property.

An application can directly access specific properties and methods of the field returned by FieldByName. For example, the following statement determines if a specified field is a calculated field or not:

if Customers.FieldByName('FullName').Calculated then

  MessageDlg(Format('%s is a calculated field. ', ['FullName’]), mtInformation, [mbOK], 0);

FieldByName is especially useful at design time for developers who are creating database applications, but who do not have access to the underlying table and therefore cannot use persistent field components.

Note:	To retrieve or set the value for a specific field, call the default dataset method FieldValues instead of FieldByName.


TDataSet.FindField

TDataSet	See also 	Example

Searches for a specified field in the dataset.

function FindField(const FieldName: string): TField;

Description

Call FindField to determine if a specified field component exists in a dataset. FieldName is the name of the field for which to search. If FindField finds a field with a matching name, it returns the TField component for the specified field. Otherwise it returns nil.

FindField is the same as the FieldByName method, except that it returns nil rather than raising an exception when the field is not found.


TDataSet.FindFirst

TDataSet	See also

Implements a virtual method for positioning the cursor on the first record in a filtered dataset.

function FindFirst: Boolean;

Description

This function returns False, indicating that the cursor was not successfully repositioned. Descendant classes override FindFirst to position the cursor on the first record of the dataset, honoring any filters that are in effect. FindFirst should return True if the cursor is successfully repositioned.


TDataSet.FindLast

TDataSet	See also

Implements a virtual method for positioning the cursor on the last record in a filtered dataset.

function FindLast: Boolean;

Description

This function returns False, indicating that the cursor was not successfully repositioned. Descendant classes override FindLast to position the cursor on the last record of the dataset, honoring any filters that are in effect. FindLast should return True if the cursor is successfully repositioned.


TDataSet.FindNext

TDataSet	See also

Implements a virtual method for positioning the cursor on the next record in a filtered dataset.

function FindNext: Boolean;

Description

This function returns False, indicating that the cursor was not successfully repositioned. Descendant classes override FindNext to position the cursor on the next record of the dataset, honoring any filters that are in effect. FindNext should return True if the cursor is successfully repositioned.


TDataSet.FindPrior

TDataSet	See also 	Example

Implements a virtual method for positioning the cursor on the previous record in a filtered dataset.

function FindPrior: Boolean;

Description

This function returns False, indicating that the cursor was not successfully repositioned. Descendant classes override FindPrior to position the cursor on the previous record of the dataset, honoring any filters that are in effect. FindPrior should return True if the cursor is successfully repositioned.


TDataSet.First

TDataSet	See also 	Example

Positions the cursor on the first record in the dataset.

procedure First;

Description

Call First to position the cursor on the first record in the dataset and make it the active record. First posts any changes to the active record and:

Clears the record buffers.

Sets the cursor to the beginning of the dataset file.

Fetches the first record, positions the cursor on it, and makes it the active record.

Fetches any additional records required for display, such as those needed to fill out a grid control.

Sets the Bof property to True.

Broadcasts the record change so that data controls and linked detail sets can update.

Note:	TDataSet uses internal, protected methods to position the database cursor and to fetch additional records required for display. In TDataSet, these internal methods are abstract. Descendant classes implement these methods to enable the First method to work.


TDataSet.FreeBookmark

TDataSet	See also 	Example

Frees the resources allocated for a specified bookmark.

procedure FreeBookmark(Bookmark: TBookmark); virtual;

Description

Call FreeBookmark to free an existing bookmark before reassigning it. FreeBookmark releases the memory allocated for a specified bookmark when the bookmark is no longer needed.


TDataSet.GetBlobFieldData

TDataSet	See also

Reads BLOB data into a buffer.

function GetBlobFieldData(FieldNo: Integer; var Buffer: TBlobByteData): Integer; virtual;

Description

GetBlobFieldData reads blob data from the field specified by FieldNo into a Buffer. The buffer is a dynamic array of bytes, so that it can grow to accommodate the size of the BLOB data. GetBlobFieldData returns the size of the buffer.


TDataSet.GetBookmark

TDataSet	See also 	Example

Allocates a bookmark for the current cursor position in the dataset.

function GetBookmark: TBookmark; virtual;

Description

Call GetBookmark to establish a bookmark for the active record in the dataset. Establishing a bookmark for a record enables an application to return to that record in the dataset at any time while the bookmark exists.

GetBookmark requires that a variable of type TBookmark already be declared in the application. Use GetBookmark to assign the variable a value that can be referenced by subsequent calls to GotoBookmark and FreeBookmark.

Note:	Applications that create bookmarks with GetBookmark should subsequently release the system resource allocated to them by calling FreeBookmark when the bookmarks are no longer needed.


TDataSet.GetCurrentRecord

TDataSet	See also

Implements a virtual function to retrieve the current record in a buffer.

function GetCurrentRecord(Buffer: PChar): Boolean; virtual;

Description

This function always returns False, indicating failure. TDataSet descendants override this method to retrieve the value of the current record. If Buffer is successfully filled with the value of the current record, GetCurrentRecord should return True.


TDataSet.GetDetailDataSets

TDataSet	See also

Fills a list with a dataset for every detail dataset that is not the value of a nested dataset field.

procedure GetDetailDataSets(List: TList);

Description

Datasets can represent master/detail relationships in two ways: as linked cursors or as nested dataset fields. GetDetailDataSets lists all detail datasets of the active record into List if they are not the value of a nested dataset field. To obtain a list of the detail datasets that are the values of nested dataset fields, use the NestedDataSets property instead.


TDataSet.GetDetailLinkFields

TDataSet

Introduces a method to list the field components that link this dataset as a detail of a master dataset.

procedure GetDetailLinkFields(MasterFields, DetailFields: TList); virtual;

Description

As implemented in TDataSet, GetDetailLinkFields does nothing. Descendants override this method to fill the two lists with field components that define a master-detail relationship between this dataset and another (master) dataset. The MasterFields list is filled with fields from the master table whose values must equal the values of the fields in the DetailFields list. The DetailFields list is filled with fields from the calling dataset.


TDataSet.GetFieldList

TDataSet	See also

Retrieves a specified set of field objects into a list.

procedure GetFieldList(List: TList; const FieldNames: string);

Description

Call GetFieldList to copy a specified set of field objects into a list object created and maintained by the application.

List is the TList object into which to copy the field objects. FieldNames is a string containing the name of the fields to copy. Each field name in the string must be separated from other field names with a semicolon. GetFieldList builds a list that contains only the field objects for which it finds a matching name in the dataset’s list of field objects.

Note:	Applications do not normally call GetFieldList to copy field objects. Field objects are directly accessible through the dataset itself. In some cases, however, it can be useful to work with a copy of a field object or its data instead of working on the actual object in the dataset.


TDataSet.GetFieldData

TDataSet	See also

Retrieves the current value of a field into a buffer.

function GetFieldData(FieldNo: Integer; Buffer: Pointer): Boolean; overload; virtual;

function GetFieldData(Field: TField; Buffer: Pointer): Boolean; overload; virtual;

function GetFieldData(Field: TField; Buffer: Pointer; NativeFormat: Boolean): Boolean; overload; virtual;

Description

Most applications do not need to call GetFieldData. TField objects call this method to implement their GetData method.

The Field or FieldNo parameter indicates the field whose data should be fetched. Field specifies the component itself, while FieldNo indicates its field number. The Buffer parameter is a memory buffer with sufficient space to accept the value of the field as it exists in the database (unformatted and untranslated). NativeFormat indicates whether the dataset fetches the field in Delphi’s native format for the field type. When NativeFormat is False, the dataset must convert the field value to the native type. This allows the field to handle data from different types of datasets (ADO-based, BDE-based, and so on) in a uniform manner.

GetFieldData returns a value that indicates whether the data was successfully fetched.

As implemented in TDataSet, GetFieldData always returns False, indicating that no data was fetched from the specified field. Descendants override this method to fetch data in whatever way is appropriate to the implementation of the dataset.


TDataSet.GetFieldNames

TDataSet	See also

Retrieves a list of names for all fields in a dataset.

procedure GetFieldNames(List: TStrings);

Description

Call GetFieldNames to get a list of names for all fields in a dataset. List is a TStrings object created and maintained by the application. For example, to load a list box with the field names of a table,

Table1.GetFieldNames(ListBox1.Items);

Retrieving a list of field names is especially useful for applications that work with datasets whose field objects are created dynamically at runtime. By retrieving a list of field names, the application can be restricted to working only with fields that exist at runtime.

Note:	GetFieldNames does not add the names of any aggregated fields to the list.


TDataSet.GotoBookmark

TDataSet	See also 	Example

Implements a virtual method to position the cursor on the record pointed to by a specified bookmark.

procedure GotoBookmark(Bookmark: TBookmark);

Description

GotoBookmark calls a virtual, abstract internal method that is not implemented by TDataSet. Descendants of TDataSet redeclare and implement the internal method so that GotoBookmark makes the record identified by the Bookmark parameter active.


TDataSet.Insert

TDataSet	See also 	Example

Inserts a new, empty record in the dataset.

procedure Insert;

Description

Call Insert to:

1	Open a new, empty record in the dataset.

2	Set the active record to the new record.

After a call to Insert, an application can enable users to enter data in the fields of the record, and then post those changes to the database using Post (or ApplyUpdates if cached updating is enabled). A newly inserted record is posted to the database in one of three ways:

For Paradox tables with primary indexes, the record is inserted into the dataset in a position based on its index.

For Paradox tables without primary indexes, the record is inserted into the dataset at the current cursor position.

For dBASE, FoxPro, and Access tables, the record is physically appended to the dataset at the end. If an index happens to be active, the new record may appear in a position relative to the index, but the record is still actually stored at the end of the table.

For SQL databases, the physical location of the insert is implementation-specific. For indexed tables, the index is updated with the new record information.


TDataSet.InsertRecord

TDataSet	See also 	Example

Inserts a new, populated record to the dataset and posts it to the database.

procedure InsertRecord(const Values: array of const);

Description

Call InsertRecord to create a new, empty record at in the dataset, populate it with the field values in Values, and post the values to the database.

A newly inserted record is posted to the database in one of three ways:

For indexed Paradox and dBASE tables, the record is inserted into the dataset in a position based on its index.

For unindexed Paradox tables, the record is inserted into the dataset at the current cursor position.

For unindexed dBASE, FoxPro, and Access tables, the record is inserted into the dataset at the end.

For SQL databases, the physical location of the insert is implementation-specific. For indexed tables, the index is updated with the new record information.

The newly inserted record becomes the active record.


TDataSet.IsEmpty

TDataSet	See also

Indicates whether the dataset contains no records.

function IsEmpty: Boolean;

Description

Call IsEmpty to determine if a dataset has records. IsEmpty returns True if the dataset does not contain any records. Otherwise it returns False.


TDataSet.IsLinkedTo

TDataSet	See also

Indicates whether a dataset is linked to a specified data source.

function IsLinkedTo(DataSource: TDataSource): Boolean;

Description

Call IsLinkedTo to verify that a dataset is linked to a specific data source. DataSource is the name of the data source against which to test.

Note:	IsLinkedTo is mainly provided for developers deriving custom components based on TDataSet. It is not intended or needed for general data access.

If the datasource already provides data from the dataset or one of its nested dataset fields (or a nested dataset nested in a dataset field...),  IsLinkedTo returns True. If the datasource provides data from some other dataset, or if the data source does not already have a dataset of its own, IsLinkedTo returns False.


TDataSet.IsSequenced

TDataSet	See also

Indicates whether the underlying database table uses record numbers to indicate the order of records.

function IsSequenced: Boolean; virtual;

Description

Use IsSequenced to determine whether the underlying database table supports sequence numbers, or whether these are computed by the dataset component. When IsSequenced returns True, applications can safely use the RecNo property to navigate to records in the dataset.

As implemented in TDataSet, IsSequenced always returns True. Descendants of TDataSet reimplement this method to return a value that depends on the underlying table type.


TDataSet.Last

See also

Positions the cursor on the last record in the dataset.

procedure Last;

Description

Call Last to position the cursor on the last record in the dataset and make it the active record. Last posts any changes to the active record and

Clears the record buffers.

Sets the cursor to the end of the dataset file.

Fetches the last record, positions the cursor on it, and makes it the active record.

Fetches any additional records required for display, such as those needed to fill out a grid control.

Sets the Eof property to True.

Broadcasts the record change so that data controls and linked detail sets can update.

Note:	TDataSet uses internal, protected methods to position the database cursor and to fetch additional records required for display. In TDataSet, these internal methods are abstract. Descendant classes implement these methods to enable the Last method to work.


TDataSet.Locate

TDataSet	See also

Implements a virtual method for searching a dataset for a specified record and makes that record the active record.

function Locate(const KeyFields: string; const KeyValues: Variant; Options: TLocateOptions): Boolean; virtual;

Description

This function returns False, indicating that a matching record was not found and the cursor is not repositioned.

Descendant classes override this method so that it locates the record where the fields identified by the comma-delimited string KeyFields have the values specified by the Variant or Variant array KeyValues. Options indicates whether the search is case insensitive and whether partial matches are supported. Locate should return True if a record is found that matches the specified criteria and the cursor repositioned to that record.


TDataSet.Lookup

TDataSet	See also

Implements a virtual method to retrieve field values from a record that matches specified search values.

function Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: string): Variant; virtual;

Description

This function returns a Variant with the value False, indicating that a matching record was not found.

Descendant classes override this method so that it locates the record where the fields identified by the comma-delimited string KeyFields have the values specified by the Variant or Variant array KeyValues. In classes that implement Lookup, it returns a Variant or Variant array that contains the value or values of the fields specified by the comma-delimited string ResultFields on the specified record.


TDataSet.MoveBy

TDataSet	See also	Example

Positions the cursor on a record relative to the active record in the dataset.

function MoveBy(Distance: Integer): Integer;

Description

Call MoveBy to position the cursor on a record relative to the active record in the dataset. Distance indicates the number of records to move. A positive value for Distance indicates forward progress through the dataset, while a negative value indicates backward progress. For example, the following statement moves backward through the dataset by 10 records:

MoveBy(-10);

MoveBy posts any changes to the active record and

Sets the Bof and Eof properties to False.

If Distance is positive, repeatedly fetches subsequent records (if possible), decrementing Distance until it is zero, positions the cursor on the last record fetched, and makes it the active record. If an attempt is made to move past the end of the file, MoveBy sets Eof to True.

If Distance is negative, repeatedly fetches previous records (if possible), incrementing Distance until it is zero, positions the cursor on the last record fetched, and makes it the active record. If an attempt is made to move past the start of the file, MoveBy sets Bof to True.

Broadcasts information about the record change so that data-aware controls and linked datasets can update.

Returns the actual number of records moved. In most cases, Result is the absolute value of Distance, but if MoveBy encounters the beginning-of-file or end-of-file before moving Distance records, Result will be less than the absolute value of Distance.


TDataSet.Next

TDataSet	See also 	Example

Positions the cursor on the next record in the dataset.

procedure Next;

Description

Call Next to position the cursor on the next record in the dataset and make it the active record. Next posts any changes to the active record and

Sets the Bof and Eof properties to False.

Fetches the next record, positions the cursor on it, and makes it the active record.

Fetches any additional records required for display, such as those needed to fill out a grid control.

Sets the Eof property to True if the cursor was already on the last record in the dataset.

Broadcasts the record change so that data controls and linked detail sets can update.

Note:	TDataSet uses internal, protected methods to position the database cursor and to fetch additional records required for display. In TDataSet, these internal methods are abstract. Descendant classes implement these methods to enable the Last method to work.


TDataSet.Open

TDataSet	See also

Opens the dataset.

procedure Open;

Description

Call Open to set the Active property for the dataset to True. When Active is True, data can be read from and written to the database.

Setting Active to True:

Triggers the BeforeOpen event handler if one is defined for the dataset.

Sets the dataset state to dsBrowse.

Opens a Borland Database Engine (BDE) cursor into the dataset, if appropriate (only applies to TBDEDataSet and its descendants, TQuery, TStoredProc, and TTable).

Triggers the After Open event handler if one is defined for the dataset.

If an error occurs during the dataset open, dataset state is set to dsInactive, and the cursor is closed.


TDataSet.Post

TDataSet	See also 	Example

Implements a virtual method to write a modified record to the database.

procedure Post; virtual;

Description

TDataSet implements a virtual method to write a modified record to the database. Dataset methods that change the dataset state, such as Edit, Insert, or Append, or that move from one record to another, such as First, Last, Next, and Prior automatically call Post.

All descendants of TDataSet redeclare and implement Post to write a record to the database.


TDataSet.Prior

TDataSet	See also

Positions the cursor on the previous record in the dataset.

procedure Prior;

Description

Call Prior to position the cursor on the previous record in the dataset and make it the active record. Prior posts any changes to the active record and

Sets the Bof and Eof properties to False.

Fetches the previous record, positions the cursor on it, and makes it the active record.

Fetches any additional records required for display, such as those needed to fill out a grid control.

Sets the Bof property to True if the cursor was already on the first record in the dataset.

Broadcasts the record change so that data controls and linked detail sets can update.

Note:	TDataSet uses internal, protected methods to position the database cursor and to fetch additional records required for display. In TDataSet, these internal methods are abstract. Descendant classes implement these methods to enable the Last method to work.


TDataSet.Refresh

TDataSet	See also	Example

Refetches data from the database to update a dataset’s view of data.

procedure Refresh;

Description

Call Refresh to ensure that an application has the latest data from a database. For example, when an application turns off filtering for a dataset, it should immediately call Refresh to display all records in the dataset, not just those that used to meet the filter condition.


TDataSet.Resync

TDataSet	See also

Refetches the active record and the records that precede and follow it.

type TResyncMode = set of (rmExact, rmCenter);

procedure Resync(Mode: TResyncMode); virtual;

Description

Resync is used internally by other dataset methods to resynchronize the Delphi dataset with underlying physical data when making calls that may change the cursor position. Applications should use the Refresh method instead of calling Resync.

Mode indicates optional processing that Resync should handle. If Mode contains rmExact, Resync raises an exception if Resync is called when the cursor is not positioned on a valid record. If Mode contains rmCenter, Resync positions the active record in the center of all buffered records.

Regardless of Mode, Resync also activates the buffers for the active record, retrieves prior and subsequent records for display purposes, and triggers a dataset change event.


TDataSet.SetFields

TDataSet	See also

Sets the values for all fields in a record

procedure SetFields(const Values: array of const);

Description

Call SetFields to set values for some or all fields in the active record at the same time.

Values contains the values to insert into each field. Values are assigned to the record based on the order of columns in the table or tables underlying the dataset. These values can be literals, variables, NULL, or nil. If Values contains fewer values than there are fields in the record, all records for which values are not provided are assigned a NULL value. A NULL value overwrites any existing value in such fields.

Before calling SetFields, call Edit to put the dataset into dsEdit state. After calling SetFields, call Post to write the changes to the database.

Note:	To set values for some fields while retaining existing values for others, pass nil for each field that should not change.


TDataSet.Translate

TDataSet

Implements a virtual procedure to copy a data string from a source to a destination, optionally performing character translation during the copy.

function Translate(Src, Dest: PChar; ToOem: Boolean): Integer; virtual;

Description

As implemented by TDataSet, Translate copies a source string to a destination string, and ignores the value passed in ToOem. Translate provides a fallback method for derived dataset objects that do not reimplement Translate.

In some descendant classes, Translate converts the source string from ANSI (the native character mapping for the VCL) to OEM (the native character mapping for the BDE) when ToOem is True, and reverses that translation when ToOem is False.


TDataSet.UpdateCursorPos

TDataSet	See also

Positions the cursor on the active record.

procedure UpdateCursorPos;

Description

UpdateCursorPos is an internal routine used by many dataset methods to ensure that the physical cursor is positioned on the active record. Normally an application should not need to call UpdateCursorPos. Typically UpdateCursorPos is called to ensure that the physical cursor position matches the logical cursor position.


TDataSet.UpdateRecord

TDataSet	See also

Ensures that data-aware controls and detail datasets reflect record updates.

procedure UpdateRecord;

Description

UpdateRecord is used internally by some dataset methods to inform data-aware controls of updates and trigger an OnUpdateRecord event if cached updates are enabled. Applications should not need to call UpdateRecord directly unless they provide custom dataset methods that bypass dataset methods.


TDataSet.UpdateStatus

TDataSet

Reports the update status for the active record.

function UpdateStatus: TUpdateStatus; virtual;

Description

As implemented in TDataSet, UpdateStatus always returns usUnmodified. Descendant classes override this method to reflect whether the active record has been modified, and if so, how.


Scope

Protected

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


 TDataSource

Hierarchy	Properties	Methods	Events	See also

TDataSource provides an interface between a dataset component and data-aware controls on a form.

Unit

db

Description

Use TDataSource to provide a conduit between a dataset and data-aware controls on a form that enable display, navigation, and editing of the data underlying the dataset.

All datasets must be associated with a data source component if their data is to be displayed and manipulated in data-aware controls. Similarly, each data-aware control needs to be associated with a data source component in order for the control to receive and manipulate data.

Data source components also link datasets in master-detail relationships.


TDataSource properties

TDataSource	Alphabetically	Legend

In TDataSource

AutoEdit

DataSet

Enabled

State

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDataSource properties

TDataSource	By object	Legend

AutoEdit

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DataSet

DesignInfo

Enabled

Name

Owner

State

Tag

VCLComObject


TDataSource.AutoEdit

TDataSource	See also

Determines if a data source component automatically calls a dataset’s Edit method when a data-aware control associated with the data source receives focus.

property AutoEdit: Boolean;

Description

AutoEdit is True by default. If AutoEdit is True, then when a user attempts to modify the data displayed by the control the underlying dataset’s Edit method is called.

Set AutoEdit to False to protect data from unintentional modification. Even if AutoEdit is False, an application can call a dataset’s Edit method directly to permit data modification.


TDataSource.DataSet

TDataSource	See also	Example

Specifies the dataset for which the data source component serves as a conduit to data-aware controls.

property DataSet: TDataSet;

Description

Set DataSet to the name of an existing dataset component either at design time, or at runtime. By changing the value of DataSet at runtime an application can effectively use the same data-aware controls to display and edit data in different datasets.

DataSource.DataSet := Table1;

Note:	To link a dataset that resides in a data module to a form at design-time, choose File | Use unit.


TDataSource.Enabled

TDataSource	See also

Determines if the data-aware controls associated with the data source component display data.

property Enabled: Boolean;

Description

Use Enabled to control whether or not data-aware controls connected to a data source display data. If Enabled is True (the default), data are displayed. If Enabled is False, all controls associated with the data source are blank.

Note:	While an application can set Enabled to False to blank out data-aware controls during processing of multiple records, a better choice is to use the TDataSet EnableControls and DisableControls methods. Using these methods prevents the controls from blanking out during processing.


TDataSource.State

TDataSource	See also	Example

Reads the current state of the dataset component associated with a data source component.

property State: TDataSetState;

Description

Examine State to determine the current state of the dataset associated with a data source component. The state of a dataset indicates the action, if any, taking place against the dataset.

The possible values of State correspond to the values for a dataset’s State property and are identical to them except that when Enabled is False or DataSet is unassigned, State is dsInactive regardless of the actual state of the dataset.


TDataSource events

TDataSource	Alphabetically	Legend

In TDataSource

OnDataChange

OnStateChange

OnUpdateData


TDataSource events

TDataSource	By object	Legend

OnDataChange

OnStateChange

OnUpdateData


TDataSource.OnDataChange

TDataSource	See also 	Example

Occurs when the current record has been edited and the application moves from one field or record to another in a dataset associated with the data source component.

type TDataChangeEvent = procedure(Sender: TObject; Field: TField) of object;

property OnDataChange: TDataChangeEvent;

Description

Write an OnDataChange event handler to take specific actions when a field in the current record has been edited and an application moves from one field or record to another in a dataset associated with a data source component. For example, methods that can trigger this event include the Next or Prior methods for the dataset.

Data-aware controls notify a data source of a data change because of:

Scrolling to a new record.

Modifications to a field’s data.

The Field parameter is nil if more than one of the fields changed simultaneously, such as when moving from one record to another. Otherwise, Field indicates the edited field.

OnDataChange is especially useful in applications that must synchronize data display in controls that are not data aware.


TDataSource.OnStateChange

TDataSource	See also

Occurs when the state of a data source component’s dataset changes.

property OnStateChange: TNotifyEvent;

Description

Write an OnStateChange event handler to take specific actions when the State property changes for a dataset associated with a data source component.

During the course of a normal connection to a database, a dataset’s state changes frequently. For example, each time a user starts editing a field in a data-aware control the dataset’s State property is changed from dsBrowse to dsEdit if the State is not already dsEdit. An OnStateChange event handler might respond to changes in state by taking actions such as disabling or enabling menu items or buttons.


TDataSource.OnUpdateData

TDataSource	See also

Occurs when the data in the current record is about to be updated.

property OnUpdateData: TNotifyEvent;

Description

Write an OnUpdateData event handler to take specific actions prior to posting data changes to the database. If an application posts changes to the database and an OnUpdateData event handler exists, the handler is called before the dataset’s Post method is executed. An OnUpdateData event handler might be useful for performing additional data processing or validation before posting.


TDataSource methods

TDataSource	Alphabetically

In TDataSource

Create

Destroy

Edit

IsLinkedTo

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataSource methods

TDataSource	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Edit

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsLinkedTo

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TDataSource.Create

TDataSource	See also

Creates an instance of a TDataSource component.

constructor Create(AOwner: TComponent);

Description

Call Create to instantiate a TDataSource component at runtime. For data source components added to a form or data module at design time, Delphi automatically inserts a call to Create.

Create instantiates a data link list, and sets the Enabled and AutoEdit properties of the component to True.


TDataSource.Destroy

TDataSource	See also

Destroys the instance of a data source component.

destructor Destroy;

Description

Do not call Destroy directly. Instead, call Free, which checks that the data source reference is not nil before calling Destroy.

Destroy sets OnStateChange to nil, sets the dataset for the component to nil, and frees the data link list before calling the inherited destructor for the component.


TDataSource.Edit

TDataSource	See also

Determines whether or not to call the Edit method for a dataset associated with a data source component.

procedure Edit;

Description

Call Edit to enable a data source component to control a user’s ability to edit a dataset associated with the data source. Edit checks that the AutoEdit property of the data source is True and that its State property is dsBrowse before calling the dataset’s Edit method. Checking these properties before calling the dataset’s Edit method ensures that the dataset is in a state that supports editing, and that the data source allows editing as well.


TDataSource.IsLinkedTo

TDataSource	See also

Checks that a data source is linked to a specified dataset.

function IsLinkedTo(DataSet: TDataSet): Boolean;

Description

Call IsLinkedTo to verify that a data source is linked to a specific dataset. DataSet is the name of the dataset to which the data source should be linked.

If the data source already uses the specified dataset, IsLinkedTo returns True. If the data source does not use the specified dataset, but the dataset exists, then IsLinkedTo sets the DataSet property of the data source component to the one specified in the DataSet parameter, and returns True.

If the data source does not use the specified dataset, and the dataset does not already have a data source of its own, IsLinkedTo returns False.

Note:	IsLinkedTo is a low-level method mainly of interest to component developers who need to detect circular data references. Otherwise IsLinkedTo should not be called directly.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TDateField

Hierarchy	Properties	Methods	Events	See also

TDateField represents a date field in a dataset.

Unit

db

Description

TDateField is a persistent field object that encapsulates the fundamental behavior common to Date fields. As a descendant of TDateTimeField, TDateField includes many properties, methods, and events that are useful for managing the value and properties of a field in a database. TDateField introduces no new methods or events. TDateField reimplements the DataSize property, adapting it to Date type data.

As with all persistent field objects, a TDateField can be created at design-time using the Fields Editor or at runtime by calling the constructor for the class. Persistent field objects exist solely in the memory space of an application. Creating a persistent field object only creates an object in the application, and does not result in the creation of a field in a table.

Fields in a table can be accessed without use of persistent field objects. Virtual field objects are created to provide access to a field when the field is referenced through such means as the TDataSet.::Fields property or the TDataSet.FieldByName method.

Date fields contain date values (without any time value).


TDateField properties

TDateField	Alphabetically	Legend

In TDateField

DataSize

Derived from TDateTimeField

AsDateTime

AsFloat

AsString

AsVariant

DisplayFormat

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsInteger

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDateField properties

TDateField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

ValidChars

Value

VCLComObject

Visible


TDateField.DataSize

Example

Specifies the amount of memory needed to store the value of a date field in its native database format.

property DataSize: Word;

Description

Check DataSize to determine the number of bytes required to store a date field component’s value. Use DataSize to determine the size needed for a buffer when working with the GetData and SetData methods.

For date fields, DataSize is always 4. This is the size of date values in the database tables, not the size of the TDateTime data type used to store and manipulate date values by TDateField.

var

  P: Pointer;

begin

  P := AllocMem(Table1DateField.DataSize);

  try

    if not (Table2.State in [dsInsert, dsEdit]) then Table2.Insert;

    Table1DateField.GetData(P);

    Table2DateField.SetData(P);

    Table2.Post;

  finally

    FreeMem(P);

  end;

end;


TDateField events

TDateField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TDateField events

TDateField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TDateField methods

TDateField	Alphabetically

In TDateField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDateField methods

TDateField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TDateField.Create

TDateField	See also

Creates an instance of TDateField.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TDateField. After calling the inherited constructor, Create sets the DataType property to ftDate.

After instantiating a TDateField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TDateField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TDateField with a dataset component by setting its DataSet property to the name of the dataset component.

The example below creates a TDateField object for a field named LastContact accessed through a TQuery named Query1.

var

  T: TDateField;

begin

  Query1.Close;

  T := TDateField.Create(Self);

  T.FieldName := 'LastContact';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  T.DisplayFormat := 'mm/dd/yyyy';

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TDateTimeField


TDateTimeField

Hierarchy	Properties	Methods	Events	See also	Example

TDateTimeField represents a date-time field in a dataset.

Unit

db

Description

TDateTimeField is a persistent field object that encapsulates the fundamental behavior common to Date-time fields. As a descendant of TField, TDateTimeField includes many properties, methods, and events that are useful for managing the value and properties of a field in a database. TDateTimeField introduces new properties to convert between date-time values and other data types, and to format the value of a date-time field for display.

As with all persistent field objects, a TDateField can be created at design-time using the Fields Editor or at runtime by calling the constructor for the class. Persistent field objects exist solely in the memory space of an application. Creating a persistent field object only creates an object in the application, and does not result in the creation of a field in a table.

Fields in a table can be accessed without use of persistent field objects. Virtual field objects are created to provide access to a field when the field is referenced through such means as the TDataSet.Fields property or the TDataSet.FieldByName method.

Date-time fields contain combined date and time information, sometimes called timestamps.


TDateTimeField properties

TDateTimeField	Alphabetically	Legend

In TDateTimeField

AsDateTime

AsFloat

AsString

AsVariant

DataSize

DisplayFormat

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsInteger

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDateTimeField properties

TDateTimeField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

ValidChars

Value

VCLComObject

Visible


TDateTimeField.AsDateTime

TDateTimeField	See also	Example

Represents the value of the date-time field as a TDateTime value.

property AsDateTime: TDateTime;

Description

Use AsDateTime to

Assign a date-time value to a date-time field.

Assign the date-time field value to a date-time variable.

The time portion of the date-time value is ignored when setting the AsDateTime property on a field where the DataType is ftDate. The date portion of the date-time value is ignored when setting the AsDateTime property on a field where the DataType is ftTime.

Similarly, reading the AsDateTime property of a field with DataType set to ftDate yields a date-time value of 12:00 AM on the date value of the field. Reading the AsDateTime property of a field with DataType set to ftTime yields a date-time value of the time value of the field on Dec. 30, 1899.

Reading or setting the AsDateTime property for a field with DataType set to ftDateTime treats both the date and time portions of the date-time value as meaningful.

AsDateTime uses date-time values stored in the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since Dec. 30 1899. The fractional part of a TDateTime value is the fraction of a 24 hour day that has elapsed.

Note:	Because TDateTimeField stores date and time values in the TDateTime type, AsDateTime is the same as Value for date-time fields. Use AsDateTime when working with field components where the actual class of the object is not known.


TDateTimeField.AsFloat

TDateTimeField	See also

Represents the value of the date-time field as a floating-point value.

property AsFloat: Double;

Description

Use AsFloat to

Assign a floating-point value to a date-time field.

Assign the date-time field value to a floating-point variable.

For example, this code assigns a floating-point value to date-time field value:

MyDateTimeField.AsFloat := 35065.75; { A date and time of Jan 1, 1996 6:00 p.m. }

To assign date-time field value to a floating-point value, use code similar to this:

FloatVariable := MyDateTimeField.AsFloat;

TDateTimeField converts dates to the number of days that have passed since Dec. 30 1899. Time values are converted to the fraction of a 24-hour day that has elapsed. The floating-point value for a date-time quantity is the sum of the date and time values.

The fractional (time) portion of the floating-point value is ignored when setting the AsFloat property on a field where the DataType is ftDate. The integral (date) portion of the floating-point value is ignored when setting the AsFloat property on a field where the DataType is ftTime.

Similarly, reading the AsFloat property of a field with DataType set to ftDate yields a floating-point value with no fractional (time) part. Reading the AsFloat property of a field with DataType set to ftTime yields a floating-point value greater than -1 and less than 1.


TDateTimeField.AsString

TDateTimeField	See also

Represents the value of the date-time field as a string.

property AsString: String;

Description

Use AsString to

Assign a string to a date-time field.

Assign the date-time field value to a string.

For example, this code assigns a string to a date-time field value:

MyDateTimeField.AsString := '1/1/1997 8:00:00 AM';

To assign date-time field value to a floating-point variable, use code similar to this:

StringVariable := MyDateTimeField.AsString;

If the DataType property value of the date-time field is ftDate, setting the AsString property uses the StrToDate function to convert the string to a date value. If the DataType is ftTime, setting the AsString property uses the StrToTime function. If the DataType is ftDateTime, setting the AsString property uses the StrToDateTime function.

Reading the AsString property yields the value of the date-time field formatted using the date and time format specified by the Windows Control Panel.

Note:	The format of the date (such as MM/DD/YY versus DD/MM/YY) depends on the current Windows settings. These settings can be overridden for the scope of the application only using the ShortDateFormat setting.)


TDateTimeField.AsVariant

TDateTimeField	See also

Represents the value of a date-time field as a variant value.

property AsVariant: Variant;

Description

Use AsVariant to

Assign the date-time field value to variant variable.

Assign a variant value to the date-time field.

Using variants is useful when the actual field type and the data type are unknown.


TDateTimeField.DataSize

TDateTimeField	See also	Example

Specifies the amount of memory needed to store the value of a date-time field in its native database format.

property DataSize: Word;

Description

Check DataSize to determine the number of bytes required to store a date-time field component’s value. Use DataSize to determine the size needed for a buffer when working with the GetData and SetData methods.

For date-time fields, DataSize is always 8.

var

  P: Pointer;

begin

  P := AllocMem(Table1DateTimeField.DataSize);

  try

    if not (Table2.State in [dsInsert, dsEdit]) then Table2.Insert;

    Table1DateTimeField.GetData(P);

    Table2DateTimeField.SetData(P);

    Table2.Post;

  finally

    FreeMem(P);

  end;

end;


TDateTimeField.DisplayFormat

TDateTimeField	See also

Controls the formatting of the date-time field for display purposes.

property DisplayFormat: String;

Description

Use DisplayFormat to specify a formatting string that is used to format the value in a date-time field when the field’s value appears as a string.

If DisplayFormat is not assigned a string, the value is formatted according to the default specified by the Windows Control Panel.

Construct a DisplayFormat string using these format specifiers:

Specifier	Displays

c	The date using the format given by the ShortDateFormat global variable, followed by the time using the format given by the LongTimeFormat global variable. The time is not displayed if the fractional part of the DateTime value is zero.

d	The day as a number without a leading zero (1-31).

dd	The day as a number with a leading zero (01-31).

ddd	The day as an abbreviation (Sun-Sat) using the strings given by the ShortDayNames global variable.

dddd	The day as a full name (Sunday-Saturday) using the strings given by the LongDayNames global variable.

ddddd	The date using the format given by the ShortDateFormat global variable.

dddddd	The date using the format given by the LongDateFormat global variable.

m	The month as a number without a leading zero (1-12). If the m specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.

mm	The month as a number with a leading zero (01-12). If the mm specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.

mmm	The month as an abbreviation (Jan-Dec) using the strings given by the ShortMonthNames global variable.

mmmm	The month as a full name (January-December) using the strings given by the LongMonthNames global variable.

yy	The year as a two-digit number (00-99).

yyyy	The year as a four-digit number (0000-9999).

h	The hour without a leading zero (0-23).

hh	The hour with a leading zero (00-23).

n	The minute without a leading zero (0-59).

nn	The minute with a leading zero (00-59).

s	The second without a leading zero (0-59).

ss	The second with a leading zero (00-59).

t	The time using the format given by the ShortTimeFormat global variable.

tt	The time using the format given by the LongTimeFormat global variable.

am/pm	The time using the 12-hour clock for the preceding h or hh specifier, followed by "am" for any hour before noon, or "pm" for any hour after noon. The am/pm specifier can use lower, upper, or mixed case, and the result is displayed accordingly.

a/p	The time using the 12-hour clock for the preceding h or hh specifier, followed by "a" for any hour before noon, or "p" for any hour after noon. The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly.

ampm	The time using the 12-hour clock for the preceding h or hh specifier, followed by the contents of the TimeAMString global variable for any hour before noon, or the contents of the TimePMString global variable for any hour after noon.

/	The date separator character given by the DateSeparator global variable.

:	The time separator character given by the TimeSeparator global variable.

'xx'/"xx"	Characters enclosed in single or double quotes are displayed as-is, with no formatting changes.

Format specifiers may be written in uppercase or lowercase letters; both produce the same result.

If the string given by the Format parameter is empty, the date and time value is formatted as if a c format specifier had been given.


TDateTimeField.Value

TDateTimeField	See also

Represents the value of the data in the date-time field.

property Value: TDateTime;

Description

Use Value to read data directly from and write data directly to a date-time field component at runtime. TDateTimeField components store and manipulate their data as TDateTime values. Thus, for date-time fields, the Value property is the same as the AsDateTime property.

var

  DT: TDateTime;

begin

  DT := Table1DateField.Value;

  ShowMessage(DateTimeToStr(DT));

end;


TDateTimeField events

TDateTimeField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TDateTimeField events

TDateTimeField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TDateTimeField methods

TDateTimeField	Alphabetically

In TDateTimeField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDateTimeField methods

TDateTimeField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TDateTimeField.Create

TDateTimeField	See also

Creates and initializes a TDateTimeField object.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TDateTimeField. After calling the inherited constructor, Create sets the DataType property to ftDateTime.

After instantiating a TDateTimeField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TDateTimeField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TDateTimeField with a dataset component by setting its DataSet property to the name of the dataset component. Optionally set the DisplayFormat property to the desired date and time format.

The example below creates a TDateTimeField object for a field named CheckOut accessed through a TQuery named Query1.

var

  T: TDateTimeField;

begin

  Query1.Close;

  T := TDateTimeField.Create(Self);

  T.FieldName := 'CheckOut';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  T.DisplayFormat := 'mm/dd/yyyy hh:nn:ss ampm';

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField


TDataSourceLink

Hierarchy	Properties	Methods	See also

TDataSourceLink helps manage the link to the data source for a TDBLookupControl object.

Unit

dbctrls

Description

TDataSourceLink is tailored to work with TDBLookupControl. It should only be used by the TDBLookupControl class.


TDataSourceLink properties

TDataSourceLink	Alphabetically	Legend

Derived from TDataLink

Active

ActiveRecord

BOF

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

Eof

ReadOnly

RecordCount


TDataSourceLink properties

TDataSourceLink	By object	Legend

Active

ActiveRecord

BOF

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

Eof

ReadOnly

RecordCount


TDataSourceLink methods

TDataSourceLink	Alphabetically	Legend

In TDataSourceLink

ActiveChanged

Create

FocusControl

LayoutChanged

RecordChanged

Derived from TDataLink

Destroy

Edit

ExecuteAction

UpdateAction

UpdateRecord

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDataSourceLink methods

TDataSourceLink	By object	Legend

ActiveChanged

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

Edit

ExecuteAction

FieldAddress

FocusControl

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

LayoutChanged

MethodAddress

MethodName

NewInstance

RecordChanged

SafeCallException

UpdateAction

UpdateRecord


TDataSourceLink.ActiveChanged

TDataSourceLink	See also

Informs the TDBLookupControl of changes in the Active property of its DataSource.

procedure ActiveChanged; override;

Description

Applications can not call the ActiveChanged procedure directly. Changes in the Active property trigger this procedure. When the Active property becomes True, ActiveChanged causes the TDBLookupControl object to reacquire its DataField property. This ensures that the lookup control is working with the correct field component.


TDataSourceLink.Create

TDataSourceLink	See also

Creates an instance of TDataSourceLink.

constructor Create;

Description

Create is called from the constructor of any TlookupControl descendant object that uses a TDataSourceLink to implement its DataSource property.

After calling the inherited constructor, Create initializes the VisualControl property to True.


TDataSourceLink.FocusControl

TDataSourceLink	See also

Moves input focus to the data field of the TDBLookupControl object.

type TFieldRef = ^TField;

procedure FocusControl(Field: TFieldRef); override;

Description

Applications can not call the FocusControl procedure. It is called automatically when a field component in the DataSet tries to set focus to a control on the form that represents the field. FocusControl moves focus to the DataField of the TDBLookupControl if it matches the Field parameter.


TDataSourceLink.LayoutChanged

TDataSourceLink	See also

Responds to changes in the representation of the data.

procedure LayoutChanged; override;

Description

LayoutChanged updates the associated lookup control so that its field bindings remain accurate when the field order in the dataset changes.


TDataSourceLink.RecordChanged

TDataSourceLink	See also

Informs the TDBLookupControl of changes in the current record or field of the DataSource.

procedure RecordChanged(Field: TField); override;

Description

Applications can not call RecordChanged directly. It is triggered automatically after changes in the contents of the current record. If the Field parameter is the key field of the lookup control, or if the Field parameter is nil, indicating that the entire record changed, RecordChanged causes the lookup control to refetch the value of its key field.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink


 TDBCheckBox

Hierarchy	Properties	Methods	Events	See also

TDBCheckBox is a data aware control that allows the user to select or deselect a single value.

Unit

dbctrls

Description

Use TDBCheckBox to place a data-aware check box on a form. A check box presents an option to the user; the user can check it to select the option, or uncheck it to deselect the option. A database check box (TDBCheckBox) is much like an ordinary check box (TCheckBox), except that it is aware of the data in a particular field of a dataset. Because check boxes can represent only two values (checked and unchecked), database check boxes are most appropriate for boolean fields. They can, however, be used to group the values of any field into two sets.

For applications that don’t require the data-aware capabilities of TDBCheckBox, use TCheckBox instead to conserve system resources.


TDBCheckBox properties

TDBCheckBox	Alphabetically	Legend

In TDBCheckBox

DataField

DataSource

Field

ReadOnly

ValueChecked

ValueUnchecked

Derived from TCustomCheckBox

Alignment

AllowGrayed

Checked

State

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

Caption

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDBCheckBox properties

TDBCheckBox	By object	Legend

Action

Align

Alignment

AllowGrayed

Anchors

BiDiMode

BoundsRect

Brush

Caption

Checked

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Field

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ReadOnly

ShowHint

Showing

State

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

ValueChecked

ValueUnchecked

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TDBCheckBox.DataField

TDBCheckBox	See also

Identifies the field from which the data-aware control displays data.

property DataField: String;

Description

Set DataField to the field name of the field component that the check box represents. Access by the TDBCheckBox to the dataset in which the field is located is provided by a TDataSource component, specified in the DataSource property.

DBCheckBox1.DataField := 'HasPaid';


TDBCheckBox.DataSource

TDBCheckBox	See also

Links the check box to a dataset.

property DataSource: TDataSource;

Description

Specify the data source component through which the data from a dataset component is provided to the TDBCheckBox. To allow the check box to represent the data for a field, both the DataSource and the DataField properties must be set.

DBCheckBox1.DataSource := DataSource1;


TDBCheckBox.Field

TDBCheckBox	See also

Indicates the TField object whose current value the check box represents.

property Field: TField;

Description

Use the TField reference provided by the Field property when you want to change the value of the data in the field programmatically.

DBCheckBox1.Field.AsBoolean := True;


TDBCheckBox.ReadOnly

TDBCheckBox	See also

Determines whether the user can change the value of the field.

property ReadOnly: Boolean;

Description

Use ReadOnly to specify whether the check box allows the user to change the field value by checking or unchecking the box. When ReadOnly is True, the checkbox can only be used to display the value of the field on the current record. When ReadOnly is False, the user can use the check box to change the field value.


TDBCheckBox.ValueChecked

TDBCheckBox	See also

Specifies the field value that corresponds to the checked state of the checkbox.

property ValueChecked: String;

Description

Use ValueChecked to specify the field value represented by the check box when it is checked. If the value of the ValueChecked property is equal to the data in the field of the current record of the dataset, the database check box appears checked. When the user checks the database check box, the field value is set to ValueChecked.

ValueChecked can represent more than one value in a semicolon-delimited list of items. If any of the items matches the contents of the field of the current record in the dataset, the check box appears checked. For example, set the value of ValueChecked string like this:

DBCheckBox1.ValueChecked := 'True;Yes;On';

If the contents of the associated field is the string True, Yes, or On, the check box is checked. The value of the field is compared to ValueChecked in a case-insensitive comparison. If the user selects a check box where ValueChecked represents more than one value, the first item in the list is assigned to the field.

If the contents of the field of the current record matches a string specified as the value of the ValueUnchecked property, the check box appears unchecked. If the contents of the field matches no string in either ValueChecked or ValueUnchecked, the check box appears gray.

Note:	If the DataField of the database check box is a logical field, the check box is always checked if the contents of the field is True, and it is always unchecked if the contents of the field is False. The values of the ValueChecked and ValueUnchecked properties have no affect on logical fields.


TDBCheckBox.ValueUnchecked

TDBCheckBox	See also

Specifies the field value that corresponds to the unchecked state of the checkbox.

property ValueUnchecked: String;

Description

Use ValueUnchecked to specify the field value represented by the check box when it is unchecked. If the value of the ValueUnchecked property is equal to the data in the field of the current record of the dataset, the database check box appears unchecked. When the user unchecks the database check box, the field value is set to ValueUnchecked.

ValueUnchecked can represent more than one value in a semicolon-delimited list of items. If any of the items matches the contents of the field of the current record in the dataset, the check box appears unchecked. For example, set the value of ValueUnchecked string like this:

DBCheckBox1.ValueUnchecked := 'False;No;Off';

If the contents of the associated field is the string False, No, or Off, the check box appears unchecked. The value of the field is compared to ValueUnchecked in a case-insensitive comparison. If the user unchecks a check box where ValueUnchecked represents more than one value, the first item in the list is assigned to the field.

If the contents of the field of the current record matches a string specified as the value of the ValueChecked property, the check box appears checked. If the contents of the field matches no string in either ValueChecked or ValueUnchecked, the check box appears gray.

Note:	If the DataField of the database check box is a logical field, the check box is always unchecked if the contents of the field is False, and it is always checked if the contents of the field is True. The values of the ValueChecked and ValueUnchecked properties have no affect on logical fields.


TDBCheckBox events

TDBCheckBox	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TDBCheckBox events

TDBCheckBox	By object	Legend

OnClick

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TDBCheckBox methods

TDBCheckBox	Alphabetically

In TDBCheckBox

CreateTDBCheckBox_Create>Main

DestroyTDBCheckBox_Destroy>Main

ExecuteAction

UpdateAction

Derived from TCustomCheckBox

GetControlsAlignment

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBCheckBox methods

TDBCheckBox	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

CreateTDBCheckBox_Create>Main

CreateParented

CreateParentedControl

DefaultHandler

DestroyTDBCheckBox_Destroy>Main

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TDBCheckBox.Create

TDBCheckBox	See also

Creates an instance of TDBCheckBox.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TDBCheckBox object at runtime. For TDBCheckBox objects placed on forms or data modules at design time, Create is called automatically.

Pass a single Component as a parameter to provide the TDBCheckBox object with an Owner that is responsible for freeing it.After calling the inherited constructor to allocate and initialize a generic checkbox, Create

Adds csReplicatable to ControlStyle.

Creates and initializes the helper objects needed to link to a dataset.


TDBCheckBox.Destroy

TDBCheckBox	See also

Destroys an instance of TDBCheckBox.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TDBCheckBox reference is not nil and only then calls Destroy.

Destroy frees the helper objects of the TDBCheckBox before calling the inherited destructor.


TDBCheckBox.ExecuteAction

TDBCheckBox	See also

Invokes an action with the TDBCheckBox as its target.

function ExecuteAction(Action: TBasicAction): Boolean; override;

Description

ExecuteAction is called automatically when the user invokes an action with the TDBCheckBox as a target. The Action parameter specifies the action that was invoked. ExecuteAction returns True if the action was successfully dispatched, and False if the TDBCheckBox could not handle the action.


TDBCheckBox.UpdateAction

TDBCheckBox	See also

Updates an action to reflect the current state of the TDBCheckBox.

function UpdateAction(Action: TBasicAction): Boolean; override;

Description

UpdateAction is called automatically when the application is idle to give the TDBCheckBox an opportunity to update associated actions. This allows actions to be grayed, checked, or to otherwise reflect the status of the TDBCheckBox they target.

The Action parameter specifies the action component that should be updated. UpdateAction returns True if the action component now reflects the state of the component, and False if it did not know how to update the action.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TButtonControl

TCustomCheckBox


 TDBComboBox

Hierarchy	Properties	Methods	Events	See also

TDBComboBox represents a data-aware combo box control.

Unit

dbctrls

Description

Use TDBComboBox to allow the user to change the value of a field on the current record in a dataset either by selecting an item from a list or by typing in the edit box part of the control. The selected item or entered text becomes the new value of the field if the database combo box’s ReadOnly property is False. The combo box can be customized to enable or disable typing in the edit region of the control, to display the list as a drop down or as a permanently displayed list, to sort the items in the list, and so on.


TDBComboBox properties

TDBComboBox	Alphabetically	Legend

In TDBComboBox

DataField

DataSource

Field

Items

ReadOnly

Style

Derived from TCustomComboBox

Canvas

CharCase

DropDownCount

DroppedDown

ItemHeight

ItemIndex

SelLength

SelStart

SelText

Sorted

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Text

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDBComboBox properties

TDBComboBox	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

Canvas

CharCase

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

DropDownCount

DroppedDown

Enabled

Field

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

ImeMode

ImeName

ItemHeight

ItemIndex

Items

Left

LRDockWidth

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ReadOnly

SelLength

SelStart

SelText

ShowHint

Showing

Sorted

Style

TabOrder

TabStop

Tag

TBDockHeight

Text

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TDBComboBox.DataField

TDBComboBox	See also

Identifies the field from which the combo box displays data.

property DataField: String;

Description

Set DataField to specify which field is represented by the combo box. (Note that this is does not refer to the source of the list, but to the field into which the selected value is inserted. The list values must be supplied manually using the Items property.) The combo box displays the current value of this field, and allows the user to set the value of this field on the current record. The dataset the field is located in is specified by the DataSource property.

DBComboBox1.DataField := 'CountryName';

Tip:	For a data-aware combo box component for which the list values are automatically supplied, use a TDBLookupComboBox instead.


TDBComboBox.DataSource

TDBComboBox	See also

Links the combo box to a dataset.

property DataSource: TDataSource;

Description

Specify the data source component that identifies the dataset in which the target field is found. To allow the combo box to represent the data for a field, both the DataSource and the DataField properties must be set.

DBComboBox1.DataSource := DataSource1;


TDBComboBox.Field

TDBComboBox	See also

Identifies the TField object whose current value the combo box represents.

property Field: TField;

Description

Use the TField reference provided by the Field property when you want to change the value of the data in the field programmatically.

DBComboBox1.Field.AsString := 'Brazil';


TDBComboBox.Items

TDBComboBox	See also

Contains the strings that appear in the list of the database combo box.

property Items: TStrings;

Description

Use Items to supply the values in the list from which the user can choose. Because Items is an object of type TStrings, you can add, delete, insert, and move items using the Add, Delete, Insert, Exchange, and Move methods of the TStrings object. For example, to add each string to the combo box list, write code such as the following:

while not Table2.Eof do begin

  DBComboBox1.Items.Add(Table2.FieldByName('Country').AsString);

  Table2.Next;

end;

The ItemIndex property determines which item is selected, if any.


TDBComboBox.ReadOnly

TDBComboBox	See also

Determines if the user can change the value of the field.

property ReadOnly: Boolean;

Description

Set ReadOnly to specify whether the combo box should be used for display purposes only. If ReadOnly is True, the combo box can only be used to display the value of the field on the current record. If ReadOnly is False, the user can use the combo box to edit the field’s value.


TDBComboBox.Style

TDBComboBox	See also

Determines how the combo box displays its items.

property Style: TComboBoxStyle;

Description

Use Style to specify whether the user can type values into the edit region as well as select values from the list, whether the list drops down when the user clicks a button or if it is always displayed, and so on. By default, Style is csDropDown, meaning that the combo box displays each item as a string in a drop-down list, and that users can edit the value in the edit region. Style can be any of the values: csDropDown, csSimple, csDropDownList, csOwnerDrawFixed, and csOwnerDrawVariable.

Owner-draw combo boxes can display items other than strings. For example, a combo box could display graphical images along with or instead of its strings. Owner-draw combo boxes require more programming, however, as the application must render the image for each item in the list.

When Style is csOwnerDrawFixed or csOwnerDrawVariable, the OnDrawItem event occurs when the list items need to be drawn. If Style is csOwnerDrawVariable, an OnMeasureItem event occurs as well.


TDBComboBox events

TDBComboBox	Alphabetically	Legend

Derived from TCustomComboBox

OnChange

OnDrawItem

OnDropDown

OnMeasureItem

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnStartDock

OnStartDrag


TDBComboBox events

TDBComboBox	By object	Legend

OnChange

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnDrawItem

OnDropDown

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMeasureItem

OnStartDock

OnStartDrag


TDBComboBox methods

TDBComboBox	Alphabetically

In TDBComboBox

Create

Destroy

ExecuteAction

UpdateAction

Derived from TCustomComboBox

Clear

Focused

SelectAll

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBComboBox methods

TDBComboBox	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TDBComboBox.Create

TDBComboBox	See also

Creates an instance of TDBComboBox.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TDBComboBox object at runtime. For TDBComboBox objects placed on forms at design time, Create is called automatically.

Pass a single Component as a parameter to provide the TDBComboBox object with an Owner that is responsible for freeing it.After calling the inherited constructor to allocate and initialize a generic combo box object, Create creates and initializes the helper objects needed to link to a dataset.


TDBComboBox.Destroy

TDBComboBox	See also

Destroys an instance of TDBComboBox.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TDBComboBox reference is not nil and only then calls Destroy.

Destroy frees the helper objects of the TDBComboBox before calling the inherited destructor.


TDBComboBox.ExecuteAction

TDBComboBox	See also

Invokes an action with the TDBComboBox as its target.

function ExecuteAction(Action: TBasicAction): Boolean; override;

Description

ExecuteAction is called automatically when the user invokes an action with the TDBComboBox as a target. The Action parameter specifies the action that was invoked. ExecuteAction returns True if the action was successfully dispatched, and False if the TDBComboBox could not handle the action.


TDBComboBox.UpdateAction

TDBComboBox	See also

Updates an action to reflect the current state of the TDBComboBox.

function UpdateAction(Action: TBasicAction): Boolean; override;

Description

UpdateAction is called automatically when the application is idle to give the TDBComboBox an opportunity to update associated actions. This allows actions to be grayed, checked, or to otherwise reflect the status of the TDBComboBox they target.

The Action parameter specifies the action component that should be updated. UpdateAction returns True if the action component now reflects the state of the component, and False if it did not know how to update the action.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomComboBox


TDBDataSet

Hierarchy	Properties	Methods	Events	See also

TDBDataSet encapsulates database connectivity for descendant dataset objects.

Unit

dbtables

Description

TDBDataSet defines database-related connectivity properties and methods for a dataset. Applications never use TDBDataSet objects directly. Instead they use the descendants of TDBDataSet, such as TQuery, TStoredProc, and TTable, which inherit its database-related properties and methods.

Developers who create custom dataset components may want to derive them from TDBDataSet to inherit to the database-specific properties of TDBDataSet in addition to all the functionality of TDataSet and the BDE-related properties and methods of TBDEDataSet. In this case, developers should examine the source code to study the protected methods of TDBDataSet that are not documented for this object.


TDBDataSet properties

TDBDataSet	Alphabetically	Legend

In TDBDataSet

AutoRefresh

Database

DatabaseName

DBHandle

DBLocale

DBSession

Handle

SessionName

UpdateMode

Derived from TBDEDataSet

BlockReadSize

CacheBlobs

CachedUpdates

CanModify

ExpIndex

Filter

Filtered

FilterOptions

KeySize

Locale

RecNo

RecordCount

RecordSize

UpdateObject

UpdateRecordTypes

UpdatesPending

Derived from TDataSet

Active

AggFields

AutoCalcFields

Bof

Bookmark

DataSetField

DataSource

DefaultFields

Designer

Eof

FieldCount

FieldDefList

FieldDefs

FieldList

Fields

FieldValues

Found

Modified

Name

ObjectView

SparseArrays

State

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDBDataSet properties

TDBDataSet	By object	Legend

Active

AggFields

AutoCalcFields

AutoRefresh

BlockReadSize

Bof

Bookmark

CacheBlobs

CachedUpdates

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Database

DatabaseName

DataSetField

DataSource

DBHandle

DBLocale

DBSession

DefaultFields

Designer

DesignInfo

Eof

ExpIndex

FieldCount

FieldDefList

FieldDefs

FieldList

Fields

FieldValues

Filter

Filtered

FilterOptions

Found

Handle

KeySize

Locale

Modified

Name

ObjectView

Owner

RecNo

RecordCount

RecordSize

SessionName

SparseArrays

State

Tag

UpdateMode

UpdateObject

UpdateRecordTypes

UpdatesPending

VCLComObject


TDBDataSet.AutoRefresh

TDBDataSet	See also

Specifies whether server-generated field values are refetched automatically.

property AutoRefresh: Boolean;

Description

When AutoRefresh is False (the default), values that the server creates for autoincrement fields and fields with default values when a record is posted are not automatically refetched by the dataset. Instead, the application must call the dataset’s Refresh method to update these field values. When AutoRefresh is True, these field values are automatically refreshed without an explicit call to the Refresh method.

Note:	Some database drivers can’t determine which fields are autoincrement fields or have default values. For these cases, you must provide this information by setting the AutoGenerateValue property of all fields that should be refreshed. Similarly, you must set the field components’ AutoGenerateValue properties when the dataset represents a query or stored procedure.


TDBDataSet.Database

TDBDataSet	See also 	Example

Identifies the database component for which this dataset represents one or more tables.

property Database: TDatabase;

Description

Use Database to access the properties, events, and methods of the database component associated with this dataset. Database is a read-only property that is automatically set when the database specified by the DatabaseName property is opened.


TDBDataSet.DatabaseName

TDBDataSet	See also 	Example

Specifies the name of the database associated with this dataset.

property DatabaseName: String;

Description

Use DatabaseName to specify the name of the database to associate with this dataset component. DatabaseName should match the name of a database component used in the application.

Note:	Attempting to set DatabaseName when a database already associated with this component is open raises an exception.

Tip:	At design time double-click a TDatabase component to invoke the Database editor and set the DatabaseName.


TDBDataSet.DBHandle

TDBDataSet	See also 	Example

Specifies the Borland Database Engine (BDE) database handle for the dataset.

type HDBISES: Longint;

property DBHandle: HDBISES;

Description

Check DBHandle to determine the database handle for the dataset. DBHandle is only useful in applications that bypass database and dataset methods to write directly to the BDE API. Many BDE function calls require a handle parameter. DBHandle is assigned an initial value when a session is activated.

Note:	Do not use this property unless an application requires BDE functionality not available through standard data access components.


TDBDataSet.DBLocale

TDBDataSet	See also

Identifies the Borland Database Engine (BDE) language driver for the dataset component.

property DBLocale: TLocale;

Description

Examine DBLocale to determine the BDE language driver used by the database component associated with which this dataset is associated. Applications that make direct calls to the BDE may need to pass DBLocale information as an API function parameter.

Note:	Do not use this property unless an application requires BDE functionality not available through standard data access components.


TDBDataSet.DBSession

TDBDataSet	See also

Identifies the database session component associated with this dataset.

property DBSession: TSession

Description

Use DBSession to determine the session component that controls the database component with which this dataset component is associated. By default, a database component is associated with the default session component, Session, that is automatically created for all database applications.


TDBDataSet.Handle

TDBDataSet	See also	Example

Specifies the Borland Database Engine (BDE) cursor handle for the dataset.

type HDBICur: Longint;

property Handle: HDBICur;

Description

Use Handle only to bypass TDataSet methods and call directly into the BDE. Many BDE function calls require a cursor handle parameter. Handle is assigned an initial value when a dataset is opened. If used with a BDE call that changes the current record position, call Resync immediately after returning from the BDE call.

TBDEDataSet allows the Handle property to be set to an existing BDE cursor handle. Setting the Handle property is intended primarily for internal use. Descendant classes redeclare the Handle property to re-establish it as a read-only property

Note:	Do not use this property unless an application requires BDE functionality not available through built-in components.


TDBDataSet.SessionName

TDBDataSet	See also

Identifies the name of the session with which this dataset is associated.

property SessionName: String;

Description

Use SessionName to determine the session with which a dataset component is associated. SessionName is automatically set to the name of the SessionName property of the database component with which a dataset component is associated. If SessionName is blank, a dataset component is automatically associated with the default session, Session.

To associate a dataset component with a different session, SessionName must match the SessionName property of an existing session component that is also used by the database component with which this dataset is associated.


TDBDataSet.UpdateMode

TDBDataSet	See also

Determines how the Borland Database Engine (BDE) finds records when updating to an SQL database.

property UpdateMode: TUpdateMode;

Description

Use UpdateMode to specify the criteria to use when locating a record in the dataset. UpdateMode specifies whether modified records are located based on all columns (fields), on only the key fields, or on the key fields plus the original values of fields that have been modified.


TDBDataSet events

TDBDataSet	Alphabetically	Legend

Derived from TBDEDataSet

OnUpdateError

OnUpdateRecord

Derived from TDataSet

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TDBDataSet events

TDBDataSet	By object	Legend

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnUpdateError

OnUpdateRecord


TDBDataSet methods

TDBDataSet	Alphabetically

In TDBDataSet

CheckOpen

CloseDatabase

Create

OpenDatabase

Derived from TBDEDataSet

ApplyUpdates

BookmarkValid

Cancel

CancelUpdates

CommitUpdates

CompareBookmarks

ConstraintCallback

ConstraintsDisabled

CreateBlobStream

Destroy

DisableConstraints

EnableConstraints

FetchAll

FlushBuffers

GetBlobFieldData

GetCurrentRecord

GetIndexInfo

IsSequenced

Locate

Lookup

RevertRecord

UpdateStatus

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

CheckBrowseMode

ClearFields

Close

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetDetailDataSets

GetDetailLinkFields

GetFieldData

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsEmpty

IsLinkedTo

Last

MoveBy

Next

Open

Post

Prior

Refresh

Resync

SetFields

Translate

UpdateCursorPos

UpdateRecord

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBDataSet methods

TDBDataSet	By object

ActiveBuffer

AfterConstruction

Append

AppendRecord

ApplyUpdates

Assign

BeforeDestruction

BookmarkValid

Cancel

CancelUpdates

CheckBrowseMode

CheckOpen

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClearFields

Close

CloseDatabase

CommitUpdates

CompareBookmarks

ConstraintCallback

ConstraintsDisabled

ControlsDisabled

Create

CreateBlobStream

CursorPosChanged

DefaultHandler

Delete

Destroy

DestroyComponents

Destroying

DisableConstraints

DisableControls

Dispatch

Edit

EnableConstraints

EnableControls

ExecuteAction

FetchAll

FieldAddress

FieldByName

FindComponent

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FlushBuffers

Free

FreeBookmark

FreeInstance

FreeNotification

FreeOnRelease

GetBlobFieldData

GetBookmark

GetCurrentRecord

GetDetailDataSets

GetDetailLinkFields

GetFieldData

GetFieldList

GetFieldNames

GetIndexInfo

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GotoBookmark

HasParent

InheritsFrom

InitInstance

Insert

InsertComponent

InsertRecord

InstanceSize

IsEmpty

IsLinkedTo

IsSequenced

Last

Locate

Lookup

MethodAddress

MethodName

MoveBy

NewInstance

Next

Open

OpenDatabase

Post

Prior

Refresh

RemoveComponent

Resync

RevertRecord

SafeCallException

SetFields

Translate

UpdateAction

UpdateCursorPos

UpdateRecord

UpdateStatus


TDBDataSet.CheckOpen

TDBDataSet	See also

Checks the result of a call to the Borland Database Engine (BDE).

function CheckOpen(Status: DBIResult): Boolean;

Description

Call CheckOpen to determine if a call to the BDE returns an error when an attempt is made to access a dataset. Status is the return result of a previous call to the BDE.

CheckOpen returns True if access is successful. If Status indicates insufficient table rights when accessing a Paradox or dBASE table, CheckOpen calls the database session’s GetPassword method to prompt the user for a password. If the dialog is successful, CheckOpen returns True.

Otherwise CheckOpen returns False, indicating that dataset access failed.


TDBDataSet.CloseDatabase

TDBDataSet	See also

Closes a database connection associated with the database session.

procedure CloseDatabase(Database: TDatabase);

Description

Call CloseDatabase to close a persistent database connection, or to close and free a temporary database connection. Database specifies the name of the database component for which to close the connection.

CloseDatabase decrements the specified database component’s reference count, and then, if the reference count is zero and the database component’s KeepConnection property is False, CloseDatabase either frees a temporary database component or closes the connection for a persistent database component.

Note:	Calling CloseDatabase for a persistent database component does not close the connection. To close a connection for a persistent database component, call the database component’s Close method directly.

Temporary database components are closed automatically when the last dataset associated with the database component is closed, but an application can call CloseDatabase prior to that time to force closure. Closing a connection established by a temporary database component does not free the component if the session’s KeepConnections property is True (the default). To free temporary database components after closing their connections call DropConnections method of the session.


TDBDataSet.Create

TDBDataSet	See also

Creates a new TDBDataSet object.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a DB dataset at runtime.

Create:

Set the Locale property of the dataset to the locale of the default session.

Sets the CacheBlobs property to True.

Checks if the specified Owner is a database component, and if so, uses it to set the SessionName and DatabaseName properties.


TDBDataSet.OpenDatabase

TDBDataSet	See also

Opens the database that contains the dataset.

function OpenDatabase: TDatabase;

Description

Call OpenDatabase to connect to the database that contains the dataset, or to create a temporary database component and connect to a database. The DatabaseName property specifies the database to open.

OpenDatabase makes the current session active, then determines whether the DatabaseName property corresponds to the DatabaseName property of an existing database component. If it does not, OpenDatabase creates a temporary database component, assigning the DatabaseName parameter to the DatabaseName property. Finally, OpenDatabase calls the Open method of the database to connect to a database server, then increments the session’s database reference count by one.


Scope

Protected

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataSet

TBDEDataSet


 TDBEdit

Hierarchy	Properties	Methods	Events	See also

TDBEdit represents a single-line edit control that can display and edit a field in a dataset.

Unit

dbctrls

Description

Use TDBEdit to enable users to edit a database field. TDBEdit uses the Text property to represent the contents of the field.

TDBEdit permits only a single line of text. If the field may contain lengthy data that would require multiple lines, consider using a TDBMemo object.

If the application does not require the data-aware capabilities of TDBEdit, use an edit control (TEdit) or a masked edit control (TMaskEdit) instead, to conserve system resources.

To provide a mask to restrict input and control the display format of the data, use mask-related properties of TField and descendants. Such properties include: TField.::EditMask, TDateTimeField.::DisplayFormat, and TNumericField.::DisplayFormat. Which property needs to be used is predicated on the field’s type and which TField descendant corresponds to that type.


TDBEdit properties

TDBEdit	Alphabetically	Legend

In TDBEdit

DataField

DataSource

Field

ReadOnly

Derived from TCustomMaskEdit

EditText

IsMasked

MaxLength

Text

Derived from TCustomEdit

AutoSelect

AutoSize

BorderStyle

CanUndo

CharCase

Modified

PasswordChar

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDBEdit properties

TDBEdit	By object	Legend

Action

Align

Anchors

AutoSelect

AutoSize

BiDiMode

BorderStyle

BoundsRect

Brush

CanUndo

CharCase

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

EditText

Enabled

Field

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

ImeMode

ImeName

IsMasked

Left

LRDockWidth

MaxLength

Modified

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PasswordChar

PopupMenu

ReadOnly

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Text

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TDBEdit.DataField

TDBEdit	See also

Specifies the field from which the edit control displays data.

property DataField: String;

Description

Set DataField to the field name of the field component that the check box represents. Access by the TDBEdit to the dataset in which the field is located is provided by a TDataSource component, specified in the DataSource property.

If the DataField refers to a database field that contains integer or floating-point data, only characters that are valid in such a field can be entered in the edit box. Characters that are not legal are not accepted.

DBEdit1.DataField := 'Company';


TDBEdit.DataSource

TDBEdit	See also

Links the edit control to the dataset that contains the field it represents.

property DataSource: TDataSource;

Description

Use DataSource to specify the data source component through which the data from a dataset component is provided to the TDBEdit. To allow the check box to represent the data for a field, both the DataSource and the DataField properties must be set.

DBEdit1.DataSource := DataSource1;


TDBEdit.Field

TDBEdit	See also

Specifies the TField object for the database field the edit box represents.

property Field: TField;

Description

Read Field to get direct access to the contents and properties of the database field without going through the edit window. Use Field to change the contents of the database field programmatically. Use the Text property instead if you want to change the contents of the edit window without immediately posting the changes to the dataset. Changing the Text property allows the user to cancel the changes.

DBEdit1.Field.AsString := 'San Francisco Baking';


TDBEdit.ReadOnly

TDBEdit	See also

Determines whether the user can use the database edit box to change the value of the field in the current record.

property ReadOnly: Boolean;

Description

Set ReadOnly to True to prevent the user from changing the contents of the database field. When ReadOnly is True, the edit control is used only to display the contents of the field. If ReadOnly is False, the user can change the field's value as long as the dataset is in edit mode.


TDBEdit events

TDBEdit	Alphabetically	Legend

Derived from TCustomEdit

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TDBEdit events

TDBEdit	By object	Legend

OnChange

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TDBEdit methods

TDBEdit	Alphabetically	Legend

In TDBEdit

Change

Create

Destroy

EditCanModify

ExecuteAction

KeyDown

KeyPress

Notification

Reset

UpdateAction

Derived from TCustomMaskEdit

Clear

GetTextLen

ValidateEdit

Derived from TCustomEdit

ClearSelection

ClearUndo

CopyToClipboard

CutToClipboard

DefaultHandler

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Undo

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBEdit methods

TDBEdit	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

Change

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClearSelection

ClearUndo

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

Create

CreateParented

CreateParentedControl

CutToClipboard

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EditCanModify

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

KeyDown

KeyPress

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

Notification

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

Reset

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

Undo

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

ValidateEdit


TDBEdit.Change

TDBEdit	See also

Responds when the text is modified.

procedure Change; override;

Description

Applications cannot call this protected method directly. It is triggered automatically by Windows’ events.

Change responds to changes in the text by internally keeping track of the fact that the text has been modified. This information can then be used to know whether there are any changes to post to the dataset or to remove if the user requests a reset.

Additionally, Change calls the inherited method, which generates an OnChange event.


TDBEdit.Create

TDBEdit	See also

Creates an instance of TDBEdit.

constructor Create(AOwner: TComponent); override;

Description

Call create to create a TDBEdit object at runtime. TDBEdit objects placed on a form at design time are created automatically.

Create overrides the inherited constructor  to initialize the database handling capabilities of the edit control.


TDBEdit.Destroy

TDBEdit	See also

Destroys an instance of TDBEdit.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the TDBEdit reference is not nil and only then calls Destroy.

Destroy overrides the inherited destructor to free the helper objects that were allocated to manage display issues and database interactions.


TDBEdit.EditCanModify

TDBEdit	See also

Allows or disallows editing of the text depending on whether the dataset is in edit mode.

function EditCanModify: Boolean; override;

Description

EditCanModify overrides the inherited method so that the control will only allow edits when the dataset is in edit mode. If the edit control should never allow edits, the ReadOnly property should be set.

Note:	EditCanModify is a protected method. Applications cannot call it directly.


TDBEdit.ExecuteAction

TDBEdit	See also

Invokes an action with the TDBEdit as its target.

function ExecuteAction(Action: TBasicAction): Boolean; override;

Description

ExecuteAction is called automatically when the user invokes an action with the TDBEdit as a target. The Action parameter specifies the action that was invoked. ExecuteAction returns True if the action was successfully dispatched, and False if the TDBEdit could not handle the action.


TDBEdit.KeyDown

TDBEdit	See also

Supplements the inherited method to drive the dataset into edit mode when the user presses Del or Shift+Insert.

type TShiftState = set of (ssShift, ssAlt, ssCtrl, ssLeft, ssRight, ssMiddle, ssDouble);

procedure KeyDown(var Key: Word; Shift: TShiftState); override;

Description

KeyDown first calls the inherited method, which calls the OnKeyDown event handler. KeyDown next attempts to put the dataset into an editing state when the user types Del or Shift+Insert. Derived classes can override KeyDown to handle additional key combinations, but the inherited method should always be called.

Note:	KeyDown is a protected method. Applications cannot call it directly. It is called automatically in response to Windows events.


TDBEdit.KeyPress

TDBEdit	See also

Supplements the inherited method to handle any keystrokes that alter the state of the edit control.

procedure KeyPress(var Key: Char); override;

Description

KeyPress first calls the inherited method, which calls the OnKeyPress event handler. Next, KeyPress discards the keystroke if it is not a valid character for the field type, or if there is no link to a database field. Valid characters cause KeyPress to attempt to put the dataset into edit mode.

Pressing the Escape key causes KeyPress to call Reset, throwing away all unposted edits.

Note:	KeyPress is a protected method. Applications cannot call it directly. It is called automatically in response to Windows events.


TDBEdit.Notification

TDBEdit	See also

Overrides the inherited method to respond to opRemove notifications on the DataSource.

procedure Notification(AComponent: TComponent; Operation: TOperation); override;

Description

After calling the inherited method, Notification checks whether the notification indicates the removal of the DataSource. If so, Notification sets the DataSource property to nil.

Derived classes can override Notification method to handle additional notifications, but the inherited method should be always be called.

Note:	Notification is a protected method. Applications can’t call it directly.


TDBEdit.Reset

TDBEdit	See also

Cancels all unposted edits.

procedure Reset; override;

Description

Reset overrides the default method to cancel all unposted edits to the dataset when the user presses the Escape key.

Note:	Reset is a protected method. Applications cannot call it directly. It is called automatically when the user presses the Escape key.


TDBEdit.UpdateAction

TDBEdit	See also

Updates an action to reflect the current state of the TDBEdit.

function UpdateAction(Action: TBasicAction): Boolean; override;

Description

UpdateAction is called automatically when the application is idle to give the TDBEdit an opportunity to update associated actions. This allows actions to be grayed, checked, or to otherwise reflect the status of the TDBEdit they target.

The Action parameter specifies the action component that should be updated. UpdateAction returns True if the action component now reflects the state of the component, and False if it did not know how to update the action.


TDBEdit.UseRightToLeftAlignment

TDBEdit	See also

Specifies whether the control’s alignment is in a right-to-left mode.

function UseRightToLeftAlignment: Boolean;

Description

Call UseRightToLeftAlignment to determine whether the TDBEdit’s alignment is in a right-to-left mode. This information can be used when painting the TDBEdit data or when responding to mouse events.

UseRightToLeftAlignment returns True for middle east locales if the BiDiMode property is bdRightToLeft. Otherwise, it returns False.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMaskEdit


TDBEngineErrorDlg

Hierarchy	Properties	Methods	Events	See also

TDBEngineErrorDlg replaces the normal message box for EDBEngineError exceptions raised at design time.

Unit

Dbexcept

Description

The standard message box displayed by an unhandled exception shows only the exception's name and description. EDBEngineError exceptions, however, contain additional information that can be useful to application developers. For this reason, exceptions of the EDBEngineError class, when raised at design time, appear in a special dialog box called TDBEngineErrorDlg. The dialog shows the entire stack of BDE errors as represented in the EDBEngineError object.

At runtime, unhandled EDBEngineError exceptions generate the standard message box. But you can use the HookExceptions or ShowException method to display TDBEngineErrorDlg instead. This can be useful for debugging or in cases where you want the end user to have access to BDE error information.


TDBEngineErrorDlg properties

TDBEngineErrorDlg	Alphabetically	Legend

In TDBEngineErrorDlg

DBException

Derived from TCustomForm

Active

ActiveControl

ActiveMDIChild

ActiveOleControl

BorderIcons

BorderStyle

Canvas

ClientHandle

ClientHeight

ClientRect

ClientWidth

DefaultMonitor

Designer

DropTarget

Floating

FormState

FormStyle

HelpFile

Icon

KeyPreview

MDIChildCount

MDIChildren

Menu

ModalResult

Monitor

ObjectMenuItem

OldCreateOrder

OleFormObject

Parent

ParentBiDiMode

PixelsPerInch

Position

PrintScale

Scaled

TileMode

Visible

WindowMenu

WindowState

Derived from TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

BorderWidth

Brush

ClientOrigin

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DockManager

DockSite

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

UseDockManager

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

AutoSize

BiDiMode

BoundsRect

Caption

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragKind

DragMode

Enabled

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

ParentFont

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDBEngineErrorDlg properties

TDBEngineErrorDlg	By object	Legend

Action

Active

ActiveControl

ActiveMDIChild

ActiveOleControl

Align

Anchors

AutoScroll

AutoSize

BiDiMode

BorderIcons

BorderStyle

BorderWidth

BoundsRect

Brush

Canvas

Caption

ClientHandle

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DBException

DefaultMonitor

Designer

DesignInfo

DockClientCount

DockClients

DockManager

DockOrientation

DockSite

DoubleBuffered

DragKind

DragMode

DropTarget

Enabled

Floating

FloatingDockSiteClass

Font

FormState

FormStyle

Handle

Height

HelpContext

HelpFile

Hint

HorzScrollBar

HostDockSite

Icon

KeyPreview

Left

LRDockWidth

MDIChildCount

MDIChildren

Menu

ModalResult

Monitor

Name

ObjectMenuItem

OldCreateOrder

OleFormObject

Owner

Parent

ParentBiDiMode

ParentFont

ParentWindow

PixelsPerInch

PopupMenu

Position

PrintScale

Scaled

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

TileMode

Top

UndockHeight

UndockWidth

UseDockManager

VCLComObject

VertScrollBar

Visible

VisibleDockClientCount

Width

WindowMenu

WindowProc

WindowState


TDBEngineErrorDlg.DBException

TDBEngineErrorDlg	See also

Holds an instance of EDBEngineError.

property DbException: EDBEngineError;

Description

DBException is the EDBEngineError instance that causes the error dialog to appear.


TDBEngineErrorDlg events

TDBEngineErrorDlg	Alphabetically	Legend

Derived from TCustomForm

OnActivate

OnClose

OnCloseQuery

OnCreate

OnDeactivate

OnDestroy

OnHelp

OnHide

OnPaint

OnShortCut

OnShow

Derived from TWinControl

OnDockDrop

OnDockOver

OnGetSiteInfo

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseWheel

OnMouseWheelDown

OnMouseWheelUp

OnUnDock

Derived from TControl

OnCanResize

OnClick

OnConstrainedResize

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock


TDBEngineErrorDlg events

TDBEngineErrorDlg	By object	Legend

OnActivate

OnCanResize

OnClick

OnClose

OnCloseQuery

OnConstrainedResize

OnContextPopup

OnCreate

OnDblClick

OnDeactivate

OnDestroy

OnDockDrop

OnDockOver

OnDragDrop

OnDragOver

OnEndDock

OnGetSiteInfo

OnHelp

OnHide

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnMouseWheel

OnMouseWheelDown

OnMouseWheelUp

OnPaint

OnResize

OnShortCut

OnShow

OnStartDock

OnUnDock


TDBEngineErrorDlg methods

TDBEngineErrorDlg	Alphabetically

In TDBEngineErrorDlg

BackClick

DetailsBtnClick

FormCreate

FormDestroy

FormShow

HookExceptions

NextClick

ShowException

Derived from TForm

ArrangeIcons

Cascade

Next

Previous

Tile

Derived from TCustomForm

Close

CloseQuery

Create

CreateNew

DefocusControl

Destroy

FocusControl

GetFormImage

Hide

IsShortCut

MouseWheelHandler

Print

Release

SendCancelMode

SetFocus

SetFocusedControl

Show

ShowModal

WantChildKey

Derived from TScrollingWinControl

DisableAutoRange

EnableAutoRange

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

InitiateAction

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

IsRightToLeft

MethodAddress

MethodName

NewInstance


TDBEngineErrorDlg methods

TDBEngineErrorDlg	By object

AfterConstruction

ArrangeIcons

Assign

BackClick

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

Cascade

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

Close

CloseQuery

ContainsControl

ControlAtPos

Create

CreateNew

CreateParented

CreateParentedControl

DefaultHandler

DefocusControl

Destroy

DestroyComponents

Destroying

DetailsBtnClick

DisableAlign

DisableAutoRange

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EnableAutoRange

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

FocusControl

Focused

FormCreate

FormDestroy

FormShow

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetFormImage

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

HookExceptions

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

IsShortCut

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

Next

NextClick

PaintTo

Perform

Previous

Print

Realign

Refresh

Release

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendCancelMode

SendToBack

SetBounds

SetFocus

SetFocusedControl

SetTextBuf

Show

ShowException

ShowModal

Tile

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

WantChildKey


TDBEngineErrorDlg.BackClick

TDBEngineErrorDlg	See also

Displays the previous exception.

procedure BackClick(Sender: TObject);

Description

Call BackClick to simulate clicking the Back button in the dialog. BackClick displays information about the previous exception in the stack of exceptions shown in the dialog.


TDBEngineErrorDlg.DetailsBtnClick

TDBEngineErrorDlg	See also

Displays or hides the detail context information for an exception.

procedure DetailsBtnClick(Sender: TObject);

Description

Call DetailsBtnClick to simulate clicking the Details button in the dialog. If the detail context information is showing, DetailsBtnClick hides it. If the detail information is not showing, DetailsBtnClick displays it..


TDBEngineErrorDlg.FormCreate

TDBEngineErrorDlg	See also

Initializes the dialog when it is first created.

procedure FormCreate(Sender: TObject);

Description

Applications should not call FormCreate. It initializes the detail window so that the Details button works correctly.


TDBEngineErrorDlg.FormDestroy

TDBEngineErrorDlg	See also

Restores the global Application object’s OnException event handler.

procedure FormDestroy(Sender: TObject);

Description

Applications should not call FormDestroy. It is called automatically when the dialog is destroyed.

While the DbEngineErrorDlg is up, it assigns its own event handler to the Application object’s OnException event. FormDestroy restores this event handler to its previous state.


TDBEngineErrorDlg.FormShow

TDBEngineErrorDlg	See also

Displays the text for the current exception and its details.

procedure FormShow(Sender: TObject);

Description

Applications should not call FormShow. It is called automatically when the dialog becomes visible. FormShow sets the text for the current exception and, if detail information is showing, displays its details.


TDBEngineErrorDlg.HookExceptions

TDBEngineErrorDlg	See also

Enables the TDBEngineErrorDlg instance, replacing the standard exception message at runtime.

procedure HookExceptions;

Description

To display all unhandled EDBEngineError exceptions in a TDBEngineErrorDlg (rather than the standard message box), create a TDBEngineErrorDlg and call HookExceptions to enable it:

TDBEngineErrorDlg.Create(Application).HookExceptions;

If you include this code in an application's project (.DPR) file, or in an OnCreate event handler for the project's main form, the TDBEngineErrorDlg will trap and display unhandled EDBEngineError exceptions at runtime.


TDBEngineErrorDlg.NextClick

TDBEngineErrorDlg	See also

Displays the next exception.

procedure NextClick(Sender: TObject);

Description

Call NextClick to simulate clicking the Next button in the dialog. NextClick displays information about the next exception in the stack of exceptions shown in the dialog.


TDBEngineErrorDlg.ShowException

TDBEngineErrorDlg	See also

Displays an EDBEngineError exception in the TDBEngineErrorDlg.

function ShowException(Error: EDbEngineError): TModalResult;

Description

Call ShowException in an EDBEngineError exception handler to display the exception in a TDBEngineErrorDlg. You can create the TDBEngineErrorDlg in the exception handler itself, or in the initialization section of your application.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TScrollingWinControl

TCustomForm

TForm


TDBError

Hierarchy	Properties	Methods	See also

TDBError represents Borland Database Engine errors for the EDBEngineError exception class.

Unit

dbtables

Description

The TDBError object is a container for the information pertaining to one database error. One or more TDBError objects are contained in the collection object EDBEngineErrorErrors.

An EDBEngineError exception is raised when Borland Database Engine (BDE) or a database back-end accessed via the BDE produces an error condition on execution of a database operation. Information about each error involved in an error condition (such as an error code and error message) is passed by the BDE to the EDBEngineError object. If the error occurs at the level of a database system accessed by the BDE (such as InterBase, Oracle, or Sybase), the error information is passed through the BDE to the application’s exception object. EDBEngineError reads the stack of database engine errors and creates a separate TDBError object to represent each one. These TDBError objects are contained in the Errors property of EDBEngineError.

When an error condition originates with a database system accessed through the BDE, there will typically be two TDBError objects in the EDBEngineError.Errors property. The first will be the BDE version of the error and the second the database system’s version of the same error. In both cases, the Category, ErrorCode, and SubCode properties will contain the same values: the BDE error code for the particular type of error condition. In the TDBError object for the BDE’s version of the error the NativeCode property is empty and the text for the Message property contains the BDE error message the type type of error that occurred. In the TDBError object for the database system’s version of the error, the NativeCode property contains the database systems specific error code and the Message property text provided by the database system (and not the BDE).

For example, when a violation of an InterBase CHECK constraint occurs (an error condition that originates with InterBase and not the BDE), the error message provided by the BDE is the generic "General SQL error," while the error message provided by InterBase is a more explanatory error like "Operation violates CHECK constraint INTEG_30 on view or table EMPLOYEE."

It is also possible to have only BDE type errors in the TDBError objects. This is usually only applicable to use of local table types (dBASE, Paradox, and FoxPro), where the BDE is the database back-end and there is no external database system used.

The categories and subcodes for BDE errors are defined in BDE.INT.. For error information provided by a database system other than the BDE, consult the vendor-supplied documentation for the specific database system for definition or clarification.


TDBError properties

TDBError	Alphabetically	Legend

In TDBError

Category

ErrorCode

Message

NativeError

SubCode


TDBError properties

TDBError	By object	Legend

Category

ErrorCode

Message

NativeError

SubCode


TDBError.Category

TDBError 	See also

Indicates the category of error referenced by ErrorCode.

property Category: Byte;

Description

Category contains the high byte of the BDE error code. Combined with the low byte of the BDE error code (in the SubCode property) this produces the whole BDE error code (also contained in the ErrorCode property).

The categories and subcodes for BDE errors are defined in BDE.INT..


TDBError.ErrorCode

TDBError	See also

Indicates the error code returned by the BDE.

property ErrorCode: DBIResult;

Description

Use ErrorCode to determine the error code returned by the BDE. The value of ErrorCode is the combination of the high byte of the BDE error code (also in the Category property) and the low byte (in the SubCode property).

The categories and subcodes for BDE errors are defined in BDE.INT..


TDBError.Message

TDBError 	See also

Specifies the text of the error message.

property Message: String;

Description

Message contains the remote server message for native (server) errors or the BDE message associated with ErrorCode for non-server errors. To determine which type of message is contained in the Message property, inspect the NativeError property. A zero value there indicates a message provided by the BDE. A nonzero value indicates a message provided by the database system (server).


TDBError.NativeError
TDBError.NativeErrorTDBError 	See also

Indicates the remote error code returned from the server.

property NativeError: Longint;

Description

Use NativeError to determine whether the error represents a remote error received from the database server. If NativeError is 0, the error is not a server error.

Values in the NativeError property originate with the database system and not the BDE. Because of this they are not documented in the same place the BDE error codes are (in the file BDE.INT.), but in the vendor-supplied documentation for the specific database system used.


TDBError.SubCode
TDBError.SubCodeTDBError 	See also

Indicates the subcode of the error referenced by ErrorCode.

property SubCode: Byte;

Description

SubCode contains the low byte of the BDE error code. Combined with the high byte of the BDE error code (in the Category property) this produces the whole BDE error code (also contained in the ErrorCode property).

The categories and subcodes for BDE errors are defined in BDE.INT..


TDBError methods

TDBError	Alphabetically

In TDBError

Create

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDBError methods

TDBError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDBError.Create

TDBError	See also

Initializes an instance of TDBError using error information returned by the BDE.

constructor Create(ErrorCode: DBIResult);

Description

TDBError’s Create method is called by the EDBEngineError constructor, just as TDBError objects are freed by the EDBEngineError destructor. Application’s should never have cause for calling Create directly, except in the case of custom exception-handling objects descending from or similar to the EDBEngineError exception object.


Accessibility

Read-only


Hierarchy

TObject


TDBGridColumns

Hierarchy	Properties	Methods	See also

TDBGridColumns represents a container for TColumn objects.

Unit

dbgrids

Description

Each TDBGridColumns holds a collection of TColumn objects in a data grid (TDBGrid). TDBGridColumns maintains an index of the columns in its Items array. The Count property contains the number of columns in the collection. At design time, use the data grid’s Columns editor to add, remove, or modify columns.


TDBGridColumns properties

TDBGridColumns	Alphabetically	Legend

In TDBGridColumns

Grid

Items

State

Derived from TCollection

Count

ItemClass


TDBGridColumns properties

TDBGridColumns	By object	Legend

Count

Grid

ItemClass

Items

State


TDBGridColumns.Grid

TDBGridColumns	See also

Indicates the data-grid control to which the TDBGridColumns instance belongs.

property Grid: TCustomDBGrid;

Description

The read-only Grid property indicates which data-grid control (TDBGrid) owns the TDBGridColumns object.


TDBGridColumns.Items

TDBGridColumns 	See also

Lists the columns in the collection.

property Items[Index: Integer]: TColumn default;

Description

Use Items to access individual columns. The value of the Index parameter corresponds to the Index property of TColumn. It represents the position of the column in the data grid.

Items is the default property of TDBGridColumns. This means that the property name, Items, can be omitted when referring to columns of the TDBGridColumns object. Thus, the line

FirstCol := DBGrid1.Columns.Items[0];

can also be written

FirstCol := DBGrid1.Columns[0];


TDBGridColumns.State

TDBGridColumns	See also

Determines whether the columns in the data grid are dependent on dataset fields.

type TDBGridColumnsState = (csDefault, csCustomized);

property State: TDBGridColumnsState;

Description

If State is set to csDefault, columns in the data grid are generated dynamically from information in the grid’s associated dataset. The appearance, order, and other properties of the columns are determined by the dataset fields. Changes made to the columns are reflected in the dataset fields, and vice versa.

If State is set to csCustomized, many properties of the data-grid columns are independent of the associated dataset. For example, a column’s title caption is, by default, the same as the associated field’s DisplayLabel property; if State is csCustomized, however, the column title’s Caption property and the field’s DisplayLabel property can be changed independently. In fact, a customized (or “persistent”) column need not be associated with a dataset field at all.

Note:	If the Columns editor is used to configure data-grid columns, State is automatically set to csCustomized. Changing the State property at runtime deletes all existing columns.


TDBGridColumns methods

TDBGridColumns	Alphabetically

In TDBGridColumns

Add

Create

LoadFromFile

LoadFromStream

RebuildColumns

RestoreDefaults

SaveToFile

SaveToStream

Derived from TCollection

Assign

BeginUpdate

Clear

Delete

Destroy

EndUpdate

FindItemID

GetNamePath

Insert

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDBGridColumns methods

TDBGridColumns	By object

Add

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

FindItemID

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

Insert

InstanceSize

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

RebuildColumns

RestoreDefaults

SafeCallException

SaveToFile

SaveToStream


TDBGridColumns.Add

TDBGridColumns	See also

Creates a new TColumn instance and adds it to the Items array.

function Add: TColumn;

Description

Add returns the new column. At design time, use the data grid’s Columns editor to add columns to the grid.


TDBGridColumns.Create

TDBGridColumns	See also

Creates and initializes a TDBGridColumns object.

type TColumnClass = class of TColumn;

constructor Create(Grid: TCustomDBGrid; ColumnClass: TColumnClass);

Description

The Create method takes two parameters: a data-grid instance object and TColumn (or the name of a class derived from TColumn).

An application should seldom need to call Create directly. Instead, objects that use a TDBGridColumns object will instantiate the object as part of its initialization. An example of such an object is the TDBGrid and its Columns property.


TDBGridColumns.LoadFromFile

TDBGridColumns	See also

Reads the file specified in FileName and loads the data into the TDBGridColumns object.

procedure LoadFromFile(const Filename: String);

Description

Use the LoadFromFile method to retrieve grid columns data from a file and load into a TDBGridColumns object.


TDBGridColumns.LoadFromStream

TDBGridColumns	See also

Reads grid columns data from a stream and stores the contents in the TDBGridColumns object.

procedure LoadFromStream(S: TStream);

Description

Use the LoadFromStream method to read Stream and store the contents in the TDBGridColumns object.


TDBGridColumns.RebuildColumns

TDBGridColumns

Deletes existing columns and generates new columns from the dataset associated with the grid.

procedure RebuildColumns;

Description

RebuildColumns initializes the TDBGridColumns object by deleting all existing columns, then creating new ones from the grid’s associated dataset. If the grid is not connected to a dataset, RebuildColumns simply deletes any existing columns.


TDBGridColumns.RestoreDefaults

TDBGridColumns	See also

Restores all columns to their default settings.

procedure RestoreDefaults;

Description

RestoreDefaults iterates through the Items array, calling the RestoreDefaults method for each TColumn object. This method removes all changes made to properties of the TColumn objects and restores the default settings.


TDBGridColumns.SaveToFile

TDBGridColumns	See also

Saves the TDBGridColumns object to the file specified in FileName.

procedure SaveToFile(const Filename: String);

Description

Use the SaveToFile method to store TDBGridColumns data to a text file.


TDBGridColumns.SaveToStream

TDBGridColumns	See also

Writes a stream with the name passed in Stream with the contents of the TDBGridColumns object.

procedure SaveToStream(S: TStream);

Description

Use the SaveToStream method to stream out TDBGridColumns data.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


 TDBGrid

Hierarchy	Properties	Methods	Events	See also

TDBGrid displays and manipulates records from a dataset in a tabular grid.

Unit

dbgrids

Description

Put a TDBGrid object on a form to display and edit the records from a database table or query. Applications can use the data grid to insert, delete, or edit data in the database, or simply to display it.

At runtime, users can use the database navigator (TDBNavigator) to move through data in the grid, and to insert, delete, and edit the data. Edits that are made in the data grid are not posted to the underlying dataset until the user moves to a different record or closes the application.

TDBGrid implements the generic behavior introduced in TCustomDBGrid. TDBGrid publishes many of the properties inherited from TCustomDBGrid, but does not introduce any new behavior.


TDBGrid properties

TDBGrid	Alphabetically	Legend

Derived from TCustomDBGrid

Columns

DataSource

DefaultDrawing

FieldCount

Fields

Options

ReadOnly

SelectedField

SelectedIndex

SelectedRows

TitleFont

Derived from TCustomGrid

BorderStyle

EditorMode

FixedColor

Derived from TCustomControl

Canvas

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDBGrid properties

TDBGrid	By object	Legend

Action

Align

Anchors

BiDiMode

BorderStyle

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Columns

ComObject

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Constraints

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataSource

DefaultDrawing

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

EditorMode

Enabled

FieldCount

Fields

FixedColor

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

ImeMode

ImeName

Left

LRDockWidth

Name

Options

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ReadOnly

SelectedField

SelectedIndex

SelectedRows

ShowHint

Showing

TBDockHeight

TabOrder

TabStop

Tag

TitleFont

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TDBGrid events

TDBGrid	Alphabetically	Legend

Derived from TCustomDBGrid

OnCellClick

OnColEnter

OnColExit

OnColumnMoved

OnDrawColumnCell

OnDrawDataCell

OnEditButtonClick

OnTitleClick

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TDBGrid events

TDBGrid	By object	Legend

OnCellClick

OnColEnter

OnColExit

OnColumnMoved

OnDblClick

OnDragDrop

OnDragOver

OnDrawColumnCell

OnDrawDataCell

OnEditButtonClick

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag

OnTitleClick


TDBGrid methods

TDBGrid	Alphabetically

Derived from TCustomDBGrid

Create

DefaultDrawColumnCell

DefaultDrawDataCell

DefaultHandler

Destroy

ExecuteAction

ShowPopupEditor

UpdateAction

ValidFieldIndex

Derived from TCustomGrid

MouseCoord

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBGrid methods

TDBGrid	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultDrawColumnCell

DefaultDrawDataCell

DefaultHandler

DestroyComponents

Destroying

Destroy

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InitiateAction

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseCoord

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

ShowPopupEditor

Update

UpdateControlState

UpdateAction

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

ValidFieldIndex


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGrid

TCustomDBGrid


 TDBImage

Hierarchy	Properties	Methods	Events	See also

TDBImage represents a graphic image from a BLOB (binary large object) field of the current record of a dataset.

Unit

dbctrls

Description

Use TDBImage to represent the value of graphic fields. TDBImage allows a form to display graphical data from a dataset. TDBImage can allow the user to edit graphical data using the clipboard. While the application is running and the database image control has focus, users can cut, copy, and paste using the standard windows accelerator keys (Ctrl+X, Ctrl+C, and Ctrl+V). Users can return to the original state of the database image control by pressing Esc before moving to another record.

If the application doesn’t require the data-aware capabilities of TDBImage, use an image control (TImage) instead to conserve system resources.


TDBImage properties

TDBImage	Alphabetically	Legend

In TDBImage

AutoDisplay

BorderStyle

Center

DataField

DataSource

Field

Picture

QuickDraw

ReadOnly

Stretch

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDBImage properties

TDBImage	By object	Legend

Action

Align

Anchors

AutoDisplay

BiDiMode

BorderStyle

BoundsRect

Brush

Center

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Field

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

Picture

PopupMenu

QuickDraw

ReadOnly

ShowHint

Showing

Stretch

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TDBImage.AutoDisplay

TDBImage	See also

Determines whether to automatically display the contents of a graphic BLOB in the database image control.

property AutoDisplay: Boolean;

Description

If AutoDisplay is True (the default value), the image automatically displays new data when the underlying BLOB field changes (such as when moving to a new record).

If AutoDisplay is False, the image clears whenever the underlying BLOB field changes. To display the data, the user can double-click on the control or select it and press Enter. In addition, calling the LoadPicture method ensures that the control is showing data.

Change the value of AutoDisplay to False if the automatic loading of BLOB fields seems to take too long.


TDBImage.BorderStyle

TDBImage	See also

Determines whether the database image control has a border.

property BorderStyle: TBorderStyle;

Description

Set BorderStyle to specify whether a single line border should be drawn around the database image control.


TDBImage.Center

TDBImage	See also

Determines whether the image is centered in the image control.

property Center: Boolean;

Description

When the image does not fit perfectly within the image control, use Center to position the image. When Center is True, the image is centered in the control. When Center is False, the upper left corner of the image is positioned at the upper left corner of the control.

Note:	Center has no effect if the Stretch property is True.


TDBImage.DataField

TDBImage	See also

Specifies the field from which the database image displays data.

property DataField: String;

Description

Use DataField to bind the image control to a field in the dataset. To fully specify a database field, both the dataset and the field within that dataset must be defined. The DataSource property of the image control specifies the dataset which contains the DataField. DataField should specify a graphic field.

DBImage1.DataField := 'Portrait';


TDBImage.DataSource

TDBImage	See also

Links the image control to a dataset.

property DataSource: TDataSource;

Description

Use DataSource to link the image control to a dataset in which the data can be found. To fully specify a database field for the image control, both the dataset and a field within that dataset must be defined. Use the DataField property to specify the particular field within the dataset.

DBImage1.DataSource := DataSource1;


TDBImage.Field

TDBImage	See also

Specifies the TField component the database image is linked to.

property Field: TField;

Description

Read Field to get direct access to the contents and properties of the database field without going through the image control’s window. Use Field to change the contents of the database field programmatically. Use the Picture property to set the value of the field and display it in the image control’s window.

(DBEdit1.Field as TBlobField).Assign(Image1.Picture.Bitmap);


TDBImage.Picture

TDBImage	See also

Represents the image that appears on the database image control.

property Picture: TPicture;

Description

Read Picture to obtain the TPicture object that represents the value of the field. Set Picture to programmatically change the value of the graphic field. The property value is a TPicture object which can contain an icon, metafile, bitmap, or other graphic object.

Image1.Picture.Assign(DBImage1.Picture);


TDBImage.QuickDraw

TDBImage	See also

Specifies whether the image is displayed using a palette.

property QuickDraw: Boolean;

Description

Set QuickDraw to specify whether a customized palette should be used when displaying field values. If False, a palette is used, to provide the best possible image quality at the expense of additional processing time. If True, no special palette is used, which is faster, but results in poorer picture quality, especially with 256-color images on a 256-color video driver.


TDBImage.ReadOnly

TDBImage	See also

Determines whether the user can change the contents of the field using the image control.

property ReadOnly: Boolean;

Description

Set ReadOnly to True to prevent the user from changing the contents of the database field. When ReadOnly is True, the image control is used only to display the contents of the field. If ReadOnly is False, the user can change the field's value as long as the dataset is in edit mode.


TDBImage.Stretch

TDBImage	See also

Determines whether bitmaps and metafiles assume the size and shape of the database image.

property Stretch: Boolean;

Description

Set Stretch to True to cause the picture to assume the size and shape of the image control. When the image control resizes, the picture resizes also. Stretch resizes the height and width of the image independently. Thus, unlike a simple change in magnification, stretch can distort the image if the image control is not the same shape as the image.


TDBImage events

TDBImage	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TDBImage events

TDBImage	By object	Legend

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TDBImage methods

TDBImage	Alphabetically

In TDBImage

CopyToClipboard

Create

CutToClipboard

Destroy

ExecuteAction

LoadPicture

PasteFromClipboard

UpdateAction

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

HasParent

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBImage methods

TDBImage	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

Create

CreateParented

CreateParentedControl

CutToClipboard

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

LoadPicture

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TDBImage.CopyToClipboard

TDBImage	See also

Copies the picture in the image control to the Clipboard.

procedure CopyToClipboard;

Description

Use CopyToClipboard to put a copy of the graphic specified by the Picture property in the Clipboard.


TDBImage.Create

TDBImage	See also

Creates and initializes an instance of TDBImage.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TDBImage object at runtime. For TDBImage objects placed on forms or data modules at design time, the constructor is called automatically.

Pass a single Component as a parameter to provide the TDBLookupComboBox object with an Owner that is responsible for freeing it.After calling the inherited constructor to allocate and initialize a generic control object, Create

Adds csOpaque, csReplicatable to the ControlStyle,

Sets TabStop, AutoDisplay and Center to True and sets BorderStyle to bsSingle,

Creates a TPicture object and assigns it to the Picture property,

Initializes the height and width of the control,

Creates and initializes the helper objects needed to link to a dataset.


TDBImage.CutToClipboard

TDBImage	See also

Deletes the image in the control and copies it to the Clipboard.

procedure CutToClipboard;

Description

Use the CutToClipboard method to delete the image in the control when copying it to the Clipboard. CutToClipboard gives the associated field a null value.


TDBImage.Destroy

TDBImage	See also

Destroys an instance of TDBImage.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the TDBImage reference is not nil and only then calls Destroy.

Destroy frees the helper objects of the TDBImage before calling the inherited destructor.


TDBImage.ExecuteAction

TDBImage	See also

Invokes an action with the TDBImage as its target.

function ExecuteAction(Action: TBasicAction): Boolean; override;

Description

ExecuteAction is called automatically when the user invokes an action with the TDBImage as a target. The Action parameter specifies the action that was invoked. ExecuteAction returns True if the action was successfully dispatched, and False if the TDBImage could not handle the action.


TDBImage.LoadPicture

TDBImage	See also

Loads the image stored in the field into the database image control.

procedure LoadPicture;

Description

If the value of the AutoDisplay property is False, the image of a database image control is not automatically loaded. If AutoDisplay is False, control when the image is loaded at runtime by calling LoadPicture when the image should appear in the control.


TDBImage.PasteFromClipboard

TDBImage	See also

Copies the contents of the Clipboard to the control.

procedure PasteFromClipboard;

Description

Use PasteFromClipboard to set the field value to an image stored in the Clipboard.


TDBImage.UpdateAction

TDBImage	See also

Updates an action to reflect the current state of the TDBImage.

function UpdateAction(Action: TBasicAction): Boolean; override;

Description

UpdateAction is called automatically when the application is idle to give the TDBImage an opportunity to update associated actions. This allows actions to be grayed, checked, or to otherwise reflect the status of the TDBImage they target.

The Action parameter specifies the action component that should be updated. UpdateAction returns True if the action component now reflects the state of the component, and False if it did not know how to update the action.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


 TDBListBox

Hierarchy	Properties	Methods	Events	See also

TDBListBox represents a data-aware list box that allows the user to change the value of the field of the current record in a dataset by selecting an item from a list.

Unit

dbctrls

Description

Use TDBListBox to add a list box to a form that permits users to change a field value from a fixed set of choices.

If the application doesn’t require the data-aware capabilities of TDBListBox, use a list box (TListBox) instead to conserve system resources.

Component writers wanting to create a customized list box objects should use TCustomListBox as a base class.


TDBListBox properties

TDBListBox	Alphabetically	Legend

In TDBListBox

DataField

DataSource

Field

Items

ReadOnly

Derived from TCustomListBox

BorderStyle

Canvas

IntegralHeight

ItemHeight

ItemIndex

SelCount

Selected

Style

TopIndex

Derived from TWinControl

BevelEdges

BevelInner

BevelKind

BevelOuter

BevelWidth

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDBListBox properties

TDBListBox	By object	Legend

Action

Align

Anchors

BevelEdges

BevelInner

BevelKind

BevelOuter

BevelWidth

BiDiMode

BorderStyle

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Field

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

ImeMode

ImeName

IntegralHeight

ItemHeight

ItemIndex

Items

Left

LRDockWidth

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ReadOnly

SelCount

Selected

ShowHint

Showing

Style

TabOrder

TabStop

Tag

TBDockHeight

Top

TopIndex

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TDBListBox.DataField

TDBListBox	See also

Identifies the field whose value is displayed by the listbox.

property DataField: String;

Description

Set DataField to specify which field is represented by the listbox. The listbox displays the current value of this field, and allows the user to set the value of this field on the current record. The dataset the field is located in is specified by the DataSource property.

Set DataField to specify which field is represented by the listbox. (Note that this is does not refer to the source of the list, but to the field into which the selected value is inserted. The list values must be supplied manually using the Items property.) The listbox displays the current value of this field as the selected (highlighted) item, and allows the user to set the value of this field on the current record by selecting a value from the list. The dataset the field is located in is specified by the DataSource property.

DBListBox1.DataField := 'CountryName';

Tip:	For a data-aware listbox component for which the list values are automatically supplied, use a TDBLookupListBox instead.


TDBListBox.DataSource

TDBListBox	See also

Links the listbox to a dataset.

property DataSource: TDataSource;

Description

Specify the data source component that identifies the dataset the data is found in. To allow the listbox to represent the data for a field, both the DataSource and the DataField properties must be set.

Specify the data source component that identifies the dataset in which the target field is found. To allow the listbox to represent the data for a field, both the DataSource and the DataField properties must be set.

DBListBox1.DataSource := DataSource1;


TDBListBox.Field

TDBListBox	See also

Identifies the TField object the listbox is linked to.

property Field: TField;

Description

Use the Field object when you want to change the value of the data in the field programmatically.

DBListBox1.Field.AsString := 'Lithuania';


TDBListBox.Items

TDBListBox	See also

Contains the strings that appear in the list box.

property Items;

Description

Use Items to specify the values the user can choose from. Because Items is an object of type TStrings, you can add, delete, insert, and move items using the Add, Delete, Insert, Exchange, and Move methods of the TStrings object. For example, to add each string to the listbox, write a line of code such as the following:

while not Table2.Eof do begin

  DBListBox1.Items.Add(Table2.FieldByName('Country').AsString);

  Table2.Next;

end;

The ItemIndex property determines which item is selected, if any.


TDBListBox.ReadOnly

TDBListBox	See also

Determines if the user can change the field value using the listbox.

property ReadOnly: Boolean;

Description

Set ReadOnly to specify whether the listbox should be used for display purposes only. If ReadOnly is True, the listbox can only be used to display the value of the field on the current record. If ReadOnly is False, the user can use the listbox to change the field’s value to one of the values in the Items list.


TDBListBox events

TDBListBox	Alphabetically	Legend

Derived from TCustomListBox

OnDrawItem

OnMeasureItem

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TDBListBox events

TDBListBox	By object	Legend

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnDrawItem

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMeasureItem

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TDBListBox methods

TDBListBox	Alphabetically

In TDBListBox

Create

Destroy

ExecuteAction

UpdateAction

Derived from TCustomListBox

Clear

ItemAtPos

ItemRect

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBListBox methods

TDBListBox	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ItemAtPos

ItemRect

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TDBListBox.Create

TDBListBox	See also

Creates and initializes an instance of TDBListBox.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TDBListBox object at runtime. For TDBListBox objects placed on forms or data modules at design time, Create is called automatically.

Pass a single Component as a parameter to provide the TDBListBox with an Owner that is responsible for freeing it.

After calling the inherited constructor to allocate and initialize a generic list box object, Create creates and initializes the helper objects needed to link to a dataset.


TDBListBox.Destroy

TDBListBox	See also

Destroys an instance of TDBListBox.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the TDBListBox reference is not nil and only then calls Destroy.

Destroy frees the helper objects of the TDBListBox before calling the inherited destructor.


TDBListBox.ExecuteAction
TDBListBox.::ExecuteAction

TDBListBox	See also

Invokes an action with the TDBListBox as its target.

function ExecuteAction(Action: TBasicAction): Boolean; override;

Description

ExecuteAction is called automatically when the user invokes an action with the TDBListBox as a target. The Action parameter specifies the action that was invoked. ExecuteAction returns True if the action was successfully dispatched, and False if the TDBListBox could not handle the action.


TDBListBox.UpdateAction

TDBListBox	See also

Updates an action to reflect the current state of the TDBListBox.

function UpdateAction(Action: TBasicAction): Boolean; override;

Description

UpdateAction is called automatically when the application is idle to give the TDBListBox an opportunity to update associated actions. This allows actions to be grayed, checked, or to otherwise reflect the status of the TDBListBox they target.

The Action parameter specifies the action component that should be updated. UpdateAction returns True if the action component now reflects the state of the component, and False if it did not know how to update the action.


TDBListBox.UseRightToLeftAlignment

TDBListBox	See also

Specifies whether the control’s alignment is in a right-to-left mode.

function UseRightToLeftAlignment: Boolean;

Description

Call UseRightToLeftAlignment to determine whether the TDBListBox’s alignment is in a right-to-left mode. This information can be used when painting the TDBListBox data or when responding to mouse events.

UseRightToLeftAlignment returns True for middle east locales if the BiDiMode property is bdRightToLeft. Otherwise, it returns False.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomListBox


 TDBLookupComboBox

Hierarchy	Properties	Methods	Events	See also

TDBLookupComboBox represents a combo box that identifies a set of field values in one dataset with a corresponding set of values from another dataset.

Unit

dbctrls

Description

Use TDBLookupComboBox to provide the user with a convenient drop-down list of lookup items for filling in fields that require data from another dataset.

If TDBLookupComboBox is linked to a lookup field component, it automatically reads the relationship between the field value and the lookup values in the lookup dataset from the field component. The relationship between field values and the corresponding values in the lookup dataset can also be explicitly set using the properties of the lookup combo box when the combo box is not linked to a lookup field component.


TDBLookupComboBox properties

TDBLookupComboBox	Alphabetically	Legend

In TDBLookupComboBox

DropDownAlign

DropDownRows

DropDownWidth

ListVisible

Text

Derived from TDBLookupControl

DataField

DataSource

Field

KeyField

KeyValue

ListField

ListFieldIndex

ListSource

ReadOnly

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDBLookupComboBox properties

TDBLookupComboBox	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

DropDownAlign

DropDownRows

DropDownWidth

Enabled

Field

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

ImeMode

ImeName

KeyField

KeyValue

Left

ListField

ListFieldIndex

ListSource

ListVisible

LRDockWidth

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ReadOnly

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Text

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TDBLookupComboBox.DropDownAlign

TDBLookupComboBox	See also

Specifies how the drop-down list is aligned relative to its edit box.

type TDropDownAlign = (daLeft, daRight, daCenter);

property DropDownAlign: TDropDownAlign;

Description

Use DropDownAlign to specify the position of the drop-down list relative to the edit region of the lookup combo box. The drop down list can be aligned to the left or right, or centered with the edit box.


TDBLookupComboBox.DropDownRows

TDBLookupComboBox	See also

Specifies the number of items displayed in the drop-down list of the TDBLookupComboBox.

property DropDownRows: Integer;

Description

Use DropDownRows to specify how many rows appear in the drop down list of the combo box. If there are more lookup items than DropDownRows, the lookup list box displays a scroll bar.

The default value for DropDownRows is 7.


TDBLookupComboBox.DropDownWidth

TDBLookupComboBox	See also

Specifies the width, in pixels, of the drop-down list.

property DropDownWidth: Integer;

Description

Use DropDownWidth to customize the width of the drop-down list. If DropDownWidth is 0 (the default), the drop-down list is the same width as the combo box.

DropDownWidth is useful when displaying multiple lookup fields, and therefore, multiple columns in the database lookup combo box.


TDBLookupComboBox.ListVisible

TDBLookupComboBox	See also

Specifies whether the lookup list is open or “dropped-down”.

property ListVisible: Boolean;

Description

Read ListVisible to determine whether the list of lookup values is currently in the open (dropped-down) position. If ListVisible is True, the list is open; if ListVisible is False, the list is closed.


TDBLookupComboBox.Text

TDBLookupComboBox	See also

Indicates the lookup value that corresponds to the value of the field on the current record.

property Text: String;

Description

Inspect Text to determine the currently selected lookup value. Text is the value that appears in the edit region of the lookup combo box. The user can change the value of Text by entering a new value if ReadOnly is False and the dataset is in edit mode.


TDBLookupComboBox events

TDBLookupComboBox	Alphabetically	Legend

In TDBLookupComboBox

OnCloseUp

OnDropDown

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TDBLookupComboBox events

TDBLookupComboBox	By object	Legend

OnClick

OnCloseUp

OnContextPopup

OnDragDrop

OnDragOver

OnDropDown

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TDBLookupComboBox.OnCloseUp

TDBLookupComboBox	See also

Occurs immediately after an opened or “dropped-down” list is closed.

property OnCloseUp: TNotifyEvent;

Description

Write an OnCloseUp event handler to respond when the combo box list is closed. When the list is closed, the value that corresponds to the selected lookup value is assigned to the field. The list can be closed by the user or by calling the CloseUp method.

procedure TForm1.DBLookupComboBox1CloseUp(Sender: TObject);

begin

  StatusBar1.SimpleText := DBLookupComboBox1.Text;

end;


TDBLookupComboBox.OnDropDown

TDBLookupComboBox	See also

Occurs immediately before the lookup list is opened.

property OnDropDown: TNotifyEvent;

Description

Write an OnDropDown event handler to take specific action before the lookup list is displayed to the user. The list can be opened by the user or by calling the DropDown method.

procedure TForm1.DBLookupComboBox1DropDown(Sender: TObject);

begin

  StatusBar1.SimpleText := '';

end;


TDBLookupComboBox methods

TDBLookupComboBox	Alphabetically

In TDBLookupComboBox

CloseUp

Create

DropDown

ExecuteAction

UpdateAction

Derived from TDBLookupControl

Destroy

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

HasParent

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBLookupComboBox methods

TDBLookupComboBox	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

CloseUp

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

DropDown

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

IsRightToLeft

InstanceSize

Invalidate

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TDBLookupComboBox.CloseUp

TDBLookupComboBox	See also

Closes an opened or “dropped-down” list.

procedure CloseUp(Accept: Boolean);

Description

Call CloseUp to programmatically close the list of the lookup combo box. The Accept parameter determines whether to modify the field value with the value that corresponds to the selected value in the lookup list.

DBLookupComboBox1.CloseUp(True);


TDBLookupComboBox.Create

TDBLookupComboBox	See also

Creates and initializes an instance of TDBLookupComboBox.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a lookup combo box at runtime. TDBLookupComboBox objects placed on forms at design time are created automatically.

Pass a single Component as a parameter to provide the TDBLookupComboBox object with an Owner that is responsible for freeing it.

After calling the inherited constructor to allocate and initialize a generic list box object, Create creates and initializes various helper objects .


TDBLookupComboBox.DropDown

TDBLookupComboBox	See also

Opens or “drops down” the lookup list so that the user can choose a lookup value.

procedure DropDown;

Description

Call DropDown to programmatically open the lookup list. Before the list is displayed, an OnDropDown event is generated.


TDBLookupComboBox.ExecuteAction

TDBLookupComboBox	See also

Invokes an action with the TDBLookupComboBox as its target.

function ExecuteAction(Action: TBasicAction): Boolean; override;

Description

ExecuteAction is called automatically when the user invokes an action with the TDBLookupComboBox as a target. The Action parameter specifies the action that was invoked. ExecuteAction returns True if the action was successfully dispatched, and False if the TDBLookupComboBox could not handle the action.


TDBLookupComboBox.UpdateAction

TDBLookupComboBox	See also

Updates an action to reflect the current state of the TDBLookupComboBox.

function UpdateAction(Action: TBasicAction): Boolean; override;

Description

UpdateAction is called automatically when the application is idle to give the TDBLookupComboBox an opportunity to update associated actions. This allows actions to be grayed, checked, or to otherwise reflect the status of the TDBLookupComboBox they target.

The Action parameter specifies the action component that should be updated. UpdateAction returns True if the action component now reflects the state of the component, and False if it did not know how to update the action.


TDBLookupComboBox.UseRightToLeftAlignment

TDBLookupComboBox	See also

Specifies whether the control’s alignment is in a right-to-left mode.

function UseRightToLeftAlignment: Boolean;

Description

Call UseRightToLeftAlignment to determine whether the TDBLookupComboBox’s alignment is in a right-to-left mode. This information can be used when painting the TDBLookupComboBox data or when responding to mouse events.

UseRightToLeftAlignment returns True for middle east locales if the BiDiMode property is bdRightToLeft. Otherwise, it returns False.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TDBLookupControl


TDBLookupControl

Hierarchy	Properties	Methods	See also

TDBLookupControl is the base class for controls that provide the user with a list of lookup items for filling in fields that require data from another dataset.

Unit

dbctrls

Description

Use TDBLookupControl as a base class when defining controls that permit the user to set a field value by selecting a corresponding value from another dataset. The TDBLookupComboBox and TDBLookupListBox controls are both descended from the TDBLookupControl and provide the user with automatic lookup capabilities that are implemented in the TDBLookupControl object.

Do not create instances of TDBLookupControl. Instead, instantiate a descendant of TDBLookupControl to allow the user to set field values from a set of lookup values.


TDBLookupControl properties

TDBLookupControl	Alphabetically	Legend

In TDBLookupControl

DataField

DataSource

Field

HasFocus

KeyField

KeyValue

ListActive

ListField

ListFieldIndex

ListFields

ListLink

ListSource

ReadOnly

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragKind

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDBLookupControl properties

TDBLookupControl	By object	Legend

Action

Align

AnchorsTControl_Anchors>Main

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DataField

DataSource

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragKind

Enabled

Field

Floating

FloatingDockSiteClass

Handle

HasFocus

Height

HelpContext

Hint

HostDockSite

KeyField

KeyValue

Left

ListActive

ListField

ListFieldIndex

ListFields

ListLink

ListSource

LRDockWidth

Name

Owner

Parent

ParentColor

ParentWindow

ReadOnly

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TDBLookupControl.DataField

TDBLookupControl	See also

Identifies the field whose value is represented by the lookup control.

property DataField: String;

Description

Use DataField to bind the lookup control to a field in the dataset specified by the DataSource property. The DataField is the field whose value can be set by the lookup control, not the field which supplies the lookup values that are displayed by the lookup control.

If DataField specifies a lookup field component, there is no need to set the KeyField or ListField properties, as the field component contains all the information about the relationship between the data field value and the lookup value.


TDBLookupControl.DataSource

TDBLookupControl	See also

Links the lookup control to the dataset that contains the DataField.

property DataSource: TDataSource;

Description

Use DataSource to specify the data source component that identifies the dataset the lookup control represents. The lookup control represents a field in one table by displaying the value of a corresponding field in another table. DataSource links to the dataset for the field the control represents, as opposed to the ListSource, which links the lookup control to the lookup table that holds the field that is actually displayed. If the lookup control is used to edit data, the field that actually gets changed is the one in the DataSource.


TDBLookupControl.Field

TDBLookupControl	See also

Identifies the TField object the lookup control represents.

property Field: TField;

Description

Use the Field object to directly access the field component for the field the lookup control represents. If Field is a lookup field, the properties of the field component describe the relationship between the field and the lookup dataset. To allow a lookup control to represent a set of lookup values that do not come from another dataset, use the DataField property to bind to a lookup field and use the LookupList property of the TField object to specify a list of lookup values.


TDBLookupControl.HasFocus

TDBLookupControl	See also

Indicates whether the lookup control has input focus.

property HasFocus: Boolean;

Description

HasFocus is used internally to determine whether the lookup control has input focus. Applications should use the public Focused method instead.


TDBLookupControl.KeyField

TDBLookupControl	See also

Identifies the field in the ListSource dataset that must match the value of the DataField field.

property KeyField: String;

Description

Use KeyField to link the ListSource of the lookup control to the DataSource. Although the name of the field specified as the KeyField does not have to be the same as the name of the field specified as the DataField, the two fields must have the same values.

After specifying the ListField, choose which field the lookup control will actually display with the ListField property.

If the DataField field is a lookup field, don't specify anything for KeyField or ListField; lookup controls automatically use the data field's LookupKeyFields property for KeyField.


TDBLookupControl.KeyValue

TDBLookupControl	See also

Represents the common value of the KeyField field and the DataField field.

property KeyValue: Variant;

Description

Use KeyField to determine the value represented by the lookup control (not the value displayed by the lookup control). When KeyValue is set, the lookup control attempts to find a record from the ListSource's dataset where the value of KeyField matches KeyValue. If such a match is found, the lookup control displays the value of ListField on that record.


TDBLookupControl.ListActive

TDBLookupControl	See also

Indicates whether the ListFields property is currently being updated.

property ListActive: Boolean;

Description

ListActive is used internally to prevent the lookup control from attempting to use its data-aware properties while it is in the middle of an update. While refreshing the ListFields cache to reflect the current fields in the dataset, ListActive is False. At all other times, ListActive is True.


TDBLookupControl.ListField

TDBLookupControl	See also

Identifies the field or fields whose values are displayed in the lookup control.

property ListField: String;

Description

The lookup control represents a field in one table by displaying the value of one or more corresponding fields in another table. ListField is the name of the field or fields in the lookup table that are actually displayed, as opposed to the DataField, which is the field in the DataSource that the lookup control actually represents, or the KeyField, which is the field in the lookup table with the same value as the DataField.

To fully specify the list fields, both a dataset for the lookup table and the fields within that dataset must be defined. The ListSource property of the lookup control specifies the dataset for the lookup table.

ListField can represent more than one field. Multiple field names should be separated by semicolons.

Before specifying ListField, specify the link between the two datasets using the KeyField property. If ListField is not set, lookup controls display KeyField field values by default. If the DataField field is a lookup field, don't specify anything for ListField; the data controls automatically use the lookup field's LookupResultField property as ListField.


TDBLookupControl.ListFieldIndex

TDBLookupControl	See also

Specifies which field from the ListField property is used for incremental searching.

property ListFieldIndex: Integer;

Description

When the ListField property specifies more than one field, use ListFieldIndex to specify which of those fields is the one to use for incremental searches. For the TDBLookupComboBox object, ListFieldIndex also determines which field appears in the edit region of the combo box.

ListFieldIndex allows the most important value to appear in a position other than the first when all the values of the ListField fields are displayed. The value of ListFieldIndex must be less than the number of fields specified by the ListField property.


TDBLookupControl.ListFields

TDBLookupControl	See also

Lists the field components named by the ListField property.

property ListFields: TList;

Description

ListFields caches the field components that are named by the ListField property.


TDBLookupControl.ListLink

TDBLookupControl	See also

Identifies the TListSourceLink object that coordinates data communication with the lookup dataset.

property ListLink: TListSourceLink;

Description

ListLink is used internally to access the TListSourceLink that coordinates communication between the lookup dataset, the lookup data source (identified by the ListSource property), and the lookup control.


TDBLookupControl.ListSource

TDBLookupControl	See also

Identifies a data source for the data displayed in the lookup control.

property ListSource: TDataSource;

Description

Set LookupSource to the data source that contains the KeyField and ListField fields. If the DataField field is a lookup field, don't specify anything for ListSource; data controls automatically use the lookup field's LookupDataSet property to create a data source.


TDBLookupControl.ReadOnly

TDBLookupControl	See also

Determines if the user can use the lookup control to set the value of the DataField field.

property ReadOnly: Boolean;

Description

Use ReadOnly to specify whether the lookup control is used for display purposes only. If ReadOnly is True, the lookup control can only be used to display the lookup values that correspond to the value of the DataField field on the current record. If ReadOnly is False, the user can use the lookup control to change the field’s value.


TDBLookupControl methods

TDBLookupControl	Alphabetically	Legend

In TDBLookupControl

Create

Destroy

ExecuteAction

Notification

UpdateAction

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

HasParentGetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBLookupControl methods

TDBLookupControl	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

Notification

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TDBLookupControl.Create

TDBLookupControl	See also

Creates an instance of TDBLookupControl.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a lookup control at runtime. For lookup controls placed on forms or data modules at design time, Create is called automatically.

After calling the inherited constructor to allocate and initialize a generic custom control, Create creates and initializes the helper objects needed to link to the datasets.


TDBLookupControl.Destroy

TDBLookupControl	See also

Destroys an instance of TDBLookupControl.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the TDBLookupControl reference is not nil and only then calls Destroy.

Destroy frees the helper objects of the TDBLookupControl before calling the inherited destructor.


TDBLookupControl.ExecuteAction

TDBLookupControl	See also

Invokes an action with the TDBLookupControl as its target.

function ExecuteAction(Action: TBasicAction): Boolean; override;

Description

ExecuteAction is called automatically when the user invokes an action with the TDBLookupControl as a target. The Action parameter specifies the action that was invoked. ExecuteAction returns True if the action was successfully dispatched, and False if the TDBLookupControl could not handle the action.


TDBLookupControl.Notification

TDBLookupControl	See also

Responds to notifications that components are being created or destroyed.

procedure Notification(AComponent: TComponent; Operation: TOperation); override;

Description

After calling the inherited method, Notification checks whether the notification indicates the removal of DataSource or ListSource. If so, Notification sets the property to nil.

Derived classes can override Notification method to handle additional notifications, but the inherited method should be always be called.


TDBLookupControl.UpdateAction

TDBLookupControl	See also

Updates an action to reflect the current state of the TDBLookupControl.

function UpdateAction(Action: TBasicAction): Boolean; override;

Description

UpdateAction is called automatically when the application is idle to give the TDBLookupControl an opportunity to update associated actions. This allows actions to be grayed, checked, or to otherwise reflect the status of the TDBLookupControl they target.

The Action parameter specifies the action component that should be updated. UpdateAction returns True if the action component now reflects the state of the component, and False if it did not know how to update the action.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


 TDBLookupListBox

Hierarchy	Properties	Methods	Events	See also

TDBLookupListBox provides a list of lookup items for filling in fields that require data from another dataset.

Unit

dbctrls

Description

Use TDBLookupListBox to provide users with a convenient list of lookup items to set a field value using the values of a field in another dataset. Lookup list boxes usually display values that are a represent a more meaningful description of the actual field value.

If TDBLookupListBox is linked to a lookup field component, it automatically reads the relationship between the field value and the lookup values in the lookup dataset from the field component. The relationship between field values and the corresponding values in the lookup dataset can also be explicitly set using the properties of the lookup list box when the list box is not linked to a lookup field component.


TDBLookupListBox properties

TDBLookupListBox	Alphabetically	Legend

In TDBLookupListBox

BorderStyle

RowCount

SelectedItem

Derived from TDBLookupControl

DataField

DataSource

Field

KeyField

KeyValue

ListField

ListFieldIndex

ListSource

ReadOnly

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDBLookupListBox properties

TDBLookupListBox	By object	Legend

Action

Align

Anchors

BiDiMode

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Field

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

ImeMode

ImeName

KeyField

KeyValue

Left

ListField

ListFieldIndex

ListSource

LRDockWidth

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ReadOnly

RowCount

SelectedItem

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TDBLookupListBox.BorderStyle

TDBLookupListBox	See also

Determines whether the lookup list box has a border.

property BorderStyle: TBorderStyle;

Description

Set BorderStyle to specify whether a border should be drawn around the lookup list box. These are the possible values:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border


TDBLookupListBox.RowCount

TDBLookupListBox	See also

Specifies how many rows are visible in the list box.

property RowCount: Integer;

Description

Set RowCount to the number of rows displayed in the lookup list box. The list box is resized to match the specified number of rows. Resizing the list box (such as by changing its Height property) automatically changes the value of RowCount to match the new height.


TDBLookupListBox.SelectedItem

TDBLookupListBox	See also

Contains the value displayed in the list box that is currently selected.

property SelectedItem: String;

Description

Read SelectedItem to determine the value the user selected using the lookup list box. If no item is selected, SelectedItem is an empty string.

StrVar := DBLookupListBox1.SelectedItem;


TDBLookupListBox events

TDBLookupListBox	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TDBLookupListBox events

TDBLookupListBox	By object	Legend

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TDBLookupListBox methods

TDBLookupListBox	Alphabetically

In TDBLookupListBox

Create

ExecuteAction

UpdateAction

Derived from TDBLookupControl

Destroy

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

HasParent

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBLookupListBox methods

TDBLookupListBox	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TDBLookupListBox.Create

TDBLookupListBox	See also

Creates an instance of TDBLookupListBox.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TDBLookupListBox object at runtime. For TDBLookupListBox objects placed on forms or data modules at design time, Create is called automatically.

Pass a single Component as a parameter to provide the TDBLookupListBox object with an Owner that is responsible for freeing it.After calling the inherited constructor to allocate and initialize a generic lookup control, Create creates and initializes the helper objects needed to link to a dataset.


TDBLookupListBox.ExecuteAction

TDBLookupListBox	See also

Performs an action directed at the DB lookup list box.

function ExecuteAction(Action: TBasicAction): Boolean; override;

Description

ExecuteAction is called automatically when the user invokes an action with the DB lookup list box as a target. The Action parameter specifies the action component that was invoked.

ExecuteAction first calls the inherited method, which checks whether the action component knows how to perform its function with the DB lookup list box as a target. If the action does not handle the invocation with the list box as a target, ExecuteAction checks whether this is an action that takes a dataset as a target. If so, ExecuteAction invokes the action, using the dataset associated with the DataSource property as a target.


TDBLookupListBox.UpdateAction

TDBLookupListBox	See also

Updates an action component to reflect the current state of the DB lookup list box.

function UpdateAction(Action: TBasicAction): Boolean; override;

Description

UpdateAction is called automatically when the CPU is idle to allow the DB lookup list box the opportunity of updating an action. For example, UpdateAction disables actions that require the dataset to be active when the dataset associated with the DataSource property is not active.

The Action parameter specifies the action component that should be updated.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TDBLookupControl


TLoginDialog

Hierarchy	Properties	Methods	Events	See also

TLoginDialog is a login dialog box that can be used to provide login security within an application.

Unit

dblogdlg

Description

Use TLoginDialog to provide login security within an application. Usually a TLoginDialog object is created with the LoginDialogEx function and is used to provide secure access to local database tables. However, TLoginDialog can also be used as a base object for other types of login dialog boxes.


TLoginDialog properties

TLoginDialog	Alphabetically	Legend

Derived from TCustomForm

Active

ActiveControl

ActiveMDIChild

ActiveOleControl

BorderIcons

BorderStyle

Canvas

ClientHandle

ClientHeight

ClientRect

ClientWidth

DefaultMonitor

Designer

DropTarget

Floating

FormState

FormStyle

HelpFile

Icon

KeyPreview

MDIChildCount

MDIChildren

Menu

ModalResult

Monitor

ObjectMenuItem

OldCreateOrder

OleFormObject

Parent

ParentBiDiMode

PixelsPerInch

Position

PrintScale

Scaled

TileMode

Visible

WindowMenu

WindowState

Derived from TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

BorderWidth

Brush

ClientOrigin

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DockManager

DockSite

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

UseDockManager

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

AutoSize

BiDiMode

BoundsRect

Caption

Color

Constraints

ControlState

ControlStyle

Cursor

DragKind

DragMode

DockOrientation

Enabled

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

ParentFont

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TLoginDialog properties

TLoginDialog	By object	Legend

Action

Active

ActiveControl

ActiveMDIChild

ActiveOleControl

Align

Anchors

AutoScroll

AutoSize

BiDiMode

BorderIcons

BorderStyle

BorderWidth

BoundsRect

Brush

Canvas

Caption

ClientHandle

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DefaultMonitor

Designer

DesignInfo

DockClientCount

DockClients

DockManager

DockOrientation

DockSite

DoubleBuffered

DragKind

DragMode

DropTarget

Enabled

Floating

FloatingDockSiteClass

Font

FormState

FormStyle

Handle

Height

HelpContext

HelpFile

Hint

HorzScrollBar

HostDockSite

Icon

KeyPreview

Left

LRDockWidth

MDIChildCount

MDIChildren

Menu

ModalResult

Monitor

Name

ObjectMenuItem

OldCreateOrder

OleFormObject

Owner

Parent

ParentBiDiMode

ParentFont

ParentWindow

PixelsPerInch

PopupMenu

Position

PrintScale

Scaled

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

TileMode

Top

UndockHeight

UndockWidth

UseDockManager

VCLComObject

VertScrollBar

Visible

VisibleDockClientCount

Width

WindowMenu

WindowProc

WindowState


TLoginDialog events

TLoginDialog	Alphabetically	Legend

Derived from TCustomForm

OnActivate

OnClose

OnCloseQuery

OnCreate

OnDeactivate

OnDestroy

OnHelp

OnHide

OnPaint

OnShortCut

OnShow

Derived from TWinControl

OnDockDrop

OnDockOver

OnGetSiteInfo

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseWheel

OnMouseWheelDown

OnMouseWheelUp

OnUnDock

Derived from TControl

OnCanResize

OnClick

OnConstrainedResize

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock


TLoginDialog events

TLoginDialog	By object	Legend

OnActivate

OnCanResize

OnClick

OnClose

OnCloseQuery

OnConstrainedResize

OnContextPopup

OnCreate

OnDblClick

OnDeactivate

OnDestroy

OnDockDrop

OnDockOver

OnDragDrop

OnDragOver

OnEndDock

OnGetSiteInfo

OnHelp

OnHide

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnMouseWheel

OnMouseWheelDown

OnMouseWheelUp

OnPaint

OnResize

OnShortCut

OnShow

OnStartDock

OnUnDock


TLoginDialog methods

TLoginDialog	Alphabetically

In TLoginDialog

FormShow

Derived from TForm

ArrangeIcons

Cascade

Next

Previous

Tile

Derived from TCustomForm

AfterConstruction

BeforeDestruction

Close

CloseQuery

Create

CreateNew

DefocusControl

Destroy

Dock

FocusControl

GetFormImage

Hide

IsShortCut

MouseWheelHandler

Print

Release

SendCancelMode

SetFocus

SetFocusedControl

Show

ShowModal

WantChildKey

Derived from TScrollingWinControl

DisableAutoRange

EnableAutoRange

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TLoginDialog methods

TLoginDialog	By object

AfterConstruction

ArrangeIcons

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

Cascade

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

Close

CloseQuery

ContainsControl

ControlAtPos

Create

CreateNew

CreateParented

CreateParentedControl

DefaultHandler

DefocusControl

Destroy

DestroyComponents

Destroying

DisableAlign

DisableAutoRange

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EnableAutoRange

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

FocusControl

Focused

FormShow

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetFormImage

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

IsShortCut

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

Next

PaintTo

Perform

Previous

Print

Realign

Refresh

Release

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendCancelMode

SendToBack

SetBounds

SetFocus

SetFocusedControl

SetTextBuf

Show

ShowModal

Tile

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

WantChildKey


TLoginDialog.FormShow

TLoginDialog

Adjusts the contents of the login dialog when it becomes visible.

procedure FormShow(Sender: TObject);

Description

FormShow is called automatically just before the login dialog becomes visible. It fixes up the controls in the login dialog so that the text appears properly formatted.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TScrollingWinControl

TCustomForm

TForm


 TDBMemo

Hierarchy	Properties	Methods	Events	See also

TDBMemo represents a multiline edit control that can display and edit a field in a dataset.

Unit

dbctrls

Description

Use TDBMemo to let users edit a field that may contain lengthy textual data or to simply display the contents of such a field. TDBMemo uses the Text property to represent the contents of the field.

TDBMemo permits multiple lines of text. Thus, TDBMemo is appropriate for long alphanumeric fields or text binary large objects (BLOBs). For short alphanumeric fields, consider using a TDBEdit component instead.

If the application doesn’t require the data-aware capabilities of TDBMemo, use a memo control (TMemo) instead, to conserve system resources.


TDBMemo properties

TDBMemo	Alphabetically	Legend

In TDBMemo

AutoDisplay

DataField

DataSource

Field

ReadOnly

Derived from TCustomMemo

Alignment

CaretPos

Lines

ScrollBars

WantTabs

WordWrap

Derived from TCustomEdit

BorderStyle

CanUndo

MaxLength

Modified

SelLength

SelStart

SelText

Derived from TWinControl

BevelEdges

BevelInner

BevelKind

BevelOuter

BevelWidth

BorderWidth

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeightText

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDBMemo properties

TDBMemo	By object	Legend

Action

Align

Alignment

Anchors

AutoDisplay

BevelEdges

BevelInner

BevelKind

BevelOuter

BevelWidth

BiDiMode

BorderStyle

BorderWidth

BoundsRect

Brush

CanUndo

CaretPos

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Field

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

ImeMode

ImeName

Left

Lines

LRDockWidth

MaxLength

Modified

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ReadOnly

ScrollBars

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

WantTabs

Width

WindowProc

WordWrap


TDBMemo.AutoDisplay

TDBMemo	See also 	Example

Determines whether to automatically display the contents of a memo or graphic BLOB in a database memo.

property AutoDisplay: Boolean;

Description

If AutoDisplay is True, the control automatically displays new data when the underlying BLOB field changes (such as when moving to a new record).

If AutoDisplay is False, the control shows only the field name whenever the underlying BLOB field changes. To display the data, the user can double-click on the control or select it and press Enter.

The effect of AutoDisplay is not purely cosmetic. The data shown by the TDBMemo is the value of the Text property. When AutoDisplay is False, if the data changes, the value of the Text property changes to the name of the field. Thus, if AutoDisplay is False, applications should be cautious about using the value of the Text property to ascertain the value of the underlying field.

Calling the LoadMemo method causes Text to update to the current value of the BLOB field. This change will also be reflected in the appearance of the control on screen.

Change the value of AutoDisplay to False if the automatic loading of BLOB fields takes too long.

Note:	AutoDisplay only applies to BLOB fields. If the control is bound to another type of text field, AutoDisplay has no effect.


TDBMemo.DataField

TDBMemo	See also

Specifies the name of the field for which the database memo displays data.

property DataField: String;

Description

Use DataField to link the memo control to a field in the dataset. Just setting DataField by itself will not link the memo control to a database field. Additionally, the dataset which contains the field must be specified by setting the DataSource property.

DBMemo1.DataField := 'Notes';


TDBMemo.DataSource

TDBMemo	See also

Links the memo control to the dataset that contains the field for which the memo control displays data.

property DataSource: TDataSource;

Description

Link the memo control with a dataset by setting DataSource to a data source component that identifies the desired dataset. Specify which field in the dataset contains the memo data using the DataField property.

DBMemo1.DataSource := DataSource1;


TDBMemo.Field

TDBMemo	See also

Identifies the TField component the database memo is linked to.

property Field: TField;

Description

Read Field to get direct access to the contents and properties of the database field without going through the edit window. Use Field to change the contents of the database field programmatically.

Use the Text property instead to change the contents of the memo control without immediately writing the changes to the record in the dataset. Changing the Text property allows the user to cancel the changes.

(DBMemo1.Field as TMemoField).Assign(Memo1.Lines);


TDBMemo.ReadOnly

TDBMemo	See also

Determines whether the user can change the contents of the database memo.

property ReadOnly: Boolean;

Description

If ReadOnly is True, the user can't change the contents. If ReadOnly is False, the user can modify the contents.

The ReadOnly property determines whether the user can use the database memo to change the value of the field of the current record, or if the control only displays the value. If ReadOnly is False, the user can change the field's value as long as the dataset is in edit mode.


TDBMemo events

TDBMemo	Alphabetically	Legend

Derived from TCustomEdit

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TDBMemo events

TDBMemo	By object	Legend

OnChange

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TDBMemo methods

TDBMemo	Alphabetically	Legend

In TDBMemo

Change

Create

Destroy

ExecuteAction

KeyDown

KeyPress

LoadMemo

Notification

UpdateAction

WndProc

Derived from TCustomMemo

GetControlsAlignment

Derived from TCustomEdit

Clear

ClearSelection

ClearUndo

CopyToClipboard

CutToClipboard

DefaultHandler

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Undo

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

HasParent

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBMemo methods

TDBMemo	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

Change

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClearSelection

ClearUndo

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

Create

CreateParented

CreateParentedControl

CutToClipboard

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

KeyDown

KeyPress

LoadMemo

MethodAddress

MethodName

MouseWheelHandler

NewInstance

Notification

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

Undo

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

WndProc


TDBMemo.Change

TDBMemo	See also

Informs the data source of changes to the value of the text, before invoking the OnChange event handler.

procedure Change; override;

Description

Applications do not call the Change method directly: it is triggered automatically by Windows events. Derived classes can override the Change method to make additional responses to changes in the Text property. Any class that overrides the Change method should call the inherited method as well.


TDBMemo.Create

TDBMemo	See also

Creates an instance of TDBMemo.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TDBMemo. Create overrides the inherited constructor to initialize the data handling aspects of a TDBMemo.

Pass a single Component as a parameter to provide the TDBMemo with an Owner that is responsible for freeing it.


TDBMemo.Destroy

TDBMemo	See also

Destroys an instance of TDBMemo.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the TDBMemo reference is not nil and only then calls Destroy.

Destroy frees up the memory associated with data handling that was allocated in the constructor, before calling the inherited destructor.


TDBMemo.ExecuteAction

TDBMemo	See also

Invokes an action with the TDBMemo as its target.

function ExecuteAction(Action: TBasicAction): Boolean; override;

Description

ExecuteAction is called automatically when the user invokes an action with the TDBMemo as a target. The Action parameter specifies the action that was invoked. ExecuteAction returns True if the action was successfully dispatched, and False if the TDBMemo could not handle the action.


TDBMemo.KeyDown

TDBMemo	See also

Overrides the inherited method to put the dataset in an editing state if the user types Del or Shift+Insert.

procedure KeyDown(var Key: Word; Shift: TShiftState); override;

Description

KeyDown first calls the inherited method, which calls the OnKeyDown event handler. KeyDown next attempts to put the dataset into an editing state when the user types Del or Shift+Insert. If the memo control is not linked to a dataset, KeyDown discards the keystroke. Derived classes can override KeyDown to handle additional key combinations, but the inherited method should always be called.


TDBMemo.KeyPress

TDBMemo	See also

KeyPress overrides the inherited method to handle any keystrokes that alter the state of the edit control.

procedure KeyPress(var Key: Char); override;

Description

KeyPress first calls the inherited method, which calls the OnKeyPress event handler. Next, KeyPress checks the value of the key, and throws it away if it is not a valid character for the field type, or if there is no link to a database field. Valid characters cause KeyPress to attempt to put the dataset into edit mode.

If the field for the memo control is a text BLOB, pressing the Pause key causes KeyPress to call the LoadMemo method. Pressing the Escape key causes KeyPress to throw away unposted edits.


TDBMemo.LoadMemo

TDBMemo	See also 	Example

LoadMemo loads the text BLOB from the field in the database into the memo control.

procedure LoadMemo; virtual;

Description

LoadMemo allows an application to control when the memo control displays the actual contents of a text BLOB field. Use LoadMemo to update the text in the memo control to the value of the field in the current record. LoadMemo only works with text BLOB fields, when the AutoDisplay property is False, so that the value of the field is not loaded automatically.


TDBMemo.Notification

TDBMemo	See also

Overrides the inherited method to respond to opRemove notifications on the DataSource.

procedure Notification(AComponent: TComponent; Operation: TOperation); override;

Description

After calling the inherited method, Notification checks whether the notification indicates the removal of the DataSource. If so, Notification sets the DataSource property to nil.

Derived classes can override Notification method to handle additional notifications, but the inherited method should be always be called.


TDBMemo.UpdateAction

TDBMemo	See also

Updates an action to reflect the current state of the TDBMemo.

function UpdateAction(Action: TBasicAction): Boolean; override;

Description

UpdateAction is called automatically when the application is idle to give the TDBMemo an opportunity to update associated actions. This allows actions to be grayed, checked, or to otherwise reflect the status of the TDBMemo they target.

The Action parameter specifies the action component that should be updated. UpdateAction returns True if the action component now reflects the state of the component, and False if it did not know how to update the action.


TDBMemo.WndProc

TDBMemo	See also

Provides specific message responses for the memo control.

procedure WndProc(var Message: TMessage); override;

Description

WndProc overrides the WndProc for TWinControl to handle window messages that are specific to painting a TDBMemo control, and sends all others to the inherited WndProc.

Derived classes that override WndProc to provide specialized responses to messages should call the inherited WndProc at the end to dispatch any other messages.


Scope

Published

Protected

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMemo


 TDBNavigator

Hierarchy	Properties	Methods	Events	See also

TDBNavigator (the database navigator) is used to move through the data in a dataset and perform operations on the data, such as inserting a blank record or posting a record.

Unit

dbctrls

Description

Use the database navigator on forms that contain data-aware controls, such as TDBGrid or TDBEdit. TDBNavigator provides the user with control over the dataset when editing or viewing the data.

When the user chooses one of the navigator buttons, the appropriate action occurs on the dataset the navigator is linked to. For example, if the user clicks the Insert button, a blank record is inserted in the dataset.

TDBNavigator can show any or all of the following buttons:

Button	Purpose

First	Sets the current record to the first record in the dataset, disables the First and Prior buttons, and enables the Next and last buttons if they are disabled.

Prior	Sets the current record to the previous record and enables the Last and Next buttons if they are disabled.

Next	Sets the current record to the next record and enables the First and Prior buttons if they are disabled.

Last	Sets the current record to the last record in the dataset, disables the Last and Next buttons, and enables the First and Prior buttons if they are disabled.

Insert	Inserts a new record before the current record, and sets the dataset into Insert and Edit states.

Delete	Deletes the current record and makes the next record the current record.

Edit	Puts the dataset into Edit state so that the current record can be modified.

Post	Writes changes in the current record to the database.

Cancel	Cancels edits to the current record, restores the record display to its condition prior to editing, and turns off Insert and Edit states if they are active.

Refresh	Refreshes the buffered data in the associated dataset. For TQuery components, this button is disabled unless the RequestLive property is True.


TDBNavigator properties

TDBNavigator	Alphabetically	Legend

In TDBNavigator

ConfirmDelete

DataSource

Flat

Hints

VisibleButtons

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDBNavigator properties

TDBNavigator	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConfirmDelete

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DataSource

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Flat

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

Hints

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentCtl3D

ParentShowHint

ParentWindow

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleButtons

VisibleDockClientCount

Width

WindowProc


TDBNavigator.ConfirmDelete

TDBNavigator	See also

Determines whether a message box appears asking the user to confirm record deletions initiated using the database navigator.

property ConfirmDelete: Boolean;

Description

Use the ConfirmDelete property to help prevent the user from accidentally deleting a record from the dataset.

If ConfirmDelete is True, a message box appears when the user presses the delete button and the record isn't deleted unless the user chooses the OK button. If ConfirmDelete is False, no message box appears and the record is simply deleted.


TDBNavigator.DataSource

TDBNavigator	See also

Links the navigator to the dataset which it controls.

property DataSource: TDataSource;

Description

Use the DataSource property to link the database navigator with a dataset. Specify the data source component that identifies the dataset the data is found in.


TDBNavigator.Flat

TDBNavigator	See also

Determines whether the buttons of the navigator have a three-dimensional (3-D) look with borders or two-dimensional look without borders.

property Flat: Boolean;

Description

When Flat is True, the navigator buttons appear flat and do not have borders separating them. When Flat is False, the buttons are clearly defined.


TDBNavigator.Hints

TDBNavigator	See also

Provides a way to customize the Help Hints for the buttons on the database navigator.

property Hints: TStrings;

Description

Use the Hints property to supply Help Hints of your choosing for the individual navigator buttons. Each button has a default Help Hint. Hints allow the values of any or all of these default Help Hints to be replaced by customized hints.

Hints is a string list. Each hint is a string. The first string in the string list becomes the Help Hint for the first button on the navigator (the First button). The seventh hint becomes the Help Hint for the seventh button (the Edit button).

When specifying Hints at runtime, enter an empty string ('') for any Help Hint that should keep the default value. Simply leave the line blank when using the string list property editor of the Object Inspector for the Hints property.

Note:	To have the Help Hints appear at runtime, set the ShowHint property to True.


TDBNavigator.VisibleButtons

TDBNavigator	See also

Determines which buttons appear on the database navigator.

type TButtonSet = set of TNavigateBtn;

property VisibleButtons: TButtonSet;

Description

Use VisibleButtons to select which buttons appear on the navigator. Leave any of the navigator buttons out of the VisibleButtons set to hide those buttons and thereby prevent the user from performing certain operations. For example, to only allow the user to view the records in the dataset, VisibleButtons should include only the nbFirst, nbPrior, nbNext, and nbLast


TDBNavigator events

TDBNavigator	Alphabetically	Legend

In TDBNavigator

BeforeAction

OnClick

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnResize

OnStartDock

OnStartDrag


TDBNavigator events

TDBNavigator	By object	Legend

BeforeAction

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnResize

OnStartDock

OnStartDrag


TDBNavigator.BeforeAction

TDBNavigator	See also

Occurs when a button on the database navigator is clicked, before the action is executed.

type

  ENavClick = procedure (Sender: TObject; Button: TNavigateBtn) of object;

property BeforeAction: ENavClick;

Description

Write a BeforeAction event handler to take specific action before the default response when a user clicks a button in the database navigator.

The Button parameter indicates which button was clicked.


TDBNavigator.OnClick

TDBNavigator	See also	Example

Occurs when a button on the database navigator is clicked, after the action is executed.

type ENavClick = procedure (Sender: TObject; Button: TNavigateBtn) of object;

property OnClick: ENavClick;

Description

Use the OnClick event handler to write code that responds to the click event. Because the buttons on the navigator already have default actions that occur when they are clicked, it isn’t necessary to write an OnClick event handler.

The OnClick event occurs when

The user clicks one the buttons on the navigator with the mouse

The user presses Spacebar while the navigator has focus.

The BtnClick method is called.

The Button parameter indicates which button was clicked.

Note:	The OnClick event occurs after the default action for the clicked button.


TDBNavigator methods

TDBNavigator	Alphabetically

In TDBNavigator

BtnClick

Create

Destroy

SetBounds

Derived from TCustomPanel

GetControlsAlignment

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBNavigator methods

TDBNavigator	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

BtnClick

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TDBNavigator.BtnClick

TDBNavigator	See also	Example

Simulates a button click on the database navigator, invoking the action of the button.

procedure BtnClick(Index: TNavigateBtn);

Description

Use BtnClick when you want the application, not the user, to control the database navigator. Call BtnClick, specifying a TNavigateBtn type as the value of the Index parameter, to invoke the command associated with the selected button.

Note:	Calling BtnClick triggers the navigator’s OnClick event after the default action of the button.


TDBNavigator.Create

TDBNavigator	See also

Creates an instance of TDBNavigator.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TDBNavigator at runtime. For TDBNavigator objects placed on a form at design time, the constructor is called automatically.

Pass a single Component as a parameter to provide the TDBNavigator object with an Owner that is responsible for freeing it.

After calling the inherited creator, Create creates the helper objects used by TDBNavigator to manage the buttons and the link to the dataset, and initializes some properties to affect the appearance of the navigator.


TDBNavigator.Destroy

TDBNavigator	See also

Destroys an instance of TDBNavigator.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the TDBNavigator reference is not nil and only then calls destroy.

Destroy frees the helper objects that were instantiated in the Create method before calling the inherited destructor.


TDBNavigator.SetBounds

TDBNavigator	See also

Sets the database navigator's boundary properties all at once.

procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer);

Description

Call SetBounds when to set more than one of the navigator’s boundary properties at a time. The Left, Top, Width, and Height properties are set to the values passed in the ALeft, ATop, AWidth, and AHeight parameters, respectively. SetBounds arranges the buttons on the navigator to fit within the boundaries.

Although you can always set the individual boundaries, using SetBounds makes several changes at once without rearranging the buttons for each change.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomPanel


 TDBRadioGroup

Hierarchy	Properties	Methods	Events	See also

TDBRadioGroup represents a group of radio buttons connected to a database.

Unit

dbctrls

Description

Use TDBRadioGroup to group a set of data-aware radio buttons. Radio buttons that are contained directly in the same control component are said to be “grouped”; when a radio button is checked, all other radio buttons in its group become unchecked. Database radio groups provide an easy way to ensure that the user enters one (or at most one) of the options presented for a field. They are also useful for displaying data from fields that have only a few possible values.

To add radio buttons to a TDBRadioGroup, edit the Items property in the Object Inspector. Each string in Items makes a radio button appear in the group box with the string as its caption.

When the user selects a radio button, the “value” of the selected button becomes the contents of the linked field for the current record in the dataset. Specify values for the buttons by editing the Values property in the Object Inspector; the first string in Values corresponds to the first string in Items, and so forth. If no Values strings are set, each button’s caption serves as its value.


TDBRadioGroup properties

TDBRadioGroup	Alphabetically	Legend

In TDBRadioGroup

DataField

DataSource

Field

Items

ReadOnly

Value

Values

Derived from TCustomRadioGroup

Columns

ItemIndex

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

Caption

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDBRadioGroup properties

TDBRadioGroup	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Columns

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Field

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

ItemIndex

Items

Left

LRDockWidth

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ReadOnly

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

Value

Values

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TDBRadioGroup.DataField

TDBRadioGroup	See also

Specifies the field from which the radio group displays data.

property DataField: String;

Description

Use DataField to specify the name of the database field that the radio group will represent.

DBRadioGroup1.DataField := 'PaymentMethod';


TDBRadioGroup.DataSource

TDBRadioGroup	See also

Determines where the database radio group obtains the data to display.

property DataSource: TDataSource;

Description

DataSource holds a TDataSource object that points to a dataset component, such as a table. The dataset component should be linked to the database you want to access.

DBRadioGroup1.DataSource := DataSource1;


TDBRadioGroup.Field

TDBRadioGroup	See also

Identifies the TField component that the radio group is linked to.

property Field: TField;

Description

Field holds the TField object that the linked dataset component creates to access the database.

DBRadioGroup1.Field.AsString := 'Yes';


TDBRadioGroup.Items

TDBRadioGroup	See also	Example

Lists the radio buttons in the radio group.

property Items: TStrings;

Description

Items holds a TStrings object that lists the captions of the radio buttons in the group. (To add or remove radio buttons, edit the Items list from the Object Inspector. These captions become the “values” of the radio buttons, unless you override them in the Values property; when a button is selected, its value becomes the content of the linked field for the current record in the database.


TDBRadioGroup.ReadOnly

TDBRadioGroup	See also

Determines whether the user can select a different radio button in the group, and hence modify the data in the field.

property ReadOnly: Boolean;

Description

If ReadOnly is True, the radio group displays data from the current record, but cannot be used to change the contents of the field. The default is False.


TDBRadioGroup.Value
TDBRadioGroup.

TDBRadioGroup

Holds the content of the linked field for the current record in the database.

property Value: String;

Description

Value holds the content of the linked field for the current record. If the user selects a different radio button, the Value property changes.


TDBRadioGroup.Values

TDBRadioGroup	See also 	Example

Determines the values of the radio buttons.

property Values: TStrings;

Description

When the user selects a radio button, the “value” of that button is written to the linked field in the database. By default, the value of a button is simply the caption that appears next to it on the screen, as determined by the Items property.

In some cases, you may want the values of the radio buttons to differ from their captions. For example, if you use radio buttons to represent a database field whose content can be “Y” or “N”, you may want the buttons’ captions to be “Yes” and “No”. In this case, you would enter “Yes” and “No” in the Items list, and enter “Y” and “N” in the Values list.

You can edit the Values list in the Object Inspector, just as you would the Items list. To keep the buttons’ captions as their values, leave the Values property empty.


TDBRadioGroup events

TDBRadioGroup	Alphabetically	Legend

In TDBRadioGroup

OnChange

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnClick

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnStartDock

OnStartDrag


TDBRadioGroup events

TDBRadioGroup	By object	Legend

OnChange

OnClick

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnStartDock

OnStartDrag


TDBRadioGroup.OnChange

TDBRadioGroup

Occurs when the user changes the data in the linked field.

property OnChange: TNotifyEvent

Description

The OnChange event occurs when a change is made to the contents of the database field accessed by the radio group. Use an OnChange event handler to implement any special processing that should be executed when the radio group is updated.


TDBRadioGroup methods

TDBRadioGroup	Alphabetically	Legend

In TDBRadioGroup

CanModify

Create

Destroy

ExecuteAction

UpdateAction

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

HasParent

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBRadioGroup methods

TDBRadioGroup	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

CanModify

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TDBRadioGroup.CanModify

TDBRadioGroup	See also

Determines whether the user can select a different radio button in the group.

function CanModify: Boolean; override;

Description

CanModify returns True if the radio group is linked to an editable data source and ReadOnly is set to False.


TDBRadioGroup.Create

TDBRadioGroup	See also

Creates and initializes a TDBRadioGroup instance.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TDBRadioGroup object at runtime. For radio groups placed on forms at design time, Create is called automatically.

Pass a single Component as a parameter to provide the TDBRadioGroup object with an Owner that is responsible for freeing it.

Create calls the inherited constructor method, then initializes internal objects and variables used to control data access.


TDBRadioGroup.Destroy

TDBRadioGroup	See also

Destroys the TDBRadioGroup instance and the radio buttons it contains.

destructor Destroy; override;

Description

Destroy frees internally created objects that control data access, then calls the inherited destructor method.


TDBRadioGroup.ExecuteAction

TDBRadioGroup	See also

Invokes an action with the TDBRadioGroup as its target.

function ExecuteAction(Action: TBasicAction): Boolean; override;

Description

ExecuteAction is called automatically when the user invokes an action with the TDBRadioGroup as a target. The Action parameter specifies the action that was invoked. ExecuteAction returns True if the action was successfully dispatched, and False if the TDBRadioGroup could not handle the action.


TDBRadioGroup.UpdateAction

TDBRadioGroup	See also

Updates an action to reflect the current state of the TDBRadioGroup.

function UpdateAction(Action: TBasicAction): Boolean; override;

Description

UpdateAction is called automatically when the application is idle to give the TDBRadioGroup an opportunity to update associated actions. This allows actions to be grayed, checked, or to otherwise reflect the status of the TDBRadioGroup they target.

The Action parameter specifies the action component that should be updated. UpdateAction returns True if the action component now reflects the state of the component, and False if it did not know how to update the action.


TDBRadioGroup.UseRightToLeftAlignment

TDBRadioGroup	See also

Specifies whether the control’s alignment is in a right-to-left mode.

function UseRightToLeftAlignment: Boolean;

Description

Call UseRightToLeftAlignment to determine whether the TDBRadioGroup’s alignment is in a right-to-left mode. This information can be used when painting the TDBRadioGroup data or when responding to mouse events.

UseRightToLeftAlignment returns True for middle east locales if the BiDiMode property is bdRightToLeft. Otherwise, it returns False.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGroupBox

TCustomRadioGroup


 TDBRichEdit

Hierarchy	Properties	Methods	Events	See also

TDBRichEdit represents a multiline edit control that can display and edit a rich text memo field in a dataset.

Unit

dbctrls

Description

Use a TDBRichEdit object to enable users to edit a database field in a rich text edit control. TDBRichEdit provides the properties and methods to enter and work with rich text. TDBRichEdit does not provide any user interface components to make these formatting options available to the user. Applications must implement the user interface components to surface the rich text capabilities of a TDBRichEdit object.

TDBRichEdit uses the Text property to represent the contents of the field.  Like other data-aware controls, TDBRichEdit controls automatically put the data source into edit mode when the value of the Text property is changed.  However, if only the formatting of the text is changed, but not the text itself, the application must explicitly put the data source into edit mode so that the changes will be saved. This should be implemented as part of the user interface for the rich text capabilities.

If the database field does not include text formatting information, consider using a TDBMemo object or a TDBEdit object instead.

If the application doesn’t require the data-aware capabilities of TDBRichEdit, use a rich text edit control (TRichEdit) instead, to conserve system resources.


TDBRichEdit properties

TDBRichEdit	Alphabetically	Legend

In TDBRichEdit

AutoDisplay

DataField

DataSource

Field

ReadOnly

Derived from TCustomRichEdit

DefAttributes

DefaultConverter

HideScrollBars

HideSelection

PageRect

Paragraph

PlainText

SelAttributes

SelLength

SelStart

SelText

Derived from TCustomMemo

Alignment

CaretPos

Lines

ScrollBars

WantReturns

WantTabs

WordWrap

Derived from TCustomEdit

BorderStyle

CanUndo

MaxLength

Modified

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Text

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDBRichEdit properties

TDBRichEdit	By object	Legend

Action

Align

Alignment

Anchors

AutoDisplay

BiDiMode

BorderStyle

BoundsRect

Brush

CanUndo

CaretPos

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DefAttributes

DefaultConverter

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Field

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

HideScrollBars

HideSelection

Hint

HostDockSite

ImeMode

ImeName

Left

Lines

LRDockWidth

MaxLength

Modified

Name

Owner

PageRect

Paragraph

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PlainText

PopupMenu

ReadOnly

ScrollBars

SelAttributes

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

WantReturns

WantTabs

Width

WindowProc

WordWrap


TDBRichEdit.AutoDisplay

TDBRichEdit	See also

Determines whether to automatically display the contents of the memo field in the rich edit control.

property AutoDisplay: Boolean;

Description

If AutoDisplay is True, the rich edit control automatically displays new data when the underlying BLOB field changes (such as when moving to a new record).

If AutoDisplay is False, the control shows only the field name whenever the underlying BLOB field changes. To display the data, the user can double-click on the control or select it and press Enter.

The effect of AutoDisplay is not purely cosmetic. The data shown by the TDBRichEdit object is the value of the Text property. When AutoDisplay is False, if the data changes, the value of the Text property changes to the name of the field. Thus, if AutoDisplay is False, applications should be cautious about using the value of the Text property to ascertain the value of the underlying field.

Calling the LoadMemo method causes Text to update to the current value of the BLOB field. This change will also be reflected in the appearance of the control on screen.

Change the value of AutoDisplay to False if the automatic loading of BLOB fields seems to take too long.

Note:	AutoDisplay only applies to BLOB fields. If the control is bound to another type of text field, AutoDisplay has no effect.


TDBRichEdit.DataField

TDBRichEdit	See also

Specifies the field from which the rich edit control displays data.

property DataField: String;

Description

Use DataField to bind the rich edit control to a field in the dataset. To fully specify a database field, both the dataset and the field within that dataset must be defined. The DataSource property of the rich edit control specifies the dataset which contains the DataField.

DBRichEdit1.DataField := 'Document';


TDBRichEdit.DataSource

TDBRichEdit	See also

Links the rich edit control to the dataset that contains the field it represents.

property DataSource: TDataSource;

Description

Use DataSource to link the rich edit control to a dataset in which the data can be found. To fully specify a database field for the edit control, both the dataset and a field within that dataset must be defined. Use the DataField property to specify the particular field within the dataset.

DBRichEdit1.DataSource := DataSource1;


TDBRichEdit.Field

TDBRichEdit	See also

Indicates the TField object for the database field the rich edit control represents.

property Field: TField;

Description

Read Field to get direct access to the contents and properties of the database field without going through the edit window. Use Field to change the contents of the database field programmatically. Use the Text property instead if you want to change the contents of the edit window without immediately posting the changes to the dataset. Changing the Text property allows the user to cancel the changes.

(DBRichEdit1.Field as TMemoField).Assign(RichEdit1.Lines);


TDBRichEdit.ReadOnly

TDBRichEdit	See also

Determines whether the user can use the rich database edit control to change the value of the field in the current record.

property ReadOnly: Boolean;

Description

Set ReadOnly to True to prevent the user from changing the contents of the database field. When ReadOnly is True, the edit control is used only to display the contents of the field. If ReadOnly is False, the user can change the field's value as long as the dataset is in edit mode.


TDBRichEdit events

TDBRichEdit	Alphabetically	Legend

Derived from TCustomRichEdit

OnProtectChange

OnResizeRequest

OnSaveClipboard

OnSelectionChange

Derived from TCustomEdit

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TDBRichEdit events

TDBRichEdit	By object	Legend

OnChange

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnProtectChange

OnResizeRequest

OnStartDock

OnSaveClipboard

OnSelectionChange

OnStartDrag


TDBRichEdit methods

TDBRichEdit	Alphabetically	Legend

In TDBRichEdit

Change

Create

Destroy

ExecuteAction

KeyDown

KeyPress

LoadMemo

Notification

UpdateAction

Derived from TCustomRichEdit

Clear

FindText

GetSelTextBuf

Print

RegisterConversionFormat

Derived from TCustomMemo

GetControlsAlignment

Derived from TCustomEdit

ClearSelection

ClearUndo

CopyToClipboard

CutToClipboard

PasteFromClipboard

SelectAll

SetSelTextBuf

Undo

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetParentComponent

GetTextBuf

HasParent

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBRichEdit methods

TDBRichEdit	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

Change

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClearSelection

ClearUndo

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

Create

CreateParented

CreateParentedControl

CutToClipboard

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FindText

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

KeyDown

KeyPress

LoadMemo

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

Notification

PaintTo

PasteFromClipboard

Perform

Print

Realign

Refresh

RegisterConversionFormat

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

Undo

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TDBRichEdit.Change

TDBRichEdit	See also

Keeps track of the fact that the text has been modified, before letting the inherited method call the OnChange event handler if it is assigned.

procedure Change; override;

Description

Applications cannot call this protected method directly. It is triggered automatically by Windows’ events. Change responds to these events by internally keeping track of the fact that the text has been modified. This information can then be used to know whether there are any changes to post to the dataset or to remove if the user requests a reset.

Change also calls the inherited method, which calls the OnChange event handler if it is assigned.


TDBRichEdit.Create

TDBRichEdit	See also

Creates an instance of TDBRichEdit.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TDBRichEdit object at runtime. For TDBRichEdit objects placed on forms at design-time, the constructor is called automatically.

Pass a single Component as a parameter to provide the TDBRichEdit object with an Owner that is responsible for freeing it.

After calling the inherited constructor to allocate and initialize a generic rich edit object, Create

Sets ReadOnly to True.

Sets AutoDisplay to True.

Creates and initializes the helper objects needed to link to a dataset.


TDBRichEdit.Destroy

TDBRichEdit	See also

Destroys an instance of TDBRichEdit.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TDBRichEdit reference is not nil and only then calls Destroy.

Destroy frees the helper objects of the TDBRichEdit before calling the inherited destructor.


TDBRichEdit.ExecuteAction

TDBRichEdit	See also

Invokes an action with the TDBRichEdit as its target.

function ExecuteAction(Action: TBasicAction): Boolean; override;

Description

ExecuteAction is called automatically when the user invokes an action with the TDBRichEdit as a target. The Action parameter specifies the action that was invoked. ExecuteAction returns True if the action was successfully dispatched, and False if the TDBRichEdit could not handle the action.


TDBRichEdit.KeyDown

TDBRichEdit	See also

Supplements the inherited method to drive the dataset into edit mode when the user presses Del or Shift+Insert.

procedure KeyDown(var Key: Word; Shift: TShiftState); override;

Description

KeyDown first calls the inherited method, which calls the OnKeyDown event handler. KeyDown next attempts to put the dataset into an editing state when the user types Del or Shift+Insert. Derived classes can override KeyDown to handle additional key combinations, but the inherited method should always be called.

Note:	Applications cannot call this protected method directly. It is called automatically in response to Windows events.


TDBRichEdit.KeyPress

TDBRichEdit	See also

Supplements the inherited method to handle any keystrokes that alter the state of the edit control.

procedure KeyPress(var Key: Char); override;

Description

KeyPress first calls the inherited method, which calls the OnKeyPress event handler. Next, KeyPress checks the value of the key, and throws it away if it is not a valid character for the field type, or if there is no link to a database field. Valid characters cause KeyPress to attempt to put the dataset into edit mode.

Pressing the Escape key causes KeyPress to throw away all unposted edits. Pressing the Pause key causes KeyPress to call LoadMemo to load the value of the memo field associated with the rich edit control.

Note:	Applications cannot call this protected method directly. It is called automatically in response to Windows events.


TDBRichEdit.LoadMemo

TDBRichEdit	See also

LoadMemo loads the memo BLOB from the field in the database into the rich edit control.

procedure LoadMemo; virtual;

Description

LoadMemo allows an application to control when the rich edit control displays the contents of the memo field. Use LoadMemo to update the text in the rich edit control to the value of the field in the current record. LoadMemo only works with BLOB fields when the AutoDisplay property is False, so that the value of the field is not loaded automatically.


TDBRichEdit.Notification

TDBRichEdit	See also

Overrides the inherited method to respond to opRemove notifications on the DataSource.

procedure Notification(AComponent: TComponent; Operation: TOperation); override;

Description

After calling the inherited method, Notification checks whether the notification indicates the removal of the DataSource. If so, Notification sets the DataSource property to nil.

Derived classes can override Notification method to handle additional notifications, but the inherited method should be always be called.

Note:	Notification is a protected method. Applications cannot call it directly.


TDBRichEdit.UpdateAction

TDBRichEdit	See also

Updates an action to reflect the current state of the TDBRichEdit.

function UpdateAction(Action: TBasicAction): Boolean; override;

Description

UpdateAction is called automatically when the application is idle to give the TDBRichEdit an opportunity to update associated actions. This allows actions to be grayed, checked, or to otherwise reflect the status of the TDBRichEdit they target.

The Action parameter specifies the action component that should be updated. UpdateAction returns True if the action component now reflects the state of the component, and False if it did not know how to update the action.


TDBRichEdit.UseRightToLeftAlignment

TDBRichEdit	See also

Specifies whether the control’s alignment is in a right-to-left mode.

function UseRightToLeftAlignment: Boolean;

Description

Call UseRightToLeftAlignment to determine whether the TDBRichEdit’s alignment is in a right-to-left mode. This information can be used when painting the TDBRichEdit data or when responding to mouse events.

UseRightToLeftAlignment returns True for middle east locales if the BiDiMode property is bdRightToLeft. Otherwise, it returns False.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMemo

TCustomRichEdit


 TDBText

Hierarchy	Properties	Methods	Events	See also

TDBText represents a data-aware control that displays the value of a field on a form.

Unit

dbctrls

Description

Use TDBText to display the contents of a field in the current record of a dataset on a form. Field values displayed by database text controls cannot be modified by the user using the text control. To allow the user to edit the field value, use TDBEdit or TDBMemo instead.

If the application does not require the data-aware capabilities of TDBText, use the label component (TLabel) or the static text component (TStaticText) instead to conserve system resources.


TDBText properties

TDBText	Alphabetically	Legend

In TDBText

AutoSize

DataField

DataSource

Field

Derived from TCustomLabel

Alignment

Transparent

WordWrap

Derived from TGraphicControl

Canvas

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDBText properties

TDBText	By object	Legend

Action

Align

Alignment

Anchors

AutoSize

BiDiMode

BoundsRect

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlState

ControlStyle

Cursor

DataField

DataSource

DesignInfo

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Field

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Tag

TBDockHeight

Top

Transparent

UndockHeight

UndockWidth

VCLComObject

Visible

Width

WindowProc

WordWrap


TDBText.AutoSize

TDBText	See also

Determines whether the database text control automatically resizes to the width and length of the current string.

property AutoSize: Boolean;

Description

Use AutoSize to make the database text control adjust its size automatically so the client area accommodates the height and width of the field value. When AutoSize is False (the default), the control is fixed in size. When AutoSize is True, the size of the control is readjusted whenever its caption changes. The size of the control is also readjusted when the Font property changes.

When WordWrap is True, the width of the database text control is fixed. If AutoSize is also True, changes to the field value cause the control to change in height. When AutoSize is True and WordWrap is False, the height of the control is determined by the font, and changes to the field value cause the control to change in width.


TDBText.DataField

TDBText	See also

Specifies the field whose value is displayed by the database text control.

property DataField: String;

Description

Use DataField to bind the database text control to a field in the dataset. To fully specify a database field, both the dataset and the field within that dataset must be defined. The DataSource property of the control specifies the dataset which contains the DataField.

DBText1.DataField := 'Company';


TDBText.DataSource

TDBText	See also

Links the text control to the dataset that contains the field it represents.

property DataSource: TDataSource;

Description

Use DataSource to link the database text control to a dataset in which the data can be found. To fully specify a database field for the control, both the dataset and a field within that dataset must be defined. Use the DataField property to specify the particular field within the dataset.

DBText1.DataSource := DataSource1;


TDBText.Field

TDBText	See also

Indicates the TField object for the database field the database text control represents.

property Field: TField;

Description

Use the Field object to change the value of the data in the field programmatically.

DBText1.Field.AsString := 'Santa Cruz Wharf';


TDBText events

TDBText	Alphabetically	Legend

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TDBText events

TDBText	By object	Legend

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TDBText methods

TDBText	Alphabetically

In TDBText

Create

Destroy

ExecuteAction

UpdateAction

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DefaultHandler

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

Invalidate

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Update

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBText methods

TDBText	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

NewInstance

Perform

Refresh

RemoveComponent

Repaint

ReplaceDockedControl

SafeCallException

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

UpdateAction

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TDBText.Create

TDBText	See also

Creates an instance of TDBText.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TDBText object at runtime. For TDBText objects placed on forms or data modules at design time, Create is called automatically.

After calling the inherited constructor to allocate and initialize a generic label object, Create

Adds csReplicatable to ControlStyle.

Sets AutoSize to False.

Creates and initializes the helper objects needed to link to a dataset.


TDBText.Destroy

TDBText	See also

Destroys an instance of TDBText.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the TDBText reference is not nil and only then calls Destroy.

Destroy frees the helper objects of the TDBText before calling the inherited destructor.


TDBText.ExecuteAction

TDBText	See also

Invokes an action with the TDBText as its target.

function ExecuteAction(Action: TBasicAction): Boolean; override;

Description

ExecuteAction is called automatically when the user invokes an action with the TDBText as a target. The Action parameter specifies the action that was invoked. ExecuteAction returns True if the action was successfully dispatched, and False if the TDBText could not handle the action.


TDBText.UpdateAction

TDBText	See also

Updates an action to reflect the current state of the TDBText.

function UpdateAction(Action: TBasicAction): Boolean; override;

Description

UpdateAction is called automatically when the application is idle to give the TDBText an opportunity to update associated actions. This allows actions to be grayed, checked, or to otherwise reflect the status of the TDBText they target.

The Action parameter specifies the action component that should be updated. UpdateAction returns True if the action component now reflects the state of the component, and False if it did not know how to update the action.


TDBText.UseRightToLeftAlignment

TDBText	See also

Specifies whether the control’s alignment is in a right-to-left mode.

function UseRightToLeftAlignment: Boolean;

Description

Call UseRightToLeftAlignment to determine whether the TDBText’s alignment is in a right-to-left mode. This information can be used when painting the TDBText.

UseRightToLeftAlignment returns True for middle east locales if the BiDiMode property is bdRightToLeft. Otherwise, it returns False.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl

TCustomLabel


 TDdeClientConv

Hierarchy	Properties	Methods	Events	See also

TDdeClientConv represents a DDE conversation with a DDE server application.

Unit

ddeman

Description

Use TDdeClientConv with a TDdeClientItem object to enable an application to act as a DDE client. TDdeClientConv provides many properties, events, and methods that provide services to

Link to a specified DDE server with a specified DDE topic.

Send data or macro commands to the DDE server after a link has been established.

Specify a format for the data that is sent to the DDE server.

Allow event handlers to respond when the DDE link is opened or closed.

TDdeClientItem objects are associated with a TDdeClientConv by setting their DdeConv property.


TDdeClientConv properties

TDdeClientConv	Alphabetically	Legend

In TDdeClientConv

ConnectMode

Conv

DataMode

DdeFmt

DdeService

DdeTopic

FormatChars

ServiceApplication

WaitStat

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDdeClientConv properties

TDdeClientConv	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConnectMode

Conv

DataMode

DdeFmt

DdeService

DdeTopic

DesignInfo

FormatChars

Name

Owner

ServiceApplication

Tag

VCLComObject

WaitStat


TDdeClientConv.ConnectMode

TDdeClientConv	See also

Determines whether the link to the DDE server is established automatically when the form is opened.

type TDataMode = (ddeAutomatic, ddeManual);

property ConnectMode: TDataMode;

Description

Use ConnectMode to change the way a DDE conversation is established. If ConnectMode is ddeAutomatic, the link is established when it is defined by SetLink. If ConnectMode is ddeManual, the application must call the OpenLink method or the PasteLink method to establish the DDE conversation.


TDdeClientConv.Conv

TDdeClientConv	See also

Indicates the handle for the current DDE conversation.

property Conv: HConv;

Description

Read Conv to get a handle to the DDE conversation when it is required for a Windows API function call. Conv is available once a DDE conversation has been established by OpenLink or PasteLink.


TDdeClientConv.DataMode

TDdeClientConv	See also

Governs whether portions of the DDE conversation execute automatically.

type TDataMode = (ddeAutomatic, ddeManual);

property DataMode: TDataMode;

Description

DataMode is not implemented for TDdeClientConv. Derived objects can use this property to automatically execute portions of a DDE conversation, such as a RequestData or PokeData call.

Note:	To determine the way the DDE conversation is established, use ConnectMode instead.


TDdeClientConv.DdeFmt

TDdeClientConv	See also

Represents the clipboard format used for submitting or requesting a data item.

property DdeFmt: Integer;

Description

Use DdeFmt to specify the format of DDE data items when it has not been specified by the server.


TDdeClientConv.DdeService

TDdeClientConv	See also 	Example

Specifies the DDE server application to be linked to a DDE client.

property DDEService: string;

Description

Use DdeService to specify the server application to link to. Typically, DdeService is the file name (with path, if necessary) of the DDE server application's main executable file without the .EXE extension. If the DDE server is a Delphi application, DdeService is the project name without the .DPR or .EXE extension. For example, to link to a TDdeServerConv component in PROJ1.DPR, set DdeService to PROJ1.

At design time, specify DdeService by typing the DDE server application name in the object inspector or by choosing Paste Link in the DDE Info dialog box. To establish a link at runtime, specify the service and topic with the SetLink method.

Note:	The necessary value for DdeService depends on the individual server application. See the documentation of the DDE server application for specific information about how to specify the server application.


TDdeClientConv.DdeTopic

TDdeClientConv	See also 	Example

Specifies the topic of a DDE conversation

property DDETopic: string;

Description

Use DdeTopic to indicate the server-defined topic name of the DDE conversation. Typically, DdeTopic is a file name (with path, if necessary) used by the server application. If the DDE server is a Delphi application, by default DdeTopic is the caption of the form containing the linked component. If the DDE client is linked to a TDdeServerConv component, DdeTopic is the name of the server conversation component rather than the form caption.

At design time, specify DdeTopic either by typing the DdeTopic name in the object inspector or by choosing Paste Link in the DDE Info dialog box. To establish a link at runtime, specify the service and topic with the SetLink method.

Note:	The server application defines the topic names available for a DDE conversation. See the documentation for the DDE server application for specific information about the names of available topics.


TDdeClientConv.FormatChars

TDdeClientConv	See also

Determines if certain characters are filtered out of text data transferred from a DDE server application.

property FormatChars: Boolean;

Description

Use FormatChars with DDE server applications that transfer backspaces, linefeeds, carriage returns, and tabs with the text data. These formatting characters can cause incorrect spacing, line breaks, or characters in the DDE client data. To prevent the formatting characters from interfering with the formatting of the client data, set FormatChars to False. To include the formatting characters sent by the DDE server, set FormatChars to True.


TDdeClientConv.ServiceApplication

TDdeClientConv	See also

Specifies the main executable file name (with path, if necessary) of a DDE server application, without the .EXE extension.

property ServiceApplication: string;

Description

Set ServiceApplication to the name of the server application. Typically, this is the same value as the DdeService property. Sometimes, however, DdeService is a value other than the DDE server application's executable file name.

If the server application is not running when the TDdeClientConv tries to establish a DDE conversation, OpenLink uses the ServiceApplication property to launch the server.


TDdeClientConv.WaitStat

TDdeClientConv	See also

Indicates whether the server is in the process of servicing a DDE macro that prohibits asynchronous DDE transactions.

property WaitStat: Boolean;

Description

Read WaitStat to learn whether a DDE transaction can be started. When WaitStat is True, the server is processing the last macro, and attempts to execute a macro, request data, or poke data will fail. When WaitStat is False, the server is free to execute the next transaction in the DDE conversation.


TDdeClientConv events

TDdeClientConv	Alphabetically	Legend

In TDdeClientConv

OnClose

OnOpen


TDdeClientConv events

TDdeClientConv	By object	Legend

OnClose

OnOpen


TDdeClientConv.OnClose

TDdeClientConv	See also 	Example

Occurs when the DDE conversation terminates.

property OnClose: TNotifyEvent;

Description

Write an OnClose event handler to take specific action when the DDE conversation ends. The DDE conversation will end if the server terminates the conversation, if the link is closed or changed, or if the TDdeClientConv object is destroyed.


TDdeClientConv.OnOpen

TDdeClientConv	See also 	Example

Occurs immediately after the DDE link to the server has been established.

property OnOpen: TNotifyEvent;

Description

Write an OnOpen event handler to take specific action whenever a link is established to the DDE server. The DDE link is established by the OnOpen method or the PasteLink method. SetLink will also establish a DDE link if the ConnectMode is ddeAutomatic. OnOpen will not be called if the link fails, such as when the server application can’t be launched.


TDdeClientConv methods

TDdeClientConv	Alphabetically

In TDdeClientConv

CloseLink

Create

Destroy

ExecuteMacro

ExecuteMacroLines

OpenLink

PasteLink

PokeData

PokeDataLines

RequestData

SetLink

StartAdvise

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDdeClientConv methods

TDdeClientConv	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

CloseLink

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteMacro

ExecuteMacroLines

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

OpenLink

PasteLink

PokeData

PokeDataLines

RemoveComponent

RequestData

SafeCallException

SetLink

StartAdvise

UpdateAction


TDdeClientConv.CloseLink

TDdeClientConv	See also

Terminates an ongoing DDE conversation.

procedure CloseLink;

Description

Use CloseLink when all communication with the DDE server is finished. After a link is closed, no DDE communication can take place between the DDE client and server until another link is opened.


TDdeClientConv.Create

TDdeClientConv	See also

Creates an instance of TDdeClientConv.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create an instance of TDdeClientConv. After calling the inherited constructor, Create creates the helper objects used to manage individual DDE client items.


TDdeClientConv.Destroy

TDdeClientConv	See also

Destroys an instance of TDdeClientConv.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TDdeClientConv reference is not nil, and only then calls Destroy.

Destroy closes the link to the server and frees up all helper objects before calling the inherited destructor.


TDdeClientConv.ExecuteMacro

TDdeClientConv	See also 	Example

Sends a macro command string to the DDE server application.

function ExecuteMacro(Cmd: PChar; WaitFlg: Boolean): Boolean;

Description

Call ExecuteMacro to send a single macro command to the server application. To send multiple macro commands, use ExecuteMacroLines instead. ExecuteMacro returns True if the macro was successfully passed to the DDE server application. If ExecuteMacro was unable to send a command string, ExecuteMacro returns False.

Cmd is a null-terminated string that contains the macro to be executed by the DDE server application. The actual value of Cmd depends on the DDE server application. See the documentation of the DDE server application for the command strings it will accept.

WaitFlg determines if this DDE client should wait until the DDE server application finishes executing the macro before allowing another DDE transaction to succeed. If WaitFlg is set to True, subsequent calls to ExecuteMacro, ExecuteMacroLines, PokeData, PokeDataLines, and RequestData will fail until the DDE server application completes the macro.

Attempting to execute a macro or poke data before a DDE server application completes a currently executing macro may cause the executing macro to fail or to produce unpredictable results. See the documentation of the DDE server application for the results of sending command strings or poking data before macro execution has completed.

Note:	ExecuteMacro returns True if the macro command was successfully passed to the DDE server. A True value does not ensure that the macro command will execute successfully once it has been accepted by the server.


TDdeClientConv.ExecuteMacroLines

TDdeClientConv	See also

Sends a list of several macro commands to a DDE server application.

function ExecuteMacroLines(Cmd: TStrings; WaitFlg: Boolean): Boolean;

Description

Call ExecuteMacroLines to send several macro commands to the server application. To send a single macro command, use ExecuteMacro instead. ExecuteMacroLines returns True if the macro list was successfully passed to the DDE server application. If ExecuteMacroLines is unable to send a list of command strings, it returns False.

Cmd contains the list of macros to be executed by the DDE server application. WaitFlg determines if this DDE client should wait until the DDE server application finishes executing all the macros before allowing another DDE transaction to be sent. If WaitFlg is set to True, subsequent calls to ExecuteMacro, ExecuteMacroLines, PokeData, PokeDataLines, and RequestData will fail until the DDE server application completes all of the macros.


TDdeClientConv.OpenLink

TDdeClientConv	See also 	Example

Initiates a new DDE conversation.

function OpenLink: Boolean;

Description

Call OpenLink to establish a new DDE conversation with the DdeService. If the server application is not running, OpenLink will launch the ServiceApplication. If the conversation is successfully opened, an OnOpen event occurs and OpenLink returns True. If the conversation isn't successfully opened, OpenLink returns False.

Note:	If ConnectMode is ddeAutomatic, OpenLink is called automatically when the DdeTopic and DdeService are specified by SetLink.


TDdeClientConv.PasteLink

TDdeClientConv	See also

Opens a DDE conversation with the current Clipboard object.

function PasteLink: Boolean;

Description

Call PasteLink to establish a DDE link to an object on the Clipboard. PasteLink sets the DdeTopic or DdeService properties from the Clipboard. PasteLink returns True if the link is successfully established.


TDdeClientConv.PokeData

TDdeClientConv	See also 	Example

Sends data to a DDE server application.

function PokeData(Item: string; Data: PChar): Boolean;

Description

Use PokeData to transfer text data to a DDE server that supports poked data. Item specifies the linked item in the DDE server. Data is a null-terminated string that specifies the text data to transfer.

The value of the DDE item depends on the linked DDE server application. Item is typically a selectable portion of text, such as a spreadsheet cell or a database field in an edit box. If the DDE server is a Delphi application, Item is the name of the linked DDE server component.

The usual direction of data flow is from the DDE server to the DDE client application. Some DDE server applications won't accept poked data. PokeData returns True if the data was successfully transferred, False if the data was not successfully transferred.

To poke a string list rather than a single string, use the PokeDataLines method.

Note:	If either the ExecuteMacro or ExecuteMacroLines method was called with its WaitFlg parameter set to True, PokeData will automatically fail until the server application has completed executing the macro. The WaitStat property indicates when PokeData will attempt to poke data to the server.


TDdeClientConv.PokeDataLines

TDdeClientConv	See also 	Example

Sends multiple lines of data to a DDE server application.

function PokeDataLines(Item: string; Data: TStrings): Boolean;

Description

Use PokeDataLines to transfer multiple lines of text data to a DDE server that supports poked data. Item specifies the linked item in the DDE server. Data is a set of strings that specifies the text data to transfer.

The value of the DDE item depends on the linked DDE server application. Item is typically a selectable portion of text, such as a spreadsheet cell or a database field in an edit box. If the DDE server is a Delphi application, Item is the name of the linked DDE server component.

The usual direction of data flow is from the DDE server to the DDE client application. Some DDE server applications won't accept poked data. PokeData returns True if the data was successfully transferred, False if the data was not successfully transferred.

To poke a single string rather than a string list, use the PokeData method.

Note:	If either the ExecuteMacro or ExecuteMacroLines method was called with its WaitFlg parameter set to True, PokeData will automatically fail until the server application has completed executing the macro. The WaitStat property indicates when PokeData will attempt to poke data to the server.


TDdeClientConv.RequestData

TDdeClientConv	See also 	Example

Requests data from a DDE server.

function RequestData(const Item: string): PChar;

Description

Call RequestData to send a request to the DDE server for the data named by Item. RequestData returns the value of the named DDE server item.

Note:	RequestData automatically allocates memory to store the returned data, but applications must dispose of this string after processing it. This is done with the StrDispose procedure.

If the DDE server contains DDE items that can be continually updated, data can be received and updated automatically by creating TDdeClientItem objects for those items.

The value of the DDE item depends on the linked DDE server application. Item is typically a selectable portion of text, such as a spreadsheet cell or a database field in an edit box. If the DDE server is a Delphi application, Item is the name of the linked DDE server component.

Note:	See the documentation for the DDE server application for specific information about specifying a DDE item.


TDdeClientConv.SetLink

TDdeClientConv	See also 	Example

Specifies the service and topic of a DDE conversation and attempts to open the link if ConnectMode is ddeAutomatic.

function SetLink(Service: string; Topic: string): Boolean;

Description

Call SetLink to fully specify a DDE conversation. If ConnectMode is ddeManual, calling SetLink is equivalent to setting the DdeTopic and DdeService properties, and clearing all data from any associated TDdeClientItem objects. If ConnectMode is ddeAutomatic, SetLink opens the link to the DDE server as well.

The Service and Topic parameters specify the values for the DdeTopic and DdeService properties, respectively.


TDdeClientConv.StartAdvise

TDdeClientConv	See also

Starts an advise loop for all of the TDdeClientItems associated with the current DDE conversation.

function StartAdvise: Boolean;

Description

Call StartAdvise to start an advise loop for all of the TDdeClientItems associated with the current DDE conversation. StartAdvise returns True if loop startup is successful.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


 TDdeClientItem

Hierarchy	Properties	Methods	Events	See also

TDdeClientItem defines an item in a DDE conversation.

Unit

ddeman

Description

Use TDdeClientItem with TDdeClientConv to enable an application to act as a DDE client. A DDE client item specifies a single item supported by a DDE server. A single TDdeClientConv object may be associated with multiple client items. If the DDE client conversation has established a link with a DDE server, the server will automatically and continually update all client items until the conversation is terminated.


TDdeClientItem properties

TDdeClientItem	Alphabetically	Legend

In TDdeClientItem

DdeConv

DdeItem

Lines

Text

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDdeClientItem properties

TDdeClientItem	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DdeConv

DdeItem

DesignInfo

Lines

Name

Owner

Tag

Text

VCLComObject


TDdeClientItem.DdeConv

TDdeClientItem	See also

Specifies the DDE client conversation to associate with the DDE client item.

property DdeConv: TDDEClientConv;

Description

Set DdeConv to associate the DDE client item with a DDE client conversation. The value of DdeConv is the DDE client conversation object that defines the DDE conversation. The DdeConv establishes the link to the server that provides the Text for the DDE client item.


TDdeClientItem.DdeItem

TDdeClientItem	See also 	Example

Specifies the item of a DDE conversation.

property DdeItem: string;

Description

Set the DdeItem property to the name of a DDE item supported by the DDE server. The value of DdeItem depends on the linked DDE server application. DdeItem is typically a selectable portion of text, such as a spreadsheet cell or a database field in an edit box. If the DDE server is a Delphi application, DdeItem is the name of the linked DDE server item.

At design time, specify DdeItem by typing the item string in the object inspector. Alternately, DdeItem can be specified from the DDE conversation by pasting a link using the DDE Info dialog box, which is called by clicking the ellipsis (...) button for DdeService or DdeTopic in the object inspector. After choosing Paste Link in the DDE Info dialog box, choose the item from a list of possible items for DdeItem in the object inspector when link information is on the Clipboard.

Note:	See the documentation for the DDE server application for the specific information about specifying DDE items.


TDdeClientItem.Lines

TDdeClientItem	See also 	Example

Contains the text data to exchange in a DDE conversation.

property Lines: TStrings;

Description

Read Lines to get the text that is updated by the DDE server application. Lines is updated automatically by the DDE server. When Lines is changed by the server, an OnChange event occurs.

Set the Lines property to poke data to the DDE server.

Lines corresponds to the Text property. Whenever the value of Lines or Text is updated, the other is also changed so that the first line of Lines is always equal to Text.

Note:	Lines of data can also be sent to the DDE server by calling the PokeDataLines method of the DDE client conversation.


TDdeClientItem.Text

TDdeClientItem	See also

Contains the text data to exchange in a DDE conversation.

property Text: string;

Description

Read Text to get the text that is updated by the DDE server application. Text is updated automatically by the DDE server. When Text is changed by the server, an OnChange event occurs.

Set the Text property to poke data to the DDE server.

Text corresponds to the Lines property. Whenever the value of Lines or Text is updated, the other is also changed so that the first line of Lines is always equal to Text.

For text data longer than the 255 character limit of Text, use the Lines property.

Note:	Data can also be sent to the DDE server by calling the PokeData method of the DDE client conversation.


TDdeClientItem events

TDdeClientItem	Alphabetically	Legend

In TDdeClientItem

OnChange


TDdeClientItem events

TDdeClientItem	By object	Legend

OnChange


TDdeClientItem.OnChange

TDdeClientItem	See also 	Example

Occurs immediately after the DDE server updates the Lines property.

property OnChange: TNotifyEvent;

Description

Write an OnChange event handler to take specific action when the DDE server updates the text for this DDE client item. The new value for the DDE client item can be found by reading the Lines or Text property.


TDdeClientItem methods

TDdeClientItem	Alphabetically

In TDdeClientItem

Create

Destroy

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetParentComponent

GetNamePath

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

ExecuteAction

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDdeClientItem methods

TDdeClientItem	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Destroying

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TDdeClientItem.Create

TDdeClientItem	See also

Creates an instance of TDdeClientItem.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TDdeClientItem at runtime. After calling the inherited constructor, Create creates a helper object to manage the Lines property.


TDdeClientItem.Destroy

TDdeClientItem	See also

Destroys an instance of TDdeClientItem.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the TDdeClientItem is not nil, and only then calls Destroy.

Destroy frees the memory associated with the Lines property before calling the inherited destructor.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


 TDdeServerItem

Hierarchy	Properties	Methods	Events	See also

TDdeServerItem defines the item of a DDE conversation.

Unit

ddeman

Description

Use TDdeServerItem by itself, or, optionally, with a TDdeServerConv object to enable an application to function as a DDE server. DDE clients link to an individual DDE server item by referring to the Name property. Once a link to a DDE client is established, the DDE server item can update the client to changes in the item data, or receive data that the DDE client pokes to the item.


TDdeServerItem properties

TDdeServerItem	Alphabetically	Legend

In TDdeServerItem

Fmt

Lines

ServerConv

Text

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDdeServerItem properties

TDdeServerItem	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Fmt

Lines

Name

Owner

ServerConv

Tag

Text

VCLComObject


TDdeServerItem.Fmt

TDdeServerItem	See also

Indicates the clipboard format the DDE client item uses to pass data to the DDE client.

property Fmt: Integer;

Description

Set Fmt in an OnChange event handler to specify a clipboard format for the data that is passed to the DDE client if it is not text. The DDE data that is sent to the DDE client includes this format so that clients can correctly interpret the data. Read Fmt when the client pokes data to the DDE server item to determine the clipboard format the client used to format the data.


TDdeServerItem.Lines

TDdeServerItem	See also 	Example

Contains the data to exchange in a DDE conversation.

property Lines: TStrings;

Description

Set Lines to the data the DDE server item sends to the DDE client. Whenever the Lines property changes, an OnChange event occurs and then the new value is sent to the DDE client. If the DDE server item accepts poked data, Lines receives the data whenever the DDE client pokes data to this item. When Lines is changed by a DDE client poking data, an OnPokeData event occurs after the OnChange event.

Usually Lines contains text, and setting Lines sets the Fmt property to CF_TEXT. However, Delphi strings can contain non-text data. If Lines does not specify text data, Fmt must be changed to indicate the format of the data in an OnChange event handler.

Lines corresponds to the Text property. Whenever the value of Lines or Text is changed, the other is updated so that the first line of Lines is always equal to Text.


TDdeServerItem.ServerConv

TDdeServerItem

Specifies the DDE server conversation to associate with the DDE server item.

property ServerConv: TDdeServerConv;

Description

Set ServerConv to associate the DDE server item with a DDE topic represented by the DDE server conversation. If ServerConv is not set, the DDE topic of the conversation is the value of the Caption property of the form containing the TDdeServerItem component.


TDdeServerItem.Text

TDdeServerItem	See also 	Example

Contains the data to exchange in a DDE conversation.

property Text: string;

Description

Set Text to the data the DDE server item sends to the DDE client. Whenever the Text property changes, an OnChange event occurs and then the new value is sent to the DDE client. If the DDE server item accepts poked data, Text receives the data whenever the DDE client pokes data to this item. When Text is changed by a DDE client poking data, an OnPokeData event occurs after the OnChange event.

Usually Text contains text, and setting Text sets the Fmt property to CF_TEXT. However, Delphi strings can contain non-text data. If Text does not specify text data, Fmt must be changed to indicate the format of the data in an OnChange event handler.

Text corresponds to the Lines property. Whenever the value of Lines or Text is changed, the other is updated so that the first line of Lines is always equal to Text.


TDdeServerItem events

TDdeServerItem	Alphabetically	Legend

In TDdeServerItem

OnChange

OnPokeData


TDdeServerItem events

TDdeServerItem	By object	Legend

OnChange

OnPokeData


TDdeServerItem.OnChange

TDdeServerItem	See also

Occurs when the Lines property changes, before the changes have been sent to the DDE client.

property OnChange: TNotifyEvent;

Description

Write an OnChange event handler to take specific action when the DDE server item is about to update the DDE client. The new value for the DDE client item can be found by reading the Lines or Text property.

If the value of Lines does not contain text data, an OnChange event handler must be assigned to change the value of Fmt. OnChange is called after Fmt gets set to CF_TEXT by setting the Lines property, but before the data gets sent to the client.


TDdeServerItem.OnPokeData

TDdeServerItem	See also 	Example

Occurs after a DDE client changes the value of the Lines property.

property OnPokeData: TNotifyEvent;

Description

Write an OnPokeData event handler to take specific action when the DDE client pokes data to this DDE server item. The new value for the item can be found by reading the Lines or Text property.

When a DDE client pokes data to a DDE server items, the PokeData method is called. PokeData causes the following events.

1	First, the new value is assigned to the Lines (Text) property.

2	An OnChange event occurs.

3	The new value is sent back to the DDE client.

4	An OnPokeData event occurs.


TDdeServerItem methods

TDdeServerItem	Alphabetically

In TDdeServerItem

Change

CopyToClipboard

Create

Destroy

PokeData

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDdeServerItem methods

TDdeServerItem	By object

AfterConstruction

Assign

BeforeDestruction

Change

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

CopyToClipboard

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

PokeData

RemoveComponent

SafeCallException

UpdateAction


TDdeServerItem.Change

TDdeServerItem	See also

Generates an OnChange event.

procedure Change; dynamic;

Description

Call Change to trigger an OnChange event when not setting the Lines or Text property. Use Change in conjunction with the OnChange event to enable the DDE server item to exchange data that is not compatible with the strings used by the Lines and Text properties.


TDdeServerItem.CopyToClipboard

TDdeServerItem	See also

Copies the data specified in the Text or Lines property to the Windows Clipboard, along with DDE link information.

procedure CopyToClipboard;

Description

Use CopyToClipboard to enable DDE clients to link to the DDE server item by executing an Edit | Paste Link command, or its equivalent in the command structure of the DDE client application.

CopyToClipboard can be used to create a DDE link at runtime only. To create a link at design time, select the TDdeServerItem object and choose Edit | Copy from the menu. Then, activate the DDE client application and paste the link according to the rules of the DDE client application. See the documentation for the DDE client application for specific information about pasting the link.


TDdeServerItem.Create

TDdeServerItem	See also

Creates an instance of TDdeServerItem.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a DDE server item at runtime. TDdeServerItem objects placed on forms at design time are created automatically.

After calling the inherited constructor, Create initializes the Fmt property to CF_TEXT, and creates a helper object to manage the Lines property.


TDdeServerItem.Destroy

TDdeServerItem	See also

Destroys an instance of TDdeServerItem.

destructor Destroy; override;

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TDdeServerItem is not nil, and only then calls Destroy.

Destroy frees the memory associated with the Lines property before calling the inherited destructor.


TDdeServerItem.PokeData

TDdeServerItem	See also

Processes data that has been poked to the DDE server item by a DDE client.

function PokeData(Data: HDdeData): LongInt;

Description

Call PokeData to inform the DDE server item that the DDE conversation holds data that has been poked from a DDE client. Data is the DDE handle to the poked data.

PokeData does the following:

1	Uses the Data handle to obtain the data that was poked.

2	Sets the Lines property to the new data value.

3	Triggers an OnChange event.

4	Sends the new value of the data back to the DDE client.

5	Triggers an OnPokeData event.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


 TDdeServerConv

Hierarchy	Properties	Methods	Events	See also

TDdeServerConv represents a DDE topic of conversation with a DDE client.

Unit

ddeman

Description

Use TDdeServerConv to establish a DDE topic with a DDE client application. Individual items under the DDE topic are represented by TDdeServerItem objects. These items are linked to the DDE server conversation by setting their ServerConv property.

Using a TDdeServerConv component is optional. Without a TDdeServerConv object, the client can still enter into a DDE conversation and receive an update directly from a TDdeServerItem object. However, a DDE server conversation is required to handle any macros that the DDE client may send.

The Name property of the DDE server conversation provides the topic used by DDE clients to establish a link to the DDE server conversation. DDE server items that are not associated with a DDE server conversation use the Caption property of the form for the topic name. Use a TDdeServerConv object when establishing multiple DDE topics in a single form, or when the Caption of the form may not be unique or constant at runtime.


TDdeServerConv properties

TDdeServerConv	Alphabetically	Legend

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDdeServerConv properties

TDdeServerConv	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDdeServerConv events

TDdeServerConv	Alphabetically	Legend

In TDdeServerConv

OnClose

OnExecuteMacro

OnOpen


TDdeServerConv events

TDdeServerConv	By object	Legend

OnClose

OnExecuteMacro

OnOpen


TDdeServerConv.OnClose

TDdeServerConv	See also

Occurs when the DDE client terminates the DDE conversation.

property OnClose: TNotifyEvent;

Description

Write an OnClose event handler to take specific action when the DDE conversation ends. The DDE conversation will end if the client terminates the conversation. It does not end if the TDdeServerConv object is destroyed. In that case, the DDE server items simply remove themselves from the DDE server conversation, and continue the link to the DDE client.

The Sender parameter is the DDE server conversation, not the DDE client.


TDdeServerConv.OnExecuteMacro

TDdeServerConv	See also 	Example

Occurs when the DDE client sends a macro to the DDE server conversation.

type TMacroEvent = procedure(Sender: TObject; Msg: TStrings) of object;

property OnExecuteMacro: TMacroEvent;

Description

Write an OnExecuteMacro event handler to implement a response to macros sent by the DDE client. The Sender parameter is the DDE server conversation. The Msg parameter gives the macro string to execute.


TDdeServerConv.OnOpen

TDdeServerConv	See also

Occurs immediately after the DDE link to the client has been established.

property OnOpen: TNotifyEvent;

Description

Write an OnOpen event handler to take specific action whenever a link is established to a DDE client. The Sender parameter is the DDE server conversation, not the DDE client.


TDdeServerConv methods

TDdeServerConv	Alphabetically

In TDdeServerConv

Create

Destroy

ExecuteMacro

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDdeServerConv methods

TDdeServerConv	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

ExecuteMacro

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TDdeServerConv.Create

TDdeServerConv	See also

Creates an instance of TDdeServerConv.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create an instance of TDdeServerConv at runtime. For TDdeServerConv objects placed on forms at design time, Create is called automatically.


TDdeServerConv.Destroy

TDdeServerConv	See also

Destroys an instance of TDdeServerConv.

destructor Destroy; override;

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TDdeServerConv reference is not nil and only then calls Destroy.

Destroy removes the DDE server conversation topic from the application, but does not terminate any currently open DDE conversations. Instead, the DDE server items that were associated with the DDE server conversation become associated with the form instead, and continue their link to the DDE client.


TDdeServerConv.ExecuteMacro

TDdeServerConv	See also

Responds to macros sent by the DDE client.

function ExecuteMacro(Data: HDdeData): LongInt;

Description

ExecuteMacro provides the only way for a Delphi application to respond to macros sent by DDE clients. ExecuteMacro is called when the DDE client sends a Macro over the DDE link. Data is the handle to the DDE data that contains the macro.

ExecuteMacro retrieves the strings of the macro from Data, and calls the OnExecuteMacro event handler. If there is no OnExecuteMacro event handler, the macro is ignored. Whether or not there is an OnExecuteMacro event handler, the DDE client always receives notification that the macro was successfully transmitted, unless Data contains no macro.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TDefCollection

Hierarchy	Properties	Methods	See also

TDefCollection holds the definition objects (TNamedItem) that represent the specifications for database entities such as fields or indexes.

Unit

db

Description

TDefCollection is used as a base class for collections of definition objects such as index or field definitions.  These definition objects are used by a dataset to specify the attributes of a database entity that will be created by the dataset.

Use the properties and methods of TDefCollection to:

Access a specific definition object.

Add or delete definition objects from the list.

Find out how many definition objects are defined.

Copy a set of definitions to another dataset.


TDefCollection properties

TDefCollection	Alphabetically	Legend

In TDefCollection

Dataset

Updated

Derived from TCollection

Count

ItemClass

Items


TDefCollection properties

TDefCollection	By object	Legend

Count

Dataset

ItemClass

Items

Updated


TDefCollection.Dataset

TDefCollection	See also

Indicates the dataset that uses the TDefCollection object to manage its definition objects.

property Dataset: TDataSet;

Description

Use Dataset to access the dataset that will create the objects specified by the definitions in the Items array.


TDefCollection.Updated

TDefCollection	See also

Indicates whether the definition objects in the Items array match the corresponding instantiated objects in the dataset.

property Updated: Boolean;

Description

Use Updated to determine whether the definitions managed by the TDefCollection object match the corresponding entities (fields or indexes) of the dataset.  Updated is set to True when the definitions are retrieved from the dataset at design time, or when the definitions are used to create the corresponding entities in the dataset.  Updated is set to False when the properties of the definition objects are changed.


TDefCollection methods

TDefCollection	Alphabetically

In TDefCollection

Create

Find

GetItemNames

IndexOf

Derived from TCollection

Add

Assign

BeginUpdate

Clear

Delete

Destroy

EndUpdate

FindItemID

GetNamePath

Insert

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDefCollection methods

TDefCollection	By object

Add

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

Find

FindItemID

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetItemNames

GetNamePath

IndexOf

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDefCollection.Create

TDefCollection	See also

Instantiates a TDefCollection object.

constructor Create(ADataset: TDataSet; AOwner: TPersistent; AClass: TCollectionItemClass);

Description

Do not call the Create method. TDefCollection objects are created by the dataset that uses them to manage definition objects. The ADataset parameter specifies the dataset that creates the TDefCollection object.  It becomes the value of the Dataset property. The AOwner parameter indicates the object on whose behalf the definition is created. The AClass parameter specifies a descendant class of TNamedItem, and indicates the type of definition objects in the Items property array.


TDefCollection.Find

TDefCollection	See also

Locates a definition object in the Items array from its name.

function Find(const AName: string): TNamedItem;

Description

Call Find to obtain information about a particular definition object. Specify the name of the definition object as the value of the Name parameter.


TDefCollection.GetItemNames

TDefCollection 	See also

Fills a TStrings object with the names of all definitions in the list.

procedure GetItemNames(List: TStrings);

Description

Call GetItemNames to retrieve the names of all definitions managed by the TDefCollection object. Pass an empty string list as the List parameter. GetItemNames fills the string list with the names of all definitions.


TDefCollection.IndexOf

TDefCollection	See also

Finds the index number of a definition in the Items array from its name.

function IndexOf(const AName: string): Integer;

Description

Use the IndexOf method to locate the position of a definition in the Items property array. IndexOf returns a value from zero (the first position) to Count - 1. Specify the name of the definition as the Name parameter.

If Items contains no definition with the specified Name, the return value is -1.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection

TOwnedCollection


TDefaultEditor

Hierarchy	Properties	Methods	See also

TDefaultEditor is the component editor for components that do not explicitly register a component editor.

Unit

dsgnintf

Description

When a component class does not have a registered property editor, TDefaultEditor controls its response to right clicks, double clicks, and clipboard formats.

TDefaultEditor does not add any custom menu items to the context menu that appears when the user right-clicks a component in the designer, nor does it add any clipboard formats to the standard component format. However, TDefaultEditor does override the Edit method to supply a default response when the user double clicks a component.

The Edit method in TDefaultEditor searches the component for events. If it finds an OnClick event, it brings up the code editor for the OnClick event handler. If there is no OnClick event, it brings up the code editor for the OnChange event handler. If there is no OnChange event, it brings up the code editor for the OnCreate event handler. If it finds none of these events, it brings up the code editor for the first event it finds.

Use TDefaultEditor as a base class when creating component editors that bring up the code editor as the default response to a double click.


TDefaultEditor properties

TDefaultEditor	Alphabetically 	Legend

Derived from TComponentEditor

Component

Designer

Derived from TInterfacedObject

RefCount


TDefaultEditor properties

TDefaultEditor	By object 	Legend

Component

Designer

RefCount


TDefaultEditor methods

TDefaultEditor	Alphabetically	Legend

In TDefaultEditor

Edit

EditProperty

Derived from TComponentEditor

Copy

Create

ExecuteVerb

GetDesigner

GetIComponent

GetVerb

GetVerbCount

PrepareItem

Derived from TInterfacedObject

AfterConstruction

BeforeDestruction

NewInstance

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

SafeCallException


TDefaultEditor methods

TDefaultEditor	By object	Legend

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Copy

Create

DefaultHandler

Destroy

Dispatch

Edit

EditProperty

ExecuteVerb

FieldAddress

Free

FreeInstance

GetDesigner

GetIComponent

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetVerb

GetVerbCount

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

PrepareItem

SafeCallException


TDefaultEditor.Edit

TDefaultEditor	See also

Responds when the user double-clicks the component in the form designer.

procedure Edit; override;

Description

The Object Inspector calls Edit when the user double-clicks the component. Edit searches the component for events and brings up the code editor for the first event it finds.


TDefaultEditor.EditProperty

TDefaultEditor	See also	Example

Scans through the event handlers of the component and selects the one which the Edit method displays.

procedure EditProperty(PropertyEditor: TPropertyEditor; var Continue, FreeEditor: Boolean); virtual;

Description

The Edit method uses EditProperty to identify the property editor it displays when the user double-clicks. Edit scans through the properties and events of the component, calling EditProperty (indirectly) with the property editor for each property and event. EditProperty sets two internal class members, FBest and FFirst, to the best property editor it finds and the first appropriate property editor it finds. After all the properties and events are scanned or the Continue parameter is set to False, the Edit method calls the Edit method of the property editor selected by EditProperty (FBest if it is available, otherwise FFirst).

As implemented in TDefaultEditor, EditProperty only accepts property editors for events.

Override EditProperty to change the property editor that appears when the user double-clicks the component. You can filter the events that are viewed by TDefaultEditor’s EditProperty method (as shown in the example), or set FBest and FFirst to the property editor you want displayed.

PropertyEditor is the property editor for the current property.

Continue indicates whether the component editor should continue scanning properties. Set Continue to False if the desired property editor has been found and there is no need to continue scanning.

FreeEditor indicates whether the component editor should free the property editor when EditProperty exits. Set FreeEditor to True when PropertyEditor is not needed.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TInterfacedObject

TComponentEditor


TDetailDataLink

Hierarchy	Properties	Methods

TDetailDataLink is the ancestor to TMasterDataLink and provides base functionality for establishing a master/detail relationship.

Unit

Db

Description

Use TDetailDataLink descendants to create master/detail relationships.


TDetailDataLink properties

TDetailDataLink	Alphabetically	Legend

In TDetailDataLink

DetailDataSet

Derived from TDataLink

Active

ActiveRecord

BOF

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

Eof

ReadOnly

RecordCount


TDetailDataLink properties

TDetailDataLink	By object	Legend

Active

ActiveRecord

BOF

BufferCount

DataSet

DataSource

DataSourceFixed

DetailDataSet

Editing

Eof

ReadOnly

RecordCount


TDetailDataLink.DetailDataSet

TDetailDataLink

Indicates the detail dataset in the master/detail relationship.

property DetailDataSet: TDataSet;

Description

Read DetailDataSet to access the detail dataset. This is the dataset that uses a DetailDataLink to access its master dataset.


TDetailDataLink methods

TDetailDataLink	Alphabetically

In TDetailDataLink

GetDetailDataSet

Derived from TDataLink

Create

Destroy

Edit

ExecuteAction

UpdateAction

UpdateRecord

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDetailDataLink methods

TDetailDataLink	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

Edit

ExecuteAction

FieldAddress

FreeInstance

Free

GetDetailDataSet

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

UpdateAction

UpdateRecord


TDetailDataLink.GetDetailDataSet

TDetailDataLink	See also

Returns the value of the DetailDataSet property.

function GetDetailDataSet: TDataSet; virtual;

Description

GetDetailDataSet is the protected read implementation of the DetailDataSet property. As implemented in TDetailDataLink, GetDetailDataSet always returns nil. Descendants override this method to return the dataset that uses the data link to link to a master dataset.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TDataLink


 TDirectoryListBox

Hierarchy	Properties	Methods	Events 	See also

TDirectoryListBox represents a list box control that is aware of the directory structure of the current drive.

Unit

filectrl

Description

TDirectoryListBox implements the generic behavior introduced in TCustomListBox. TDirectoryListBox publishes many of the properties inherited from TCustomListBox and introduces new behavior to let the user change directories or drives.


TDirectoryListBox properties

TDirectoryListBox	Alphabetically	Legend

In TDirectoryListBox

CaseSensitive

Directory

DirLabel

Drive

FileList

PreserveCase

Derived from TCustomListBox

Canvas

Columns

IntegralHeight

ItemHeight

ItemIndex

Items

SelCount

Selected

TopIndex

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDirectoryListBox properties

TDirectoryListBox	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

Canvas

CaseSensitive

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Columns

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

Directory

DirLabel

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragMode

Drive

Enabled

FileList

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

ImeMode

ImeName

IntegralHeight

ItemHeight

ItemIndex

Items

Left

LRDockWidth

Name

Owner

Parent

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

PreserveCase

SelCount

Selected

ShowHint

Showing

TabOrder

TabStop

Tag

Top

TBDockHeight

TopIndex

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TDirectoryListBox.CaseSensitive

TDirectoryListBox	See also

Indicates whether the system supports case-sensitive directory information.

property CaseSensitive: Boolean;

Description

Read CaseSensitive to ascertain whether the current file system supports case-sensitive file names. CaseSensitive returns True if it does and False if it does not.


TDirectoryListBox.Directory

TDirectoryListBox	See also 	Example

Determines the current directory for the directory list box control.

property Directory: string;

Description

The directory list box displays the value of the Directory property as the current directory in the list box. The example shows how a directory list box and a file list box can work together through their Directory properties.

If the form contains a file list box, you can set the FileList property to have the file list box automatically display the files from the directory specified by the Directory property.


TDirectoryListBox.DirLabel

TDirectoryListBox	See also 	Example

Provides a simple way to display the current directory as the caption of a label control.

property DirLabel: TLabel;

Description

Use DirLabel to specify a label. When the current directory changes in the directory list box, the change is reflected in the caption of the label.


TDirectoryListBox.Drive

TDirectoryListBox	See also 	Example

Determines the drive for which the list box displays the directory structure.

property Drive: Char;

Description

When the value of Drive changes, the Directory value changes to the current directory on the specified drive.


TDirectoryListBox.FileList

TDirectoryListBox	See also 	Example

Provides a simple way to connect a directory list box with a file list box.

property FileList: TFileListBox;

Description

Use FileList to specify a file list box in which to display the files of the current directory.


TDirectoryListBox.PreserveCase

TDirectoryListBox	See also

Indicates whether the file system preserves the case of file names when writing to disk.

property PreserveCase: Boolean;

Description

Read PreserveCase to ascertain whether the current file system preserves the case of file names. PreserveCase returns True if it does and False if it does not.


TDirectoryListBox events

TDirectoryListBox	Alphabetically	Legend

In TDirectoryListBox

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDirectoryListBox events

TDirectoryListBox	By object	Legend

OnChange

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDirectoryListBox.OnChange

TDirectoryListBox 	Example

Occurs when the user selects a new directory with the mouse or keyboard when the user moves the selection bar and presses enter.

property OnChange: TNotifyEvent;

Description

Write an OnChange event handler to perform an action whenever a new directory is selected.


TDirectoryListBox methods

TDirectoryListBox	Alphabetically

In TDirectoryListBox

Create

Destroy

DisplayCase

FileCompareText

GetItemPath

OpenCurrent

Update

Derived from TCustomListBox

Clear

ItemAtPos

ItemRect

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDirectoryListBox methods

TDirectoryListBox	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

DisplayCase

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FileCompareText

FindComponent

FindChildControl

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetItemPath

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ItemAtPos

ItemRect

ManualDock

ManualFloat

MethodAddress

MethodName

NewInstance

OpenCurrent

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBarTControl_UseRightToLeftScrollBar>Main


TDirectoryListBox.Create

TDirectoryListBox	See also

Creates and intitializes a directory list box.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a directory list box at runtime. For directory list boxes created at design time, Create is called automatically.


TDirectoryListBox.Destroy

TDirectoryListBox	See also

Disposes of an instance of a directory list box.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Call Free instead. Free checks that the list box reference is not nil before it calls Destroy.

Destroy frees the bitmaps used for the Open, Close and Current folders, and then calls the inherited Destroy method.


TDirectoryListBox.DisplayCase

TDirectoryListBox	See also

Preserves or converts the case of the string passed to it.

function DisplayCase(const S: String): string;

Description

DisplayCase converts S to all-lower-case (using the currently installed language driver) if neither PreserveCase nor CaseSensitive is True. Otherwise, it returns S unmodified.


TDirectoryListBox.FileCompareText
TDirectoryListBox:.FileCompareText

TDirectoryListBox	See also

Compares two strings, taking into account the case-sensitivity of the file system.

function FileCompareText(const A, B: String): Integer;

Description

If CaseSensitive is False, FileCompareText compares the strings passed to it case-insensitively. Otherwise, it uses AnsiCompareStr to compare the strings.


TDirectoryListBox.GetItemPath

TDirectoryListBox	See also	Example

Returns the path of a directory in the directory list box.

function GetItemPath(Index : Integer): string;

Description

Use GetItemPath to get the path of a directory by specifying the directory’s index value. The first directory in the list has an index of 0.


TDirectoryListBox.OpenCurrent

TDirectoryListBox 	Example

Opens the selected directory.

procedure OpenCurrent;

Description

OpenCurrent opens the directory selected in the directory list box, as if the user had double-clicked the directory.


TDirectoryListBox.Update

TDirectoryListBox 	Example

Refreshes the directory list.

procedure Update; reintroduce;

Description

Call Update to refresh the directory list after new directories have been created or existing directories deleted.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomListBox


TDragObject

Hierarchy	Methods	See also

TDragObject is a base class used for managing drag operations.

Unit

controls

Description

Use TDragObject as a base class when creating a custom drag object to manage drag-and-drop operations or drag-and-dock operations. If the drag operation is associated with a single control that is dragged, derive the custom drag object from TBaseDragControlObject instead. Create the custom drag object in the OnStartDrag event of the dragged control. Use the public IsDragObject function within a target’s OnDragOver event when accepting a drag drop.

In Applications that do not need to override the virtual methods of TDragObject, a drag object such as TDragControlObject or TDragDockObject is created automatically to manage drag operations.

TDragObject allows more flexible drag operation handling. Normally, the Source parameter of the OnDragOver and OnDragDrop events is the control that starts the drag operation. If multiple controls of differing kinds need to start a drag of the same kind of data (for example, a file name, text, or a dollar amount), the source would need support for each kind of control. A drag object allows the target to handle drag sources as a single class of object since each source control creates the same kind of drag object in their OnStartDrag events. The OnDragOver and OnDragDrop event handlers can tell if the source is a drag object, as opposed to the control, by calling IsDragObject.

Drag objects can be dragged between multiple .DLLs as well as inside the main .EXE. This is useful if you are not using packages but still want drag operations to function from forms implemented in .EXEs to forms implemented in .DLLs.


TDragObject properties

TDragObject	Alphabetically	Legend

In TDragObject

Cancelling

DragHandle

DragPos

DragTarget

DragTargetPos

MouseDeltaX

MouseDeltaY


TDragObject properties

TDragObject	By object	Legend

Cancelling

DragHandle

DragPos

DragTarget

DragTargetPos

MouseDeltaX

MouseDeltaY


TDragObject.Cancelling

TDragObject	See also

Specifies whether the drag operation is being canceled.

property Cancelling: Boolean;

Description

Use Cancelling to specify whether the drag operation is being canceled. Cancelling is set to True in the global CancelDrag procedure to prevent the canceling code from being executed more than once.


TDragObject.DragHandle

TDragObject	See also

Specifies the window handle of the dragged object.

property DragHandle: HWND;

Description

Use DragHandle to get or set the window handle of the dragged object.


TDragObject.DragPos

TDragObject 	See also

Specifies the position of the dragged object.

property DragPos: TPoint;

Description

Use DragPos to get the position of the dragged object.


TDragObject.DragTarget

TDragObject 	See also

Specifies the dragged object’s target.

property DragTarget: Pointer;

Description

Use DragTarget to get the control (if any) that is the current drop target of the drag operation. If there is no control that will accept the dragged object if it is released, DragTarget is nil.


TDragObject.DragTargetPos

TDragObject 	See also

Specifies the position of the drag object relative to the drag target.

property DragTargetPos: TPoint;

Description

Use DragTargetPos to get the position of the dragged object relative to the upper left corner of the drag target. To get the position of the dragged object in screen coordinates, use the DragPos property instead.


TDragObject.MouseDeltaX

TDragObject 	See also

Specifies the x-coordinate of the mouse position relative to the position of the dragged object’s target.

property MouseDeltaX: Double;

Description

Use MouseDeltaX to determine the x-coordinate of the mouse position relative to the position where the dragged object would appear if released on the current target.


TDragObject.MouseDeltaY

TDragObject 	See also

Specifies the y-coordinate of the mouse position relative to the position of the dragged object’s target.

property MouseDeltaY: Double;

Description

Use MouseDeltaY to determine the y-coordinate of the mouse position relative to the position where the dragged object would appear if released on the current target.


TDragObject methods

TDragObject	Alphabetically	Legend

In TDragObject

Assign

Finished

GetDragCursor

GetDragImages

GetName

HideDragImage

Instance

ShowDragImage

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDragObject methods

TDragObject	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Finished

Free

FreeInstance

GetDragCursor

GetDragImages

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetName

HideDragImage

InheritsFrom

InitInstance

Instance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

ShowDragImage


TDragObject.Assign

TDragObject	See also

Copies the properties of another drag control object.

procedure Assign(Source: TDragObject); virtual;

Description

Call Assign to copy the properties of another drag object. Assign changes the DragTarget, DragHandle, DragPos, DragTargetPos, MouseDeltaX and MouseDeltaY properties of the drag object to match those supplied by the Source parameter.


TDragObject.Finished

TDragObject	See also

Responds when the mouse is released indicating the drag operation is complete.

procedure Finished(Target: TObject; X, Y: Integer; Accepted: Boolean); virtual;

Description

Finished does nothing as implemented in TDragObject. Override this method to provide more meaningful behavior. The Target is the object that accepted the drag. If the drag operation is canceled or a drag-and-dock operation ends with the dragged object in a free-floating position, Target is nil. X and Y indicate the position where the drag ended. Accepted is True if the Target accepted the dragged object.

Finished is overridden and implemented in TBaseDragControlObject.


TDragObject.GetDragCursor

TDragObject	See also

Indicates which cursor should be displayed in response to mouse moves.

function GetDragCursor(Accepted: Boolean; X, Y: Integer): TCursor; virtual;

Description

When the mouse is moved, GetDragCursor is called automatically.  The Accepted parameter indicates whether the object under the mouse accepts the drag. The X and Y parameters represent the current position of the mouse. The TCursor value returned by GetDragCursor is used to indicate the current drag cursor.

GetDragCursor returns crDrag to when Accepted is True, crNoDrop otherwise.


TDragObject.GetDragImages

TDragObject	See also

Returns an image list containing the image to be displayed while dragging.

function GetDragImages: TDragImageList; virtual;

Description

GetDragImages is called at the beginning of a drag and drop operation. As implemented in TDragObject, GetDragImages returns nil, meaning that only the cursor is used to indicate the drag operation.

In descendant classes, the image list normally contains only one image, and the drag object automatically creates and maintains the image list.


TDragObject.GetName

TDragObject	See also

Returns a string that identifies the drag operation.

function GetName: string; virtual;

Description

By default GetName returns the name of the drag object class, but can be overridden to return a more meaningful string.


TDragObject.HideDragImage

TDragObject	See also

Provides the interface for a method that hides the current drag image.

procedure HideDragImage; virtual;

Description

Because TDragObject does not implement drag images (relying only on the cursor) HideDragImage does nothing. Descendant classes override HideDragImage to hide the drag image provided by the GetDragImages method.


TDragObject.Instance

TDragObject	See also

Returns the instance (module) handle of the EXE or DLL that created the drag object.

type THandle = Integer;

function Instance: THandle; virtual;

Description

Use Instance to obtain the instance handle for loading a resource, such as a cursor, associated with the drag object.  See the example for the Cursors property of TScreen for an example of using the instance handle to load a cursor.


TDragObject.ShowDragImage

TDragObject	See also

Provides the interface for a method that hides the current drag image.

procedure ShowDragImage; virtual;

Description

Because TDragObject does not implement drag images (relying only on the cursor) ShowDragImage does nothing. Descendant classes override ShowDragImage to show the drag image provided by the GetDragImages method.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject


 TDrawGrid

Hierarchy	Properties	Methods	Events	See also

TDrawGrid represents a grid control that displays information in column and row format.

Unit

grids

Description

Add a TDrawGrid object to a form to present arbitrary information in a tabular format. TDrawGrid provides many properties to control the appearance of the grid, as well as events and methods that take advantage of the tabular organization of the grid in responding to user actions.

TDrawGrid introduces several events and methods to allow applications to customize the appearance and behavior of the grid.

If the cells of the grid contain text strings that represent objects, consider using a TStringGrid object instead. If the grid displays field values from the records in a dataset, use TDBGrid instead.


TDrawGrid properties

TDrawGrid	Alphabetically	Legend

Derived from TCustomGrid

BorderStyle

Col

ColCount

ColWidths

DefaultColWidth

DefaultDrawing

DefaultRowHeight

EditorMode

FixedColor

FixedCols

FixedRows

GridHeight

GridLineWidth

GridWidth

LeftCol

Options

Row

RowCount

RowHeights

ScrollBars

Selection

TabStops

TopRow

VisibleColCount

VisibleRowCount

Derived from TCustomControl

Canvas

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDrawGrid properties

TDrawGrid	By object	Legend

Action

Align

Anchors

BiDiMode

BorderStyle

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Col

ColCount

Color

ColWidths

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DefaultColWidth

DefaultDrawing

DefaultRowHeight

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

EditorMode

Enabled

FixedColor

FixedCols

FixedRows

Floating

FloatingDockSiteClass

Font

GridHeight

GridLineWidth

GridWidth

Handle

Height

HelpContext

Hint

HostDockSite

Left

LeftCol

LRDockWidth

Name

Options

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

Row

RowCount

RowHeights

ScrollBars

Selection

ShowHint

Showing

TabOrder

TabStop

TabStops

Tag

TBDockHeight

Top

TopRow

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleColCount

VisibleDockClientCount

VisibleRowCount

Width

WindowProc


TDrawGrid events

TDrawGrid	Alphabetically	Legend

In TDrawGrid

OnColumnMoved

OnDrawCell

OnGetEditMask

OnGetEditText

OnRowMoved

OnSelectCell

OnSetEditText

OnTopLeftChanged

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseWheelDown

OnMouseWheelUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TDrawGrid events

TDrawGrid	By object	Legend

OnClick

OnColumnMoved

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnDrawCell

OnEndDock

OnEndDrag

OnEnter

OnExit

OnGetEditMask

OnGetEditText

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnMouseWheelDown

OnMouseWheelUp

OnRowMoved

OnSelectCell

OnSetEditText

OnStartDock

OnStartDrag

OnTopLeftChanged


TDrawGrid.OnColumnMoved

TDrawGrid	See also

Occurs immediately after the position of a column changes.

type TMovedEvent = procedure (Sender: TObject; FromIndex, ToIndex: Longint) of object;

property OnColumnMoved: TMovedEvent;

Description

Use OnColumnMoved to perform special processing when the position of a grid column changes. Columns can be moved programmatically or by user manipulation. The FromIndex parameter is the old index of the column, and the ToIndex parameter is the new index. OnColumnMoved does not occur unless the Options property includes goColMoving.


TDrawGrid.OnDrawCell

TDrawGrid	See also 	Example

Occurs when a cell in the grid needs to be drawn.

type

  TDrawCellEvent = procedure (Sender: TObject; ACol, ARow: Longint; Rect: TRect; State: TGridDrawState) of object;

property OnDrawCell: TDrawCellEvent;

Description

Write an OnDrawCell event handler to draw the contents all the cells in the grid. Draw on the cell using the methods of the Canvas property. The Rect parameter indicates the location of the cell on the canvas. The Col and Row parameters indicate the column and row indexes of the cell that should be drawn. The State parameter indicates whether the cell has input focus, whether the cell is selected, and whether the cell is a fixed (nonscrolling) cell.

If the OnDrawCell event handler is not assigned, all cells in the draw grid will appear empty. If the DefaultDrawing property is True, the draw grid paints the background color of the cell before the OnDrawCell event, and draws a focus rectangle around the selected cell after the OnDrawCell event handler finishes drawing the contents of the cell. If the DefaultDrawing property is False, the OnDrawCell event handler should paint the background of the cell and provide all visual indication of selection and focus.


TDrawGrid.OnGetEditMask

TDrawGrid	See also 	Example

Occurs when the in-place editor requests an edit mask.

type TGetEditEvent = procedure (Sender: TObject; ACol, ARow: Longint; var Value: String) of object;

property OnGetEditMask: TGetEditEvent;

Description

Write an OnGetEditMask event handler to provide the in-place editor with an edit mask that describes the valid input strings a user can type into a cell. Set the Value parameter to the string that describes the edit mask for the cell specified by the ACol and ARow parameters. If the cell does not have an edit mask, set the Value parameter to an empty string.

OnGetEditMask does not occur unless the Options property includes goEditing.


TDrawGrid.OnGetEditText

TDrawGrid	See also 	Example

Occurs when the in-place editor requests the value of a cell.

type TGetEditEvent = procedure (Sender: TObject; ACol, ARow: Longint; var Value: String) of object;

property OnGetEditText: TGetEditEvent;

Description

Write an OnGetEditText event handler to provide the in-place editor with a string representing the contents of the cell. Set the Value parameter to the string for the cell specified by the ACol and ARow parameters. When the cell enters edit mode, the contents of the cell are drawn as the Value string returned by the OnGetEditText event handler. This image need not match the appearance of the cell when it is not in edit mode, which is drawn using the OnDrawCell event handler.

OnGetEditText does not occur unless the Options property includes goEditing.


TDrawGrid.OnRowMoved

TDrawGrid	See also 	Example

Occurs immediately after the position of a row changes.

type TMovedEvent = procedure (Sender: TObject; FromIndex, ToIndex: Longint) of object;

property OnRowMoved: TMovedEvent;

Description

Write an OnRowMoved event handler to provide special processing whenever a row in the grid changes position. Rows can be moved programmatically or by user manipulation. The FromIndex parameter is the old index of the row, and the ToIndex parameter is the new index. OnRowMoved does not occur unless the Options property includes goRowMoving.


TDrawGrid.OnSelectCell

TDrawGrid	See also 	Example

Occurs before a cell in the grid is selected.

type

  TSelectCellEvent = procedure (Sender: TObject; ACol, ARow: Longint; var CanSelect: Boolean) of object;

property OnSelectCell: TSelectCellEvent;

Description

Write an OnSelectCell event handler to specify whether any particular cell in the grid can be selected. The Col and Row parameters indicate the column and row indexes of the cell that is about to be selected. Set the CanSelect parameter to False to prevent the cell being selected.


TDrawGrid.OnSetEditText

TDrawGrid	See also

Occurs when the user edits the value of a cell.

type TSetEditEvent = procedure (Sender: TObject; ACol, ARow: Longint; const Value: String) of object;

property OnSetEditText: TSetEditEvent;

Description

Write an OnSetEditText event handler to perform any special processing of the text edited by the user in an in-place editor. For example, use the OnSetEditText event to retrieve and store the value of a cell so that it can be displayed in an OnDrawCell event handler. OnSetEditText occurs every time the user changes the text.

The Value parameter is the new value for the cell specified by the ACol and ARow parameters.

OnSetEditText does not occur unless the Options property includes goEditing.


TDrawGrid.OnTopLeftChanged

TDrawGrid	See also

Occurs immediately after the TopRow property or the LeftCol property changes.

property OnTopLeftChanged: TNotifyEvent;

Description

Use OnTopLeftChanged to perform special processing when the non-fixed cells in the grid are scrolled.


TDrawGrid methods

TDrawGrid	Alphabetically	Legend

In TDrawGrid

CellRect

ColumnMoved

DrawCell

GetEditMask

GetEditText

MouseToCell

RowMoved

SelectCell

SetEditText

TopLeftChanged

Derived from TCustomGrid

Create

Destroy

MouseCoord

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDrawGrid methods

TDrawGrid	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

CellRect

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ColumnMoved

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawCell

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetEditMask

GetEditText

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseCoord

MouseToCell

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

RowMoved

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SelectCell

SendToBack

SetBounds

SetEditText

SetFocus

SetTextBuf

Show

TopLeftChanged

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TDrawGrid.CellRect

TDrawGrid	See also

Returns the screen coordinates of a cell in the grid.

function CellRect(ACol, ARow: Longint): TRect;

Description

Call CellRect to obtain the boundaries, in pixels, of the cell in the column and row indicated by the ACol and ARow parameters. The top left cell is specified when ACol and ARow are set to zero.

If the indicated cell is not visible, CellRect returns an empty rectangle.


TDrawGrid.ColumnMoved

TDrawGrid	See also

Generates an OnColumnMoved event.

procedure ColumnMoved(FromIndex, ToIndex: Longint); override;

Description

ColumnMoved is called immediately after a column in the grid has moved. It overrides the inherited method to generate an OnColumnMoved event. Descendants of TDrawGrid can override this method to make internal adjustments or to block the OnColumnMoved event.


TDrawGrid.DrawCell

TDrawGrid	See also

Generates an OnDrawCell event.

procedure DrawCell(ACol, ARow: Longint; ARect: TRect; AState: TGridDrawState); override;

Description

DrawCell is called automatically whenever a cell in the grid is drawn. If the DefaultDrawing property is True, the background of the cell is painted before DrawCell is called, and the 3D effects of the fixed cells or the focus rectangle around the focused cell are drawn after DrawCell. Descendants of TDrawGrid can override this method to draw the contents of the cell or to block the OnDrawCell event.


TDrawGrid.GetEditMask

TDrawGrid	See also

Generates an OnGetEditMask event.

function GetEditMask(ACol, ARow: Longint): String; override;

Description

The inplace editor calls GetEditMask to obtain any input mask associated with the cell specified by the ACol and ARow parameters. GetEditMask returns the Value parameter set by the OnGetEditMask event handler. If there is no OnGetEditMask event handler, GetEditMask returns an empty string, indicating that there is no edit mask.


TDrawGrid.GetEditText

TDrawGrid	See also

Generates an OnGetEditText event.

function GetEditText(ACol, ARow: Longint): String; override;

Description

The inplace editor calls GetEditText to obtain the text for the indicated cell. GetEditText returns the Value parameter set by the OnGetEditText event handler. If there is no OnGetEditText event handler, GetEditText returns an empty string.


TDrawGrid.MouseToCell

TDrawGrid	See also 	Example

Returns the column and row of the cell at the position with screen coordinates (X,Y).

procedure MouseToCell(X, Y: Integer; var ACol, ARow: Longint);

Description

Call MouseToCell to convert from grid-relative screen coordinates to row and column indexes. The X and Y parameters are the screen coordinates of the point to be converted. MouseToCell returns the ACol parameter as the number of the column over the point (X,Y), and the ARow parameter as the number of the row.

Usually the MouseToCell method is used in a mouse event handler, which supplies the mouse coordinates as the X and Y parameters of the method call.


TDrawGrid.RowMoved

TDrawGrid	See also

Generates an OnRowMoved event.

procedure RowMoved(FromIndex, ToIndex: Longint); override;

Description

RowMoved is called immediately after a row in the grid changes position. It overrides the inherited method to generate an OnRowMoved event. Descendants of TDrawGrid can override this method to make internal adjustments or to block the OnRowMoved event.


TDrawGrid.SelectCell

TDrawGrid	See also

Determines whether a particular cell in the grid can be selected.

function SelectCell(ACol, ARow: Longint): Boolean; override;

Description

Grid controls call SelectCell internally before attempting to move selection to a the cell identified by the ACol and ARow parameters. ACol and ARow are the column and row indexes for the cell, where the first column has index 0, and the top row has index 0.

SelectCell generates an OnSelectCell event. This method then returns True, unless the OnSelectCell event handler indicates that the cell should not be selected. Descendants of TDrawGrid can override this method to check the properties of the information displayed in the cell or block the OnSelectCell event.


TDrawGrid.SetEditText

TDrawGrid	See also

Generates an OnSetEditText event.

procedure SetEditText(ACol, ARow: Longint; const Value: String); dynamic;

Description

SetEditText is called by the inplace editor so that the grid can store the new value for the current cell. SetEditText overrides the inherited method to generate an OnSetEditText event. Descendants of TDrawGrid can override this method to update an internal representation of the cell’s value, or to block the OnSetEditText event.


TDrawGrid.TopLeftChanged

TDrawGrid	See also

Generates an OnTopLeftChanged event.

procedure TopLeftChanged; dynamic;

Description

Grid controls call TopLeftChanged internally, whenever the LeftCol or TopRow property changes. After calling the inherited method to update the position of the inplace editor, TopLeftChanged generates an OnTopLeftChanged event.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGrid


TDragControlObject

Hierarchy	Properties	Methods	See also

TDragControlObject object provides for normal drag and drop operations.

Unit

controls

Description

TDragControlObject object performs normal drag and drop operations. When TDragControlObject is used, the OnDragOver and OnDragDrop events receive the control being dragged as the Sender, instead of the drag object itself.


TDragControlObject properties

TDragControlObject	Alphabetically	Legend

Derived from TBaseDragControlObject

Control

Derived from TDragObject

Cancelling

DragHandle

DragPos

DragTarget

DragTargetPos

MouseDeltaX

MouseDeltaY


TDragControlObject properties

TDragControlObject	By object	Legend

Cancelling

Control

DragHandle

DragPos

DragTarget

DragTargetPos

MouseDeltaX

MouseDeltaY


TDragControlObject methods

TDragControlObject	Alphabetically	Legend

In TDragControlObject

GetDragCursor

GetDragImages

HideDragImage

ShowDragImage

Derived from TBaseDragControlObject

Assign

Create

Derived from TDragObject

GetName

Instance

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDragControlObject methods

TDragControlObject	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetDragCursor

GetDragImages

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetName

HideDragImage

InheritsFrom

InitInstance

Instance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

ShowDragImage


TDragControlObject.GetDragCursor

TDragControlObject	See also

Returns the correct drag cursor to display at the X, Y position for the drag and drop operation.

function GetDragCursor(Accepted: Boolean; X, Y: Integer): TCursor; override;

Description

If the control at the X, Y position accepts the drag (in an OnDragOver event handler), the drag object sets the drag cursor to the control's DragCursor property; otherwise, it displays the crNoDrop cursor.


TDragControlObject.GetDragImages

TDragControlObject	See also

Returns the control's image list containing the image to be displayed while dragging.

function GetDragImages: TDragImageList; override;

Description

GetDragImages calls the associated control’s GetDragImages method. The image list normally contains only one image, which the control creates and maintains. For many controls in the VCL, GetDragImages returns nil.


TDragControlObject.HideDragImage

TDragControlObject	See also

Hides the image used in the drag cursor.

procedure HideDragImage; override;

Description

If the control being dragged contains an image list containing an image for dragging, it will be hidden. This allows control over when a drag image is displayed.


TDragControlObject.ShowDragImage

TDragControlObject	See also

Shows the image used in the drag cursor.

procedure ShowDragImage; override;

Description

If the control being dragged contains an image list containing an image for dragging, it will be shown. This allows control over when a drag image is shown.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TDragObject

TBaseDragControlObject


TDragDockObject

Hierarchy	Properties	Methods	See also

Contains drag-and-dock information for a control.

Unit

Controls

Description

TDragDockObject is used in several events and methods that use drag-and-dock information, including the OnDockDrop and OnDockOver events of TWinControl.


TDragDockObject properties

TDragDockObject	Alphabetically	Legend

In TDragDockObject

Brush

DockRect

DropAlign

DropOnControl

Floating

FrameWidth

Derived from TBaseDragControlObject

Control

Derived from TDragObject

Cancelling

DragHandle

DragPos

DragTarget

DragTargetPos

MouseDeltaX

MouseDeltaY


TDragDockObject properties

TDragDockObject	By object	Legend

Brush

Cancelling

Control

DockRect

DragHandle

DragPos

DragTarget

DragTargetPos

DropAlign

DropOnControl

Floating

FrameWidth

MouseDeltaX

MouseDeltaY


TDragDockObject.Brush

TDragDockObject	Properties

Specifies the brush used to draw the dock image.

property Brush: TBrush;

Description

Use Brush to specify the brush used to draw the dock image.


TDragDockObject.DockRect

TDragDockObject	Properties	Example

Specifies the rectangle on which the control is docked if released.

property DockRect: TRect;

Description

Use DockRect to determine the rectangle on which the control is docked if released.


TDragDockObject.DropAlign

TDragDockObject	Properties

Specifies how the control will be aligned when docked.

property DropAlign: TAlign;

Description

Use DropAlign to determine how the control will be aligned when docked.


TDragDockObject.DropOnControl

TDragDockObject	Properties

Specifies the control on which the dragged control will be docked if released.

property DropOnControl: TControl;

Description

Use DropOnControl to determine the control on which the dragged control would be dropped if released.


TDragDockObject.Floating

TDragDockObject	Properties

Specifies whether the control is floating.

property Floating: Boolean;

Description

Use Floating to determine whether the control is floating.


TDragDockObject.FrameWidth

TDragDockObject	See also

Specifies the border width, in pixels, of the frame drawn around the drag image.

property FrameWidth: Integer;

Description

Read FrameWidth to detemine the size of the frame drawn around the drag image. As implemented in TDragDockObject, this value is always 4 pixels.


TDragDockObject methods

TDragDockObject	Alphabetically	Legend

In TDragDockObject

AdjustDockRect

Assign

Create

Destroy

DrawDragDockImage

EndDrag

EraseDragDockImage

GetDragCursor

GetFrameWidth

Derived from TDragObject

GetName

HideDragImage

Instance

ShowDragImage

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDragDockObject methods

TDragDockObject	By object	Legend

AdjustDockRect

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

DrawDragDockImage

EndDrag

EraseDragDockImage

FieldAddress

Free

FreeInstance

GetDragCursor

GetFrameWidth

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetName

HideDragImage

InheritsFrom

InitInstance

Instance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

ShowDragImage


TDragDockObject.AdjustDockRect

TDragDockObject	See also

Adjusts the value of DockRect to reflect the dragged control’s current status.

procedure AdjustDockRect(ARect: TRect); virtual;

Description

AdjustDockRect is called automatically at points during the drag operation to adjust the value of the DockRect property. The adjustment ensures that the position where the control is docked reflects the current mouse position.


TDragDockObject.Assign

TDragDockObject	Methods

Enables assignments of TDragDockObject objects.

procedure Assign(Source: TDragObject); override;

Description

Assign calls the inherited Assign method and then handles the assignment of TDragDockObject objects.


TDragDockObject.Create

TDragDockObject	Methods

Creates and initializes an instance of TDragDockObject.

constructor Create(AControl: TControl); override;

Description

Create calls the inherited constructor and allocates memory for the Brush property.


TDragDockObject.Destroy

TDragDockObject	Methods

Destroys an instance of TDragDockObject.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead, call Free.

Destroy frees the memory associated with the Brush property and then calls the inherited destructor.


TDragDockObject.DrawDragDockImage

TDragDockObject	Methods

Called when the dock image for a control is drawn.

procedure DrawDragDockImage; virtual;

Description

Override DrawDragDockImage in a derived class to perform actions when the dock image for a control is erased.

By default, EndDrag calls the control’s EraseDragDockImage method.


TDragDockObject.EndDrag

TDragDockObject	Methods

Called when a control is released from dragging.

procedure EndDrag(Target: TObject; X, Y: Integer); override;

Description

Override EndDrag in a derived class to perform actions when a control is released from dragging.

By default, EndDrag calls the control’s DoEndDock method.

Target is the object in which the control is docked. If the control is not docked, Target is nil.

X and Y are the coordinates of the control.


TDragDockObject.EraseDragDockImage

TDragDockObject	Methods

Called when the dock image for a control is erased.

procedure EraseDragDockImage; virtual;

Description

Override EraseDragDockImage in a derived class to perform actions when the dock image for a control is erased.

By default, EndDrag calls the control’s EraseDragDockImage method.


TDragDockObject.GetDragCursor

TDragDockObject	Methods	See also

Returns the cursor used during dragging.

type TCursor = -32768..32767;

function GetDragCursor(Accepted: Boolean; X, Y: Integer): TCursor; override;

Description

Override GetDragCursor to specify the cursor used during dragging.

By default, GetDragCursor returns crDefault.


TDragDockObject.GetFrameWidth

TDragDockObject	Methods	See also

Returns the value of the FrameWidth property.

function GetFrameWidth: Integer); virtual;

Description

Override GetFrameWidth to change the width of the frame that is drawn around the drag image. As implemented in TDragDockObject, GetFrameWidth returns 4.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TDragObject

TBaseDragControlObject


TDragImageList

Hierarchy	Properties	Methods	Events	See also

TDragImageList represents a set of images that appear during drag and drop operations.

Unit

Controls

Description

TDragImageList is used to hold images that are displayed during drag and drop operations. It is created by the control that is dragged, which returns the drag image list in its GetDragImages method.  During a drag operation, a TDragControlObject instance uses the drag image list to display or hide the images in the list.


TDragImageList properties

TDragImageList	Alphabetically	Legend

In TDragImageList

DragCursor

Dragging

Derived from TCustomImageList

AllocBy

BkColor

BlendColor

Count

DrawingStyle

Handle

Height

ImageType

Masked

ShareImages

Width

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDragImageList properties

TDragImageList	By object	Legend

AllocBy

BkColor

BlendColor

ComObject

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Count

DesignInfo

DragCursor

Dragging

DrawingStyle

Handle

Height

ImageType

Masked

Name

Owner

ShareImages

Tag

VCLComObject

Width


TDragImageList.DragCursor

TDragImageList	See also

Specifies the current drag cursor that is associated with the image list.

property DragCursor: TCursor;

Description

Use DragCursor to determine which cursor should be displayed when an image in the image list is dragged. When an image is dragged, a new drag image is created by combining the given image (typically a mouse cursor image) with the current drag cursor.


TDragImageList.Dragging

TDragImageList	See also

Indicates whether an image in the image list is being dragged.

property Dragging: Boolean;

Description

When Dragging returns True, an image in the image list is being dragged. When Dragging returns False, no image is being dragged.


TDragImageList events

TDragImageList	Alphabetically

Derived from TCustomImageList

OnChange


TDragImageList events

TDragImageList	By object

OnChange


TDragImageList methods

TDragImageList	Alphabetically	Legend

In TDragImageList

BeginDrag

DragLock

DragMove

DragUnlock

EndDrag

GetHotSpot

HideDragImage

Initialize

SetDragImage

ShowDragImage

Derived from TCustomImageList

Add

AddIcon

AddImages

AddMasked

Assign

Clear

Create

CreateSize

Delete

Destroy

Draw

DrawOverlay

FileLoad

GetBitmap

GetIcon

GetImageBitmap

GetInstRes

GetMaskBitmap

GetResource

HandleAllocated

Insert

InsertIcon

InsertMasked

Move

Overlay

RegisterChanges

Replace

ReplaceIcon

ReplaceMasked

ResInstLoad

ResourceLoad

UnRegisterChanges

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDragImageList methods

TDragImageList	By object	Legend

Add

AddIcon

AddImages

AddMasked

AfterConstruction

Assign

BeforeDestruction

BeginDrag

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

CreateSize

DefaultHandler

Delete

Destroy

DestroyComponents

Destroying

Dispatch

DragLock

DragMove

DragUnlock

Draw

DrawOverlay

EndDrag

ExecuteAction

FieldAddress

FileLoad

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetBitmap

GetHotSpot

GetIcon

GetImageBitmap

GetInstRes

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetMaskBitmap

GetNamePath

GetParentComponent

GetResource

HandleAllocated

HasParent

HideDragImage

InheritsFrom

Initialize

InitInstance

Insert

InsertComponent

InsertIcon

InsertMasked

InstanceSize

MethodAddress

MethodName

Move

NewInstance

Overlay

RegisterChanges

RemoveComponent

Replace

ReplaceIcon

ReplaceMasked

ResInstLoad

ResourceLoad

SafeCallException

SetDragImage

ShowDragImage

UnRegisterChanges

UpdateAction


TDragImageList.BeginDrag

TDragImageList	See also

Starts the dragging of an image list.

function BeginDrag(Window: HWND; X, Y: Integer): Boolean;

Description

Use BeginDrag to start dragging an image set by SetDragImage at the X and Y coordinates of the drag position relative to the upper-left corner of the image. Window is the handle to the image list. BeginDrag returns True if it was successful in starting the drag of the image.


TDragImageList.DragLock

TDragImageList	See also

Associates the drag image with the given Window handle and draws it at the position given by the parameters XPos and YPos while the window is in drag mode.

function DragLock(Window: HWND; XPos, YPos: Integer): Boolean;

Description

Call DragLock to use an image in the image list as a drag image when a particular window is dragged. DragLock returns True if successful.


TDragImageList.DragMove

TDragImageList	See also

Moves the drag image set by SetDragImage to a new position specified by X and Y within its currently associated window while the window is in drag mode.

function DragMove(X,Y: Integer): Boolean;

Description

Use the DragMove method to move the image that is being dragged during a drag-and-drop operation. DragMove returns True if successful.


TDragImageList.DragUnlock

TDragImageList	See also

Removes the association between the drag image and a window.

procedure DragUnlock;

Description

Call DragUnlock when an image is no longer needed as a drag image for a particular window. DragUnlock removes the association started by the DragLock method.


TDragImageList.EndDrag

TDragImageList	See also

Ends the drag operation.

function EndDrag: Boolean;

Description

Use EndDrag after BeginDrag has been called to end the drag operation.  EndDrag returns True if successful.


TDragImageList.GetHotSpot

TDragImageList

Returns the hot spot location associated with the current drag image.

function GetHotSpot: TPoint; override;

Description

Use the GetHotSpot method to obtain the position of the hot spot of the current drag image. The hot spot represents the current mouse position.


TDragImageList.HideDragImage

TDragImageList	See also

Hides the current drag image if it was previously shown.

procedure HideDragImage;

Description

Most applications do not need to use HideDragImage to hide the current drag image. The drag control object calls this method when it is needed.


TDragImageList.Initialize

TDragImageList

Sets numerous image list properties to their default values and creates instances of objects used internal to the image list.

procedure Initialize; override;

Description

Initialize is called from the constructors of the image list.


TDragImageList.SetDragImage

TDragImageList	See also

Sets an image within the image list to be shown during a drag and drop operation.

function SetDragImage(Index, HotSpotX, HotSpotY: Integer): Boolean;

Description

Use the SetDragImage method to set the image specified by Index within the image list to be shown when the image list is being used for drag and drop. The hot spot of the image is specified by HotSpotX and HotSpotY.


TDragImageList.ShowDragImage

TDragImageList	See also

Shows the current drag image if it was previously hidden.

procedure ShowDragImage;

Description

Most applications do not need to use ShowDragImage to display the current drag image. The drag control object calls this method when it is needed.


Scope

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TCustomImageList


 TDriveComboBox

Hierarchy	Properties	Methods	Events	See also

TDriveComboBox implements a specialized combo box that displays all the drives available when the application runs.

Unit

filectrl

Description

Add TDriveComboBox to a form to allow users to select a drive. Use TDriveComboBox along with TFileListBox, TFilterComboBox, and TDirectoryListBox to add full file selection capabilities to a form.

To add a standard Windows 95 file open or save dialog to an application, use TOpenDialog or TSaveDialog instead.


TDriveComboBox properties

TDriveComboBox	Alphabetically	Legend

In TDriveComboBox

DirList

Drive

TextCase

Derived from TCustomComboBox

Canvas

CharCase

DroppedDown

ItemIndex

Items

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Text

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDriveComboBox properties

TDriveComboBox	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

Canvas

CharCase

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DirList

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragMode

Drive

DroppedDown

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

ImeMode

ImeName

ItemIndex

Items

Left

LRDockWidth

Name

Owner

Parent

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Text

TextCase

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TDriveComboBox.DirList

TDriveComboBox	See also 	Example

Connects the drive combo box to a directory list box.

property DirList: TDirectoryListBox;

Description

Set DirList to a directory list box control that should update when the user changes the drive. When a new drive is selected in the drive combo box, the specified directory list box updates to display the directory structure and the current directory on the new drive.

Note:	If the form contains a file list box as well, it can be updated automatically using the FileList property of the directory list box object.


TDriveComboBox.Drive

TDriveComboBox	See also 	Example

Indicates the currently selected drive displayed in the edit portion of the combo box.

property Drive: Char;

Description

Set Drive to initialize the combo box to a particular drive. Read Drive to obtain the drive that was selected by the user.

When the user uses the drive combo box to select a new drive, the selected drive becomes the value of the Drive property. The value of the Text property also changes to the new volume name when the Drive property value changes.


TDriveComboBox.TextCase

TDriveComboBox	See also

Determines if the volume name in the Text property appears in uppercase or lowercase.

type TTextCase = (tcLowerCase, tcUpperCase);

property TextCase: TTextCase;

Description

Set TextCase to the case that should be used to represent the drive letter. These are the possible values:

Value	Meaning

tcLowerCase	The volume name specified in the Text property is displayed in lowercase letters.

tcUpperCase	The volume name specified in the Text property is displayed in uppercase letters.

Note:	Changes made to the TextCase property at design time don’t appear until the application runs.


TDriveComboBox events

TDriveComboBox	Alphabetically	Legend

Derived from TCustomComboBox

OnChange

OnDropDown

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TDriveComboBox events

TDriveComboBox	By object	Legend

OnChange

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnDropDown

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnStartDrag


TDriveComboBox methods

TDriveComboBox	Alphabetically

In TDriveComboBox

Create

Destroy

Derived from TCustomComboBox

Clear

SelectAll

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDriveComboBox methods

TDriveComboBox	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TDriveComboBox.Create

TDriveComboBox	See also

Creates and initializes an instance of TDriveComboBox.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create a TDriveComboBox object at runtime. Drive combo boxes placed on a form at design time are created automatically.

After allocating the memory for the combo box, Create fills the combo box with all the drives on the system, and initializes the Drive property to the current drive.


TDriveComboBox.Destroy

TDriveComboBox	See also

Destroys an instance of TDriveComboBox.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the drive combo box reference is not nil, and only then calls Destroy.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomComboBox


TDataSetDesigner

Hierarchy	Properties	Methods	See also

TDataSetDesigner is the base class for all dataset designers.

Unit

db

Description

Use TDataSetDesigner when defining a design-time editor, such as the Fields editor, that enables a developer to specify the fields that belong to a dataset at design time. The dataset designer is specified as the designer property of a dataset that uses it to enable design-time specification of its structure.


TDataSetDesigner properties

TDataSetDesigner	Alphabetically 	Legend

In TDataSetDesigner

DataSet


TDataSetDesigner properties

TDataSetDesigner	By object 	Legend

DataSet


TDataSetDesigner.DataSet

TDataSetDesigner 	See also

The DataSet property provides a reference to the dataset currently being designed.

property DataSet: TDataSet;

Description

Use DataSet to access the dataset, if any, that is being designed. When the user specifies changes in the dataset designer, the changes can be made to the dataset specified by the DataSet property.


TDataSetDesigner methods

TDataSetDesigner	Alphabetically

In TDataSetDesigner

BeginDesign

Create

DataEvent

Destroy

EndDesign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDataSetDesigner methods

TDataSetDesigner	By object

AfterConstruction

BeforeDestruction

BeginDesign

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DataEvent

DefaultHandler

Destroy

Dispatch

EndDesign

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDataSetDesigner.BeginDesign

TDataSetDesigner 	See also

BeginDesgin ensures that the dataset is not active while design changes are made.

procedure BeginDesign;

Description

Call BeginDesign before changing the structure of the associated dataset. BeginDesign deactivates the dataset and disables any associated controls until the EndDesign method is called.


TDataSetDesigner.Create

TDataSetDesigner	See also

Create creates and initializes an instance of TDataSetDesigner.

constructor Create(DataSet: TDataSet);

Description

Call Create from the component editor of a specialized dataset to create an instance of the dataset designer. Create initializes the DataSet property of the dataset designer and the Designer property of the dataset.


TDataSetDesigner.DataEvent

TDataSetDesigner

DataEvent provides the interface for a method that can respond to data events.

type TDataEvent = (deFieldChange, deRecordChange, deDataSetChange, deDataSetScroll, deLayoutChange, deUpdateRecord, deUpdateState, deCheckBrowseMode, dePropertyChange, deFieldListChange, deFocusControl, deConnectChange);

procedure DataEvent(Event: TDataEvent; Info: Longint); virtual;

Description

Call DataEvent to pass information about data events to the dataset designer. The Event parameter specifies the type of event that is occurring. Use the Info parameter to specify additional information about the event. The value of the Info parameter depends on the type of data event.

The DataEvent method for TDataSetDesigner does nothing when informed of a data event. Override this method to allow the data set designer to respond to different types of events.


TDataSetDesigner.Destroy

TDataSetDesigner	See also

Destroy disposes of an instance of TDataSetDesigner.

destructor Destroy; override;

Description

Do not call the Destroy method directly.  Instead, when freeing the dataset designer from a component editor, use the Free method.  Free checks that the dataset designer reference is not nil, and only then calls Destroy.

Destroy sets the Designer property of the associated dataset to nil before destroying the instance of TDataSetDesigner.


TDataSetDesigner.EndDesign

TDataSetDesigner 	See also

EndDesign reactivates the dataset if it was active when designing began.

procedure EndDesign;

Description

Call EndDesign when changes to the dataset are complete. EndDesign re-enables all controls that use the dataset and resets the Active property of the dataset to the value it help when BeginDesign was called.


Accessibility

Read-only


Hierarchy

TObject


TDataSetField

Hierarchy	Properties	Methods	Events

TDataSetField provides access to nested datasets.

Unit

DB

Description

TDataSetField introduces a new property NestedDataSet to enable a field object to reference nested data sets. TDataSetField provides the base functionality for a TReferenceField component.


TDataSetField properties

TDataSetField	Alphabetically	Legend

In TDataSetField

Fields

IncludeObjectField

NestedDataSet

Derived from TObjectField

AsString

AsVariant

DataSet

FieldCount

FieldKind

FieldValues

HasConstraints

ObjectType

UnNamed

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSize

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldName

FieldNo

FullName

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDataSetField properties

TDataSetField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldCount

FieldKind

FieldName

FieldNo

Fields

FieldValues

FullName

HasConstraints

ImportedConstraint

IncludeObjectField

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Name

NestedDataSet

NewValue

ObjectType

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

UnNamed

ValidChars

Value

VCLComObject

Visible


TDataSetField.Fields

TDataSetField	See also

Lists the fields in the dataset that is nested with the dataset field.

property Fields: TFields;

Description

Read Fields to access the fields that make up the nested dataset.


TDataSetField.IncludeObjectField

TDataSetField	See also

Exposes the parent object field of the nested dataset.

property IncludeObjectField: Boolean;

Description

Set this property to True to access the parent object field of the nested dataset.  When this property is True, a persistent field can be created for the object field of the nested dataset through the fields editor of the nested dataset. The name of object field is displayed above the child fields in a grid associated with the nested dataset. The default value is False.


TDataSetField.NestedDataSet

TDataSetField	See also

Indicates the dataset that is nested with the dataset field.

property NestedDataSet: TDataSet;

Description

Read NestedDataSet to access the nested dataset of the dataset field.


TDataSetField events

TDataSetField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TDataSetField events

TDataSetField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TDataSetField methods

TDataSetField	Alphabetically

In TDataSetField

Create

Derived from TObjectField

Destroy

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataSetField methods

TDataSetField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TDataSetField.Create

TDataSetField	see also

Creates and initializes a TDataSetField instance.

constructor Create(AOwner: TComponent); override;

Description

Call create to create and initialize an instance of TDataSetField. Create calls the inherited Create method of TField and then sets the DataType to ftDataSet. Dataset objects also call field constructors automatically to create dynamic field components.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TObjectField


TDesignerSelectionList

Hierarchy	Properties	Methods	See also

TDesignerSelectionList maintains a list of persistent objects.

Unit

Dsgnintf

Description

The form designer and its property editors and component editors use TDesignerSelectionList to manage lists of persistent objects in the IDE. For example, the form designer uses a TDesignerSelectionList to represent the set of components currently selected in the form designer.

TDesignerSelectionList implements the IDesignerSelections interface. TDesignerSelectionList introduces properties and methods to

Add objects to the list.

Compare two lists of objects.

Access individual objects in the list.

Note:	TDesignerSelectionList does not allow objects to be rearranged or deleted from the list once they are added. To maintain a list of objects that allows the objects to be rearranged or deleted, use the TList object, or the Objects property of a descendant of TStrings.

Interfaces supported

IDesignerSelections, IComponentList


TDesignerSelectionList properties

TDesignerSelectionList	Alphabetically	Legend

In TDesignerSelectionList

Count

Items

Derived from TInterfacedObject

RefCount


TDesignerSelectionList properties

TDesignerSelectionList	By object	Legend

Count

Items

RefCount


TDesignerSelectionList.Count

TDesignerSelectionList	See also

Indicates the number of entries in the component list.

property Count: Integer;

Description

Read Count to determine the number of entries in the Items array.  Use Count as an upper limit when iterating over all the components in the list.

Count is a read-only property.  To increase the number of components in the list, use the Add method.  Components can not be removed from the list once they have been added.


TDesignerSelectionList.Items

TDesignerSelectionList	See also

Provides indexed access to the objects in the list.

property Items[Index: Integer]: TPersistent; default;

Description

Use Items to access a specific object in the array. The Index parameter indicates the index of the object, where 0 is the index of the first object, 1 is the index of the second object, and so on. Use Items with the Count property to iterate through all of the objects in the list.

To add objects to the Items array, use the Add method.  Once objects have been added, they can’t be deleted or rearranged.


TDesignerSelectionList methods

TDesignerSelectionList	Alphabetically

In TDesignerSelectionList

Add

Create

Destroy

Equals

Derived from TInterfacedObject

AfterConstruction

BeforeDestruction

NewInstance

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

SafeCallException


TDesignerSelectionList methods

TDesignerSelectionList	By object

Add

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

Equals

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TDesignerSelectionList.Add

TDesignerSelectionList	See also

Adds a new object to the end of the list.

function Add(Item: TPersistent): Integer;

Description

Call Add to insert a new object at the end of the Items array. Add returns the index of the new item, where the first item in the list has an index of 0. Add increases the value of Count to reflect the addition of a new object.


TDesignerSelectionList.Create

TDesignerSelectionList	See also

Creates an instance of TDesignerSelectionList.

constructor Create;

Description

Call Create to create an empty component list. After creating the list, use the Add method to add objects to the list.


TDesignerSelectionList.Destroy

TDesignerSelectionList	See also

Destroys an instance of TDesignerSelectionList.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the TDesignerSelectionList reference is not nil, and only then calls Destroy.


TDesignerSelectionList.Equals

TDesignerSelectionList	See also

Indicates whether the component list is identical to another component list.

function Equals(List: TDesignerSelectionList): Boolean;

Description

Call Equals to determine whether the component list specified by the List parameter contains exactly the same objects in the same order as this component list. Equals returns False if the other list

Contains objects not in the Items array.

Contains a subset of the objects in the Items array.

Contains the same objects but in a different order.


Accessibility

Read-only


Hierarchy

TObject

TInterfacedObject


TDataSetUpdateObject

Hierarchy	Properties	Methods	See also

TDataSetUpdateObject is the abstract base class for update objects used to update otherwise unupdateable queries or stored procedures in applications that cache updates.

Unit

dbtables

Description

Use TDataSetUpdateObject as a base class when creating customized update objects that can be used to update BDE datasets.  TDataSetUpdateObject declares a single property and some abstract methods, but provides no implementation details: descendant objects must provide these.


TDataSetUpdateObject properties

TDataSetUpdateObject	Alphabetically	Legend

In TDataSetUpdateObject

DataSet

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TDataSetUpdateObject properties

TDataSetUpdateObject	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DataSet

DesignInfo

Name

Owner

Tag

VCLComObject


TDataSetUpdateObject.DataSet

TDataSetUpdateObject	See also

Dataset is the dataset whose records are updated by the update object.

property DataSet: TBDEDataSet;

Description

Descendants of TDataSetUpdateObject must implement the abstract GetDataSet and SetDataSet methods to implement the DataSet property.


TDataSetUpdateObject methods

TDataSetUpdateObject	Alphabetically 	Legend

In TDataSetUpdateObject

Apply

GetDataSet

SetDataSet

Derived from TComponent

Create

Destroy

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataSetUpdateObject methods

TDataSetUpdateObject	By object 	Legend

AfterConstruction

Apply

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetDataSet

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

SetDataSet

UpdateAction


TDataSetUpdateObject.Apply

TDataSetUpdateObject	See also

Apply applies changes to the dataset specified by the DataSet property.

procedure Apply(UpdateKind: TUpdateKind); virtual; abstract;

Description

Descendants of TDataSetUpdateObject must implement the abstract Apply method. This method is intended to perform the updates specified by the update object. Descendants must introduce properties to describe the details of the updates that should be performed. The UpdateKind parameter indicates whether the update object should modify existing records, insert new records, or delete existing records.


TDataSetUpdateObject.GetDataSet

TDataSetUpdateObject	See also

GetDataSet returns the value of the DataSet property.

function GetDataSet: TBDEDataSet; virtual; abstract;

Description

Override GetDataSet, along with the SetDataSet method, to provide an implementation of the DataSet property. The DataSet property should represent the dataset whose records are updated using the update object.


TDataSetUpdateObject.SetDataSet

 TDataSetUpdateObject	See also

SetDataSet sets the value of the DataSet property.

procedure SetDataSet(ADataSet: TBDEDataSet); virtual; abstract;

Description

Override SetDataSet, along with the GetDataSet method, to provide an implementation of the DataSet property. The DataSet property should represent the dataset whose records are updated using the update object.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent


 TDateTimePicker

Hierarchy	Properties	Methods	Events	See also

TDateTimePicker displays a list box for entering dates or times.

Unit

comctrls

Description

TDateTimePicker is a visual component designed specifically for entering dates or times. In dmComboBox date mode, it resembles a list box or combo box, except that the drop-down list is replaced with a calendar illustration; users can select a date from the calendar. Dates or times can also be selected by scrolling with Up and Down arrows and by typing.

Date-time picker ignores the BiDiMode setting for right-to-left reading, displaying dates according to the system locale.


TDateTimePicker properties

TDateTimePicker	Alphabetically	Legend

In TDateTimePicker

CalAlignment

Checked

DateFormat

DateMode

DroppedDown

Kind

ParseInput

ShowCheckbox

Time

Derived from TCommonCalendar

CalColors

Date

DateTime

MaxDate

MinDate

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TDateTimePicker properties

TDateTimePicker	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

CalAlignment

CalColors

Checked

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

Date

DateFormat

DateMode

DateTime

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

DroppedDown

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

ImeMode

ImeName

Kind

Left

LRDockWidth

MaxDate

MinDate

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

ParentWindow

ParseInput

PopupMenu

ShowCheckbox

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Time

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TDateTimePicker.CalAlignment

TDateTimePicker	See also

Determines the alignment of the drop-down calendar.

type TDTCalAlignment = (dtaLeft, dtaRight);

property CalAlignment: TDTCalAlignment;

Description

Set CalAlignment to dtaLeft or dtaRight to align the drop-down calendar on the left or right side of the component. This property is applicable only if Kind = dtkDate and DateMode = dmComboBox, and makes little difference except when the TDateTimePicker component is larger than the drop-down calendar.


TDateTimePicker.Checked

TDateTimePicker	See also

Indicates whether the check box next to the date or time is selected.

property Checked: Boolean;

Description

Checked returns True if the check box in the TDateTimePicker component is selected. Setting Checked to True at design time makes the check box appear selected by default.


TDateTimePicker.DateFormat

TDateTimePicker	See also

Specifies format in which the date is presented.

type TDTDateFormat = (dfShort, dfLong);

property DateFormat: TDTDateFormat;

Description

If DateFormat is set to dfShort, the date appears like this: 3/21/97. If DateFormat is set to dfLong, the date appears like this: Friday, March 21, 1997. (Applies only when Kind = dtkDate.)


TDateTimePicker.DateMode

TDateTimePicker	See also

Determines the method of date selection used by the component.

type TDTDateMode = (dmComboBox, dmUpDown);

property DateMode: TDTDateMode;

Description

If DateMode is dmComboBox, the component has a drop-down calendar illustration from which the user can select a date. If DateMode is dmUpDown, the component has Up/Down arrows with which the user can adjust the date. (Applies only when Kind = dtkDate.)


TDateTimePicker.DateTime

TDateTimePicker	See also

Indicates the date and time.

property DateTime: TDateTime;

Description

DateTime represents both a date and a time. If the Kind property is switched at runtime, TDateTimePicker continues to track both the last date entered and the last time entered. If the Kind property never changes, DateTime can be set programmatically (for example, by reading system date and time information) to indicate both a date and a time.


TDateTimePicker.DroppedDown

TDateTimePicker

Specifies whether the date time picker control is dropped down.

property DroppedDown: Boolean;

Description

Use DroppedDown to get or set whether the date time picker control is dropped down.


TDateTimePicker.Kind

TDateTimePicker	See also

Determines whether the component is a date selector or a time selector.

type TDateTimeKind = (dtkDate, dtkTime);

property Kind: TDateTimeKind;

Description

If Kind is dtkDate, the component is used to select a date. If Kind is dtkTime, the component is used to select a time.


TDateTimePicker.MaxDate

TDateTimePicker	See also

Determines the latest allowable date that can be entered.

type TDate = type TDateTime;

property MaxDate: TDate;

Description

Assign a value to MaxDate to limit the range of dates that the user can enter. Out-of-range dates raise the EDateTimeError exception. (Applies only when Kind = dtkDate.)


TDateTimePicker.MinDate

TDateTimePicker	See also

Determines the earliest allowable date that can be entered.

type TDate = type TDateTime;

property MinDate: TDate;

Description

Assign a value to MinDate to limit the range of dates that the user can enter. Out-of-range dates raise the EDateTimeError exception. (Applies only when Kind = dtkDate.)


TDateTimePicker.ParseInput

TDateTimePicker	See also

Enables the OnUserInput event.

property ParseInput: Boolean;

Description

If ParseInput is True, the OnUserInput event occurs whenever the user types into the component’s edit box.


TDateTimePicker.ShowCheckbox

TDateTimePicker	See also

Displays a check box next to the date or time.

property ShowCheckbox: Boolean;

Description

Set ShowCheckbox to True to display a check box in the TDateTimePicker component.


TDateTimePicker.Time

TDateTimePicker	See also

Indicates the time entered by the user.

type TTime = type TDateTime;

property Time: TTime;

Description

Time represents the time entered by the user. Set Time in program code or in the Object Inspector to determine which time is selected by default. (Applies only when Kind = dtkTime.)


TDateTimePicker events

TDateTimePicker	Alphabetically	Legend

In TDateTimePicker

OnChange

OnCloseUp

OnDropDown

OnUserInput

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnStartDock

OnStartDrag


TDateTimePicker events

TDateTimePicker	By object	Legend

OnChange

OnClick

OnCloseUp

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnDropDown

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnStartDock

OnStartDrag

OnUserInput


TDateTimePicker.OnChange

TDateTimePicker	See also

Occurs when a date or time is entered.

property OnChange: TNotifyEvent;

Description

Write an OnChange event handler to take specific action whenever the date or time entered in the component changes.


TDateTimePicker.OnCloseUp

TDateTimePicker	See also

Occurs when the drop-down calendar closes.

property OnCloseUp: TNotifyEvent;

Description

Write an OnCloseUp event handler to implement special processing that needs to occur only when the drop-down calendar closes.


TDateTimePicker.OnDropDown

TDateTimePicker	See also

Occurs when the user opens the drop-down calendar by clicking the arrow at the right of the control.

property OnDropDown: TNotifyEvent;

Description

Write an OnDropDown event handler to implement special processing that needs to occur only when the drop-down calendar is opened.


TDateTimePicker.OnUserInput

TDateTimePicker	See also

Occurs when the user types directly into the component’s edit box.

type TDTParseInputEvent = procedure(Sender: TObject; const UserString: string; var DateAndTime: TDateTime; var AllowChange: Boolean) of object;

property OnUserInput: TDTParseInputEvent;

Description

This event occurs only if ParseInput is set to True. Write an OnUserInput event handler implement special processing that needs to occur when the user types directly into the TDateTimePicker (rather than selecting with the drop-down calendar or scroll arrows). UserString is the string that the user types, and DateAndTime represents the value of the Date or Time property.


TDateTimePicker methods

TDateTimePicker	Alphabetically

In TDateTimePicker

Create

Derived from TCommonCalendar

BoldDays

Destroy

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDateTimePicker methods

TDateTimePicker	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BoldDays

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TDateTimePicker.Create

TDateTimePicker	See also

Creates and initializes a TDateTimePicker instance.

constructor Create(AOwner: TComponent); override;

Description

Create calls the inherited constructor method and initializes the Date and Time properties to the current date and time. It also sets the following ControlStyle flags: csCaptureMouse, csOpaque, csClickEvents, csDoubleClicks, and csFixedHeight.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCommonCalendar


EAbort

Hierarchy	Properties	Methods	See also

EAbort is the exception class for errors that should not display an error message dialog box.

Unit

sysutils

Description

Call EAbort to raise an exception without displaying an error message in a dialog box. If applications do not trap such “silent” exceptions, the EAbort exception is passed to the application’s HandleException method.

The easiest way to raise an EAbort exception is to call the Abort procedure.


EAbort properties

EAbort	Alphabetically

Derived from Exception

HelpContext

Message


EAbort properties

EAbort	By object

HelpContext

Message


EAbort methods

EAbort	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EAbort methods

EAbort	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EAbstractError

Hierarchy	Properties	Methods

EAbstractError is the exception class for attempts to call an abstract method.

Unit

sysutils

Description

EAbstractError is raised when an application tries to call an abstract method. It is also raised at design time when a component with an abstract method is placed on a form.

Abstract methods are declared with the abstract directive and must be overriden in descendant classes before an instance object can be created.


EAbstractError properties

EAbstractError	Alphabetically

Derived from Exception

HelpContext

Message


EAbstractError properties

EAbstractError	By object

HelpContext

Message


EAbstractError methods

EAbstractError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelpException_CreateResHelp>Main

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EAbstractError methods

EAbstractError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EAccessViolation

Hierarchy	Properties	Methods	See also

EAccessViolation is the exception class for invalid memory access errors.

Unit

sysutils

Description

EAccessViolation is raised when an application

•	Dereferences a nil pointer.

•	Writes to a code page.

•	Attempts to access a memory address for which there is no virtual memory allocated to the application.

As a descendant of EExternal, EAccessViolation saves the Windows exception record (if there is one) in its ExceptionRecord data structure.

Note

Applications should not raise EAccessViolation directly, but should instead rely on the runtime to raise this exception.


EAccessViolation properties

EAccessViolation	Alphabetically

Derived from Exception

HelpContext

Message


EAccessViolation properties

EAccessViolation	By object

HelpContext

Message


EAccessViolation methods

EAccessViolation	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EAccessViolation methods

EAccessViolation	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EExternal


EAssertionFailed

Hierarchy	Properties	Methods	See also

EAssertionFailed is the exception class for Assert procedures performed on Boolean expressions that return False.

Unit

sysutils

Description

EAssertionFailed is raised by the Assert procedure when an application passes it a Boolean expression whose value is False. The exception is raised only if the $ASSERTIONS ON compiler directive is in effect.


EAssertionFailed properties

EAssertionFailed	Alphabetically

Derived from Exception

HelpContext

Message


EAssertionFailed properties

EAssertionFailed	By object

HelpContext

Message


EAssertionFailed methods

EAssertionFailed	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EAssertionFailed methods

EAssertionFailed	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EBitsError

Hierarchy	Properties	Methods	See also

EBitsError is the exception class for invalid attempts to access an array of Boolean values.

Unit

classes

Description

EBitsError is raised when an application attempts to access a Boolean array (an instance of the TBits class) using an index value that is too large or too small. This can occur when the value of the Index parameter of the Bits property is

•	Less than zero.

•	Equal to or greater than the Size property.


EBitsError properties

EBitsError	Alphabetically

Derived from Exception

HelpContext

Message


EBitsError properties

EBitsError	By object

HelpContext

Message


EBitsError methods

EBitsError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EBitsError methods

EBitsError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EClassNotFound

Hierarchy	Properties 	Methods 	See also

EClassNotFound is the exception class for the failure to find a specified component when reading from a stream.

Unit

classes

Description

EClassNotFound is raised if a class name that has not been linked into the current application is encountered when reading a component from a stream. This can happen when a component exists on a form, but has been removed from the type declaration.


EClassNotFound properties

EClassNotFound	Alphabetically

Derived from Exception

HelpContext

Message


EClassNotFound properties

EClassNotFound	By object

HelpContext

Message


EClassNotFound methods

EClassNotFound	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelpException_CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EClassNotFound methods

EClassNotFound	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EStreamError

EFilerError


EConvertError

Hierarchy	Properties	Methods	See also

EConvertError is the exception class for string and object conversion errors.

Unit

sysutils

Description

EConvertError is raised when

An application makes an unsuccessful attempt to convert an integer, float, date, or time to a string, or to convert a string to one of these other types.

An application passes an invalid argument to a formatting routine.

An application attempts to assign one type of component derived from TPersistent to another component derived from TPersistent when such an assignment is not possible. For example, EConvertError is raised by the attempted assignment of a TButton control to a TEdit control.

In the example below, an EConvertError exception is raised on the attempt to convert a String to a TDateTime and the date in the String is invalid. The type of exception and the error message are displayed.

const

  CRLF = #13 + #10;

var

  TempDate: TDateTime;

begin

  try

    TempDate := StrToDateTime('99/99/1998');

  except

    on E: EConvertError do

      ShowMessage(E.ClassName + CRLF + E.Message);

end;


EConvertError properties

EConvertError	Alphabetically

Derived from Exception

HelpContext

Message


EConvertError properties

EConvertError	By object

HelpContext

Message


EConvertError methods

EConvertError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelpException_CreateResHelp>Main

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstanceT

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EConvertError methods

EConvertError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


ECommonCalendarError

Hierarchy	Properties	Methods	See also

ECommonCalendarError is the exception class for invalid entries in a TCommonCalendar component.

Unit

comctrls

Description

Exceptions derived from ECommonCalendarError are raised by TCommonCalendar descendants when an invalid date or time is entered.


ECommonCalendarError properties

ECommonCalendarError	Alphabetically

Derived from Exception

HelpContext

Message


ECommonCalendarError properties

ECommonCalendarError	By object

HelpContext

Message


ECommonCalendarError methods

ECommonCalendarError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


ECommonCalendarError methods

ECommonCalendarError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EComponentError

Hierarchy	Properties	Methods	See also

EComponentError is the exception class for registering and renaming components.

Unit

classes

Description

EComponentError is raised when:

•	Delphi cannot register a component.

•	An application cannot rename a component.

•	A request is made to retrieve the COM interface of a component that doesn’t support COM.

To register a component, write a procedure called “Register” in the interface section of the component’s unit file. This procedure must call RegisterComponents for each component you want to register.

Failure to rename a component occurs when an application tries to rename the component at runtime, and the new name is the same as the name of another component or is not a valid Object Pascal identifier.


EComponentError properties

EComponentError	Alphabetically

Derived from Exception

HelpContext

Message


EComponentError properties

EComponentError	By object

HelpContext

Message


EComponentError methods

EComponentError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelpException_CreateResHelp>Main

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EComponentError methods

EComponentError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EControlC

Hierarchy	Properties	Methods	See also

EControlC is the exception class for Ctrl+C key presses in console applications.

Unit

sysutils

Description

EControlC is raised when a user presses Ctrl+C to terminate a console application.

As a descendant of EExternal, EControlC saves the Windows exception record (if there is one) in its ExceptionRecord data structure.


EControlC properties

EControlC	Alphabetically

Derived from Exception

HelpContext

Message


EControlC properties

EControlC	By object

HelpContext

Message


EControlC methods

EControlC	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EControlC methods

EControlC	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterfaceEntry

GetInterfaceTable

GetInterface

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EExternal


EDatabaseError

Hierarchy	Properties	Methods	See also

EDatabaseError is the exception class for database errors.

Unit

db

Description

EDatabaseError is raised when a component detects a database error. Use EDatabaseError in an exception handling block or to create a database exception.


EDatabaseError properties

EDatabaseError	Alphabetically

Derived from Exception

HelpContext

Message


EDatabaseError properties

EDatabaseError	By object

HelpContext

Message


EDatabaseError methods

EDatabaseError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelpException_CreateResHelp>Main

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EDatabaseError methods

EDatabaseError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EDBEditError

Hierarchy	Properties	Methods	See also

EDBEditError is the exception class for data that are incompatible with a specified mask.

Unit

mask

Description

EDBEditError is raised when an application attempts to use data that are incompatible with the mask specified for a field.

A mask restricts the data that can be put into an edit box or data field. Use the EditMask property to specify a mask.


EDBEditError properties

EDBEditError	Alphabetically

Derived from Exception

HelpContext

Message


EDBEditError properties

EDBEditError	By object

Message

HelpContext


EDBEditError methods

EDBEditError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelpException_CreateResHelp>Main

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EDBEditError methods

EDBEditError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EDBEngineError

Hierarchy	Properties	Methods	See also

EDBEngineError is the exception class for Borland Database Engine errors.

Unit

dbtables

Description

EDBEngineError is raised whenever a BDE error occurs. Its Errors property contains TDBError objects.

When EDBEngineError exceptions are raised at design time, they appear in a special dialog (TDbEngineErrorDlg) that displays the complete stack of BDE errors. At runtime, unhandled EDBEngineError exceptions generate the same message box as other exceptions.


EDBEngineError properties

EDBEngineError	Alphabetically	Legend

In EDBEngineError

ErrorCount

Errors

Derived from Exception

HelpContext

Message


EDBEngineError properties

EDBEngineError	By object	Legend

ErrorCount

Errors

HelpContext

Message


EDBEngineError.ErrorCount

EDBEngineError 	See also

Indicates the total number of errors contained in the Errors property.

property ErrorCount: Integer;

Description

Use ErrorCount as an upper bound when iterating through the errors in the error stack.


EDBEngineError.Errors

EDBEngineError	See also

Lists the entire Borland Database Engine error stack.

property Errors[Index: Integer]: TDBError;

Description

Errors is an index of TDBError objects. The first error has an index value of 0.


EDBEngineError methods

EDBEngineError	Alphabetically

In EDBEngineError

Create

Destroy

Derived from Exception

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EDBEngineError methods

EDBEngineError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EDBEngineError.Create

EDBEngineError	See also

Creates an instance of EDBEngineError using a specified BDE error code.

constructor Create(ErrorCode: DBIResult);

Description

Create calls the Create method inherited from Exception (using an empty string) to construct an initialized instance of EDBEngineError. It then creates a TDBError instance for each error in the BDE error stack and builds a single string containing all the error messages. If the BDE is uninitialized when Create is called, the method generates only one generic error message and one TDBError instance.


EDBEngineError.Destroy

EDBEngineError	See also

Disposes of the EDBEngineError instance and each TDBError instance.

destructor Destroy; override;

Description

Destroy first disposes of each TDBError instance referenced in the Errors property, then calls the inherited desctructor to dispose of the EDBEngineError instance itself.


Accessibility

Read-only


Hierarchy

TObject

Exception

EDatabaseError


 TEdit

Hierarchy	Properties	Methods	Events	See also

TEdit is a wrapper for a Windows single-line edit control.

Unit

stdctrls

Description

Use a TEdit object to put a standard Windows edit control on a form. Edit controls are used to retrieve text that users type. Edit controls can also display text to the user.

When only displaying text to the user, choose an edit control to allow users to select text and copy it to the Clipboard. Choose a label object if the selection capabilities of an edit control are not needed.

TEdit implements the generic behavior introduced in TCustomEdit. TEdit publishes many of the properties inherited from TCustomEdit, but does not introduce any new behavior. For specialized edit controls, use other descendant classes of TCustomEdit or derive from it.


TEdit properties

TEdit	Alphabetically	Legend

Derived from TCustomEdit

AutoSelect

AutoSize

BorderStyle

CanUndo

CharCase

HideSelection

MaxLength

Modified

OEMConvert

PasswordChar

ReadOnly

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

AutoSelect

AutoSize

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Text

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TEdit properties

TEdit	By object	Legend

Action

Align

Anchors

AutoSelect

AutoSize

BiDiMode

BorderStyle

BoundsRect

Brush

CanUndo

CharCase

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

HideSelection

Hint

HostDockSite

ImeMode

ImeName

Left

LRDockWidth

MaxLength

Modified

Name

OEMConvert

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PasswordChar

PopupMenu

ReadOnly

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Text

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TEdit events

TEdit	Alphabetically	Legend

Derived from TCustomEdit

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TEdit events

TEdit	By object	Legend

OnChange

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TEdit methods

TEdit	Alphabetically

Derived from TCustomEdit

Clear

ClearSelection

ClearUndo

CopyToClipboard

Create

CutToClipboard

DefaultHandler

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Undo

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TEdit methods

TEdit	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClearSelection

ClearUndo

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

Create

CreateParented

CreateParentedControl

CutToClipboard

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

Undo

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit


EDivByZero

Hierarchy	Properties	Methods	See also

EDivByZero is the exception class for integer divide-by-zero errors.

Unit

sysutils

Description

EDivByZero is raised when an application tries to divide an integer by zero. In practice, this error is easy to trap and correct in a try...except block.

As a descendant of EExternal, EDivByZero saves the Windows exception record (if there is one) in its ExceptionRecord data structure.

Note

Floating-point divide-by-zero errors raise the EZeroDivide exception.


EDivByZero properties

EDivByZero	Alphabetically

Derived from Exception

HelpContext

Message


EDivByZero properties

EDivByZero	By object

HelpContext

Message


EDivByZero methods

EDivByZero	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelpException_CreateResHelp>Main

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EDivByZero methods

EDivByZero	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EExternal

EIntError


EDateTimeError

Hierarchy	Properties	Methods	See also

EDateTimeError is the exception class for invalid date and time entries.

Unit

comctrls

Description

EDateTimeError is raised by TDateTimePicker when an invalid date or time is entered.


EDateTimeError properties

EDateTimeError	Alphabetically

Derived from Exception

HelpContext

Message


EDateTimeError properties

EDateTimeError	By object

HelpContext

Message


EDateTimeError methods

EDateTimeError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EDateTimeError methods

EDateTimeError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

ECommonCalendarError


EExternalException

Hierarchy	Properties	Methods	See also

EExternalException is the exception class for invalid exception codes.

Unit

sysutils

Description

EExternalException is raised when Delphi detects an unrecognized exception code. Delphi recognizes the following exception codes:

•	STATUS_INTEGER_DIVIDE_BY_ZERO

•	STATUS_ARRAY_BOUNDS_EXCEEDED

•	STATUS_FLOAT_OVERFLOW

•	STATUS_FLOAT_INEXACT_RESULT

•	STATUS_FLOAT_INVALID_OPERATION

•	STATUS_FLOAT_STACK_CHECK

•	STATUS_FLOAT_DIVIDE_BY_ZERO

•	STATUS_INTEGER_OVERFLOW

•	STATUS_FLOAT_UNDERFLOW

•	STATUS_FLOAT_DENORMAL_OPERAND

•	STATUS_ACCESS_VIOLATION

•	STATUS_PRIVILEGED_INSTRUCTION

•	STATUS_CONTROL_C_EXIT

•	STATUS_STACK_OVERFLOW

Any exception code that is not on the list above raises an EExternalException.

As a descendant of EExternal, EExternalException saves the Windows exception record (if there is one) in its ExceptionRecord data structure.


EExternalException properties

EExternalException	Alphabetically

Derived from Exception

HelpContext

Message


EExternalException properties

EExternalException	By object

HelpContext

Message


EExternalException methods

EExternalException	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EExternalException methods

EExternalException	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EExternal


EExternal

Hierarchy	Properties	Methods	See also

EExternal is the exception class that captures Windows exception records.

Unit

sysutils

Description

EExternal is the ancestor of all exception classes that can represent Win32 exception codes. EExternal has a public data structure, ExceptionRecord:

PExceptionRecord = ^TExceptionRecord;

TExceptionRecord =

record

  ExceptionCode        : Longint;

  ExceptionFlags       : Longint;

  OuterException       : PExceptionRecord;

  ExceptionAddress     : Pointer;

  NumberParameters     : Longint;

  case {IsOsException:} Boolean of

  True:  (ExceptionInformation : array [0..14] of Longint);

  False: (ExceptAddr: Pointer; ExceptObject: Pointer);

end;

ExceptionRecord: PExceptionRecord;

The fields in ExceptionRecord correspond to the Windows EXCEPTION_RECORD structure. When the exception is not raised originally by the operating system, ExceptionRecord is empty.


EExternal properties

EExternal	Alphabetically

Derived from Exception

HelpContext

Message


EExternal properties

EExternal	By object

HelpContext

Message


EExternal methods

EExternal	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EExternal methods

EExternal	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EFCreateError

Hierarchy	Properties	Methods	See also

EFCreateError is the exception class for streaming file-creation errors.

Unit

classes

Description

EFCreateError is raised when an application unsuccessfully attempts to create a file. This can occur, for example, if a user specifies an invalid file name, or specifies the name of an existing file that cannot be overwritten because the user lacks appropriate access permission.


EFCreateError properties

EFCreateError	Alphabetically

Derived from Exception

HelpContext

Message


EFCreateError properties

EFCreateError	By object

HelpContext

Message


EFCreateError methods

EFCreateError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EFCreateError methods

EFCreateError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EStreamError


EFilerError

Hierarchy	Properties	Methods	See also

EFilerError is the exception class for file stream errors.

Unit

classes

Description

EFilerError is raised when an attempt is made to register the same class twice.

EFilerError is also the immediate ancestor of the following exceptions that occur when reading or writing streams:

Exception	Description

EReadError	Cannot read the specified number of bytes

EWriteError	Cannot write the specified number of bytes

EClassNotFound	Component is not linked to application

EInvalidImage	Cannot read a resource file


EFilerError properties

EFilerError	Alphabetically

Derived from Exception

HelpContext

Message


EFilerError properties

EFilerError	By object

HelpContext

Message


EFilerError methods

EFilerError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EFilerError methods

EFilerError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EStreamError


EFOpenError

Hierarchy	Properties	Methods	See also

EFOpenError is the exception class for file-opening errors during streaming.

Unit

classes

Description

EFOpenError is raised when an application cannot open a specified file. This can occur, for example, because the file doesn’t exist or is not in the directory where the application is searching for it.


EFOpenError properties

EFOpenError	Alphabetically

Derived from Exception

HelpContext

Message


EFOpenError properties

EFOpenError	By object

HelpContext

Message


EFOpenError methods

EFOpenError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EFOpenError methods

EFOpenError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EStreamError


EHeapException

Hierarchy	Properties	Methods	See also

EHeapException is the exception class for errors related to heap-allocated memory.

Unit

sysutils

Description

EHeapException’s descendants—EOutOfMemory and EInvalidPointer—are used to handle failed allocations of dynamic memory and invalid pointer operations.

Note

Memory for these exceptions is preallocated whenever an application starts and remains allocated as long as the application is running. Never raise EHeapException or its descendants directly.


EHeapException properties

EHeapException	Alphabetically

Derived from Exception

HelpContext

Message


EHeapException properties

EHeapException	By object

HelpContext

Message


EHeapException methods

EHeapException	Alphabetically

In EHeapException

FreeInstance

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EHeapException methods

EHeapException	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EHeapException.FreeInstance
EHeapException::FreeInstance

EHeapException

Deallocates the memory occupied by an EHeapException instance.

procedure FreeInstance; override;

Description

FreeInstance is called internally when a Delphi application shuts down. Do not call this method directly or attempt to create or destroy instances of EHeapException.


Hierarchy

TObject

Exception


EIntfCastError

Hierarchy	Properties	Methods	See also

EIntfCastError is the exception class for interface casting errors.

Unit

sysutils

Description

EIntfCastError is raised when an application tries to typecast an interface illegally using the as operator.


EIntfCastError properties

EIntfCastError	Alphabetically

Derived from Exception

HelpContext

Message


EIntfCastError properties

EIntfCastError	By object

HelpContext

Message


EIntfCastError methods

EIntfCastError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EIntfCastError methods

EIntfCastError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EInOutError

Hierarchy	Properties	Methods	See also

EInOutError is the exception class for file input/output errors.

Unit

sysutils

Description

EInOutError is raised when an operating-system file input/output error occurs, provided the $I+ directive is in effect. The resulting error code is returned in the local ErrorCode variable, which can take the following values.

Error code	Meaning

2	File not found.

3	Invalid file name.

4	Too many open files.

5	Access denied.

100	EOF.

101	Disk full.

106	Invalid input.

Note

If an I/O error occurs when an application is in the $I- state, the application must call the IOResult function to clear the error.


EInOutError properties

EInOutError	Alphabetically

Derived from Exception

HelpContext

Message


EInOutError properties

EInOutError	By object

HelpContext

Message


EInOutError methods

EInOutError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EInOutError methods

EInOutError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EIntError

Hierarchy	Properties	Methods	See also

EIntError is the base class for integer math error exceptions.

Unit

sysutils

Description

EIntError is a generic integer math exception. Although it is never raised in the runtime library, it is the base from which other integer math exceptions descend. These are the integer math exceptions:

Exception	Meaning

EDivByZero	An attempt was made to divide by zero

ERangeError	Number or expression out of range

EIntOverflow	Integer operation overflowed

As descendants of EExternal, these classes save the Windows exception record (if there is one) in their ExceptionRecord data structure.


EIntError properties

EIntError	Alphabetically

Derived from Exception

HelpContext

Message


EIntError properties

EIntError	By object

HelpContext

Message


EIntError methods

EIntError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EIntError methods

EIntError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EExternal


EIntOverflow

Hierarchy	Properties	Methods	See also

EIntOverflow is the exception class for integer calculations whose results are too large to fit in the allocated register.

Unit

sysutils

Description

EIntOverflow is an integer math exception. It occurs when a calculated result is too large to fit in the register allocated for it and data is therefore lost.

EIntOverflow is raised only if overflow checking is turned on. To turn on overflow checking, include the $Q+ directive in project source code, or select Project|Options, choose the Compiler tab, and check the Overflow-checking option in the dialog box.

As a descendant of EExternal, EIntOverflow saves the Windows exception record (if there is one) in its ExceptionRecord data structure.

Note:

Overflow is determined by the size of the machine register and does not occur consistently in 16- and 32-bit versions of Delphi. A calculation which would overflow in a 16-bit program may not overflow in a 32-bit program; in 32-bit programs a range-check exception may occur instead. If overflow occurs before assignment, an EIntOverflow exception is raised; but if the error is checked at the point of assignment, ERangeError is raised.

Floating-point register overflows raise the EOverflow exception.


EIntOverflow properties

EIntOverflow	Alphabetically

Derived from Exception

HelpContext

Message


EIntOverflow properties

EIntOverflow	By object

HelpContext

Message


EIntOverflow methods

EIntOverflow	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EIntOverflow methods

EIntOverflow	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EExternal

EIntError


EInvalidOp

Hierarchy	Properties	Methods	See also

EInvalidOp is the exception class for undefined floating-point operations.

Unit

sysutils

Description

EInvalidOp is raised when the processor encounters an undefined instruction, invalid operation, or floating-point processor stack overflow.

As a descendant of EExternal, EInvalidOp saves the Windows exception record (if there is one) in its ExceptionRecord data structure.

Note:	Do not confuse this object with EInvalidOperation.


EInvalidOp properties

EInvalidOp	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidOp properties

EInvalidOp	By object

HelpContext

Message


EInvalidOp methods

EInvalidOp	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EInvalidOp methods

EInvalidOp	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EExternal

EMathError


EInvalidCast

Hierarchy	Properties	Methods	See also

EInvalidCast is the exception class for typecasting errors.

Unit

sysutils

Description

EInvalidCast is raised when an application tries to typecast an object illegally using the as operator. For example, the following expression generates an EInvalidTypecast exception if AnObject is of a type incompatible with TObjectType:

AnObject as TObjectType


EInvalidCast properties

EInvalidCast	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidCast properties

EInvalidCast	By object

HelpContext

Message


EInvalidCast methods

EInvalidCast	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EInvalidCast methods

EInvalidCast	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EInvalidGridOperation

Hierarchy	Properties	Methods	See also

EInvalidGridOperation is the exception class for illegal grid operations.

Unit

grids

Description

EInvalidGridOperation is raised when an application attempts an illegal operation on a grid. For example, EInvalidGridOperation is raised if an application tries to access a cell or column that does not exist within the grid.


EInvalidGridOperation properties

EInvalidGridOperation	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidGridOperation properties

EInvalidGridOperation	By object

Message

HelpContext


EInvalidGridOperation methods

EInvalidGridOperation	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EInvalidGridOperation methods

EInvalidGridOperation	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EInvalidGraphicOperation

Hierarchy	Properties	Methods	See also

EInvalidGraphicOperation is the exception class for illegal operations on graphics.

Unit

graphics

Description

EInvalidGraphicOperation is raised when an illegal operation is attempted on a graphic. For example, an EInvalidGraphicOperation exception is raised when an application attempts to resize an icon or copy an icon to the Clipboard.


EInvalidGraphicOperation properties

EInvalidGraphicOperation	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidGraphicOperation properties

EInvalidGraphicOperation	By object

HelpContext

Message


EInvalidGraphicOperation methods

EInvalidGraphicOperation	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EInvalidGraphicOperation methods

EInvalidGraphicOperation	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EInvalidGraphic

Hierarchy	Properties	Methods

EInvalidGraphic is the exception class for unrecognized graphic files.

Unit

graphics

Description

EInvalidGraphic is raised when

•	An application attempts to load a file that is not a valid bitmap, icon, metafile, or user-defined graphic type into a picture.

•	An application attempts to load a file with an unrecognized extension.

•	An image does not match the format specified in a call to LoadFromClipboardFormat or SaveToClipboardFormat.


EInvalidGraphic properties

EInvalidGraphic	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidGraphic properties

EInvalidGraphic	By object

HelpContext

Message


EInvalidGraphic methods

EInvalidGraphic	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EInvalidGraphic methods

EInvalidGraphic	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EInvalidArgument

Hierarchy	Properties	Methods	See also

EInvalidArgument is the exception class for out-of-range parameters in specialized math and accounting functions.

Unit

math

Description

EInvalidArgument is raised by some functions in the Math unit (mostly financial functions) when one of the parameters is out of range or makes the calculation impossible.

As a descendant of EExternal, EInvalidArgument saves the Windows exception record (if there is one) in its ExceptionRecord data structure.


EInvalidArgument properties

EInvalidArgument	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidArgument properties

EInvalidArgument	By object

HelpContext

Message


EInvalidArgument methods

EInvalidArgument	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EInvalidArgument methods

EInvalidArgument	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EExternal

EMathError


EInvalidImage

Hierarchy	Properties	Methods	See also

EInvalidImage is the exception class for unsuccessful attempts to read resource files.

Unit

classes

Description

EInvalidImage is raised when an application cannot read a resource file. This occurs most often because the specified file is not a resource file.

This error can occur if the TStream object’s read and write methods are used inconsistently. Always use ReadComponentRes to read components written with WriteComponentRes, and ReadComponent to read components written with WriteComponent. Failure to use the corresponding read and write methods can result in EInvalidImage exceptions.


EInvalidImage properties

EInvalidImage	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidImage properties

EInvalidImage	By object

HelpContext

Message


EInvalidImage methods

EInvalidImage	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EInvalidImage methods

EInvalidImage	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EStreamError

EFilerError


EInvalidOperation

Hierarchy	Properties	Methods	See also

EInvalidOperation is the exception class for invalid operations on a component.

Unit

classes

Description

EInvalidOperation is raised when an application attempts an operation that requires a window handle on a component does not have a parent (Parent = nil). This exception can also occur if a drag-and-drop operation is attempted from a form (for example, Form1.BeginDrag).

Note:	Do not confuse this object with EInvalidOp.


EInvalidOperation properties

EInvalidOperation	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidOperation properties

EInvalidOperation	By object

HelpContext

Message


EInvalidOperation methods

EInvalidOperation	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EInvalidOperation methods

EInvalidOperation	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EInvalidPointer

Hierarchy	Properties	Methods

EInvalidPointer is the exception class for invalid pointer operations.

Unit

sysutils

Description

EInvalidPointer is raised when an application attempts an invalid pointer operation. For example, it can occur if an application tries to dispose of the same pointer twice, or refers to a pointer which has already been disposed of.

Note

Never raise an EInvalidPointer exception directly. EInvalidPointer is raised internally by the memory manager.


EInvalidPointer properties

EInvalidPointer	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidPointer properties

EInvalidPointer	By object

HelpContext

Message


EInvalidPointer methods

EInvalidPointer	Alphabetically

Derived from EHeapException

FreeInstance

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EInvalidPointer methods

EInvalidPointer	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EHeapException


EListError

Hierarchy	Properties	Methods	See also

EListError is the exception class for list and string errors.

Unit

classes

Description

EListError is raised when an error is made in a list, string, or TStringList object. This exception commonly occurs when an application refers to an item that is out of the list’s range.

EListError also occurs if an application tries to add a duplicate string to a TStringList object when the value of the Duplicates property is dupError.

An EListError exception is raised when an application attempts to insert a string into a sorted string list, since the insertion of a string at a specified position may put the list out of order.


EListError properties

EListError	Alphabetically

Derived from Exception

HelpContext

Message


EListError properties

EListError	By object

HelpContext

Message


EListError methods

EListError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EListError methods

EListError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EMathError

Hierarchy	Properties	Methods	See also

EMathError is the exception class for floating-point math errors.

Unit

sysutils

Description

EMathError is the base class from which all specific floating-point math exceptions descend. EMathError itself is never raised in the VCL.

The following exceptions descend from EMathError:

Exception	Meaning

EInvalidArgument	Parameter out of range

EInvalidOp	Processor encountered an undefined instruction

EOverflow	Floating-point operation overflowed

EUnderflow	Floating-point operation underflowed

EZeroDivide	Attempt to divide by zero

As descendants of EExternal, these classes save the Windows exception record (if there is one) in their ExceptionRecord data structure.


EMathError properties

EMathError	Alphabetically

Derived from Exception

HelpContext

Message


EMathError properties

EMathError	By object

HelpContext

Message


EMathError methods

EMathError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EMathError methods

EMathError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EExternal


EMonthCalError

Hierarchy	Properties	Methods	See also

EMonthCalError is the exception class for invalid entries in a TMonthCalendar component.

Unit

comctrls

Description

EMonthCalError is raised by TMonthCalendar when an invalid date is entered.


EMonthCalError properties

EMonthCalError	Alphabetically

Derived from Exception

HelpContext

Message


EMonthCalError properties

EMonthCalError	By object

HelpContext

Message


EMonthCalError methods

EMonthCalError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EMonthCalError methods

EMonthCalError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

ECommonCalendarError


EMCIDeviceError

Hierarchy	Properties	Methods	See also

EMCIDeviceError is the exception class for devices that provide a Media Control Interface (MCI) driver.

Unit

mplayer

Description

EMCIDeviceError is raised if an error occurs when accessing a multimedia device. The most common cause for the exception is trying to access a multimedia device before it has been opened with the TMediaPlayer.Open method.


EMCIDeviceError properties

EMCIDeviceError	Alphabetically

Derived from Exception

HelpContext

Message


EMCIDeviceError properties

EMCIDeviceError	By object

Message

HelpContext


EMCIDeviceError methods

EMCIDeviceError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelpException_CreateResHelp>Main

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EMCIDeviceError methods

EMCIDeviceError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EMenuError

Hierarchy	Properties	Methods	See also

EMenuError is the exception class for errors involving menu items.

Unit

menus

Description

EMenuError is raised if an error occurs while an application is working with menu items. For example, an EMenuError exception occurs if an application attempts to delete a menu item that doesn’t exist.


EMenuError properties

EMenuError	Alphabetically

Derived from Exception

HelpContext

Message


EMenuError properties

EMenuError	By object

Message

HelpContext


EMenuError methods

EMenuError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EMenuError methods

EMenuError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


TEnumPropDesc

Hierarchy	Methods	See also

TEnumPropDesc provides the mapping between strings used to name the values of a property in an OLE control object and the values themselves.

Unit

olectrls

Description

Use TEnumPropDesc to interpret the strings used by an OLE control object to represent the values of one of its properties.  TEnumPropDesc can provide a list of possible value strings to a callback function, or map between the string names of property values and the values themselves.  TEnumPropDesc objects are made available through the GetEnumPropDesc method of an OLE control object.


TEnumPropDesc methods

TEnumPropDesc	Alphabetically

In TEnumPropDesc

Create

Destroy

GetStrings

StringToValue

ValueToString

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TEnumPropDesc methods

TEnumPropDesc	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetStrings

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

StringToValue

ValueToString


TEnumPropDesc.Create

TEnumPropDesc	See also

Creates an instance of TEnumPropDesc.

constructor Create(DispID, ValueCount: Integer; const TypeInfo: ITypeInfo);

Description

Create is called by an OLE control object to create an instance of TEnumPropDesc to represent the values of one of its properties.  Applications should not need to create instances of TEnumPropDesc.  When working with OLE properties, get the TEnumPropDesc objects from the OLE control object.

DispID identifies the property of the OLE object, ValueCount is the number of distinct values the property can take TypeInfo is an ITypeInfo object that the constructor can use to capture the values and their strings.


TEnumPropDesc.Destroy

TEnumPropDesc	See also

Destroys an instance of TEnumPropDesc.

destructor Destroy; override;

Description

Do not call Destroy directly in an application.  The TOleControl object that owns the TEnumPropDesc object will destroy it automatically.

Destroy frees the internal list used to map value strings to property values.


TEnumPropDesc.GetStrings

TEnumPropDesc	See also

Calls the callback Proc for each property value string.

procedure GetStrings(Proc: TGetStrProc);

Description

Use GetStrings to execute code for every property value string represented in the TEnumPropDesc object.  The callback Proc is called for every value, with the S parameter set to a string that gives the integer value followed by the string representation of that value.

For example, consider a  TEnumPropDesc object that represents a color property, with values equal to TColor values. The callback Proc would be called for every built-in color name with strings of the form ‘255 - clRed’.


TEnumPropDesc.StringToValue

TEnumPropDesc	See also

Maps a string representation of the property value to the integer value.

Function StringToValue(const S: string): Integer;

Description

Use StringToValue to map the string representation of a property value used by an OLE control object to an integer value that is a more accurate representation of the property value.  If the property value is not an integer, the integer associated with the string can be a pointer to the value.


TEnumPropDesc.ValueToString

TEnumPropDesc	See also

Maps an integer that indicates the value of the property to the string representation of that value used by the OLE control object.

function ValueToString(V: Integer): string;

Description

Use ValueToString to map the integer value of a property value to the string representation used by an OLE control object.  If the property value is not an integer, the integer associated with the string can be a pointer to the value.


Hierarchy

TObject


ENoResultSet

Hierarchy	Properties	Methods	See also

ENoResultSet is the exception class for unsuccessful attempts to open a dataset query.

Unit

dbtables

Description

ENoResultSet is raised by TQuery when an attempt is made to open the query without a SELECT statement.


ENoResultSet properties

ENoResultSet	Alphabetically

Derived from Exception

HelpContext

Message


ENoResultSet properties

ENoResultSet	By object

HelpContext

Message


ENoResultSet methods

ENoResultSet	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


ENoResultSet methods

ENoResultSet	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EDatabaseError


EOleCtrlError

Hierarchy	Properties	Methods	See also

EOleCtrlError is the exception class for ActiveX controls.

Unit

olectrls

Description

EOleCtrlError is raised when an application cannot link to an ActiveX control.


EOleCtrlError properties

EOleCtrlError	Alphabetically

Derived from Exception

HelpContext

Message


EOleCtrlError properties

EOleCtrlError	By object

HelpContext

Message


EOleCtrlError methods

EOleCtrlError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EOleCtrlError methods

EOleCtrlError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EOutlineError

Hierarchy	Properties	Methods	See also

EOutlineError is the exception class for outline components.

Unit

outline

Description

EOutlineError is raised when an error occurs as an application works with an outline component. For example, an EOutlineError exception occurs when an application

•	Attempts to access an outline using an invalid node index.

•	Attempts to expand a node whose parent isn’t expanded.

•	Attempts to load items from a file using an invalid file extension.

Note

EOutlineError is raised by the TOutline component, which is maintained for compatibility with older versions of Delphi only.


EOutlineError properties

EOutlineError	Alphabetically

Derived from Exception

HelpContext

Message


EOutlineError properties

EOutlineError	By object

HelpContext

Message


EOutlineError methods

EOutlineError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EOutlineError methods

EOutlineError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EOutOfMemory

Hierarchy	Properties	Methods	See also

EOutOfMemory is the exception class for unsuccessful attempts to allocate memory.

Unit

sysutils

Description

EOutOfMemory occurs when an application attempts to allocate dynamic memory, but there is not enough free memory in the system to meet the request.

Memory for the EOutOfMemory exception is itself preallocated whenever a Delphi application starts and remains allocated as long as the application is running.

Note

Never raise EOutOfMemory directly. Instead, call the OutOfMemoryError procedure.


EOutOfMemory properties

EOutOfMemory	Alphabetically

Derived from Exception

HelpContext

Message


EOutOfMemory properties

EOutOfMemory	By object

HelpContext

Message


EOutOfMemory methods

EOutOfMemory	Alphabetically

Derived from EHeapException

FreeInstance

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EOutOfMemory methods

EOutOfMemory	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EHeapException


EOutOfResources

Hierarchy	Properties	Methods	See also

EOutOfResources is the exception class for unsuccessful attempts to allocate Windows handles.

Unit

classes

Description

EOutOfResources is raised when an application attempts to create a Windows handle and Windows has no more handles to allocate.


EOutOfResources properties

EOutOfResources	Alphabetically

Derived from Exception

HelpContext

Message


EOutOfResources properties

EOutOfResources	By object

HelpContext

Message


EOutOfResources methods

EOutOfResources	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EOutOfResources methods

EOutOfResources	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EHeapException

EOutOfMemory


EOverflow

Hierarchy	Properties	Methods	See also

EOverflow is the exception class for floating-point register overflows.

Unit

sysutils

Description

EOverflow is raised when a calculated result is too large to fit in the floating-point register allocated for it and data is therefore lost.

As a descendant of EExternal, EOverflow saves the Windows exception record (if there is one) in its ExceptionRecord data structure.

Note

Integer register overflows raise the EIntOverflow exception.


EOverflow properties

EOverflow	Alphabetically

Derived from Exception

HelpContext

Message


EOverflow properties

EOverflow	By object

HelpContext

Message


EOverflow methods

EOverflow	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EOverflow methods

EOverflow	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EExternal

EMathError


EParserError

Hierarchy	Properties	Methods	See also

EParserError is the exception class for text-to-binary streaming conversion errors.

Unit

classes

Description

EParserError is raised when an error occurs during text-to-binary conversion, usually due to a syntax error in the source text.


EParserError properties

EParserError	Alphabetically

Derived from Exception

HelpContext

Message


EParserError properties

EParserError	By object

HelpContext

Message


EParserError methods

EParserError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EParserError methods

EParserError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EPackageError

Hierarchy	Properties	Methods

EPackageError is the exception class for package-related errors.

Unit

sysutils

Description

EPackageError is raised at design time only, when an error occurs loading or utilizing a package.


EPackageError properties

EPackageError	Alphabetically

Derived from Exception

HelpContext

Message


EPackageError properties

EPackageError	By object

HelpContext

Message


EPackageError methods

EPackageError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EPackageError methods

EPackageError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EPrinter

Hierarchy	Properties	Methods

EPrinter is the exception class for printing errors.

Unit

printers

Description

EPrinter is raised when a printing error occurs. For example, if an application attempts to use a printer that doesn’t exist, or if a job can’t be sent to the printer for some other reason, an EPrinter exception is raised.


EPrinter properties

EPrinter	Alphabetically

Derived from Exception

HelpContext

Message


EPrinter properties

EPrinter	By object

HelpContext

Message


EPrinter methods

EPrinter	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EPrinter methods

EPrinter	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EPrivilege

Hierarchy	Properties	Methods	See also

EPrivilege is the exception class for processor privilege violations.

Unit

sysutils

Description

EPrivilege is raised when an application tries to execute a processor instruction that is invalid for the current processor privilege level.

As a descendant of EExternal, EPrivilege saves the Windows exception record (if there is one) in its ExceptionRecord data structure.


EPrivilege properties

EPrivilege	Alphabetically

Derived from Exception

HelpContext

Message


EPrivilege properties

EPrivilege	By object

HelpContext

Message


EPrivilege methods

EPrivilege	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EPrivilege methods

EPrivilege	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EExternal


EPropertyConvertError

Hierarchy	Properties	Methods	See also

EPropertyConvertError is the exception class for type errors when attempting to get or set the value of a property.

Unit

typinfo

Description

EPropertyConvertError is raised when an application tries to set a property to a value of the wrong type or to read a property that has invalid type information.


EPropertyConvertError properties

EPropertyConvertError	Alphabetically

Derived from Exception

HelpContext

Message


EPropertyConvertError properties

EPropertyConvertError	By object

HelpContext

Message


EPropertyConvertError methods

EPropertyConvertError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EPropertyConvertError methods

EPropertyConvertError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EPropertyError

Hierarchy	Properties	Methods	See also

EPropertyError is the exception class for unsuccessful attempts to set the value of a property.

Unit

typinfo

Description

EPropertyError is raised by the SetValue (or Edit) methods of property-editor objects when they cannot set a requested property value. This usually occurs because the requested value is out of range or of an invalid data type.


EPropertyError properties

EPropertyError	Alphabetically

Derived from Exception

HelpContext

Message


EPropertyError properties

EPropertyError	By object

HelpContext

Message


EPropertyError methods

EPropertyError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EPropertyError methods

EPropertyError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EPropReadOnly

Hierarchy	Properties	Methods

EPropReadOnly is the exception class for invalid attempts to write to a property using OLE automation.

Unit

sysutils

Description

EPropReadOnly is raised when an application tries to write to a read-only property using OLE automation.


EPropReadOnly properties

EPropReadOnly	Alphabetically

Derived from Exception

HelpContext

Message


EPropReadOnly properties

EPropReadOnly	By object

HelpContext

Message


EPropReadOnly methods

EPropReadOnly	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EPropReadOnly methods

EPropReadOnly	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EPropWriteOnly

Hierarchy	Properties	Methods

EPropWriteOnly is the exception class for invalid attempts to read a property using OLE automation.

Unit

sysutils

Description

EPropWriteOnly is raised when an application tries to read a write-only property using OLE automation.


EPropWriteOnly properties

EPropWriteOnly	Alphabetically

Derived from Exception

HelpContext

Message


EPropWriteOnly properties

EPropWriteOnly	By object

HelpContext

Message


EPropWriteOnly methods

EPropWriteOnly	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EPropWriteOnly methods

EPropWriteOnly	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


ERangeError

Hierarchy	Properties	Methods	See also

ERangeError is the exception class for integer values that are too large for the declared type to which they are assigned.

Unit

sysutils

Description

ERangeError is an integer math exception. It occurs when

An integer expression’s value exceeds the bounds of the specified integer type to which it is assigned.

Source code attempts to access an item in an array using an index value that is not within the defined array.

ERangeError is raised only if range checking is turned on. To turn on range checking, include the $R+ directive in project source code, or select Project|Options, choose the Compiler tab, and check the Range-checking option in the dialog box.

As a descendant of EExternal, ERangeError saves the Windows exception record (if there is one) in its ExceptionRecord data structure.


ERangeError properties

ERangeError	Alphabetically

Derived from Exception

HelpContext

Message


ERangeError properties

ERangeError	By object

HelpContext

Message


ERangeError methods

ERangeError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


ERangeError methods

ERangeError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EExternal

EIntError


EReadError

Hierarchy	Properties	Methods	See also

EReadError is the exception class for unsuccessful attempts to read data from a stream.

Unit

classes

Description

EReadError is raised when an application attempts to read data from a stream but cannot read the specified number of bytes.

An EReadError exception may also be raised if Delphi is unable to read a property while creating a form. This can occur because a component reads the form resource incorrectly, or because the resource is corrupt.


EReadError properties

EReadError	Alphabetically

Derived from Exception

HelpContext

Message


EReadError properties

EReadError	By object

HelpContext

Message


EReadError methods

EReadError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EReadError methods

EReadError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EStreamError

EFilerError


ERegistryException

Hierarchy	Properties	Methods	See also

ERegistryException is the exception class for registry errors.

Unit

registry

Description

ERegistryException is raised when an application cannot

•	Create a new key in the registry.

•	Read a data value associated with a key.

•	Read a binary data value associated with a key into a local buffer.

•	Write a data value to a key.

Key creation fails when an application attempts to create a subkey under a key for which it does not have KEY_CREATE_SUB_KEY security access.

Reading a data value associated with a key fails when an application does not have KEY_READ security access, or when the application attempts to read the wrong kind of data from a key (for example, attempting to read string data from an integer data value).

Reading a binary data value into a local buffer fails when an application does not allocate a buffer large enough for the data.

Writing a data value to a key fails because an application does not have KEY_WRITE security access for the current key.


ERegistryException properties

ERegistryException	Alphabetically

Derived from Exception

HelpContext

Message


ERegistryException properties

ERegistryException	By object

HelpContext

Message


ERegistryException methods

ERegistryException	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


ERegistryException methods

ERegistryException	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EResNotFound

Hierarchy	Properties	Methods	See also

EResNotFound is the exception class for unlocatable resources.

Unit

classes

Description

EResNotFound is raised when Delphi cannot find a specified resource (such as a form, bitmap, or icon) in a .DFM or .RES file, or when the resource is not linked into the application.

If you receive this exception on startup of an application, or when you create a form, check the form’s .PAS file for the {$R *.DFM} compiler directive. If this directive is missing or commented out, the .DFM file will not be included in the executable and an EResNotFound exception will be generated.


EResNotFound properties

EResNotFound	Alphabetically

Derived from Exception

HelpContext

Message


EResNotFound properties

EResNotFound	By object

HelpContext

Message


EResNotFound methods

EResNotFound	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EResNotFound methods

EResNotFound	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EStackOverflow

Hierarchy	Properties	Methods	See also

EStackOverflow is the exception class for stack overflows.

Unit

sysutils

Description

EStackOverflow is raised when the current thread’s stack grows into the final guard page—that is, when the system cannot grow the stack dynamically. This can happen because of extremely large local variables, deeply recursive routines, or invalid assembly-language code.

As a descendant of EExternal, EStackOverflow saves the Windows exception record (if there is one) in its ExceptionRecord data structure.


EStackOverflow properties

EStackOverflow	Alphabetically

Derived from Exception

HelpContext

Message


EStackOverflow properties

EStackOverflow	By object

HelpContext

Message


EStackOverflow methods

EStackOverflow	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EStackOverflow methods

EStackOverflow	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EExternal


EStringListError

Hierarchy	Properties	Methods	See also

EStringListError is the exception class for invalid list-box references.

Unit

classes

Description

EStringListError is raised when an application attempts to access a list box (for example, to add an item) using an invalid index.


EStringListError properties

EStringListError	Alphabetically

Derived from Exception

HelpContext

Message


EStringListError properties

EStringListError	By object

HelpContext

Message


EStringListError methods

EStringListError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EStringListError methods

EStringListError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EStreamError

Hierarchy	Properties	Methods	See also

EStreamError is the exception class for streaming errors.

Unit

classes

Description

EStreamError is the ancestor from which all streaming exception classes descend. EStreamError is itself raised when resources cannot be allocated for a memory stream.


EStreamError properties

EStreamError	Alphabetically

Derived from Exception

HelpContext

Message


EStreamError properties

EStreamError	By object

HelpContext

Message


EStreamError methods

EStreamError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EStreamError methods

EStreamError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EThread

Hierarchy	Properties	Methods	See also

EThread is the exception class for thread synchronization errors.

Unit

classes

Description

EThread is never raised. It is included for backward compatibility.


EThread properties

EThread	Alphabetically

Derived from Exception

HelpContext

Message


EThread properties

EThread	By object

HelpContext

Message


EThread methods

EThread	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EThread methods

EThread	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


ETreeViewError

Hierarchy	Properties	Methods	See also

ETreeViewError is the exception class for unsuccessful attempts to access a tree view node.

Unit

comctrls

Description

ETreeViewError is raised when an invalid index is requested from a TTreeView component.


ETreeViewError properties

ETreeViewError	Alphabetically

Derived from Exception

HelpContext

Message


ETreeViewError properties

ETreeViewError	By object

HelpContext

Message


ETreeViewError methods

ETreeViewError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


ETreeViewError methods

ETreeViewError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EUnderflow

Hierarchy	Properties	Methods	See also

EUnderflow is the exception class for values that are too small to be represented with a floating-point variable.

Unit

sysutils

Description

When a floating-point math operation produces a value that is too small to be represented in a floating-point variable, the result ordinarily becomes zero. However, an application can change the numeric coprocessor's control word to unmask underflow hardware exceptions; in this case, EUnderflow is raised when the coprocessor reports an underflow hardware exception. The control word is reset after the exception.

As a descendant of EExternal, EUnderflow saves the Windows exception record (if there is one) in its ExceptionRecord data structure.


EUnderflow properties

EUnderflow	Alphabetically

Derived from Exception

HelpContext

Message


EUnderflow properties

EUnderflow	By object

HelpContext

Message


EUnderflow methods

EUnderflow	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EUnderflow methods

EUnderflow	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EExternal

EMathError


EVariantError

Hierarchy	Properties	Methods	See also

EVariantError is the exception class for errors involving variant data types.

Unit

sysutils

Description

EVariantError is raised when

An application attempts an invalid variant typecast or operation.

A variant does not contain a required OLE IDispatch object.

The VarArrayCreate function is unable to create a requested variant array.

A variant-array operation is attempted on something that is not a variant array.

A variant-array index is out of bounds.


EVariantError properties

EVariantError	Alphabetically

Derived from Exception

HelpContext

Message


EVariantError properties

EVariantError	By object

HelpContext

Message


EVariantError methods

EVariantError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EVariantError methods

EVariantError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EWin32Error

Hierarchy	Properties	Methods	See also

EWin32Error is the exception class for Windows errors.

Unit

sysutils

Description

EWin32Error is raised by the RaiseLastWin32Error procedure if Windows returns an error code. The exception dialog contains the error number and the message associated with the error.


EWin32Error properties

EWin32Error	Alphabetically

Derived from Exception

HelpContext

Message


EWin32Error properties

EWin32Error	By object

HelpContext

Message


EWin32Error methods

EWin32Error	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EWin32Error methods

EWin32Error	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception


EWriteError

Hierarchy	Properties	Methods	See also

EWriteError is the exception class for unsuccessful attempts to write data to a stream.

Unit

classes

Description

EWriteError is raised when:

The WriteBuffer method of a stream object is unable to write the specified number of bytes.

The IDE is unable to write one of a component’s properties to a stream. This can occur when you try to save a form at design time.


EWriteError properties

EWriteError	Alphabetically

Derived from Exception

HelpContext

Message


EWriteError properties

EWriteError	By object

HelpContext

Message


EWriteError methods

EWriteError	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EWriteError methods

EWriteError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EStreamError

EFilerError


OnKeyDown, Abort, Printing Example

The following code aborts a print job if the user presses Esc. Note that you should set KeyPreview to True to ensure that the OnKeyDown event handler of Form1 is called.

procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);

begin

if (Key=VK_ESCAPE) and Printer.Printing then

  begin

  Printer.Abort;

  MessageDlg('Printing aborted', mtInformation, [mbOK],0);

  end;

end;


Aborted Example

The following code displays a dialog box if the print job was aborted:

if Printer.Aborted then

  MessageDlg('The print job did not finish printing', mtInformation, [mbOK], 0);


OnTimer, Interval, ActiveControl Example

The following event handler responds to timer events by moving the active control one pixel to the right:

procedure TForm1.Timer1Timer(Sender: TObject);

begin

  Timer1.Interval := 100;

  if ActiveControl <> nil then

    ActiveControl.Left := ActiveControl.Left + 1;

end;


AddChildObject Example

The following example adds a new child to the selected item’s list of child items in the tree view control. The new item is identified by the text ‘New Item’. The TBitmap object is attached to the new item.

TreeView1.Items.AddChildObject(TreeView1.Selected,'New Item',MyBitMap);


AddChildObjectFirst Example

The following example adds a new item to the selected item’s list of child items in the tree view control. The new item is added first in the list of child items. The new item is identified by the text ‘New Item’. The TBitmap object is attached to the new item.

TreeView1.Items.AddChildObjectFirst(TreeView1.Selected,'New Item',MyBitMap);


AddIndex Example

In the example below, the AddIndex method is used to create an index named NewIndex. This index is based on two fields from the associated table, CustNo and CustName. The index NewIndex incorporates two index options through the TIndexOptions constants ixUnique and ixCaseInsensitive.

Table1.AddIndex('NewIndex', 'CustNo;CustName', [ixUnique, ixCaseInsensitive]);


AddObject, Count, Data Example

The following code defines a record type of TMyRec and a record pointer type of PMyRec.

type

PMyRec = ^TMyRec;

TMyRec = record

  FName: string;

  LName: string;

end;

Assuming these types are used, the following code adds a node to TreeView1 as the last sibling of a specified node. A TMyRec record is associated with the added item. The FName and LName fields are obtained from edit boxes Edit1 and Edit2. The Index parameter is obtained from edit box Edit3. The item is added only if the Index is a valid value.

procedure TForm1.Button1Click(Sender: TObject);

var

  MyRecPtr: PMyRec;

  TreeViewIndex: LongInt;

begin

  New(MyRecPtr);

  MyRecPtr^.FName := Edit1.Text;

  MyRecPtr^.LName := Edit2.Text;

  TreeViewIndex := StrToInt(Edit3.Text);

  with TreeView1 do

  begin

    if Items.Count = 0 then

      Items.AddObject(nil, 'Item' + IntToStr(TreeViewIndex), MyRecPtr)

    else if (TreeViewIndex < Items.Count) and (TreeViewIndex >= 0) then

      Items.AddObject(Items[TreeViewIndex], 'Item' + IntToStr(TreeViewIndex), MyRecPtr);

  end;

end;

After an item containing a TMyRec record has been added, the following code retrieves the FName and LName values associated with the item and displays the values in a label.

procedure TForm1.Button2Click(Sender: TObject);

begin

  Label1.Caption := PMyRec(TreeView1.Selected.Data)^.FName + ' ' +

                  PMyRec(TreeView1.Selected.Data)^.LName;

end;


AddParam, RemoveParam Example

{ Move all parameter info from Params2 to Params1 }

while Params2.Count <> 0 do

begin

  { Grab the first parameter from Params2 }

  TempParam := Params2[0];

  { Remove it from Params2 }

  Params2.RemoveParam(TempParam);

  { And add it to Params1 }

  Params1.AddParam(TempParam);

end;


AfterCancel Example

This example updates the form’s status bar with a message when an AfterCancel event occurs.

procedure TForm1.Table1AfterCancel(DataSet: TDataSet);

begin

  with TDataSet as TTable do

    StatusBar1.SimpleText := 'Record changes cancelled for ' + TableName;

end;


AfterDelete, Format Example

This example displays a message on the form’s status bar indicating the table’s record count after a record is deleted.

procedure TForm1.Table1AfterDelete(DataSet: TDataSet);

begin

  StatusBar1.SimpleText := Format('There are now %d records in the table', [DataSet.RecordCount]);

end;


AfterEdit Example

This example updates the form’s status bar with a message when an AfterEdit event occurs.

procedure TForm1.Table1AfterEdit(DataSet: TDataSet);

begin

   StatusBar1.SimpleText := 'Editing record';

end;


AfterInsert Example

This example updates the form’s status bar with a message when an AfterInsert event occurs.

procedure TForm1.Table1AfterInsert(DataSet: TDataSet);

begin

   StatusBar1.SimpleText := 'Inserting new record';

end;


AfterOpen Example

This example updates the form’s status bar with a message when an AfterOpen event occurs.

procedure TForm1.Table1AfterOpen(DataSet: TDataSet);

begin

  {// now that the table is open, record information is available }

  StatusBar1.SimpleText := 'Record ' + IntToStr(Table1.RecNo) + 'of ' + IntToStr(Table1.RecordCount);

end;


AfterPost Example

This example updates the form’s status bar with a message when an AfterPost event occurs.

procedure TForm1.Table1AfterPost(DataSet: TDataSet);

begin

  StatusBar1.SimpleText := 'Record changes complete';

end;


AllowGrayed, State Example

This example uses a check box on a form. When the application runs, the check box is initially checked. When the user clicks it, the check box is unchecked. Clicking it again grays the check box.

procedure TForm1.FormCreate(Sender: TObject);

begin

  CheckBox1.AllowGrayed := True;

  CheckBox1.State := cbChecked;

end;


Append, FieldValues, Post Example

This example appends a new record to a table when the user clicks a button. The two fields ALPHANUMERIC and INTEGER are filled from the contents of two edit controls.

procedure TForm1.Button1Click(Sender: TObject);

begin

Table1.Append;

Table1.FieldValues['ALPHANUMERIC'] := Edit1.text;

Table1.FieldValues['INTEGER'] := StrToInt(Edit2.text);

Table1.Post;

end;


AppendRecord Example

This statement appends a record to the Customer table. Note that Nulls are entered for some of the values, but are not required for missing values at the end of the array argument, i.e. after the Discount field.

Customer.AppendRecord([CustNoEdit.Text,CoNameEdit.Text, AddrEdit.Text, Null, Null, Null, Null, Null, Null, DiscountEdit.Text]);


ApplyFilePath, FileEdit, FileList, DirLabel, DirList Example

This example uses a file list box, a directory list box, a filter combo box, a drive combo box, a label, an edit box, and a button on a form. When the user runs the application and enters a path or filename in the edit box and presses the button, all the controls update:

procedure TForm1.FormCreate(Sender: TObject);

begin

  FileListBox1.FileEdit := Edit1;

  FilterComboBox1.FileList := FileListBox1;

  DirectoryListBox1.FileList := FileListBox1;

  DirectoryListBox1.DirLabel := Label1;

  DriveComboBox1.DirList := DirectoryListBox1;

  Button1.Default := True;

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

  FileListBox1.ApplyFilePath(Edit1.Text);

end;


EditRangeStart, EditRangeEnd, FieldByName, ApplyRange Example

with Customer do

begin

  EditRangeStart;

  FieldByName('Company').AsString := Edit1.Text;

  {Set start range based on text of Edit1 component}

  EditRangeEnd;

  FieldByName('Company').AsString := Edit2.Text;

  {Set end range based on value of Edit2 component}

  ApplyRange; {Apply the ranges}

end;


Arc Example

The following lines of code draw the top quarter of an arc bounded by the current window:

procedure TForm1.FormPaint(Sender: TObject);

var

  R: TRect;

begin

  R := GetClientRect;   {Gets the boundaries of the current window}

  Canvas.Arc(R.Left, R.Top, R.Right, R.Bottom, R.Right, R.Top, R.Left, R.Top);

end;


OnClick, ArrangeIcons Example

This code runs when the user chooses a menu item called Window | Arrange Icons:

procedure TForm1.WindowArrangeIconsClick(Sender: TObject);

begin

  Form1.ArrangeIcons;

end;


AsDateTime Example

The following statement converts a string to a date for insertion into a date field:

Table1.FieldByName('TimeStamp').AsDateTime := StrToDateTime(Now);


Assign Example

The following line copies the bitmap of a speed button named SpeedButton1 to the Clipboard.  Note that you must addClipbrd to the uses clause

Clipboard.Assign(SpeedButton1.Glyph);


Assign Example

{ Copy one date-time field to another }

DateTimeField1.Assign(DateTimeField2);

{ Copy a graphic field to a blob field }

BlobField1.Assign(GraphicField1);

{Copy strings in a TMemo to a TMemoField}

MemoField1.Assign(Memo1.Lines);


Create, Assign, AssignValues Example

var SavedParams: TParams;

{ Initialize SavedParams }

SavedParams := TParams.Create;

try

  { Save the parameters for Query1 }

  SavedParams.Assign(Query1.Params);

  { Do something with Query1 }

  ...

  { Restore the parameters to Query1 }

  Query1.Params.AssignValues(SavedParams);

finally

  SavedParams.Free;

end;


AutoEnable, EnabledButtons Example

The following code causes all of the buttons of MediaPlayer1 to become disabled when a bitmap button is clicked:

procedure TForm1.BitBtn1Click(Sender: TObject);

begin

  with MediaPlayer1 do begin

    AutoEnable := False;

    EnabledButtons := [];

  end;

end;


AutoRewind, Previous Example

The following code plays MediaPlayer. If AutoRewind is False, Previous is called to rewind after Play is finished.

MediaPlayer.Wait := True;

MediaPlayer.Play;

if not MediaPlayer.AutoRewind then MediaPlayer.Previous;


AutoSize Example

This example uses an edit box and a button on a form. When the user clicks the button, the font in the edit box enlarges, and the edit box enlarges also to accommodate the larger font size.

procedure TForm1.Button1Click(Sender: TObject);

begin

  Edit1.AutoSize := True;

  Edit1.Font.Size := 20;

  Edit1.Text := 'The edit box is taller now';

end;


AutoSize, Caption Example

The following code keeps the size of the label control constant, even though the length of the label’s caption changes. As a result, the caption of the label is probably too long to display in the label when the user clicks the button:

procedure TForm1.Button1Click(Sender: TObject);

begin

  Label1.AutoSize := False;

  Label1.Caption := 'This string is too long as the caption of this label';

end;


FileName, Back, Next Example

The following example lets the user pick an .AVI video file using OpenDialog1 and opens that file in MediaPlayer1. Then, the Forward and Back buttons can be used to step through the frames of the AVI clip in either direction.

procedure TForm1.OpenClick(Sender: TObject);

begin

  OpenDialog1.DefaultExt := 'AVI';

  OpenDialog1.Filename := '*.avi';

  if OpenDialog1.Execute then

  begin

    MediaPlayer1.Filename := OpenDialog1.Filename;

    MediaPlayer1.Open;

  end;

end;

procedure TForm1.BackClick(Sender: TObject);

begin

  MediaPlayer1.Back;

end;

procedure TForm1.ForwardClick(Sender: TObject);

begin

  MediaPlayer1.Next;

end;


BeforeInsert, Insert, AsInteger, FieldByName Example

This example uses the BeforeInsert event to do data validation; if the StrToInt function raises an exception, the edit control’s contents are set to a valid value so the assignment to the INTEGER field in the table will succeed.

procedure TForm1.Table1BeforeInsert(DataSet: TDataSet);

begin

  try

  {Make sure edit field can be converted to integer --

   this will raise an exception if it can’t }

    StrToInt(Edit1.Text);

  except

    Edit1.Text := '0';

  end;

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

  Table1.Insert;

  Table1.FieldByName('QUANTITY').AsInteger := StrToInt(Edit1.Text);

  Table1.Post;

end;


BeforePost, Abort Example

This example checks for a valid entry in a TDBEdit control and calls the Abort procedure if the control is empty; Abort cancels the post before it happens.

procedure TForm1.Table1BeforePost(DataSet: TDataSet);

begin

if DBEdit1.Text = '' then

  Abort;

end;


BeginUpdate, EndUpdate, Add, Count, Items Example

The following example adds a panel to the status bar control when the user clicks the button and adds a caption to the panel. The code uses BeginUpdate and EndUpdate to prevent repaints until the operation is complete.  A try...finally block ensures EndUpdate is called even when an exception occurs.

procedure TForm1.Button1Click(Sender: TObject);

var

  PanelIndex : Integer;

begin

  with StatusBar1 do

  begin

    Panels.BeginUpdate;

    PanelIndex := StatusBar1.Panels.Count - 1;

    try

      Panels.Add;

      Inc(PanelIndex);

      Panels.Items[PanelIndex].Text := 'Panel' + IntToStr(PanelIndex);

    finally

      Panels.EndUpdate;

    end;

  end;

end;


BevelInner, BevelOuter, BorderWidth, BevelWidth Example

This example uses a panel component and a button named CreateStatusLine on a form. The code moves the panel to the bottom of the form when the user clicks the button and gives the panel the appearance of a status line by changing the value of the BevelInner, BevelOuter, BevelWidth, and BorderWidth properties.

procedure TForm1.CreateStatusLineClick(Sender: TObject);

begin

  with Panel1 do

  begin

    Align := alBottom;

    BevelInner := bvLowered;

    BevelOuter := bvRaised;

    BorderWidth := 1;

    BevelWidth := 1;

  end;

end;


Canvas, Brush, Bitmap, FillRect Example

The following code loads a bitmap from a file and assigns it to the Brush of the Canvas of Form1:

var

  Bitmap: TBitmap;

begin

  Bitmap := TBitmap.Create;

  try

    Bitmap.LoadFromFile('MyBitmap.bmp');

    Form1.Canvas.Brush.Bitmap := Bitmap;

    Form1.Canvas.FillRect(Rect(0,0,100,100));

  finally

    Form1.Canvas.Brush.Bitmap := nil;

    Bitmap.Free;

  end;

end;


GetBookmark, GotoBookmark, FreeBookmark, FindPrior, Value, OnDataChange, BOF Example

This example uses a button to copy the value of a field in the previous record into the corresponding field in the current record.

procedure TForm1.CopyDataClick(Sender: TObject);

var

   SavePlace: TBookmark;

   PrevValue: Variant;

begin

   with Table1 do

   begin

    { get a bookmark so that we can return to the same record }

    SavePlace := GetBookmark;

    { move to prior record}

    FindPrior;

    { get the value }

    PrevValue := Fields[0].Value;

    {Move back to the bookmark

    this may not be the next record anymore

    if something else is changing the dataset asynchronously }

    GotoBookmark(SavePlace);

    { Set the value }

    Fields[0].Value := PrevValue;

    { Free the bookmark }

    FreeBookmark(SavePlace);

  end;

end;

To ensure that the button is disabled when there is no previous record, the OnDataChange event of the DataSource detects when the user moves to the beginning of file (BOF property becomes True), and disables the button.

procedure TForm1.Table1DataChange(Sender: TObject; Field: TField);

begin

  if Table1.BOF then

    CopyData.Enabled := False

  else

    CopyData.Enabled := True;

end;


BorderIcons Example

The following code removes a form’s Maximize button when the user clicks a button:

procedure TForm1.Button1Click(Sender: TObject);

begin

BorderIcons := BorderIcons - [biMaximize];

end;


 BoundsRect Example

This code resizes the active control to twice as wide and half as high:

procedure TForm1.Button1Click(Sender: TObject);

var

  MyRect: TRect;

begin

  MyRect := ActiveControl.BoundsRect;

  MyRect.Right := MyRect.Left + 2 * (MyRect.Right - MyRect.Left);

  MyRect.Bottom := MyRect.Top + (MyRect.Bottom - MyRect.Top) div 2;

  ActiveControl.BoundsRect := MyRect;

end;


Visible, BringToFront Example

The following code uses two forms. Form1 has a button on it. The second form is used as a tool palette. This code makes the palette form visible, and ensures it is the top form by bringing it to the front.

To run this example, you must add Unit2 in the uses clause of your unit.

procedure TForm1.ShowPaletteButtonClick(Sender: TObject);

begin

if Form2.Visible = False then Form2.Visible := True;

Form2.BringToFront;

end;


BrushCopy, CopyRect Example

The following code illustrates the differences between CopyRect and BrushCopy. The bitmap graphic ‘TARTAN.BMP’ is loaded into Bitmap and displayed on the Canvas of Form1. BrushCopy replaces the color black in the graphic with the brush of the canvas, while CopyRect leaves the colors intact.

var

  Bitmap: TBitmap;

  MyRect, MyOther: TRect;

begin

  MyRect := Rect(10,10,100,100);

  MyOther := Rect(10,111,100, 201);

  Bitmap := TBitmap.Create;

  Bitmap.LoadFromFile('c:\windows\tartan.bmp');

  Form1.Canvas.BrushCopy(MyRect, Bitmap, MyRect, clBlack);

  Form1.Canvas.CopyRect(MyOther,Bitmap.Canvas,MyRect);

  Bitmap.Free;

end;


BtnClick Example

This code allows a menu item called Record | Next to simulate clicking the Next button on a database navigator control, making the next record in the dataset the current record:

procedure TForm1.RecordNextClick(Sender: TObject);

begin

  DBNavigator1.BtnClick(nbNext);

end;


Cancel Example

The following fragment prompts the user to confirm changes to a record; if the user clicks Yes, the record is posted to the table, otherwise the changes are cancelled.

if MessageDlg('Update Record?', mtConfirmation, [mbYes, mbNo], 0) =

              mrYes then

  Table1.Post

else

  Table1.Cancel;


Canvas, Ellipse, Color, Style Example

The following example paints a cross-hatched ellipse onto Image1 which is a TImage on the form when the user clicks on Button1.

procedure TForm1.Button1Click(Sender: TObject);

begin

  with Image1 do begin

    Canvas.Brush.Color := clRed;

    Canvas.Brush.Style := bsDiagCross;

    Canvas.Ellipse(0, 0, Image1.Width, Image1.Height);

  end;

end;


OnDrawPanel, Canvas, Draw Example

The following code is the OnDrawPanel event handler of a status bar.  It draws each panel of the status bar, adding text and icons stored in ImageList1. The image list contains as many icons as there are header sections.

procedure TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar;

  Panel: TStatusPanel; const Rect: TRect);

begin

with StatusBar1.Canvas do

  begin

    Brush.Color := clRed;

    FillRect(Rect);

    Font.Color := clYellow;

    ImageList1.Draw(StatusBar1.Canvas,Rect.Left,Rect.Top,Panel.Index);

    TextOut(Rect.left + 30, Rect.top + 2, 'Panel' + IntToStr(Panel.Index));

  end;

end;


Capabilities Example

The following code determines whether the device opened by the media player control MediaPlayer1 uses a window to display output. If so, the output displays in a form named Form2:

if mpUsesWindow in MediaPlayer1.Capabilities then

  MediaPlayer1.Display := Form2;


Cascade Example

This code runs when the user chooses a menu item called Window | Cascade:

procedure TForm1.Cascade1Click(Sender: TObject);

begin

  Cascade;

end;


ColCount, RowCount, Cells Example

This code fills each cell with a number. The numbers are arranged in consecutive order by rows.

procedure TForm1.Button1Click(Sender: TObject);

var

  I, J, K : Integer;

begin

  K := 0;

  with StringGrid1 do

    for I := 0 to ColCount - 1 do

      for J:= 0 to RowCount - 1 do

        begin

          K := K + 1;

          Cells[I,J] := IntToStr(K);

        end;

end;


ClassType, ClassParent Example

This example shows how to obtain the ancestry of a component using the ClassType and ClassParent properties.  It uses a button and a list box on a form. When the user clicks the button, the name of the button’s class and the names of its parent classes are added to the list box.

procedure TForm1.Button1Click(Sender: TObject);

var

  ClassRef: TClass;

begin

  ListBox1.Clear;

  ClassRef := Sender.ClassType;

  while ClassRef <> nil do

  begin

    ListBox1.Items.Add(ClassRef.ClassName);

    ClassRef := ClassRef.ClassParent;

  end;

end;

The list box contains the following strings after the user clicks the button:

TButton

TButtonControl

TWinControl

TControl

TComponent

TPersistent

TObject


ClientHeight example

This example reduces the height of the form's client area by half when the user clicks the button on the form:

procedure TForm1.Button1Click(Sender: TObject);

begin

  ClientHeight := ClientHeight div 2;

end;

Note that only the client area is halved, not the entire form.


ClientRect Example

The following code uses ClientRect to find and draw a line from the top left to the bottom right of the current control.  It assumes that the current object has a Canvas property, such as can be found on descendants of TGraphicControl or TCustomControl.

with ClientRect do

begin

  Canvas.MoveTo(Left,Top);

  Canvas.LineTo(Right, Bottom);

end;


OnMouseDown, OnMouseMove, OnMouseUp, Panels, Text Example

The following example requires a form with a four-paneled status bar.  (Set the Width of the status panels to 150 before running this example).  When the user presses a mouse button, moves the mouse, and releases the mouse button, a rectangle is drawn on the form. When the mouse button is released, the rectangle appears on the form’s canvas. Its top-left and bottom-right corners are defined by the location of the mouse pointer when the user pressed and released the mouse button.  While the user drags the mouse, the location of the top, left, bottom, and right sides of the rectangle are displayed in the status bar.

var

StartX, StartY: Integer;{Declare in interface section of form’s unit}

{Use this code as the OnMouseDown event handler of the form:}

procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

begin

  StartX := X;

  StartY := Y;

end;

{Use this code as the OnMouseUp event handler of the form:}

procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

begin

  Form1.Canvas.Rectangle(StartX, StartY, X, Y);

  StatusBar1.Panels[0].Text := '';

  StatusBar1.Panels[1].Text := '';

  StatusBar1.Panels[2].Text := '';

  StatusBar1.Panels[3].Text := '';

end;

{Use this code as the OnMouseMove event handler of the form:}

procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);

begin

  if ssLeft in Shift then { make sure button is down }

  begin

    if Y > StartY then

      begin

      StatusBar1.Panels[0].Text := 'Top: ' + IntToStr(StartY);

      StatusBar1.Panels[2].Text := 'Bottom: ' + IntToStr(Y);

      end

    else

      begin

      StatusBar1.Panels[0].Text := 'Top: ' + IntToStr(Y);

      StatusBar1.Panels[2].Text := 'Bottom: ' + IntToStr(StartY);

      end;

    if X > StartX then

      begin

      StatusBar1.Panels[1].Text := 'Left: ' + IntToStr(StartX);

      StatusBar1.Panels[3].Text := 'Right: ' + IntToStr(X);

      end

    else

      begin

      StatusBar1.Panels[1].Text := 'Left: ' + IntToStr(X);

      StatusBar1.Panels[3].Text := 'Right: ' + IntToStr(StartX);

      end;

  end;

end;


Color Example

The following code changes the color of a shape control using the Color dialog box. The example displays the Color dialog box when the Button1 button is clicked, allowing the user to select a color with the dialog box. When a color value is selected with the dialog box, it is assigned to the shape control.

procedure TForm1.Button1Click(Sender: TObject);

begin

  if ColorDialog1.Execute then Shape1.Color := ColorDialog1.Color;

end;


ComponentCount, Components,RemoveComponent, InsertComponent example

This code fragment moves any nonvisual components on the form into a separate data module.  Note that the components are removed starting with the last component, so that the unprocessed portion of the Components array does not change.

Note: This code does not save the form or data module to disk after the nonvisual components are moved.  If executed at runtime, the effect will not persist.

var

  I: Integer;

  Temp: TComponent;

begin

  for I := ComponentCount - 1 downto 0 do

  begin

    Temp := Components[I];

    if not (Temp is TControl) then

    begin

      RemoveComponent(Temp);

      DataModule2.InsertComponent(Temp);

    end;

  end;

end;


ConfigMode, AddStandardAlias, ExtractFilePath example

The following example specifically creates a local alias pointing to the application directory.  Note that this alias is automatically deleted when the application terminates and will not be saved to the BDE configuration file.

begin

  with Session do

  begin

    ConfigMode := cmSession;

  try

    AddStandardAlias('TEMPDB', ExtractFilePath(ParamStr(0)), 'PARADOX');

  finally

      ConfigMode := cmAll;

  end;

end;


ControlCount, Controls, Top Example
CountrolCount, Controls, Top Example

This example uses an updown control and a group box on a form, with several controls contained within the group box. When the updown control is clicked, the controls within the group box are moved in the appropriate direction.

procedure TForm1.UpDown1Click(Sender: TObject;Button: TUDBtnType);

var

  I: Integer;

  ChildControl: TControl;

begin

  for I:= 0 to GroupBox1.ControlCount -1 do

  begin

    ChildControl := GroupBox1.Controls[I];

    if Button = btNext then

      ChildControl.Top := ChildControl.Top + 15

    else

      ChildControl.Top := ChildControl.Top - 15;

  end;

end;


CopyToClipboard, PasteFromClipboard Example

This example uses an edit box, a rich edit control, and a button on a form. When the user clicks the button, text is copied from the rich edit control and pasted into the edit box.  Note that only the text is pasted. If the rich edit control includes any formatting information that is not pasted into the edit control.  If the destination were a rich edit control, the formatting information would be copied as well.

procedure TForm1.Button1Click(Sender: TObject);

begin

  RichEdit1.SelectAll;

  RichEdit1.CopyToClipboard;

  Edit1.Clear;

  Edit1.PasteFromClipboard;

  RichEdit1.SetFocus;

end;


SelectAll, CutToClipboard Example

This example uses an edit box, a rich edit control, and a button on a form. When the user clicks the button, text is cut from the rich edit control and pasted into the edit box.  Note that only the text is pasted. If the rich edit control includes any formatting information that is not pasted into the edit control.  If the destination where a rich edit control, the formatting information would be copied as well.

procedure TForm1.Button1Click(Sender: TObject);

begin

  RichEdit1.SelectAll;  { ensure that all the text is cut, not just the current selection }

  RichEdit1.CutToClipboard;

  Edit1.Clear;

  Edit1.PasteFromClipboard;

  RichEdit1.SetFocus;

end;


 Count, Items, IsNull Example

{ Assign -1 to any integer parameter which does not have a value }

for I := 0 to Params.Count - 1 do

  if (Params.Items[I].IsNull) and

     (Params.Items[I].DataType = ftInteger) then

    { Items is the default property, so you can omit its name }

    Params[I].AsInteger := -1;


Create,CreateBlobStream, Edit, CopyFrom Example

The following example copies the data in the Notes field of Table1 to the Remarks field of Table2.

procedure TForm1.Button1Click(Sender: TObject);

var

  Stream1, Stream2 : TBlobStream;

begin

  Stream1 := TBlobStream.Create(Table1Notes, bmRead);

  try

    Table2.Edit;

    { here’s a different way to create a blob stream }

    Stream2 := Table2.CreateBlobStream(Table2.FieldByName('Remarks'), bmReadWrite);

    try

      Stream2.CopyFrom(Stream1, Stream1.Size);

      Table2.Post;

    finally

      Stream2.Free;

    end;

  finally

    Stream1.Free;

  end;

end;


Table Creation Example

The following example shows how to create a table.

{ Don't overwrite an existing table }

if not Table1.Exists then begin

  with Table1 do begin

    { The Table component must not be active }

    Active := False;

    { First, describe the type of table and give }

    { it a name }

    DatabaseName := 'DBDEMOS';

    TableType := ttParadox;

    TableName := 'CustInfo';

    { Next, describe the fields in the table }

    with FieldDefs do begin

      Clear;

      with AddFieldDef do begin

        Name := 'Field1';

        DataType := ftInteger;

        Required := True;

      end;

      with AddFieldDef do begin

        Name := 'Field2';

        DataType := ftString;

        Size := 30;

      end;

    end;

    { Next, describe any indexes }

    with IndexDefs do begin

      Clear;

      { The 1st index has no name because it is

      { a Paradox primary key }

      with AddIndexDef do begin

        Name := '';

        Fields := 'Field1';

        Options := [ixPrimary];

      end;

      with AddIndexDef do begin

        Name := 'Fld2Indx';

        Fields := 'Field2';

        Options := [ixCaseInsensitive];

      end;

    end;

    { Call the CreateTable method to create the table }

    CreateTable;

  end;

end;


CustomSort Example

The following code orders a list view in reverse alphabetical order on the click of a button. The callback function CustomSortProc calls the global CompareText function and negates its return value.

function CustomSortProc(Item1, Item2: TListItem; ParamSort: integer): integer; stdcall;

begin

  Result := -CompareText(Item1.Caption,Item2.Caption);

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

ListView1.CustomSort(@CustomSortProc, 0);

end;


Database Example

{ Do a transaction }

with Table1.Database do

begin

  StartTransAction;

{ Post some records with Table1 }

  Commit;

end;


Active, DatabaseName Example

{ The table should be closed when changing the database }

Table1.Active := False;

try

{ First try to use an alias }

  Table1.DatabaseName := 'Delphi_Demos';

  Table1.Active := True;

except

  on EDatabaseError do

    { If that fails, try to use the drive and directory }

    Table1.DatabaseName := 'c:\delphi\demos\database';

    Table1.Active := True;

end;


DBHandle Example

This example uses the DBHandle property to make a call to the DbiGetDirectory BDE API function. Because it uses a BDE API function directly, you must add uses BDE; in the implementation section of the unit.

procedure TForm1.Button1Click(Sender: TObject);

var

  Directory: String;

begin

  SetLength(Directory, 250);

  if DbiGetDirectory(Table1.DBHandle, True, PChar(Directory)) <> dbiErr_None then

    MessageDlg('Error getting default directory', mtError, [mbOk], 0)

  else

    ShowMessage('Default directory = ' + Directory);

  if DbiGetDirectory(Table1.DBHandle, False, PChar(Directory)) <> dbiErr_None then

    MessageDlg('Error getting current working directory', mtError, [mbOk], 0)

  else

    ShowMessage('Current working directory = ' + Directory);

end;


Items, Delete Example

The following example deletes an item in the tree view when the user clicks on it if a checkbox is checked.

procedure TForm1.TreeView1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

var

  HT : THitTests;

begin

if (CheckBox1.Checked and (Sender is TTreeView)) then

  begin

  with Sender as TTreeView do

    begin

    HT := GetHitTestInfoAt(X,Y);

    if (htOnItem in HT) then

      Items.Delete(GetNodeAt(X,Y));

    end;

  end;

end;


DeleteTable Example

with Table1 do

begin

  Active := False; { can’t delete table if it is active }

  { set properties to identify the table that should be deleted }

  DatabaseName := 'DBDEMOS';

  TableName := 'Customer';

  TableType := ttParadox;

  { finally, delete the table }

  DeleteTable;

end;


DisableControls, EnableControls, Eof Example

Usually DisableControls is called within the context of a try...finally block that reenables the controls even if an exception occurs. For example:

with CustTable do

begin

  DisableControls;

  try

    First;

    while not Eof do

    begin

     { Process each record here }

     Next;

    end;

  finally

    EnableControls;

  end;

end;


DisplayText Example

The following code displays a message that the current value is invalid:

MessageDlg(Field1.DisplayText + ' is invalid', mtWarning, [mbOK], 0);


Drive, Directory Example

The following example assumes that a drive combo box, a file list box, and a directory list box are on a form. Add this code as the OnChange event handler for the drive combo box.  When the user changes the drive using the combo box, the directory list box and file list box will update to reflect the new drive and the current directory on that drive.

procedure TForm1.DriveComboBox1Change(Sender: TObject);

begin

  DirectoryListBox1.Drive := DriveComboBox1.Drive;

  FileListBox1.Drive := DriveComboBox1.Drive;

  FileListBox1.Directory := DirectoryListBox1.Directory;

end;


EditKey, GotoKey Example

The following code uses the EditKey and GotoKey methods to move to a particular record on Table1.  The actual field values are not changed when making the assignments because of the call to EditKey.

with Table1 do

begin

  EditKey;

  FieldByName('State').AsString := 'CA';

  FieldByName('City').AsString := 'Santa Barbara';

  GotoKey;

end;


Eject, Close, Enabled Example

This code ejects the CD from the CD-ROM player and shuts down the media player after 10 seconds. For the code to run correctly, you must have your CD audio device installed correctly, and the device must have software-ejecting capabilities.

var

  TimerOver: Word;

procedure TForm1.FormClick(Sender: TObject);

begin

  MediaPlayer1.DeviceType := dtCDAudio;

  MediaPlayer1.Open;

  MediaPlayer1.Play;

end;

procedure TForm1.Timer1Timer(Sender: TObject);

begin

  if TimeOver = 10 then

  begin

    MediaPlayer1.Eject;

    MediaPlayer1.Close;

    { disable the timer, as we are done }

    Timer1.Enabled := False;

  end

  else

    Inc(TimeOver);

end;


Empty Example

The following loads a file into Graphic1 if it does not already contain a graphic.

if Graphic1.Empty then Graphic1.LoadFromFile('myfile.bmp');


EmptyTable Example

The following example uses a table component to empty a database table.  First the properties of the table component are set to specify the table that should be emptied.

with Table1 do

begin

  Active := False;

  DatabaseName := 'Delphi_Demos';

  TableName := 'CustInfo';

  TableType := ttParadox;

  EmptyTable;

end;


EndPos, TrackLength Example

The following procedure begins playing the .WAV audio file from the beginning of the file to middle only.

procedure TForm1.Button1Click(Sender: TObject);

begin

  with MediaPlayer1 do

  begin

    FileName := 'D:\WINAPPS\SOUNDS\CARTOON.WAV';

    Open;

    EndPos := TrackLength[1] div 2;

    Play;

  end;

end;


 Error, ErrorMessage Example

The following code opens MediaPlayer1. If an exception occurs, a message window displays the error number and string.

procedure TForm1.BitBtn1Click(Sender: TObject);

var

  MyErrorString: String;

begin

  try

    MediaPlayer1.Open;

  except

    MyErrorString := 'ErrorCode: ' + IntToStr(Error) + #13#10;

    MessageDlg(MyErrorString + MediaPlayer1.ErrorMessage, mtError, [mbOk], 0);

  end;

end;


 Exclusive, MessageBox Example

{ Try to open Table1 with Exclusive True }

{ First, close Table1 }

Table1.Active := False;

repeat { until successful or Cancel button is pressed }

  try

    Table1.Exclusive := True; { See if it will open }

    Table1.Active := True;

    Break; { If no error, exit the loop }

  except

    on EDatabaseError do

    { Ask if it is OK to retry. If it isn’t, reraise to abort }

      if Application.MessageBox(

        'Could not open Table1 exclusively - Try again?',

        'Open Error',

        MB_OKCANCEL + MB_DEFBUTTON1) <> IDOK then

        raise;

{ Otherwise resume the repeat loop }

  end;

until False;


Prepare, ExecProc Example

The following code executes the stored procedure:

StoredProc1.Params[0].AsString := Edit1.Text;

StoredProc1.Prepare;

StoredProc1.ExecProc;


SQL, ExecSQL Example

Query1.Close;

Query1.SQL.Clear;

Query1.SQL.Add('Delete from Country where Name = ''Argentina''');

Query1.ExecSQL;


FieldCount, Fields Example

If an application needs to access all the field components for each column of the TCustomDBGrid in order, Fields can be used with the FieldCount property.

with GridDataLink1 do

  for I := 0 to FieldCount-1 do

    if Fields[I] <> nil then

    begin

     { Fields[I] is the next column’s field component at runtime }

    end;


FieldCount, Fields, FieldName Example

This example displays a message box with the names of all fields in the table.

procedure TForm1.Button2Click(Sender: TObject);

var

   i: Integer;

   Info: String;

begin

   Info := 'The fields of table ' + Table1.TableName +

           ' are:'#13#10#13#10;

   for i := 0 to Table1.FieldCount - 1 do

      Info := Info + Table1.Fields[i].FieldName + #13#10;

  ShowMessage(Info);

end;


FilterIndex, Files, Strings, Append Example

This example uses an Open dialog box, a memo, and a button on a form. When the user clicks the button, the Open dialog box appears. When the user selects files in the dialog box and chooses the OK button, the first line from each of the files is added to the memo.

procedure TForm1.Button1Click(Sender: TObject);

var

  I: integer;

  F: TextFile;

  FirstLine: string;

begin

  OpenDialog1.Options := [ofAllowMultiSelect, ofFileMustExist];

  OpenDialog1.Filter := 'Text files (*.txt)|*.txt|All files (*.*)|*.*';

  OpenDialog1.FilterIndex := 2; { start the dialog showing all files }

  if OpenDialog1.Execute then

    with OpenDialog1.Files do

      for I := 0 to Count - 1 do

      begin

        AssignFile(F, Strings[I]);  { next file in Files property }

        Reset(F);

        Readln(F, FirstLine);  { Read the first line out of the file }

        Memo1.Lines.Append(FirstLine);  { Add the line to the memo }

        CloseFile(F);

      end;

end;


AddStrings, Find Example
Add, AddStrings, Find Example

This example uses a list box and a label on a form. When the application runs, a string list object is created and three strings are added to it. The Find method searches the strings to look for a match with the string ‘Flowers’. If the string is found, all the strings in the string list are added to the list box, and the index value of the ‘Flowers’ string appears in the caption of the label control.

procedure TForm1.FormCreate(Sender: TObject);

var

  MyList: TStringList;

  Index: Integer;

begin

  MyList := TStringList.Create;

  try

    MyList.Add('Animals');

    MyList.Add('Flowers');

    MyList.Add('Cars');

    MyList.Sort;   { Find will only work on sorted lists! }

    if MyList.Find('Flowers', Index) then

    begin

      ListBox1.Items.AddStrings(MyList);

      Label1.Caption := 'Flowers has an index value of ' + IntToStr(Index);

    end;

  finally

  MyList.Free;

  end;

end;


FindField, AsString Example

with Table1 do

begin

  { This is the safe way to change 'CustNo' field }

  FindField('CustNo').AsString := '1234';

 { This is *not* the safe way to change 'CustNo' field }

  Fields[0].AsString := '1234';

end;


SetFocus, SelStart, SelLength Example

The following OnFind event handler searches a memo component for the text specified in the FindText property of a find dialog component. If found, the first occurrence of the text in Memo1 is selected. The code uses the Pos function to compare strings, and stores the number of characters to skip when determining the selection position in the SkipChars variable. Because there is no handling of case, whole word, or search direction in this algorithm, it is assumed that the Options property of FindDialog1 was set to [frHideMatchCase, frHideWholeWord, frHideUpDown].

procedure TForm1.FindDialog1Find(Sender: TObject);

var

  I, J, PosReturn, SkipChars: Integer;

begin

  for I := 0 to Memo1.Lines.Count do

  begin

    PosReturn := Pos(FindDialog1.FindText,Memo1.Lines[I]);

    if PosReturn <> 0 then {found!}

    begin

      Skipchars := 0;

      for J := 0 to I - 1 do

        Skipchars := Skipchars + Length(Memo1.Lines[J]);

      SkipChars := SkipChars + (I*2);

      SkipChars := SkipChars + PosReturn - 1;

      Memo1.SetFocus;

      Memo1.SelStart := SkipChars;

      Memo1.SelLength := Length(FindDialog1.FindText);

      Break;

    end;

  end;

end;


OnActiveControlChange, Focused Example

This example uses the OnActiveControlChange event to detect when focus changes on the form.  When focus changes, the active control is drawn in red.  All other controls are given the window color from the control panel.

type

  TForm1 = class(TForm)

    Edit1: TEdit;

    Memo1: TMemo;

    Button1: TButton;

    procedure FormCreate(Sender: TObject);

  private

    { Private declarations }

  public

    procedure ColorControl(Sender: TObject);

  end;

var

  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.ColorControl(Sender: TObject);

var

  I : Integer;

begin

  for I:= 0 to ControlCount -1 do

  begin

    if Controls[I] is TWinControl then

    begin

      if (Controls[I] as TWinControl).Focused then

        Controls[I].Color := clRed

      else

        Controls[I].Color := clWindow;

    end;

end;

procedure TForm1.FormCreate(Sender: TObject);

begin

  Screen.OnActiveControlChange := ColorControl;

end;


OnDropDown, Sorted, Clear, BeginUpdate, EndUpdate Example

This example fills the list of a combo box with the set of available fonts when the user drops down the list.  The list is regenerated every time the list is dropped down, so if the application adds or removes fonts, the combo box stays current.

procedure Form1.ComboBox1DropDown(Sender: TObject);

begin

  with ComboBox1 do

  begin

    Items.BeginUpdate; { prevent repaints until done }

    Items.Clear; { empty the list of any old values }

    Sorted := True; { make sure the font names are sorted }

    Items := Screen.Fonts; { add the current list of fonts }

    Items.EndUpdate; {reenable painting }

  end;

end;


FormatCount, Formats Example

The following code adds each format on the Clipboard to ListBox1 when Button1 is clicked. Note: You will need to add Clipbrd to the uses clause

procedure TForm1.Button1Click(Sender: TObject);

var

  I: Integer;

begin

  for I := 0 to Clipboard.FormatCount-1 do

    ListBox1.Items.Add(IntToStr(Clipboard.Formats[I]));

end;


MenuItem, FormCount, Forms Example

This example assumes that the main form of the application has a main menu with a Windows menu item.  The following code adds a separator, and the name of all forms to the Windows menu.

var

  NewItem: TMenuItem;

  I : integer;

begin

  { first create the separator }

  NewItem := TMenuItem.Create(Self);

  NewItem.Caption := '-';

  { add the new item to the Windows menu }

  Windows.Add(NewItem);

  { now create and add a menu item for each form }

  for  I := 0 to Screen.FormCount-1 do

  begin

    NewItem := TMenuItem.Create(Self);

    NewItem.Caption := Screen.Forms[I].Name;

    Windows.Add(NewItem);

  end;

end;


FormStyle example

This example ensures the main form of the application is an MDI parent:

constructor TForm1.Create(TComponent* Owner);

begin

  inherited Create;

  if FormStyle <> fsMDIForm then

    	  FormStyle := fsMDIForm;

  if FormStyle = fsMDIForm then

    	  Edit1.Text := 'MDI form'

  else

    //This line never executes

    Edit1.Text := 'Not an MDI form';

end;


Rect, TextRect, FrameRect Example
Rect, TextRect FrameRect Example

The following code displays the text “Hello, world!” in a rectangle defined by the coordinates (10, 10) and (100, 100). After displaying the text with the TextRect method, the code draws a black, vertical line frame around the rectangle.

var

TheRect: TRect;

begin

Form1.Canvas.TextRect(TheRect,10,10,'Hello, world!');

Form1.Canvas.Brush.Color := clBlack;

Form1.Canvas.FrameRect(TheRect);

end;


GetAliasNames, Count Example

MyStringList := TStringList.Create;

try

  Session.GetAliasNames(MyStringList);

  { fill a list box with alias names for the user to select from }

  for I := 0 to MyStringList.Count - 1 do

    ListBox1.Items.Add(MyStringList[I]);

finally

  MyStringList.Free;

end;


GetAliasParams Example

MyStringList := TStringList.Create;

try

  Session.GetAliasParams('DBDEMOS',MyStringList);

  { fill a list box with driver names for the user to select from }

  ListBox1.Items := MyStringList;

finally

  MyStringList.Free;

end;


Open, Close, GetAsHandle Example

The following code locks the memory for text on the Clipboard, then converts the text to a Pascal-style string.

var

  MyHandle: THandle;

  TextPtr: PChar;

  MyString: string;

begin

  ClipBoard.Open;

try

  MyHandle := Clipboard.GetAsHandle(CF_TEXT);

  TextPtr := GlobalLock(MyHandle);

  MyString := StrPas(TextPtr);

  GlobalUnlock(MyHandle);

finally

  Clipboard.Close;

end;

end;


GetComponent, SetComponent Example

This example uses a button and a group box on a form. When the user clicks the button, the button is copied to the Clipboard and then retrieved from the Clipboard and placed in the new parent of the button, the group box. The name of the original button is changed to avoid having two components with the same name at the same time.

implementation

uses Clipbrd;

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);

begin

  { copy the button to the clipboard }

  Clipboard.SetComponent(Button1);

  { rename the button which is still on the form }

  Button1.Name := 'OriginalButton';

  { Now retrieve the button from the clipboard }

  { and add it to GroupBox1 }

  { Note that the clipboard button is named Button1, while }

  { the source button has been renamed to 'OriginalButton' }

  Clipboard.GetComponent(Self, GroupBox1);

end;

initialization

  RegisterClasses([TButton]);{ registers the TButton class }

end.


IsBlob, DataSize, GetData, DisplayName Example

{ Retrieve the "raw" data from Field1 }

with Field1 do

begin

  if not IsBlob  { this does not work for BLOB fields }

  begin

    { Allocate space }

    GetMem(MyBuffer, DataSize);

    try

      if not GetData(MyBuffer) then

         MessageDlg(DisplayName + ' is NULL', mtInformation, [mbOK], 0)

      else

         { Do something with the data };

    finally

      { Free the space }

      FreeMem(MyBuffer, DataSize);

    end;

  end;

end;


ParamByName, GetData, GetDataSize Example

var Buffer: Pointer;

begin

  { Allocate enough space to hold the CustNo data }

  GetMem(Buffer, Query1.ParamByName('CustNo').GetDataSize);

  try

  { Retrieve the data }

    Query1.ParamByName('CustNo').GetData(Buffer);

    {  now do something with the data }

  finally

    FreeMem(MyBuffer);

  end;

end;


GetDatabaseNames Example

MyStringList := TStringList.Create;

try

  Session.GetDatabaseNames(MyStringList);

  { fill a list box with database names for the user to select from }

  ListBox1.Items := MyStringList;

finally

  MyStringList.Free;

end;


GetDriverNames Example

MyStringList := TStringList.Create;

try

  Session.GetDriverNames(MyStringList);

  { fill a list box with driver names for the user to select from }

  ListBox1.Items := MyStringList;

finally

  MyStringList.Free;

end;


GetDriverParams Example

MyStringList := TStringList.Create;

try

  Session.GetDriverParams(MyStringList);

  { fill a list box with parameter names for the user to select from }

  ListBox1.Items := MyStringList;

finally

  MyStringList.Free;

end;


GetFirstNode, GetNext Example

The following example adds the Text for all items in the tree view to the list box.

var

  CurItem: TTreeNode;

begin

  CurItem := TreeView1.Items.GetFirstNode;

  while CurItem <> nil do

  begin

    ListBox1.Items.Add(CurItem.Text);

    CurItem := CurItem.GetNext;

  end;

end;


GetFormImage, Picture, Assign Example

This example uses an image, a button, and a shape component on a form. When the user clicks the button, an image of the form is stored in the FormImage variable and copied to the Clipboard. Then image of the form in then copied back to the image component, producing an interesting result, especially if the button is clicked multiple times.

procedure TForm1.Button1Click(Sender: TObject);

var

  FormImage: TBitmap;

begin

  FormImage := GetFormImage;

  try

    Clipboard.Assign(FormImage);

    Image1.Picture.Assign(Clipboard);

  finally

    FormImage.Free;

  end;

end;

procedure TForm1.FormCreate(Sender: TObject);

begin

  Shape1.Shape := stEllipse;

  Shape1.Brush.Color := clLime;

  Image1.Stretch := True;

end;


OpenCurrent, GetItemPath Example

This example uses a directory list box, a button, and a label on a form. When the user selects a directory in the directory list box and clicks the button, the selected directory opens, and the path of the second directory displayed in the list box appears as the caption of the label.

procedure TForm1.Button1Click(Sender: TObject);

begin

  DirectoryListBox1.OpenCurrent;

  Label1.Caption := DirectoryListBox1.GetItemPath(1);

end;


GetResults, ParamByName Example

StoredProc1.Open;

while not StoredProc1.EOF do

begin

StoredProc1.Next;

{Do Something}

end;

StoredProc1.GetResults;

Edit1.Text := StoredProc1.ParamByName('Output');


GetSelTextBuf, SelText Example

procedure TForm1.Button1Click(Sender: TObject);

var

  Buffer: PChar;

  Size: Integer;

begin

  Size := Edit1.SelLength; {Get length of selected text in Edit1}

  Inc(Size); {Add room for null character}

  GetMem(Buffer, Size); {Creates Buffer dynamic variable}

  Edit1.GetSelTextBuf(Buffer,Size); {Puts Edit1.Text into Buffer}

  Edit2.Text := StrPas(Buffer);{Converts Buffer into Pascal-style string}

  FreeMem(Buffer, Size);{Frees memory allocated to Buffer}

end;

Note: the same thing could be accomplished more simply as follows:

procedure TForm1.Button1Click(Sender: TObject);

begin

  Edit2.Text := Edit1.SelText;

end;


GetStaticRect Example

The following example is taken from TOpenPictureDialog. It calculates the preview rectangle based on the difference between the client area of the dialog and the static area of the standard controls.

procedure TOpenPictureDialog.DoShow;

var

  PreviewRect, StaticRect: TRect;

begin

  { Set preview area to entire dialog }

  GetClientRect(Handle, PreviewRect);

  StaticRect := GetStaticRect;

  { Move preview area to right of static area }

  PreviewRect.Left := StaticRect.Left + (StaticRect.Right - StaticRect.Left);

...


GetStoredProcNames Example

MyStringList := TStringList.Create;

try

  Session.GetStoredProcNames('IB_EMPLOYEE', MyStringList);

  { fill a list box with stored procedure names

   for the user to select from }

  ListBox1.Items := MyStringList;

finally

  MyStringList.Free;

end;


GetTableNames Example

MyStringList := TStringList.Create;

try

  Session.GetTableNames('DBDEMOS', '*.db',False, False, MyStringList);

  { Add the table names to a list box }

  ListBox1.Items = MyStringList;

finally

  MyStringList.Free;

end;


GetTextLen, GetTextBuf, Text Example

This example copies the text in an edit box into a null-terminated string, and puts this string in another edit box when the user clicks the button on the form.

procedure TForm1.Button1Click(Sender: TObject);

var

  Buffer: PChar;

  Size: Byte;

begin

  Size := Edit1.GetTextLen;       {Get length of string in Edit1}

  Inc(Size);                      {Add room for null character}

  GetMem(Buffer, Size);           {Creates Buffer dynamic variable}

  Edit1.GetTextBuf(Buffer,Size);  {Puts Edit1.Text into Buffer}

  Edit2.Text := StrPas(Buffer);   {Converts Buffer to a Pascal-style string}

  FreeMem(Buffer, Size);{Frees memory allocated to Buffer}

end;

Note: the same thing could be accomplished more simply as follows:

procedure TForm1.Button1Click(Sender: TObject);

begin

  Edit2.Text := Edit1.Text;

end;


Glyph, NumGlyphs Example

These lines of code load a four-image bitmap into the Glyph property of a speed button, and specify the appropriate value for the NumGlyphs property:

SpeedButton1.Glyph.LoadFromFile('MYBITMAP.BMP');

SpeedButton1.NumGlyphs := 4;


SetKey, GotoNearest Example

with Table1 do

begin

  SetKey;

  FieldByName('State').AsString := 'CA';

  FieldByName('City').AsString := 'Santa';

  GotoNearest;

end;


Graphic Example

The following code draws the graphic in Picture1 in the top-left corner PaintBox1.

PaintBox1.Canvas.Draw(0,0 Picture1.Graphic);


Handle Example

The following code uses the Windows API function ShowWindow to display Form2 as an icon, but does not activate it.

ShowWindow(Form2.Handle, SW_SHOWMINNOACTIVE);


OnIdle, HandleMessage Example

The following code demonstrates background processing using the OnIdle event, and using the HandleMessage method to permit messages or background processing to get through.

Note:	You must add MyIdleHandler to the Form1 methods.

var

{ global variables to show the order of events. }

  XPos, YPos, Delta: integer;

{ This is a utility procedure to display messages }

{ add this at the beginning of the implementation section }

procedure StatusMsg(MyForm : TForm; Canvas : TCanvas; Message : string; Bkg : Boolean);

begin

  if not bkg then

    Canvas.Font.Style := [fsBold]; {foreground messages are bold }

  Canvas.TextOut(XPos, YPos, Message);

  if not bkg then

    Canvas.Font.Style := [];

  { change Xpos and YPos to prepare for the next message }

  Ypos := Ypos + Delta;

  if YPos >= MyForm.ClientHeight then

  begin

    YPos := 10;

    Xpos := Xpos + 100;

  end;

  if (Xpos >= MyForm.ClientWidth - 100) then

  begin

    if (Canvas.Font.Color = clRed) then

      Canvas.Font.Color := clBlack;

    else

      Canvas.Font.Color := clRed;

    Xpos := 10;

  end;

end;

{This is the Form’s OnCreate event handler.  }

{ It initializes global variables and sets the  the OnIdle event handler }

procedure TForm1.FormCreate(Sender: TObject);

begin

  Button1.Caption := 'Do not yield';

  Button2.Caption := 'Handle Message';

  Application.OnIdle:= MyIdleHandler;

  XPos := 10;

  YPos := 10;

  Delta := Abs(Canvas.Font.Height) + 1;

 end;

{ This is the OnIdle event handler. It is set in the Form’s OnCreate event handler, so you need only add it as a private method of the form.  Usually it would perform some background processing for the application.  This one simply writes a message to let you know when it’s there. }

procedure TForm1.MyIdleHandler(Sender: TObject; var Done: Boolean);

begin

  StatusMsg(TForm1, Canvas, 'This represents a background process.', True);

end;

  { Set this method as the OnClick event handler of Button1.  It performs a calculation without yielding to other messages or idle time. }

procedure TForm1.Button1Click(Sender: TObject);

var

  I, J, X, Y: Word;

begin

  StatusMsg(TForm1, Canvas, 'The Button1Click handler is starting', False);

  I := 0;

  J := 0;

  while I < 10 do

  begin

    Randomize;

    while J < 10 do

    begin

      Y := Random(J);

      Inc(J);

    end;

    X := Random(I);

    Inc(I);

  end;

  StatusMsg(TForm1, Canvas, 'The Button1Click handler is done', False);

end;

{ Set this method as the OnClick event handler of Button2.  It performs a calculation but calls HandleMessage to allow idle time or asynchronous message processing. }

procedure TForm1.Button2Click(Sender: TObject);

var

  I, J, X, Y: Word;

begin

 StatusMsg(TForm1, Canvas, 'The Button2Click handler is starting', False);

  I := 0;

  J := 0;

  while I < 10 do

  begin

    Randomize;

    while J < 10 do

    begin

      Y := Random(J);

      Inc(J);

      Application.HandleMessage; { yield to OnIdle or other messages }

    end;

    X := Random(I);

    Inc(I);

  end;

  StatusMsg(TForm1, Canvas, 'The Button2Click handler is done', False);

end;


HasFormat, AsText Example

This example uses a button and an edit control on a form. When the user clicks the button, any text on the clipboard is pasted into the edit control.  If there is no text on the clipboard, a message box appears.

Note:	To use this example, you must add Clipbrd to the uses clause.

procedure TForm1.Button1Click(Sender: TObject);

begin

if Clipboard.HasFormat(CF_TEXT) then

  Edit1.Text := Clipboard.AsText

else

  MessageDlg('There is no text on the Clipboard', mtInformation,

        [mbOK],0);

end;


HelpCommand Example

This example uses a bitmap button on a form. When the user clicks the button, the Help contents screen of the specified Help file appears.

procedure TForm1.BitBtn1Click(Sender: TObject);

begin

  Application.HelpFile := 'MYHELP.HLP';

  Application.HelpCommand(HELP_FINDER, 0);

end;


HelpContext Example

This example uses a bitmap button on a form. When the user clicks the button, the screen with the context number of 714 in the DATA.HLP Help file appears.  Note that using constants for HelpContext numbers makes the code easier to read:

const

  DATANOTFOUND = 714;

procedure TForm1.BitBtn1Click(Sender: TObject);

begin

  Application.HelpFile := 'DATA.HLP';

  Application.HelpContext(DATANOTFOUND);

end;


HelpFile, HelpJump Example

This example uses a bitmap button on a form. When the user clicks the button, the Help screen describing the HelpJump property in the Help file appears, because the HelpJump property screen has the a JumpID string of ‘TApplication_HelpJump'. (Note: In the following example, replace "VCL.HLP" with the full name of the VCL Help file that accompanies this product.)

procedure TForm1.BitBtn1Click(Sender: TObject);

begin

  Application.HelpFile := 'vcl.hlp';

  Application.HelpJump('TApplication_HelpJump');

end;


Hide Example

This code uses a button and a timer on a form. When the user clicks the button, the form disappears for the period of time specified in the Interval property of the timer control, then the form reappears:

procedure TForm1.Button1Click(Sender: TObject);

begin

  Timer1.Enabled := True;

  Hide;

end;

procedure TForm1.Timer1Timer(Sender: TObject);

begin

  Visible := True;

  Timer1.Enabled := False;

end;


Hint, ShowHint Example

This example uses an edit box and a list box on a form. Items are added to the list box and a Help Hint is assigned to both controls. The last statement enables the Help Hints for the entire application.

procedure TForm1.FormCreate(Sender: TObject);

var

  I: Integer;

begin

  Edit1.Hint := 'Enter your name';

  Edit1.ShowHint := True;

  with ListBox1 do

  begin

    for I := 1 to 10 do

      Items.Add('Item ' + IntToStr(I));

    Hint := 'Select an item';

    ShowHint := True;

  end;

  Application.ShowHint := True;

end;

Note: To see a example that displays the hints of controls in some place other than in a Help Hint box, see the OnHint example.


Hints Example

This example uses a database navigator and a button on a form. When the user clicks the button, the Help Hints for the navigator are modified.

procedure TForm1.Button1Click(Sender: TObject);

var

  NewStrings: TStringList;

begin

  NewStrings := TStringList.Create;

  with NewStrings do

  begin

    Add('Beginning of dataset');

    Add('Previous record');

    Add(''); { do not change the hint for the third button }

    Add('End of dataset');

  end;

  DBNavigator1.Hints := NewStrings;

  DBNavigator1.ShowHint := True;

end;


ClientWidth, HorzScrollBar, Position, Range, Increment, Visible Example

This example starts the form in a position scrolled so that the right hand edge shows:

procedure TForm1.FormCreate(Sender: TObject);

begin

  ClientWidth := 300;

  with HorzScrollBar do

  begin

    { Set the range to twice the ClientWidth of the form }

    { This means that the form’’s logical size is twice as big }

    { as the physical window. }

    { Note that Range must always be larger than the ClientWidth }

    Range := 600;

    Position := Range - ClientWidth; { start form out fully scrolled }

    Increment := 10;  { clicking the scroll arrows moves the form 10 pixels }

    Visible := True;  { Show the scrollbar }

  end;

end;


Icon Example

This code assigns an icon to a form when the form is created:

procedure TForm1.FormCreate(Sender: TObject);

begin

  Icon.LoadFromFile('MDIChild1.ICO');

end;


OpenPictureDialog, Icon Example

The following code allows the user to use a dialog box to redefine the icon for the application at run time. When the user clicks Button1, OpenDialog1 executes and the user specifies an icon filename. The Icon is then assigned to the application.

procedure TForm1.Button1Click(Sender: TObject);

var

Done: Boolean;

begin

  OpenPictureDialog1.DefaultExt := GraphicExtension(TIcon);

  OpenPictureDialog1.FileName := GraphicFileMask(TIcon);

  OpenPictureDialog1.Filter := GraphicFilter(TIcon);

  OpenPictureDialog1.Options := [ofFileMustExist, ofHideReadOnly, ofNoChangeDir ];

  while not Done do

  begin

  if OpenPictureDialog1.Execute then

    begin

    if not (ofExtensionDifferent in OpenPictureDialog1.Options) then

      begin

      Application.Icon.LoadFromFile(OpenPictureDialog1.FileName);

      Done := True;

      end

    else

      OpenPictureDialog1.Options := OpenPictureDialog1.Options - ofExtensionDifferent;

    end

  else { User cancelled }

    Done := True;

  end;

end;


IndexDefs, Update, Count, Items, IndexName, Fields, Name Example

This example uses the IndexName property to sort the records in a table on the CustNo and OrderNo fields.

Table1.Active := False;

Table1.Exclusive := True;

{ Get the current available indices }

Table1.IndexDefs.Update;

{ Find one which combines Customer Number ('CustNo') and Order Number ('OrderNo') }

for I := 0 to Table1.IndexDefs.Count - 1 do

  if Table1.IndexDefs.Items[I].Fields = 'CustNo;OrderNo' then

    { set that index as the current index for the table }

    Table1.IndexName := Table1.IndexDefs.Items[I].Name;

Table1.Exclusive := False;

Table1.Active := True;


IndexFields, IndexFieldCount Example

The following code calculates the total length of the index and assigns it to the variable TotalLen.

TotalLen := 0;

with Table1 do

  for I := 0 to IndexFieldCount - 1 do

    Inc(TotalLen, IndexFields[I].DataSize);


IndexOf Example

The following code adds an object to MyList if it isn’t already in the list.

if MyList.IndexOf(MyObject)=-1 then MyList.Add(MyObject);


OnChange, IndexOf Example

This example uses a file list box, a directory list box, and a label on a form. When the user uses the directory list box to change directories, a message appears and the color of the form changes if the file AUTOEXEC.BAT is in the new directory. The code is written in the OnChange event of the directory list box:

procedure TForm1.DirectoryListBox1Change(Sender: TObject);

begin

  FileListBox1.Directory := DirectoryListBox1.Directory;

  if FileListBox1.Items.IndexOf('AUTOEXEC.BAT') > -1 then

  begin

    Color := clYellow;

    Label1.Caption := 'You are in the root directory!';

  end;

end;


IndexOfName, Count, Names, Strings Example

The following example updates the strings in a list box given the strings contained in another list box. If a string in the source list box has the form Name=Value and the destination list box contains a string with the same Name part, the Value part in the destination list box will be replaced by the source’s value.

procedure MergeStrings(Dest, Source: TStrings);

var

  I, DI: Integer;

  begin

  for I := 0 to Source.Count - 1 do

  begin

    if Pos ('=', Source[I]) > 1 then

    begin

      DI := Dest.IndexOfName(Source.Names[I]);

      if DI > -1 then Dest[DI] := Source[I];

    end;

  end;

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

  MergeStrings(ListBox1.Items,ListBox2.Items);

end;


InitialValues Example

The following code adds two report variable values and runs the report.

Report1.InitialValues.Add('@Report1=<35>');

Report1.InitialValues.Add('@Report2=<test>');

Report1.Run;


Insert, Selected, Index Example

The following example inserts a list item after the selected item in the list view.

procedure TForm1.Button1Click(Sender: TObject);

var InsertItem : TListItem;

begin

  with ListView1 do

    InsertItem := Items.Insert(Selected.Index);

  InsertItem.Caption := 'InsertedItem';

end;


InsertControl, RemoveControl Example

This example uses a button placed next to a group box. When the user clicks the button, the group box becomes the parent of the button, so the button moves inside the group box.

procedure TForm1.Button1Click(Sender: TObject);

begin

  RemoveControl(Button1);

  GroupBox1.InsertControl(Button1);

end;

Note that it was necessary to remove the button from the Controls property of the form before the button actually moves into the group box.

This code accomplishes the same thing:

procedure TForm1.Button1Click(Sender: TObject);

begin

Button1.Parent := GroupBox1;

end;


InsertObject, Name, ItemAtPos Example

For the following example, add a button, a status bar, and a list box to Form1.  Set the SimplePanel property of the status bar to True, using the object inspector.The following code fills a list box with the names of all components on the form when the user clicks the button.  References to the components themselves are inserted along with the names.  The components are all inserted at the front of the list, so that the last component added to the form is the first component in the list.  When the user right-clicks the name of an object in the list, the component’s coordinates are displayed on the status bar.  Note that because we are using the right-click, the item need not be selected.

procedure TForm1.Button1Click(Sender: TObject);

var

  I: Integer;

begin

  for I := 0 to Form1.ComponentCount-1 do

    ListBox1.Items.InsertObject(0, Form1.Components[I].Name,

                                Form1.Components[I] as TObject);

end;

procedure TForm1.ListBox1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X,Y: integer);

var

  APoint: TPoint;

  Index: integer;

  TheObject: TControl;

begin

  if Button = mbRight then

  begin

  APoint.X := X;

  APoint.Y := Y;

  Index := ListBox1.ItemAtPos(APoint, True);

  if (ListBox1.Items.Objects[Index] is TControl) then

  begin

    TheObject := (ListBox1.Items.Objects[Index] as TControl);

    StatusBar1.SimpleText := TheObject.Name + ' is at (' +

                           IntToStr(TheObject.Left) + ', ' +

                           IntToStr(TheObject.Top) + ') ';

  end

  else

    Beep;

  end;

end;


InsertRecord Example

This statement appends a record to the Customer table. Note that Nulls are entered for some of the values, but are not required for missing values at the end of the array argument.

Customer.InsertRecord([CustNoEdit.Text, CoNameEdit.Text, AddrEdit.Text, Null, Null, Null, Null, Null, Null, DiscountEdit.Text]);


IsMasked Example

This example tests the masked edit box to determine if it has an edit mask. If it doesn’t an edit mask is assigned. The edit mask is one for dates in the MM/DD/YY format:

if not MaskEdit1.IsMasked then

    MaskEdit1.EditMask := '!99/99/00;1;_';


EditMask example

This example assigns an edit mask to the masked edit box on the form. The edit mask makes it easy to enter American telephone numbers in the edit box.

procedure TForm1.FormCreate(Sender: TObject);

begin

  MaskEdit1.EditMask := '!\(999\)000-0000;1';

  MaskEdit1.Text = '';

  MaskEdit1.AutoSelect := False;

end;


ItemRect Example

This example uses a list box on a form. When the user clicks one of the items in the list box, a beep occurs if the mouse is in the first half of the item. A similar technique can be used to detect “hot” regions in an owner-draw list box:

procedure TForm1.FormCreate(Sender: TObject);

begin

  with ListBox1 do

  begin

    Items.Add('Hello');

    Items.Add('New');

    Items.Add('World');

  end;

end;

procedure TForm1.ListBox1MouseUp (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

var

  ListBoxItem: TRect;

begin

  if Button = mbLeft then

  begin

    ListBoxItem := ListBox1.ItemRect(ListBox1.ItemIndex);

    if (Y > ListBoxItem.Top) and

       (Y < ListBoxItem.Bottom) and

       (X > ListBoxItem.Left) and

       (X < (ListBoxItem.Left + ListBoxItem.Right) div 2) then

      Beep;

  end;

 end;


Add, AddChild Example

The following example demonstrates how to add nodes and child nodes to a TTreeView control.

procedure TForm1.Button1Click(Sender: TObject);

var

  MyTreeNode1, MyTreeNode2: TTreeNode;

begin

  with TreeView1.Items do

  begin

    Clear; { remove any existing nodes }

    MyTreeNode1 := Add(nil, 'RootTreeNode1'); { Add a root node }

    { Add a child node to the node just added }

    AddChild(MyTreeNode1,'ChildNode1');

    {Add another root node}

    MyTreeNode2 := Add(MyTreeNode1, 'RootTreeNode2');

    {Give MyTreeNode2 to a child }

    AddChild(MyTreeNode2,'ChildNode2');

    {Change MyTreeNode2 to ChildNode2 }

    { and add a child node to it}

    MyTreeNode2 := TreeView1.Items[3];

    AddChild(MyTreeNode2,'ChildNode2a');

    {Add another child to ChildNode2, after ChildNode2a }

    Add(MyTreeNode2,'ChildNode2b');

    {add another root node}

    Add(MyTreeNode1, 'RootTreeNode3');

  end;

end;


Count, Items, Enabled Example

The following code disables all the subitems of MenuItem1.

var

  I: Integer;

begin

  for I := 0 to MenuItem1.Count-1 do

    MenuItem1.Items[I].Enabled := False;

end;


Add, Count, Items Example

This example creates a list object and inserts two records into it. The value of the record fields are written on a paintbox:

procedure TForm1.FormButton1Click(Sender: TObject);

type

  PMyList = ^AList;

  AList = record

    I: Integer;

    C: Char;

  end;

var

  MyList: TList;

  ARecord: PMyList;

  B: Byte;

  Y: Word;

begin

  MyList := TList.Create;

  try

    New(ARecord);

    ARecord^.I := 100;

    ARecord^.C := 'Z';

    MyList.Add(ARecord); {Add integer 100 and character Z to list}

    New(ARecord);

    ARecord^.I := 200;

    ARecord^.C := 'X';

    MyList.Add(ARecord); {Add integer 200 and character X to list}

    { Now paint the items onto the paintbox}

    Y := 10;             {Variable used in TextOut function}

    for B := 0 to (MyList.Count - 1) do

    begin

      ARecord := MyList.Items[B];

      Canvas.TextOut(10, Y, IntToStr(ARecord^.I)); {Display I}

      Y := Y + 30;  {Increment Y Value again}

      Canvas.TextOut(10, Y, ARecord^.C);  {Display C}

      Y := Y + 30;  {Increment Y Value}

    end;

    { Cleanup: must free the list items as well as the list }

   for B := 0 to (MyList.Count - 1) do

   begin

     ARecord := MyList.Items[B];

     Dispose(ARecord);

   end;

  finally

    MyList.Free;

  end;

end;


KeyExclusive Example

{ Limit the range from 1351 to 1356,

  including 1351 but excluding 1356 }

with Table1 do

begin

  { Set the beginning key }

  EditRangeStart;

  IndexFields[0].AsString := '1351';

  { Include 1351 in the range. }

  { Note that KeyExclusive applys to the range start }

  { because of the call to EditRangeStart }

  KeyExclusive := False;

  { Set the ending key }

  EditRangeEnd;

  IndexFields[0].AsString := '1356';

  { Exclude 1356 from the range }

  { Note that KeyExclusive now applys to the range end }

  { because of the call to EditRangeEnd }

  KeyExclusive := True;

  { Tell the table to establish the range }

  ApplyRange;

end;


KeyPreview, OnKeyDown, OnKeyUp Example

This example changes a form’s color to aqua when the user presses a key, even when a control on the form has the focus. When the user releases the key, the form returns to its original color.

var

  FormColor: TColor;

procedure TForm1.FormCreate(Sender: TObject);

begin

  KeyPreview := True;

end;

procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;

  Shift: TShiftState);

begin

  FormColor := Form1.Color;

  Form1.Color := clAqua;

end;

procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word;

  Shift: TShiftState);

begin

  Form1.Color := FormColor;

end;


Kind Example

This example uses three bitmap buttons on a form. When the application runs, the Kind property for each bitmap button is set, and the BitBtn1 button (the OK button) becomes the default button.

procedure TForm1.FormCreate(Sender: TObject);

begin

  BitBtn1.Kind := bkOK;

  BitBtn2.Kind := bkCancel;

  BitBtn3.Kind := bkHelp;

end;


Items, ItemIndex, Kind Example

This example uses a radio group box and a scroll bar on a form. When the user selects one of the radio buttons, the scroll bar changes orientation accordingly.

procedure TForm1.FormCreate(Sender: TObject);

begin

  RadioGroup1.Items.Add('Vertical');

  RadioGroup1.Items.Add('Horizontal');

  RadioGroup1.ItemIndex := 2;

end;

procedure TForm1.RadioGroup1Click(Sender: TObject);

begin

  if RadioGroup1.Items[RadioGroup1.ItemIndex] = 'Vertical' then

    ScrollBar1.Kind := sbVertical;

  if RadioGroup1.Items[RadioGroup1.ItemIndex] = 'Horizontal' then

    ScrollBar1.Kind := sbHorizontal;

end;


Last Example

This example inserts two records into a list object and displays the contents of the last record in the list on the form:

procedure TForm1.FormActivate(Sender: TObject);

type

  PMyList = ^AList;

  AList = record

    I: Integer;

    C: Char;

  end;

var

  MyList: TList;

  ARecord: PMyList;

  integer: I;

begin

  MyList := TList.Create;

  New(ARecord);

  ARecord^.I := 100;

  ARecord^.C := 'Z';

  MyList.Add(ARecord); {Add integer 100 and character Z to list}

  New(ARecord);

  ARecord^.I := 200;

  ARecord^.C := 'X';

  MyList.Add(ARecord); {Add integer 200 and character X to list}

  ARecord := MyList.Last;

  Canvas.TextOut(10, 10, IntToStr(ARecord^.I)); {Display I}

  Canvas.TextOut(10, 40, ARecord^.C);  {Display C}

  { Cleanup: must free the list items as well as the list }

  for I := 0 to (MyList.Count - 1) do

  begin

    ARecord := MyList.Items[I];

    Dispose(ARecord);

  end;

  MyList.Free;

end;


Lines Example

This example uses a button and a memo control on a form. When the user clicks the button, the content of the system’s AUTOEXEC.BAT file is loaded into the memo, and the sixth line of the file is written across the top of the form.

procedure TForm1.Button1Click(Sender: TObject);

begin

  Memo1.Lines.LoadFromFile('C:\AUTOEXEC.BAT');

  Writeln('The 6th line of AUTOEXEC.BAT is: ', Memo1.Lines[5]);

end;


OnChange Example

The following code assigns the value to the Lines property of DDEClientItem1 to the Lines of Memo1. This code is executed in the OnChange event handler of DDEClientItem1, so whenever the client is updated, the new data from the server is displayed.

procedure TForm1.DdeClientItem1Change(Sender: TObject);

begin

  Memo1.Lines := DDEClientItem1.Lines

end;


MoveTo, LineTo Example

The following code draws a line from the upper left corner of a form to the mouse position when the mouse is moved, creating a “rubber band” effect.

procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);

begin

  { first call FillRect to paint the surface of the form.

  this removes any previously drawn lines (and anything else!) }

  Canvas.FillRect(ClientRect);

  Canvas.MoveTo(0, 0);

  Canvas.LineTo(X, Y);

end;


AutoDisplay, LoadMemo Example

This example uses a database memo that is connected to a BLOB text field in the dataset. The current value of the BLOB field does not appear until the user clicks the memo.

procedure TForm1.FormCreate(Sender: TObject);

begin

  DBMemo1.AutoDisplay := False;

end;

procedure TForm1.DBMemo1Click(Sender: TObject);

begin

  DBMemo1.LoadMemo;

end;


Mappings Example

with BatchMove1.Mappings do

begin

  Clear;

  { Map the CustomerNum field to CustNo }

  Add('CustNo=CustomerNum');

  { Leave the SSN field mapped to SSN }

  Add('SSN');

end;


Margin, Range Example

This example uses a button and a label on a form. Place the label near the left side of the form, and place the button somewhere near the middle of the form. When the user runs the application, a horizontal scroll bar does not appear, because no control on the form is close enough to the right edge. Each time the user clicks the button, the button moves 25 pixels to the right, and the calculated Range value is reported in the caption of the label. Repeatedly clicking the button eventually moves the button close enough to the edge of the form (within the Margin amount) so that a horizontal scroll bar appears.  Note that the Range property is continuously updated as the button moves to the right.

procedure TForm1.FormCreate(Sender: TObject);

begin

  with HorzScrollBar do

  begin

    Margin:= 25;

    Increment := 10;

  end;

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

  Button1.Left := Button1.Left + 25;

  Label1.Caption := IntToStr(HorzScrollBar.Range);

end;


 Filter, Mask Example

This example uses a filter combo box and a file list box on a form. When the user selects a filter in the filter combo box, the file list box displays only files which match the selected mask:

procedure TForm1.FilterComboBox1Change(Sender: TObject);

begin

  FileListBox1.Mask := FilterComboBox1.Mask;

end;

procedure TForm1.FormCreate(Sender: TObject);

begin

  FilterComboBox1.Filter := 'All files (*.*)|*.*| Pascal files (*.pas)|*.pas';

end;


 MasterSource, MasterFields Example

Suppose you have a master table named Customer that contains a CustNo field, and you also have a detail table named Orders that also has a CustNo field. To display only those records in Orders that have the same CustNo value as the current record in Customer, write this code:

Orders.MasterSource := 'CustSource';

Orders.MasterFields := 'CustNo';

If you want to display only the records in the detail table that match more than one field value in the master table, specify each field and separate them with a semicolon.

Orders.MasterFields := 'CustNo;SaleDate';


Options, MaxFontSize, MinFontSize Example

This example uses a Font dialog box, a button, and a label on a form. When the user clicks the button, the Font dialog box appears. The font sizes available are within the range of 8 to 14. When the user chooses OK, the selected font is applied to the caption of the label.

procedure TForm1.Button1Click(Sender: TObject);

begin

  FontDialog1.Options := [fdLimitSize];

  FontDialog1.MaxFontSize := 14;

  FontDialog1.MinFontSize := 8;

  if FontDialog1.Execute then

    Label1.Font := FontDialog1.Font;

end;


NewMenu, NewItem, TextToShortCut, Menu example

This code displays a new menu named MyMenu when the user clicks the button.

procedure TForm1.Button1Click(Sender: TObject);

begin

  Menu := NewMenu(Self, 'MyMenu',

            [NewItem('New item', TextToShortCut('Ctrl+N'),

            False, True, Action1.OnExecute, 0, 'Item1')];

end;


Printing Example

This example uses a button, a Page Control, and a Print dialog box on a form. When the user clicks the button, the print dialog is displayed.  The user can select any subset of the pages in the page control for printing.  The selected pages are then printed.

To run this example successfully, you must add the Printers unit to the uses clause of your unit.

procedure TForm1.Button1Click(Sender:TObject);

var

  I, Start, Stop: Integer;

begin

PrintDialog1.Options := [poPageNums, poSelection];

PrintDialog1.FromPage := 1;

PrintDialog1.MinPage := 1;

PrintDialog1.ToPage := PageControl1.PageCount;

PrintDialog1.MaxPage := PageControl1.PageCount;

if PrintDialog1.Execute then

  begin

    { determine the range the user wants to print }

    with PrintDialog1 do

    begin

      if PrintRange = prAllPages then

        begin

        Start := MinPage - 1;

        Stop := MaxPage - 1;

      end

      else if PrintRange = prSelection then

      begin

        Start := PageControl1.ActivePage.PageIndex;

        Stop := Start;

        end

      else  { PrintRange = prPageNums }

      begin

        Start := FromPage - 1;

        Stop := ToPage - 1;

      end;

    end;

    { now, print the pages }

    with Printer do

    begin

      BeginDoc;

      for I := Start to Stop do

      begin

        PageControl1.Pages[I].PaintTo(Handle, 10, 10);

        if I <> Stop then

          NewPage;

      end;

      EndDoc;

    end;

  end;

end;


MDIChildCount, MDIChildren, Close Example

The following code closes all the MDI children of Form1.

var

  I: Integer;

begin

  with Form1 do

    for I := MDIChildCount-1 downto 0 do

      MDIChildren[I].Close;

end;


ModalResult, ShowModal Example

The following methods are used for buttons in a form that is used as a modal dialog box. The methods cause the dialog box to terminate when the user clicks either the OK or Cancel button, returning mrOK or mrCancel from ShowModal, respectively. You could also set the ModalResult value to mrOk for the OK button and mrCancel for the Cancel button to accomplish the same thing. When the user clicks either button, the dialog box closes.

procedure TMyDialogBox.OKButtonClick(Sender: TObject);

begin

  ModalResult := mrOK;

end;

procedure TMyDialogBox.CancelButtonClick(Sender: TObject);

begin

  ModalResult := mrCancel;

end;

This code brings up the modal dialog from Form1 when a button is clicked.  It causes a Beep if the OK button is clicked.

procedure TForm1.Button1Click(Sender: TObject);

begin

  if MyDialogBox1.ShowModal = mrOK then

    Beep;

end;


OnNotify, Mode Example
OnNotify, Mode, Notify Example

The following code declares an array of strings named ModeStr, indexed by the TMPModes type. The Caption of a form displays the string describing the current mode of the device.

Note: before running this example, initialize the Notify property of TMediaPlayer1 to True.

const

  ModeStr: array[TMPModes] of string = ('Not ready', 'Stopped', 'Playing', 'Recording', 'Seeking', 'Paused', 'Open');

procedure TForm1.MediaPlayer1Notify(Sender: TObject);

begin

  with Sender as TMediaPlayer do

  begin

    Form1.Caption := ModeStr[Mode];

    { Note we must reset the Notify property to True }

    { so that we are notified the next time the }

    { mode changes }

    Notify := True;

  end;

end;


MouseToCell Example

This example uses a string grid on a form. When the user selects a cell in the grid and releases the mouse button, the column and row coordinates for the cell appear in the cell. The code for displaying the coordinates is written in the OnMouseUp event handler:

procedure TForm1.FormCreate(Sender: TObject);

begin

  StringGrid1.DefaultColWidth := 100;

end;

procedure TForm1.StringGrid1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

var

  Column, Row: Longint;

begin

  StringGrid1.MouseToCell(X, Y, Column, Row);

  StringGrid1.Cells[Column, Row] := 'Col ' + IntToStr(Column) +

    ',Row ' + IntToStr(Row);

end;


ItemIndex, Move Example

This example uses a list box and a button on a form. The list box contains items when the form appears. When the user clicks the button, the selected item in the list box is moved to the top of the list box:

procedure TForm1.FormCreate(Sender: TObject);

var

  I: Integer;

begin

  ListBox1.MultiSelect := False;

  Button1.Caption := 'Move to Top';

  for I := 1 to 10 do

    ListBox1.Items.Add('Item ' + IntToStr(I));

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

  ListBox1.Items.Move(ListBox1.ItemIndex, 0);

end;


Mode, AbortOnKeyViol, Execute, MovedCount, KeyViolCount Example

The following code uses the BatchMove component to add records to a table.  After the records have been added, the number of new records is reported on the status line.

with BatchMove1 do

begin

  Mode := batAppend;

  AbortOnKeyViol := False;

  Execute;

  StatusBar1.SimpleText := IntToStr(MovedCount - KeyViolCount) + ' records added';

end;


Printer, Canvas, PageWidth, PageHeight Example

This example uses a button on a form. When the user clicks the button, a bitmap is printed, centered on the page. To run this example successfully, you must add the Printers unit to the uses clause of your unit.

procedure TForm1.Button1Click(Sender: TObject);

var

  Bmp: TBitmap;

begin

  Bmp := TBitmap.Create;

  try

    Bmp.LoadFromFile('MyBitmap.bmp');

    with Printer do

    begin

      BeginDoc;

      Canvas.Draw((PageWidth - Bmp.Width) div 2,

                  (PageHeight - Bmp.Height) div 2,

                  Bmp);

      EndDoc;

    end;

  finally

    Bmp.Free;

  end;

end;


NormalizeTopMosts, RestoreTopMosts Example

The following code causes “stay on top” forms to allow a MessageBox to appear on top. After the message box is closed, the topmost forms are restored so that they continue to float to the top.

Begin

  with Application do

  begin

    NormalizeTopMosts;

    MessageBox('This should be on top.', 'Look', MB_OK);

    RestoreTopMosts;

  end;

end;


NotifyValue Example

This example uses a media player component named MediaPlayer1. When the application runs, the code attempts to play a CD in the CD audio device, If it is not successful, the application displays an error dialog.

Before you can run this example, you must have a CD audio device installed correctly.

procedure TForm1.FormCreate(Sender: TObject);

begin

  with MediaPlayer1 do

  begin

    Visible := False;

    Notfiy := True;

    DeviceType := dtCDAudio;

    Open;

    Play;

    if NotifyValue <> nvSuccessful then

      MessageDlg('Error playing CD audio', mtError, [mbOk], 0)

  end;

end;


OnActivate, ComponentCount, Components Example

The following code sets the Datasource for a DBGrid component in Form2 to the currently selected data source in a list provided in Form1.  This allows users to specify the desired information in form1, and then move to Form2 to view the information.

procedure TForm2.FormActivate(Sender: TObject);

begin

  DBGrid1.DataSource :=

    Form1.ListBox1.Objects[Form1.ListBox1.ItemIndex] as TDataSource;

end;

Here is the code on Form1 that fills the list box:

procedure TForm1.FormCreate(Sender.TObject);

var

  integer I;

begin

  for I := 0 to DataModule2.ComponentCount - 1 do

  begin

    if (DataModule2.Components[I] is TDataSource) then

      ListBox1.Items.AddObject(DataModule2.Components[I].Name,

        DataModule2.Components[I] as TObject);

  end;

end;


OnActiveFormChange, ActiveForm Example

This example uses a two forms with a button on the first form. When the user clicks the button, the second form appears. As the user switches between forms, the form that is active is colored aqua.

type

  TForm1 = class(TForm)

    Button1: TButton;

    procedure FormCreate(Sender: TObject);

    procedure Button1Click(Sender: TObject);

  private

    { Private declarations }

  public

    procedure ColorForm(Sender: TObject);

  end;

var

  Form1: TForm1;

implementation

{$R *.DFM}

uses Unit2;

procedure TForm1.ColorForm(Sender: TObject);

begin

  Color := clBtnFace;

  Form2.Color := clBtnFace;

  Screen.ActiveForm.Color := clAqua;

end;

procedure TForm1.FormCreate(Sender: TObject);

begin

  Screen.OnActiveFormChange := ColorForm;

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

  Form2.Show;

end;


Font, Execute, OnApply, Assign Example

This example takes an edit control, a button, and a rich edit control on a form.  When the user presses the button, a Font dialog appears.  When the user clicks the Apply button in the Font dialog, the currently selected font is applied to the active control.

procedure TForm1.Button1Click(Sender: TObject);

begin

   TFontDialog1.Options = TFontDialog1.Options + fdApplyButton;

   TFontDialog1.Execute;

end;

procedure TForm1.FontDialog1Apply(Sender: TObject; Wnd: Integer);

begin

  if ActiveControl is TEdit then

    with ActiveControl as TEdit do

       Font.Assign(TFontDialog(Sender).Font)

  else if ActiveControl is TRichEdit then

    with ActiveControl as TRichEdit do

      SelAttributes.Assign(TFontDialog(Sender).Font)

  else

    Beep;

end;


OnClick Example

This example uses a label and a media player on a form. When the user clicks one of the media player buttons, the caption of the label indicates which button was clicked. For this example to run successfully, you must have a CD audio device installed correctly.

procedure TForm1.FormCreate(Sender: TObject);

begin

  MediaPlayer1.DeviceType := dtCDAudio;

  MediaPlayer1.Open;

  MediaPlayer1.Left := 20;

  MediaPlayer1.Top := 12;

  Label1.Top := 44;

  Label1.Left := 20;

  Label1.Color := clYellow;

  Label1.Font.Name := 'Arial';

  Label1.Caption := 'Click Me';

end;

procedure TForm1.MediaPlayer1Click(Sender: TObject; Button: TMPBtnType; var DoDefault: Boolean);

begin

  case Button of

    btPlay :

    begin

      Label1.Caption := 'Playing';

      Label1.Left := 20;

    end;

    btPause:

    begin

      Label1.Caption := 'Paused';

      Label1.Left := 48;

    end;

    btStop:

    begin

      Label1.Caption := 'Stopped';

      Label1.Left := 76;

    end;

    btNext:

    begin

      Label1.Caption := 'Next';

      Label1.Left := 104;

    end;

    btPrev:

    begin

      Label1.Caption := 'Previous';

      Label1.Left := 132;

    end;

    btStep:

    begin

      Label1.Caption := 'Step';

      Label1.Left := 160;

    end;

    btBack:

    begin

      Label1.Caption := 'Back';

      Label1.Left := 188;

    end;

    btRecord:

    begin

      Label1.Caption := 'Record';

      Label1.Left := 216;

    end;

    btEject:

    begin

      Label1.Caption := 'Eject';

      Label1.Left := 244;

    end;

  end;

end;


OnClick Example

The following code determines which database navigator button was clicked and displays a message identifying the name of the button.

procedure TForm1.DBNavigator1Click(Sender: TObject; Button: TNavigateBtn);

var

  BtnName: string;

begin

  case Button of

    nbFirst  : BtnName := 'nbFirst';

    nbPrior  : BtnName := 'nbPrior';

    nbNext   : BtnName := 'nbNext';

    nbLast   : BtnName := 'nbLast';

    nbInsert : BtnName := 'nbInsert';

    nbDelete : BtnName := 'nbDelete';

    nbEdit   : BtnName := 'nbEdit';

    nbPost   : BtnName := 'nbPost';

    nbCancel : BtnName := 'nbCancel';

    nbRefresh: BtnName := 'nbRefresh';

  end;

  MessageDlg(BtnName + ' button clicked.', mtInformation, [mbOK], 0);

end;


OnOpen, OnClose, ExecuteMacro Example

The following code enables the send macro button and macro edit control when the DDE conversation begins, and disables them when it ends.  When the send macro button is clicked, the macro is sent to the DDE server.

procedure TForm1.DdeClientConv1Open(Sender: TObject);

begin

  SendMacroButton.Enabled := True;

  EditMacro.Enabled := True;

end;

procedure TForm1.DdeClientConv1Close(Sender: TObject);

begin

  SendMacroButton.Enabled := False;

  EditMacro.Enabled := False;

end;

procedure TForm1.SendMacroButtonClick(Sender: TObject);

begin

  DdeClientConv1.ExecuteMacro(EditMacro.Text, True);

end;


OnColEnter, OnColExit, SelectedField, DisplayLabel Example

The following code concatenates an asterisk to the display label of a field when the column is entered, and removes it when another column is selected. StarIsThere is a boolean that prevents deleting characters from the column that is selected at startup (which never receives an OnColEnter event).

var

  StarIsThere: Boolean;

procedure TForm1.DBGrid1ColEnter(Sender: TObject);

begin

  with DBGrid1.SelectedField do

    DisplayLabel := '* ' + DisplayLabel;

  StarIsThere = True;

end;

procedure TForm1.DBGrid1ColExit(Sender: TObject);

var

  TheLabel: string;

begin

  if StarIsThere then

  begin

    with DBGrid1.SelectedField do

    begin

      TheLabel := DisplayLabel;

      Delete(TheLabel, 1, 2);

      DisplayLabel := TheLabel;

    end;

  end;

end;


OnDeactivate, Minimize Example

The following code minimizes an application when it’s deactivated. Note that AppDeactivate should be declared a method of TForm1.

procedure TForm1.FormCreate(Sender: TObject);

begin

  Application.OnDeactivate := AppDeactivate;

end;

procedure TForm1.AppDeactivate(Sender: TObject);

begin

  Application.Minimize;

end;


OnDestroy Example

The following code explicitly allocates memory for a pointer in the OnCreate event of Form1, then releases the memory in the OnDestroy event. Assume that MyPtr is a Pointer type field of TForm1.

procedure TForm1.FormCreate(Sender: TObject);

begin

  New(MyPtr);

end;

procedure TForm1.FormDestroy(Sender: TObject);

begin

  Dispose(MyPtr);

end;


OnDragOver, OnDragDrop Example

This code comes from an application that contains a list box and three labels, each with a different font and color.  The user can select a label and drag it to a list box and drop it. When the label is dropped, the items in the list box assume the color and font of the dropped label.

This OnDragOver event handler permits the list box to accept a dropped label:

procedure TForm1.ListBox1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);

begin

  Accept := Source is TLabel;

end;

This OnDragDrop event handler implements the drop behavior.

procedure TForm1.ListBox1DragDrop(Sender, Source: TObject; X, Y: Integer);

begin

  if (Sender is TListBox) and (Source is TLabel) then

  begin

    with Sender as TListBox do

    begin

      Font := (Source as TLabel).Font;

      Color := (Source as TLabel).Color;

    end;

  end;

end;


OnDrawCell, Canvas, DrawFocusRect Example

The following code uses the bitmaps in an imagelist component to draw the contents of each cell in a draw grid.  It draws a focus rectangle around the cell that has focus.

procedure TForm1.DrawGrid1DrawCell(Sender: TObject; Col, Row: Longint; Rect: TRect; State: TGridDrawState);

var

  index: integer;

begin

  index := Row * DrawGrid1.ColCount + Col;

  with Sender as TDrawGrid do

  begin

    Canvas.Brush.Color := clBackGround;

    Canvas.FillRect(Rect);

    ImageList1.Draw(Canvas,Rect.Left,Rect.Top,index);

    if gdFocused in State then

      Canvas.DrawFocusRect(Rect);

  end;

end;


OnEndDrag Example

This code displays a message in a label named Status. The message displayed depends on whether or not the dragged label control was successfully dropped into and accepted by a another control.

procedure TForm1.Label1EndDrag(Sender, Target: TObject; X, Y: Integer);

var

  S: string;

begin

  S := (Sender as TLabel).Name + ' was dropped... and ';

  if Target <> nil then

    S := S + 'accepted!'

  else

    S := S + 'rejected!';

  Status.Caption := S;

end;


OnEnter, OnExit Example

This example uses an edit box and a memo control on a form. When either the edit box or the memo is the active control, it is colored yellow. When the active control becomes inactive, the color of the control returns to the Windows system color for a window.

procedure TForm1.Edit1Enter(Sender: TObject);

begin

  Edit1.Color := clYellow;

end;

procedure TForm1.Edit1Exit(Sender: TObject);

begin

  Edit1.Color := clWindow;

end;

procedure TForm1.Memo1Enter(Sender: TObject);

begin

  Memo1.Color := clYellow;

end;

procedure TForm1.Memo1Exit(Sender: TObject);

begin

  Memo1.Color := clWindow;

end;


OnException, ShowException, Terminate Example

In addition to displaying the exception message, which happens by default, the following code shuts down the application when a VCL exception is not caught and handled.

procedure TForm1.FormCreate(Sender: TObject);

begin

  Application.OnException := AppException;

end;

procedure TForm1.AppException(Sender: TObject; E: Exception);

begin

  Application.ShowException(E);

  Application.Terminate;

end;


OnExecuteMacro Example

The following code clears the contents of a memo in the server application if the appropriate message is sent from the client application.

procedure TForm1.DdeServerConv1ExecuteMacro(Sender: TObject; Msg: TStrings);

begin

  if Msg.Strings[0] = 'Edit|Clear' then

    Memo1.Clear;

end;


OnFilterRecord Example

The following example shows how to use a field comparison when filtering records on a local table, by using the OnFilterRecord event.

procedure TForm1.Table1FilterRecord(DataSet: TDataSet; var Accept: Boolean);

begin

  Accept := DataSet['DateOfPayment'] > DataSet['DateOfPurchase'] + 30;

end;


OnGetEditMask Example

This example specifies an edit mask in a string grid to limit the cells that contain telephone numbers, as indicated by a label cell in the first row:

procedure TForm1.StringGrid1GetEditMask(Sender: TObject; ACol, ARow: Longint; var Value: string);

begin

  if StringGrid1.Cells[ACol, 0] = 'Phone Number' then

    Value :=  '!\(999\)000-0000;1';

end;


OnGetEditText Example

The following code lowercases the text for a string grid cell when the user begins to edit it.

procedure TForm1.StringGrid1GetEditText(Sender: TObject; ACol, ARow: Longint; var Value: string);

begin

  Value := AnsiLowerCase(Value);

end;


OnHelp Example

The following code changes the Help file depending on the active form, before WinHelp is called. AppHelp is assigned to the OnHelp event handler of Application in the OnCreate event of Form1.

function TForm1.AppHelp(Command: Word; Data: Longint; var CallHelp: Boolean): Boolean;

begin

  Application.HelpFile := Screen.ActiveForm.Name + '.hlp';

  CallHelp := True;

end;

function TForm1.FormCreate(Sender: TObject);

begin

  Application.OnHelp := AppHelp;

end;


OnHide Example

This example uses two forms, each with a label and a button. When the user clicks a button, the other form appears and the current form disappears. Also, a message appears in the label of the form that is showing, indicating that the other form is hidden. This is the implementation section of Unit1:

implementation

{$R *.DFM}

uses Unit2;

procedure TForm1.Button1Click(Sender: TObject);

begin

  Form2.Show;

  Hide;

end;

procedure TForm1.FormHide(Sender: TObject);

begin

  Form2.Label1.Caption := 'Form1 is hiding';

end;

end.

This is the implementation section of Unit2:

implementation

{$R *.DFM}

uses Unit1;

procedure TForm2.Button1Click(Sender: TObject);

begin

  Form1.Show;

  Hide;

end;

procedure TForm2.FormHide(Sender: TObject);

begin

  Form1.Label1.Caption := 'Form2 is hiding';

end;

end.


OnKeyPress Example

This event handler displays a message dialog box specifying which key was pressed:

procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);

begin

  MessageDlg(Key + ' has been pressed', mtInformation, [mbOK], 0)

end;


OnMessage Example

The following code handles a custom message that the application sends to itself when a file is ready for reading.

const

 WM_FILEREADY = WM_USER + 2000;

procedure TForm1.FormCreate(Sender: TObject);

begin

  Application.OnMessage := AppMessage;

end;

procedure TForm1.AppMessage(var Msg: TMsg; var Handled: Boolean);

begin

  if Msg.message = WM_FILEREADY then

  begin

    Memo1.Lines.LoadFromFile(StrPas(PChar(Msg.lParam)));

    Handled := True;

  end;

  { for all other messages, Handled remains False }

  { so that other message handlers can respond }

end;


OnPokeData, Lines, Text Example

The following code uses two DDE server items to protect poked data from being lost by a DDE server application. DoOnPoke is the OnPokeData event handler for the DDE server item named DDETestItem. When data is poked, The Text for the DDE server item named FInPoke is set to 'True', telling the client application not to send any more data.  After the poked data is stored in the Lines property of Memo2,  the Text property of FInPoke is set back to 'False', telling the client application that more data can safely be sent.

procedure TDdeSrvrForm.doOnPoke(Sender: TObject);

begin

  FInPoke.Text := 'True';

  Memo2.Lines := DdeTestItem.Lines;

  FInPoke.Text := 'False';

end;


OnPopup Example

The following code enables the Paste item from the pop-up menu if the Clipboard has text data.

procedure TForm1.PopupMenu1Popup(Sender: TObject);

begin

  Paste1.Enabled := Clipboard.HasFormat(CF_TEXT);

end;


Options Example

The following code calls the user-defined routine DoReplace if the Replace button was clicked, or calls the user-defined routine DoReplaceAll if the Replace All button was clicked.

procedure TForm1.ReplaceDialog1Replace(Sender: TObject);

begin

  with Sender as TReplaceDialog do

  begin

  if frReplace in Options then

    DoReplace(FindText, ReplaceText);

  else if frReplaceAll in Options then

    DoReplaceAll(FindText, ReplaceText);

end;


OnReplace, ReplaceText Example

The following event handler searches a TMemo object called Memo1 and replaces FindText with ReplaceText. It uses TMemo’s SelStart, SelLength, and SelText properties.

procedure TForm1.ReplaceDialog1Replace(Sender: TObject);

var

  SelPos: Integer;

begin

  with TReplaceDialog(Sender) do

  begin

  { Perform a global case-sensitive search for FindText in Memo1 }

    SelPos := Pos(FindText, Memo1.Lines.Text);

    if SelPos > 0 then

    begin

      Memo1.SelStart := SelPos - 1;

      Memo1.SelLength := Length(FindText);

      { Replace selected text with ReplaceText }

      Memo1.SelText := ReplaceText;

    end

    else MessageDlg(Concat('Could not find "', FindText, '" in Memo1.'), mtError, [mbOk], 0);

  end;

end;


OnResize Example

The following code keeps the right edge on Button1 against the right edge of Form1 when Form1 is resized.

procedure TForm1.FormResize(Sender: TObject);

begin

  Button1.Left := Form1.ClientWidth-Button1.Width;

end;


OnResizeRequest Example

The following code resizes the rich edit control to accomodate growing or shrinking lines of text:

procedure TForm1.RichEditResizeRequest(Sender: TObject; Rect: TRect);

begin

(Sender as TRichEdit).BoundsRect := Rect;

end;


OnRowMoved Example

The following code displays the number of rows a row was moved in a label.

procedure TForm1.StringGrid1RowMoved(Sender: TObject; FromIndex, ToIndex: Longint);

begin

  Label1 := IntToStr(Abs(FromIndex-ToIndex));

end;


Min, Max, Position, SmallChange, LargeChange, OnScroll Example

This example shows how to use a scrollbar to navigate the pages of a page control.  To run this example, place a scrollbar and a page control on a form.  Right click the page control and add 12 pages to it.  Add the following code to the OnCreate event of the form, the OnChange event of the page control, and the OnScroll event of the scrollbar.

Note that the LargeChange and SmallChange properties are set to automatically change the active page by one tab or one row respectively.  The OnScroll event is used to make the actual change in the page control, while the OnChange event of the page control ensures that the scrollbar is kept in sync with changes made directly to the page control.

procedure TForm1.FormCreate(Sender: TObject);

var

  I : Integer;

begin

  { First, initialize the page control }

  PageControl1.TabWidth := PageControl1.ClientWidth div 4 - 1;

  PageControl1.ActivePage := PageControl1.Pages[0];

  { set up the scrollbar to reflect the structure of the page control}

  with ScrollBar1 do

  begin

    Max := PageControl1.PageCount - 1;

    Min := 0;

    SmallChange := 1;

    { set LargeChange to a single row of tabs }

    LargeChange := PageControl1.ClientWidth div PageControl1.TabWidth;

  end;

end;

procedure TForm1.PageControl1Change(Sender: TObject);

begin

  with Sender as TPageControl do

    ScrollBar1.Position := ActivePage.PageIndex;

end;

procedure TForm1.ScrollBar1Scroll(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer);

begin

  PageControl1.ActivePage := PageControl1.Pages[ScrollPos];

end;


OnSelectCell Example

The following code ensures that the user cannot select a cell unless it is empty.

procedure TForm1.StringGrid1SelectCell(Sender: TObject; Col, Row: Longint; var CanSelect: Boolean);

begin

  CanSelect := (StringGrid1.Cells[Col,Row]='')

end;


OnShowHint Example

This example uses three speed buttons on a panel. The code changes the color, width, and position of the text in the Help Hint for the third speed button. . Set the ShowHint property of each speed button to true and give a value to the Hint property of each.

You must declare the DoShow method in the type declaration of the form. Once it is declared, write the code for the DoShow method in the implementation part of the unit. Finally, in the OnCreate event handler for the form, assign the method to the OnShowHint event of the application.

type

  TForm1 = class(TForm)

    Panel1: TPanel;

    SpeedButton1: TSpeedButton;

    SpeedButton2: TSpeedButton;

    SpeedButton3: TSpeedButton;

    procedure FormCreate(Sender: TObject);

   private

    { Private declarations }

  public

    procedure DoShowHint(var HintStr: string; var CanShow: Boolean; var HintInfo: THintInfo);

  end;

var

  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.DoShowHint(var HintStr: string; var CanShow: Boolean; var HintInfo: THintInfo);

begin

  if HintInfo.HintControl = SpeedButton3 then

  begin

    with HintInfo do

    begin

      HintColor := clAqua;{ Changes only for this hint }

      HintMaxWidth := 120;{Hint text word wraps if width is greater than 120 }

      Inc(HintPos.X, SpeedButton3.Width); { Move hint to right edge }

    end;

  end;

end;

procedure TForm1.FormCreate(Sender: TObject);

begin

  Application.ShowHint := True;

  Application.OnShowHint := DoShowHint;

end;

end.


OpenLink, RequestData, DDEItem Example

The following code requests data if a link is open.

with DDEClientConv1 do

  if OpenLink then RequestData(DDEClientItem1.DDEItem);


Orientation Example

This example uses two radio buttons on a form named Landscape and Portrait. The form also includes a button. When the user selects an orientation by clicking one of the radio buttons and then clicks the button to print one line of text, the print job prints using the selected orientation:

procedure TForm1.Button1Click(Sender: TObject);

begin

  Printer.BeginDoc;

  Printer.Canvas.TextOut(100,100,'Hi there');

  Printer.EndDoc;

end;

procedure TForm1.PortraitClick(Sender: TObject);

begin

  Printer.Orientation := poPortrait;

end;

procedure TForm1.LandscapeClick(Sender: TObject);

begin

  Printer.Orientation := poLandscape;

end;


Pack Example

This example assumes there are two edit box controls on the form. The code creates a list object and adds two strings to it. The second string in the list is a nil string. The code counts the number of strings in the list and displays the number in the Edit1 control. The code then packs the list, removing the nil string, and counts the strings in the list again. The second count displays in the Edit2 control:

procedure TForm1.FormCreate(Sender: TObject);

var

  MyList: TList;

  I: Integer;

begin

  MyList := TList.Create;              {Create a list }

  MyList.Add(PChar('A string')); {Add a string}

  MyList.Add(PChar('')); { Add an empty string }

  MyList.Add(nil);              {Add nil }

  MyList.Add(PChar('')); { Add another empty string }

  Edit1.Text := IntToStr(MyList.Count); {Put count into Edit1}

  Mylist.Pack;                         {Pack the list.}

  Edit2.Text := IntToStr(MyList.Count); {Put count into Edit2}

  MyList.Free;                         {Free memory for list}

end;


PageNumber Example

This example uses a button on a form. When the user clicks the button, one line of text is printed on six separate pages. As each page is printed, a message indicating the number of the page being printed appears on the status bar.

To run this example successfully, you must add Printers to the uses clause of your unit and set the SimplePanel property of the status bar to True.

procedure TForm1.Button1Click(Sender: TObject);

var

  I: Integer;

begin

  StatusBar1.SimplePanel := True; { so that SimpleText will work }

  Printer.BeginDoc;

  for I := 1 to 6 do

  begin

    Printer.Canvas.TextOut(100, 100, 'Object Pascal is great');

    StatusBar1.SimpleText := 'Now printing page ' + IntToStr(Printer.PageNumber));

    Printer.NewPage;

  end;

  Printer.EndDoc;

end;


ParamByName, CreateParam Example

try

  { Assign a value of 999 to the CustNo parameter }

  Params.ParamByName('CustNo').AsInteger := 999;

except

  { If it doesn’t exist, then }

  on EDatabaseError do

    { Create a new parameter for CustNo

      and assign a value of 999 to it }

    with Params.CreateParam(ftInteger, 'CustNo', ptInput) do

      AsInteger := 999;

end;


ParamCount, DataType, StrToIntDef, AsXXX Example

This example fills in the parameters of a query from the entries of a list box.

var

  I: Integer;

  ListItem: string;

begin

  for I := 0 to Query1.ParamCount - 1 do

  begin

    ListItem := ListBox1.Items[I];

    case Query1.Params[I].DataType of

      ftString:

        Query1.Params[I].AsString := ListItem;

      ftSmallInt:

        Query1.Params[I].AsSmallInt := StrToIntDef(ListItem, 0);

      ftInteger:

        Query1.Params[I].AsInteger := StrToIntDef(ListItem, 0);

      ftWord:

        Query1.Params[I].AsWord := StrToIntDef(ListItem, 0);

      ftBoolean:

        begin

          if ListItem = 'True' then

            Query1.Params[I].AsBoolean := True

          else

            Query1.Params[I].AsBoolean := False;

        end;

      ftFloat:

        Query1.Params[I].AsFloat := StrToFloat(ListItem);

      ftCurrency:

        Query1.Params[I].AsCurrency := StrToFloat(ListItem);

      ftBCD:

        Query1.Params[I].AsBCD := StrToCurr(ListItem);

      ftDate:

        Query1.Params[I].AsDate := StrToDate(ListItem);

      ftTime:

        Query1.Params[I].AsTime := StrToTime(ListItem);

      ftDateTime:

        Query1.Params[I].AsDateTime := StrToDateTime(ListItem);

    end;

  end;

end;


ParamCount, Params, ParamType Example

{ Set all input parameters to an empty string }

with StoredProc1 do

  for I := 0 to ParamCount - 1 do

    if (Params[I].ParamType = ptInput) or

       (Params[I].ParamType = ptInputOutput) then

      Params[I].AsString := '';


Params Example

The following code runs an insert query to add a record for Lichtenstein into the country table.

Query2.SQL.Clear;

Query2.SQL.Add('INSERT INTO COUNTRY (NAME, CAPITAL, POPULATION)');

Query2.SQL.Add('VALUES (:Name, :Capital, :Population)');

Query2.Params[0].AsString := 'Lichtenstein';

Query2.Params[1].AsString := 'Vaduz';

Query2.Params[2].AsInteger := 420000;

Query2.ExecSQL;


Parent, GetNextChild, GetPrevChild Example

The following code tests to see if the currently selected item has a sibling. True will be assigned to HasSibling if so.

var

  HasSibling: Boolean;

  SelNode: TTreeNode;

  ParentNode: TTreeNode;

begin

  SelNode := TTreeView1.Selected;

  ParentNode := SelNode.Parent;

  HasSibling := (ParentNode.GetPrevChild(SelNode) <> nil) or

                (ParentNode.GetNextChild(SelNode) <> nil);

end;


Pause Example

This example uses a media player, a timer, and a button on a form. Only the button is visible when the application runs. When the user clicks the button, the .WAV file plays. When the user clicks the button again, the .WAV file pauses. The caption of the button changes, depending on whether the .WAV file is playing, paused, or stopped.

To run this example, you must have the CHIMES.WAV file in your Windows directory and install a device that plays WAV audio files:

procedure TForm1.FormActivate(Sender: TObject);

var

  WinDir: PChar;

begin

  MediaPlayer1.Visible := False;

  GetMem(WinDir, 144);

  GetWindowsDirectory(WinDir, 144);

  StrCat(WinDir, '\chimes.wav');

  MediaPlayer1.FileName := StrPas(WinDir);

  MediaPlayer1.Open;

  FreeMem(WinDir, 144);

  Button1.Caption := 'Play';

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

  if Button1.Caption = 'Play' then

  begin

    Button1.Caption := 'Pause';

    MediaPlayer1.Play;

  end

  else

  begin

    Button1.Caption := 'Play';

    MediaPlayer1.Pause;

  end;

end;

procedure TForm1.Timer1Timer(Sender: TObject);

begin

  if MediaPlayer1.Mode = mpStopped then

    Button1.Caption := 'Play';

end;


PauseOnly Example

The following code illustrates the difference between Pause and PauseOnly. After the second call to Pause, MediaPlayer1 resumes playing. After the second call to PauseOnly, MediaPlayer1 is still paused.

with MediaPlayer1 do

begin

  MediaPlayer1.Play;

  MediaPlayer1.Pause;

  { Now its paused }

  MediaPlayer1.Pause;

  { Now it’s playing – the Pause property toggled }

  MediaPlayer1.PauseOnly;

  { Now it’s paused again }

  MediaPlayer1.PauseOnly;

  { Now it’s still paused }

end;


Pixels Example

This example draws a red line (very slowly) when the user presses a button. Attach the following code to the button’s OnClick event handler:

procedure TForm1.Button1Click(Sender: TObject);

var

  W: Word;

begin

  for W := 10 to 200 do

    Canvas.Pixels[W, 10] := clRed;

end;


 PokeData Example

The following code pokes the data that is in Edit1 to the DDE server. The DDE item of the conversation is specified in the DDEItem property of DDEClientItem1.

var

  TheData: PChar;

DDEClientConv1.PokeData(DDEClientItem1.DDEItem,

                StrPCopy(TheData, Edit1.Text));


 PokeDataLines Example

The following line pokes the data that is in Memo1 to the DDE server. The DDE item of the conversation is specified in the DDEItem property of DDEClientItem1.

DDEClientConv1.PokeDataLines(DDEClientItem1.DDEItem, Memo1.Lines);


OnPaint, Pen, Polyline Example

This example paints a white five pointed star in a paintbox control:

procedure TForm1.PaintBox1Paint(Sender: TObject);

begin

  with Sender as TPaintBox do

  begin

    Canvas.Pen.Color := clWhite;

    Canvas.Polyline([Point(40, 10), Point(20, 60), Point(70, 30),

    Point(10, 30), Point(60, 60), Point(40, 10)]);

  end;

end;


Popup, AutoPopup Example

This example uses a pop-up menu. When the user presses the mouse button, the pop-up menu appears where the user clicked the mouse:

procedure TForm1.FormCreate(Sender: TObject);

begin

  PopupMenu1.AutoPopup := False;

end;

procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

begin

  PopupMenu1.Popup(X, Y);

end;


PopupComponent, PopupMenu Example

This example uses two edit boxes, two memos, and one pop-up menu on a form. The pop-up menu contains Cut, Copy, and Paste commands. This code makes the pop-up menu available to both edit boxes and both memos:

procedure TForm1.FormCreate(Sender: TObject);

begin

  PopupMenu1.AutoPopup := True;

  Edit1.PopupMenu := PopupMenu1;

  Edit2.PopupMenu := PopupMenu1;

  Memo1.PopupMenu := PopupMenu1;

  Memo2.PopupMenu := PopupMenu1;

end;

These are the cut, copy, and paste OnClick events for the commands on the pop-up menu.

procedure TForm1.Copy1Click(Sender: TObject);

begin

  if PopupMenu1.PopupComponent = Edit1 then

   Edit1.CopyToClipboard

  else if PopupMenu1.PopupComponent = Edit2 then

    Edit2.CopyToClipboard

  else if PopupMenu1.PopupComponent = Memo1 then

    Memo1.CopyToClipboard

  else if PopupMenu1.PopupComponent = Memo2 then

    Memo2.CopyToClipboard

  else

    Beep;

end;

procedure TForm1.Cut1Click(Sender: TObject);

begin

  if PopupMenu1.PopupComponent = Edit1 then

    Edit1.CutToClipboard

  else if PopupMenu1.PopupComponent = Edit2 then

    Edit2.CutToClipboard;

  else if PopupMenu1.PopupComponent = Memo1 then

    Memo1.CutToClipboard

  else if PopupMenu1.PopupComponent = Memo2 then

    Memo2.CutToClipboard

  else

    Beep;

end;

procedure TForm1.Paste1Click(Sender: TObject);

begin

  if PopupMenu1.PopupComponent = Memo1 then

    Edit1.PasteFromClipboard

  else if PopupMenu1.PopupComponent = Memo2 then

    Edit2.PasteFromClipboard;

  else if PopupMenu1.PopupComponent = Memo1 then

    Memo1.PastFromClipboard

  else if PopupMenu1.PopupComponent = Memo2 then

    Memo2.PasteFromClipboard

  else

    Beep;

end;


Prepared, Prepare Example

if not Query1.Prepared then

begin

  Query1.Close;

  Query1.Prepare;

  Query1.Open

end;


Parent, Top, Left, Checked, Preview Example

This example uses a report component, a radio group, two radio buttons, and a button on a form. When the user clicks the button, the report is sent to the screen if the screen radio button is selected, and to the printer if the printer radio button is selected.

procedure TForm1.FormCreate(Sender: TObject);

begin

  RadioGroup1.Caption := 'Send Report';

  RadioButton1.Parent := RadioGroup1;

  RadioButton1.Caption := 'to Printer';

  RadioButton1.Top := 15;

  RadioButton1.Left := 10;

  RadioButton1.Checked := True; { initialize to printer }

  RadioButton2.Parent := RadioGroup1;

  RadioButton2.Caption := 'to Screen';

  RadioButton2.Top := 35;

  RadioButton2.Left := 10;

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

  Report1.ReportName := 'MyReport';

  if RadioButton1.Checked then

    Report1.Preview := False

  else

    Report1.Preview := True;

  Report1.Run;

end;


PrintToFile, SaveToFile Example

This example displays a print dialog box with a Print to File check box, and then prints the contents of a rich edit control to the indicated destination:

procedure TForm1.BitBtn1Click(Sender: TObject);

begin

with PrintDialog1 do

  begin

  Options := [poPrintToFile];

  PrintToFile := True;

  if Execute then

    begin

    if PrintToFile then

      begin

      SaveDialog1.Title := 'Print to File: ';

      if SaveDialog1.Execute then

        RichEdit1.Lines.SaveToFile(SaveDialog1.FileName);

      end

    else

      RichEdit1.Print('');

    end;

  end;

end;


ProcessMessages Example

This example uses two buttons that are long enough to accommodate lengthy captions on a form. When the user clicks the button with the caption Ignore Messages, the code begins to generate a long series of random numbers. If the user tries to resize the form while the handler is running, nothing happens until the handler is finished. When the user clicks the button with the caption Process Messages, more random numbers are generated, but Windows can still respond to a series of mouse events, such as resizing the form.

Note:	How quickly these event handlers run depends on the microprocessor of your computer. A message appears on the form informing you when the handler has finished executing.

procedure TForm1.FormCreate(Sender: TObject);

begin

  Button1.Caption := 'Ignore Messages';

  Button2.Caption := 'Process Messages';

end;

procedure TForm1.Button1Click(Sender: TObject);

var

  I, J, X, Y: Word;

begin

  I := 0;

  J := 0;

  while I < 64000 do

  begin

    Randomize;

    while J < 64000 do

    begin

      Y := Random(J);

      Inc(J);

    end;

    X := Random(I);

    Inc(I);

  end;

  Canvas.TextOut(10, 10, 'The Button1Click handler is finished');

end;

procedure TForm1.Button2Click(Sender: TObject);

var

  I, J, X, Y: Word;

begin

  I := 0;

  J := 0;

  while I < 64000 do

  begin

    Randomize;

    while J < 64000 do

    begin

      Y := Random(J);

      Inc(J);

      Application.ProcessMessages;

    end;

    X := Random(I);

    Inc(I);

  end;

  Canvas.TextOut(10, 10, 'The Button2Click handler is finished');

end;


Read Example

The following example reads reads the data from a memo field into a blob stream and displays it in a memo control.

procedure TForm1.Button2Click(Sender: TObject);

var

  Buffer: PChar;

  MemSize: Integer;

  Stream: TBlobStream;

begin

  Stream := TBlobStream.Create(query1.FieldByName('Notes') as TBlobField, bmRead);

  try

    MemSize := Stream.Size;

    Inc(MemSize); {Make room for the buffer's null terminator.}

    Buffer := AllocMem(MemSize);     {Allocate the memory.}

    try

      Stream.Read(Buffer^, MemSize); {Read Notes field into buffer.}

      Memo1.SetTextBuf(Buffer);      {Display the buffer's contents.}

    finally

      FreeMem(Buffer, MemSize);

    end;

  finally

    Stream.Free;

  end;

end;


ReadBool Example

This example reads the DELPHI32.INI file and displays on the form the status of your auto save options.

Before you run this example, you must add the IniFiles unit to the uses clause of your unit.

procedure TForm1.FormActivate(Sender: TObject);

var

  DelphiIni: TIniFile;

begin

  DelphiIni := TIniFile.Create('c:\windows\delphi32.ini');

  with DelphiIni do

  begin

    if ReadBool('AutoSave', 'EditorFiles', True) = True then

      Canvas.TextOut(10, 10, 'Auto saving editor files.')

    else

      Canvas.TextOut(10, 10, 'Not auto saving editor files.');

    if ReadBool('AutoSave', 'DesktopFile', True) = True then

      Canvas.TextOut(10, 50, 'Auto saving desktop file.')

    else

      Canvas.TextOut(10, 50, 'Not auto saving desktop file.');

  end;

DelphiIni.Free;

end;


ReadInteger Example

This example reads settings in the WIN.INI file and displays on the form the value of a few settings.

Before you run this example, you must add the IniFiles unit to the uses clause of your unit.

procedure TForm1.FormActivate(Sender: TObject);

var

  WinIni: TIniFile;

begin

  Canvas.TextOut(20, 10, 'VARIOUS WINDOWS SETTINGS');

  WinIni := TIniFile.Create('Win.Ini');

  with WinIni do

  begin

    Canvas.TextOut(10, 45, 'Border Width = ' +

      IntToStr(ReadInteger('Windows', 'BorderWidth', -1)));

    Canvas.TextOut(10, 65, 'Icon Spacing = ' +

       IntToStr(ReadInteger('Desktop', 'IconSpacing', -1)));

    Canvas.TextOut(10, 85, 'Grid Granularity = ' +

       IntToStr(ReadInteger('Desktop', 'GridGranularity', -1)));

    Canvas.TextOut(10, 105, 'Cursor Blink Rate = ' +

       IntToStr(ReadInteger('Windows', 'CursorBlinkRate', -1)));

    Canvas.TextOut(10, 125, 'Double Click Speed = ' +

       IntToStr(ReadInteger('Windows', 'DoubleClickSpeed', -1)));

  end;

  WinIni.Free;

end;


Create, ReadSectionValues, WriteString, DeleteKey Example

This example reads the Transfer section of the DELPHI32.INI file into a memo and changes one of the strings in the INI file when Button1 is clicked.  When Button2 is clicked, the DELPHI32.INI file is restored to its initial state, using the values stored in the memo.

Before you run this example, you must add the IniFiles unit to the uses clause of your unit.

Warning:	Do not click button2 before you have clicked button1!

procedure TForm1.Button1Click(Sender: TObject);

var

  DelphiIni: TIniFile;

  begin

  DelphiIni := TIniFile.Create('c:\windows\delphi32.ini');

  Memo1.Clear;

  DelphiIni.ReadSectionValues('Transfer', Memo1.Lines);

  if Memo1.Lines.Values['Title1'] <> 'Picture Painter' then

    DelphiIni.WriteString('Transfer', 'Title1', 'Picture Painter');

  DelphiIni.Free;

end;

procedure TForm1.Button2Click(Sender: TObject);

var

  DelphiIni: TIniFile;

  begin

  DelphiIni := TIniFile.Create('c:\windows\delphi32.ini');

  { if the entry wasn’t there before, delete it now }

  if Memo1.Lines.Values['Title1'] = '' then

    DelphiIni.DeleteKey('Transfer', 'Title1')

  { otherwise, restore the old value }

  else

    DelphiIni.WriteString('Transfer', 'Title1', Memo1.Lines.Values['Title1']);

  DelphiIni.Free;

end;


ReadString Example

This example reads strings in the DELPHI32.INI file and displays them on the form.

Before you run this example, you must add the IniFiles unit to the uses clause of your unit.

procedure TForm1.FormActivate(Sender: TObject);

var

  DelphiIni: TIniFile;

begin

  Canvas.TextOut(20, 10, 'VARIOUS DELPHI SETTINGS');

  DelphiIni := TIniFile.Create('Delphi32.Ini');

  with DelphiIni do

  begin

    with Canvas do

    begin

      TextOut(10, 50, 'Editor Font = ' +

        ReadString('Editor', 'FontName', 'ERROR'));

      TextOut(10, 70, 'Search Path = ' +

        ReadString('Library', 'SearchPath', 'ERROR'));

      TextOut(10, 90, 'Component Library = ' +

        ReadString('Library', 'ComponentLibrary', 'ERROR'));

      TextOut(10, 110, 'VBX Directory = ' +

        ReadString('VBX', 'VBXDir', 'ERROR'));

      TextOut(10, 130, 'VBX Unit Directory = ' +

        ReadString('VBX', 'UnitDir', 'ERROR'));

    end;

  end;

DelphiIni.Free;

end;


Rectangle, Style, Color Example

This example draws many rectangles of various sizes and colors on a form maximized to fill the entire screen.  To run the code, drop a TTimer component on the form and use the object inspector to create the OnTimer and OnActivate event handlers.

var

  X, Y: Integer;

procedure TForm1.FormActivate(Sender: TObject);

begin

  WindowState := wsMaximized;

  Timer1.Interval := 50;

  Randomize;

end;

procedure TForm1.Timer1Timer(Sender: TObject);

begin

  X := Random(Screen.Width - 10);

  Y := Random(Screen.Height - 10);

  Canvas.Pen.Color := Random(65535);

  case Random(5) of

    0: Canvas.Pen.Style := psSolid;

    1: Canvas.Pen.Style := psDash;

    2: Canvas.Pen.Style := psDot;

    3: Canvas.Pen.Style := psDashDot;

    4: Canvas.Pen.Style := psDashDotDot;

  end;

  Canvas.Rectangle(X, Y, X + Random(400), Y + Random(400));

end;


Remove Example

The following code adds a new object to a list in a list object and then removes it:

type

  TMyClass = class

    MyString: string;

    constructor Create(S: string);

  end;

constructor TMyClass.Create(S: string);

begin

  MyString := S;

end;

procedure TForm1.Button1Click(Sender: TObject);

var

  MyList: TList;

  MyObject: TMyClass;

begin

  MyList := TList.Create;        { create the list }

  try

    MyObject := TMyClass.Create('Semper Fidelis!');  { create a class instance }

    try

      MyList.Add(MyObject);      { add instance to list }

      MessageDlg('The list has ' + IntToStr(MyList.Count) + 'objects',

                 mtInformation, [mbOk], 0);

      MyList.Remove(MyObject);

      MessageDlg('The list has ' + IntToStr(MyList.Count) + 'objects',

                 mtInformation, [mbOk], 0);

    finally

      MyObject.Free;

    end;                  { don't forget to clean up! }

  finally

    MyList.Free;

  end;

end;


OnMinimize, Restore Example

This example uses a timer on a form. When the application runs and the user minimizes the application, the timer starts and the application returns to its normal size when an OnTimer event occurs.  The timer then shuts down until the next time the form is minimized.

Be sure to declare the AppStartTimer method as a public method of TForm1.

procedure TForm1.FormCreate(Sender: TObject);

begin

  Application.OnMinimize := AppStartTimer;

end;

procedure TForm1.AppStartTimer(Sender: TObject);

begin

  Timer1.Enabled := True;

end;

procedure TForm1.Timer1Timer(Sender: TObject);

begin

  Application.Restore;

  Timer1.Enabled := False;

end;


Rewind Example

This example uses a media player and a button on a form. When the user clicks the button, the WAV audio media rewinds and begins playing. To run this example successfully, you must have installed a WAV audio device correctly.

procedure TForm1.FormCreate(Sender: TObject);

begin

  with MediaPlayer1 do

  begin

    DeviceType := dtWaveAudio;

    AutoRewind := False;

    FileName := 'CHIMES.WAV';

  end;

  Button1.Caption := 'Rewind and Play';

  Button1.Width := 130;

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

  MediaPlayer1.Rewind;

  MediaPlayer1.Play;

end;


RoundRect, Width Example

This example draws many rounded rectangles of various sizes and colors on a form maximized to fill the entire screen:

var

  X, Y, DX, DY: Integer;

procedure TForm1.FormActivate(Sender: TObject);

begin

  WindowState := wsMaximized;

  Timer1.Interval := 50;

  Randomize;

end;

procedure TForm1.Timer1Timer(Sender: TObject);

begin

  X := Random(Screen.Width - 10);

  Y := Random(Screen.Height - 10);

  Canvas.Pen.Color := Random(65535);

  Canvas.Pen.Width := Random(7);

  DX := Random(400);

  DY := Random(400);

  Canvas.RoundRect(X, Y, X + DX, Y + DY, DX div 2, DY div 2);

end;


Row, Rows Example

This example displays a string grid, a list box, and a button on a form. When the application runs, strings are put in the cells of row 1 of the string grid. When the user clicks the button, The strings in the current row of the grid are displayed in the list box.

Note that when the grid contains an empty cell, the list box has a corresponding empty string.

procedure TForm1.Button1Click(Sender: TObject);

begin

  ListBox1.Items := StringGrid1.Rows[StringGrid1.Row];

end;

procedure TForm1.FormCreate(Sender: TObject);

begin

  with StringGrid1 do

  begin

    Cells[1,0] := 'Column 1';

    Cells[2,0] := 'Column 2';

    Cells[3,0] := 'Column 3';

    Cells[4,0] := 'Column 4';

    Cells[0,1] := 'Row 1';

    Cells[1,1] := 'Object';

    Cells[2,1] := 'Pascal';

    Cells[3,1] := 'is';

    Cells[4,1] := 'excellent';

    Cells[0,2] := 'Row 2';

    Cells[1,2] := 'Delphi';

    Cells[2,2] := 'is';

    Cells[4,2] := 'RAD';

  end;

end;


State, Seek, Truncate Example

The following example deletes the stream from position 60 within the blob stream to the end.

procedure TForm1.Button1Click(Sender: TObject);

var

  Stream1: TBlobStream;

begin

  Table1.Edit;

  if Table1.State = dsEdit then

  begin

    Stream1 := Table1.CreateBlobStream(FieldByName('Notes', bmReadWrite);

    try

      Stream1.Seek(60, 0); { Move to byte 60}

      Stream1.Truncate;  { Delete from current position (60) to end of stream.}

      Table1.Post;

    finally

      Stream1.Free;

    end;

  end;

end;


SetData Example

var I: Longint;

begin

  I := Table1.FieldByName('CustID').AsInteger;

{ Set the data }

  Query1.ParamByName('CustNo').SetData(@I);

end;


SetData Example

{ Assign “raw” data to Field1 }

with Field1 do

begin

  { Allocate space }

  GetMem(Buffer, DataSize);

  { Fill Buffer with the desired data }

  ...

  { Do the assignment }

  Field1.SetData(Buffer)

  { Free the space }

  FreeMem(Buffer, DataSize);

end;


SetLink, DdeService, DdeTopic Example

The following code establishes a link with a DDE server. The service is specified in the DdeService property of DdeClientConv1, and the topic is specified in the DdeTopic property of DdeClientConv1. If the link is not established, an exception is raised.

with DDEClientConv1 do

begin

  DDEService := 'ReportSmith';

  DDETopic := 'RS_PrintReport';

  if not SetLink(DDEService, DDETopic) then

    raise Exception.Create ('Could not link to DDE server.');

end;


SetRangeStart, SetRangeEnd Example

with Table1 do

begin

  SetRangeStart; { Set the beginning key }

  FieldByName('City').AsString := 'Felton';

  SetRangeEnd; { Set the ending key }

  FieldByName('City').AsString := 'Scotts Valley';

  ApplyRange; { Tell the dataset to establish the range }

end;


ShowAccelChar Example

This example uses two labels on a form. The first label has a caption with an accelerator character in it. The second label also includes an ampersand, but it does not appear as an accelerator character.

procedure TForm1.FormCreate(Sender: TObject);

begin

  Label1.ShowAccelChar := True;

  Label1.Caption := 'An &Underlined character appears here';

  Label2.ShowAccelChar := False;

  Label2.Caption := 'An ampersand (&) appears here';

end;


Sorted Example

This example uses an edit box, a list box, and two buttons on a form. The buttons are named Add and Sort. When the user clicks the Add button, the text in the edit box is added to the list in the list box. Before the user clicks the sort button, any new items are added to the end of the list.  After the user clicks the Sort button, the list in the list box is sorted and remains sorted, even if additional strings are added.  If the user clicks the sort button again, the list box remains sorted, but any new strings are again added to the end of the list.

procedure TForm1.FormCreate(Sender: TObject);

begin

  ListBox1.Items.Add('Not');

  Listbox1.Items.Add('In');

  ListBox1.Items.Add('Alphabetical');

  ListBox1.Items.Add('Order');

end;

procedure TForm1.AddClick(Sender: TObject);

begin

  ListBox1.Items.Add(Edit1.Text);

end;

procedure TForm1.SortClick(Sender: TObject);

begin

  ListBox1.Sorted := not ListBox1.Sorted;

end;


Sorted Example

This example uses a list box on a form. When the application runs, a string list object is created and three strings are added to it. The strings are sorted and added to the list box, where they appear in their sorted order:

procedure TForm1.FormCreate(Sender: TObject);

var

  MyList: TStringList;

begin

  MyList := TStringList.Create;

  MyList.Add('Plants');

  MyList.Add('Animals');

  MyList.Add('Minerals');

  MyList.Sorted := True;

  ListBox1.Items.AddStrings(MyList);

  MyList.Free;

end;


State Example

The following code enables a post button only when the data set is edited.

if DataSource1.Dataset <> nil then

  PostButton.Enabled := DataSource1.State in [dsEdit, dsInsert];


TimeFormat, Length Example

The following code declares a HMSRec record with four byte fields. If TimeFormat is tfHMS, the first field specifies hours, the second field specifies minutes, the third field specifies seconds, and the fourth field corresponds to the unused most-significant byte of the tfHMS time format. A LongInt variable is typecast to an HMSRec record, then the hours, minutes, and seconds of the Length of the loaded media are displayed in labels when the user clicks a button.

type

  HMSRec = record

    Hours: byte;

    Minutes: byte;

    Seconds: byte;

    NotUsed: byte;

  end;

procedure TForm1.Button1Click(Sender: TObject);

var

  TheLength: LongInt;

begin

  { Set time format - note that some devices don’t support tfHMS }

  MediaPlayer1.TimeFormat := tfHMS;

  { Store length of currently loaded media }

  TheLength := MediaPlayer1.Length;

  with HMSRec(TheLength) do { Typecast TheLength as a HMSRec record }

  begin

    Label1.Caption := IntToStr(Hours); { Display Hours in Label1 }

    Label2.Caption := IntToStr(Minutes); { Display Minutes in Label2 }

    Label3.Caption := IntToStr(Seconds); { Display Seconds in Label3 }

  end;

end;


Create Example

This example shows how to create or augment a metafile using a metafile canvas object.  This metafile can then be used to draw on the canvas of another object such as a paintbox or a printer.

MyMetafile := TMetafile.Create;

with TMetafileCanvas.Create(MyMetafile, 0) do

try

  Brush.Color := clRed;

  Ellipse(0,0,100,100);

  ...

finally

  Free;

end;

Form1.Canvas.Draw(0,0,MyMetafile); {1 red circle }

To add to an existing metafile image, create a metafile canvas and play the source metafile into the metafile canvas:

with TMetafileCanvas.Create(MyMetafile, 0) do

try

  Draw(0,0,MyMetafile);

  Brush.Color := clBlue;

  Ellipse(100,100,200,200);

...

finally

  Free;

end;

Form1.Canvas.Draw(0,0,MyMetafile); {1 red circle and 1 blue circle }


Update Example

The following sample code sets the directory of DirectoryListBox1 to C:\TEMP when the form is created. When Button1 is pressed, a subdirectory called MYDIR is added to C:\TEMP, but note that it is not updated in DirectoryListBox1 until Button2 is pressed and Update is called.

procedure TForm1.Button1Click(Sender: TObject);

begin

  MkDir('c:\temp\mydir');

end;

procedure TForm1.FormCreate(Sender: TObject);

begin

  DirectoryListBox1.Directory := 'c:\temp';

end;

procedure TForm1.Button2Click(Sender: TObject);

begin

  DirectoryListBox1.Update;

end;


Sessions, GetSessionNames, SessionName, ValidateName Example

The following example searches all sessions for an open session with the DBDEMOS directory.

function TForm1.IsDuplicate(DBName: string): string;

var

  SessionCount: Integer;

  SessionNames: TStrings;

begin

  Result:= '';

  SessionNames:= TStringList.Create;

  try

    Sessions.GetSessionNames(SessionNames);

    for SessionCount:= 0 to (Sessions.Count - 1) do

      with TDatabase.Create(nil) do

      try

        SessionName:= SessionNames[SessionCount];

        try

          ValidateName(DBName);

        except

          on EDatabaseError do

            Result:= SessionNames[SessionCount];

        end;

      finally

        Free;

      end;

  finally

    SessionNames.Free;

  end;

end;

procedure TForm1.Button1Click(Sender: TObject);

var

  Duplicate: string;

begin

  Duplicate:=

    IsDuplicate('c:\program files\borland\delphi 4\demos\data');

  if Duplicate <> '' then

    ShowMessage(Format('Duplicate found in %s Session', [Duplicate]))

  else

    ShowMessage('Not A Duplicate');

end;


Sessions, Count Example

The following code sets the KeepConnections property of each session to False:

var

I: Integer;

begin

  for I := 0 to Sessions.Count - 1 do

    Sessions[I].KeepConnections := False;

end;


TileMode, Tile example

This example uses three forms. The first form has its FormStyle property set to MDIForm. The other two have their FormStyle properties set to MDIChild and their Visible properties set to True. Add a main menu component and name one of the menu items TileForms. This is code for the TileFormsClick handler:

procedure TForm1.TileFormsClick(Sender: TObject);

begin

  TileMode := tbVertical;

  Tile;

end;

When the user chooses the TileForms command, the child forms tile vertically within the MDI frame form.


Items, Values Example

This example uses a database radio group box connected to field in a dataset. The field contains the values ‘Y’, ‘N’, or ‘M’. In contrast, the user sees the captions of the radio buttons to be ‘Yes’, ‘No’, or ‘Maybe’.

When the code runs, three radio buttons appear in the group box. If the current record in the dataset contains any of the values contained in the Values property, the appropriate radio button is checked. When the user selects a radio button, the corresponding string in the Values property is entered into the field.

procedure TForm1.FormCreate(Sender: TObject);

begin

  with DBRadioGroup1 do

  begin

    Items.Add('Yes');

    Items.Add('No');

    Items.Add('Maybe');

    Values.Add('Y');

    Values.Add('N');

    Values.Add('M');

  end;

end;


Wait Example

The following code plays a .WAV audio file named NI!.WAV twice. The first call to play doesn't return control to the application until the file is done playing. Note that if you remove the line of code that sets wait to true, the sound is only played once.

procedure TForm1.Button1Click(Sender: TObject);

begin

  with MediaPlayer1 do

  begin

    FileName := 'ni!.wav';

    AutoRewind := True;

    Open;          { Open Media Player }

    try

      Wait := True;  { Waits until sounds is done playing to return }

      Play;          { Play sound }

      Play;          { Play again after first playing is completed }

    finally

      Close;             { Close media player }

    end;

  end;

end;


Write Example

The following example writes a string to the end of a blob stream.

procedure TForm1.Button3Click(Sender: TObject);

var

  Stream: TBlobStream;

  S: string;

begin

  with Table1 do

  begin

    Edit;

    Stream := CreateBlobStream(FieldByName('Notes'), bmReadWrite);

    try

      Stream.Seek(0, 2); {Seek 0 bytes from the stream's end point}

      S := ' This line will be added to the end.';

      Stream.Write(PChar(S), Length(S));

    finally

      Stream.Free;

    end;

    Post;

  end;

end;


WriteBool, WriteInteger Example

This example creates an .INI file for a game with two entries in the Options section, and one entry in the Configuration section.

Before you try this example, you must add IniFiles to the uses clause of your unit.

var

  GameIni: TIniFile;

begin

  Gameini := TIniFile.Create('FUNGAME.INI');

  with GameIni do

  begin

    WriteBool('Options', 'Sound', True);

    WriteInteger('Options', 'Level', 3);

    WriteBool('Configuration', 'ShowToolBar', True);

    Free;

  end;

end;


IndexDefs, IndexName Example

This example uses the IndexName property to sort the records in a client dataset on the CustNo and OrderNo fields.

{ Get the current available indices }

ClientDataSet1.IndexDefs.Update;

{ Find one which combines Customer Number ('CustNo') and Order Number ('OrderNo') }

for I := 0 to ClientDataSet1.IndexDefs.Count - 1 do

  if ClientDataSet1.IndexDefs.Items[I].Fields = 'CustNo;OrderNo' then

    begin

    { set that index as the current index for the dataset}

    ClientDataSet1.IndexName := ClientDataSet1.IndexDefs.Items[I].Name;

    end;


IndexFields, IndexFieldCount Example

TotalLen := 0;

with ClientDataSet1 do

{ Calculate the total length of the index }

  for I := 0 to IndexFieldCount - 1 do

    Inc(TotalLen, IndexFields[I].DataSize);


SetRangeStart, SetRangeEnd, ApplyRange Example

with ClientDataSet1 do

begin

  SetRangeStart; { Set the beginning key }

  FieldByName('City').AsString := 'Felton';

  SetRangeEnd; { Set the ending key }

  FieldByName('City').AsString := 'Scotts Valley';

  ApplyRange; { Tell the dataset to establish the range }

end;


Columns, Items, BgColor Example

The following example colors every other column in the HTML table produced by a TDataSetTableProducer gray:

with DataSetTableProducer1 do

  for I := 0 to Columns.Count - 1 do

  begin

    if I mod 2 = 0 then

      { note that we say Columns[I] rather than Columns.Items[I] }

      Columns[I].BgColor := 'White'

    else

      Columns[I].BgColor := 'Gray';

   end;


ServerExceptionHandler Example

The following code uses the ServerExceptionHandler  to access the SafeCall exception notification process so that you can log or reroute those notifications to an external monitor. The following example uses the event log wrapper class along with the ServerExceptionHandler.

unit Comexcu;

interface

uses

  ComObj, ActiveX, COMExcp_TLB;

type

    TServerExcp = class(TInterfacedObject, IServerExceptionHandler)

        procedure OnException(

            const ServerClass, ExceptionClass, ErrorMessage: WideString;

            ExceptAddr: Integer; const ErrorIID, ProgID: WideString;

            var Handled: Integer; var Result: HResult);

  end;

  TServExcpt = class(TAutoObject, IServExcpt)

  protected

    procedure CallingCOM; safecall;

    { Protected declarations }

  public

   procedure Initialize; override;

  end;

implementation

uses Windows,Sysutils,ComServ,DbTables,SvcMgr;

// Defined in Service manager unit and is used to write information

// to the NT eventlog

var

  EventLogger : TEventLogger = nil;

procedure TServExcpt.Initialize;

begin

 inherited Initialize;

 // Create the new COM server safecall exception interceptor object

 ServerExceptionHandler := TServerExcp.Create;

end;

// This method will be called from a remote machine such as an

// active server page.

procedure TServExcpt.CallingCOM;

var

 aTable : TTable;

begin

 aTable := TTable.Create(nil);

 try

   aTable.DataBaseName := 'DBDEMOS';

   aTable.TableName := 'NoExsistenttable.db'; // Force an error

   aTable.Open;

 finally

   aTable.Free;

 end;

end;

procedure TServerExcp.OnException(const ServerClass, ExceptionClass,

  ErrorMessage: WideString; ExceptAddr: Integer; const ErrorIID,

  ProgID: WideString; var Handled: Integer; var Result: HResult);

begin

  // Make use of the Services event logging class to write

  // information into the NT Event log that can be viewed remotely

  if (EventLogger <> nil) then

      EventLogger.LogMessage('The class ' + ClassName + ' caused an '+

      ExceptionClass +' Exception :' + ErrorMessage);

  // Do not pass the message onto the OS's COM subsystem

  Handled := integer(true);

end;

// Small utility function to get the module name of the DLL.

function GetModuleName: string;

var

  ModName: array[0..MAX_PATH] of Char;

begin

  SetString(Result, ModName, Windows.GetModuleFileName(HInstance, ModName, SizeOf(ModName)));

  Result := ExtractFileName(Result);

end;

initialization

  TAutoObjectFactory.Create(ComServer, TServExcpt, Class_ServExcpt,

    ciMultiInstance, tmApartment);

  // Instantiate the event logging mechanism

  EventLogger := TEventLogger.Create(GetModuleName);

finalization

  EventLogger.Free;

end.


TToolBar example
Toolbar example

To create an “IE4-style” toolbar that corresponds to an existing menu:

1	Drop a ToolBar on the form and add a ToolButton for each top-level menu item you wish to create.

2	Set the MenuItem property of each ToolButton to correspond to the top level menu items.

3	Set the Grouped property of each ToolButton to True.

4	Clear the MainMenu property of the Form (if it is assigned)


DefaultColWidth, GridLineWidth example

This example includes a draw grid on a form. When the application runs and the form is created, the width of the lines on the draw grid changes if the default column width of the grid is over 90 pixels wide:

procedure TForm1.FormCreate(Sender: TObject);

begin

  if DrawGrid1.DefaultColWidth > 90 then

    DrawGrid1.GridLineWidth := 2

  else

    DrawGrid1.GridLineWidth := 1;

end;


Col example

This example uses a string grid with a label above it on a form. When the user clicks a cell in the grid, the location of the cursor is displayed in the label caption.

procedure TForm1.DrawGrid1Click(Sender: TObject);

begin

  Label1.Caption := 'The cursor is in column ' +

                     IntToStr(DrawGrid1.Col + 1) +

                     ', row ' +

                     IntToStr(DrawGrid1.Row + 1);

end;


Selection example

The following code selects the rectangle containing rows 1 through 4, and columns 2 and 3.

procedure TForm1.Button1Click(Sender: TObject);

var

  myRect: TGridRect;

begin

  myRect.Left := 3;

  myRect.Top := 1;

  myRect.Right := 2;

  myRect.Bottom := 4;

  DrawGrid1.Selection := myRect;

end;


TopRow example

This code uses a draw grid and a button on a form. When the user clicks the button, the last row of the draw grid becomes the top row:

procedure TForm1.Button1Click(Sender: TObject);

begin

  DrawGrid1.TopRow := DrawGrid1.RowCount;

end;


TMenu example 1
TMenu example 1 (menudemo.pas)

menuform.pas	about.pas	menudemo.dfm	menuform.dfm	about.dfm

Objects

The example demonstrates using TMainMenu, TMenuItem, TPopupMenu, TColorDialog, TShape, and TPanel  objects.

Running

To run this example, load the project file from the Help\Examples\Menu directory.

Description

This example demonstrates using a main menu, menu items, and a popup menu.  Clicking on the various menu options allows the user to modify the shape and color of an image.

unit menudemo;

interface

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  Menus, ExtCtrls, ComCtrls;

type

  TMenuForm = class(TForm)

    DisplayPanel: TPanel;

    DemoShape: TShape;

    MainMenu: TMainMenu;

    Application1: TMenuItem;

    Exit1: TMenuItem;

    Color1: TMenuItem;

    Outline1: TMenuItem;

    Randomize1: TMenuItem;

    Select1: TMenuItem;

    Inside1: TMenuItem;

    Randomize2: TMenuItem;

    Select2: TMenuItem;

    Shape1: TMenuItem;

    Circle1: TMenuItem;

    Ellipse1: TMenuItem;

    Rectangle1: TMenuItem;

    Square1: TMenuItem;

    Misc1: TMenuItem;

    ThickOutline1: TMenuItem;

    RoundedShape1: TMenuItem;

    Help1: TMenuItem;

    About1: TMenuItem;

    SolidColorDialog: TColorDialog;

    AnyColorDialog: TColorDialog;

    PopupMenu: TPopupMenu;

    Random1: TMenuItem;

    RandomizeColors1: TMenuItem;

    InvertColors1: TMenuItem;

    procedure DisplayPanelResize(Sender: TObject);

    procedure Exit1Click(Sender: TObject);

    procedure Randomize1Click(Sender: TObject);

    procedure Select1Click(Sender: TObject);

    procedure Randomize2Click(Sender: TObject);

    procedure Select2Click(Sender: TObject);

    procedure Circle1Click(Sender: TObject);

    procedure Ellipse1Click(Sender: TObject);

    procedure Rectangle1Click(Sender: TObject);

    procedure Square1Click(Sender: TObject);

    procedure ThickOutline1Click(Sender: TObject);

    procedure RoundedShape1Click(Sender: TObject);

    procedure About1Click(Sender: TObject);

    procedure Random1Click(Sender: TObject);

    procedure RandomizeColors1Click(Sender: TObject);

    procedure InvertColors1Click(Sender: TObject);

  private

    { Private declarations }

    Roundable: Boolean;

    function RandomColor: TColor;

    procedure AlterShape(shape: TShapeType; roundable: Boolean);

  public

    { Public declarations }

  end;

const

  SHAPE_OFFSET = 4;

var

  MenuForm: TMenuForm;

implementation

uses about;

{$R *.DFM}

procedure TMenuForm.DisplayPanelResize(Sender: TObject);

begin

  DemoShape.Top := SHAPE_OFFSET;

  DemoShape.Left := DemoShape.Top;

  DemoShape.Height := DisplayPanel.Height - 2 * SHAPE_OFFSET;

  DemoShape.Width := DisplayPanel.Width - 2 * SHAPE_OFFSET;

end;

procedure TMenuForm.Exit1Click(Sender: TObject);

begin

  Close;

end;

function TMenuForm.RandomColor;

var

  red, green, blue: Byte;

begin

  red := Random(255);

  green := Random(255);

  blue := Random(255);

  Result := red or (green shl 8) or (blue shl 16);

end;

procedure TMenuForm.Randomize1Click(Sender: TObject);

begin

  DemoShape.Pen.Color := RandomColor;

end;

procedure TMenuForm.Select1Click(Sender: TObject);

begin

  try

    SolidColorDialog.Color := DemoShape.Pen.Color;

    if SolidColorDialog.Execute then

      DemoShape.Pen.Color := SolidColorDialog.Color;

  except

    ShowMessage('Color selection dialog failed to load');

  end;

end;

procedure TMenuForm.Randomize2Click(Sender: TObject);

begin

  DemoShape.Brush.Color := RandomColor;

end;

procedure TMenuForm.Select2Click(Sender: TObject);

begin

  AnyColorDialog.Color := DemoShape.Brush.Color;

  try

    if AnyColorDialog.Execute then

      DemoShape.Brush.Color := AnyColorDialog.Color;

  except

    ShowMessage('Color selection dialog failed to load.');

  end;

end;

procedure ToggleCheck(Sender: TObject);

var

  Item: TMenuItem;

begin

  Item := Sender as TMenuItem;

  Item.Checked := not Item.Checked;

end;

procedure SetCheck(Sender: TObject);

var

  Item: TMenuItem;

begin

  Item := Sender as TMenuItem;

  Item.Checked := True;

end;

procedure TMenuForm.AlterShape(shape: TShapeType; roundable: Boolean);

begin

  Self.Roundable := roundable;

  DemoShape.Shape := shape;

end;

procedure TMenuForm.Circle1Click(Sender: TObject);

begin

  SetCheck(Sender);

  AlterShape(stCircle, False);

end;

procedure TMenuForm.Ellipse1Click(Sender: TObject);

begin

  SetCheck(Sender);

  AlterShape(stEllipse, False);

end;

procedure TMenuForm.Rectangle1Click(Sender: TObject);

begin

  SetCheck(Sender);

  if RoundedShape1.Checked then

    AlterShape(stRoundRect, True)

  else

    AlterShape(stRectangle, True);

end;

procedure TMenuForm.Square1Click(Sender: TObject);

begin

  SetCheck(Sender);

  if RoundedShape1.Checked then

    AlterShape(stRoundSquare, True)

  else

    AlterShape(stSquare, True);

end;

procedure TMenuForm.ThickOutline1Click(Sender: TObject);

begin

  ToggleCheck(Sender);

  DemoShape.Pen.Width := 11 - DemoShape.Pen.Width;

end;

procedure TMenuForm.RoundedShape1Click(Sender: TObject);

begin

  ToggleCheck(Sender);

  case DemoShape.Shape of

    stRectangle:   DemoShape.Shape := stRoundRect;

    stRoundRect:   DemoShape.Shape := stRectangle;

    stSquare:      DemoShape.Shape := stRoundSquare;

    stRoundSquare: DemoShape.Shape := stSquare;

  end;

end;

procedure TMenuForm.About1Click(Sender: TObject);

var

  AboutBox: TAboutBox;

begin

  AboutBox := TAboutBox.Create(Self);

  try

    AboutBox.ShowModal;

  finally

    AboutBox.Free;

  end;

end;

procedure TMenuForm.Random1Click(Sender: TObject);

var

  newshape: TShapeType;

begin

  // Ensure we actually change the shape.

  repeat newshape := TShapeType(Random(6)) until

    newshape <> DemoShape.Shape;

  // Adjust the "Shape" and "Rounded Shape" menu selections.

  case newshape of

    stEllipse: Ellipse1Click(Ellipse1);

    stCircle: Circle1Click(Circle1);

    stRectangle, stRoundRect:

      begin

        RoundedShape1.Checked := newshape = stRoundRect;

        Rectangle1Click(Rectangle1);

      end;

    stSquare, stRoundSquare:

      begin

        RoundedShape1.Checked := newshape = stRoundSquare;

        Square1Click(Square1);

      end;

    end;

end;

procedure TMenuForm.RandomizeColors1Click(Sender: TObject);

begin

  DemoShape.Brush.Color := RandomColor;

  DemoShape.Pen.Color := RandomColor;

end;

procedure TMenuForm.InvertColors1Click(Sender: TObject);

var

  i : Integer;

begin

  i := Integer(DemoShape.Brush.Color) xor $FFFFFF;

  DemoShape.Brush.Color := TColor(i);

end;

end.


TMenu example 1 (about.pas)

menudemo.pas	menuform.pas	menudemo.dfm	menuform.dfm	about.dfm

This example shows a simple about box for an application.

unit about;

interface

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  StdCtrls;

type

  TAboutBox = class(TForm)

    Label1: TLabel;

    Label2: TLabel;

    Button1: TButton;

    procedure Button1Click(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

var

  AboutBox: TAboutBox;

implementation

{$R *.DFM}

procedure TAboutBox.Button1Click(Sender: TObject);

begin

  Close;

end;

end.


TMenu example 1 (menuform.pas)

menudemo.pas	about.pas	menudemo.dfm	menuform.dfm	about.dfm

This is the code for the main form of the menu example.

unit menuform;

interface

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  Menus, ExtCtrls;

type

  TForm1 = class(TForm)

    DisplayPanel: TPanel;

    DemoShape: TShape;

    MainMenu: TMainMenu;

    Application1: TMenuItem;

    Exit1: TMenuItem;

    Color1: TMenuItem;

    Outline1: TMenuItem;

    Randomize1: TMenuItem;

    Select1: TMenuItem;

    Inside1: TMenuItem;

    Randomize2: TMenuItem;

    Select2: TMenuItem;

    Shape1: TMenuItem;

    Circle1: TMenuItem;

    Ellipse1: TMenuItem;

    Rectangle1: TMenuItem;

    Square1: TMenuItem;

    Misc1: TMenuItem;

    ThickOutline1: TMenuItem;

    RoundedShape1: TMenuItem;

    Help1: TMenuItem;

    About1: TMenuItem;

    SolidColorDialog: TColorDialog;

    AnyColorDialog: TColorDialog;

    PopupMenu: TPopupMenu;

    Random1: TMenuItem;

    RandomizeColors1: TMenuItem;

    InvertColors1: TMenuItem;

    procedure DisplayPanelResize(Sender: TObject);

    procedure Exit1Click(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

const

  SHAPE_OFFSET = 4;

var

  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.DisplayPanelResize(Sender: TObject);

begin

  DemoShape.Top := SHAPE_OFFSET;

  DemoShape.Left := DemoShape.Top;

  DemoShape.Height := DisplayPanel.Height - 2 * SHAPE_OFFSET;

  DemoShape.Width := DisplayPanel.Width - 2 * SHAPE_OFFSET;

end;

procedure TForm1.Exit1Click(Sender: TObject);

begin

  Close;

end;

end.


TMenu example 1 (menudemo.dfm)

menudemo.pas	menuform.pas	about.pas	menuform.dfm	about.dfm

object MenuForm: TMenuForm

  Left = 180

  Top = 233

  Width = 696

  Height = 480

  Caption = 'MenuForm'

  Font.Color = clWindowText

  Font.Height = -11

  Font.Name = 'MS Sans Serif'

  Font.Style = []

  Menu = MainMenu

  Position = poDefaultPosOnly

  ShowHint = True

  Visible = True

  PixelsPerInch = 96

  TextHeight = 13

  object DisplayPanel: TPanel

    Left = 0

    Top = 0

    Width = 688

    Height = 434

    Align = alClient

    BevelInner = bvLowered

    BevelOuter = bvLowered

    PopupMenu = PopupMenu

    TabOrder = 0

    OnResize = DisplayPanelResize

    object DemoShape: TShape

      Left = 120

      Top = 8

      Width = 193

      Height = 217

      Shape = stCircle

    end

  end

  object MainMenu: TMainMenu

    Left = 16

    Top = 56

    object Application1: TMenuItem

      Caption = '&Application'

      Hint = 'Simple command menu item'

      object Exit1: TMenuItem

        Caption = 'E&xit'

        Hint = 'Close the application'

        OnClick = Exit1Click

      end

    end

    object Color1: TMenuItem

      Caption = '&Color'

      Hint = 'Submenus'

      object Outline1: TMenuItem

        Caption = '&Outline'

        Hint = 'Adjust shape outline color'

        object Randomize1: TMenuItem

          Caption = '&Randomize'

          Hint = 'Set shape outline to a random color'

          OnClick = Randomize1Click

        end

        object Select1: TMenuItem

          Caption = '&Select...'

          Hint = 'Select shape outline color'

          OnClick = Select1Click

        end

      end

      object Inside1: TMenuItem

        Caption = '&Inside'

        Hint = 'Adjust shape inside color'

        object Randomize2: TMenuItem

          Caption = '&Randomize'

          Hint = 'Set shape inside to a random color'

          OnClick = Randomize2Click

        end

        object Select2: TMenuItem

          Caption = '&Select...'

          Hint = 'Select a color for the shape filling'

          OnClick = Select2Click

        end

      end

    end

    object Shape1: TMenuItem

      Caption = '&Shape'

      GroupIndex = 1

      Hint = 'Mutually-exclusive toggle group'

      object Circle1: TMenuItem

        Caption = '&Circle'

        Checked = True

        GroupIndex = 1

        Hint = 'Make the shape a circle'

        RadioItem = True

        OnClick = Circle1Click

      end

      object Ellipse1: TMenuItem

        Caption = '&Ellipse'

        GroupIndex = 1

        Hint = 'Make the shape an ellipse'

        RadioItem = True

        OnClick = Ellipse1Click

      end

      object Rectangle1: TMenuItem

        Caption = '&Rectangle'

        GroupIndex = 1

        Hint = 'Make the shape a rectangle'

        RadioItem = True

        OnClick = Rectangle1Click

      end

      object Square1: TMenuItem

        Caption = '&Square'

        GroupIndex = 1

        Hint = 'Make the shape a square'

        RadioItem = True

        OnClick = Square1Click

      end

    end

    object Misc1: TMenuItem

      Caption = '&Misc'

      GroupIndex = 1

      Hint = 'Simple checkable menu items with a superfluous bar break in between'

      object ThickOutline1: TMenuItem

        Caption = '&Thick Outline'

        Hint = 'Controls whether or not the outline is thick'

        OnClick = ThickOutline1Click

      end

      object RoundedShape1: TMenuItem

        Break = mbBarBreak

        Caption = '&Rounded Shape'

        Hint = 'Makes rectangle or square have rounded corners'

        OnClick = RoundedShape1Click

      end

    end

    object Help1: TMenuItem

      Caption = '&Help'

      GroupIndex = 1

      Hint = 'Simple command menu item'

      object About1: TMenuItem

        Caption = '&About...'

        Hint = 'Summons an About box'

        OnClick = About1Click

      end

    end

  end

  object SolidColorDialog: TColorDialog

    Ctl3D = True

    Options = [cdSolidColor]

    Left = 48

    Top = 56

  end

  object AnyColorDialog: TColorDialog

    Ctl3D = True

    Options = [cdAnyColor]

    Left = 80

    Top = 56

  end

  object PopupMenu: TPopupMenu

    Left = 16

    Top = 88

    object Random1: TMenuItem

      Caption = 'Randomize &Shape'

      OnClick = Random1Click

    end

    object RandomizeColors1: TMenuItem

      Caption = 'Randomize &Colors'

      OnClick = RandomizeColors1Click

    end

    object InvertColors1: TMenuItem

      Caption = '&Invert Inside Color'

      OnClick = InvertColors1Click

    end

  end

end


TMenu example 1 (about.dfm)

menudemo.pas	menuform.pas	about.pas	menudemo.dfm	menuform.dfm

object AboutBox: TAboutBox

  Left = 200

  Top = 108

  BorderIcons = []

  BorderStyle = bsDialog

  Caption = 'About Menu'

  ClientHeight = 134

  ClientWidth = 239

  Font.Charset = DEFAULT_CHARSET

  Font.Color = clWindowText

  Font.Height = -11

  Font.Name = 'MS Sans Serif'

  Font.Style = []

  Position = poScreenCenter

  PixelsPerInch = 96

  TextHeight = 13

  object Label1: TLabel

    Left = 60

    Top = 24

    Width = 123

    Height = 16

    Alignment = taCenter

    Caption = 'Menu Demonstration'

    Font.Charset = ANSI_CHARSET

    Font.Color = clBlack

    Font.Height = -13

    Font.Name = 'MS Sans Serif'

    Font.Style = []

    ParentFont = False

  end

  object Label2: TLabel

    Left = 32

    Top = 56

    Width = 186

    Height = 13

    Caption = 'Copyright (c) 1999 Inprise International'

  end

  object Button1: TButton

    Left = 80

    Top = 88

    Width = 75

    Height = 25

    Caption = 'OK'

    TabOrder = 0

    OnClick = Button1Click

  end

end


TMenu example 1 (menuform.dfm)

menudemo.pas	menuform.pas	about.pas	menudemo.dfm	about.dfm

object Form1: TForm1

  Left = 134

  Top = 226

  Width = 696

  Height = 480

  Caption = 'Form1'

  Font.Color = clWindowText

  Font.Height = -11

  Font.Name = 'MS Sans Serif'

  Font.Style = []

  Menu = MainMenu

  Visible = True

  PixelsPerInch = 96

  TextHeight = 13

  object DisplayPanel: TPanel

    Left = 0

    Top = 0

    Width = 688

    Height = 434

    Align = alClient

    BevelInner = bvLowered

    BevelOuter = bvLowered

    Caption = 'DisplayPanel'

    PopupMenu = PopupMenu

    TabOrder = 0

    OnResize = DisplayPanelResize

    object DemoShape: TShape

      Left = 120

      Top = 8

      Width = 193

      Height = 217

      Shape = stCircle

    end

  end

  object MainMenu: TMainMenu

    Left = 16

    Top = 56

    object Application1: TMenuItem

      Caption = '&Application'

      Hint = 'Simple command menu item'

      object Exit1: TMenuItem

        Caption = 'E&xit'

        OnClick = Exit1Click

      end

    end

    object Color1: TMenuItem

      Caption = '&Color'

      Hint = 'Submenus'

      object Outline1: TMenuItem

        Caption = '&Outline'

        Hint = 'Adjust shape outline color'

        object Randomize1: TMenuItem

          Caption = '&Randomize'

          Hint = 'Set shape outline to a random color'

        end

        object Select1: TMenuItem

          Caption = '&Select...'

          Hint = 'Select shape outline color'

        end

      end

      object Inside1: TMenuItem

        Caption = '&Inside'

        Hint = 'Adjust shape inside color'

        object Randomize2: TMenuItem

          Caption = '&Randomize'

          Hint = 'Set shape inside to a random color'

        end

        object Select2: TMenuItem

          Caption = '&Select...'

          Hint = 'Select a color for the shape filling'

        end

      end

    end

    object Shape1: TMenuItem

      Caption = '&Shape'

      GroupIndex = 1

      Hint = 'Mutually-exclusive toggle group'

      object Circle1: TMenuItem

        Caption = '&Circle'

        Checked = True

        GroupIndex = 1

        Hint = 'Make the shape a circle'

        RadioItem = True

      end

      object Ellipse1: TMenuItem

        Caption = '&Ellipse'

        GroupIndex = 1

        Hint = 'Make the shape an ellipse'

        RadioItem = True

      end

      object Rectangle1: TMenuItem

        Caption = '&Rectangle'

        GroupIndex = 1

        Hint = 'Make the shape a rectangle'

        RadioItem = True

      end

      object Square1: TMenuItem

        Caption = '&Square'

        GroupIndex = 1

        Hint = 'Make the shape a square'

        RadioItem = True

      end

    end

    object Misc1: TMenuItem

      Caption = '&Misc'

      GroupIndex = 1

      Hint = 'Simple checkable menu items with a superfluous bar break in between'

      object ThickOutline1: TMenuItem

        Caption = '&Thick Outline'

        Hint = 'Controls whether or not the outline is thick'

      end

      object RoundedShape1: TMenuItem

        Break = mbBarBreak

        Caption = '&Rounded Shape'

        Hint = 'Makes rectangle or square have rounded corners'

      end

    end

    object Help1: TMenuItem

      Caption = '&Help'

      GroupIndex = 1

      Hint = 'Simple command menu item'

      object About1: TMenuItem

        Caption = '&About...'

        Hint = 'Summons an About box'

      end

    end

  end

  object SolidColorDialog: TColorDialog

    Ctl3D = True

    Options = [cdSolidColor]

    Left = 48

    Top = 56

  end

  object AnyColorDialog: TColorDialog

    Ctl3D = True

    Options = [cdAnyColor]

    Left = 80

    Top = 56

  end

  object PopupMenu: TPopupMenu

    Left = 16

    Top = 88

    object Random1: TMenuItem

      Caption = 'Randomize &Shape'

    end

    object RandomizeColors1: TMenuItem

      Caption = 'Randomize &Colors'

    end

    object InvertColors1: TMenuItem

      Caption = '&Invert Inside Color'

    end

  end

end


TMenu example 2
TMenu example 2 (umnudmo.pas)

umnudmo.dfm

Objects

The example demonstrates using TMainMenu, TMenuItem, and TPopupMenu objects.

Running

To run this example, load the project file from the Help\Examples\Menu2 directory.

Description

This example demonstrates creating a main menu, menu items, and a popup menu.

unit UMnuDmo;

interface

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  StdCtrls, ExtCtrls,Menus;

type

  TForm1 = class(TForm)

    Panel1: TPanel;

    Button1: TButton;

    Button2: TButton;

    Button3: TButton;

    Button4: TButton;

    Button5: TButton;

    Button6: TButton;

    Button7: TButton;

    Button8: TButton;

    Button9: TButton;

    procedure Button1Click(Sender: TObject);

    procedure Button2Click(Sender: TObject);

    procedure Button7Click(Sender: TObject);

    procedure Button3Click(Sender: TObject);

    procedure MyPopupHandler(Sender: TObject);

    procedure Button4Click(Sender: TObject);

    procedure Button5Click(Sender: TObject);

    procedure Button6Click(Sender: TObject);

    procedure Button8Click(Sender: TObject);

    procedure Button9Click(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

var

  Form1: TForm1;

  MyMainMenu: TMainMenu;

  MyPopUpMenu: TPopUpMenu;

  MySubItem1,MySubItem2 : TMenuItem;

  MySubItems: array[0..3] of TMenuItem;

  MyPopUpItems: array[0..3] of TMenuItem;

implementation

{$R *.DFM}

procedure TForm1.MyPopupHandler(Sender: TObject);

begin

  with Sender as TMenuItem do begin

    ShowMessage(Caption);

  end;

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

  MyMainMenu:= TMainMenu.Create(Self);

  Button4.Enabled := true;

  ShowMessage('MainMenu created but no items' + #13+

              'are added so it does not show.');

  Button1.Enabled := False;

end;

procedure TForm1.Button2Click(Sender: TObject);

begin

  MyPopUpMenu := TPopUpMenu.Create(self);

  Button3.Enabled := true;

  ShowMessage('PopUpMenu created.');

  Button2.Enabled := False;

end;

procedure TForm1.Button7Click(Sender: TObject);

begin

  MyPopUpMenu.Popup(Form1.Left + 60, Form1.Top + 140);

  Button9.Enabled := true;

end;

procedure TForm1.Button3Click(Sender: TObject);

var

  i: Integer;

begin

  for i := 0 to 3 do begin

    MyPopUpItems[i] := TMenuItem.Create(Self);

    MyPopUpItems[i].Caption := 'New item ' + IntToStr(i);

    MyPopUpMenu.Items.Add(MyPopUpItems[i]);

  end;

  Button7.Enabled := true;

  Button3.Enabled := False;

end;

procedure TForm1.Button4Click(Sender: TObject);

var

  MyItem: array[0..2] of TMenuItem;

  i: Integer;

begin

  for i := 0 to 2 do begin

    MyItem[i] := TMenuItem.Create(Self);

    MyItem[i].Caption := 'New item ' + IntToStr(i);

    MyMainMenu.Items.Add(MyItem[i]);

    end;

  Button4.Enabled := False;

  Button5.Enabled := true;

end;

procedure TForm1.Button5Click(Sender: TObject);

var

  i: Integer;

begin

  for i := 0 to 3 do begin

    MySubItems[i] := TMenuItem.Create(Self);

    MySubItems[i].Caption := 'New item ' + IntToStr(i);

    MySubItems[i].OnClick := MyPopUpHandler;

    MyMainMenu.Items[0].Add(MySubItems[i]);

  end;

  Button6.Enabled := true;

  Button8.Enabled := true;

  Button5.Enabled := False;

end;

procedure TForm1.Button6Click(Sender: TObject);

begin

  MySubItems[3].Break := mbBarBreak;

end;

procedure TForm1.Button8Click(Sender: TObject);

begin

  MySubItems[2].Caption :='-';

end;

procedure TForm1.Button9Click(Sender: TObject);

var

  i: Integer;

begin

  for i := 0 to 3 do begin

    MyPopUpItems[i].OnClick := MyPopupHandler;

  end;

end;

end.


TMenu example 2 (umnudmo.dfm)

umnudmo.pas

object Form1: TForm1

  Left = 199

  Top = 67

  Width = 467

  Height = 341

  Caption = 'Menu Demo'

  Font.Charset = DEFAULT_CHARSET

  Font.Color = clWindowText

  Font.Height = -11

  Font.Name = 'MS Sans Serif'

  Font.Style = []

  PixelsPerInch = 96

  TextHeight = 13

  object Panel1: TPanel

    Left = 56

    Top = 56

    Width = 345

    Height = 209

    TabOrder = 0

    object Button1: TButton

      Left = 32

      Top = 16

      Width = 110

      Height = 25

      Caption = 'Create Main Menu'

      TabOrder = 0

      OnClick = Button1Click

    end

    object Button2: TButton

      Left = 200

      Top = 14

      Width = 110

      Height = 25

      Caption = 'Create PopUp Menu'

      TabOrder = 1

      OnClick = Button2Click

    end

    object Button3: TButton

      Left = 200

      Top = 52

      Width = 110

      Height = 25

      Caption = 'Add PopUp Items'

      Enabled = False

      TabOrder = 2

      OnClick = Button3Click

    end

    object Button4: TButton

      Left = 32

      Top = 54

      Width = 110

      Height = 25

      Caption = 'Add Main Items'

      Enabled = False

      TabOrder = 3

      OnClick = Button4Click

    end

    object Button5: TButton

      Left = 32

      Top = 92

      Width = 110

      Height = 25

      Caption = 'Add Sub-Menu'

      Enabled = False

      TabOrder = 4

      OnClick = Button5Click

    end

    object Button6: TButton

      Left = 32

      Top = 130

      Width = 110

      Height = 25

      Caption = 'Add  Vertical Break'

      Enabled = False

      TabOrder = 5

      OnClick = Button6Click

    end

    object Button7: TButton

      Left = 200

      Top = 90

      Width = 110

      Height = 25

      Caption = 'Show PopUp'

      Enabled = False

      TabOrder = 6

      OnClick = Button7Click

    end

    object Button8: TButton

      Left = 32

      Top = 168

      Width = 110

      Height = 25

      Caption = 'Add Horizontal Break'

      Enabled = False

      TabOrder = 7

      OnClick = Button8Click

    end

    object Button9: TButton

      Left = 200

      Top = 128

      Width = 110

      Height = 25

      Caption = 'Assign OnClick Event'

      Enabled = False

      TabOrder = 8

      OnClick = Button9Click

    end

  end

end


TBitmap example
TBitmap example (bmpformu.pas)

bmpformu.dfm

Objects

The example demonstrates using the TBitmap object.

Running

To run this example, load the project file from the Help\Examples\Bitmap directory.

Description

This example demonstrates changing the palette of a TBitmap object. A TBitmap is an encapsulation of the windows BITMAP and PALETTE which manages realizing of the palette automatically. The bitmap can be loaded from a .BMP file (LoadFromFile method) or a resource (LoadFromResourceName or LoadFromResourceID method) and saved back to a file (SaveToFile method).  It can be drawn on a canvas by using the TCanvas' Draw or StretchDraw method.  The size of the bitmap can be determined by using the Height and Width properties of TBitmap.

The example below illustrates the use of TBitmap’s Palette, LoadFromFile, Draw, Height, and Width. Be sure that a small bitmap file named bor6.bmp is present in the same directory as the .exe file.

Disclaimer

This is an example of using TBitmaps and is not intended to be an efficient method of tiling a form.

unit bmpformu;

//

interface

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  StdCtrls;

type

  TBmpForm = class(TForm)

    Button1: TButton;

    procedure FormDestroy(Sender: TObject);

    procedure FormPaint(Sender: TObject);

    procedure Button1Click(Sender: TObject);

    procedure FormCreate(Sender: TObject);

  private

    { Private declarations }

    Bitmap: TBitmap;

    procedure ScrambleBitmap;

    procedure WMEraseBkgnd(var m: TWMEraseBkgnd); message WM_ERASEBKGND;

  public

    { Public declarations }

  end;

var

  BmpForm: TBmpForm;

implementation

{$R *.DFM}

procedure TBmpForm.FormCreate(Sender: TObject);

begin

  Bitmap := TBitmap.Create;

  Bitmap.LoadFromFile('bor6.bmp');

end;

procedure TBmpForm.FormDestroy(Sender: TObject);

begin

  Bitmap.Free;

end;

// since we're going to be painting the whole form, handling this

// message will suppress the uneccessary repainting of the background

// which can result in flicker.

procedure TBmpform.WMEraseBkgnd(var m : TWMEraseBkgnd);

begin

  m.Result := LRESULT(False);

end;

procedure TBmpForm.FormPaint(Sender: TObject);

var

  x, y: Integer;

begin

  y := 0;

  while y < Height do

  begin

    x := 0;

    while x < Width do

    begin

      Canvas.Draw(x, y, Bitmap);

      x := x + Bitmap.Width;

    end;

    y := y + Bitmap.Height;

  end;

end;

procedure TBmpForm.Button1Click(Sender: TObject);

begin

  ScrambleBitmap;

  Invalidate;

end;

//

// scrambling the bitmap is easy when it has 256 colors:

// we just need to change each of the colors in the palette

// to some other value.

//

procedure TBmpForm.ScrambleBitmap;

var

  pal: PLogPalette;

  hpal: HPALETTE;

  i: Integer;

begin

  pal := nil;

  try

    GetMem(pal, sizeof(TLogPalette) + sizeof(TPaletteEntry) * 255);

    pal.palVersion := $300;

    pal.palNumEntries := 256;

    for i := 0 to 255 do

    begin

      pal.palPalEntry[i].peRed := Random(255);

      pal.palPalEntry[i].peGreen := Random(255);

      pal.palPalEntry[i].peBlue := Random(255);

    end;

    hpal := CreatePalette(pal^);

    if hpal <> 0 then

      Bitmap.Palette := hpal;

  finally

    FreeMem(pal);

  end;

end;

end.


TBitmap example (bmpformu.dfm)

bmpformu.pas

object BmpForm: TBmpForm

  Left = 311

  Top = 321

  Width = 466

  Height = 334

  Caption = 'BmpForm'

  Font.Charset = DEFAULT_CHARSET

  Font.Color = clWindowText

  Font.Height = -11

  Font.Name = 'MS Sans Serif'

  Font.Style = []

  OnCreate = FormCreate

  OnDestroy = FormDestroy

  OnPaint = FormPaint

  PixelsPerInch = 96

  TextHeight = 13

  object Button1: TButton

    Left = 56

    Top = 40

    Width = 113

    Height = 25

    Caption = 'Scramble Palette'

    TabOrder = 0

    OnClick = Button1Click

  end

end


TRegIniFile example
TRegIniFile example (regini.pas)

reginid.pas	reginid.dfm

Objects

The example demonstrates using TRegIniFile, TGroupBox, TLabel, TCheckBox, TRadioGroup, TEdit and TMemo objects.

Running

To run this example, load the project file from the Help\Examples\Regini directory.

Description

This example demonstrates using a TRegIniFile object to make changes to the Windows registry.  Changes made to the system registry will not be permanent and will be deleted upon termination of the example application.

program regini;

uses

  Forms,

  reginid in 'reginid.pas' {Form1};

{$R *.RES}

begin

  Application.Initialize;

  Application.CreateForm(TForm1, Form1);

  Application.Run;

end.


TRegIniFile example (reginid.pas)

regini.pas	reginid.dfm

unit reginid;

interface

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  StdCtrls, ExtCtrls, Registry;

type

  TRegIniForm = class(TForm)

    GroupBox1: TGroupBox;

    Label1: TLabel;

    CheckBox_Write: TCheckBox;

    RadioGroup_Write: TRadioGroup;

    Edit_Write: TEdit;

    GroupBox2: TGroupBox;

    Label3: TLabel;

    CheckBox_Read: TCheckBox;

    RadioGroup_Read: TRadioGroup;

    Edit_Read: TEdit;

    Memo_Read: TMemo;

    Button_Write: TButton;

    Button_Read: TButton;

    procedure FormCreate(Sender: TObject);

    procedure FormDestroy(Sender: TObject);

    procedure Button_WriteClick(Sender: TObject);

    procedure Button_ReadClick(Sender: TObject);

    procedure CheckBox_ReadClick(Sender: TObject);

    procedure RadioGroup_ReadClick(Sender: TObject);

  private

    { Private declarations }

    procedure Read_Registry;

    procedure Write_Registry;

  public

    { Public declarations }

    FIniFile: TRegIniFile;

  end;

var

  RegIniForm: TRegIniForm;

implementation

{$R *.DFM}

const

  SECTION = 'Sample';

procedure TRegIniForm.FormCreate(Sender: TObject);

begin

  FIniFile := TRegIniFile.Create('Sample Registry');

end;

procedure TRegIniForm.FormDestroy(Sender: TObject);

var

  Cleanup: TRegistry;

  key: string;

begin

  key := FIniFile.FileName;

  FIniFile.Free;

  // make sure we don't leave junk in the registry behind.

  Cleanup := TRegistry.Create;

  try

    Cleanup.DeleteKey(key);

  finally

    Cleanup.Free;

  end;

end;

procedure TRegIniForm.Write_Registry;

begin

  FIniFile.WriteBool(SECTION, 'BooleanTest', CheckBox_Write.Checked);

  FIniFile.WriteInteger(SECTION, 'IntegerTest', RadioGroup_Write.ItemIndex);

  FIniFile.WriteString(SECTION, 'StringTest', Edit_Write.Text);

  if not Button_Read.Enabled then Button_Read.Enabled := True;

end;

procedure TRegIniForm.Read_Registry;

begin

  CheckBox_Read.Checked := FIniFile.ReadBool(SECTION, 'BooleanTest', False);

  RadioGroup_Read.ItemIndex := FIniFile.ReadInteger(SECTION, 'IntegerTest', 0);

  Edit_Read.Text := FIniFile.ReadString(SECTION, 'StringTest', '');

  Memo_Read.Lines.Clear;

  FIniFile.ReadSectionValues(SECTION, Memo_Read.Lines);

  Button_Read.Enabled := False;

end;

procedure TRegIniForm.Button_WriteClick(Sender: TObject);

begin

  Write_Registry;

end;

procedure TRegIniForm.Button_ReadClick(Sender: TObject);

begin

  Read_Registry;

end;

procedure TRegIniForm.CheckBox_ReadClick(Sender: TObject);

begin

  Read_Registry;

end;

procedure TRegIniForm.RadioGroup_ReadClick(Sender: TObject);

begin

  Read_Registry;

end;

end.


TRegIniFile example (reginid.dfm)

regini.pas	reginid.pas

object RegIniForm: TRegIniForm

  Left = 200

  Top = 108

  Width = 476

  Height = 264

  Caption = 'RegIniForm'

  Font.Charset = DEFAULT_CHARSET

  Font.Color = clWindowText

  Font.Height = -11

  Font.Name = 'MS Sans Serif'

  Font.Style = []

  OnCreate = FormCreate

  OnDestroy = FormDestroy

  PixelsPerInch = 96

  TextHeight = 13

  object GroupBox1: TGroupBox

    Left = 8

    Top = 16

    Width = 145

    Height = 169

    Caption = 'Write to Registry'

    TabOrder = 0

    object Label1: TLabel

      Left = 16

      Top = 120

      Width = 51

      Height = 13

      Caption = 'String Test'

    end

    object CheckBox_Write: TCheckBox

      Left = 16

      Top = 24

      Width = 97

      Height = 17

      Caption = 'Boolean Test'

      TabOrder = 0

    end

    object RadioGroup_Write: TRadioGroup

      Left = 16

      Top = 48

      Width = 105

      Height = 65

      Caption = 'Integer Test'

      Columns = 3

      ItemIndex = 0

      Items.Strings = (

        '0'

        '1'

        '2'

        '3'

        '4'

        '5')

      TabOrder = 1

    end

    object Edit_Write: TEdit

      Left = 16

      Top = 136

      Width = 105

      Height = 21

      TabOrder = 2

      Text = 'Edit_Write'

    end

  end

  object GroupBox2: TGroupBox

    Left = 160

    Top = 16

    Width = 289

    Height = 169

    Caption = 'Read from Registry'

    TabOrder = 1

    object Label3: TLabel

      Left = 16

      Top = 120

      Width = 51

      Height = 13

      Caption = 'String Test'

    end

    object CheckBox_Read: TCheckBox

      Left = 16

      Top = 24

      Width = 97

      Height = 17

      Caption = 'Boolean Test'

      TabOrder = 0

      OnClick = CheckBox_ReadClick

    end

    object RadioGroup_Read: TRadioGroup

      Left = 16

      Top = 48

      Width = 105

      Height = 65

      Caption = 'Integer Test'

      Columns = 3

      ItemIndex = 0

      Items.Strings = (

        '0'

        '1'

        '2'

        '3'

        '4'

        '5')

      TabOrder = 1

      OnClick = RadioGroup_ReadClick

    end

    object Edit_Read: TEdit

      Left = 16

      Top = 136

      Width = 105

      Height = 21

      ReadOnly = True

      TabOrder = 2

      Text = 'Edit_Read'

    end

    object Memo_Read: TMemo

      Left = 144

      Top = 24

      Width = 129

      Height = 137

      Lines.Strings = (

        '')

      ReadOnly = True

      TabOrder = 3

    end

  end

  object Button_Write: TButton

    Left = 24

    Top = 200

    Width = 105

    Height = 25

    Caption = 'Write to Registry'

    TabOrder = 2

    OnClick = Button_WriteClick

  end

  object Button_Read: TButton

    Left = 176

    Top = 200

    Width = 105

    Height = 25

    Caption = 'Read from Registry'

    TabOrder = 3

    OnClick = Button_ReadClick

  end

end


TScrollBar example
TScrollBar example (scroldem.pas)

scroldem.dfm

Objects

The example demonstrates using TScrollBar, TImage, TEdit, TUpDown, TOpenDialog, TMenuItem, TBevel, TLabel and TPanel objects.

Running

To run this example, load the project file from the Help\Examples\Scrollbar directory.

Description

This example demonstrates the use of TScrollBar, including how to properly set scrolling ranges and how to respond to the scroll bar notification events.  In addition, an interface is provided for the user to adjust the values to see how the different parameters affect the scrolling behavior.  No attempt is made to verify that the parameters supplied by the user make any sense.

unit scroldem;

interface

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  Menus, StdCtrls, ComCtrls, ExtCtrls;

type

  TScrollForm1 = class(TForm)

    Bevel1: TBevel;

    Label3: TLabel;

    Label4: TLabel;

    Label5: TLabel;

    Label1: TLabel;

    Vertical: TLabel;

    ImgPanel: TPanel;

    Image: TImage;

    HScrollb: TScrollBar;

    VScrollb: TScrollBar;

    HUnits: TEdit;

    HPage: TEdit;

    HMax: TEdit;

    VUnits: TEdit;

    VPage: TEdit;

    VMax: TEdit;

    HUnitsUpDown: TUpDown;

    HPageUpDown: TUpDown;

    HMaxUpDown: TUpDown;

    VUnitsUpDown: TUpDown;

    VMaxUpDown: TUpDown;

    VPageUpDown: TUpDown;

    DefaultBtn: TButton;

    ApplyBtn: TButton;

    MainMenu1: TMainMenu;

    File1: TMenuItem;

    Open1: TMenuItem;

    N1: TMenuItem;

    Exit1: TMenuItem;

    View1: TMenuItem;

    VScrollMenu: TMenuItem;

    HScrollMenu: TMenuItem;

    Help1: TMenuItem;

    About1: TMenuItem;

    OpenDialog: TOpenDialog;

    procedure FormCreate(Sender: TObject);

    procedure Exit1Click(Sender: TObject);

    procedure View1Click(Sender: TObject);

    procedure VScrollMenuClick(Sender: TObject);

    procedure HScrollMenuClick(Sender: TObject);

    procedure Open1Click(Sender: TObject);

    procedure VScrollbChange(Sender: TObject);

    procedure HScrollbScroll(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer);

    procedure ImgPanelResize(Sender: TObject);

    procedure About1Click(Sender: TObject);

    procedure ApplyBtnClick(Sender: TObject);

    procedure DefaultBtnClick(Sender: TObject);

    procedure UpDownClick(Sender: TObject; Button: TUDBtnType);

  private

    { Private declarations }

    Units: TPoint;

    FDirty: Boolean;

    procedure SetDirty(d: Boolean);

    procedure ImageLoad(filename: string);

    procedure ScrollAdjust(update: Boolean);

    procedure ScrollReset;

    procedure UpdateDisplay;

    property Dirty: Boolean read FDirty write SetDirty;

  public

        { Public declarations }

  end;

var

  ScrollForm1: TScrollForm1;

implementation

uses about;

{$R *.DFM}

const

  DEF_SCROLL_UNITS = 8;

procedure TScrollForm1.FormCreate(Sender: TObject);

begin

  ScrollReset;

end;

procedure TScrollForm1.Exit1Click(Sender: TObject);

begin

  Close;

end;

procedure TScrollForm1.View1Click(Sender: TObject);

begin

  HScrollMenu.Checked := HScrollb.Visible;

  VScrollMenu.Checked := VScrollb.Visible;

end;

procedure TScrollForm1.VScrollMenuClick(Sender: TObject);

begin

  VScrollb.Visible := not VScrollb.Visible;

end;

procedure TScrollForm1.HScrollMenuClick(Sender: TObject);

begin

  HScrollb.Visible := not HScrollb.Visible;

end;

procedure TScrollForm1.Open1Click(Sender: TObject);

begin

  if OpenDialog.Execute then

    ImageLoad(OpenDialog.FileName);

end;

//

// Hooking the OnChange event is the simplest way to handle the

// scrollbar notification.  Note the check to ensure that the

// that the sender is the vertical scrollbar.  While irrelevant for

// this example, some forms may need to distinguish between various

// scrollbars.

//

procedure TScrollForm1.VScrollbChange(Sender: TObject);

begin

  if Sender as TScrollBar = VScrollb then

    Image.Top := -Units.y * VScrollb.Position;

end;

//

// Hooking the OnScroll event is another option for handling the

// scrollbar notification.  This is needed for a few reasons:

//   1) you want to do something special with particular scroll

//      events

//   2) the range of your scrollbar is larger than [0, 65535].  in

//      this case, the ScrollPos element is invalid and much of the

//      scrolling has to be done manually.

//

procedure TScrollForm1.HScrollbScroll(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer);

begin

  if HScrollb.Max <= 65535 then

    Image.Left := -Units.x * ScrollPos

  else

    ShowMessage('Scrollbar ranges > 65535 not supported');

end;

//

// The panel's size doesn't change in this example, so

// this event will only happen once.  In general, the range

// of the scrollbars will need to be changed when the size of

// the visible window is changed.

//

procedure TScrollForm1.ImgPanelResize(Sender: TObject);

begin

  ScrollAdjust(True);

end;

function scale(n, u: Integer): Integer;

begin

  Result := (n + u - 1) div u;

end;

function maxval(a, b: Integer): Integer;

begin

  if a >= b then

    Result := a

  else

    Result := b;

end;

//

// Readjust the range of the scrollbars to match the new size

// of the visible window.  (Also called by ScrollReset to avoid

// duplicating the code).

//

procedure TScrollForm1.ScrollAdjust(update: Boolean);

begin

  // set the maximum scrolling to be large enough to scroll the whole

  // image, but not so much that it can scroll off the window.  we

  // divide by the number of Units (>1) because scrolling one pixel at

  // a time is way too slow for most images of any size.

  if Image.Picture <> nil then

  begin

    HScrollb.Max := maxval(0, scale(Image.Width - ImgPanel.Width, Units.x));

    VScrollb.Max := maxval(0, scale(Image.Height - ImgPanel.Height, Units.y));

  end;

  if update then

    UpdateDisplay;

end;

//

// ScrollReset() is used to put the scrollbars into a sane "initial"

// state.  this needs to be done each time the image is changed,

// since the amount we scroll depends upon the image size.  for

// simplicity, the special case of "new image size" == "old image size"

// is ignored.

//

procedure TScrollForm1.ScrollReset;

begin

  // this fixed size works nice, although in some cases basing

  // the scroll units upon the size of the image works well, too.

  Units.x := DEF_SCROLL_UNITS;

  Units.y := DEF_SCROLL_UNITS;

  if Image.Picture <> nil then

  begin

    // move the image and the scrollbars to their "home" location

    Image.Top := 0;

    Image.Left := 0;

    HScrollb.Position := 0;

    VScrollb.Position := 0;

    // negative scrolling ranges aren't worth the trouble, so set

    // the range to go from [0, M].  See 'ScrollAdjust' to see how M

    // is calculated.

    HScrollb.Min := 0;

    VScrollb.Min := 0;

    ScrollAdjust(False);

    HScrollb.LargeChange := scale(HScrollb.Max, Units.x);

    VScrollb.LargeChange := scale(VScrollb.Max, Units.y);

    HScrollb.Visible := True;

    VScrollb.Visible := True;

  end;

  UpdateDisplay;

end;

procedure TScrollForm1.SetDirty(d: Boolean);

begin

  if d <> FDirty then

  begin

    FDirty := d;

    ApplyBtn.Enabled := FDirty;

  end;

end;

procedure TScrollForm1.ImageLoad(filename: string);

begin

  Image.Picture.LoadFromFile(filename);

  ScrollReset;

end;

procedure TScrollForm1.About1Click(Sender: TObject);

var

  about: TAboutBox;

begin

  about := TAboutBox.Create(Self);

  try

    about.ShowModal;

  finally

    about.Free;

  end;

end;

procedure TScrollForm1.ApplyBtnClick(Sender: TObject);

begin

  Units.x := HUnitsUpDown.Position;

  HScrollb.LargeChange := HPageUpDown.Position;

  HScrollb.Max := HMaxUpDown.Position;

  Units.y := VUnitsUpDown.Position;

  VScrollb.LargeChange := VPageUpDown.Position;

  VScrollb.Max := VMaxUpDown.Position;

  Dirty := False;

end;

procedure TScrollForm1.DefaultBtnClick(Sender: TObject);

begin

  ScrollReset;

  Dirty := False;

end;

procedure TScrollForm1.UpDownClick(Sender: TObject; Button: TUDBtnType);

begin

  Dirty := True;

end;

procedure TScrollForm1.UpdateDisplay;

begin

  HUnitsUpDown.Position := Units.x;

  HPageUpDown.Position := HScrollb.LargeChange;

  HMaxUpDown.Position := HScrollb.Max;

  VUnitsUpDown.Position := Units.y;

  VPageUpDown.Position := VScrollb.LargeChange;

  VMaxUpDown.Position := VScrollb.Max;

  Dirty := False;

end;

end.


TScrollBar example (scroldem.dfm)

scroldem.pas

object ScrollForm1: TScrollForm1

  Left = 200

  Top = 108

  BorderIcons = [biSystemMenu, biMinimize]

  BorderStyle = bsSingle

  Caption = 'ScrollDemo'

  ClientHeight = 194

  ClientWidth = 436

  Font.Color = clWindowText

  Font.Height = -11

  Font.Name = 'MS Sans Serif'

  Font.Style = []

  Menu = MainMenu1

  OnCreate = FormCreate

  PixelsPerInch = 96

  TextHeight = 13

  object Bevel1: TBevel

    Left = 0

    Top = 0

    Width = 436

    Height = 9

    Align = alTop

    Shape = bsTopLine

  end

  object Label3: TLabel

    Left = 238

    Top = 42

    Width = 24

    Height = 13

    Caption = 'Units'

  end

  object Label4: TLabel

    Left = 198

    Top = 78

    Width = 64

    Height = 13

    Caption = 'LargeChange'

  end

  object Label5: TLabel

    Left = 242

    Top = 117

    Width = 20

    Height = 13

    Caption = 'Max'

  end

  object Label1: TLabel

    Left = 280

    Top = 16

    Width = 47

    Height = 13

    Caption = 'Horizontal'

  end

  object Vertical: TLabel

    Left = 376

    Top = 16

    Width = 35

    Height = 13

    Caption = 'Vertical'

  end

  object HScrollb: TScrollBar

    Left = 9

    Top = 169

    Width = 159

    Height = 16

    Max = 32767

    TabOrder = 1

    OnScroll = HScrollbScroll

  end

  object VScrollb: TScrollBar

    Left = 169

    Top = 9

    Width = 16

    Height = 157

    Kind = sbVertical

    TabOrder = 2

    OnChange = VScrollbChange

  end

  object HUnits: TEdit

    Left = 275

    Top = 38

    Width = 48

    Height = 20

    ReadOnly = True

    TabOrder = 3

    Text = '1'

  end

  object HPage: TEdit

    Left = 275

    Top = 74

    Width = 48

    Height = 20

    ReadOnly = True

    TabOrder = 4

    Text = '0'

  end

  object HMax: TEdit

    Left = 276

    Top = 113

    Width = 48

    Height = 20

    ReadOnly = True

    TabOrder = 5

    Text = '0'

  end

  object VUnits: TEdit

    Left = 363

    Top = 38

    Width = 48

    Height = 20

    ReadOnly = True

    TabOrder = 6

    Text = '1'

  end

  object VPage: TEdit

    Left = 363

    Top = 74

    Width = 48

    Height = 20

    ReadOnly = True

    TabOrder = 7

    Text = '0'

  end

  object VMax: TEdit

    Left = 363

    Top = 113

    Width = 48

    Height = 20

    ReadOnly = True

    TabOrder = 8

    Text = '0'

  end

  object HUnitsUpDown: TUpDown

    Left = 323

    Top = 38

    Width = 16

    Height = 20

    Associate = HUnits

    Min = 1

    Max = 32767

    Position = 1

    TabOrder = 9

    Wrap = False

    OnClick = UpDownClick

  end

  object HPageUpDown: TUpDown

    Left = 323

    Top = 74

    Width = 16

    Height = 20

    Associate = HPage

    Min = 0

    Max = 32767

    Position = 0

    TabOrder = 10

    Wrap = False

    OnClick = UpDownClick

  end

  object HMaxUpDown: TUpDown

    Left = 324

    Top = 113

    Width = 16

    Height = 20

    Associate = HMax

    Min = 0

    Max = 32767

    Position = 0

    TabOrder = 11

    Wrap = False

    OnClick = UpDownClick

  end

  object VUnitsUpDown: TUpDown

    Left = 411

    Top = 38

    Width = 16

    Height = 20

    Associate = VUnits

    Min = 1

    Max = 32767

    Position = 1

    TabOrder = 12

    Wrap = False

    OnClick = UpDownClick

  end

  object VMaxUpDown: TUpDown

    Left = 411

    Top = 113

    Width = 16

    Height = 20

    Associate = VMax

    Min = 0

    Max = 32767

    Position = 0

    TabOrder = 13

    Wrap = False

    OnClick = UpDownClick

  end

  object VPageUpDown: TUpDown

    Left = 411

    Top = 74

    Width = 16

    Height = 20

    Associate = VPage

    Min = 0

    Max = 32767

    Position = 0

    TabOrder = 14

    Wrap = False

    OnClick = UpDownClick

  end

  object DefaultBtn: TButton

    Left = 348

    Top = 157

    Width = 75

    Height = 25

    Caption = '&Defaults'

    ParentShowHint = False

    ShowHint = False

    TabOrder = 15

    OnClick = DefaultBtnClick

  end

  object ApplyBtn: TButton

    Left = 265

    Top = 157

    Width = 75

    Height = 25

    Caption = '&Apply'

    Enabled = False

    TabOrder = 16

    OnClick = ApplyBtnClick

  end

  object ImgPanel: TPanel

    Left = 8

    Top = 8

    Width = 160

    Height = 160

    BevelOuter = bvNone

    BorderStyle = bsSingle

    TabOrder = 0

    object Image: TImage

      Left = 0

      Top = 0

      Width = 600

      Height = 470

      AutoSize = True

      Picture.Data = {

// rest of bitmap goes here

                }

       end

  end

  object MainMenu1: TMainMenu

    Left = 196

    Top = 159

    object File1: TMenuItem

      Caption = '&File'

      object Open1: TMenuItem

        Caption = '&Open...'

        OnClick = Open1Click

      end

      object N1: TMenuItem

        Caption = '-'

      end

      object Exit1: TMenuItem

        Caption = 'E&xit'

        OnClick = Exit1Click

      end

    end

    object View1: TMenuItem

      Caption = '&Scroll'

      OnClick = View1Click

      object VScrollMenu: TMenuItem

        Caption = '&Vertical'

        OnClick = VScrollMenuClick

      end

      object HScrollMenu: TMenuItem

        Caption = '&Horizontal'

        OnClick = HScrollMenuClick

      end

    end

    object Help1: TMenuItem

      Caption = '&Help'

      object About1: TMenuItem

        Caption = '&About...'

        OnClick = About1Click

      end

    end

  end

  object OpenDialog: TOpenDialog

    DefaultExt = '.bmp'

    FileEditStyle = fsEdit

    Filter = 'Images (*.bmp;*.ico)|*.bmp;*.ico|Bitmaps (*.bmp)|*.bmp|Icons (*.ico)|*.ico'

    Options = [ofHideReadOnly, ofPathMustExist, ofFileMustExist]

    Left = 230

    Top = 158

  end

end


TProgressBar, TThread example
TProgressBar, TThread example (pg1.pas)

pg1.dfm

Objects

The example demonstrates using the TProgressBar and TThread objects.

Running

To run this example, load the project file from the Help\Examples\PrgrsBar directory.

Description

This example illustrates the use of a progress bar control, how to update the control, and how to manage threads during such a process.

For another example using TProgress bar see Technical Information Document #3103 on our website: www.inprise.com/devsupport/delphi/ti_list/TI3103.html.

unit Pg1;

interface

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  StdCtrls, ComCtrls, ExtCtrls, Pg2;

const

  WM_ThreadDoneMsg = WM_User + 8;

type

  TForm1 = class(TForm)

    ProgressBar1: TProgressBar;

    ProgressBar2: TProgressBar;

    Button1: TButton;

    Button2: TButton;

    TrackBar1: TTrackBar;

    TrackBar2: TTrackBar;

    Bevel1: TBevel;

    Bevel2: TBevel;

    Label1: TLabel;

    Label2: TLabel;

    Button3: TButton;

    Button4: TButton;

    procedure Button1Click(Sender: TObject);

    procedure Button2Click(Sender: TObject);

    procedure Button3Click(Sender: TObject);

    procedure Button4Click(Sender: TObject);

    procedure FormCreate(Sender: TObject);

    procedure TrackBar1Change(Sender: TObject);

    procedure TrackBar2Change(Sender: TObject);

    procedure FormDestroy(Sender: TObject);

  private

    { Private declarations }

    MyThread1 : TMyThread; // thread number 1

    MyThread2 : TMyThread; // thread number 2

    Thread1Active : boolean; // used to test if thread 1 is active

    Thread2Active : boolean; // used to test if thread 2 is active

    procedure ThreadDone(var AMessage : TMessage); message WM_ThreadDoneMsg; // Message to be sent back from thread when its done

  public

    { Public declarations }

  end;

var

  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject); // Create Thread 1

{ The thread will destroy iteself when it is done executing because FreeOnTerminate is set to true.

The first paramter is the priority, and the second is the progressbar to update.

}

begin

   if (MyThread1 = nil) or (Thread1Active = false) then // make sure its not already running

   begin

     MyThread1 := TMyThread.CreateIt(TrackBar1.Position, ProgressBar1);

     Thread1Active := true;

   end

   else

     ShowMessage('Thread still executing');

end;

procedure TForm1.Button2Click(Sender: TObject); // Create Thread 2

begin

   if (MyThread2 = nil) or (Thread2Active = false) then  // make sure its not already running

   begin

     MyThread2 := TMyThread.CreateIt(TrackBar2.Position, ProgressBar2);

     Thread2Active := true;

   end

   else

     ShowMessage('Thread still executing');

end;

procedure TForm1.Button3Click(Sender: TObject); // Terminate Thread 1

begin

  if (MyThread1 <> nil) and (Thread1Active = true) then  // check to see if it is running

    MyThread1.Terminate

  else

   ShowMessage('Thread not started');

end;

procedure TForm1.Button4Click(Sender: TObject); // Terminate Thread 2

begin

  if (MyThread2 <> nil) and (Thread2Active = true) then  // check to see if it is running

    MyThread2.Terminate

  else

    ShowMessage('Thread not started');

end;

procedure TForm1.ThreadDone(var AMessage: TMessage); // keep track of when and which thread is done executing

begin

  if ((MyThread1 <> nil) and (MyThread1.ThreadID = cardinal(AMessage.WParam))) then

  begin

      Thread1Active := false;

  end;

  if ((MyThread2 <> nil) and (MyThread2.ThreadID = cardinal(AMessage.WParam))) then

  begin

      Thread2Active := false;

  end;

end;

procedure TForm1.FormCreate(Sender: TObject); // initialize to zero

begin

  Thread1Active := false;

  Thread2Active := false;

end;

procedure TForm1.TrackBar1Change(Sender: TObject); // set Thread 1 Priority

begin

  if (MyThread1 <> nil) and (Thread1Active = true) then

     MyThread1.priority := TThreadPriority(TrackBar1.Position);

end;

procedure TForm1.TrackBar2Change(Sender: TObject); // set Thread 2 Priority

begin

  if (MyThread2 <> nil) and (Thread2Active = true) then

    MyThread2.priority := TThreadPriority(TrackBar2.Position);

end;

procedure TForm1.FormDestroy(Sender: TObject); // Terminate any threads still running

begin

   if (MyThread1 <> nil) and (Thread1Active = true) then

   begin

     MyThread1.Terminate;

     MyThread1.WaitFor;  // wait for it to terminate

   end;

   if (MyThread2 <> nil) and (Thread2Active = true) then

   begin

     MyThread2.Terminate;

     MyThread2.WaitFor;

   end;

end;

end.


TProgressBar, TThread example (pg1.dfm)

pg1.pas

object Form1: TForm1

  Left = 516

  Top = 256

  Width = 712

  Height = 507

  Caption = 'TThread, TTrackBar, TProgressBar'

  Color = clBtnFace

  Font.Charset = DEFAULT_CHARSET

  Font.Color = clWindowText

  Font.Height = -11

  Font.Name = 'MS Sans Serif'

  Font.Style = []

  OldCreateOrder = False

  Position = poDesktopCenter

  OnCreate = FormCreate

  OnDestroy = FormDestroy

  PixelsPerInch = 96

  TextHeight = 13

  object Bevel1: TBevel

    Left = 32

    Top = 8

    Width = 513

    Height = 169

  end

  object Bevel2: TBevel

    Left = 32

    Top = 200

    Width = 513

    Height = 169

  end

  object Label1: TLabel

    Left = 256

    Top = 104

    Width = 34

    Height = 13

    Caption = 'Priority:'

  end

  object Label2: TLabel

    Left = 248

    Top = 296

    Width = 34

    Height = 13

    Caption = 'Priority:'

  end

  object ProgressBar1: TProgressBar

    Left = 64

    Top = 32

    Width = 393

    Height = 25

    Min = 0

    Max = 100

    Step = 1

    TabOrder = 0

  end

  object ProgressBar2: TProgressBar

    Left = 64

    Top = 224

    Width = 401

    Height = 25

    Min = 0

    Max = 100

    TabOrder = 1

  end

  object Button1: TButton

    Left = 72

    Top = 80

    Width = 105

    Height = 25

    Caption = 'Create Thread'

    TabOrder = 2

    OnClick = Button1Click

  end

  object Button2: TButton

    Left = 72

    Top = 272

    Width = 105

    Height = 25

    Caption = 'Create Thread'

    TabOrder = 3

    OnClick = Button2Click

  end

  object TrackBar1: TTrackBar

    Left = 296

    Top = 104

    Width = 193

    Height = 33

    Max = 6

    Orientation = trHorizontal

    Frequency = 1

    Position = 3

    SelEnd = 0

    SelStart = 0

    TabOrder = 4

    TickMarks = tmBottomRight

    TickStyle = tsAuto

    OnChange = TrackBar1Change

  end

  object TrackBar2: TTrackBar

    Left = 288

    Top = 296

    Width = 193

    Height = 45

    Max = 6

    Orientation = trHorizontal

    Frequency = 1

    Position = 3

    SelEnd = 0

    SelStart = 0

    TabOrder = 5

    TickMarks = tmBottomRight

    TickStyle = tsAuto

    OnChange = TrackBar2Change

  end

  object Button3: TButton

    Left = 72

    Top = 128

    Width = 105

    Height = 25

    Caption = 'Terminate Thread'

    TabOrder = 6

    OnClick = Button3Click

  end

  object Button4: TButton

    Left = 72

    Top = 320

    Width = 105

    Height = 25

    Caption = 'Terminate Thread'

    TabOrder = 7

    OnClick = Button4Click

  end

end


TTabControl example
TTabControl example (clsexm1.pas)

clsexm1.dfm

Objects

The example demonstrates using TTabControl, TTable, TDataSource, TIntegerField, TStringField, TFloatField, TDateTimeField, TDBEdit and TLabel objects.

Running

To run this example, load the project file from the Help\Examples\TabCntrl directory.

Description

This project shows how to use a tab control to display records from a database table, including the creation of a calculated field.

unit clsexm1;

interface

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  Db, DBTables, ComCtrls, ExtCtrls, DBCtrls, StdCtrls, Mask;

type

  TForm1 = class(TForm)

    TabControl1: TTabControl;

    Table1: TTable;

    DataSource1: TDataSource;

    Table1EmpNo: TIntegerField;

    Table1LastName: TStringField;

    Table1FirstName: TStringField;

    Table1PhoneExt: TStringField;

    Table1HireDate: TDateTimeField;

    Table1Salary: TFloatField;

    Label1: TLabel;

    DBEdit1: TDBEdit;

    Label2: TLabel;

    DBEdit2: TDBEdit;

    Label3: TLabel;

    DBEdit3: TDBEdit;

    Label4: TLabel;

    DBEdit4: TDBEdit;

    Label5: TLabel;

    DBEdit5: TDBEdit;

    Label6: TLabel;

    DBEdit6: TDBEdit;

    DBText1: TDBText;

    Table1FullName: TStringField;

    procedure FormCreate(Sender: TObject);

    procedure TabControl1Change(Sender: TObject);

    procedure Table1CalcFields(DataSet: TDataSet);

  end;

var

  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);

begin

  TabControl1.Align := alClient;

  TabControl1.TabHeight := 30;

  with Table1 do

  begin

    Close;

    IndexName := 'ByName';

    Open;

    while not EOF do

    begin

      TabControl1.Tabs.Add(FieldByName('LASTNAME').AsString);

      Next;

    end;

    // Sync page and table.

    First;

  end;

end;

procedure TForm1.TabControl1Change(Sender: TObject);

begin

  with TabControl1 do

  begin

    if TabIndex <> -1 then

      if not Table1.Locate('LASTNAME', Tabs[TabIndex], []) then

        ShowMessage(Tabs[TabIndex -1] + ' not found.');

  end;

end;

procedure TForm1.Table1CalcFields(DataSet: TDataSet);

begin

  DataSet['FullName'] := DataSet['LASTNAME'] + ', ' + DataSet['FIRSTNAME'];

end;

end.


TTabControl example (clsexm1.dfm)

clsexm1.pas

object Form1: TForm1

  Left = 266

  Top = 182

  Width = 366

  Height = 354

  Caption = 'Form1'

  Font.Charset = DEFAULT_CHARSET

  Font.Color = clWindowText

  Font.Height = -11

  Font.Name = 'MS Sans Serif'

  Font.Style = []

  OnCreate = FormCreate

  PixelsPerInch = 96

  TextHeight = 13

  object TabControl1: TTabControl

    Left = 0

    Top = 0

    Width = 358

    Height = 327

    Align = alClient

    TabOrder = 0

    OnChange = TabControl1Change

    object Label1: TLabel

      Left = 16

      Top = 72

      Width = 35

      Height = 13

      Caption = 'EmpNo'

      FocusControl = DBEdit1

    end

    object Label2: TLabel

      Left = 16

      Top = 112

      Width = 48

      Height = 13

      Caption = 'LastName'

      FocusControl = DBEdit2

    end

    object Label3: TLabel

      Left = 16

      Top = 152

      Width = 47

      Height = 13

      Caption = 'FirstName'

      FocusControl = DBEdit3

    end

    object Label4: TLabel

      Left = 16

      Top = 192

      Width = 46

      Height = 13

      Caption = 'PhoneExt'

      FocusControl = DBEdit4

    end

    object Label5: TLabel

      Left = 16

      Top = 232

      Width = 42

      Height = 13

      Caption = 'HireDate'

      FocusControl = DBEdit5

    end

    object Label6: TLabel

      Left = 16

      Top = 272

      Width = 29

      Height = 13

      Caption = 'Salary'

      FocusControl = DBEdit6

    end

    object DBText1: TDBText

      Left = 56

      Top = 48

      Width = 6

      Height = 20

      AutoSize = True

      DataField = 'FullName'

      DataSource = DataSource1

      Font.Charset = ANSI_CHARSET

      Font.Color = clBlack

      Font.Height = -16

      Font.Name = 'MS Sans Serif'

      Font.Style = [fsBold]

      ParentFont = False

    end

    object DBEdit1: TDBEdit

      Left = 16

      Top = 88

      Width = 64

      Height = 20

      DataField = 'EmpNo'

      DataSource = DataSource1

      TabOrder = 0

    end

    object DBEdit2: TDBEdit

      Left = 16

      Top = 128

      Width = 124

      Height = 20

      DataField = 'LastName'

      DataSource = DataSource1

      TabOrder = 1

    end

    object DBEdit3: TDBEdit

      Left = 16

      Top = 168

      Width = 94

      Height = 20

      DataField = 'FirstName'

      DataSource = DataSource1

      TabOrder = 2

    end

    object DBEdit4: TDBEdit

      Left = 16

      Top = 208

      Width = 28

      Height = 20

      DataField = 'PhoneExt'

      DataSource = DataSource1

      TabOrder = 3

    end

    object DBEdit5: TDBEdit

      Left = 16

      Top = 248

      Width = 64

      Height = 20

      DataField = 'HireDate'

      DataSource = DataSource1

      TabOrder = 4

    end

    object DBEdit6: TDBEdit

      Left = 16

      Top = 288

      Width = 64

      Height = 20

      DataField = 'Salary'

      DataSource = DataSource1

      TabOrder = 5

    end

  end

  object Table1: TTable

    Active = True

    OnCalcFields = Table1CalcFields

    DatabaseName = 'DBDEMOS'

    TableName = 'EMPLOYEE.DB'

    Left = 32

    Top = 48

    object Table1EmpNo: TIntegerField

      FieldName = 'EmpNo'

      DisplayFormat = 'Emp'#39'#'#39' 0000'

      MaxValue = 9999

      MinValue = 1

    end

    object Table1LastName: TStringField

      FieldName = 'LastName'

    end

    object Table1FirstName: TStringField

      FieldName = 'FirstName'

      Size = 15

    end

    object Table1PhoneExt: TStringField

      FieldName = 'PhoneExt'

      Size = 4

    end

    object Table1HireDate: TDateTimeField

      FieldName = 'HireDate'

    end

    object Table1Salary: TFloatField

      FieldName = 'Salary'

    end

    object Table1FullName: TStringField

      FieldName = 'FullName'

      Size = 30

      Calculated = True

    end

  end

  object DataSource1: TDataSource

    DataSet = Table1

    Left = 64

    Top = 48

  end

end


TUpdateSQL example
TUpdateSQL example (cupdm.pas)

cuperror.pas	cupmnfrm.pas	cupdm.dfm	cuperror.dfm	cupmnfrm.dfm

Objects

The example demonstrates using TUpdateSQL, TDataModule, TTable, TDataSource, TQuery, TIntegerField, TStringField, TDBGrid, TDBNavigator, TButton, TLabel, TPanel and TEdit objects.

Running

To run this example, load the project file from the Help\Examples\Update directory.

Description

This project shows how to use TUpdateSQL to update the records of a read-only query (QueryCache). The UpdateSQLCache TUpdateSQL object contains SQL statements in its DeleteSQL, InsertSQL and ModifySQL properties that are executed when ApplyUpdates of the TQuery (QueryCache) object is called.  Note that the CachedUpdates property of QueryCache is True.

This example uses the local InterBase database \Demos\Data\EMPLOYEE.GDB. You may need to update this path in the Params property of the DBaseCache TDatabase object.

unit CUpMnFrm;

interface

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  StdCtrls, ExtCtrls, DBCtrls, Grids, DBGrids;

type

  TForm1 = class(TForm)

    DBGridRefresh: TDBGrid;

    DBGridCache: TDBGrid;

    DBNavigator1: TDBNavigator;

    ButtonApply: TButton;

    ButtonCancel: TButton;

    ButtonUndo: TButton;

    ButtonRefresh: TButton;

    Label1: TLabel;

    Label2: TLabel;

    procedure ButtonApplyClick(Sender: TObject);

    procedure ButtonCancelClick(Sender: TObject);

    procedure ButtonUndoClick(Sender: TObject);

    procedure ButtonRefreshClick(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

var

  Form1: TForm1;

implementation

uses  CUpDM;

{$R *.DFM}

procedure TForm1.ButtonApplyClick(Sender: TObject);

begin

  DataModuleCache.DBaseCache.ApplyUpdates([DataModuleCache.QueryCache]);

end;

procedure TForm1.ButtonCancelClick(Sender: TObject);

begin

  DataModuleCache.QueryCache.CancelUpdates;

end;

procedure TForm1.ButtonUndoClick(Sender: TObject);

begin

  DataModuleCache.QueryCache.RevertRecord;

end;

procedure TForm1.ButtonRefreshClick(Sender: TObject);

begin

  With DataModuleCache.TableRefresh do

  begin

    close;

    open;

  end;

end;

end.


TUpdateSQL example (cuperror.pas)

cupdm.pas	cupmnfrm.pas	cupdm.dfm	cuperror.dfm	cupmnfrm.dfm

 unit CUpError;

interface

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  StdCtrls, ExtCtrls,DB,dbitypes,dbiprocs,dbtables;

type

  TFormError = class(TForm)

    Panel1: TPanel;

    LabelOld: TLabel;

    LabelNew: TLabel;

    LabelMessage: TLabel;

    EditOld: TEdit;

    EditNew: TEdit;

    ButtonIgnore: TButton;

    ButtonRetry: TButton;

    ButtonAbort: TButton;

  private

    { Private declarations }

  public

  function ErrorDecision(DataSet : TDataSet; E: EDataBaseError;

                                 UpdateKind: TUpdateKind):TUpdateAction;

    { Public declarations }

  end;

var

  FormError: TFormError;

implementation

uses CUpDM;

{$R *.DFM}

function TFormError.Errordecision(Dataset: TDataSet;

             E: EDataBaseError; UpdateKind: TUpdateKind):

             TUpdateAction;

    const

      UpdateKindStr: array[TUpdateKind] of String =('Modify Error',

                     'Insert Error','Delete Error');

      begin

        Panel1.caption := UpdateKindStr[UpdateKind];

        LabelMessage.Caption := E.Message;

        EditOld.text := DataModuleCache.QueryCache.Fields[0].OldValue;

        EditNew.text := DataModuleCache.QueryCache.Fields[0].NewValue;

        ShowModal;

        case ModalResult of

        mrRetry:

        begin

          DataModuleCache.QueryCache.Fields[0].newvalue := EditNew.text;

          Result := uaRetry;

        end;

        mrIgnore: Result := uaSkip;

        else

          result := uaAbort;

      end;

   end;

end.


TUpdateSQL example (cupmnfrm.pas)

cupdm.pas	cuperror.pas	cupdm.dfm	cuperror.dfm	cupmnfrm.dfm

 unit CUpDM;

interface

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  DB, DBTables;

type

  TDataModuleCache = class(TDataModule)

    DBaseCache: TDatabase;

    TableRefresh: TTable;

    DataSourceCache: TDataSource;

    DataSourceRefresh: TDataSource;

    QueryCache: TQuery;

    UpdateSQLCache: TUpdateSQL;

    QueryCacheCUST_NO: TIntegerField;

    QueryCacheCUSTOMER: TStringField;

    QueryCacheCONTACT_FIRST: TStringField;

    QueryCacheCONTACT_LAST: TStringField;

    QueryCachePHONE_NO: TStringField;

    QueryCacheADDRESS_LINE1: TStringField;

    QueryCacheADDRESS_LINE2: TStringField;

    QueryCacheCITY: TStringField;

    QueryCacheSTATE_PROVINCE: TStringField;

    QueryCacheCOUNTRY: TStringField;

    QueryCachePOSTAL_CODE: TStringField;

    QueryCacheON_HOLD: TStringField;

    procedure QueryCacheUpdateError(DataSet: TDataSet; E: EDatabaseError;

      UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

var

  DataModuleCache: TDataModuleCache;

implementation

uses CUpError;

{$R *.DFM}

procedure TDataModuleCache.QueryCacheUpdateError(DataSet: TDataSet;

  E: EDatabaseError; UpdateKind: TUpdateKind;

  var UpdateAction: TUpdateAction);

begin

  if EDBEngineError(e).errors[0].errorcode = 9729 then

  begin

    UpdateAction := FormError.ErrorDecision(DataSet, E, UpdateKind);

  end;

end;

end.


TUpdateSQL example (cupdm.dfm)

cupdm.pas	cuperror.pas	cupmnfrm.pas	cuperror.dfm	cupmnfrm.dfm

object Form1: TForm1

  Left = 181

  Top = 96

  Width = 435

  Height = 358

  Caption = 'CachedUpdate Demo'

  Font.Charset = DEFAULT_CHARSET

  Font.Color = clWindowText

  Font.Height = -11

  Font.Name = 'MS Sans Serif'

  Font.Style = []

  PixelsPerInch = 96

  TextHeight = 13

  object Label1: TLabel

    Left = 40

    Top = 40

    Width = 227

    Height = 13

    Caption = 'This grid is Hooked to the  TQuery  QueryCache'

  end

  object Label2: TLabel

    Left = 48

    Top = 184

    Width = 214

    Height = 13

    Caption = 'This grid is hooked to a TTable TableRefresh'

  end

  object DBGridRefresh: TDBGrid

    Left = 0

    Top = 200

    Width = 320

    Height = 120

    DataSource = DataModuleCache.DataSourceRefresh

    Options = [dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines,

dgTabs, dgConfirmDelete, dgCancelOnExit]

    ReadOnly = True

    TabOrder = 0

    TitleFont.Charset = DEFAULT_CHARSET

    TitleFont.Color = clWindowText

    TitleFont.Height = -11

    TitleFont.Name = 'MS Sans Serif'

    TitleFont.Style = []

  end

  object DBGridCache: TDBGrid

    Left = 0

    Top = 56

    Width = 320

    Height = 120

    DataSource = DataModuleCache.DataSourceCache

    TabOrder = 1

    TitleFont.Charset = DEFAULT_CHARSET

    TitleFont.Color = clWindowText

    TitleFont.Height = -11

    TitleFont.Name = 'MS Sans Serif'

    TitleFont.Style = []

  end

  object DBNavigator1: TDBNavigator

    Left = 0

    Top = 0

    Width = 320

    Height = 25

    DataSource = DataModuleCache.DataSourceCache

    ParentShowHint = False

    ShowHint = True

    TabOrder = 2

  end

  object ButtonApply: TButton

    Left = 336

    Top = 40

    Width = 75

    Height = 25

    Caption = 'Apply'

    TabOrder = 3

    OnClick = ButtonApplyClick

  end

  object ButtonCancel: TButton

    Left = 336

    Top = 80

    Width = 75

    Height = 25

    Caption = 'Cancel'

    TabOrder = 4

    OnClick = ButtonCancelClick

  end

  object ButtonUndo: TButton

    Left = 336

    Top = 120

    Width = 75

    Height = 25

    Caption = 'Undo'

    TabOrder = 5

    OnClick = ButtonUndoClick

  end

  object ButtonRefresh: TButton

    Left = 336

    Top = 216

    Width = 75

    Height = 25

    Caption = 'Refresh'

    TabOrder = 6

    OnClick = ButtonRefreshClick

  end

end


TUpdateSQL example (cuperror.dfm)

cupdm.pas	cuperror.pas	cupmnfrm.pas	cupdm.dfm	cupmnfrm.dfm

 object FormError: TFormError

  Left = 191

  Top = 96

  Width = 383

  Height = 192

  Caption = 'FormError'

  Font.Charset = DEFAULT_CHARSET

  Font.Color = clWindowText

  Font.Height = -11

  Font.Name = 'MS Sans Serif'

  Font.Style = []

  PixelsPerInch = 96

  TextHeight = 13

  object LabelOld: TLabel

    Left = 24

    Top = 72

    Width = 57

    Height = 13

    Caption = 'Old Cust No'

  end

  object LabelNew: TLabel

    Left = 24

    Top = 104

    Width = 48

    Height = 13

    Caption = 'LabelNew'

  end

  object LabelMessage: TLabel

    Left = 24

    Top = 136

    Width = 69

    Height = 13

    Caption = 'LabelMessage'

    WordWrap = True

  end

  object Panel1: TPanel

    Left = 64

    Top = 8

    Width = 185

    Height = 41

    Caption = 'Panel1'

    TabOrder = 0

  end

  object EditOld: TEdit

    Left = 96

    Top = 64

    Width = 121

    Height = 21

    TabOrder = 1

  end

  object EditNew: TEdit

    Left = 96

    Top = 96

    Width = 121

    Height = 21

    TabOrder = 2

  end

  object ButtonIgnore: TButton

    Left = 272

    Top = 16

    Width = 75

    Height = 25

    Caption = 'Ignore'

    ModalResult = 5

    TabOrder = 3

  end

  object ButtonRetry: TButton

    Left = 272

    Top = 64

    Width = 75

    Height = 25

    Caption = 'Retry'

    ModalResult = 4

    TabOrder = 4

  end

  object ButtonAbort: TButton

    Left = 272

    Top = 112

    Width = 75

    Height = 25

    Caption = 'Abort'

    ModalResult = 3

    TabOrder = 5

  end

end


TUpdateSQL example (cupmnfrm.dfm)

cupdm.pas	cuperror.pas	cupmnfrm.pas	cupdm.dfm	cuperror.dfm

object DataModuleCache: TDataModuleCache

  Left = 728

  Top = 102

  Height = 260

  Width = 290

  object TableRefresh: TTable

    Filtered = True

    DatabaseName = 'myib'

    TableName = 'CUSTOMER'

    Left = 96

    Top = 104

  end

  object DataSourceCache: TDataSource

    DataSet = QueryCache

    Left = 32

    Top = 152

  end

  object DataSourceRefresh: TDataSource

    DataSet = TableRefresh

    Left = 120

    Top = 152

  end

  object QueryCache: TQuery

    CachedUpdates = True

    OnUpdateError = QueryCacheUpdateError

    DatabaseName = 'myib'

    SQL.Strings = (

      'select * from customer')

    UpdateObject = UpdateSQLCache

    Left = 32

    Top = 104

    object QueryCacheCUST_NO: TIntegerField

      FieldName = 'CUST_NO'

    end

    object QueryCacheCUSTOMER: TStringField

      FieldName = 'CUSTOMER'

      Size = 25

    end

    object QueryCacheCONTACT_FIRST: TStringField

      FieldName = 'CONTACT_FIRST'

      Size = 15

    end

    object QueryCacheCONTACT_LAST: TStringField

      FieldName = 'CONTACT_LAST'

    end

    object QueryCachePHONE_NO: TStringField

      FieldName = 'PHONE_NO'

    end

    object QueryCacheADDRESS_LINE1: TStringField

      FieldName = 'ADDRESS_LINE1'

      Size = 30

    end

    object QueryCacheADDRESS_LINE2: TStringField

      FieldName = 'ADDRESS_LINE2'

      Size = 30

    end

    object QueryCacheCITY: TStringField

      FieldName = 'CITY'

      Size = 25

    end

    object QueryCacheSTATE_PROVINCE: TStringField

      FieldName = 'STATE_PROVINCE'

      Size = 15

    end

    object QueryCacheCOUNTRY: TStringField

      FieldName = 'COUNTRY'

      Size = 15

    end

    object QueryCachePOSTAL_CODE: TStringField

      FieldName = 'POSTAL_CODE'

      Size = 12

    end

    object QueryCacheON_HOLD: TStringField

      FieldName = 'ON_HOLD'

      Size = 1

    end

  end

  object UpdateSQLCache: TUpdateSQL

    ModifySQL.Strings = (

      'update customer'

      'set'

      '  CUST_NO = :CUST_NO,'

      '  CUSTOMER = :CUSTOMER,'

      '  CONTACT_FIRST = :CONTACT_FIRST,'

      '  CONTACT_LAST = :CONTACT_LAST,'

      '  PHONE_NO = :PHONE_NO,'

      '  ADDRESS_LINE1 = :ADDRESS_LINE1,'

      '  ADDRESS_LINE2 = :ADDRESS_LINE2,'

      '  CITY = :CITY,'

      '  STATE_PROVINCE = :STATE_PROVINCE,'

      '  COUNTRY = :COUNTRY,'

      '  POSTAL_CODE = :POSTAL_CODE,'

      '  ON_HOLD = :ON_HOLD'

      'where'

      '  CUST_NO = :OLD_CUST_NO')

    InsertSQL.Strings = (

      'insert into customer'

      '  (CUST_NO, CUSTOMER, CONTACT_FIRST, CONTACT_LAST, PHONE_NO, '

      'ADDRESS_LINE1, '

      '   ADDRESS_LINE2, CITY, STATE_PROVINCE, COUNTRY, POSTAL_CODE, '

      'ON_HOLD)'

      'values'

        '  (:CUST_NO, :CUSTOMER, :CONTACT_FIRST, :CONTACT_LAST, :PHONE_NO' +

        ', '

      ':ADDRESS_LINE1, '

        '   :ADDRESS_LINE2, :CITY, :STATE_PROVINCE, :COUNTRY, :POSTAL_COD' +

        'E, '

      ':ON_HOLD)')

    DeleteSQL.Strings = (

      'delete from customer'

      'where'

      '  CUST_NO = :OLD_CUST_NO')

    Left = 32

    Top = 48

  end

  object DBaseCache: TDatabase

    AliasName = 'IBLOCAL'

    Connected = True

    DatabaseName = 'myib'

    Params.Strings = (

        'SERVER NAME=..\Demos\Data\EMPLOYE' +

        'E.GDB'

      'USER NAME=SYSDBA'

      'OPEN MODE=READ/WRITE'

      'SCHEMA CACHE SIZE=8'

      'LANGDRIVER='

      'SQLQRYMODE='

      'SQLPASSTHRU MODE=SHARED AUTOCOMMIT'

      'SCHEMA CACHE TIME=-1'

      'MAX ROWS=-1'

      'BATCH COUNT=200'

      'ENABLE SCHEMA CACHE=FALSE'

      'SCHEMA CACHE DIR='

      'ENABLE BCD=FALSE'

      'BLOBS TO CACHE=64'

      'BLOB SIZE=32'

      'PASSWORD=')

    SessionName = 'Default'

    Left = 112

    Top = 24

  end

end


TBatchMove example
TBatchMove example (batmove.pas)

batmov.dfm

Objects

The example demonstrates using TBatchMove, TBevel, TComboBox, TPageControl, TDatabase, and TOpenDialog objects.

Running

To run this example, load the project file from the Help\Examples\Batchmv directory. A second, similar example is also provided in the folder Help\Examples\Batchmv2.

Description

This example demonstrates using TBatchMove to manipulate the records in a database table.

unit Batmove;

interface

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  StdCtrls, ExtCtrls, Db, DBTables, ComCtrls;

type

  TForm1 = class(TForm)

    BatchMove1: TBatchMove;

    tblSource: TTable;

    tblDest: TTable;

    Bevel1: TBevel ;

    Label6: TLabel;

    cmbxDestAlias: TComboBox;

    Label7: TLabel;

    cmbxDestTable: TComboBox;

    Label8: TLabel;

    cmbxDestIndex: TComboBox;

    Bevel2: TBevel;

    cmbxSourceAlias: TComboBox;

    cmbxSourceTable: TComboBox;

    cmbxSourceIndex: TComboBox;

    Label5: TLabel;

    Label4: TLabel;

    Label3: TLabel;

    cmbxMode: TComboBox;

    Button1: TButton;

    Bevel3: TBevel;

    chkbxAbortKey: TCheckBox;

    chkbxAbortProblem: TCheckBox;

    chkbxTrans: TCheckBox;

    Label1: TLabel;

    Label2: TLabel;

    Label10: TLabel;

    Label9: TLabel;

    Label12: TLabel;

    edtChangedTable: TEdit;

    Label13: TLabel;

    edtKeyVioTbl: TEdit;

    Label14: TLabel;

    edtProbTbl: TEdit;

    Label11: TLabel;

    edtRecCount: TEdit;

    procedure FormCreate(Sender: TObject);

    procedure cmbxSourceAliasChange(Sender: TObject);

    procedure cmbxDestAliasChange(Sender: TObject);

    procedure cmbxSourceTableChange(Sender: TObject);

    procedure cmbxDestTableChange(Sender: TObject);

    procedure cmbxSourceIndexChange(Sender: TObject);

    procedure cmbxDestIndexChange(Sender: TObject);

    procedure Button1Click(Sender: TObject);

    procedure chkbxAbortKeyClick(Sender: TObject);

    procedure chkbxAbortProblemClick(Sender: TObject);

    procedure chkbxTransClick(Sender: TObject);

    procedure cmbxModeChange(Sender: TObject);

    procedure edtRecCountKeyPress(Sender: TObject; var Key: Char);

    procedure FormShow(Sender: TObject);

  private

    { Private declarations }

    function IsStringsEqual(const s1,s2 : string): boolean;

//    simple utility function

  public

    { Public declarations }

  end;

var

  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject); // Get alias names

begin

  if Session.Active = false then

    Session.Open;

  Session.GetAliasNames(CmbxSourceAlias.Items);

  cmbxDestAlias.Items := cmbxSourceAlias.Items;

end;

procedure TForm1.cmbxSourceAliasChange(Sender: TObject);

begin

  if cmbxSourceAlias.ItemIndex <> -1 then

  begin

     tblSource.DatabaseName := cmbxSourceAlias.Items[cmbxSourceAlias.ItemIndex];

     Session.GetTableNames(tblSource.DatabaseName,'',true,false,cmbxSourceTable.Items);

  end

  else

  begin

    tblSource.DatabaseName := '';

    cmbxSourceTable.Items.Clear;

  end;

end;

procedure TForm1.cmbxDestAliasChange(Sender: TObject);

begin

  if cmbxDestAlias.ItemIndex <> -1 then

  begin

     tblDest.DatabaseName := cmbxDestAlias.Items[cmbxDestAlias.ItemIndex];

     Session.GetTableNames(tblDest.DatabaseName,'',true,false,cmbxDestTable.Items);

  end

  else

  begin

    tblDest.DatabaseName := '';

    cmbxDestTable.Items.Clear;

  end;

end;

procedure TForm1.cmbxSourceTableChange(Sender: TObject);

begin

  if cmbxSourceTable.ItemIndex <> -1 then

  begin

     tblSource.TableName := cmbxSourceTable.Items[cmbxSourceTable.ItemIndex];

     tblSource.GetIndexNames(cmbxSourceIndex.Items);

  end

  else

  begin

    tblSource.TableName := '';

    cmbxSourceIndex.Items.Clear;

  end;

end;

procedure TForm1.cmbxDestTableChange(Sender: TObject);

begin

  if cmbxDestTable.ItemIndex <> -1 then

  begin

     tblDest.TableName := cmbxDestTable.Items[cmbxDestTable.ItemIndex];

     tblDest.GetIndexNames(cmbxDestIndex.Items);

  end

  else

  begin

    tblDest.TableName := '';

    cmbxDestIndex.Items.Clear;

  end;

end;

procedure TForm1.cmbxSourceIndexChange(Sender: TObject);

begin

  if cmbxSourceIndex.ItemIndex <> -1 then

  begin

    tblSource.IndexName := cmbxSourceIndex.Items[cmbxSourceIndex.ItemIndex];

  end

  else

  begin

     tblSource.IndexName := '';

  end;

end;

procedure TForm1.cmbxDestIndexChange(Sender: TObject);

begin

  if cmbxDestIndex.ItemIndex <> -1 then

  begin

    tblDest.IndexName := cmbxDestIndex.Items[cmbxDestIndex.ItemIndex];

  end

  else

  begin

     tblDest.IndexName := '';

  end;

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

  if tblDest.TableName = '' then

    tblDest.TableName := cmbxDestTable.Text;

  if ((tblSource.DatabaseName <> '') and // test for enough input

     (tblSource.TableName <> '') and

     (tblDest.DatabaseName <> '') and

     (tblDest.TableName <> '') and

     (cmbxMode.items[cmbxMode.ItemIndex] <> '')) then

  begin

    BatchMove1.ChangedTableName := edtChangedTable.Text;  // more batchmove setup

    BatchMove1.KeyViolTableName := edtKeyVioTbl.Text;

    BatchMove1.ProblemTableName := edtProbTbl.Text;

    BatchMove1.RecordCount := StrToInt(edtRecCount.Text);

  end

  else

  begin

    MessageDlg('Incomplete input.',mtError,[mbOK],0);

    exit;

  end;

  BatchMove1.Execute;  // run the batchmove

  MessageDlg('BatchMove complete. Number of records applied: '+IntToStr(BatchMove1.MovedCount),mtInformation,[mbOK],0);

end;

procedure TForm1.chkbxAbortKeyClick(Sender: TObject);

begin

  BatchMove1.AbortOnKeyViol := chkbxAbortKey.Checked;

end;

procedure TForm1.chkbxAbortProblemClick(Sender: TObject);

begin

  BatchMove1.AbortOnProblem := chkbxAbortProblem.Checked;

end;

procedure TForm1.chkbxTransClick(Sender: TObject);

begin

  BatchMove1.Transliterate := chkbxTrans.Checked;

end;

function TForm1.IsStringsEqual(const s1,s2 : string): boolean;

begin

   Result := UpperCase(s1) = UpperCase(s2);

end;

// set the batch mode

procedure TForm1.cmbxModeChange(Sender: TObject);

begin

  if cmbxMode.ItemIndex <> -1 then

  begin

    if IsStringsEqual(cmbxMode.Items[cmbxMode.ItemIndex],'Append') then

      BatchMove1.Mode := batAppend

    else if IsStringsEqual(cmbxMode.Items[cmbxMode.ItemIndex],'Copy') then

      BatchMove1.Mode := batCopy

    else if IsStringsEqual(cmbxMode.Items[cmbxMode.ItemIndex],'Append Update') then

      BatchMove1.Mode := batAppendUpdate

    else if IsStringsEqual(cmbxMode.Items[cmbxMode.ItemIndex],'Delete') then

      BatchMove1.Mode := batDelete

    else if IsStringsEqual(cmbxMode.Items[cmbxMode.ItemIndex],'Update') then

      BatchMove1.Mode := batUpdate

    else

      MessageDlg('Batch mode not found',mtError,[mbOK],0);

  end;

end;

// only allow numbers to be typed in

procedure TForm1.edtRecCountKeyPress(Sender: TObject; var Key: Char);

begin

  if ((key in ['0'..'9'] = false) and (word(key) <> VK_BACK)) then

    key := #0;

end;

procedure TForm1.FormShow(Sender: TObject);

begin

    cmbxSourceAlias.SetFocus;

end;

end.


TBatchMove example (batmove.dfm)

batmov.pas

object Form1: TForm1

  Left = 169

  Top = 154

  Width = 766

  Height = 584

  Caption = 'TBatchMove Example'

  Color = clBtnFace

  Font.Charset = DEFAULT_CHARSET

  Font.Color = clWindowText

  Font.Height = -11

  Font.Name = 'MS Sans Serif'

  Font.Style = []

  OldCreateOrder = False

  Position = poDesktopCenter

  OnCreate = FormCreate

  OnShow = FormShow

  PixelsPerInch = 96

  TextHeight = 13

  object Bevel1: TBevel

    Left = 312

    Top = 8

    Width = 265

    Height = 169

    Shape = bsFrame

    Style = bsRaised

  end

  object Label6: TLabel

    Left = 344

    Top = 48

    Width = 25

    Height = 13

    Caption = 'Alias:'

  end

  object Label7: TLabel

    Left = 324

    Top = 88

    Width = 61

    Height = 13

    Caption = 'Table Name:'

  end

  object Label8: TLabel

    Left = 348

    Top = 128

    Width = 29

    Height = 13

    Caption = 'Index:'

  end

  object Bevel2: TBevel

    Left = 16

    Top = 8

    Width = 265

    Height = 169

    Shape = bsFrame

    Style = bsRaised

  end

  object Label5: TLabel

    Left = 48

    Top = 128

    Width = 29

    Height = 13

    Caption = 'Index:'

  end

  object Label4: TLabel

    Left = 24

    Top = 88

    Width = 61

    Height = 13

    Caption = 'Table Name:'

  end

  object Label3: TLabel

    Left = 48

    Top = 48

    Width = 25

    Height = 13

    Caption = 'Alias:'

  end

  object Bevel3: TBevel

    Left = 16

    Top = 192

    Width = 561

    Height = 201

    Shape = bsFrame

    Style = bsRaised

  end

  object Label1: TLabel

    Left = 104

    Top = 16

    Width = 77

    Height = 13

    Caption = 'Source Table'

    Font.Charset = DEFAULT_CHARSET

    Font.Color = clWindowText

    Font.Height = -12

    Font.Name = 'MS Sans Serif'

    Font.Style = [fsBold]

    ParentFont = False

  end

  object Label2: TLabel

    Left = 400

    Top = 16

    Width = 101

    Height = 13

    Caption = 'Destination Table'

    Font.Charset = DEFAULT_CHARSET

    Font.Color = clWindowText

    Font.Height = -12

    Font.Name = 'MS Sans Serif'

    Font.Style = [fsBold]

    ParentFont = False

  end

  object Label10: TLabel

    Left = 224

    Top = 200

    Width = 131

    Height = 13

    Caption = 'Options/Error Handling'

    Font.Charset = DEFAULT_CHARSET

    Font.Color = clWindowText

    Font.Height = -12

    Font.Name = 'MS Sans Serif'

    Font.Style = [fsBold]

    ParentFont = False

  end

  object Label9: TLabel

    Left = 28

    Top = 336

    Width = 61

    Height = 13

    Caption = 'Batch Mode:'

  end

  object Label12: TLabel

    Left = 288

    Top = 232

    Width = 110

    Height = 13

    Caption = 'Changed Table Name: '

  end

  object Label13: TLabel

    Left = 272

    Top = 272

    Width = 128

    Height = 13

    Caption = 'Key Violation Table Name: '

  end

  object Label14: TLabel

    Left = 296

    Top = 312

    Width = 105

    Height = 13

    Caption = 'Problem Table Name: '

  end

  object Label11: TLabel

    Left = 256

    Top = 352

    Width = 145

    Height = 13

    Caption = 'Record Count (Leave 0 for all):'

  end

  object cmbxDestAlias: TComboBox

    Left = 400

    Top = 48

    Width = 145

    Height = 21

    Style = csDropDownList

    ItemHeight = 13

    Sorted = True

    TabOrder = 0

    OnChange = cmbxDestAliasChange

  end

  object cmbxDestTable: TComboBox

    Left = 400

    Top = 88

    Width = 145

    Height = 21

    ItemHeight = 13

    Sorted = True

    TabOrder = 1

    OnChange = cmbxDestTableChange

  end

  object cmbxDestIndex: TComboBox

    Left = 400

    Top = 128

    Width = 145

    Height = 21

    Style = csDropDownList

    ItemHeight = 13

    Sorted = True

    TabOrder = 2

    OnChange = cmbxDestIndexChange

  end

  object cmbxSourceAlias: TComboBox

    Left = 96

    Top = 48

    Width = 145

    Height = 21

    Style = csDropDownList

    ItemHeight = 13

    Sorted = True

    TabOrder = 3

    OnChange = cmbxSourceAliasChange

  end

  object cmbxSourceTable: TComboBox

    Left = 96

    Top = 88

    Width = 145

    Height = 21

    Style = csDropDownList

    ItemHeight = 13

    Sorted = True

    TabOrder = 4

    OnChange = cmbxSourceTableChange

  end

  object cmbxSourceIndex: TComboBox

    Left = 96

    Top = 128

    Width = 145

    Height = 21

    Style = csDropDownList

    ItemHeight = 13

    Sorted = True

    TabOrder = 5

    OnChange = cmbxSourceIndexChange

  end

  object cmbxMode: TComboBox

    Left = 96

    Top = 336

    Width = 145

    Height = 21

    Style = csDropDownList

    ItemHeight = 13

    Sorted = True

    TabOrder = 6

    OnChange = cmbxModeChange

    Items.Strings = (

      'Append'

      'Append Update'

      'Copy'

      'Delete'

      'Update')

  end

  object Button1: TButton

    Left = 230

    Top = 404

    Width = 131

    Height = 25

    Caption = 'Execute BatchMove'

    TabOrder = 7

    OnClick = Button1Click

  end

  object chkbxAbortKey: TCheckBox

    Left = 32

    Top = 232

    Width = 193

    Height = 17

    Caption = 'Abort on key violation'

    Checked = True

    State = cbChecked

    TabOrder = 8

    OnClick = chkbxAbortKeyClick

  end

  object chkbxAbortProblem: TCheckBox

    Left = 32

    Top = 264

    Width = 193

    Height = 17

    Caption = 'Abort on problem (data is truncated)'

    Checked = True

    State = cbChecked

    TabOrder = 9

    OnClick = chkbxAbortProblemClick

  end

  object chkbxTrans: TCheckBox

    Left = 32

    Top = 296

    Width = 193

    Height = 17

    Caption = 'Transliterate Characters'

    Checked = True

    State = cbChecked

    TabOrder = 10

    OnClick = chkbxTransClick

  end

  object edtChangedTable: TEdit

    Left = 416

    Top = 232

    Width = 121

    Height = 21

    TabOrder = 11

  end

  object edtKeyVioTbl: TEdit

    Left = 416

    Top = 272

    Width = 121

    Height = 21

    TabOrder = 12

  end

  object edtProbTbl: TEdit

    Left = 416

    Top = 312

    Width = 121

    Height = 21

    TabOrder = 13

  end

  object edtRecCount: TEdit

    Left = 416

    Top = 352

    Width = 121

    Height = 21

    TabOrder = 14

    Text = '0'

    OnKeyPress = edtRecCountKeyPress

  end

  object BatchMove1: TBatchMove

    Destination = tblDest

    Source = tblSource

    Transliterate = False

    Left = 280

    Top = 88

  end

  object tblSource: TTable

    Left = 280

    Top = 24

  end

  object tblDest: TTable

    Left = 280

    Top = 144

  end

end


TComboBox example
TComboBox example (combform.pas)

inptform.pas	combform.dfm	inptform.dfm

Objects

The example demonstrates using the TComboBox object.

Running

To run this example, load the project file from the Help\Examples\ComboBox directory.

Description

This example demonstrates the properties and methods of a combo box by allowing the user to manipulate them by clicking buttons.

unit combform;

interface

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  StdCtrls, ComCtrls, Menus, ExtCtrls;

type

  TComboForm = class(TForm)

    CbDrop: TComboBox;

    CbDropList: TComboBox;

    CbSimple: TComboBox;

    Label1: TLabel;

    Label2: TLabel;

    Label3: TLabel;

    Label4: TLabel;

    MainMenu1: TMainMenu;

    ComboStyle: TMenuItem;

    CmSimple: TMenuItem;

    CmDrop: TMenuItem;

    CmDropList: TMenuItem;

    Add1: TMenuItem;

    CmAddString: TMenuItem;

    CmAddStringAt: TMenuItem;

    Search1: TMenuItem;

    CmFindString: TMenuItem;

    CmFindIndex: TMenuItem;

    CmDelete: TMenuItem;

    CmList: TMenuItem;

    CmDelString: TMenuItem;

    CmDelIndex: TMenuItem;

    CmShowList: TMenuItem;

    CmClear: TMenuItem;

    N1: TMenuItem;

    Label5: TLabel;

    EdCursel: TEdit;

    EdCuridx: TEdit;

    EdCurlen: TEdit;

    EdEdit: TEdit;

    EdEditlen: TEdit;

    CmSortList: TMenuItem;

    Bevel1: TBevel;

    procedure ComboStyleClick(Sender: TObject);

    procedure CmSimpleClick(Sender: TObject);

    procedure CmDropClick(Sender: TObject);

    procedure CmDropListClick(Sender: TObject);

    procedure FormCreate(Sender: TObject);

    procedure ComboChange(Sender: TObject);

    procedure CmClearClick(Sender: TObject);

    procedure CmDelStringClick(Sender: TObject);

    procedure CmDelIndexClick(Sender: TObject);

    procedure CmFindStringClick(Sender: TObject);

    procedure CmFindIndexClick(Sender: TObject);

    procedure CmAddStringClick(Sender: TObject);

    procedure CmAddStringAtClick(Sender: TObject);

    procedure Button1Click(Sender: TObject);

    procedure CmSortListClick(Sender: TObject);

    procedure CmListClick(Sender: TObject);

    procedure CmShowListClick(Sender: TObject);

  private

    { Private declarations }

    FCbActive: TComboBox;

    procedure SetCbActive(cb: TComboBox);

    procedure NewSelection;

    procedure DeleteAt(idx: Integer);

    procedure AddAt(idx: Integer; s: string);

    procedure SelectAt(idx: Integer);

    function FindString(s: string): Integer;

    property CbActive: TComboBox read FCbActive write SetCbActive;

  public

    { Public declarations }

  end;

var

  ComboForm: TComboForm;

implementation

uses inptform;

{$R *.DFM}

// -------------- //

// event handlers //

// -------------- //

procedure TComboForm.FormCreate(Sender: TObject);

begin

  FCbActive := CbSimple;

  CbSimple.Visible := True;

  CbDrop.Visible := False;

  CbDropList.Visible := False;

  NewSelection;

end;

// Control notifications

// ---------------------

//

// close form

//

procedure TComboForm.Button1Click(Sender: TObject);

begin

  Close;

end;

procedure TComboForm.ComboChange(Sender: TObject);

begin

  NewSelection;

end;

// ComboBox menu

// -------------

procedure TComboForm.ComboStyleClick(Sender: TObject);

begin

  CmSimple.Checked := CbActive = CbSimple;

  CmDrop.Checked := CbActive = CbDrop;

  CmDropList.Checked := CbActive = CbDropList;

end;

procedure TComboForm.CmSimpleClick(Sender: TObject);

begin

  CbActive := CbSimple;

end;

procedure TComboForm.CmDropClick(Sender: TObject);

begin

  CbActive := CbDrop;

end;

procedure TComboForm.CmDropListClick(Sender: TObject);

begin

  CbActive := CbDropList;

end;

// Add menu

// --------

procedure TComboForm.CmAddStringClick(Sender: TObject);

var

  s: string;

begin

  if InputForm.GetString('String to add:', s) then

    AddAt(0, s);

end;

procedure TComboForm.CmAddStringAtClick(Sender: TObject);

var

  i: Integer;

  s: string;

begin

  if InputForm.GetString('String to add:', s)

      and InputForm.GetInteger('Index to insert at:', i) then

    AddAt(i, s);

end;

// Find menu

// ---------

procedure TComboForm.CmFindStringClick(Sender: TObject);

var

  s: string;

begin

  if InputForm.GetString('String to select:', s) then

    SelectAt(FindString(s));

end;

procedure TComboForm.CmFindIndexClick(Sender: TObject);

var

  i: Integer;

begin

  if InputForm.GetInteger('Index to select:', i) then

    SelectAt(i);

end;

// Delete menu

// -----------

procedure TComboForm.CmDelStringClick(Sender: TObject);

var

  s: string;

begin

  if InputForm.GetString('String to delete:', s) then

    DeleteAt(FindString(s));

end;

procedure TComboForm.CmDelIndexClick(Sender: TObject);

var

  i: Integer;

begin

  if InputForm.GetInteger('Index to delete:', i) then

    DeleteAt(i);

end;

procedure TComboForm.CmClearClick(Sender: TObject);

begin

  CbActive.Clear;

end;

// List menu

// ---------

procedure TComboForm.CmShowListClick(Sender: TObject);

begin

  CbActive.DroppedDown := not CbActive.DroppedDown;

end;

procedure TComboForm.CmSortListClick(Sender: TObject);

begin

  CbActive.Sorted := not CbActive.Sorted;

end;

procedure TComboForm.CmListClick(Sender: TObject);

begin

  CmShowList.Enabled := CbActive <> CbSimple;

  CmSortList.Checked := CbActive.Sorted;

end;

// --------------- //

// private methods //

// --------------- //

procedure TComboForm.NewSelection;

begin

  if CbActive.ItemIndex = -1 then

    EdCursel.Text := ''

  else

    EdCursel.Text := CbActive.Items[CbActive.ItemIndex];

  EdCuridx.Text := IntToStr(CbActive.ItemIndex);

  EdCurlen.Text := IntToStr(length(EdCursel.Text));

  EdEdit.Text := CbActive.Text;

  EdEditlen.Text := IntToStr(length(EdEdit.Text));

end;

procedure TComboForm.SetCbActive(cb: TComboBox);

begin

  if FCbActive <> cb then

  begin

    FCbActive.Visible := False;

    FCbActive := cb;

    FCbActive.Visible := True;

    NewSelection;

  end;

end;

//

// Delete an item from the active combobox given its index.

// Ignores bogus indices.

//

procedure TComboForm.DeleteAt(idx: Integer);

begin

  if idx >= 0 then

    CbActive.Items.Delete(idx);

end;

//

// Add a string into the active combobox at the given index.

// If the index is too big, append the item, if too small,

// insert it at the top.

//

procedure TComboForm.AddAt(idx: Integer; s: string);

begin

  if idx > CbActive.Items.Count then

    CbActive.Items.Append(s)

  else

  begin

    if idx < 0 then

      idx := 0;

    CbActive.Items.Insert(idx, s);

  end;

end;

//

// Select an item in the active combobox given it's index.

// A bogus index will result in an exception.

procedure TComboForm.SelectAt(idx: Integer);

begin

  CbActive.ItemIndex := idx;

  NewSelection;

end;

//

// Find the index of an item in the combobox given a string.

// If the string does not exist, return -1.

//

function TComboForm.FindString(s: string): Integer;

var

  i: Integer;

begin

  i := 0;

  while (i < CbActive.Items.Count) and (CbActive.Items[i] <> s) do

    inc(i);

  Result := i;

end;

end.


TComboBox example (combform.dfm)

combform.pas	inptform.pas	inptform.dfm

object ComboForm: TComboForm

  Left = 200

  Top = 108

  BorderIcons = [biSystemMenu, biMinimize]

  BorderStyle = bsSingle

  Caption = 'ComboBox demo'

  ClientHeight = 281

  ClientWidth = 611

  Font.Charset = DEFAULT_CHARSET

  Font.Color = clWindowText

  Font.Height = -11

  Font.Name = 'MS Sans Serif'

  Font.Style = []

  Menu = MainMenu1

  OnCreate = FormCreate

  PixelsPerInch = 96

  TextHeight = 13

  object Label1: TLabel

    Left = 288

    Top = 48

    Width = 82

    Height = 13

    Caption = 'Current selection:'

  end

  object Label2: TLabel

    Left = 305

    Top = 82

    Width = 65

    Height = 13

    Caption = 'Current index:'

  end

  object Label3: TLabel

    Left = 241

    Top = 116

    Width = 129

    Height = 13

    Caption = 'Length of current selection:'

  end

  object Label4: TLabel

    Left = 321

    Top = 150

    Width = 49

    Height = 13

    Caption = 'Edit string:'

  end

  object Label5: TLabel

    Left = 271

    Top = 176

    Width = 99

    Height = 13

    Caption = 'Length of Edit String:'

  end

  object Bevel1: TBevel

    Left = 0

    Top = 0

    Width = 611

    Height = 2

    Align = alTop

  end

  object CbDrop: TComboBox

    Left = 40

    Top = 48

    Width = 178

    Height = 20

    ItemHeight = 13

    Items.Strings = (

      'in'

      'this'

      'box'

      'we'

      'have'

      'a'

      'list'

      'of'

      'strings')

    TabOrder = 0

    Visible = False

    OnChange = ComboChange

  end

  object CbDropList: TComboBox

    Left = 40

    Top = 48

    Width = 178

    Height = 20

    Style = csDropDownList

    ItemHeight = 13

    Items.Strings = (

      'Closer'

      'Still'

      'Substance'

      'Little Earthquakes'

      'Under the Pink'

      'Boys for Pele')

    TabOrder = 1

    Visible = False

    OnChange = ComboChange

  end

  object CbSimple: TComboBox

    Left = 40

    Top = 48

    Width = 178

    Height = 129

    Style = csSimple

    ItemHeight = 13

    Items.Strings = (

      'Return of the Native'

      'Jude the Obscure'

      'One Hundred Years of Solitude'

      'The Autumn of the Patriarch'

      'Idoru'

      'Neuromancer')

    TabOrder = 2

    OnChange = ComboChange

  end

  object EdCursel: TEdit

    Left = 384

    Top = 48

    Width = 178

    Height = 20

    ReadOnly = True

    TabOrder = 3

  end

  object EdCuridx: TEdit

    Left = 384

    Top = 80

    Width = 178

    Height = 20

    ReadOnly = True

    TabOrder = 4

  end

  object EdCurlen: TEdit

    Left = 384

    Top = 112

    Width = 178

    Height = 20

    ReadOnly = True

    TabOrder = 5

  end

  object EdEdit: TEdit

    Left = 384

    Top = 144

    Width = 178

    Height = 20

    ReadOnly = True

    TabOrder = 6

  end

  object EdEditlen: TEdit

    Left = 384

    Top = 176

    Width = 178

    Height = 20

    ReadOnly = True

    TabOrder = 7

  end

  object MainMenu1: TMainMenu

    Left = 8

    Top = 8

    object ComboStyle: TMenuItem

      Caption = '&ComboBox'

      OnClick = ComboStyleClick

      object CmSimple: TMenuItem

        Caption = '&Simple'

        OnClick = CmSimpleClick

      end

      object CmDrop: TMenuItem

        Caption = '&Dropdown'

        OnClick = CmDropClick

      end

      object CmDropList: TMenuItem

        Caption = 'Dropdown &list'

        OnClick = CmDropListClick

      end

    end

    object Add1: TMenuItem

      Caption = '&Add'

      object CmAddString: TMenuItem

        Caption = '&String...'

        OnClick = CmAddStringClick

      end

      object CmAddStringAt: TMenuItem

        Caption = 'String &at...'

        OnClick = CmAddStringAtClick

      end

    end

    object Search1: TMenuItem

      Caption = '&Find'

      object CmFindString: TMenuItem

        Caption = '&String...'

        OnClick = CmFindStringClick

      end

      object CmFindIndex: TMenuItem

        Caption = '&Index...'

        OnClick = CmFindIndexClick

      end

    end

    object CmDelete: TMenuItem

      Caption = '&Delete'

      object CmDelString: TMenuItem

        Caption = '&String...'

        OnClick = CmDelStringClick

      end

      object CmDelIndex: TMenuItem

        Caption = '&Index...'

        OnClick = CmDelIndexClick

      end

      object N1: TMenuItem

        Caption = '-'

      end

      object CmClear: TMenuItem

        Caption = '&All'

        OnClick = CmClearClick

      end

    end

    object CmList: TMenuItem

      Caption = '&List'

      OnClick = CmListClick

      object CmShowList: TMenuItem

        Caption = '&Show'

        OnClick = CmShowListClick

      end

      object CmSortList: TMenuItem

        Caption = 'So&rt'

        OnClick = CmSortListClick

      end

    end

  end

end


TComboBox example (inptform.pas)

combform.pas	combform.dfm	inptform.dfm

unit inptform;

interface

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  StdCtrls;

type

  TInputForm = class(TForm)

    Button1: TButton;

    Button2: TButton;

    PromptLabel: TLabel;

    InputEdit: TEdit;

  private

    { Private declarations }

    function Execute: Boolean;

  public

    { Public declarations }

    function GetString(prompt: string; var s: string): Boolean;

    function GetInteger(prompt: string; var i: Integer): Boolean;

  end;

var

  InputForm: TInputForm;

implementation

{$R *.DFM}

function TInputForm.Execute: Boolean;

begin

  InputEdit.Text := '';

  Result := ShowModal = mrOk;

end;

function TInputForm.GetString(prompt: string; var s: string): Boolean;

begin

  PromptLabel.Caption := prompt;

  Result := InputForm.Execute;

  if Result then

    s := InputEdit.Text;

end;

function TInputForm.GetInteger(prompt: string; var i: Integer): Boolean;

begin

  PromptLabel.Caption := prompt;

  Result := InputForm.Execute;

  if Result then

    i := StrToInt(InputEdit.Text);

end;

end.


TComboBox example (inptform.dfm)

combform.pas	inptform.pas	combform.dfm

object InputForm: TInputForm

  Left = 200

  Top = 108

  Width = 274

  Height = 140

  ActiveControl = InputEdit

  Caption = 'InputForm'

  Font.Charset = DEFAULT_CHARSET

  Font.Color = clWindowText

  Font.Height = -11

  Font.Name = 'MS Sans Serif'

  Font.Style = []

  Position = poScreenCenter

  PixelsPerInch = 96

  TextHeight = 13

  object PromptLabel: TLabel

    Left = 40

    Top = 8

    Width = 5

    Height = 13

    Font.Charset = DEFAULT_CHARSET

    Font.Color = clWindowText

    Font.Height = -11

    Font.Name = 'MS Sans Serif'

    Font.Style = [fsBold]

    ParentFont = False

  end

  object InputEdit: TEdit

    Left = 36

    Top = 24

    Width = 193

    Height = 20

    TabOrder = 0

  end

  object Button1: TButton

    Left = 43

    Top = 72

    Width = 75

    Height = 25

    Caption = '&OK'

    Default = True

    ModalResult = 1

    TabOrder = 1

  end

  object Button2: TButton

    Left = 147

    Top = 72

    Width = 75

    Height = 25

    Caption = '&Cancel'

    ModalResult = 2

    TabOrder = 2

  end

end


TJPegImage example
TJPegImage example (jpegdemo.pas)

jpegdemo.dfm

Objects

The example demonstrates using the TJPegImage object.

Running

To run this example, load the project file from the Help\Examples\JPEG directory.

Description

This example demonstrates the effect of various properties of the TJPegImage object.  In the example form, controls along the left allow you to select a .JPG file to display.  Across the top, various controls allow you to alter the PixelFormat, Scale, GrayScale, Performance, ProgressiveDisplay, and ProgressiveEncoding properties. The JPEG examples directory contains example .JPG files that were saved with and without progressive encoding.

unit jpegdemo;

interface

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  StdCtrls, jpeg, ExtCtrls, FileCtrl, ComCtrls, Menus, printers;

type

  TForm1 = class(TForm)

    Panel1: TPanel;

    DirectoryListBox1: TDirectoryListBox;

    FileListBox1: TFileListBox;

    Panel3: TPanel;

    DriveComboBox1: TDriveComboBox;

    Scale: TComboBox;

    PixelFormat: TComboBox;

    ColorSpace: TComboBox;

    Performance: TComboBox;

    ProgressiveDisplay: TCheckBox;

    IncrementalDisplay: TCheckBox;

    MainMenu1: TMainMenu;

    File1: TMenuItem;

    Open1: TMenuItem;

    N1: TMenuItem;

    Print1: TMenuItem;

    PrinterSetup1: TMenuItem;

    N2: TMenuItem;

    Exit1: TMenuItem;

    OpenDialog1: TOpenDialog;

    PrinterSetupDialog1: TPrinterSetupDialog;

    PrintDialog1: TPrintDialog;

    ScrollBox1: TScrollBox;

    Image1: TImage;

    procedure FileListBox1DblClick(Sender: TObject);

    procedure SetJPEGOptions(Sender: TObject);

    procedure FormCreate(Sender: TObject);

    procedure ProgressUpdate(Sender: TObject; Stage: TProgressStage;

      PercentDone: Byte; RedrawNow: Boolean; const R: TRect; const Msg: string);

    procedure Open1Click(Sender: TObject);

    procedure Print1Click(Sender: TObject);

    procedure PrinterSetup1Click(Sender: TObject);

    procedure Exit1Click(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

    procedure OpenFile(const Filename: string);

  end;

var

  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.OpenFile(const Filename: string);

begin

  try

    Image1.Picture.LoadFromFile(Filename);

  except

    on EInvalidGraphic do

      Image1.Picture.Graphic := nil;

  end;

  SetJPEGOptions(self);

end;

procedure TForm1.FileListBox1DblClick(Sender: TObject);

begin

  OpenFile(FileListbox1.Filename);

end;

procedure TForm1.SetJPEGOptions(Sender: TObject);

var

  Temp: Boolean;

begin

  Temp := Image1.Picture.Graphic is TJPEGImage;

  if Temp then

    with TJPEGImage(Image1.Picture.Graphic) do

    begin

      PixelFormat := TJPEGPixelFormat(Self.PixelFormat.ItemIndex);

      Scale := TJPEGScale(Self.Scale.ItemIndex);

      Grayscale := Boolean(Colorspace.ItemIndex);

      Performance := TJPEGPerformance(Self.Performance.ItemIndex);

      ProgressiveDisplay := Self.ProgressiveDisplay.Checked;

    end;

  Scale.Enabled := Temp;

  PixelFormat.Enabled := Temp;

  Colorspace.Enabled := Temp;

  Performance.Enabled := Temp;

  ProgressiveDisplay.Enabled := Temp

    and TJPEGImage(Image1.Picture.Graphic).ProgressiveEncoding;

  Image1.IncrementalDisplay := IncrementalDisplay.Checked;

end;

procedure TForm1.FormCreate(Sender: TObject);

begin

  Scale.ItemIndex := 0;

  PixelFormat.ItemIndex := 0;

  Colorspace.ItemIndex := 0;

  Performance.ItemIndex := 0;

  OpenDialog1.Filter := GraphicFilter(TGraphic);

  FileListbox1.Mask := GraphicFileMask(TGraphic);

  Image1.OnProgress := ProgressUpdate;

end;

procedure TForm1.ProgressUpdate(Sender: TObject; Stage: TProgressStage;

  PercentDone: Byte; RedrawNow: Boolean; const R: TRect; const Msg: string);

begin

  if Stage = psRunning then

    Caption := Format('%d%%',[PercentDone])

  else

    Caption := 'Form1';

end;

procedure TForm1.Open1Click(Sender: TObject);

begin

  if OpenDialog1.Execute then

    OpenFile(OpenDialog1.FileName);

end;

procedure TForm1.Print1Click(Sender: TObject);

var

  AspectRatio: Single;

  OutputWidth, OutputHeight: Single;

begin

  if not PrintDialog1.Execute then Exit;

  Printer.BeginDoc;

  try

    OutputWidth := Image1.Picture.Width;

    OutputHeight := Image1.Picture.Height;

    AspectRatio := OutputWidth / OutputHeight;

    if (OutputWidth < Printer.PageWidth) and

      (OutputHeight < Printer.PageHeight) then

    begin

      if OutputWidth < OutputHeight then

      begin

        OutputHeight := Printer.PageHeight;

        OutputWidth := OutputHeight * AspectRatio;

      end

      else

      begin

        OutputWidth := Printer.PageWidth;

        OutputHeight := OutputWidth / AspectRatio;

      end

    end;

    if OutputWidth > Printer.PageWidth then

    begin

      OutputWidth := Printer.PageWidth;

      OutputHeight := OutputWidth / AspectRatio;

    end;

    if OutputHeight > Printer.PageHeight then

    begin

      OutputHeight := Printer.PageHeight;

      OutputWidth := OutputHeight * AspectRatio;

    end;

    Printer.Canvas.StretchDraw(Rect(0,0,

      Trunc(OutputWidth), Trunc(OutputHeight)),

      Image1.Picture.Graphic);

  finally

    Printer.EndDoc;

  end;

end;

procedure TForm1.PrinterSetup1Click(Sender: TObject);

begin

  PrinterSetupDialog1.Execute;

end;

procedure TForm1.Exit1Click(Sender: TObject);

begin

  Close;

end;

end.


TJPEGImage Example(jpegdemo.dfm)

jpegdemo.pas

object Form1: TForm1

  Left = 225

  Top = 115

  AutoScroll = False

  Caption = 'Form1'

  ClientHeight = 376

  ClientWidth = 488

  Font.Charset = ANSI_CHARSET

  Font.Color = clWindowText

  Font.Height = -10

  Font.Name = 'MS Sans Serif'

  Font.Style = []

  Menu = MainMenu1

  Position = poDefaultPosOnly

  ShowHint = True

  OnCreate = FormCreate

  PixelsPerInch = 96

  TextHeight = 13

  object Panel1: TPanel

    Left = 0

    Top = 27

    Width = 124

    Height = 349

    Align = alLeft

    TabOrder = 0

    object DirectoryListBox1: TDirectoryListBox

      Left = 1

      Top = 1

      Width = 122

      Height = 79

      Align = alTop

      Ctl3D = True

      FileList = FileListBox1

      ItemHeight = 16

      ParentCtl3D = False

      TabOrder = 0

    end

    object FileListBox1: TFileListBox

      Left = 1

      Top = 80

      Width = 122

      Height = 268

      Align = alClient

      ItemHeight = 13

      TabOrder = 1

      OnClick = FileListBox1DblClick

    end

  end

  object Panel3: TPanel

    Left = 0

    Top = 0

    Width = 488

    Height = 27

    Align = alTop

    TabOrder = 1

    object DriveComboBox1: TDriveComboBox

      Left = 7

      Top = 3

      Width = 117

      Height = 19

      DirList = DirectoryListBox1

      TabOrder = 0

    end

    object Scale: TComboBox

      Left = 127

      Top = 3

      Width = 36

      Height = 21

      Hint = 'Scale'

      Style = csDropDownList

      Enabled = False

      ItemHeight = 13

      Items.Strings = (

        '1:1'

        '1:2'

        '1:4'

        '1:8')

      TabOrder = 1

      OnClick = SetJPEGOptions

    end

    object PixelFormat: TComboBox

      Left = 166

      Top = 3

      Width = 49

      Height = 21

      Hint = 'Pixel Format'

      Style = csDropDownList

      Enabled = False

      ItemHeight = 13

      Items.Strings = (

        '24 bit'

        '8 bit')

      TabOrder = 2

      OnClick = SetJPEGOptions

    end

    object ColorSpace: TComboBox

      Left = 218

      Top = 3

      Width = 62

      Height = 21

      Hint = 'Color space'

      Style = csDropDownList

      Enabled = False

      ItemHeight = 13

      Items.Strings = (

        'RGB'

        'Grayscale')

      TabOrder = 3

      OnClick = SetJPEGOptions

    end

    object Performance: TComboBox

      Left = 283

      Top = 3

      Width = 75

      Height = 21

      Hint = 'Performance'

      Style = csDropDownList

      Enabled = False

      ItemHeight = 13

      Items.Strings = (

        'Quality'

        'Speed')

      TabOrder = 4

      OnClick = SetJPEGOptions

    end

    object ProgressiveDisplay: TCheckBox

      Left = 364

      Top = 1

      Width = 124

      Height = 14

      Caption = 'Progressive JPEG'

      Enabled = False

      Font.Charset = ANSI_CHARSET

      Font.Color = clWindowText

      Font.Height = -9

      Font.Name = 'arial'

      Font.Style = []

      ParentFont = False

      TabOrder = 5

      OnClick = SetJPEGOptions

    end

    object IncrementalDisplay: TCheckBox

      Left = 364

      Top = 12

      Width = 137

      Height = 14

      Caption = 'Incremental Display'

      Font.Charset = ANSI_CHARSET

      Font.Color = clWindowText

      Font.Height = -9

      Font.Name = 'Arial'

      Font.Style = []

      ParentFont = False

      TabOrder = 6

    end

  end

  object ScrollBox1: TScrollBox

    Left = 124

    Top = 27

    Width = 364

    Height = 349

    Align = alClient

    TabOrder = 2

    object Image1: TImage

      Left = 0

      Top = 0

      Width = 85

      Height = 85

      AutoSize = True

    end

  end

  object MainMenu1: TMainMenu

    Left = 96

    Top = 217

    object File1: TMenuItem

      Caption = '&File'

      object Open1: TMenuItem

        Caption = '&Open...'

        ShortCut = 114

        OnClick = Open1Click

      end

      object N1: TMenuItem

        Caption = '-'

      end

      object Print1: TMenuItem

        Caption = '&Print'

        OnClick = Print1Click

      end

      object PrinterSetup1: TMenuItem

        Caption = 'Printer &Setup...'

        OnClick = PrinterSetup1Click

      end

      object N2: TMenuItem

        Caption = '-'

      end

      object Exit1: TMenuItem

        Caption = 'E&xit'

        ShortCut = 32856

        OnClick = Exit1Click

      end

    end

  end

  object OpenDialog1: TOpenDialog

    Options = [ofPathMustExist, ofFileMustExist]

    Left = 96

    Top = 257

  end

  object PrinterSetupDialog1: TPrinterSetupDialog

    Left = 96

    Top = 313

  end

  object PrintDialog1: TPrintDialog

    Left = 96

    Top = 377

  end

end


Exception

Hierarchy	Properties	Methods

Exception is the base class for all runtime exceptions.

Unit

sysutils

Description

Exception encapsulates the fundamental properties and methods for all exceptions. Use Exception as the base class for creating custom exceptions.

All methods introduced for the Exception object are constructors that provide alternative ways to create exception messages. Some constructors also create help context IDs. Typically, an application calls these constructors dynamically when an exception occurs.

Exception messages can be hard-coded strings, formatted strings, or strings (including formatted strings ) loaded from an application resource.

Exceptions are raised when a runtime error occurs in an application, such as attempting to divide by zero. When an exception is raised, typically an exception instance displays a dialog box describing the error condition. If an application does not handle the exception condition, then the default exception handler is called. This handler also displays a dialog box with an OK button that usually permits an application to continue processing when the user clicks OK.

The Exception object provides a consistent interface for error conditions, and enables applications to handle error conditions in a graceful manner. Applications can

•	Trap for and handle specific exceptions in try...except blocks.

•	Protect code that allocates resources from exception conditions by embedding the code in try...finally blocks.

•	Raise  exceptions or custom exceptions in response to program conditions.

Note:	Standard practice is to name all derived exceptions beginning with “E”, followed by an abbreviated, descriptive name.


Exception properties

Exception	Alphabetically

In Exception

HelpContext

Message


Exception properties

Exception	By object

HelpContext

Message


Exception.HelpContext

Exception	See also

Indicates the help-context ID number for context-sensitive online help associated with the exception.

type THelpContext = -MaxLongint..MaxLongint;

property HelpContext: THelpContext;

Description

HelpContext provides storage for the help context ID number associated with the exception object. The context ID number determines the contents of the help screen that appears when a user presses F1 in response to an exception error message.

Note

Not all Exception constructors provide a value for HelpContext. To provide a help context for custom exceptions, use the constructors listed in the See also list.


Exception.Message

Exception	See also

Message contains the text string to display in the exception dialog box when the exception is raised.

property Message: string

Description

Message stores the error-message string to display when the exception is raised. All Exception constructors expect a string parameter to store in Message. Message text can be hard-coded as a parameter to an Exception constructor, created as dynamic parameter, or loaded from a resource file as a static or dynamically formatted parameter.


Exception methods

Exception	Alphabetically

In Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Exception methods

Exception	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Exception.Create

Exception	See also	Example

Instantiates an instance of an exception with a simple message string.

constructor Create (const Msg: string);

Description

Call Create to construct an exception with a simple message string.

Msg is the string containing the runtime error message to display in the exception dialog box. Msg can be a hard-coded string, or can be a function call that returns a string.


Exception.CreateFmt

Exception	See also

Instantiates an instance of an exception with a formatted message string.

constructor CreateFmt (const Msg: string; const Args: array of const)

Description

Call CreateFmt to construct an exception with a formatted message string. Msg is a string constant containing format specifiers to be replaced with values from Args. Args is an array of constants containing values to format according to format specifiers in Msg, and insert into Msg. CreateFmt calls the Format function to transform Msg with the values in Arg.


Exception.CreateFmtHelp

Exception	See also

Instantiates an instance of an exception with a formatted message string and a help-context ID.

constructor CreateFmtHelp (const Msg: string; const Args: array of const; AHelpContext: Integer);

Description

Call CreateFmtHelp to construct an exception with a formatted message string and a help context ID. Msg is a string constant containing format specifiers to be replaced with values from Args. Args is an array of constants containing values to format according to format specifiers in Msg, and insert into Msg. CreateFmt calls the Format function to transform Msg with the values in Arg.

AHelpContext is an integer that specifies the context-sensitive help ID for the exception.


Exception.CreateHelp

Exception	See also

Creates an instance of an exception with a simple message string and a help- context ID.

constructor CreateHelp (const Msg: string; AHelpContext: Integer);

Description

Call CreateHelp to construct an exception with a simple message string and a help-context ID. Msg is the string containing the runtime error message to display in the exception dialog box. Msg can be a hard-coded string, or can be a function call that returns a string.

AHelpContext is an integer that specifies the context-sensitive help ID for the exception.


Exception.CreateRes

Exception	See also

Creates an instance of an exception with a simple message string that is loaded from the application’s resources.

constructor CreateRes (Ident: Integer); overload;

constructor CreateRes(ResStringRec: PResStringRec); overload;

Description

Call CreateRes to construct an exception with a simple message string loaded from an application’s resources. Resources are bound into the application executable at compile time, but at design time they exist in a separate RES file.

Ident is the unique ID of the resource as specified in the RES file. If Ident is not a valid resource ID, CreateRes creates an empty message string for the exception.

ResStringRec is a pointer to a resource string. This syntax appears as follows:

resourcestring sMyNewErrorMessage = 'You shouldn''t have done that';

...

Exception.Create(@sMyNewErrorMessage);


Exception.CreateResFmt

Exception	See also

Creates an instance of an exception with a message string that is loaded from the application’s resources and then formatted.

constructor CreateResFmt(Ident: Integer; const Args: array of const); overload;

constructor CreateResFmt(ResStringRec: PResStringRec; const Args: array of const); overload;

Description

Call CreateResFmt to construct an exception with a message string loaded from an application’s resources and then formatted with additional information. Resources are bound into the application executable at compile time, but at design time they exist in a separate RES file.

Ident is the unique ID of the resource as specified in the RES file. If Ident is not a valid resource ID, CreateResFmt creates an empty message string.

ResStringRec is a pointer to a resource string. This syntax appears as follows:

resourcestring sMyNewErrorMessage = 'Illegal value: %s';

...

Exception.CreateResFmt(@sMyNewErrorMessage, [-1]);

Args is an array of constants containing values to:

1	Format according to format specifiers embedded in the string, and

2	Insert into the message string.

CreateResFmt calls the Format function to transform the message string with the values in Arg.


Exception.CreateResFmtHelp

Exception	See also

Creates an instance of an exception with a help-context ID and a formatted message string loaded from the application resources

constructor CreateResFmtHelp(Ident: Integer; const Args: array of const; AHelpContext: Integer); overload;

constructor CreateResFmtHelp(ResStringRec: PResStringRec; const Args: array of const; AHelpContext: Integer); overload;

Description

Call CreateResFmtHelp to construct an exception with a:

1	Message string loaded from an application’s resources and formatted with additional information.

2	Help-context ID.

Resources are bound into the application executable at compile time, but at design time they exist in a separate RES file. Ident is the unique ID of the resource as specified in the RES file. If Ident is not a valid resource ID, CreateResFmt creates an empty message string.

ResStringRec is a pointer to a resource string. This syntax appears as follows:

resourcestring sMyNewErrorMessage = 'Illegal value: %s';

const IDH_MYNEWERROR: Integer = 30000;

...

Exception.CreateResFmt(@sMyNewErrorMessage, [-1], IDH_MYNEWERROR);

Args is an array of constants containing values to:

1	Format according to format specifiers embedded in the string, and

2	Insert into the message string.

CreateResFmtHelp calls the Format function to transform the message string with the values in Arg.

AHelpContext is an integer that specifies the context-sensitive help ID for the exception.


Exception.CreateResHelp

Exception	See also

Creates an instance of an exception with a help-context ID and a simple message string that is loaded from the application’s resources.

constructor CreateResHelp(Ident: Integer; AHelpContext: Integer); overload;

constructor CreateResHelp(ResStringRec: PResStringRec; AHelpContext: Integer); overload;

Description

Call CreateResHelp to construct an exception with a help-context ID and a simple message string loaded from an application’s resources. Resources are bound into the application executable at compile time, but at design time they exist in a separate RES file.

Ident is the unique ID of the resource as specified in the RES file. If Ident is not a valid resource ID, CreateResHelp creates an empty message string for the exception.

AHelpContext is an integer that specifies the context-sensitive help ID for the exception.

ResStringRec is a pointer to a resource string. Its syntax appears as follows:

resourcestring sMyNewErrorMessage = 'You shouldn''t have done that';

const IDH_MYNEWERROR: Integer = 30000;

...

Exception.Create(@sMyNewErrorMessage, IDH_MYNEWERROR);


Hierarchy

TObject


EZeroDivide

Hierarchy	Properties	Methods	See also

EZeroDivide is the exception class for floating-point divide-by-zero errors.

Unit

sysutils

Description

EZeroDivide exception is raised when an application attempts to divide a floating-point value by zero.

As a descendant of EExternal, EZeroDivide saves the Windows exception record (if there is one) in its ExceptionRecord data structure.

Note

Integer divide-by-zero errors raise the EDivByZero exception.


EZeroDivide properties

EZeroDivide	Alphabetically

Derived from Exception

HelpContext

Message


EZeroDivide properties

EZeroDivide	By object

HelpContext

Message


EZeroDivide methods

EZeroDivide	Alphabetically

Derived from Exception

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


EZeroDivide methods

EZeroDivide	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateFmt

CreateFmtHelp

CreateHelp

CreateRes

CreateResFmt

CreateResFmtHelp

CreateResHelp

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject

Exception

EExternal

EMathError


TField

Hierarchy	Properties	Methods	Events	See also

TField is the common ancestor of all the field components in a dataset.

Unit

db

Description

TField encapsulates the fundamental behavior common to all field components. It introduces the properties, events, and methods that are used to:

Change the value of a field in a dataset.

Convert the value of a field from one data type to another.

Validate data that the user enters for a field.

Define how the data in the field appears as it is displayed or edited.

Calculate the value of a field from code written in the OnCalcFields event of the dataset.

Look up the field’s value from another dataset.

Do not create instances of TField. TField descendants are created automatically each time a dataset is activated. These descendants can be dynamic (the default) or persistent. Dynamic field components reflect the actual columns of the underlying physical table at the time a dataset is opened. Persistent field components are created at design time using the Fields editor, which specifies the fields in the dataset, their properties, and their ordering.

Creating persistent field components guarantees that each time an application runs, it uses and displays the same columns, in the same order, even if the physical structure of the underlying database changes. If a column on which a persistent field component is based is deleted or changed, Delphi generates an exception rather than opening the table against a nonexistent column or mismatched data. If this happens, remove the field component for the nonexistent field using the Fields editor.

A field in a dataset is always treated as one of the following TField descendant classes below:

TADTField	TDateField	TReferenceField
TAggregateField	TDateTimeField	TSmallIntField
TArrayField	TFloatField	TStringField
TAutoIncField	TGraphicField	TTimeField
TBCDField	TGuidField	TVarBytesField
TBlobField	TIDispatchField	TVariantField
TBooleanField	TIntegerField	TWideStringField
TBytesField	TLargeIntField	TWordField
TCurrencyField	TMemoField

In addition to these front-line field classes, there are a number of field classes that serve only as abstract classes. These field classes are not used to instantiate field objects, only to provide functionality for descendant classes. These abstract field classes include TBinaryField, TDataSetField, TInterfaceField, TNumericField, and TObjectField.


TField properties

TField	Alphabetically	Legend

In TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Value

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TField properties

TField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

ValidChars

Value

VCLComObject

Visible


TField.Alignment

TField	See also

Determines how the field’s data is displayed within a data-aware control.

property Alignment: TAlignment;

Description

Use Alignment to specify the position of the field’s data within data-aware controls. These are the possible values:

Value	Meaning

taLeftJustify	Align data to the left side of the control

taCenter	Center data horizontally in the control

taRightJustify	Align data to the right side of the control


TField.AsBoolean

TField	See also

Represents the field’s value as a Boolean value.

property AsBoolean: Boolean;

Description

AsBoolean provides a property to read the value of the field’s data into a Boolean, or to assign a Boolean value to the contents of the field. TField does not support Boolean values, and raises an exception whenever an attempt is made to get or set the AsBoolean property.

Descendants of TField that represent Boolean fields or that support conversions between the field’s Value property and a Boolean value, override AsBoolean to read and write the value of the field as a Boolean value.


TField.AsCurrency

TField	See also

Represents the field’s value as a Currency value.

property AsCurrency: Currency;

Description

AsCurrency provides a property to read the value of the field’s data into an object or variable of type Currency, or to assign a Currency value to the contents of the field. TField does not support Currency values, and raises an exception whenever an attempt is made to get or set the AsCurrency property.

Descendants of TField that represent currency fields or that support conversions between the field’s Value property and a Currency value, override AsCurrency to read and write the value of the field as a Currency value.


TField.AsDateTime

TField	See also 	Example

Represents the field’s value as a TDateTime value.

property AsDateTime: TDateTime;

Description

AsDateTime provides a property to read the value of the field’s data into an object or variable of type TDateTime, or to assign a TDateTime value to the contents of the field. TField does not support TDateTime values, and raises an exception whenever an attempt is made to get or set the AsDateTime property.

Descendants of TField that represent datetime (timestamp) fields or that support conversions between the field’s Value property and a TDateTime value, override AsDateTime to read and write the value of the field as a TDateTime value.


TField.AsFloat

TField	See also

Represents the field’s value as a Double value.

property AsFloat: Double;

Description

AsFloat provides a property to read the value of the field’s data into a Double, or to assign a Double value to the contents of the field. TField does not support floating point values, and raises an exception whenever an attempt is made to get or set the AsFloat property.

Descendants of TField that represent floating point numeric fields or that support conversions between the field’s Value property and a Double value, override AsFloat to read and write the value of the field as a Double value.


TField.AsInteger

TField	See also 	Example

Represents the field’s value as a 32-bit integer.

property AsInteger: Integer;

Description

AsInteger provides a property to read the value of the field’s data into an integer, or to assign an integer value to the contents of the field. TField does not support integer values, and raises an exception whenever an attempt is made to get or set the AsInteger property.

Descendants of TField that represent integer fields or that support conversions between the field’s Value property and an integer value, override AsInteger to read and write the value of the field as an integer value.


TField.AsString

TField	See also 	Example

Represents the field’s value as a string.

property AsString: String;

Description

Reading the AsString property returns the abbreviated class name of the field component enclosed in parentheses. The abbreviated class name is built by stripping the leading ‘T’ from the class name and removing the trailing word ‘FIELD’, except in the case of TField where that would leave an empty string. Thus, the abbreviated class name of TField is “FIELD”, the abbreviated class name of TVarBytesField is “VarBytes”, and so on.

Trying to set the AsString property raises an exception.

Descendants of TField that represent string fields or that support conversions between the field’s Value property and a string override AsString to read and write the value of the field as a different, more meaningful, string.


TField.AsVariant

TField	See also

Represents the Value of the field as type Variant.

property AsVariant: Variant;

Description

AsVariant provides a property to read the value of the field’s data into a Variant, or to assign a Variant value to the contents of the field. TField does not support Variant values, and raises an exception when an attempt is made to read the AsVariant property. TField also raises an exception when an attempt is made to set the AsVariant property, unless the Variant is of type varNull, in which case TField calls the Clear method.

Descendants of TField implement the AsVariant method to get or set the value of the field as a Variant.


TField.AttributeSet

TField	See also

Specifies the name of an attribute set in the data dictionary to apply to the field component.

property AttributeSet: String;

Description

An attribute set defines the display and format properties of a field component that are displayed in a data-aware control at design time. It also defines any constraint and default properties of the field component.

Attribute sets are stored in the data dictionary by name so that at design time developers can create and apply the same set of attributes to different field components in one or more datasets. When an attribute set is assigned to a field component at design time and that field component is owned by a TQuery or TStoredProc dataset, AttributeSet contains the name of the assigned attribute set.


TField.AutoGenerateValue

TField	See also

Indicates whether the field values can be generated by the server rather than entered by the user.

property AutoGenerateValue: TAutoRefreshFlag;

Description

Use AutoGenerateValue to indicate when field values can be generated by the database. Such fields include autoincrement fields and fields with default values.

By default, values inserted automatically into such fields when a record is posted are not automatically refetched by the dataset. Instead, the application must call the dataset’s Refresh method to update the field component’s Value property. These values can be automatically updated if the dataset’s AutoRefresh property is True. However, some database drivers can’t determine which fields can have values supplied automatically by the server. For these cases, applications can provide this information by setting the AutoGenerateValue property. Use this property to indicate whether the field is an autoincrement field (arAutoInc), a field with a default value (arDefault), or a field whose value is not automatically generated (arNone).

AutoGenerateValue is not always required. Fields with an AutoGenerateValue property of arNone may still be updated if the driver supplies metadata that indicates it has a default value or an autoincrement value. However, it is good practice to supply this information because not all drivers supply this metadata.

Note:	Trying to change the AutoGenerateValue property when the field’s dataset is open generates an exception. Thus, AutoGenerateValue only works with persistent field components, which remain when the dataset is closed.

Note:	If the field is not in a BDE-enabled dataset or if the dataset’s AutoRefresh property is False, this property has no effect.


TField.Calculated

TField	See also

Determines whether the value of the field is calculated by the OnCalcFields event handler of its dataset.

property Calculated: Boolean;

Description

Use Calculated to determine if the field is a calculated field. When Calculated is True and the OnCalcFields event occurs, the OnCalcFields event handler updates the value of the field. The default value is False.

The value of a Calculated field is not stored in or retrieved from the physical tables underlying a dataset. Instead, calculated fields are calculated for each record in the table by the dataset's OnCalcFields event handler, which typically uses expressions involving values from other fields in the record to generate a value for each calculated field.

For example, a table might have non-calculated fields for Quantity and UnitPrice, and a calculated field for ExtendedPrice, which would be calculated by multiplying the values of the Quantity and UnitPrice fields in an OnCalcFields event handler.

Note:	Do not change the setting of Calculated in application code. Calculated is automatically set to True by the Fields editor at design time if a field’s value is specified as calculated.

Note:	Do not confuse the Calculated property with the InternalCalcField property of a field definition. The value of a calculated field is computed in the OnCalcFields event handler. The value of an internally calculated field is computed by the SQL server or the Borland Database Engine.


TField.CanModify

TField	See also

Specifies whether a field can be modified.

property CanModify: Boolean;

Description

Check CanModify to determine if a field’s data can be edited. CanModify is True only if the ReadOnly property is False, and the dataset for this field component allows write access to the corresponding database field.


TField.ConstraintErrorMessage

TField	See also

Specifies a customized error message that appears when the user tries to set a value that violates the data constraints of the field.

property ConstraintErrorMessage: String;

Description

Set ConstraintErrorMessage to specify the message that appears when the user-supplied value for the field does not meet the constraints imposed by the server or specified in the CustomConstraint property.


TField.CurValue

TField	See also

Represents the current value of the field component including changes made by other users of the database.

property CurValue: Variant;

Description

Use CurValue to examine the value of a field when a problem occurs in posting a value to the database using a provider. If the current field value is causing a problem, such as a key violation, when posting the value, an event is generated to allow applications to respond to the problem. Client datasets generate an OnReconcileError event. On the server side, provider components generate an OnUpdateError event. In the event handler, NewValue is the unposted value that caused the problem, OldValue is the value that was originally assigned to the field before any edits were made, and CurValue is the value that is currently assigned to the field. CurValue may differ from OldValue if another user changed the value of the field after OldValue was read.

Note:	CurValue is only supported when the dataset is a TClientDataSet. In the provider’s OnUpdateError event, a temporary client dataset containing fields with a CurValue property is passed to the event handler.


TField.CustomConstraint

TField	See also

Specifies an SQL string the enforces any application-specific constraints on the field’s value.

property CustomConstraint: String;

Description

Set CustomConstraint to limit the values that the user can enter into a field. CustomConstraint must be a valid SQL search expression such as

x > 0 and x < 100

The name used to refer to the value of the field can be any string that is not a reserved SQL keyword, as long as it is used consistently throughout the constraint expression.

Custom constraints are imposed in addition to any constraints to the field’s value that come from the server. To see the constraints imposed by the server, read the ImportedConstraint property.

Note:	When setting the CustomConstraint property, be sure to set the ConstraintErrorMessage property as well, so that a message will appear to the user when a value is entered that violates the custom constraint.

Note:	Custom constraints are SQL expressions. Because of this, always use a period (.) as a floating-point separator.  This may be inconsistent with international Windows settings.


TField.DataSet

TField	See also

Identifies the dataset to which a field component belongs.

property DataSet: TDataSet;

Description

Check the value of the DataSet property to determine the dataset that uses the field component to represent one of its fields. Applications should not directly assign the DataSet property of a field. It is assigned automatically when the field is created from a TFieldDef object.


TField.DataSize

TField	See also 	Example

Indicates the amount of memory needed to store a field component’s value.

property DataSize: Integer;

Description

Check DataSize to determine the number of bytes required to store a field component’s value. Use DataSize to determine the required size of a buffer for working with the field’s value in native format. For example, use DataSize to determine the buffer size needed by the GetData and SetData methods.

The value of DataSize for TField is 0. Most descendants of TField override this property to specify the size required by the specific field type they represent. BLOB fields, however, represent data of indeterminate size. They do not override the inherited method, and the value of DataSize for BLOB fields is 0. A value of zero should not be interpreted as meaning the field value requires no memory. A value of zero indicates that the memory required for the field is indeterminate.


TField.DataType

TField	See also

Identifies the data type of the field component.

property DataType: TFieldType;

Description

Read the DataType property to learn the type of the data the field contains.


TField.DefaultExpression

TField	See also

Specifies an SQL expression that is assigned to the field if the user does not provide a value.

property DefaultExpression: String;

Description

Set DefaultExpression to provide a default value for a field. DefaultExpression can be any valid SQL value expression that does not refer to field values. If the expression contains literals other than numeric values, they must appear in quotes. For example, a default value of noon for a time field would be

'12:00:00'

including the quotes around the literal value.


TField.DisplayLabel

TField	See also 	Example

Contains the text to display in the corresponding column heading of a data grid.

property DisplayLabel: String;

Description

Use DisplayLabel to assign column headings to a data grid. The column headings of the data grid use the DisplayName property of the field whose value they represent. Setting DisplayLabel changes DisplayName property from FieldName to the string specified as DisplayLabel.


TField.DisplayName

TField	See also	Example

Represents the name of the field for display purposes.

property DisplayName: String;

Description

Use DisplayName when displaying a string that represents the field to the user. For example, when raising an exception concerning the field, format an error string that includes the DisplayName to refer to the field. DisplayName is a read-only property. To change the value of DisplayName, use the DisplayLabel property.

If DisplayLabel is defined, DisplayName is the same as DisplayLabel. Otherwise, DisplayName is the same as the FieldName property.


TField.DisplayText

TField	See also 	Example

Represents the field’s value as it is displayed in a data-aware control.

property DisplayText: String;

Description

DisplayText is a read-only string representation of a field’s value to display in a data-aware control. If an OnGetText event handler is assigned, DisplayText is the value returned in the Text parameter of the OnGetText event handler when the DisplayText parameter is True. Otherwise, DisplayText is the value of the AsString property.

DisplayText is the string representation of the field’s Value property when it is not being edited. When the field is being edited, use the Text property.


TField.DisplayWidth

TField	See also

Specifies the number of characters that should be used to display a field’s value by a cooperating data-aware control.

property DisplayWidth: Integer;

Description

Set DisplayWidth to control how many characters are used to calculate the column width for the field when it is displayed by a TDBLookupListBox object or a descendant if TCustomDBGrid. The actual width of columns is determined by the average character width. If the data-aware control that displays the field is not using a fixed pitch font, DisplayWidth may indicate more or fewer characters than will fit in the column for any given string.

Note:	The DisplayWidth property has no effect if there is an explicit Columns value for the field in a TDBGrid object.


TField.EditMask

TField	See also

Contains the mask that is used to restrict the data that can be entered into a data field.

property EditMask: String;

Description

Use EditMask to restrict the characters the user can enter to valid characters and formats. If the user attempts to enter a character that is not valid, the character is not accepted. Validation using the EditMask property is performed on a character-by-character basis. Use an OnValidate event to validate the entire input, just before it is posted to the database.

A mask consists of three fields with semicolons separating the fields. The first part of the mask is the mask itself. The second part is the character that determines whether the literal characters of a mask are included as part of the data. The third part of the mask is the character used to represent unentered characters in the mask.

These are the special characters used in the first field of the mask:

Character	Meaning in mask

     !	If a ! character appears in the mask, optional characters are represented in the EditText as leading blanks. If a ! character is not present, optional characters are represented in the EditText as trailing blanks.

     >	If a > character appears in the mask, all characters that follow are in uppercase until the end of the mask or until a < character is encountered.

     <	If a < character appears in the mask, all characters that follow are in lowercase until the end of the mask or until a > character is encountered.

     <>	If these two characters appear together in a mask, no case checking is done and the data is formatted with the case the user uses to enter the data.

     \	The character that follows a \ character is a literal character. Use this character when you want to allow any of the mask special characters as a literal in the data.

     L	The L character requires an alphabetic character only in this position. For the US, this is A-Z, a-z.

     l	The l character permits only an alphabetic character in this position, but doesn't require it.

     A	The A character requires an alphanumeric character only in this position. For the US, this is A-Z, a-z, 0-9.

     a	The a character permits an alphanumeric character in this position, but doesn't require it.

     C	The C character requires an arbitrary character in this position.

     c	The c character permits an arbitrary character in this position, but doesn't require it.

     0	The 0 character requires a numeric character only in this position.

     9	The 9 character permits a numeric character in this position, but doesn't require it.

     #	The # character permits a numeric character or a plus or minus sign in this position, but doesn't require it.

    :	The : character is used to separate hours, minutes, and seconds in times. If the character that separates hours, minutes, and seconds is different in the regional settings of the Control Panel utility on your computer system, that character is used instead of :.

     /	The / character is used to separate months, days, and years in dates. If the character that separates months, days, and years is different in the regional settings of the Control Panel utility on your computer system, that character is used instead of /.

    ;	The ; character is used to separate the three fields of the mask.

     _	the _ character automatically inserts spaces into the text. When the user enters characters in the field, the cursor skips the _ character.

Any character that does not appear in the preceding table can appear in the first part of the mask as a literal character. Literal characters must be matched exactly when entering data for the field. They are inserted automatically, and the cursor skips over them during editing. The special mask characters can also appear as literal characters if preceded by a backslash character (\).

The second field of the mask is a single character that indicates whether literal characters from the mask should be included as part of the Value property of the field. For example, the mask for a telephone number with area code could be the following string:

(000)_000-0000;0;*

The 0 in the second field indicates that the Value property for the field would consist of the 10 digits that were entered, rather than the 14 characters that make up the telephone number as it appears to the user.

A 0 in the second field indicates that literals should not be included, any other character indicates that they should be included. You can change the character that indicates whether literals should be included in the EditMask property editor, or programmatically by changing the MaskNoSave typed constant defined in the Mask unit.

The third field of the mask is the character that appears in the edit control for blanks (characters that have not been entered). By default, this is the same as the character that stands for literal spaces. The two characters appear the same in an edit window. However, when a user enters the data for the field, the cursor selects each blank character in turn, and skips over the space character.

Setting EditMask to an empty string removes the mask.

Note:	When working with multibyte character sets, such as Japanese shift-JIS, each special mask character represents a single byte. To specify double-byte characters using the L,l,A,a,C, or c specifiers, the mask characters must be doubled as well. For example, LL would represent two single-byte alphabetic characters or a one double-byte character. Only single-byte literal characters are supported.


TField.EditMaskPtr

TField	See also

Provides read-only access to the EditMask property.

property EditMaskPtr: String;

Description

Use EditMaskPtr when reading the EditMask property. Because EditMaskPtr is a read-only property, EditMaskPtr guards against accidentally changing the value of the mask in code that should only read it.


TField.FieldKind

TField	See also

Indicates whether a field represents a column in a dataset, a calculated field, or a lookup field.

property FieldKind: TFieldKind;

type TFieldKind = (fkData, fkCalculated, fkLookup, fkInternalCalc, fkAggregate);

Description

Use FieldKind to determine if a field is a data field, a calculated field, or a lookup field. The value of FieldKind can be changed programmatically, but in practice FieldKind is set at design time when creating Field components with the Fields editor.

The FieldKind property can take one of the following values:

Value	Description

fkData	Field represents a physical field in a database table

fkCalculated	Field is calculated in an OnCalcFields event handler

fkLookup	Field is a lookup field.

fkInternalCalc	Field is calculated but values are stored in the dataset.

fkAggregate	Field represents a maintained aggregate in a client dataset.

Note:	Fields calculated by SQL servers or the Borland Database Engine to display the results of a query that returns a live dataset have a FieldKind of fkInternalCalc, not fkCalculated. This is because the field values are stored in the dataset. Calculated fields in a client dataset are calculated in an OnCalcFields event handler, but stored internally in the dataset. They also have a FieldKind of fkInternalCalc instead of fkCalculated. Unlike regular calculated fields, these fields can be used in filter expressions. They can also edited, but the changes are discarded. To prevent editing, set the ReadOnly property to True.

Note:	The FieldKind property of a field is only stored with the field object if the value is fkInternalCalc.


TField.FieldName

TField	See also 	Example

Indicates the name of the physical column in the underlying dataset to which a field component is bound.

property FieldName: String;

Description

When creating a field component, the TFieldDef object uses FieldName to specify which field in underlying dataset the field component represents. FieldName is used when displaying references to the field to users, unless a DisplayLabel has been set. For calculated fields, supply a FieldName when defining the field. For non-calculated fields, an EDatabaseError exception is raised if a FieldName is not a column name in the physical table.


TField.FieldNo

TField	See also

Indicates the ordinal of the field component’s column in the physical table underlying a dataset.

property FieldNo: Integer;

Description

Read FieldNo to learn a field component’s ordinal position in the table underlying the dataset, where 1 is the first field. Use the FieldNo property to specify the field only in direct API calls to the Borland Database Engine.

Note:	Do not confuse FieldNo, which is the field component’s ordinal position in the physical database table, with Index, the field components position in the dataset’s Fields property.


TField.FullName

TField	See also

Indicates field name qualified by the full name of the parent field, if any.

property FullName: string;

Description

Inspect FullName to determine the field’s name when it may be a subfield in the flattened version of a more complex object field. FullName prefixes the FieldName property with the full name of the more complex object field of which it is a part.


TField.HasConstraints

TField	See also

Indicates whether field values are constrained.

property HasConstraints: Boolean;

Description

Read HasConstraints to determine whether the field component imposes custom constraints, imported constraints, or a default expression. HasConstraints is True if the CustomConstraint, DefaultExpression, or ImportedConstraint property is set. Otherwise, HasConstraints is False, indicating that the server or database engine are not imposing any constraints on field values.

Field values can still be limited when HasConstraints is False. For example, an edit mask or OnValidate event handler can constrain field values. However, these constraints are imposed by the Delphi application, not by the server or database engine.


TField.ImportedConstraint

TField	See also

Represents an SQL clause that enforces constraints stored on the server.

property ImportedConstraint: String;

Description

Read ImportedConstraint to determine the limits imposed by the server on what values are valid for the field. ImportedConstraint is an SQL search expression such as

Value > 0 and Value < 100

Do not change the value of ImportedConstraint. To add additional constraints on the field value, use the CustomConstraint property instead. Custom constraints are imposed in addition to the imported constraints. If the server constraints change, the value of ImportedConstraint will be changed but constraints introduced in the CustomConstraint property will persist.

Removing constraints from the ImportedConstraint property will not change the validity of field values that violate those constraints. Removing constraints will result in the constraints being checked by the server instead of locally. When constraints are checked locally, the error message supplied as the ConstraintErrorMessage property is displayed when violations are found, instead of an error message from the server.


TField.Index

TField	See also

Specifies the field component’s index number into the Fields property of the dataset.

property Index: Integer;

Description

Use the Index property to:

Find the position of the field in the dataset.

Change the order of a field's position in the dataset by changing the value of Index. Changing the Index value affects the order in which fields are displayed in data grids, but not the position of the fields in the physical database tables.

Note:	The field order can also be changed by dragging and dropping fields in the Fields editor at design time.


TField.IsIndexField

TField	See also

Indicates whether a field is an index field.

property IsIndexField: Boolean;

Description

Inspect the IsIndexField to determine if a field is an index field. If IsIndex is True, a field is one of the fields that makes up the index on the underlying database table. If IsIndexField is False, the field is not an index field. A field component must be an index field to serve as one of the field components for the LookupKeyFields in a lookup table.


TField.IsNull

TField	See also

Indicates whether the field has a value assigned to it.

property IsNull: Boolean;

Description

Inspect IsNull to determine if the field contains a value. If IsNull is True, the field is blank. If IsNull is False, the field has a value.


TField.KeyFields

TField	See also

Identifies the field or fields in the dataset that must be matched in the lookup dataset when doing a lookup.

property KeyFields: String;

Description

Set KeyFields only on lookup fields (fields where FieldKind is fkLookup and Lookup is True). KeyFields specifies the field or fields to match when a lookup occurs. To use more than one field, separate each field name with a semicolon. The specified fields must be of the same types as the corresponding fields in LookupKeyFields, or the lookup fails.

The values of the KeyFields in the DataSet are matched with the values of the LookupKeyFields in the LookupDataSet to determine a particular record of the lookup table. The value of the LookupResultField on that record becomes the Value property for the field component.


TField.Lookup

TField	See also

Determines whether the field is specified as a lookup field.

property Lookup: Boolean;

Description

Lookup is provided for backward compatibility. To determine if a field is a lookup field, use the FieldKind property instead.

If the field is a lookup field, the KeyFields property indicates which fields in the dataset must match the LookupKeyFields in the LookupDataSet, to identify a record in the LookupDataSet. The value of the LookupResultField for that record becomes the Value of the field component.


TField.LookupCache

TField	See also

Determines whether the values of a lookup field are cached or looked up dynamically every time the current record in the dataset changes.

property LookupCache: Boolean;

Description

Set LookupCache to True to cache the values of a lookup field when the LookupDataSet is unlikely to change and the number of distinct lookup values is small. Caching lookup values can speed performance, because the lookup values for every set of LookupKeyFields values are preloaded when the DataSet is opened. When the current record in the DataSet changes, the field object can locate its Value in the cache, rather than accessing the LookupDataSet. This performance improvement is especially dramatic if the LookupDataSet is on a network where access is slow.

If every record of DataSet has different values for KeyFields, the overhead of locating values in the cache can be greater than any performance benefit provided by the cache. The overhead of locating values in the cache increases with the number of distinct values that can be taken by KeyFields.

If LookupDataSet is volatile, caching lookup values can lead to inaccurate results. Call RefreshLookupList to update the values in the lookup cache. RefreshLookupList regenerates the LookupList property, which contains the value of the LookupResultField for every set of LookupKeyFields values.

When setting LookupCache at runtime, call RefreshLookupList to initialize the cache.

Note:	LookupCache is only meaningful if the value of FieldKind is fkLookup.


TField.LookupDataSet

TField	See also

Identifies the dataset used to look up field values.

property LookupDataSet: TDataSet;

Description

Use LookupDataSet to specify the dataset to use for looking up field values in a field with a FieldKind of fkLookup.

When a field component is a lookup field, the Value of the field component is the value of the LookupResultField in the LookupDataSet. The record in the LookupDataSet that contains the correct value is found by matching the LookupKeyFields in the LookupDataSet with the current values of the KeyFields in the DataSet.


TField.LookupKeyFields

TField	See also

Identifies the field or fields in the lookup dataset to match when doing a lookup.

property LookupKeyFields: String;

Description

Only use LookupKeyFields on field components with a FieldKind of fkLookup. LookupKeyFields are the fields in the index of the LookupDataSet whose values must match the KeyFields in the field component’s DataSet.

To specify more than one field, separate each field name with a semicolon. The fields specified in LookupKeyFields must be of the same types as the corresponding fields in KeyFields, or the lookup can't work.

Matching the values of the LookupKeyFields in the LookupDataSet with the values of the KeyFields in the DataSet determines a specific record in the LookupDataSet. The Value of the field component is the value of the LookupResultField in the indicated record.


TField.LookupList

TField	See also

Indicates a cache of values from the LookupDataSet indexed by a set of values from the KeyFields property.

property LookupList: TLookupList;

Description

Inspect LookupList to find the cached value assigned to the field for a given set of values on the fields specified by KeyFields. The value of LookupList is set when the dataset is open or the RefreshLookupList method is called. Applications can also set the LookupList programmatically to provide lookup values when the lookup dataset does not actually exist.

The ValueOfKey method of the LookupList returns the value of the LookupResultField for a set of values on the LookupKeyFields. This allows the value of the lookup field object to be computed as follows:

Value := LookupList.ValueOfKey(DataSet.FieldValues[KeyFields]);

Note:	LookupList is only meaningful when the value of FieldKind is fklookup and the LookupCache property is True.


TField.LookupResultField

TField	See also

Identifies the field from the lookup dataset whose value becomes the Value property of the field component.

property LookupResultField: String;

Description

Use LookupResultField to specify a single field in the LookupDataSet whose value becomes the value of the field component. The field component must have a FieldKind of fkLookup, and the DataType of the field component must be the same as the data type of the LookupResultField.

When a field component is a lookup field, the Value of the field component is the value of the LookupResultField in the LookupDataSet. The record in the LookupDataSet that contains the correct value is found by matching the LookupKeyFields in the LookupDataSet with the current values of the KeyFields in the DataSet.


TField.NewValue

TField	See also

Represents the current value of the field component including pending cached updates.

property NewValue: Variant;

Description

Use NewValue to examine or change the current value to a field when in the process of posting multiple records. If the current field value is causing a problem, such as a key violation, when applying a cached update, datasets generate an OnUpdateError event. Similarly, provider components generate an OnUpdateError event when problems occur posting records from a client, and client datasets generate an OnReconcileError event when informed of problems by the server. In the event handler, assign a new value to NewValue to correct the problem.

NewValue is the same as Value, except when errors are encountered while posting records. Setting NewValue in an OnUpdateError event handler, an OnUpdateRecord event handler, or an OnReconcileError event handler will cause NewValue to differ from Value until the records have finished being posted to the underlying database table.

Note:	the NewValue property is only usable when the data is accessed using a TClientDataSet component or cached updates is enabled.


TField.Offset

TField	See also

Indicates the number of bytes added to the end of the current record buffer in the dataset for storing cached values (for calculated fields or BLOB fields).

property Offset: Integer;

Description

Read Offset to determine the extra space in the record buffer of a TClientDataSet object allocated for cached information on calculated fields or BLOB fields. Offset should only be used by component writers when developing new descendants of TClientDataSet.


TField.OldValue

TField	See also

Represents the original value of the field (as a Variant).

property OldValue: Variant;

Description

Read the OldValue property to examine or retrieve the original value of the field that was obtained from the dataset before any new values were written to the record buffer. For example, this code replaces current pending changes with a field’s original value:

NewValue := OldValue;

Once records are posted successfully, the old field value cannot be retrieved.

Note:	the OldValue property is only usable when the data is accessed using a TClientDataSet component or cached updates is enabled.


TField.Origin

TField	See also

Indicates the name of the field in its original dataset.

property Origin: String;

Description

Origin is only assigned at design time by the Fields editor, and only when the field component is used by a TQuery object. The Origin property distinguishes the name of the field as it appears in its dataset from the name of the field in the base table on which it is based. For example, in a query that uses the following SQL statement, the value of Origin is CUSTOMER.CUSTNO.

SELECT CUSTNO AS ID FROM CUSTOMER

In this case, the FieldName property is ID.


TField.ParentField

TField 	See also

Specifies the TObjectField object from which this field is derived.

property ParentField: TObjectField;

Description

Use ParentField when the field represents a subfield in the flattened version of a more complex object field. ParentField describes the object field (an Oracle8 array field or ADT).

When ParentField is nil, the field does not represent part of a more complex object field.


TField.ProviderFlags

TField 	See also

Specifies how a provider uses the field value when applying updates.

type

  TProviderFlag = (pfInUpdate, pfInWhere, pfInKey, pfHidden);

  TProviderFlags = set of TProviderFlag;

property ProviderFlags: TProviderFlags;

Description

ProviderFlags is only relevant for fields that appear in data packets. This property is a set of flags that determine how the field is used when applying updates or resolving update errors. ProviderFlags includes any of the following values:

Value	Meaning

pfInUpdate	The field is not updated when applying updates from a client application.

pfInWhere	The field is not used when locating records that should be updated.

pfInKey	The field is used when locating records after an update error occurs. The record located using this value is used to set the CurValue property.

pfHidden	The field is included in data packets to ensure the uniqueness of records so that they can be correctly updated. It can’t be seen or used by client applications.


TField.ReadOnly

TField	See also

Determines whether the field can be modified.

property ReadOnly: Boolean;

Description

Set ReadOnly to True to prevent a field from being modified. In a data grid, tabbing from field to field skips over ReadOnly fields.

To learn whether a field can be modified, use the CanModify property instead. CanModify reflects not only the value of the ReadOnly property, but also any restrictions imposed by the underlying dataset.


TField.Required

TField	See also

Specifies whether a nonblank value for a field is required.

property Required: Boolean;

Description

Use Required to find out if a field requires a value or if the field can be blank.

If a field is created with the Fields editor, then this property is set based on the underlying table. Applications that set Required to True for fields that must have values (for example, a password or part number), but for which the underlying table does not require the field, must write an OnValidate event handler to enforce the property.

When the Required property reflects a property of the underlying database table, trying to post a null value will cause an exception to be raised. Applications that set the Required property to True when the underlying table does not require the field, should raise an EDatabaseError exception on null values in the OnValidate event handler in order to achieve the same result.


TField.Size

TField	See also

Indicates the size used in the definition of the physical database field for data types that support different sizes.

property Size: Integer;

Description

The interpretation of Size depends on the data type. The meaning of Size for different data types is given in the following table:

DataType	Meaning of Size

ftBoolean	Size is not used; its value is always 0.

ftSmallInt	Size is not used; its value is always 0.

ftWord	Size is not used; its value is always 0.

ftAutoInc	Size is not used; its value is always 0.

ftDate	Size is not used; its value is always 0.

ftInteger	Size is not used; its value is always 0.

ftTime	Size is not used; its value is always 0.

ftCurrency	Size is not used; its value is always 0.

ftDateTime	Size is not used; its value is always 0.

ftFloat	Size is not used; its value is always 0.

ftBCD	Size is the number of digits after the decimal place.

ftString	Size is the maximum number of characters in the string.

ftVarBytes	Size is the maximum number of bytes of data, not counting the first two bytes which indicate the actual number of bytes of data that were used.

ftBytes	Size is the maximum number of bytes of data.

ftBlob	Size is the number of bytes from the BLOB that are stored in the record buffer.

ftDBaseOle	Size is the number of bytes from the DBase OLE BLOB that are stored in the record buffer.

ftFmtMemo	Size is the number of bytes from the memo that are stored in the record buffer.

ftGraphic	Size is the number of bytes from the image that are stored in the record buffer.

ftMemo	Size is the number of characters from the memo that are stored in the record buffer.

ftParadoxOle	Size is the number of bytes from the Paradox OLE BLOB that are stored in the record buffer.

ftTypedBinary	Size is the number of bytes from the BLOB that are stored in the record buffer.

ftUnknown	Size is not used; its value is always 0.

ftCursor	Size is not used; its value is always 0.

ftADT	Size is the total number of fields contained in the ADT field, including the fields of any fields that are of type ADT.

ftArray

ftReference	Size is not used; its value is always 0.

ftDataSet	Size is not used; its value is always 0.


TField.Text

TField	See also

Contains the string to display in a data-aware control when the field is in edit mode.

property Text: String;

Description

Data-aware controls rely on the Text property to provide the editing format for each field. For example, by default the Text property of a currency field omits the thousands separators and currency symbol.

Text can differ from the DisplayText property if the field should have a different string representation when the value is being edited. To implement two different string representations of a field’s value, use the OnGetText event handler. If an OnGetText event handler is assigned, Text is the value returned in the Text parameter of the OnGetText event handler when the DisplayText parameter is False. Otherwise, Text is the value of the AsString property.


TField.ValidChars

TField	See also

Specifies the characters that can be included in the text representation of the field’s value.

type TFieldChars = set of Char;

property ValidChars: TFieldChars;

Description

Set ValidChars to restrict the characters that can be validly entered as part of the text representation of the field’s value. ValidChars is used by the IsValidChar method to determine whether a character typed into a data-aware edit control can make up part of the field’s value. Unlike the EditMask property which specifies which characters can appear in specific positions, ValidChars limits the characters that can appear anywhere in the field’s value.

TField initializes ValidChars to include all characters. Numeric descendants of TField change the default value to include only the characters that can make up a numeric value. Applications can change this value to restrict the character set for a field in other ways or to allow characters that are not permitted by default.


TField.Value

TField	See also 	Example

Represents the data in a field component.

property Value: Variant

Description

Use Value to read data directly from and write data directly to a field component at runtime. For example, use the Value property to affect the contents of a field that is not Visible.


TField.Visible

TField	See also

Determines whether the field appears in a data grid.

property Visible: Boolean;

Description

To hide a field in a data grid, set Visible to False. If Visible is True, the field appears in the grid.

Note:	The Visible property has no effect if the grid has an explicit Columns value for the field. It also has no effect on controls other than TDBGrid, such as TDBEdit.


TField events

TField	Alphabetically	Legend

In TField

OnChange

OnGetText

OnSetText

OnValidate


TField events

TField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TField.OnChange

TField	See also

Occurs immediately after the data in the field is written to the record buffer.

type TFieldNotifyEvent = procedure(Sender: TField of object;

property OnChange: TFieldNotifyEvent;

Description

Write an OnChange event handler to respond to any changes in the field’s data. OnChange allows a response once the data has been successfully written to the record buffer.

When writing the value of a field to the current record buffer, the following steps occur:

1	The OnValidate event handler is called to validate the data.

2	If the OnValidate event handler accepts the current Value, the data is written to the record buffer.

3	If writing the data does not raise an exception, the OnChange event handler is called to allow a response to the change.


TField.OnGetText

TField	See also

Occurs whenever the DisplayText or Text properties of the field are referenced.

type TFieldGetTextEvent = procedure(Sender: TField; var Text: String; DisplayText: Boolean) of object;

property OnGetText: TFieldGetTextEvent;

Description

Write an OnGetText handler to perform custom processing for the DisplayText and Text properties. Use OnGetText to format the Value of the field differently when it must be edited from the format used when simply displaying the value, or use OnGetText to display something other than the field’s value when it is displayed.

The Sender parameter is the field component. The Text parameter receives the formatted text that is used by the DisplayText or Text property. The DisplayText parameter indicates whether the text will be used for display purposes only, or whether the string will be used for editing purposes.

If there is no OnGetText handler, the value of the DisplayText and Text properties is simply the value of the AsString property.


TField.OnSetText

TField	See also

Occurs when the Text property is assigned a value.

type TFieldSetTextEvent = procedure(Sender: TField; const Text: String) of object;

property OnSetText: TFieldSetTextEvent;

Description

Write an OnSetText event handler to specify processing that occurs whenever Text receives a new value. If there is an OnGetText event handler that formats the Value of the field in some special way for editing purposes, OnSetText should reverse the process when parsing the edited string.

If there is no OnSetText handler, the Text property will be set by setting the AsString property.


TField.OnValidate

TField	See also

Occurs just before the data is written to the record buffer.

type TFieldNotifyEvent = procedure(Sender: TField) of object;

property OnValidate: TFieldNotifyEvent;

Description

Write an OnValidate event handler to validate changes made to the data in the field, just before the data is written to the current record buffer. The EditMask property allows validation of the data on a character by character basis while it is being entered by the user. OnValidate allows an application to validate the data as a whole.

When the value of a field component is assigned programmatically, validation by the EditMask is bypassed, since there is no data-aware control to enforce adherence to the mask. OnValidate allows an application to validate such data before it is posted to the database table.

To reject the current value of the field from the OnValidate event handler, raise an exception.

When writing the value of a field to the current record buffer, the following steps occur:

1	The OnValidate event handler is called to validate the data.

2	If the OnValidate event handler does not raise an exception, the data is written to the current record buffer.

3	If writing the data does not raise an exception, the OnChange event handler is called to allow a response to the change.


TField methods

TField	Alphabetically

In TField

Assign

AssignValue

Clear

Create

Destroy

FocusControl

GetData

GetParentComponent

HasParent

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TField methods

TField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TField.Assign

TField	See also 	Example

Copies the Value property of one field to another or assigns another object to the field component.

procedure Assign(Source: TPersistent);

Description

Use Assign to copy the Value property from one field to another. The fields must have compatible data types.

When Source is another field object, Assign calls the AssignValue method, using the Source field’s Value property. Calling Assign with the Source parameter set to nil assigns a blank value to the field component. Calling Assign with any other object type calls the inherited method, which allows assignment from objects that implement a TField object in their AssignTo method.


TField.AssignValue

TField	See also

Sets the field value using one of the AsInteger, AsBoolean, AsString or AsFloat properties.

procedure AssignValue(const Value: TVarRec);

Description

Use AssignValue to assign a value to a field using the As... conversion properties. The property used depends on the type of the Value parameter:

Value	As... property used

vtInteger	AsInteger

vtBoolean	AsBoolean

vtChar	AsString

vtExtended	AsFloat

vtString	AsString

vtPChar	AsString

vtAnsiString	AsString

vtCurrency	AsCurrency

vtVariant	AsVariant

If Value is not one of the types in the table, but is of type TObject or a TObject descendant, AssignValue uses the Assign method to assign the value to the field.


TField.Clear

TField	See also

Sets the value of the field to NULL.

procedure Clear;

Description

Call the Clear method to give the field a blank value (a NULL value in SQL terms).


TField.Create

TField	See also

Creates and initializes a field component.

constructor Create(AOwner: TComponent); override;

Description

Do not create TField instances. TField is an abstract base class which should not be directly instantiated. The constructor for descendant classes is usually called indirectly by using the Fields editor at design time to create a persistent field component. Dataset objects also call field constructors automatically to create dynamic field components.

After calling the inherited constructor, TField initializes the Visible property to True.


TField.Destroy

TField	See also

Destroys an instance of TField.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Destroy is called automatically by the dataset that owns the field component, and applications never need to call it explicitly. If an application creates a descendant of TField without an owner, it should call Free instead of Destroy, to guard against nil values.

Destroy closes the dataset, deletes the instance of TField from the dataset, and calls the inherited destructor.


TField.FocusControl

TField	See also

Forces a form’s focus to the first data-aware component associated with the field object.

function FocusControl;

Description

Call FocusControl to switch the focus of the form to a data-aware control associated with the field. Because it is possible that the field’s value can change even if its associated data-aware control does not have the focus, calling FocusControl can aid in drawing attention to the new value when it fails to be validated.


TField.GetData

TField	See also	Example

Returns the unformatted data from the field.

function GetData(Buffer: Pointer; NativeFormat:Boolean=True: Boolean;

Description

Call GetData to return the uninterpreted data in a field to a buffer. Unlike the DisplayText, Text, or AsXXX properties, GetData does not translate the data into a specific type. Instead, it uses a type that reflects the underlying database information.

Buffer must have sufficient space allocated for the data. Use the DataSize property to determine the space required.

NativeFormat indicates whether the raw database information must be translated into the underlying type associated with the specific type of database field. When NativeFormat is True, the dataset does not need to translate the raw database information. When NativeFormat is False, the dataset must translate the field value into the type associated with the field.

If the data is NULL, GetData returns False and no data is transferred to Buffer. Otherwise, GetData returns True.

Note:	GetData cannot be used to read data from BLOB or memo fields. Use such means as a TBlobStream object or the SaveToStream method.


TField.GetParentComponent

TField	See also

Returns the component which directs the loading and saving of the field.

function GetParentComponent: TComponent; override;

Description

The streaming system that loads and saves components calls GetParentComponent to identify the component which uses this field to represent one of its parts. If the field represents a subfield in an object field, GetParentComponent returns the value of ParentField. Otherwise, GetParentComponent returns the value of DataSet.


TField.HasParent

TField	See also

Returns True, indicating that field components act as part of a larger composite.

function HasParent: Boolean; override;

Description

The streaming system that loads and saves components calls HasParent to determine when a component acts as part of a composite. The component that represents the entire composite is returned by the GetParentComponent method. This parent component is responsible for directing the loading and saving of its subcomponents.


TField.IsBlob

TField	See also 	Example

Indicates whether the field represents the data in a binary large object (BLOB) field.

class function IsBlob: Boolean; virtual;

Description

Call IsBlob to determine whether the field represents BLOB data. For example, before using the GetData or SetData method, call IsBlob to determine whether the method can be used. The IsBlob method for TField always returns False. Descendants of TField that implement blob fields override this method to indicate that they represent BLOB data.


TField.IsValidChar

TField	See also

Indicates whether a particular character is valid for the field.

function IsValidChar(InputChar: Char): Boolean; virtual;

Description

Call IsValidChar to determine if a character specified as the value of the InputChar can appear in the text representation of the value of the field. Many data-aware controls use IsValidChar to check characters entered by the user to determine if they are valid. IsValidChar returns True if InputChar can appear in the field. IsValidChar returns False if InputChar is not a valid character for the field type.

The valid characters for a field object are given by the ValidChars property. The default valid characters for each DataType are given in the following table.

DataType	Valid characters

ftBoolean	All characters.

ftSmallInt	Digits 0 to 9, plus sign (+), and minus sign (-).

ftWord	Digits 0 to 9, plus sign (+), and minus sign (-)

ftAutoInc	Digits 0 to 9, plus sign (+), and minus sign (-)

ftDate	All characters.

ftInteger	Digits 0 to 9, plus sign (+), and minus sign (-)

ftTime	All characters

ftCurrency	Digits 0 to 9, plus sign (+), minus sign (-), the letter E (E or e) and the decimal separator from the regional settings in the Windows control panel.

ftDateTime	All characters.

ftFloat	Digits 0 to 9, plus sign (+), minus sign (-), the letter E (E or e) and the decimal separator from the regional settings in the Windows control panel

ftBCD	Digits 0 to 9, plus sign (+), minus sign (-), and the decimal separator from the regional settings in the Windows control panel.

ftString	All characters.

ftVarBytes	All characters.

ftBytes	All characters.

ftBlob	All characters.

ftDBaseOle	All characters.

ftFmtMemo	All characters.

ftGraphic	All characters.

ftMemo	All characters.

ftParadoxOle	All characters.

ftTypedBinary	All characters.

ftUnknown	All characters.

ftCursor	All characters.

Note:	For some DataTypes, such as ftGraphic, IsValidChar returns True for all characters although not every character is valid for the field. IsValidChar provides only a rough validation of input characters. More refined character-by-character validation can be provided by an edit mask. Also, the value for a field is validated as a whole when it is written to the database record.


TField.RefreshLookupList

TField	See also

Loads LookupList with all the values for LookupResultField that match distinct values of LookupKeyFields.

procedure RefreshLookupList;

Description

Call RefreshLookupList to load the lookup cache when setting the LookupCache property at runtime or when the values of the LookupResultField or the LookupKeyFields in the LookupDataSet may have changed.


TField.SetData

TField	See also	Example

Assigns unformatted data to the field.

procedure SetData(Buffer: Pointer, NativeFormat: Boolean=True);

Description

Use SetData to assign data to a field in the format that is used by the underlying database table. Ultimately, any method of setting the data for the field component calls SetData, once the data has been parsed into the format expected by the database table.

SetData calls the OnValidate event handler before writing the data to the current record buffer. If the data is successfully written, SetData calls the OnChange event handler.

Buffer contains the field value in the field components underlying type. NativeFormat indicates whether the value in Buffer must be translated before the dataset assign its value to its internal record.

Note:	SetData should not be used by descendants of TField that implement BLOB or memo field types. Instead, use a TBlobStream object or the LoadFromStream method.


TField.SetFieldType

TField	See also

Provides the interface for a method that can set the DataType for the field.

procedure SetFieldType(Value: TFieldType);

Description

SetFieldType does nothing other than provide an interface for derived classes to override to implement a method that sets the DataType for the field component. SetFieldType is useful for derived classes that can support more than one underlying data type. For example, a TBlobField may support ftBlob, ftFmtMemo, ftParadoxOle, ftDBaseOle, or ftTypedBinary.


TField.Validate

TField	See also

Generates an OnValidate event.

procedure Validate(Buffer: Pointer);

Description

Call Validate to validate the unformatted data pointed to by the Buffer parameter. Validate is called by the dataset when writing new values to the current record.

Before calling the OnValidate event handler, Validate sets up the unformatted data in Buffer so that the properties that represent the field’s value will return formatted versions of this value. The value of Buffer does not affect the value of the field outside the OnValidate event handler.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TFieldDef

Hierarchy	Properties	Methods	See also

TFieldDef is a field definition that corresponds to a physical field of a record in a table underlying a dataset.

Unit

db

Description

A TFieldDef object contains the definition of one field in a table. The definition for a field includes such attributes as the field’s name, data type, and size. TFieldDef objects are typically used in collections of such objects, such as the FieldDefs property of the TDataSet component.

When using an existing table, a field definition is automatically created for each field in the dataset. Inspect the properties of TFieldDef to retrieve information about specific fields in the dataset.

When creating new tables, such as with the TTable.CreateTable method, TFieldDef objects are used to supply the definitions for the new fields that will comprise the new table.

A field definition has a corresponding TField object, but not all TField objects have a corresponding field definition object. For example, calculated fields do not have field definition objects.

There are two primary reasons for working with TFieldDef objects:

To obtain information about field types in a table without opening the table.

To specify field definitions for a new table.


TFieldDef properties

TFieldDef	Alphabetically	Legend

In TFieldDef

Attributes

ChildDefs

DataType

FieldClass

FieldNo

InternalCalcField

ParentDef

Precision

Required

Size

Derived from TNamedItem

DisplayName

Name

Derived from TCollectionItem

Collection

ID

Index


TFieldDef properties

TFieldDef	By object	Legend

Attributes

ChildDefs

Collection

DataType

DisplayName

FieldClass

FieldNo

ID

Index

InternalCalcField

Name

ParentDef

Precision

Required

Size


TFieldDef.Attributes

TFieldDef	See also

Identifies attributes of the field associated with the field def.

type

  TFieldAttribute = (faHiddenCol, faReadonly, faRequired, faLink, faUnNamed, faFixed);

  TFieldAttributes = set of TFieldAttribute;

property Attributes: TFieldAttributes;

Description

Contains attributes for the field that the TFieldDef object defines.

Value	Meaning

faHiddenCol	Internal flag for hidden columns returned by live queries.

faReadonly	Indicates whether the physical field in the underlying table is read-only.

faRequired	Indicates whether a value for the physical field in the underlying table is required.

faLink	Internal flag for nested datasets.

faUnNamed	Internal use only. Indicates a TObjectField in a nested table that has no name associated with it.

faFixed	Indicates that the field has a fixed size.


TFieldDef.ChildDefs

TFieldDef	See also

Specifies the TFieldDefs object that contains an array of child fields.

property ChildDefs: TFieldDefs;

Description

If the field that the TFieldDef object represents is an object field such as TADTField or TArrayField, child fields of the object field are stored in the TFieldDefs array referenced by the ChildDefs property.


TFieldDef.DataType

TFieldDef	See also

Determines the type of a physical field.

property DataType: TFieldType;

Description

Use DataType to find out what type of data the field contains. When adding field definitions to a dataset, set DataType to specify what type of field is being defined.


TFieldDef.FieldClass

TFieldDef	See also

Determines the class of the field object that corresponds to this field definition object.

type TFieldClass = class of TField;

property FieldClass: TFieldClass;

Description

Use FieldClass to find out the class of field object this field definition object corresponds to. The FieldClass is determined by the DataType of the field. For example, if the DataType is ftString, the FieldClass is TStringField.

The field object created from a field definition by the CreateField method is an instance of the FieldClass.

FieldClass is a read-only property.


TFieldDef.FieldNo

TFieldDef	See also

Identifies the physical field number used to reference the field.

property FieldNo: Integer;

Description

Use FieldNo to find out where the physical field the field definition references is in the set of fields in the table. For example, if the value of FieldNo is 2, then the field is the second field in the table.

When adding field definitions to a dataset, set FieldNo to specify the location at which the field will be created.


TFieldDef.InternalCalcField

TFieldDef	See also

Determines if the field is a field whose value is calculated by the data source.

property InternalCalcField: Boolean;

Description

Read InternalCalcField to find out if the field represents a value provided by the data source that is not a field in the physical database table. Internally calculated fields are calculated by SQL servers or the Borland Database Engine in a live query view.

For example, in the following SQL statement, the dataset includes a field for the calculated value ONHAND * COST.

SELECT PartNo, Description, OnHand, Cost, (OnHand * Cost)

FROM PARTS

When the TQuery object has its RequestLive property set to True, the field definition for that calculated value will have InternalCalcField set to True.

InternalCalcField is a read-only property.


TFieldDef.ParentDef

TFieldDef	See also

The ParentDef property references the parent field definition for the field def, if one exists.

property ParentDef: TFieldDef;

Description

If the TFieldDef object is the field definition of the child field of an object field, such as an ADT field, or an array field, then ParentDef references the parent object’s field definition.


TFieldDef.Precision

TFieldDef	See also

Specifies the number of digits of accuracy used to store the field value.

property Precision: Integer;

Description

When defining a BCD field, set Precision to the total number of digits stored for each field value. The value of Precision is ignored unless DataType is ftBCD.


TFieldDef.Required

TFieldDef	See also

Indicates whether a value for the physical field in the underlying table is required.

property Required: Boolean;

Description

Use Required to find out if a field in a table must have a value. If Required is True, the field must have a value. If Required is False, the field can be left blank.

When adding field definitions to a dataset, set Required to specify whether new field will be required.


TFieldDef.Size

TFieldDef	See also

Reports the size associated with the field in the physical database table.

property Size: Integer;

Description

Use Size to determine the size associated with the corresponding physical field.

Size is meaningful only for a field definition object with one of the following TFieldType values: ftString, ftBCD, ftBytes, ftVarBytes, ftBlob, ftMemo or ftGraphic. For string and byte fields, Size is the number of bytes reserved in the table for the field. For a BCD field, Size is the number of digits following the decimal point. For a BLOB, memo, or graphic field, Size is the number of bytes from the field’s value that are stored in the actual database table.


TFieldDef methods

TFieldDef	Alphabetically

In TFieldDef

AddChild

Assign

Create

CreateField

Destroy

HasChildDefs

Derived from TCollectionItem

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TFieldDef methods

TFieldDef	By object

AddChild

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

CreateField

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

HasChildDefs

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TFieldDef.AddChild

TFieldDef	See also

Adds a new TFieldDef object to the ChildDefs array.

function AddChild: TFieldDef;

Description

Use AddChild to add a new field definition for a child field of the TFieldDef object’s field.


TFieldDef.Assign

TFieldDef	See also

Copies the properties of one field definition to another.

procedure Assign(Source: TPersistent); override;

Description

Call Assign to copy a field definition. Assign checks whether the Source parameter specifies another field definition, and if so, copies the values of the Name, DataType, Size, Precision, and InternalCalcField properties. Note that the value of FieldNo is not changed.

If the source is not a field definition, Assign calls the inherited method, which assigns properties from any object that specifies how to copy to a field definition in its AssignTo method.


TFieldDef.Create

TFieldDef	See also

Creates and initializes a TFieldDef instance.

constructor Create(Owner: TFieldDefs; const Name: String; DataType: TFieldType; Size: Integer; Required: Boolean; FieldNo: Integer); reintroduce; overload;

Description

Applications should not call Create directly. A TFieldDef is created automatically by the dataset for each field in an already existing table. When composing field definitions preparatory to creating a new table, the TFieldDefs.AddFieldDef method (or the older TFieldDefs.Add method) creates the needed instance of TFieldDef.


TFieldDef.CreateField

TFieldDef	See also

Creates a TField component that matches the specifications of the TFieldDef object.

function CreateField(Owner: TComponent; ParentField: TObjectField= nil; const FieldName: String= ''; CreateChildren: Boolean= True): TField;

Description

A dataset object calls CreateField to create the field components from the field definitions objects. Applications need never call CreateField directly.


TFieldDef.Destroy

TFieldDef	See also

Destroys the TFieldDef instance and frees its memory.

destructor Destroy; override;

Description

Destroy calls the inherited Destroy method, and then frees and child field definition objects.

An application will seldom need to destroy a TFieldDef object using this method. Instead, call the Free method, inherited from TObject.


TFieldDef.HasChildDefs

TFieldDef	See also

Indicates whether the field of the TFieldDef object has any child field definitions.

function HasChildDefs: Boolean;

Description

If the TFieldDef object defines an object field, such as TADTField or TArrayField, HasChildDefs will return True.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem

TNamedItem


TFieldDefs

Hierarchy	Properties	Methods	See also

TFieldDefs holds the field definition (TFieldDef) objects that represent the physical fields underlying a dataset.

Unit

db

Description

TFieldDefs is used by a dataset to manage the field definitions it uses to create field objects that correspond to fields in the database table. TTable and TClientDataSet objects also use TFieldDefs when creating a new database table.

TFieldDefs with object field types, such as TADTField and TArrayField, have TFieldDef objects for these object types that contain FieldDefs to hold the TFieldDef objects of their child fields. This is a hierarchical representation of the data, which is in contrast to a TFieldDefList, which lists the child TFieldDef objects of object fields sequentially after the parent TFieldDef.

Use the properties and methods of TFieldDefs to:

Access a specific field definition.

Add or delete field definitions from the list (new tables).

Find out how many fields are defined.

Copy a set of field definitions to another table.


TFieldDefs properties

TFieldDefs	Alphabetically	Legend

In TFieldDefs

HiddenFields

Items

ParentDef

Derived from TDefCollection

DataSet

Updated

Derived from TCollection

Count

ItemClass


TFieldDefs properties

TFieldDefs	By object	Legend

Count

DataSet

HiddenFields

ItemClass

Items

ParentDef

Updated


TFieldDefs.HiddenFields

TFieldDefs	See also

Determines whether to show the extra hidden columns that the BDE returns in a live query.

property HiddenFields: Boolean;

Description

When the user performs a live query, the BDE returns extra hidden columns in the query result set. These extra columns ensure that each record contains enough information to locate the corresponding record in the underlying dataset. Setting HiddenFields to True and calling TFieldDefs.Update allows these columns to be seen. HiddenFields is primarily for internal use.


TFieldDefs.Items

TFieldDefs	See also	Example

Lists the field definitions that describe each physical field in the dataset.

property Items[Index: Integer]: TFieldDef; default;

Description

Use Items to access a particular field definition. Specify the field definition to access with the Index parameter. Index is an integer identifying the field definition’s position in the list of field definitions, in the range 0 to Count - 1.

FieldNameVar := Table1.FieldDefs.Items[0].DisplayName;


TFieldDefs.ParentDef

TFieldDefs	See also

References the field definition of the parent field, if there is one.

property ParentDef: TFieldDef;

Description

When a TFieldDefs object represents the data members of an object field type (such as TADTField), ParentDef specifies the field definition for that object field. Otherwise, ParentDef returns nil.


TFieldDefs methods

TFieldDefs	Alphabetically

In TFieldDefs

Add

AddFieldDef

Create

Find

Update

Derived from TDefCollection

GetItemNames

IndexOf

Derived from TCollection

Assign

BeginUpdate

Clear

Delete

Destroy

EndUpdate

FindItemID

GetNamePath

Insert

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TFieldDefs methods

TFieldDefs	By object

Add

AddFieldDef

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

Find

FindItemID

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetItemNames

GetNamePath

IndexOf

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

Update


TFieldDefs.Add

TFieldDefs	See also	Example

Creates a new field definition object and adds it to the Items property of this TFieldDefs object.

procedure Add(const Name: String; DataType: TFieldType; Size: Integer = 0; Required: Boolean = False);

Description

Add is provided for backward compatibility.  The recommended way to add new field definitions to the Items property array is using the AddFieldDef method.

Add uses the values passed in the Name, DataType, Size, and Required parameters and assigns them to the respective properties of the new field definition object.

If a field definition with same name already exists, an EDatabaseError exception is raised.


TFieldDefs.AddFieldDef

TFieldDefs	See also	Example

Creates a new field definition object and adds it to the Items property of this TFieldDefs object.

function AddFieldDef: TFieldDef;

Description

Call AddFieldDef to add field definitions when creating a database table. AddFieldDef returns the new TFieldDef object that was added to the FieldDefs collection of field definitions. After calling AddFieldDef, set the properties of the newly added TFieldDef object to specify the name, type, and size of field that should be created.

Note:	AddFieldDef is only valid in the context of creating field definitions for a table to be created with a subsequent call to the CreateTable or CreateDataSet method. It cannot be used to add fields to an already-existing table.


TFieldDefs.Create

TFieldDefs	See also

Creates an instance of TFieldDefs.

constructor Create(AOwner: TPersistent);

Description

Applications should not need to call Create directly. TFieldDefs objects are created automatically by dataset components. An example of such a default TFieldDefs object is the FieldDefs property of the TDataSet component.


TFieldDefs.Find

TFieldDefs	See also

Locates a field definition in the Items array from the name of the field.

function Find(const Name: String): TFieldDef;

Description

Call Find to obtain information about a particular field definition. Specify the name of the field as the value of the Name parameter.

If no matching field is found, an exception is raised. The IndexOf method (inherited from TDefCollection) can be used to determine if the field exists first before calling Find. If IndexOf returns a value greater than –1, the TFieldDef exists and Find can be used.


TFieldDefs.Update

TFieldDefs	See also

Refreshes the field definitions in the Items property array to reflect the current state of the physical fields underlying the dataset.

procedure Update; reintroduce;

Description

Call Update to refresh the field definitions when the structure of the underlying dataset may have changed. Update updates the field definitions without opening the dataset.

Before updating, the Updated property is checked to determine if the list is already up to date. You can force the list to be regenerated by setting the Updated property to False.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection

TOwnedCollection

TDefCollection


TFieldList

Hierarchy	Properties	Methods	Events

TFieldList contains a list of field names used to access the field (TField) objects stored in the dataset’s Fields property.

Unit

Db

Description

TFieldList is used by a dataset to create a complete list of field names that correspond to fields in the database table.

The field names in the list are listed sequentially, or flattened out, meaning any child fields of an object field type (such as TADTField), appear after the object field in the list.


TFieldList properties

TFieldList	Alphabetically	Legend

In TFieldList

Fields

Derived from TFlatList

Count

DataSet

Derived from TStringList

Capacity

Duplicates

Objects

Sorted

Strings

Derived from TStrings

CommaText

Names

StringsAdapter

Text

Values


TFieldList properties

TFieldList	By object	Legend

Capacity

CommaText

Count

DataSet

Duplicates

Fields

Names

Objects

Sorted

Strings

StringsAdapter

Text

Values


TFieldList.Fields

TFieldList	See also

Lists the field references.

property Fields[Index: Integer]: TField;

Description

Use Fields to obtain a pointer to a specific field in the list. The Index parameter indicates the index of the field, where 0 is the index of the first field, 1 is the index of the second field, and so on.

Use Fields with the Count property to iterate through all of the fields in the list.


TFieldList events

TFieldList	Alphabetically

Derived from TStringList

OnChange

OnChanging


TFieldList events

TFieldList	By object

OnChange

OnChanging


TFieldList methods

TFieldList	Alphabetically

In TFieldList

FieldByName

Find

In TFlatList

Create

Update

Derived from TStringList

Add

Clear

Delete

Destroy

Exchange

IndexOf

Insert

Sort

Derived from TStrings

AddObject

AddStrings

Append

Assign

BeginUpdate

EndUpdate

Equals

GetText

IndexOfName

IndexOfObject

InsertObject

LoadFromFile

LoadFromStream

Move

SaveToFile

SaveToStream

SetText

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TFieldList methods

TFieldList	By object

Add

AddObject

AddStrings

AfterConstruction

Append

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Dispatch

EndUpdate

Equals

Exchange

FieldAddress

FieldByName

Find

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetText

IndexOf

IndexOfName

IndexOfObject

InheritsFrom

InitInstance

Insert

InsertObject

InstanceSize

LoadFromFile

LoadFromStream

MethodAddress

MethodName

Move

NewInstance

SafeCallException

SaveToFile

SaveToStream

SetText

Sort

Update


TFieldList.FieldByName

TFieldList	See also

Finds a field based on a specified field name.

function FieldByName(const FieldName: string): TField;

Description

Call FieldByName to retrieve field information for a field when only the field’s name is known. FieldName is the name of an existing field. FieldByName returns the TField component for the specified field. An application can access specific properties and methods of the field directly.


TFieldList.Find

TFieldList	Methods

Searches for a specified field object in the TFieldList object.

function FindField(const FieldName: string): TField;

Description

Call Find to determine if a specified field component is referenced in the TFieldList object. FieldName is the name of the field for which to search. If Find finds a field with a matching name, it returns the TField component for the specified field. Otherwise it returns nil.

FindField is a useful function to call prior to calling other TFieldList methods, such as FieldByName, that require a valid field name as a parameter.

If the field does not exist, an exception is raised.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TStrings

TStringList·

TFlatList

TFieldList


TFields

Hierarchy	Properties	Methods

TFields holds the field (TField) objects that represent the physical fields underlying a dataset or an object field such as TADTField and TArrayField.

Unit

Db

Description

TFields is used by a dataset to manage the field objects that correspond to fields in the database table and also by object fields to manage child fields.

When TDataSet.ObjectView is True, the fields are stored hierarchically, meaning any child fields of an object field are referenced by the object field and do not appear sequentially after the object field in the Fields array. When TDataSet.ObjectView is False, the fields are stored sequentially, or flattened out, meaning any child fields of an object field are stored sequentially in the Fields array.

Use the properties and methods of TFields to:

Access a specific field.

Add or delete fields from the list.

Find out how many fields there are.


TFields properties

TFields	Alphabetically	Legend

In TFields

Count

DataSet

Fields


TFields properties

TFields	By object	Legend

Count

DataSet

Fields


TFields.Count

TFields	See also

Represents the number of fields in the fields object.

property Count: Integer;

Description

Use Count to determine the number of fields referenced by the TFields object.


TFields.DataSet

TFields	See also

Identifies the dataset to which a TFields object belongs.

property DataSet: TDataSet;

Description

Check the value of the DataSet property to determine the dataset that is associated with the TFields object. Applications should not directly assign the DataSet property of a field. It is assigned automatically when the field is created from a TFieldDef object.


TFields.Fields

TFields	See also

Lists the field references that are managed by the TFields object.

property Fields[Index: Integer]: TField;

Description

Use Fields to obtain a pointer to a specific field in the array. The Index parameter indicates the index of the field, where 0 is the index of the first field, 1 is the index of the second field, and so on.

Set Fields to assign the properties of another field component to one of the fields in the list.

Use Fields with the Count property to iterate through all of the fields in the list.


TFields methods

TFields	Alphabetically

In TFields

Add

CheckFieldName

CheckFieldNames

Clear

Create

Destroy

FieldByName

FieldByNumber

FindField

GetFieldNames

IndexOf

Remove

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TFields methods

TFields	By object

Add

AfterConstruction

BeforeDestruction

CheckFieldName

CheckFieldNames

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

FieldByName

FieldByNumber

FindField

Free

FreeInstance

GetFieldNames

GetInterface

GetInterfaceEntry

GetInterfaceTable

IndexOf

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Remove

SafeCallException


TFields.Add

TFields	See also

Inserts a new field to the end of the Fields array.

procedure Add(Field: TField);

Description

Applications do not normally call the Add method directly. When field objects are created, Add is called automatically by the dataset.


TFields.CheckFieldName

TFields	See also

Checks to see if a field name already exists in the TFields object.

procedure CheckFieldName(const FieldName: String);

Description

Applications do not normally call the CheckFieldName method directly. If the field with the specified name already exists in the TFields object, an EDatabaseError exception is raised with a duplicate field name error message.


TFields.CheckFieldNames

TFields	See also

Checks to see if fields exist in the TFields object.

procedure CheckFieldNames(const FieldNames: String);

Description

Applications do not normally call the CheckFieldNames method directly. If any of the fields in FieldNames do not exist in the TFields object, an EDatabaseError exception is raised with a field not found error message.


TFields.Clear

TFields	See also

Deletes all fields from the TFields object.

procedure Clear;

Description

Applications do not normally call the Clear method directly. Clear also frees the memory used to store the Fields array and sets the DataSet property to nil.


TFields.Create

TFields	See also

Creates an instance of TFields.

constructor Create(ADataSet: TDataSet);

Description

Call Create to instantiate a TFields object at runtime. Most applications do not need to create a TFields object because a dataset’s TObjectField descendant (such as TADTField, TReferenceField, and TArrayField) automatically creates it.


TFields.Destroy

TFields	See also

Destroys an instance of TFields.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the TFields reference is not nil, and only then calls Destroy.

Destroy frees the memory used to store the list of fields.

Note:	Destroy does not free the memory pointed to by the elements of the list.


TFields.FieldByName

TFields	See also

Finds a field based on a specified field name.

function FieldByName(const FieldName: String): TField;

Description

Call FieldByName to retrieve field information for a field when only the field’s name is known. FieldName is the name of an existing field. FieldByName returns the TField component for the specified field. If the field can not be found, an exception is raised.

An application can access specific properties and methods of the field directly. For example, the following statement assigns the contents of an edit box to a child field of an ADT field:

TADTField(Table1.FieldByName('ADDRESS')).Fields.FieldByName('STREET').Value := Edit1.Text;

FieldByName is especially useful at design time for developers who are creating database applications, but who do not have access to the underlying table and therefore cannot use persistent field components.


TFields.FieldByNumber

TFields	See also

Finds a field based on a specified field number.

function FieldByNumber(FieldNo: Integer): TField;

Description

Call FieldByNumber to retrieve field information for a field when only the position of the field in the fields object is known.


TFields.FindField

TFields	See also

Searches for a specified field object in the TFields object.

function FindField(const FieldName: String): TField;

Description

Call FindField to determine if a specified field component is referenced in the TFields object. FieldName is the name of the field for which to search. If FindField finds a field with a matching name, it returns the TField component for the specified field. Otherwise it returns nil.

FindField is a useful function to call prior to calling other TFields methods, such as FieldByName, that require a valid field name as a parameter.


TFields.GetFieldNames

TFields	See also

Retrieves a list of names for all fields in a fields object.

procedure GetFieldNames(List: TStrings);

Description

Call GetFieldNames to get a list of names for all fields in a fields object. List is a TStrings (or compatible) object created and maintained by the application.

Retrieving a list of field names is especially useful for applications that work with datasets whose field objects are created dynamically at runtime. By retrieving a list of field names, the application can be restricted to working only with fields that exist at runtime.


TFields.IndexOf

TFields	See also

Finds the index number of a field object in the Fields array from the field object.

function IndexOf(Field: TField): Integer;

Description

Call IndexOf to get the index for a field in the Fields array. Specify the field as the Field parameter.

The first field in the array has index 0, the second field has index 1, and so on. If a field is not in the Fields array, IndexOf returns -1.


TFields.Remove

TFields	See also

Deletes the reference to the Field parameter from the Fields array.

procedure Remove(Field: TField);

Description

Applications do not normally call the Remove method directly. After a field is removed, all of the items that follow it are moved up in index position and the Count is reduced by one.


Accessibility

Read-only


Hierarchy

TObject

TFields


 TFileListBox

Hierarchy	Properties	Methods	Events	See also

TFileListBox is a specialized list box that lists all the files in a specified directory.

Unit

filectrl

Description

Add TFileListBox to a form to allow users to select a file. Use TFileListBox along with TDriveComboBox, TFilterComboBox, and TDirectoryListBox to add full file selection capabilities to a form.

Note:	To add a standard Windows 95 file open or save dialog to an application, use TOpenDialog or TSaveDialog instead.


TFileListBox properties

TFileListBox	Alphabetically	Legend

In TFileListBox

Directory

Drive

FileEdit

FileName

FileType

Mask

ShowGlyphs

Derived from TCustomListBox

Canvas

ExtendedSelect

IntegralHeight

ItemHeight

ItemIndex

Items

MultiSelect

SelCount

Selected

TopIndex

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TFileListBox properties

TFileListBox	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

Directory

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragMode

Drive

Enabled

ExtendedSelect

FileEdit

FileName

FileType

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

ImeMode

ImeName

IntegralHeight

ItemHeight

ItemIndex

Items

Left

LRDockWidth

Mask

MultiSelect

Name

Owner

Parent

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

SelCount

Selected

ShowGlyphs

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

TopIndex

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TFileListBox.Directory

TFileListBox	See also 	Example

Specifies the directory that contains all the files listed in the file list box.

property Directory: string;

Description

Set Directory to update the file list box so that it displays the files in a new directory. If the form includes a TDirectoryListBox object, set the FileList property of the directory list box to have the Directory property updated automatically when the user selects a new directory.


TFileListBox.Drive

TFileListBox	See also 	Example

Specifies the drive which contains the files listed in the list box.

property Drive: Char;

Description

Set the value of Drive to the drive that contains the files that the list box should display. When the value of Drive changes, the Directory value also changes to the current directory on the specified drive.

If the form includes a TDirectoryListBox object, set the FileList property of the directory list box to have the Drive property updated automatically when the Drive property of the directory list box changes.


TFileListBox.FileEdit

TFileListBox	See also 	Example

Links the directory list box to an edit control that displays the currently selected file.

property FileEdit: TEdit;

Description

Set FileEdit to an edit control that displays the selected file from the file list box, as is commonly done in Open and Save dialog boxes. If no file is selected in the file list box, the text of the edit control is the current value of the file list box’s Mask property.

Note:	If the user changes the text of the edit control, the results are not automatically reflected in the file list box. Use the ApplyFilePath method to update the file list box when the edit control’s text changes.


TFileListBox.FileName

TFileListBox	See also

Indicates the name of the selected file in the list box, including the path name.

property FileName: string;

Description

Set FileName to initialize the file list box to a particular file. Read FileName to obtain the name of the file the user selected.

If the FileEdit property is set, the linked edit control displays the value of FileName whenever the FileName property changes.


TFileListBox.FileType

TFileListBox	See also

Determines which files are displayed in the file list box based on the attributes of the files.

type

  TFileAttr = (ftReadOnly, ftHidden, ftSystem, ftVolumeID, ftDirectory, ftArchive, ftNormal);

  TFileType = set of TFileAttr;

property FileType: TFileType;

Description

Set FileType to the type of files the list box should display. FileType can specify more than one type of file. For example, if the value of FileType is a set containing the values ftReadOnly and ftHidden, files that have either the read-only or the hidden attributes are displayed in the list box. These are the values that can occur in the FileType property:

Value	Meaning

ftReadOnly	The list box displays files with the read-only attribute.

ftHidden	The list box displays files with the hidden attribute.

ftSystem	The list box displays system files.

ftVolumeID	The list box displays the volume name.

ftDirectory	The list box displays directories.

ftArchive	The list box displays files with archive attribute.

ftNormal	The list box displays files with no special attributes.

To set the FileType property using the Object Inspector, click the FileType property to see the attribute values. Then set each value to True or False to specify whether it is included in the FileType set.

Note:	The files that are listed can also be limited by the form of their names. To restrict the files to particular names, use the Mask property or include a TFilterComboBox on the form.


TFileListBox.Mask

TFileListBox	See also 	Example

Limits which files are displayed in the file list box.

property Mask: string;

Description

Set Mask to a regular expression to limit the list box to files that match the mask. The value of the mask is a file name that may include wildcards. The asterisk (*) is a wildcard which matches any number of arbitrary characters. The question mark (?) is a wildcard which matches a single arbitrary character. The file mask *.* displays all files, which is the default value.

To specify multiple file masks, separate the file mask specifications with semicolons. For example, *.PAS; *.EXE.

If the form includes a TFilterComboBox object, set the FileList property of the filter combo box to have the Mask property updated automatically when the Mask property of the filter combo box changes.


TFileListBox.ShowGlyphs

TFileListBox

Determines whether glyphs (bitmaps) appear next to the file names listed in the file list box.

property ShowGlyphs: Boolean;

Description

Set ShowGlyphs to True to display icons next to the files in the list that indicate the file type. Set ShowGlyphs to False to list only the file names.


TFileListBox events

TFileListBox	Alphabetically	Legend

In TFileListBox

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TFileListBox events

TFileListBox	By object	Legend

OnChange

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TFileListBox.OnChange

TFileListBox	See also

Occurs immediately after the user changes the selected file in the list.

property OnChange: TNotifyEvent;

Description

Write an OnChange event handler to take specific action when the FileName property changes. If the FileEdit property has been set, the edit control is updated before the OnChange event.


TFileListBox methods

TFileListBox	Alphabetically

In TFileListBox

ApplyFilePath

Create

Destroy

Update

Derived from TCustomListBox

Clear

ItemAtPos

ItemRect

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

HasParent

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFileListBox methods

TFileListBox	By object

AfterConstruction

ApplyFilePath

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ItemAtPos

ItemRect

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TFileListBox.ApplyFilePath

TFileListBox	See also 	Example

Updates the file list box to represent a fully qualified file name.

procedure ApplyFilePath(const EditText: string);

Description

Call ApplyFilePath to change the Directory, Drive, FileName, and Mask properties so that they match the values implied by the EditText parameter. For example, if an edit control is linked to the file list box using the FileEdit property, call ApplyFilePath from the OnChange event handler of the edit control to update the file list box whenever the user types a value in the edit control.

ApplyFilePath updates the Mask property only if the EditText parameter includes wildcards. If the form contains a TDirectoryListBox object that specifies this file list box object in its FileList property, the Directory and Drive properties of the directory list box object are updated as well. If the form also includes a TDriveComboBox object that specifies the directory list box in its DirList property, the Drive property of the drive combo box will also be updated. However, the Mask property of any TFilterComboBox will not be updated.


TFileListBox.Create

TFileListBox	See also

Creates an instance of TFileListBox.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create a TFileListBox object at runtime. File list boxes placed on a form at design time are created automatically.

After allocating the memory for the list box, Create

Initializes the Mask property to *.*.

Initializes the FileType property to [ftNormal].

Initializes the Drive and Directory properties to the current directory and fills the list box with all the files in the directory.

Initializes the MultiSelect property to False.

Initializes the Sorted property to True.

Initializes the Width property to 145.


TFileListBox.Destroy

TFileListBox	See also

Destroys an instance of TFileListBox.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the file list box reference is not nil, and only then calls Destroy.


TFileListBox.Update

TFileListBox	See also

Refreshes the directory list for the file list box.

procedure Update; reintroduce;

Description

Call Update whenever the files listed by the file list box may be out of date. For example, if an application creates, renames, or deletes files, calling Update will ensure that those changes are reflected in the file list box.

The list box is updated automatically when the Drive, Directory, FileType, or Mask property is changed.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomListBox


TFiler

Hierarchy	Properties	Methods	See also

TFiler is the abstract base class for reader and writer objects, which are used for loading and saving components and their properties.

Unit

classes

Description

TFiler works with stream and component objects. It handles the internal mechanics of the streaming system that reads and writes components and their associated data.  This streaming system is the mechanism by which Delphi saves components to or reads components from disk (in .DFM files) and by which it saves and restores temporary in-memory images of components.

TFiler has two descendants, TReader and TWriter, that implement the methods introduced by TFiler. The filer type is used as a parameter to component methods that can require either a reader or writer object, depending on whether the data is read from or written to a stream. Every filer has an associated stream that is passed as a parameter to its constructor. Filer objects are usually created by the stream objects which become associated with the filer.

TFiler properties provide support for managing the streaming of owned components. Filer objects read and write the properties of components to and from a stream. Filer objects provide buffering of data to speed read and write operations.

TFiler introduces abstract methods that are customized by its descendant reader and writer objects. These include methods that enable components to load and save hidden or complex data as if it was the value of a published property.

Note:	Most of the filer properties and methods have public visibility for convenience within the Delphi streaming system. The majority of them are never called directly by applications.


TFiler properties

TFiler	Alphabetically

In TFiler

Ancestor

IgnoreChildren

LookupRoot

Root


TFiler properties

TFiler	By object

Ancestor

IgnoreChildren

LookupRoot

Root


TFiler.::Ancestor
TFiler.Ancestor

TFiler	See also	Example

Determines whether to write the properties of inherited components.

property Ancestor: TPersistent;

Description

Do not use Ancestor directly. It is used internally by the methods of writer objects to write components in inherited forms.

In Visual Form Inheritance, a writer object only needs to write the values of properties that differ from those that are inherited. It tracks each component from which properties can be inherited in Ancestor and compares properties before writing. If Ancestor is nil, there is no corresponding component from which to inherit, and the writer object writes the component out to the stream completely.

Ancestor is only non-nil when writing forms created with Visual Form Inheritance. The streaming system uses WriteDescendent and WriteDescendentRes to write such forms to the stream.

When writing or overriding a DefineProperties method, be aware that Ancestor might be set, and it might be necessary to write or omit properties, as appropriate. Normally, DefineProperty read procedures ignore the value of Ancestor.


TFiler.IgnoreChildren

TFiler	See also

Enables a writer object to save a component without saving the components it owns.

property IgnoreChildren: Boolean;

Description

Programs rarely use IgnoreChildren directly. Delphi uses IgnoreChildren internally to avoid writing owned components when the Root is changed during the streaming process. A few components change Root while streaming, but this is rare.

If IgnoreChildren is True, the writer writes a component without writing any child components it owns. If IgnoreChildren is False, the writer object writes all owned objects to the stream.


TFiler.LookupRoot

TFiler	See also

Specifies the root component for resolving names while loading and saving components.

property LookupRoot: TComponent;

Description

The Filer sets LookupRoot when loading or saving components to resolve name references in nested frames. This allows the Writer to look up component names relative to a local root component, even when a frame is nested in another root component.


TFiler.Root

TFiler	See also

Indicates which object is the root, or ultimate owner, of the objects read or written by the filer.

property Root: TComponent;

Description

Do not call Root directly. It is used internally to find the root object when streaming owned components. Root represents the ultimate owner of all the components being streamed during the current streaming process.

The ReadRootComponent and WriteRootComponent methods set Root before reading or writing their components and owned components.


TFiler methods

TFiler	Alphabetically

In TFiler

Create

DefineBinaryProperty

DefineProperty

Destroy

FlushBuffer

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TFiler methods

TFiler	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

DefineBinaryProperty

DefineProperty

Destroy

Dispatch

FieldAddress

FlushBuffer

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TFiler.Create

TFiler	See also

Creates a filer object.

constructor Create(Stream: TStream; BufSize: Integer);

Description

Call Create to instantiate a filer descendant at runtime, if necessary. It is seldom necessary to create a filer object because filers arecreated automatically by methods and routines that use them.

Create allocates memory for a filer object, and associates it with the stream passed in the Stream parameter, with a buffer of size BufSize.


TFiler.DefineBinaryProperty

TFiler	See also

Introduces an abstract method that allows descendants to read and write unformatted data like a property.

type TStreamProc = procedure(Stream: TStream) of object;

procedure DefineBinaryProperty(const Name: string; ReadData, WriteData: TStreamProc; HasData: Boolean); virtual; abstract;

Description

Each descendant filer object declares a DefineBinaryProperty method that reads or writes binary data as if the data were a property.


TFiler.DefineProperty

TFiler	See also	Example

Introduces an abstract method that allows descendants to read or write data like a property.

type

  TReaderProc = procedure(Reader: TReader) of object;

  TWriterProc = procedure(Writer: TWriter) of object;

procedure DefineProperty(const Name: string; ReadData: TReaderProc; WriteData: TWriterProc; HasData: Boolean); virtual; abstract;

Description

Each descendant filer object declares a DefineProperty method that defines the data that the descendant object will read or write as if the data were a property.


TFiler.Destroy

TFiler	See also

Destroys a filer object.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free, which checks that the filer reference is not nil before calling Destroy.

The Destroy method for filer objects frees memory associated with the buffer. Memory deallocation for the object instance is handled automatically when Destroy is called. TFiler’s Destroy method is called by descendant objects in their respective destructors.


TFiler.FlushBuffer

TFiler

Introduces an abstract method that allows descendants to synchronize the filer’s buffer with its stream.

procedure FlushBuffer; virtual; abstract;

Description

Each descendant filer object defines a FlushBuffer method to provide practical implementations for synchronizing the filer object’s buffer with the associated stream.


Hierarchy

TObject


TFileStream

Hierarchy	Properties	Methods	See also

TFileStream enables applications to read from and write to a file on disk.

Unit

classes

Description

Use TFileStream to access the information in disk files. TFileStream will open a named file and provide methods to read from or write to it. If an application already has a handle to the file, opened in the appropriate mode, use THandleStream instead.


TFileStream properties

TFileStream	Alphabetically	Legend

Derived from THandleStream

Handle

Size

Derived from TStream

Position


TFileStream properties

TFileStream	By object	Legend

Handle

Position

Size


TFileStream methods

TFileStream	Alphabetically

In TFileStream

Create

Destroy

Derived from THandleStream

Read

Seek

Write

Derived from TStream

CopyFrom

FixupResourceHeader

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TFileStream methods

TFileStream	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

CopyFrom

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

FixupResourceHeader

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Read

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

SafeCallException

Seek

Write

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader


TFileStream.Create

TFileStream	See also

Creates an instance of TFileStream.

constructor Create(const FileName: string; Mode: Word);

Description

Call Create to instantiate a file stream for reading from or writing to the named file. Specify the name of the file and the way the file should be opened as parameters.

The Mode parameter indicates how the file is to be opened. The Mode parameter consists of an open mode and a share mode or’ed together. The open mode must be one of the following values:

Value	Meaning

fmCreate	Create a file with the given name. If a file with the given name exists, open the file in write mode.

fmOpenRead	Open the file for reading only.

fmOpenWrite	Open the file for writing only. Writing to the file completely replaces the current contents.

fmOpenReadWrite	Open the file to modify the current contents rather than replace them.

The share mode must be one of the following values:

Value	Meaning

fmShareCompat	Sharing is compatible with the way FCBs are opened.

fmShareExclusive	Other applications can not open the file for any reason.

fmShareDenyWrite	Other applications can open the file for reading but not for writing.

fmShareDenyRead	Other applications can open the file for writing but not for reading.

fmShareDenyNone	No attempt is made to prevent other applications from reading from or writing to the file.

If the file can not be opened, Create raises an exception.


TFileStream.Destroy

TFileStream	See also

Destroys an instance of TFileStream.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free, which checks that the TFileStream reference is not nil and only then calls Destroy.

Destroy closes the Handle for the file stream before freeing the object.


Accessibility

Read-only


Hierarchy

TObject

TStream

THandleStream


 TFindDialog

Hierarchy	Properties	Methods	Events	See also

TFindDialog displays a Find dialog that allows users to search for text in a file.

Unit

dialogs

Description

The TFindDialog component displays a modeless Windows dialog box that prompts the user for a search string. The dialog does not appear at runtime until it is activated by a call to the Execute method.


TFindDialog properties

TFindDialog	Alphabetically	Legend

In TFindDialog

FindText

Left

Options

Position

Top

Derived from TCommonDialog

Ctl3D

Handle

HelpContext

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TFindDialog properties

TFindDialog	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Ctl3D

DesignInfo

FindText

Handle

HelpContext

Left

Name

Options

Owner

Position

Tag

Top

VCLComObject


TFindDialog.FindText

TFindDialog 	Example

Contains the search string.

property FindText: string;

Description

FindText contains the text string that the user wants to search for. When the user clicks the Find Next button, the text in the dialog’s edit box is automatically assigned to FindText. To make a default text string appear in the edit box when the dialog opens, assign a value to FindText in the Object Inspector or in program code.


TFindDialog.Left

TFindDialog	See also

Determines the X coordinate (horizontal position) of the Find dialog’s upper left corner.

property Left: Integer;

Description

Left holds the same value as the first integer in Position. This property is maintained for compatibility with older applications.


TFindDialog.Options

TFindDialog	See also 	Example

Determines the appearance and behavior of the Find dialog.

type

  TFindOption = (frDown, frFindNext, frHideMatchCase, frHideWholeWord, frHideUpDown, frMatchCase, frDisableMatchCase, frDisableUpDown, frDisableWholeWord, frReplace, frReplaceAll, frWholeWord, frShowHelp);

  TFindOptions = set of TFindOption;

property Options: TFindOptions;

Description

The possible values of Options are

Value	Meaning

frDisableMatchCase	Disables (grays) the Match Case check box.

frDisableUpDown	Disables (grays) the Up and Down buttons, used to determine the direction of the search.

frDisableWholeWord	Disables (grays) the Match Whole Word check box.

frDown	Selects the Down button by default when the dialog opens. If the frDown flags is off, Up is selected when the dialog opens. (By default, frDown is on.)

frFindNext	This flag is turned on when the user clicks the Find Next button and turned off when the dialog closes.

frHideMatchCase	Removes the Match Case check box from the dialog.

frHideWholeWord	Removes the Match Whole Word check box from the dialog.

frHideUpDown	Removes the Up and Down buttons from the dialog.

frMatchCase	This flag is turned on (off) when the user selects (deselects) the Match Case check box. To select the check box by default when the dialog opens, set frMatchCase at design time.

frReplace	Applies to TReplaceDialog only. This flag is set by the system to indicate that the application should replace the current occurrence (and only the current occurrence) of the FindText string with the ReplaceText string.

frReplaceAll	Applies to TReplaceDialog only. This flag is set by the system to indicate that the application should replace all occurrences of the FindText string with the ReplaceText string.

frShowHelp	Displays a Help button in the dialog.

frWholeWord	This flag is turned on (off) when the user selects (deselects) the Match Whole Word check box. To select the check box by default when the dialog opens, set frWholeWord at design time.

By default, all options except frDown are off.


TFindDialog.Position

TFindDialog	See also 	Example

Determines the position of the Find dialog on the screen.

property Position: TPoint;

Description

Position gives the pixel coordinates of the dialog’s upper left corner.


TFindDialog.Top

TFindDialog	See also

Determines the Y coordinate (vertical position) of the Find dialog’s upper left corner.

property Top: Integer;

Description

Top holds the same value as the second integer in Position. This property is maintained for compatibility with older applications.


TFindDialog events

TFindDialog	Alphabetically	Legend

In TFindDialog

OnFind

Derived from TCommonDialog

OnClose

OnShow


TFindDialog events

TFindDialog	By object	Legend

OnClose

OnFind

OnShow


TFindDialog.OnFind

TFindDialog	See also	Example

Occurs when the user clicks the Find Next button.

property OnFind: TNotifyEvent;

Description

Write an OnFind event handler to perform the requested search when the user clicks Find Next in the dialog. Use the Options flags to determine how the search is conducted.


TFindDialog methods

TFindDialog	Alphabetically

In TFindDialog

CloseDialog

Create

Destroy

Execute

Derived from TCommonDialog

DefaultHandler

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFindDialog methods

TFindDialog	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

CloseDialog

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Execute

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TFindDialog.CloseDialog

TFindDialog

Closes the Find dialog box.

procedure CloseDialog;

Description

CloseDialog closes the dialog box and frees its window handle, but leaves most properties of the TFindDialog (including FindText) unchanged.


TFindDialog.Create

TFindDialog	See also

Creates and initializes a TFindDialog instance.

constructor Create(AOwner: TComponent); override;

Description

The Create method generates a TFindDialog instance, but the new dialog does not appear on the form at runtime until the Execute method is called.


TFindDialog.Destroy

TFindDialog	See also

Destroys the TFindDialog and frees its memory.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Call Free instead. Free checks that the Find dialog reference is not nil before calling Destroy.


TFindDialog.Execute

TFindDialog 	Example

Displays the Find dialog.

function Execute: Boolean; override;

Description

Execute opens the Find dialog, returning True when a window handle is successfully allocated. If the dialog is already open when Execute is called, Execute brings the dialog to the top, activates its parent form, and returns True.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog


TFlatList

Hierarchy	Properties	Methods	Events

TFlatList is an abstract base class for objects that represent a list of fields.

Unit

Db

Description

Derive a class from TFlatList to store and manipulate a list of fields in an iterative manner.  Fields are stored iteratively, including the child fields of object fields such as ADTs and Arrays, rather than hierarchically as in TFieldDefs.

Descendants of TFlatList include TFieldList and TFieldDefList.


TFlatList properties

TFlatList	Alphabetically	Legend

In TFlatList

Count

DataSet

Derived from TStringList

Capacity

Duplicates

Objects

Sorted

Strings

Derived from TStrings

CommaText

Names

StringsAdapter

Text

Values


TFlatList properties

TFlatList	By object	Legend

Capacity

CommaText

Count

DataSet

Duplicates

Names

Objects

Sorted

StringsAdapter

Strings

Text

Values


TFlatList.Count

TFlatList	See also

Indicates the number of fields in the list.

property Count: Integer;

Description

Use Count when iterating over all the fields in the list.


TFlatList.DataSet

TFlatList	See also

Identifies the dataset to which the TFlatList object belongs.

property DataSet: TDataSet;

Description

Check the value of the DataSet property to determine the dataset that uses the TFlatList object. Applications should not directly assign the DataSet property of a TFlatList object. It is assigned automatically when a TFlatList object descendant is created.


TFlatList events

TFlatList	Alphabetically

Derived from TStringList

OnChange

OnChanging


TFlatList events

TFlatList	By object

OnChange

OnChanging


TFlatList methods

TFlatList	Alphabetically

In TFlatList

Create

Update

Derived from TStringList

Add

Clear

Delete

Destroy

Exchange

Find

IndexOf

Insert

Sort

Derived from TStrings

AddObject

AddStrings

Append

Assign

BeginUpdate

EndUpdate

Equals

GetText

IndexOfName

IndexOfObject

InsertObject

LoadFromFile

LoadFromStream

Move

SaveToFile

SaveToStream

SetText

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TFlatList methods

TFlatList	By object

AddObject

AddStrings

Add

AfterConstruction

Append

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

Equals

Exchange

FieldAddress

Find

FreeInstance

Free

GetInterfaceEntry

GetInterfaceTable

GetInterface

GetNamePath

GetText

IndexOfName

IndexOfObject

IndexOf

InheritsFrom

InitInstance

InsertObject

Insert

InstanceSize

LoadFromFile

LoadFromStream

MethodAddress

MethodName

Move

NewInstance

SafeCallException

SaveToFile

SaveToStream

SetText

Sort

Update


TFlatList.Create

TFlatList	See also

Creates an instance of TFlatList.

constructor Create(ADataSet: TDataSet);

Description

Applications should not call the Create method.  TFlatList objects are created by the dataset that uses them to manage definition objects.  The ADataset parameter specifies the dataset that creates the TFlatList object.  It becomes the value of the Dataset property.


TFlatList.Update

TFlatList	See also

Refreshes the string definitions in the Strings property array to reflect the current state of the physical fields underlying the dataset.

procedure Update;

Description

Call Update to refresh the field definitions when the structure of the underlying dataset may have changed. Update updates the field definitions without opening the dataset.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TStrings

TStringList


TFieldDataLink

Hierarchy	Properties	Methods	Events	See also

TFieldDataLink helps a data-aware windowed control manage its link to a TField object and respond to data events.

Unit

dbctrls

Description

Use TFieldDataLink as a member in any data-aware object that needs to link to a TField object and respond to data events or track database information. The data-aware object must be a descendant of TWinControl.

The constructor of the data-aware object should call the constructor of the TFieldDataLink member, and initialize any relevant event-handlers. The data-aware object can then link to a TField object by using the FieldName property of the TFieldDataLink and can link to a dataset by using the DataSource property of the TFieldDataLink.


TFieldDataLink properties

TFieldDataLink	Alphabetically	Legend

In TFieldDataLink

CanModify

Control

Editing

Field

FieldName

Derived from TDataLink

Active

ActiveRecord

BOF

BufferCount

DataSet

DataSource

DataSourceFixed

Eof

ReadOnly

RecordCount


TFieldDataLink properties

TFieldDataLink	By object	Legend

Active

ActiveRecord

BOF

BufferCount

CanModify

Control

DataSet

DataSource

DataSourceFixed

Editing

Eof

Field

FieldName

ReadOnly

RecordCount


TFieldDataLink.CanModify

TFieldDataLink	See also

Indicates whether the Control can modify a field in the database table managed by TFieldDataLink.

property CanModify: Boolean;

Description

Read CanModify to find out whether the Control that owns this TFieldDataLink is able to alter the data in the database that this field represents. CanModify may be False because the control is read-only, or because the underlying field does not permit updates.


TFieldDataLink.Control

TFieldDataLink	See also

Specifies the data-aware component that uses this TFieldDataLink object to manage its link to a TField object.

property Control: TComponent;

Description

This property should only be set by components that use TFieldDataLink to manage the link to a TField object. In their own constructors, these data-aware components can set the Control property of their TFieldDataLink member to self, after calling the TFieldDataLink constructor.

The Control property can be read to access methods of the component when processing data events.


TFieldDataLink.Editing

TFieldDataLink	See also

Indicates whether the dataset that contains the associated field is in edit mode.

property Editing: Boolean;

Description

Use Editing to determine whether the value of the field associated with this TDataLink can currently be edited. If Editing is False, calling the Edit method may drive the dataset into edit mode. The Edit method may not be successful, however, if the field cannot be edited. For example, if the CanModify property is False, Editing will always be False.


TFieldDataLink.Field

TFieldDataLink	See also

Specifies the field component managed by this TFieldDataLink object.

property Field: TField;

Description

Read Field to gain access to the field object to which the Control of this TFieldDataLink is bound.

Note:	Before using Field to alter the value of a field’s contents, applications should check the CanModify property. The Field object will not be aware of all constraints to edits for this TFieldDataLink.


TFieldDataLink.FieldName

TFieldDataLink	See also

Specifies the name of the field to which the Control of this TFieldDataLink is bound.

property FieldName: String;

Description

Use FieldName to implement the FieldName property of the data-aware control that owns the TFieldDataLink. Setting FieldName links the TFieldDataLink, and hence the control, to the field in the dataset with that name.


TFieldDataLink events

TFieldDataLink	Alphabetically

In TFieldDataLink

OnActiveChange

OnDataChange

OnEditingChange

OnUpdateData


TFieldDataLink events

TFieldDataLink	By object

OnActiveChange

OnDataChange

OnEditingChange

OnUpdateData


TFieldDataLink.OnActiveChange

TFieldDataLink	See also

Occurs when the Active property of the TFieldDataLink changes.

property OnActiveChange: TNotifyEvent;

Description

Write an OnActiveChange event handler to take specific action immediately after the dataset transitions into or out of an active state. OnActiveChange is particularly useful for updating objects to reflect changes that occurred while the dataset was not active, as the object can not respond to events while its TFieldDataLink is not Active.


TFieldDataLink.OnDataChange

TFieldDataLink	See also

Occurs when the contents of the dataset change.

property OnDataChange: TNotifyEvent;

Description

Write an OnDataChange event handler to take specific action when there is a change to the contents of the field. OnDataChange allows the control object to respond when the dataset sends out notifications that the data has changed.


TFieldDataLink.OnEditingChange

TFieldDataLink	See also

Occurs after the DataSource transitions into or out of an editing state.

property OnEditingChange: TNotifyEvent;

Description

Write an OnEditingChange event handler to take specific action when the DataSource transitions into or out of an editing state. This event can be used to create visual indications of the editing state in the control that uses this TFieldDataLink.


TFieldDataLink.OnUpdateData

TFieldDataLink	See also

Occurs when it is time to post any pending changes to the dataset.

property OnUpdateData: TNotifyEvent;

Description

Write an OnUpdateData event handler to write the data in the representation of the field to the database record. Posting the data from within OnUpdateData does not trigger a call to OnDataChange.


TFieldDataLink methods

TFieldDataLink	Alphabetically	Legend

In TFieldDataLink

ActiveChanged

Create

Edit

EditingChanged

FocusControl

LayoutChanged

Modified

RecordChanged

Reset

UpdateData

Derived from TDataLink

Destroy

ExecuteAction

UpdateAction

UpdateRecord

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TFieldDataLink methods

TFieldDataLink	By object	Legend

ActiveChanged

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

Edit

EditingChanged

ExecuteAction

FieldAddress

FocusControl

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

LayoutChanged

MethodAddress

MethodName

Modified

NewInstance

RecordChanged

Reset

SafeCallException

UpdateAction

UpdateData

UpdateRecord


TFieldDataLink.ActiveChanged

TFieldDataLink	See also

Generates an OnActiveChanged event.

procedure ActiveChanged; override;

Description

Changes to the Active property trigger the ActiveChanged method. If an OnActiveChange event handler is assigned, ActiveChanged calls this event handler. If ActiveChanged is triggered by a transition into an active state, then before calling the event handler, ActiveChanged makes sure that the Field for this TFieldDataLink is still valid.


TFieldDataLink.Create
TFieldDataLink.CreateTFieldDataLink	See also

Creates an instance of TFieldDataLink.

constructor Create;

Description

Applications should never need to create a TFieldDataLink component. Component writers will need to instantiate a TFieldDataLink object from the constructor of data-aware controls.


TFieldDataLink.Edit

TFieldDataLink	See also

Attempts to drive the DataSource into an editing state if it is not already in one.

function Edit: Boolean;

Description

Use Edit to try to ensure that the contents of the field can be modified. A return value of True indicates that the field was already in an editing state, or that the DataSource was successfully changed to allow editing. A return value of False indicates that the DataSource could not be changed to allow editing. For example, if the CanModify property is False, Edit fails, and returns False.


TFieldDataLink.EditingChanged

TFieldDataLink	See also

Enforces the CanModify property when the field binding changes.

procedure EditingChanged; override;

Description

Changing the field binding can change the validity of the CanModify property, since individual field components can disallow edits. If TFieldDataLink is in an editing state when the Field property is changed, EditingChanged checks the CanModify property. If CanModify is False, it changes back out of the editing state.

Note:	This differs significantly from the inherited EditingChanged method of TDataLink. The functionality of the inherited method is replaced in TFieldDataLink by the OnEditingChange event handler.


TFieldDataLink.FocusControl

TFieldDataLink	See also

Sets the input focus to Control.

type TFieldRef = ^TField;

procedure FocusControl(Field: TFieldRef; override;

Description

Call FocusControl to give the Control associated with this TFieldDataLink object the input focus. FocusControl checks whether the Control can receive input focus, and if so, calls its SetFocus method to move focus to the Control.


TFieldDataLink.LayoutChanged

TFieldDataLink	See also

Ensures that the Field property is valid after changes in the layout of a container of the Control for this TFieldDataLink.

procedure LayoutChanged; override;

Description

LayoutChanged is called after changes in the layout of one of the containers of the Control for this TFieldDataLink that might change the validity of its field binding. For example, if the Control is embedded within a TCustomDBGrid, and one of the columns is deleted, the Field property for the Control might become invalid.


TFieldDataLink.Modified

TFieldDataLink	See also

Keeps track of changes made to the data for this field that are not yet written to the record in the dataset.

procedure Modified;

Description

Call Modified when the Control for this TFieldDataLink begins processing edits.


TFieldDataLink.RecordChanged

TFieldDataLink	See also

Generates an OnDataChange event.

procedure RecordChanged(Field: TField); override;

Description

Applications can not call this protected method. It is triggered automatically when the contents of the current record change. RecordChanged calls the OnDataChange event handler if there is one.


TFieldDataLink.Reset

TFieldDataLink	See also

Ignores all pending changes and generates an OnDataChange event.

procedure Reset;

Description

The Control that owns a TFieldDataLink object calls its Reset method to process a UI action that cancels edits to the field. Reset calls the OnDataChange event handler without writing any pending changes to the record in the dataset.


TFieldDataLink.UpdateData

TFieldDataLink	See also

Generates an OnUpdateData event.

procedure UpdateData; override;

Description

UpdateData overrides the default UpdateData method to call the OnUpdateData event handler where the data-aware control can write any pending edits to the record in the dataset.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink


TFieldDefList

Hierarchy	Properties	Methods	Events

TFieldDefList contains a list of field names used to access the field definition (TFieldDef) objects stored in the FieldDefs property.

Unit

Db

Description

TFieldDefList is used by a dataset to create a complete list of field names that correspond to the objects in the FieldDefs property.

TFieldDefs with object field types, such as TADTField and TArrayField, have TFieldDef objects for these object types that contain FieldDefs to hold the TFieldDef objects of their child fields.

A TFieldDefList with object field types, such as TADTField and TArrayField, lists child TFieldDef objects of object fields sequentially after the parent TFieldDef. This is a linear representation of the data, and is in contrast to TFieldDefs which has a hierarchical representation of the data. TFieldDefs with object field types have TFieldDef objects for these object types that contain FieldDefs to hold the TFieldDef objects of their child fields.


TFieldDefList properties

TFieldDefList	Alphabetically	Legend

In TFieldDefList

FieldDefs

Updated

Derived from TFlatList

DataSet

Count

Derived from TStringList

Capacity

Duplicates

Objects

Sorted

Strings

Derived from TStrings

CommaText

Names

StringsAdapter

Text

Values


TFieldDefList properties

TFieldDefList	By object	Legend

Capacity

CommaText

Count

DataSet

Duplicates

FieldDefs

Names

Objects

Sorted

StringsAdapter

Strings

Text

Updated

Values


TFieldDefList.FieldDefs

TFieldDefList	See also

Points to a list of field definitions for the dataset associated with the TFieldDefList object.

property FieldDefs[Index: Integer]: TFieldDef;

Description

FieldDefs points to a internal list of field definitions for a dataset. A TFieldDefList with object field types, such as TADTField and TArrayField, lists child TFieldDef objects of object fields sequentially after the parent TFieldDef.


TFieldDefList.Updated

TFieldDefList	See also

Indicates whether the entries in the FieldDefs list match the corresponding objects in the FieldDefs property.

property Updated: Boolean;

Description

Use Updated to determine whether the definitions managed by the TFieldDefList object match the corresponding objects in the FieldDefs property.  Updated is set to True when the dataset is opened. Updated is set to False when the FieldDefs are changed.


TFieldDefList events

TFieldDefList	Alphabetically

Derived from TStringList

OnChange

OnChanging


TFieldDefList events

TFieldDefList	By object

OnChange

OnChanging


TFieldDefList methods

TFieldDefList	Alphabetically

In TFieldDefList

Find

FieldByName

Derived from TFlatList

Create

Update

Derived from TStringList

Add

Clear

Delete

Destroy

Exchange

IndexOf

Insert

Sort

Derived from TStrings

AddObject

AddStrings

Append

Assign

BeginUpdate

EndUpdate

Equals

GetText

IndexOfName

IndexOfObject

InsertObject

LoadFromFile

LoadFromStream

Move

SaveToFile

SaveToStream

SetText

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TFieldDefList methods

TFieldDefList	By object

AddObject

AddStrings

Add

AfterConstruction

Append

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

Equals

Exchange

FieldAddress

FieldByName

Find

FreeInstance

Free

GetInterfaceEntry

GetInterfaceTable

GetInterface

GetNamePath

GetText

IndexOfName

IndexOfObject

IndexOf

InheritsFrom

InitInstance

InsertObject

Insert

InstanceSize

LoadFromFile

LoadFromStream

MethodAddress

MethodName

Move

NewInstance

SafeCallException

SaveToFile

SaveToStream

SetText

Sort

Update


TFieldDefList.Find

TFieldDefList	See also

Locates a field definition object in the FieldDef list from a field name.

function Find(const Name: String): TFieldDef; reintroduce;

Description

Call Find to obtain information about a particular field definition object. Specify the name of the field as the value of the Name parameter. If Find finds a field with a matching name, it returns the TFieldDef component for the specified Name. Otherwise it returns nil.


TFieldDefList.FieldByName

TFieldDefList	See also

Locates a field definition object in the FieldDefs list from its name.

function FieldByName(const Name: String): TFieldDef;

Description

Call Find to obtain information about a particular field definition object. Specify the name of the field as the value of the Name parameter. If Name is not found, an EDatabaseError exception is raised with the error message “Field not found”.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TStrings

TStringList

TFlatList


TFloatField

Hierarchy	Properties	Methods	Events	See also

TFloatField represents a field that contains floating-point values in a dataset.

Unit

db

Description

TFloatField is a persistent field object that encapsulates the fundamental behavior common to numeric data. TFloatField introduces new properties to convert between integer values and other data types, to control the precision of numbers that the field will permit, and to format the value for display purposes.

As with all persistent field objects, a TFloatField can be created at design-time using the Fields Editor or at runtime by calling the constructor for the class. Persistent field objects exist solely in the memory space of a Delphi application. Creating a persistent field object only creates an object in the application, and does not result in the creation of a field in a table.

Fields in a table can be accessed without use of persistent field objects. Virtual field objects are created to provide access to a field when the field is referenced through such means as the TDataSet.::Fields property or the TDataSet.FieldByName method. However, as both the Fields property and the FieldByName method return a value of type TField, the return value must be typecast as a TFloatField before using any property specific to TFloatField.

Floating-point fields can hold values in the range from (positive or negative) 5.0 * 10-324 to 1.7 * 10308 with an accuracy of 15 digits.

TFloatField is the direct ancestor of the TCurrencyField component.


TFloatField properties

TFloatField	Alphabetically	Legend

In TFloatField

AsFloat

AsInteger

AsString

AsVariant

Currency

DataSize

MaxValue

MinValue

Precision

Value

Derived from TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TFloatField properties

TFloatField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

Currency

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

MaxValue

MinValue

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

Precision

ReadOnly

Required

Size

Tag

Text

ValidChars

Value

VCLComObject

Visible


TFloatField.AsFloat

TFloatField	See also

Represents the value of the floating-point field.

property AsFloat: Double;

Description

Floating-point values need no conversion, because the native storage format of a floating-point field is a Double. AsFloat provides a uniform interface that allows applications to get or set floating-point values with generic field components when the internal storage format of the data is not known.

If the value assigned to the field does not fall within the range specified by the MinValue and MaxValue properties, an EDatabaseError exception is raised.


TFloatField.AsInteger

TFloatField	See also	Example

Represents the value of the floating-point field as an integer value.

property AsInteger: Longint;

Description

Use AsInteger to

Assign an integer value to the floating-point field.

Assign the floating-point field value to an integer.

AsInteger converts floating point values to integers by truncating the decimal portion. If a value assigned to the field is not within the range established by the MinValue and the MaxValue properties, an EDatabaseError exception is raised.


TFloatField.AsString

TFloatField	See also

Represents the value of a floating-point field as a string value.

property AsString: String;

Description

Use AsString to

Assign the floating-point field value to string value.

Assign a string value to the floating-point field.

For example, this code assigns a string value to floating-point field value:

MyFloatField.AsString := '13.5';

To assign floating-point field value to a string, use code similar to this:

NewString := MyFloatField.AsString;

If the string assigned to the field does not represent a valid floating-point value within the range specified by the MinValue and MaxValue properties, an EDatabaseError exception is raised.


TFloatField.AsVariant

TFloatField	See also

Represents the value of a floating-point field as a variant value.

property AsVariant: Variant;

Description

Use AsVariant to

Assign the floating-point field value to a variant variable.

Assign a variant value to the floating-point field.

Using variants is useful when the actual field type and the format of the data are unknown.

If the value assigned to the field does not fall within the range specified with MinValue and MaxValue properties, an EDatabaseError exception is raised.


TFloatField.Currency

TFloatField	See also

Determines whether the value in the field should be formatted as a currency value.

property Currency: Boolean;

Description

Use the Currency property to specify the formatting of the field for viewing and editing in a data-aware control.

The field is formatted for display using the DisplayFormat property if it is assigned. If DisplayFormat is not assigned, Currency determines how the field is formatted for display. If Currency is True the value is formatted for display using the FloatToText function with the ffCurrency formatting code. If Currency is False, the value is formatted with the ffGeneral format.

The field is formatted for editing purposes using the EditFormat (or DisplayFormat) property if it is assigned. If neither EditFormat nor DisplayFormat is assigned, Currency determines how the field is formatted for editing. If Currency is True, the value is formatted for editing using the FloatToText function with the ffFixed formatting code. If Currency is False, the value is formatted with the ffGeneral format.


TFloatField.DataSize

TFloatField	See also	Example

Specifies the amount of memory needed to store the value of a float field in its native database format.

property DataSize: Word;

Description

Check DataSize to determine the number of bytes required to store a float field component’s value. Use DataSize to determine the size needed for a buffer when working with the GetData and SetData methods.

For float fields, DataSize is always 8. Database tables store float fields as a Double, which is the same as the type used by TFloatField.


TFloatField.MaxValue

TFloatField	See also

Limits the maximum value in the floating-point field.

property MaxValue: Double;

Description

Use MaxValue to get or set the maximum value that can be entered into the field. If a value greater than MaxValue is entered, an EDatabaseError exception is raised.


TFloatField.MinValue

TFloatField	See also

Limits the minimum value in the floating-point field.

property MinValue: Double;

Description

Use MinValue to get or set the minimum value that can be entered into the field. If a value smaller than MinValue is entered, an EDatabaseError exception is raised.


TFloatField.Precision

TFloatField	See also

Determines the precision used in formatting the value in a floating-point field.

property Precision: Integer;

Description

Use Precision to set the number of digits beyond the decimal point that the value should be formatted to before rounding begins. Precision affects the format of the floating-point value when it is displayed as a text string, not the actual floating-point value that is stored in the field.

The default value of Precision is 15 decimal places.

Note:	Precision must be greater than or equal to 2. Trying to set Precision to a value less than 2 changes the value of Precision to 2.


TFloatField.Value

TFloatField	See also

Specifies the value of the floating-point field.

property Value: Double;

Description

Use Value to read data from and write data to a floating-point component at runtime. Using the Value property is the same as using the AsFloat property. Use Value when you know the field component is a floating-point field. Use AsFloat when working with a generic field component.


TFloatField events

TFloatField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TFloatField events

TFloatField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TFloatField methods

TFloatField	Alphabetically

In TFloatField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFloatField methods

TFloatField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TFloatField.Create

TFloatField	See also

Creates an instance of TFloatField.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TFloatField.  After calling the inherited constructor, Create sets the DataType to ftFloat, and the Precision to 15.

After instantiating a TFloatField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TFloatField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TFloatField with a dataset component by setting its DataSet property to the name of the dataset component. Optionally set the Precision property to the desired degree of precision.

The example below creates a TFloatField object for a field named Amount accessed through a TQuery named Query1.

var

  T: TFloatField;

begin

  Query1.Close;

  T := TFloatField.Create(Self);

  T.Precision := 2;

  T.FieldName := 'Amount';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TNumericField


 TFilterComboBox

Hierarchy	Properties	Methods	Events	See also

TFilterComboBox is a specialized combo box that presents the user with a choice of file filters.

Unit

filectrl

Description

Add a filter combo box to a form that includes a file selection control to provide a set of predefined file filters. Use TFilterComboBox along with TDriveComboBox, TDirectoryListBox, and TFileListBox to add full file selection capabilities to a form.

To add a standard Win32 file open or save dialog to an application, use TOpenDialog or TSaveDialog instead.


TFilterComboBox properties

TFilterComboBox	Alphabetically	Legend

In TFilterComboBox

FileList

Filter

Mask

Derived from TCustomComboBox

Canvas

CharCase

DroppedDown

ItemIndex

Items

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Text

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TFilterComboBox properties

TFilterComboBox	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

Canvas

CharCase

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragMode

DroppedDown

Enabled

FileList

Filter

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

ImeMode

ImeName

ItemIndex

Items

Left

LRDockWidth

Mask

Name

Owner

Parent

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Text

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TFilterComboBox.FileList

TFilterComboBox	See also 	Example

Links the filter combo box to a file list box control.

property FileList: TFileListBox;

Description

If the form includes a TFileListBox object to display a list of files to choose from, set FileList to allow the filter combo box to limit which files are displayed in the list box. Once the two controls are connected, whenever a new filter is selected using a filter combo box, the file list box displays the files that match the selected filter.


TFilterComboBox.Filter

TFilterComboBox	See also 	Example

Contains all the file masks displayed in the filter combo box.

property Filter: string;

Description

Set the Filter property to specify the names that appear in the filter combo box, along with the masks associated with each name. Each mask is a file name that may include wildcards. The asterisk (*) is a wildcard which matches any number of arbitrary characters. The question mark (?) is a wildcard which matches a single arbitrary character. When the application runs, the file filter the user selects in the filter combo box becomes the value of the Mask property.

To create the value of Filter for a single file type, follow these steps:

1	Type some meaningful text to indicate the type of file.

2	Type a | character (vertical bar).

3	Type the file filter.

Don't put in any spaces around the | character in the string.

Here's an example:

FilterComboBox1.Filter := 'Text files|*.TXT';

If Filter is set to this string, the string “Text files” appears in the filter combo box. When the user selects “Text files”, the mask is set to “*.TXT”.

To specify multiple file filters, extend the value of Filter, separating each file name/mask combination with a | character.

Here's an example of two file filters that could be specified as the value of the Filter property:

'Text files (*.TXT)|*.TXT|Pascal files (*.PAS)|*.PAS'

The previous example includes the file filters in parentheses in the text parts. This isn't required, but it's a common convention that helps users understand what to expect when they select a file filter.

The mask portion can include multiple file specifiers if they are separated with semicolons:

'All files|*.TXT;*.PAS;*.WB1'


TFilterComboBox.Mask

TFilterComboBox	See also 	Example

Specifies the mask associated with the string selected in the filter combo box.

property Mask: string;

Description

Read Mask to obtain the mask that was selected by the user.

When the user uses the filter combo box to select a new filter, the mask associated with the selected file type becomes the value of the Mask property. If a file list box is linked to the filter combo box with the FileList property, the file list will update when the value of Mask changes.


TFilterComboBox events

TFilterComboBox	Alphabetically	Legend

Derived from TCustomComboBox

OnChange

OnDropDown

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TFilterComboBox events

TFilterComboBox	By object	Legend

OnChange

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnDropDown

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnStartDrag


TFilterComboBox methods

TFilterComboBox	Alphabetically

In TFilterComboBox

Create

Destroy

Derived from TCustomComboBox

Clear

SelectAll

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFilterComboBox methods

TFilterComboBox	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TFilterComboBox.Create

TFilterComboBox	See also

Creates and initializes an instance of TFilterComboBox.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create a TFilterComboBox objectat runtime. Filter combo boxes placed on a form at design time are created automatically.

After allocating the memory for the combo box, Create initializes the Mask property to *.* and initializes the Style property to csDropDownList.


TFilterComboBox.Destroy

TFilterComboBox	See also

Destroys an instance of TFilterComboBox.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free checks that the filter combo box is not nil, and only then calls Destroy.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomComboBox


TFont

Hierarchy	Properties	Methods	Events	See also

TFont encapsulates a windows logical font.

Unit

graphics

Description

TFont describes font characteristics used when displaying text. TFont defines a set of characters by specifying the height, font family (typeface), attributes (such as bold or italic) and so on.


TFont properties

TFont	Alphabetically	Legend

In TFont

Charset

Color

FontAdapter

Handle

Height

Name

Pitch

PixelsPerInch

Size

Style

Derived from TGraphicsObject

OwnerCriticalSection


TFont properties

TFont	By object	Legend

Charset

Color

FontAdapter

Handle

Height

Name

OwnerCriticalSection

Pitch

PixelsPerInch

Size

Style


TFont.Charset

TFont	See also

Specifies the character set of the font.

property Charset: TFontCharset nodefault;

Description

Set Charset to identify the character set of the font. Each typeface (specified by the Name property) supports one or more character sets. Check the information supplied by the font vendor to determine what values of Charset are valid.


TFont.Color

TFont	See also 	Example

Specifies the color of the text.

property Color: TColor;

Description

Use Color to specify the color of the text characters (as opposed to the background color). If Color is set to a dithered color, the text appears in the closest non-dithered value.


TFont.FontAdapter

TFont	See also

Designates an interface for providing the font information to ActiveX controls.

property FontAdapter: IChangeNotifier;

Description

Do not use the FontAdapter property. FontAdapter is used internally by ActiveX controls to communicate font information through an OLE interface.


TFont.Handle

TFont	See also

Indicates the Windows GDI font object handle.

property Handle: HFont;

Description

Use Handle as a parameter when calling Windows API functions that require a font handle. Set Handle to make the TFont object represent the Windows font indicated by the font handle. Setting Handle releases the current Windows font resource.

Note:	When possible, change a font by setting the other properties of TFont rather than using the Handle property. Setting Handle does not reset the properties that describe the font. However, an OnChange event does occur when Handle is set directly by an application.


TFont.Height

TFont	See also

Specifies the height of the font.

property Height: Integer;

Description

Use Height to specify the height of the font in pixels. If the value is negative, the internal leading that appears at the top of each line of text is not measured. If the value is positive, Height represents the height of the characters plus the internal leading.

To specify the size of the font in points, use the Size property instead. Users usually specify font size in points, while applications may be concerned with the actual size of the font in pixels when displaying the font on the screen.

The value of Height can be optained from the point size using this formula:

Font.Height = -Font.Size * Font.PixelsPerInch / 72

When the Height property has a positive value, the Size property has a negative value. When the Size property has a positive value, the Height property has a negative value.


TFont.Name

TFont	See also	Example

Identifies the typeface of the font.

type TFontName = type string;

property Name: TFontName;

Description

Use Name to specify the typeface of the font. If the font family described by Name includes multiple character sets, be sure to set the CharSet property as well.

Note:	If the combination of Name, CharSet, Pitch, and Size specifies a font that is not available on the system, Windows substitutes a different font.


TFont.Pitch

TFont	See also

Specifies whether the characters in the font all have the same width.

type TFontPitch = (fpDefault, fpVariable, fpFixed);

property Pitch: TFontPitch;

Description

Each typeface has an associated pitch. The characters in fixed-pitch fonts are all the same width. The characters in variable-pitch fonts differ in width. Fixed pitch fonts are generally used for representing source code, because they allow the indentation to line up properly. Variable pitch fonts are generally used to give text a more natural appearance.

Here are the possible values for Pitch:

Value	Meaning

fpDefault	The font pitch is set to the default value, which depends on the font specified in the Name property.

fpFixed	The font pitch is set to fixed. All characters in the font have the same width.

fpVariable	The font pitch is set to variable. The characters in the font have different widths.

Setting the Pitch of a fixed-pitch font to fpVariable or a variable-pitch font to fpFixed will cause Windows to find what it considers the best match to all of the font characteristics that have been specified. This might have no effect on the appearance of a font, or might cause Windows to substitute a different font with the appropriate pitch. For example, setting the pitch of MS Serif (a variable-pitch font) to fpFixed causes Courier to be displayed.


TFont.PixelsPerInch

TFont	See also

Indicates the conversion factor between logical inches and the pixels of the device (printer or screen) using the font.

property PixelsPerInch: Integer;

Description

PixelsPerInch is used to ensure that when a font is copied from the form's canvas to the printer, the font is the same size in points. The PixelsPerInch property affects printer fonts only and should not be modified.

To modify the size of a font, use the Size or Height properties.


TFont.Size

TFont	See also

Specifies the height of the font in points.

property Size: Integer;

Description

Use Size to specify the point size of the font. If the value is negative, the internal leading that appears at the top of each line of text is included. If the value is positive, Size represents the height of the characters but not the internal leading.

To determine the size of the font in pixels, use the Height property instead. The value of Size can be optioned from the height in pixels using this formula:

Font.Size = -Font.Height * 72 / Font.PixelsPerInch

When the Size property has a positive value, the Height property has a negative value. When the Height property has a positive value, the Size property has a negative value.


TFont.Style

TFont	See also

Determines whether the font is normal, italic, underlined, bold, and so on.

type

  TFontStyle = (fsBold, fsItalic, fsUnderline, fsStrikeOut);

  TFontStyles = set of TFontStyle;

property Style: TFontStyles;

Description

Use Style to add special characteristics to characters that use the font. Style is a set containing zero or more values from the following:

Value	Meaning

fsBold	The font is boldfaced.

fsItalic	The font is italicized.

fsUnderline	The font is underlined.

fsStrikeout	The font is displayed with a horizontal line through it.


TFont events

TFont	Alphabetically

Derived from TGraphicsObject

OnChange


TFont events

TFont	By object

OnChange


TFont methods

TFont	Alphabetically

In TFont

Assign

Create

Destroy

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TFont methods

TFont	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TFont.Assign

TFont	See also 	Example

Copies the properties of another TFont object.

procedure Assign(Source: TPersistent); override;

Description

Call Assign to set the properties of the font to match the characteristics of the Source object. If Source is another TFont object, Assign matches the font characteristics of the source. Assign does not copy the PixelsPerInch property, so this method can be used to copy a screen font to a printer font, or vice versa.

If the Source parameter is not another TFont object, Assign calls the inherited method so that the font can be copied from any object that can assign font properties in its AssignTo method.


TFont.Create

TFont	See also

Creates and initializes an instance of TFont.

constructor Create;

Description

Call Create to create a font object at runtime. Create allocates memory for the font resource, and initializes the Color property to clWindowText. Create also initializes the PixelsPerInch property based on the screen resolution.


TFont.Destroy

TFont	See also

Destroys an instance of TFont.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TFont reference is not nil, and only then calls Destroy.Destroy frees the resource identified by the Handle property.


Scope

Published


Hierarchy

TObject

TPersistent

TGraphicsObject


 TFontDialog

Hierarchy	Properties	Methods	Events

TFontDialog displays a font-selection dialog.

Unit

dialogs

Description

TFontDialog displays a modal Windows dialog box for selecting fonts. The dialog does not appear at runtime until it is activated by a call to the Execute method. When the user selects a font and clicks OK, the dialog closes and the selected font is stored in the Font property.


TFontDialog properties

TFontDialog	Alphabetically	Legend

In TFontDialog

Device

Font

MaxFontSize

MinFontSize

Options

Derived from TCommonDialog

Ctl3D

Handle

HelpContext

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TFontDialog properties

TFontDialog	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Ctl3D

DesignInfo

Device

Font

Handle

HelpContext

MaxFontSize

MinFontSize

Name

Options

Owner

Tag

VCLComObject


TFontDialog.Device

TFontDialog

Specifies the device from which to retrieve the list of available fonts.

type TFontDialogDevice = (fdScreen, fdPrinter, fdBoth);

property Device: TFontDialogDevice;

Description

These are the possible values of Device:

Value	Meaning

fdScreen	Retrieve from the screen.

fdPrinter	Retrieve from the printer.

fdBoth	Retrieve from both the screen and the printer.


TFontDialog.Font

Example

Indicates the selected font.

property Font: TFont;

Description

When the user selects a font in the dialog box and clicks OK, the selected font becomes the value of the Font property. To make a default font appear in the dialog when it opens, assign a value to Font in the Object Inspector or in program code.


TFontDialog.MaxFontSize

TFontDialog	See also 	Example

Determines the largest font size available in the Font dialog.

property MaxFontSize: Integer;

Description

Assign a value to MaxFontSize to limit the font sizes available in the dialog.

MaxFontSize is inoperative unless the fdLimitSize flag is set in Options.


TFontDialog.MinFontSize

TFontDialog	See also 	Example

Determines the smallest font size available in the Font dialog.

property MinFontSize: Integer;

Description

Assign a value to MinFontSize to limit the font sizes available in the dialog.

MinFontSize is inoperative unless the fdLimitSize flag is set in Options.


TFontDialog.Options

TFontDialog	See also 	Example

Determines the appearance and behavior of the Font dialog.

type

  TFontDialogOption = (fdAnsiOnly, fdTrueTypeOnly, fdEffects, fdFixedPitchOnly, fdForceFontExist, fdNoFaceSel, fdNoOEMFonts, fdNoSimulations, fdNoSizeSel, fdNoStyleSel, fdNoVectorFonts, fdShowHelp, fdWysiwyg, fdLimitSize, fdScalableOnly, fdApplyButton);

  TFontDialogOptions = set of TFontDialogOption;

property Options: TFontDialogOptions;

Description

Use the Options property to customize the appearance and functionality of the dialog. The possible values of Options are:

Value	Meaning

fdAnsiOnly	Displays only fonts that use the Windows character set. Symbol fonts are not listed in the dialog.

fdApplyButton	Displays an Apply button in the dialog, whether or not there is an OnApply event handler.

fdEffects	Displays the Effects check boxes (Strikeout and Underline) and the Color list box in the dialog.

fdFixedPitchOnly	Displays only monospaced fonts in the dialog. Proportionally spaced fonts are not listed, nor are TrueType fonts that do not have the fixed-pitch flag set in the style header.

fdForceFontExist	Allows the user to enter only fonts that are displayed in the dialog (that is, listed in the Font combo box). If the user tries to enter another font name, an error message appears.

fdLimitSize	Enables the MaxFontSize and MinFontSize properties, limiting the range of font sizes that appear in the dialog if these properties have values.

fdNoFaceSel	Causes the dialog to open without a preselected font name in the Font combo box.

fdNoOEMFonts	Removes OEM fonts from the dialog’s combo box. Lists only non-OEM fonts.

fdScalableOnly	Displays only scalable fonts in the dialog. Non-scalable (bitmap) fonts are removed from the list.

fdNoSimulations	Displays only fonts and font styles that are directly supported by the font definition file. GDI-synthesized bold and italic styles (for bitmap fonts) are not listed.

fdNoSizeSel	Causes the dialog to open without a preselected size in the Size combo box.

fdNoStyleSel	Causes the dialog to open without a preselected style in the Font Style combo box.

fdNoVectorFonts	Removes vector fonts from the dialog’s combo box; lists only non-vector fonts. (Vector fonts are Windows 1.0 fonts, such as Roman or Script, which resemble pen-plotter output.)

fdShowHelp	Displays a Help button in the dialog.

fdTrueTypeOnly	Displays only TrueType fonts in the dialog. Other fonts are not listed.

fdWysiwyg	Displays only fonts that are available to both the printer and the screen. Device-specific fonts are not listed in the dialog.

By default, all options except fdEffects are off.


TFontDialog events

TFontDialog	Alphabetically	Legend

In TFontDialog

OnApply

Derived from TCommonDialog

OnClose

OnShow


TFontDialog events

TFontDialog	By object	Legend

OnApply

OnClose

OnShow


TFontDialog.OnApply

TFontDialog	See also 	Example

Occurs when the user clicks the Apply button.

type TFDApplyEvent = procedure(Sender: TObject; Wnd: HWND) of object;

property OnApply: TFDApplyEvent;

Description

The Apply button appears in the dialog if an event handler is assigned to OnApply or if the fdApplyButton flag is set in Options. Use an OnApply event handler to apply the selected font without closing the Font dialog box.

The Wnd parameter is the Font dialog’s window handle. Wnd has the same value as the Handle property and is maintained for backward compatibility.


TFontDialog methods

TFontDialog	Alphabetically

In TFontDialog

Create

Destroy

Execute

Derived from TCommonDialog

DefaultHandler

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFontDialog methods

TFontDialog	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Execute

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TFontDialog.Create

TFontDialog 	See also

Creates and initializes a TFontDialog instance.

constructor Create(AOwner: TComponent); override;

Description

The Create method generates a TFontDialog instance, but the new dialog does not appear on the form at runtime until the Execute method is called.


TFontDialog.Create
TFontDialog.Destroy

TFontDialog	See also

Destroys the TFontDialog and frees its memory.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Call Free instead. Free verifies that the TFontDialog reference is not nil before calling Destroy.


TFontDialog.Execute

TFontDialog 	Example

Displays the Font dialog.

function Execute: Boolean; override;

Description

Execute opens the Font dialog, returning True when the user selects a font and clicks OK.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog


TForm

Hierarchy 	Properties	Methods	Events	See also

TForm is the component for a standard application window (form).

Unit

forms

Description

When you create forms in the Form designer at design time, they are implemented as descendants of TForm. Forms can represent the application’s main window, dialog boxes, or MDI children. A form can contain other objects, such as TButton, TCheckBox, and TComboBox objects.

Examples of forms include TLoginDialog and TPasswordDialog objects.


TForm properties

TForm	Alphabetically	Legend

Derived from TCustomForm

Active

ActiveControl

ActiveMDIChild

ActiveOleControl

BorderIcons

BorderStyle

Canvas

ClientHandle

ClientHeight

ClientRect

ClientWidth

DefaultMonitor

Designer

DropTarget

Floating

FormState

FormStyle

HelpFile

Icon

KeyPreview

MDIChildCount

MDIChildren

Menu

ModalResult

Monitor

ObjectMenuItem

OldCreateOrder

OleFormObject

Parent

ParentBiDiMode

PixelsPerInch

Position

PrintScale

Scaled

TileMode

Visible

WindowMenu

WindowState

Derived from TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

BorderWidth

Brush

ClientOrigin

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DockManager

DockSite

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

UseDockManager

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

AutoSize

BiDiMode

Align

BoundsRect

Caption

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragKind

DragMode

Enabled

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

ParentFont

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TForm properties

TForm	By object	Legend

Action

Active

ActiveControl

ActiveMDIChild

ActiveOleControl

Align

Anchors

AutoScroll

AutoSize

BiDiMode

BorderIcons

BorderStyle

BorderWidth

BoundsRect

Brush

Canvas

Caption

ClientHandle

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DefaultMonitor

Designer

DesignInfo

DockClientCount

DockClients

DockManager

DockOrientation

DockSite

DoubleBuffered

DragKind

DragMode

DropTarget

Enabled

Floating

FloatingDockSiteClass

Font

FormState

FormStyle

Handle

Height

HelpContext

HelpFile

Hint

HorzScrollBar

HostDockSite

Icon

KeyPreview

Left

LRDockWidth

MDIChildCount

MDIChildren

Menu

ModalResult

Monitor

Name

ObjectMenuItem

OldCreateOrder

OleFormObject

Owner

Parent

ParentBiDiMode

ParentFont

ParentWindow

PixelsPerInch

PopupMenu

Position

PrintScale

Scaled

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

TileMode

Top

UndockHeight

UndockWidth

UseDockManager

VCLComObject

VertScrollBar

Visible

VisibleDockClientCount

Width

WindowMenu

WindowProc

WindowState


TForm events

TForm	Alphabetically	Legend

Derived from TCustomForm

OnActivate

OnClose

OnCloseQuery

OnCreate

OnDeactivate

OnDestroy

OnHelp

OnHide

OnPaint

OnShortCut

OnShow

Derived from TWinControl

OnDockDrop

OnDockOver

OnGetSiteInfo

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseWheel

OnMouseWheelDown

OnMouseWheelUp

OnUndock

Derived from TControl

OnCanResize

OnClick

OnConstrainedResize

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock


TForm events

TForm	By object	Legend

OnActivate

OnCanResize

OnClick

OnClose

OnCloseQuery

OnConstrainedResize

OnContextPopup

OnCreate

OnDblClick

OnDeactivate

OnDestroy

OnDockDrop

OnDockOver

OnDragDrop

OnDragOver

OnEndDock

OnGetSiteInfo

OnHelp

OnHide

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnMouseWheel

OnMouseWheelDown

OnMouseWheelUp

OnPaint

OnResize

OnShortCut

OnShow

OnStartDock

OnUndock


TForm methods

TForm	Alphabetically

In TForm

ArrangeIcons

Cascade

Next

Previous

Tile

Derived from TCustomForm

AfterConstruction

BeforeDestruction

Close

CloseQuery

Create

CreateNew

DefocusControl

Destroy

FocusControl

GetFormImage

Hide

IsShortCut

MouseWheelHandler

Print

Release

SendCancelMode

SetFocus

SetFocusedControl

Show

ShowModal

WantChildKey

Derived from TScrollingWinControl

DisableAutoRange

EnableAutoRange

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TForm methods

TForm	By object

AfterConstruction

ArrangeIcons

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

Cascade

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

Close

CloseQuery

ContainsControl

ControlAtPos

Create

CreateNew

CreateParented

CreateParentedControl

DefaultHandler

DefocusControl

Destroy

DestroyComponents

Destroying

DisableAlign

DisableAutoRange

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EnableAutoRange

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

FocusControl

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetFormImage

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

IsShortCut

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

Next

PaintTo

Perform

Previous

Print

Realign

Refresh

Release

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendCancelMode

SendToBack

SetBounds

SetFocus

SetFocusedControl

SetTextBuf

Show

ShowModal

Tile

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

WantChildKey


TForm.ArrangeIcons

TForm	See also 	Example

Arranges the icons of minimized MDI child forms.

procedure ArrangeIcons;

Description

Use ArrangeIcons to arrange the icons of minimized MDI child forms so they are evenly spaced and don't overlap.

ArrangeIcons works only if the form is an MDI parent form (that is, if the form’s FormStyle property is fsMDIForm).


TForm.Cascade

TForm	See also 	Example

Arranges MDI child forms so they overlap.

procedure Cascade;

Description

Use Cascade to arrange MDI child forms so they overlap.

Cascade works only if the form is an MDI parent form (that is, if the form’s FormStyle property is fsMDIForm).


TForm.Next

TForm	See also

Activates the next child form in the form sequence.

procedure Next;

Description

Use Next to change the active child form of an MDI parent. For example, if you have three child forms within a parent form and Form2 is the active form, the Next method makes Form3 the active form. Calling Next again makes Form4 active. The next time your application calls Next, the sequence starts over again and Form2 becomes the active form once again.

The Next method applies only to forms that are MDI parent forms (have a FormStyle property value of fsMDIForm).


TForm.Previous

TForm	See also

Activates the previous MDI child form in the form sequence.

procedure Previous;

Description

Use Previous to change the active child form of an MDI parent. For example, if you have three child forms within a parent form and Form4 is the active form, the Previous method makes Form3 the active form. Calling Previous again makes Form2 active. The next time your application calls Previous, the sequence starts over again and Form4 becomes the active form once again.

The Previous method applies only to forms that are MDI parent forms (have a FormStyle property value of fsMDIForm).


TForm.Tile

TForm	See also	Example

Arranges MDI child forms so that they are all the same size.

procedure Tile;

Description

Use Tile to arrange MDI child forms so that they are all the same size. Tiled forms completely fill up the client area of the parent form. How the forms arrange themselves depends upon the values of their TileMode properties.

Tile works only if the form is an MDI parent form (that is, if the form’s FormStyle property is fsMDIForm).


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TScrollingWinControl

TCustomForm


 TFrame

Hierarchy	Properties	Methods	Events	See also

TFrame is a container for components; it can be nested within forms or other frames.

Unit

forms

Description

When you create frames, they are implemented as descendants of TFrame.

A frame, like a form, is a container for other components. It uses the same ownership mechanism as forms for automatic instantiation and destruction of the components on it, and the same parent-child relationships for synchronization of component properties. But frames can be nested within forms or other frames, and they can be saved on the Component palette for easy reuse. After a frame is created and saved, it continues to function as a unit and to inherit changes from the components (including other frames) it contains. Moreover, an embedded frame continues to inherit changes made to the frame from which it is derived.


TFrame properties

TFrame	Alphabetically	Legend

Derived from TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DockSite

DoubleBuffered

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

AutoSize

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TFrame properties

TFrame	By object	Legend

Action

Align

Anchors

AutoScroll

AutoSize

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DockSite

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HorzScrollBar

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

VertScrollBar

Visible

VisibleDockClientCount

Width

WindowProc


TFrame events

TFrame	Alphabetically	Legend

Derived from TWinControl

OnDockDrop

OnDockOver

OnEnter

OnExit

OnGetSiteInfo

OnMouseWheel

OnMouseWheelDown

OnMouseWheelUp

OnUndock

Derived from TControl

OnCanResize

OnClick

OnConstrainedResize

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock

OnStartDrag


TFrame events

TFrame	By object	Legend

OnCanResize

OnClick

OnConstrainedResize

OnContextPopup

OnDblClick

OnDockDrop

OnDockOver

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnGetSiteInfo

OnMouseDown

OnMouseMove

OnMouseUp

OnMouseWheel

OnMouseWheelDown

OnMouseWheelUp

OnResize

OnStartDock

OnStartDrag

OnUndock


TFrame methods

TFrame	Alphabetically

In TCustomFrame

Create

Derived from TScrollingWinControl

Destroy

DisableAutoRange

EnableAutoRange

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFrame methods

TFrame	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

DisableAutoRange

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EnableAutoRange

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TScrollingWinControl

TCustomFrame


TGraphicField

Hierarchy	Properties	Methods	Events	See also

TGraphicField represents a graphics field in a dataset.

Unit

db

Description

TGraphicField is a persistent field object that encapsulates the fundamental behavior common to graphic data. Graphics fields are a form of binary large object (BLOB) field where the data includes a BLOB header describing the encoding of the graphical value. TGraphicField differs from its immediate ancestor TBlobField only in having a DataType of ftGraphic. As a descendant of TBlobField, TGraphicField includes many properties, methods, and events that are useful for managing the value and properties of a BLOB field in a database.

As with all persistent field objects, a TGraphicField can be created at design-time using the Fields Editor or at runtime by calling the constructor for the class. Persistent field objects exist solely in the memory space of a Delphi application. Creating a persistent field object only creates an object in the application, and does not result in the creation of a field in a table.

Fields in a table can be accessed without use of persistent field objects. Virtual field objects are created to provide access to a field when the field is referenced through such means as the TDataSet.Fields property or the TDataSet.FieldByName method. However, as both the Fields property and the FieldByName method return a value of type TField, the return value must be typecast as a TGraphicField or TBlobField before using any property specific to TGraphicField or TBlobField.


TGraphicField properties

TGraphicField	Alphabetically	Legend

Derived from TBlobField

AsString

AsVariant

BlobSize

BlobType

IsNull

Modified

Transliterate

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TGraphicField properties

TGraphicField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

BlobSize

BlobType

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Modified

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

Transliterate

ValidChars

Value

VCLComObject

Visible


TGraphicField events

TGraphicField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TGraphicField events

TGraphicField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TGraphicField methods

TGraphicField	Alphabetically

In TGraphicField

Create

Derived from TBlobField

Assign

Clear

IsBlob

LoadFromFile

LoadFromStream

SaveToFile

SaveToStream

SetFieldType

Derived from TField

AssignValue

Destroy

FocusControl

GetData

IsValidChar

RefreshLookupList

SetData

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TGraphicField methods

TGraphicField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SaveToFile

SaveToStream

SetData

SetFieldType

UpdateAction

Validate


TGraphicField.Create

TGraphicField	See also

Creates an instance of TGraphicField.

constructor Create(AOwner: TComponent); override;

Description

Create creates and initializes an instance of TGraphicField. After calling the inherited constructor, Create sets the DataType to ftGraphic.

After instantiating a TGraphicField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TGraphicField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TGraphicField with a dataset component by setting its DataSet property to the name of the dataset component.

The example below creates a TGraphicField object for a field named Pics accessed through a TQuery named Query1.

var

  T: TGraphicField;

begin

  Query1.Close;

  T := TGraphicField.Create(Self);

  T.FieldName := 'Pics';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TBlobField


TGraphic

Hierarchy	Properties	Methods	Events	See also

TGraphic is the abstract base class type for objects such as icons, bitmaps, and metafiles that can store and display visual images.

Unit

graphics

Description

TGraphic is an abstract class that cannot be instantiated. Descendant graphics objects override many of the methods of TGraphic to address the needs of their particular file format and graphical characteristics. TGraphic also introduces methods that work with TPicture objects and the Clipboard. Properties of TGraphic provide information about the state and size of the graphic image.

When the type of graphic (bitmap, icon, or metafile) is known, store the graphic in its specific type object (TBitmap, TIcon, or TMetafile, respectively). Otherwise, use a TPicture object that can hold any type of TGraphic.


TGraphic properties

TGraphic	Alphabetically	Legend

In TGraphic

Empty

Height

Modified

Palette

PaletteModified

Transparent

Width


TGraphic properties

TGraphic	By object	Legend

Empty

Height

Modified

Palette

PaletteModified

Transparent

Width


TGraphic.Empty

TGraphic 	Example

Indicates whether the graphics object contains a graphic.

property Empty: Boolean;

Description

Use Empty to determine whether the graphic is bound to an image. Each descendant graphic object defines its own Get method to access the Empty property.


TGraphic.Height

TGraphic

Specifies the vertical size of the graphic in pixels.

property Height: Integer;

Description

Use Height to determine the height of the graphic image. Each descendant graphic object defines its own Get and Set methods to access the Height property.


TGraphic.Modified

TGraphic

Indicates whether the graphics object has been changed or edited.

property Modified: Boolean;

Description

If Modified is True, the graphic object has changed. If Modified is False, the graphics object is in the same state as when the object was loaded.

The Modified property indicates only if bitmap objects have been modified. Modified is not True if the graphics object contains an icon or metafile graphic, even if they have been modified.

If the graphics object was modified, save the changes to a file with the SaveToFile method. The next time the application runs, it can load the graphic from the file with the LoadFromFile method.


TGraphic.Palette

TGraphic

Indicates the color palette of the graphical image.

property Palette: HPALETTE;

Description

Use Palette to get the color palette of a graphical image. If the graphic does not need or does not use a palette, the Palette property is zero.


TGraphic.PaletteModified

TGraphic

Indicates whether the palette has changed.

property PaletteModified: Boolean;

Description

Use PaletteModified to determine if the palette used for a graphical image has changed. PaletteModified is used in the OnChange event. PaletteModified remains True until whoever's responsible for realizing this new palette (for example, TImage) sets it to False.


TGraphic.Transparent

TGraphic 	Example

Indicates whether the image covers its rectangular area.

property Transparent: Boolean;

Description

Use Transparent to specify that the graphic be drawn transparently. Some descendants of TGraphic such as TIcon and TMetafile are always transparent, so setting the property for those objects does not change their behavior. However, the TBitmap graphic's drawing is affected by this property. The TImage component sets this property to be the same as its Transparent property to achieve transparent painting.


TGraphic.Width

TGraphic

Determines the maximum width of the graphics object in pixels.

property Width: Integer;

Description

Each descendant graphic object defines its own Get and Set methods to access the Width property.


TGraphic events

TGraphic	Alphabetically

In TGraphic

OnChange

OnProgress


TGraphic events

TGraphic	By object

OnChange

OnProgress


TGraphic.OnChange

TGraphic

Occurs whenever a graphical image changes.

property OnChange: TNotifyEvent;

Description

Use OnChange to write a handler to perform an action then the graphical image changes.


TGraphic.OnProgress

TGraphic	See also

Occurs when a graphical image is in the process of changing.

type

  TProgressStage = (psStarting, psRunning, psEnding);

  TProgressEvent = procedure (Sender: TObject; Stage: TProgressStage; PercentDone: Byte; RedrawNow: Boolean; const R: TRect; const Msg: string) of object;

property OnProgress: TProgressEvent;

Description

For certain descendants of TGraphic, OnProgress occurs during slow processes such as loading, storing, or transforming image data. OnProgress allows applications to provide feedback to the user about the progress of the slow process.

Component writers can generate OnProgress events for new descendants of TGraphic by calling the protected Progress method. These events are propagated to the TPicture and TImage objects.

The Stage parameter indicates whether the operation is beginning, continuing, or ending. If the OnProgress event handler displays an indicator such as a progress bar, the indicator can be created when Stage is psStarting, updated while Stage is psRunning, and removed when Stage is psEnding. The PercentDone parameter is an approximation of how much of the operation has completed. Use PercentDone to update the position of a progress bar or other indicator.

The RedrawNow parameter indicates whether the image can safely be drawn on screen at this point. The R parameter specifies the portion of the image that has changed and needs to be redrawn.

The Msg parameter contains one or two words that describe what operation is occurring. For example, the value of Msg could be a string such as Loading, Storing, or Reducing colors. The Msg string can also be empty.


TGraphic methods

TGraphic	Alphabetically

In TGraphic

LoadFromClipboardFormat

LoadFromFile

LoadFromStream

SaveToClipboardFormat

SaveToFile

SaveToStream

Derived from TPersistent

Assign

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TGraphic methods

TGraphic	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

LoadFromClipboardFormat

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

SafeCallException

SaveToClipboardFormat

SaveToFile

SaveToStream


TGraphic.LoadFromClipboardFormat

TGraphic	See also

Introduces an abstract method that loads the image from a variable in Clipboard format.

procedure LoadFromClipboardFormat(AFormat: Word; AData: THandle; APalette: HPALETTE); virtual; abstract;

Description

Each descendant graphic object defines a LoadFromClipboardFormat method that replaces the current graphic image with the graphic indicated by AData, which it loads from the Clipboard.

The format for the new graphic object must be registered with the Clipboard in the RegisterClipboardFormat method, or an exception is raised.


TGraphic.LoadFromFile

TGraphic 	See also	Example

Loads a graphic image stored in a file.

procedure LoadFromFile(const FileName: string); virtual;

Description

LoadFromFile reads the file specified in FileName and loads the data into the graphics object.


TGraphic.LoadFromStream

TGraphic 	See also

Introduces an abstract method that loads the image from a stream.

procedure LoadFromStream(Stream: TStream); virtual; abstract;

Description

Each descendant graphic object defines a LoadFromStream method that loads a graphics object from Stream.


TGraphic.SaveToClipboardFormat

TGraphic	See also

Introduces an abstract method that assigns the graphic to a variable in clipboard format.

procedure SaveToClipboardFormat(var AFormat: Word; var AData: THandle; var APalette: HPALETTE); virtual; abstract;

Description

Each descendant graphic object defines a SaveToClipboardFormat method that saves that particular graphic image type to a Clipboard format. An application must have registered the format with the TGraphic object using the RegisterClipboardFormat method.


TGraphic.SaveToFile

TGraphic	Example

Saves a graphics image to a file.

procedure SaveToFile(const FileName: string); virtual;

Description

SaveToFile writes the graphic to a file, specified by FileName.


TGraphic.SaveToStream

TGraphic

Introduces an abstract method that saves the graphic image to a stream.

procedure SaveToStream(Stream: TStream); virtual; abstract;

Description

Each descendant graphic object defines a SaveToStream method that saves a the object to a Stream.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TGraphicsObject

Hierarchy	Properties	Methods	Events	See also

TGraphicsObject is the abstract base class for objects which encapsulate a Windows graphics object: TBrush, TFont, and TPen.

Unit

graphics

Description

Create descendants of TGraphicsObject when drawing an image to a canvas (TCanvas). Each TGraphicsObject object describes a Windows graphics object that is selected into the device context of the canvas.

TGraphicsObject introduces a mechanism for responding to changes in the properties of the graphics object.


TGraphicsObject properties

TGraphicsObject	Alphabetically

In TGraphicsObject

OwnerCriticalSection


TGraphicsObject properties

TGraphicsObject	By object

OwnerCriticalSection


TGraphicsObject.OwnerCriticalSection

TGraphicsObject	See also

Points to the TRTLCriticalSection that the canvas which draws with this graphics object uses to lock out other threads.

type

  PRTLCriticalSection = ^TRTLCriticalSection;

  TRTLCriticalSection = record

    DebugInfo: PRTLCriticalSectionDebug;

    LockCount: Longint;

    RecursionCount: Longint;

    OwningThread: THandle;

    LockSemaphore: THandle;

    Reserved: DWORD;

  end;

property OwnerCriticalSection: PRTLCriticalSection;

Description

Use OwnerCriticalSection to obtain information about the thread locking state of the canvas that draws with this graphics object. The canvas sets OwnerCriticalSection when it creates the graphics object. Do not change this property while the canvas is using the graphics object.

If the graphics object is created on behalf of a drawing surface that is not a canvas, set OwnerCriticalSection to an initialized TRTLCriticalSection that is maintained by the drawing surface.

To use OwnerCriticalSection to block other execution threads, use the Lock method.


TGraphicsObject events

TGraphicsObject	Alphabetically

In TGraphicsObject

OnChange


TGraphicsObject events

TGraphicsObject	By object

OnChange


TGraphicsObject.OnChange

TGraphicsObject	See also

Occurs immediately after the Windows graphics object changes.

property OnChange: TNotifyEvent;

Description

Write an OnChange event handler to take specific action when the graphics object changes. The properties of the graphics object reflect the new settings when OnChange occurs.


TGraphicsObject methods

TGraphicsObject	Alphabetically	Legend

In TGraphicsObject

Changed

Lock

Unlock

Derived from TPersistent

Assign

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TGraphicsObject methods

TGraphicsObject	By object	Legend

AfterConstruction

Assign

BeforeDestruction

Changed

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

Lock

MethodAddress

MethodName

NewInstance

SafeCallException

Unlock


TGraphicsObject.Changed

TGraphicsObject	See also

Generates an OnChange event when the properties of the graphics object change.

procedure Changed; dynamic;

Description

Descendants of TGraphicsObject call Changed after making changes to the properties encapsulated by the TGraphicsObject object.


TGraphicsObject.Lock

TGraphicsObject	See also

Blocks other execution threads from using the associated canvas until the Unlock method is called.

procedure Lock;

Description

Call Lock in a multithreaded application before using the graphics object in a section of code that would not otherwise be thread-safe. Lock prevents other cooperating threads in the application from using the associated canvas until the Unlock method is called. Calls to Lock can be nested so that the canvas is not unlocked until the last lock is released.

Because Lock prevents other threads from executing, it can adversely affect performance. Do not call Lock unless there is a danger that another thread might interfere with the drawing.

Note:	Lock will do nothing unless the drawing surface sets the OwnerCriticalSection property. TCanvas objects automatically set the OwnerCriticalSection property when they use graphics objects.


TGraphicsObject.Unlock

TGraphicsObject	See also

Releases the lock on execution threads set by the Lock method.

procedure Unlock;

Description

Call Unlock at the end of a thread-sensitive section of code that was started with a call to the Lock method. When every call to Lock is balanced by a call to Unlock, other threads are allowed to lock the associated canvas.


Scope

Protected


Hierarchy

TObject

TPersistent


TGridDataLink

Hierarchy	Properties	Methods	See also

TGridDataLink helps manage the link to a data source and maintain the field mapping for a TCustomDBGrid object.

Unit

dbgrids

Description

TGridDataLink is tailored to work with a TCustomDBGrid. It should only be used by the TCustomDBGrid class.


TGridDataLink properties

TGridDataLink	Alphabetically	Legend

In TGridDataLink

DefaultFields

FieldCount

Fields

SparseMap

Derived from TDataLink

Active

ActiveRecord

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

ReadOnly

RecordCount


TGridDataLink properties

TGridDataLink	By object	Legend

Active

ActiveRecord

BufferCount

DataSet

DataSource

DataSourceFixed

DefaultFields

Editing

FieldCount

Fields

ReadOnly

RecordCount

SparseMap


TGridDataLink.DefaultFields

TGridDataLink	See also

Indicates whether the dataset’s underlying field components are generated dynamically when the dataset is opened.

property DefaultFields: Boolean;

Description

Read DefaultFields to determine whether or not a dataset uses dynamically generated field components or persistent field components. If DefaultFields is True, the dataset uses dynamically allocated field components. If DefaultFields is False, the dataset uses persistent field components or the custom field mapping contains unmapped fields.

If DefaultFields is False, the TCustomDBGrid may not show all the fields that are present in the underlying database table.


TGridDataLink.FieldCount

TGridDataLink	See also 	Example

Indicates the number of entries in the field map.

property FieldCount: Integer;

Description

Read FieldCount to determine the number of entries in the field map. Used with the Fields property, this is useful for applications that need to iterate over all of the mapped fields.

FieldCount is the same as the number of columns in the TCustomDBGrid. The field map can contain undefined fields, which do not appear in the dataset. Undefined fields in the field map stand in for fields in the columns of the grid that are not in the dataset, such as calculated fields.


TGridDataLink.Fields

TGridDataLink	See also	Example

Lists all the field components contained in the field map.

property Fields[I: Integer]: TField;

Description

Use Fields to access field components by index number. Fields is a zero-based array. If the SparseMap property is True, the field map may contain undefined fields. For these entries, Fields returns nil.


TGridDataLink.SparseMap

TGridDataLink	See also

Indicates whether the associated grid has customized the field map (which means it may contain undefined fields).

property SparseMap: Boolean

Description

Read SparseMap to determine whether the field map is not a simple reflection of the underlying dataset. The TCustomDBGrid sets SparseMap when it builds the field map. SparseMap is False if the TCustomDBGrid builds a default field map directly from the dataset. Any changes to the field components associated with each column cause TCustomDBGrid to change SparseMap to True. When SparseMap is True, the field map may contain undefined fields if the column attributes indicate an invalid field name or an unassigned field component.


TGridDataLink methods

TGridDataLink	Alphabetically	Legend

In TGridDataLink

ActiveChanged

AddMapping

ClearMapping

Create

DataSetChanged

DataSetScrolled

Destroy

EditingChanged

FocusControl

GetMappedIndex

LayoutChanged

Modified

RecordChanged

Reset

UpdateData

Derived from TDataLink

Edit

ExecuteAction

UpdateAction

UpdateRecord

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TGridDataLink methods

TGridDataLink	By object	Legend

ActiveChanged

AddMapping

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClearMapping

Create

DataSetChanged

DataSetScrolled

DefaultHandler

Destroy

Dispatch

Edit

EditingChanged

ExecuteAction

FieldAddress

FocusControl

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetMappedIndex

GetNamePath

InheritsFrom

InitInstance

InstanceSize

LayoutChanged

MethodAddress

MethodName

Modified

NewInstance

RecordChanged

Reset

SafeCallException

UpdateAction

UpdateData

UpdateRecord


TGridDataLink.ActiveChanged

TGridDataLink	See also

Informs the TCustomDBGrid of changes in the Active property.

procedure ActiveChanged; override;

Description

Applications can not call the ActiveChanged procedure directly. Changes in the Active property trigger this procedure. When the dataset becomes inactive, ActiveChanged makes sure that the grid is not in edit mode. When the dataset becomes active, ActiveChanged makes sure that the grid does not contain references to fields that are no longer in the dataset, and that the grid does is not scrolled inappropriately.


TGridDataLink.AddMapping

TGridDataLink	See also

Adds a field component to the end of the field map.

function AddMapping(const FieldName: String): Boolean;

Description

Applications should not call AddMapping directly, because this would cause the field map to become out of sync with the columns in TCustomDBGrid. TCustomDBGrid calls AddMapping iteratively to build a field map that corresponds to its columns.


TGridDataLink.ClearMapping

TGridDataLink	See also

Empties the field map and frees any associated memory.

procedure ClearMapping;

Description

Applications should not call ClearMapping directly, because this would cause the field map to become out of sync with the columns of the TCustomDBGrid. The TCustomDBGrid calls ClearMapping first, every time it regenerates the field map.


TGridDataLink.Create

TGridDataLink	See also

Creates an instance of TGridDataLink.

constructor Create(AGrid: TCustomDBGrid);

Description

Applications should not call the Create method for a TGridDataLink directly. The TCustomDBGrid object that owns a TGridDataLink calls Create from its own constructor.


TGridDataLink.DataSetChanged

TGridDataLink	See also

Informs TCustomDBGrid of changes to the dataset.

procedure DataSetChanged; override;

Description

Applications can not call DataSetChanged directly. Changes to the contents of the dataset trigger this method automatically. DataSetChanged allows the TCustomDBGrid to keep track of when the contents of the dataset change.


TGridDataLink.DataSetScrolled

TGridDataLink	See also

Informs the TCustomDBGrid when the dataset has finished scrolling.

procedure DataSetScrolled(Distance: Integer); override;

Description

Applications can not call the DataSetScrolled procedure directly. This procedure is called automatically after the dataset for the TCustomDBGrid scrolls. TGridDataLink informs the TCustomDBGrid that a scroll of the dataset has just occurred by calling its Scroll method.


TGridDataLink.Destroy

TGridDataLink	See also

Destroys an instance of TGridDataLink.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. The TCustomDBGrid that owns a TGridDataLink calls Free from its own destructor to destroy the TGridDataLink object.

Destroy frees up the memory used by the field map before calling the inherited destructor.


TGridDataLink.EditingChanged

TGridDataLink	See also

Informs the TCustomDBGrid of changes in the editing state of the dataset.

procedure EditingChanged; override;

Description

Applications can not call the EditingChanged procedure directly. Changes in the Editing property trigger this procedure. EditingChanged allows the TCustomDBGrid to provide visual feedback to the user about the editing state of the dataset.


TGridDataLink.FocusControl

TGridDataLink	See also

Displays the editor and gives focus to a field control in the TCustomDBGrid object.

procedure FocusControl(Field: TFieldRef); override;

Description

Call the FocusControl procedure to bring up the editor for the representation of Field in the TCustomDBGrid. FocusControl selects Field in the TCustomDBGrid, and then tells the TCustomDBGrid object to bring up the editor.


TGridDataLink.GetMappedIndex

TGridDataLink	See also

GetMappedIndex provides the index of a field component in the dataset that corresponds to an index within the field map.

function GetMappedIndex(ColIndex: Integer): Integer;

Description

Use GetMappedIndex on an index into the field map to get an index into the dataset for the same field component. Both the field map and the dataset are zero-based arrays. If an entry in the field map is an undefined field, GetMappedIndex returns -1.


TGridDataLink.LayoutChanged

TGridDataLink	See also

Informs the grid after the layout of the TCustomDBGrid has changed in a way that affects the representation of the dataset.

procedure LayoutChanged; override;

Description

Applications can not call the LayoutChanged method directly. The TCustomDBGrid that owns the TGridDataLink calls this method automatically when layout changes affect the representation of the dataset. LayoutChanged allows the TCustomDBGrid to regenerate its layout by calling its LayoutChanged method.


TGridDataLink.Modified

TGridDataLink	See also

Tracks changes to the data which have not been written to the current record in the database.

procedure Modified;

Description

Applications should not call Modified directly. Modified is called automatically whenever the TCustomDBGrid starts editing one of its fields. Modified allows the TGridDataLink to keep track of whether there are any edits that have not been posted.


TGridDataLink.RecordChanged

TGridDataLink	See also

Informs the grid of changes in the current record or field of the DataSource.

procedure RecordChanged(Field: TField);

Description

Applications can not call RecordChanged directly. It is called automatically when the contents of the current record change. The Field parameter indicates which field in the current record has changed. If Field is nil, the entire record has changed.

RecordChanged informs TCustomDBGrid of these changes so that it can update the display of the affected column or columns.


TGridDataLink.Reset

TGridDataLink	See also

Cancels any pending edits to the dataset that have not been written to the current record in the database.

procedure Reset;

Description

Reset is triggered by user actions that cancel any pending edits to the dataset.


TGridDataLink.UpdateData

TGridDataLink	See also

Allows the grid to post changes to the dataset.

procedure UpdateData;

Description

Applications can not call the UpdateData procedure directly. It is called automatically when pending changes need to be posted to the dataset. UpdateData tells the TCustomDBGrid to write any unposted changes to the current field to the underlying Field component.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink


 TGroupBox

Hierarchy	Properties	Methods	Events	See also

TGroupBox represents a Windows group box.

Unit

stdctrls

Description

The TGroupBox component represents a standard Windows group box, used to group related controls on a form. When another control component is placed within a group box, the group box becomes the parent of that component.


TGroupBox properties

TGroupBox	Alphabetically	Legend

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DockSite

DoubleBuffered

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

Caption

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TGroupBox properties

TGroupBox	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DockSite

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TGroupBox events

TGroupBox	Alphabetically	Legend

Derived from TWinControl

OnDockDrop

OnDockOver

OnEnter

OnExit

OnGetSiteInfo

OnUnDock

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TGroupBox events

TGroupBox	By object	Legend

OnClick

OnContextPopup

OnDblClick

OnDockDrop

OnDockOver

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnGetSiteInfo

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag

OnUnDock


TGroupBox methods

TGroupBox	Alphabetically

Derived from TCustomGroupBox

Create

Derived from TCustomControl

DestroyTCustomControl_Destroy>Main

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TGroupBox methods

TGroupBox	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBarTControl_UseRightToLeftScrollBar>Main


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGroupBox


TGraphicControl

Hierarchy	Properties	Methods	See also

TGraphicControl is the base class for all nonwindowed custom controls.

Unit

controls

Description

The primary purpose of most graphic controls is to display text or graphics. Delphi controls that descend from TGraphicControl include TBevel, TImage, TPaintBox, TShape, TSpeedButton, TSplitter, and TCustomLabel, from which TDBText and TLabel are derived.

In addition to everything inherited from the abstract TControl component, TGraphicControl provides a Canvas property that provides ready access to the control's drawing surface and a virtual Paint method called in response to WM_PAINT messages received by a parent control.

Graphic controls cannot receive the input focus, nor can they contain other controls. Because a graphic control doesn’t need a Windows handle, it’s demand on system resources is lessened, and painting a graphic control is quicker than painting a windowed control.

To create a control that can receive input focus or contain other controls, but which needs a Canvas property and a Paint method, derive a class from TCustomControl.


TGraphicControl properties

TGraphicControl	Alphabetically	Legend

In TGraphicControl

Canvas

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TGraphicControl properties

TGraphicControl	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlState

ControlStyle

Cursor

DesignInfo

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ShowHint

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

Width

WindowProc


TGraphicControl.Canvas

TGraphicControl	See also	Example

Provides the drawing surface used by the graphic control.

property Canvas: TCanvas;

Description

Use the properties of the TCanvas object to draw or paint on the surface of the control. Canvas provides all the tools and methods needed for drawing and painting.

Since TGraphicControl does not have its own window, when Canvas needs a handle to a device context, it uses the device context obtained from the window of the control’s Parent.


TGraphicControl methods

TGraphicControl	Alphabetically	Legend

In TGraphicControl

Create

Destroy

Paint

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

Invalidate

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

Repaint

ReplaceDockedControl

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TGraphicControl methods

TGraphicControl	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

NewInstance

Paint

Perform

Refresh

RemoveComponent

Repaint

ReplaceDockedControl

SafeCallException

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

UpdateAction

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TGraphicControl.Create

TGraphicControl	See also

Creates an instance of TGraphicControl.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate and initialize a graphic control at runtime. Graphic controls placed on forms at design time are created automatically.

Create creates the TCanvas object for the Canvas property after calling the inherited constructor.

Nearly every kind of control overrides Create to initialize its unique properties. When overriding the Create method, always call the inherited constructor first, then proceed with the component's initialization.


TGraphicControl.Destroy

TGraphicControl	See also

Destroys an instance of TGraphicControl.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the graphic control reference is not nil, and only then calls Destroy.

Use Destroy to free any memory or resources allocated in the Create method. When declaring a Destroy method in a descendant control type, always add the override directive to the declaration and call the inherited Destroy as the last statement in the redeclared method.


TGraphicControl.Paint

TGraphicControl	See also

Provides the interface for a method that renders the image of the graphic control.

procedure Paint; virtual;

Description

A graphic control receives WM_PAINT messages from its Parent, when the parent wants the graphic control to paint itself. Graphic controls respond to WM_PAINT messages by initializing the control's canvas and calling the Paint method. Override Paint to specify how the image of the control should be drawn.

The Paint method for TGraphicControl does nothing more than provide an interface to be overridden by derived objects. All graphic controls that can be instantiated must override Paint to draw the image of the control.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl


TGuidField

Hierarchy	Properties	Methods	Events	See also

TGuidField represents a guid field in a dataset.

Unit

DB

Description

TGuidField is a persistent field object that encapsulates the fundamental behavior common to fields storing Globally Unique Identifiers (GUIDs). In addition to the properties, methods, and events common to all fields that are introduced by the TField class, TGuidField introduces the AsGuid property for setting and getting the field's value as a TGUID data type.

As with all persistent field objects, a TGuidField can be created at design-time using the Fields Editor or at runtime by calling the constructor for the class. Persistent field objects exist solely in the memory space of an application. Creating a persistent field object only creates an object in the application, and does not result in the creation of a field in a table.

Fields in a table can be accessed without use of persistent field objects. Virtual field objects are created to provide access to a field when the field is referenced through such means as the TDataSet.Fields property or the TDataSet.FieldByName method. However, as both the Fields property and the FieldByName method return a value of type TField, the return value must be typecast as a TGuidField before using any property specific to TGuidField.


TGuidField properties

TGuidField	Alphabetically	Legend

In TGuidField

AsGuid

Derived from TStringField

AsBoolean

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

DataSize

FixedChar

Transliterate

Value

Derived from TField

Alignment

AsCurrency

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TGuidField properties

TGuidField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsGuid

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FixedChar

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

Transliterate

ValidChars

Value

VCLComObject

Visible


TGuidField.AsGuid

TGuidField	See also

Represents the value of the field as a Guid value.

property AsGuid: TGUID

Description

Use AsGuid to

Assign the GUID field value to a TGUID variable.

Assign a GUID as the value of the field.

AsGuid suses the StringToGuid and GuidToString functions internally to convert between the internal representation of the GUID as a string and a TGUID type.


TStringField events

TStringField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TStringField events

TStringField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TStringField methods

TStringField	Alphabetically

In TGuidField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStringField methods

TStringField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TGuidField.Create

TGuidField	See also

Creates an instance of a TGuidField object.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TGuidField. After calling the inherited constructor, Create sets the DataType property to ftGuid.

After instantiating a TGuidField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TGuidField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TGuidField with a dataset component by setting its DataSet property to the name of the dataset component.

The example below creates a TGuidField object for a field named Guid accessed through a TQuery named Query1.

var

  T: TGuidField;

begin

  Query1.Close;

  T := TGuidField.Create(Self);

  T.FieldName := 'Guid';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TStringField


 THeaderControl

Hierarchy	Properties	Methods	Events	See also

THeaderControl is a container for THeaderSection objects. It provides a set of resizable column headers.

Unit

comctrls

Description

A THeaderControl is a set of column headers that the user can resize at runtime. Each header is represented by a THeaderSection object listed in the Sections property.

The header sections can be positioned above columns or fields of information. For example, header sections could be placed over a list box (TListBox). Because THeaderControl provides a generic header element that can be paired with virtually any other visual component, runtime manipulation of the header sections is not automatically extended to the components beneath it. If, for example, you want the column beneath a header section to be resized whenever the header section is resized, you will have to write a custom OnSectionResize event handler to accomplish this.


THeaderControl properties

THeaderControl	Alphabetically	Legend

In THeaderControl

Canvas

DragReorder

FullDrag

HotTrack

Images

Sections

Style

Derived from TWinControl

BorderWidth

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


THeaderControl properties

THeaderControl	By object	Legend

Action

Align

Anchors

BiDiMode

BorderWidth

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

DragReorder

Enabled

Floating

FloatingDockSiteClass

Font

FullDrag

Handle

Height

HelpContext

Hint

HostDockSite

HotTrack

Images

Left

LRDockWidth

Name

Owner

Parent

ParentBiDiMode

ParentFont

ParentShowHint

ParentWindow

PopupMenu

Sections

ShowHint

Showing

Style

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


THeaderControl.Canvas

THeaderControl	See also 	Example

Provides runtime access to the header control’s drawing surface.

property Canvas: TCanvas;

Description

The read-only Canvas property provides access to the header control’s drawing surface that can be used when implementing a handler for the OnDrawSection event.


THeaderControl.DragReorder

THeaderControl	See also

Specifies whether users can change the order of header sections using drag and drop.

property DragReorder: Boolean;

Description

Set DragReorder to True to enable automatic drag-and-drop operations that change the order of header sections. Set DragReorder to False to disable such automatic drag-and-drop operations.

When DragReorder is True, the header control receives an OnSectionDrag when the user drags a section to a new position.


THeaderControl.FullDrag

THeaderControl	See also

Specifies whether headers are repainted when they are dragged.

property FullDrag: Boolean;

Description

Use FullDrag to specify whether headers are repainted while they are dragged.


THeaderControl.HotTrack

THeaderControl	See also

Highlights the header sections as the mouse passes over them.

property HotTrack: Boolean;

Description

If HotTrack is set to True, the text on each header section appears highlighted when the mouse passes over it at runtime.


THeaderControl.Images

THeaderControl	See also

Lists the images that can appear next to the text in header sections.

property Images: TCustomImageList;

Description

Use Images to provide a set of graphic images that can appear in the header sections. Each header section can be associated with one of the images in this list using its ImageIndex property.


THeaderControl.Sections

THeaderControl	See also	Example

Lists the header sections (column headings).

property Sections: THeaderSections;

Description

The Sections property holds a THeaderSections—that is, a collection of THeaderSection objects. At design time, header sections can be added, removed, or modified with the Sections editor. To open the Sections editor, select the Sections property in the Object Inspector, then double-click in the Value column to the right or click the ellipsis (...) button.


THeaderControl.Style

THeaderControl

Specifies the header control’s style.

property Style: THeaderStyle;

Description

Use Style to determine the appearance of the header sections.


THeaderControl events

THeaderControl	Alphabetically	Legend

In THeaderControl

OnDrawSection

OnSectionClick

OnSectionDrag

OnSectionResize

OnSectionTrack

Derived from TControl

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock

OnStartDrag


THeaderControl events

THeaderControl	By object	Legend

OnContextPopup

OnDragDrop

OnDragOver

OnDrawSection

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnSectionClick

OnSectionDrag

OnSectionResize

OnSectionTrack

OnStartDock

OnStartDrag


THeaderControl.OnDrawSection

THeaderControl	See also	Example

Occurs when a header section needs to be redrawn.

type TDrawSectionEvent = procedure (HeaderControl: THeaderControl; Section: THeaderSection; const Rect: TRect; Pressed: Boolean) of object;

property OnDrawSection: TDrawSectionEvent;

Description

The OnDrawSection event occurs when a header section needs to be redisplayed—for example, when the user selects or resizes a section. OnDrawSection occurs only if the header section’s Style property is set to hsOwnerDraw.

TDrawSectionEvent is the type of the OnDrawSection property.


THeaderControl.OnSectionClick

THeaderControl	See also

Occurs when one of the header control’s sections is clicked.

type TSectionNotifyEvent = procedure(HeaderControl: THeaderControl; Section: THeaderSection) of object;

property OnSectionClick: TSectionNotifyEvent;

Description

The OnSectionClick event occurs when a header section is clicked at runtime. To disable a section from being clicked set its AllowClick property to False.

TSectionNotifyEvent is the type of the OnSectionClick and OnSectionResize events.


THeaderControl.OnSectionDrag

THeaderControl	See also

Occurs when the user drags a header section to a new position.

property OnSectionDrag: TSectionDragEvent;

Description

Write an OnSectionDrag event handler to respond when a user tries to reorder the sections in the header control. The OnSectionDrag event handler can conditionally prevent the user from dragging a header to a new position.

If the AllowDrag parameter is True on exit from the event handler, the header control reorders the sections and generates an OnSectionEndDrag event when the reorder is complete.

Note:	OnSectionDrag only occurs if the DragReorder property is True.


THeaderControl.OnSectionEndDrag

THeaderControl	See also

Occurs after the header control rearranges its sections in response to a drag operation.

property OnSectionEndDrag: TNotifyEvent;

Description

Write an OnSectionEndDrag event handler to respond after a user reorders the sections in the header control.

Note:	OnSectionEndDrag only occurs if the DragReorder property is True.


THeaderControl.OnSectionResize

THeaderControl	See also

Occurs when one of the header control’s sections is resized.

type TSectionNotifyEvent = procedure(HeaderControl: THeaderControl; Section: THeaderSection) of object;

property OnSectionResize: TSectionNotifyEvent;

Description

The OnSectionResize event occurs when a header section is resized at runtime. This happens when the user positions the mouse pointer between two sections and drags their border to the right or left.

TSectionNotifyEvent is the type of the OnSectionClick and OnSectionResize events.


THeaderControl.OnSectionTrack

THeaderControl	See also

Occurs as one of the header control’s sections is being resized.

type

  TSectionTrackState = (tsTrackBegin, tsTrackMove, tsTrackEnd);

  TSectionTrackEvent = procedure(HeaderControl: THeaderControl; Section: THeaderSection; Width: Integer; State: TSectionTrackState) of object;

property OnSectionTrack: TSectionTrackEvent;

Description

The OnSectionTrack event tracks the dragging of a header section’s border as it happens. OnSectionTrack occurs when the mouse pointer is positioned between two header sections and the left mouse button is depressed.

OnSectionTrack is of type TSectionTrackEvent, whose Width and State parameters indicate the size of the header section (in pixels) and the status of the event. The State property can take three values:

Value	Meaning

tsTrackBegin	The border has not yet been dragged.

tsTrackMove	The border is being dragged.

tsTrackEnd	The border is no longer being dragged.

Use OnSectionTrack when you want something to happen at runtime as a header section is being resized.


THeaderControl methods

THeaderControl	Alphabetically

In THeaderControl

Create

Destroy

FlipChildren

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


THeaderControl methods

THeaderControl	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


THeaderControl.Create

THeaderControl	See also

Creates and initializes a THeaderControl component.

constructor Create(AOwner: TComponent); override;

Description

The Create method creates a header control along with its canvas and header sections.


THeaderControl.Destroy

THeaderControl	See also

Destroys THeaderControl and frees its memory.

destructor Destroy; override;

Description

The Destroy method destroys the header control along with its canvas and header sections.


THeaderControl.FlipChildren

THeaderControl	Methods

Reverses the order in which sections are displayed.

procedure FlipChildren(AllLevels: Boolean); override;

Description

FlipChildren flips the order of the header control’s sections; then calls the inherited FlipChildren method to reverse the order of any other child controls.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


THeaderSection

Hierarchy	Properties	Methods	See also

THeaderSection represents a section of a header control.

Unit

comctrls

Description

THeaderControl uses TheaderSections to maintain a collection of THeaderSection objects. These THeaderSection objects represent resizable column headers. Each column header includes a text label and possibly a graphic image.


THeaderSection properties

THeaderSection	Alphabetically	Legend

In THeaderSection

Alignment

AllowClick

AutoSize

BiDiMode

DisplayName

ImageIndex

Left

MaxWidth

MinWidth

ParentBiDiMode

Right

Style

Text

Width

Derived from TCollectionItem

Collection

ID

Index


THeaderSection properties

THeaderSection	By object	Legend

Alignment

AllowClick

AutoSize

BiDiMode

Collection

DisplayName

ID

ImageIndex

Index

Left

MaxWidth

MinWidth

ParentBiDiMode

Right

Style

Text

Width


THeaderSection.Alignment

THeaderSection	See also

Specifies how text is aligned within the header section.

property Alignment: TAlignment;

Description

Use Alignment to specify whether the header section text should be left-justified, right-justified, or centered.

These are the possible values of Alignment:

Value	Meaning

taLeftJustify	Align text on the left side of the header section.

taCenter	Center text in the header section.

taRightJustify	Align text on the right side of the header section.


THeaderSection.AllowClick

THeaderSection	See also

Allows the section to respond to mouse clicks at runtime.

property AllowClick: Boolean;

Description

If AllowClick is set to True (the default), the header section can be clicked with the mouse at runtime. Header sections behave like buttons when clicked: They loose their raised borders and appear depressed on the form. To attach functionality to the clicking of header sections, write an event handler for the header control’s OnSectionClick event.


TheaderSectionAutoSize
THeaderSection.AutoSize

THeaderSection

Indicates whether the header section should size itself to exactly hold its contents.

property AutoSize: Boolean;

Description

When AutoSize is True, the header section (and the header control that contains it) automatically resizes to adjust to changes. When AutoSize is False, the header section size is fixed unless changed programmatically.


THeaderSection.BiDiMode

THeaderSection

Specifies the bi-directional mode for the header section.

property BiDiMode: TBiDiMode;

Description

Use BiDiMode to specify the bi-directional mode for the header section.


THeaderSection.DisplayName

THeaderSection	See also

The name displayed in the Sections editor.

property DisplayName: string;

Description

DisplayName is the string that represents the item in the Sections property editor.


THeaderSection.ImageIndex

THeaderSection	See also

Indentifies the image that appears next to the text on the header section.

property ImageIndex: TImageIndex;

Description

Use ImageIndex to specify an image that appears next tot he text on the header section. ImageIndex is the (0-offset) index of the image in the TCustomImageList component that is available through the header control’s Images property.


THeaderSection.Left

THeaderSection	See also

Specifies the horizontal position of the header section’s left edge.

property Left: Integer;

Description

The Left property is the horizontal coordinate of the header section’s left edge, relative to the left border of the the header control and measured in pixels.


THeaderSection.MaxWidth

THeaderSection	See also

Specifies the maximum width of the header section.

property MaxWidth: Integer;

Description

Sets the maximum width, in pixels, for the header section. If MaxWidth = MinWidth, the header section cannot be resized at runtime.


THeaderSection.MinWidth

THeaderSection	See also 	Example

Specifies the minimum width of the header section.

property MinWidth: Integer;

Description

Sets the minimum width, in pixels, for the header section. If MinWidth = MaxWidth, the header section cannot be resized at runtime.


THeaderSection.ParentBiDiMode

THeaderSection

Specifies whether the header section uses its parent’s bi-directional mode.

property ParentBiDiMode: Boolean;

Description

Use BiDiMode to specify whether the header section uses its parent’s bi-directional mode.


THeaderSection.Right

THeaderSection	See also

Specifies the horizontal position of the header section’s right edge.

property Right: Integer;

Description

The Right property is the horizontal coordinate of the header section’s right edge, relative to the left border of the the header control and measured in pixels. The Right value is the value of Left plus the value of Width.


THeaderSection.Style

THeaderSection	See also 	Example

Determines how the header section’s text is displayed.

type THeaderSectionStyle = (hsText, hsOwnerDraw);

property Style: THeaderSectionStyle;

Description

If Style is set to hsText (the default), the string contained in the Text property is displayed in the header section, using the alignment specified by Alignment. The font is determined by the header control’s Font property. A graphic image can appear beside the text if the ImageIndex property is set.

If Style is set to hsOwnerDraw, the content displayed in the header section is drawn at run time on the header control’s canvas by code in an OnDrawSection event handler.


THeaderSection.Text

THeaderSection	See also

Specifies the header section’s caption.

property Text: string;

Description

The Text property contains a string that identifies the header section or the column beneath it. If Style is set to hsText, the value of Text appears in the header section.


THeaderSection.Width

THeaderSection	See also

Specifies the width of the header section.

property Width: Integer;

Description

The Width property determines the default width of the header section, in pixels. Header sections can be resized at runtime by dragging their borders.


THeaderSection methods

THeaderSection	Alphabetically

In THeaderSection

Assign

Create

Derived from TCollectionItem

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ParentBiDiModeChanged

SafeCallException

UseRightToLeftAlignment

UseRightToLeftReading


THeaderSection methods

THeaderSection	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ParentBiDiModeChanged

SafeCallException

UseRightToLeftAlignment

UseRightToLeftReading


THeaderSection.Assign

THeaderSection	See also

Copies the contents of the source header section to a new header section.

procedure Assign(Source: TPersistent); override;

Description

Assign copies the values of the source object’s Alignment, AllowClick, MaxWidth, MinWidth, Style, Text, and Width properties to another header section.


THeaderSection.Create

THeaderSection	See also

Creates and initializes a header section.

constructor Create(Collection: TCollection); override;

Description

Description

Do not instantiate a THeaderSection object. Header sections are created automatically by the THeaderSections objects that use them. To add a section to a THeaderSections object, use its Add method instead.

Create takes a THeaderSections instance as its argument.


TheaderSectionParentBiDiModeChanged
THeaderSection.ParentBiDiModeChanged

THeaderSection

Synchronizes the header section’s BiDiMode with the associated header control’s BiDiMode.

procedure ParentBiDiModeChanged;

Description

Use ParentBiDiModeChanged to synchronize the header section’s BiDiMode with the associated header control’s BiDiMode.


THeaderSection.UseRightToLeftAlignment

THeaderSection

Specifies whether the control’s alignment is in a right-to-left mode.

function UseRightToLeftAlignment: Boolean;

Description

Call UseRightToLeftAlignment to determine whether the control’s alignment is in a right-to-left mode. This information can be used when painting the control, or when responding to mouse events.

UseRightToLeft alignment returns True if SysLocale.MiddleEast is True and BiDiMode is bdRightToLeft


THeaderSection.UseRightToLeftReading

THeaderSection

Specifies whether the control is using a right-to-left reading order.

function UseLeftToRightAlignment: Boolean;

Description

Call UseRightToLeftReading to determine which style flags to set for the control when it is created and which flags to set for drawing text (for example, when calling ExTextOut or DrawText).

UseRightToLeftReading returns True if SysLocale.MiddleEast = True and BiDiMode is not bdLeftToRight.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem


THeaderSections

Hierarchy	Properties	Methods	See also

THeaderSections is a container for THeaderSection objects.

Unit

comctrls

Description

Each THeaderSections holds a collection of THeaderSection objects in a THeaderControl. THeaderSections maintains an index of the header sections in its Items array. The Count property contains the number of header sections in the collection. At design time, use the header control’s Sections editor to add, remove, or modify header sections.


THeaderSections properties

THeaderSections	Alphabetically	Legend

In THeaderSections

Items

Derived from TCollection

Count

ItemClass


THeaderSections properties

THeaderSections	By object	Legend

Count

ItemClass

Items


THeaderSections.Items

THeaderSections	See also

Lists the header sections in the collection.

property Items[Index: Integer]: THeaderSection; default;

Description

The value of the Index parameter corresponds to the Index property of THeaderSection. It represents the position of the header section in the header.


THeaderSections methods

THeaderSections	Alphabetically

In THeaderSections

Add

Create

Derived from TCollection

Assign

BeginUpdate

Clear

Delete

Destroy

EndUpdate

FindItemID

GetNamePath

Insert

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


THeaderSections methods

THeaderSections	By object

Add

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

FindItemID

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


THeaderSections.Add

THeaderSections	See also 	Example

Creates a new THeaderSection instance and adds it to the Items array.

function Add: THeaderSection;

Description

Add returns the new header section. At design time, use the header control’s Sections editor to add sections to the header.


THeaderSections.CreateTHeaderSections
THeaderSections.Create

THeaderSections	See also

Creates and initializes a THeaderSections object.

constructor Create(HeaderControl: THeaderControl);

Description

The Create method takes a THeaderControl instance as a parameter.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


 THeader

Hierarchy	Properties	Methods	Events

THeader is a sectioned visual control that displays text and allows each section to be resized with the mouse.

Unit

extctrls

Description

THeader is provided for backward compatibility. New applications should use THeaderControl instead.


THeader properties

THeader	Alphabetically	Legend

In THeader

AllowResize

BorderStyle

Sections

SectionWidth

Derived from TWinControl

Brush

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Parent

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject

WindowProc


THeader properties

THeader	By object	Legend

Action

Align

AllowResize

Anchors

BiDiMode

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentFont

ParentShowHint

ParentWindow

PopupMenu

Sections

SectionWidth

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


THeader.AllowResize

THeader

Determines if the user can modify the size of the header at runtime with the mouse.

property AllowResize: Boolean;

Description

If AllowResize is False, the sections within a header can't be resized. If AllowResize is True, clicking a border of a header section and dragging it left or right changes the width of the section. The default value is True.


THeader.BorderStyle

THeader

Determines whether the header control has a border.

property BorderStyle: TBorderStyle;

Description

These are the possible values:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border


THeader.Sections

THeader

Lists the strings that contain the text for the sections of a header.

property Sections: TStrings;

Description

The number of lines of the string list determines the number of sections of the header. If the string list is empty, the header has one blank section. If this string list contains one or more lines, the text of each line is in its own section. The first line is in the leftmost section, the second line is in the next section to the right, and so on.


THeader.SectionWidth

THeader

Determines the width, in pixels, of the sections of a header.

property SectionWidth[X: Integer]: Integer;

Description

Use SectionWidth to specify the width of each header section. X is an index into the sections, from 0 to the number of sections - 1. For example, the index of the first section is 0, the second section is 1, and so on.


THeader events

THeader	Alphabetically	Legend

In THeader

OnSized

OnSizing

Derived from TControl

OnContextPopup


THeader events

THeader	By object	Legend

OnContextPopup

OnSized

OnSizing


THeader.OnSized

THeader	See also

Occurs after the header has been resized.

type TSectionEvent = procedure(Sender: TObject; ASection, AWidth: Integer) of object;

property OnSized: TSectionEvent;

Description

Write an OnSized event handler to perform special processing after the header has been resized. Sender is the header control, ASection is the index of the section that was resized, and AWidth is the width of the section before it was resized. Use the SectionWidth property to determine the new size of the section.


THeader.OnSizing

THeader	See also

Occurs before the header is resized.

type TSectionEvent = procedure(Sender: TObject; ASection, AWidth: Integer) of object;

property OnSizing: TSectionEvent;

Description

Write an OnSizing event handler to perform special processing immediately before the header is resized. Sender is the header control, ASection is the index of the section that is being resized, and AWidth is the width that the section will have after it is resized. Use the SectionWidth property to determine the current size of the section.


THeader methods

THeader	Alphabetically

In THeader

Create

Destroy

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


THeader methods

THeader	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


THeader.Destroy

THeader	See also

Frees the memory associated with the THeader object.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead, use the Free method, which checks whether the THeader reference is nil before calling Destroy.


THeader.Create

THeader	See also

Creates a new THeader object.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a header at runtime. Headers added to forms at design time are created automatically.

The AOwner parameter initializes the Owner property of the header.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


THintWindow

Hierarchy	Properties	Methods	See also

THintWindow implements the small pop-up window that appears over a control at runtime when the control has its ShowHint property set to True.

Unit

controls

Description

Use THintWindow to display a Help Hint pop-up window directly from an application. Override THintWindow to customize the window that appears automatically for controls with their ShowHint property set to True. After overriding THintWindow to create a new derived type, assign the new type to the global HintWindowClass variable at application startup, so that the new hint window type is used for Help Hints.

The hint window’s BiDiMode is always set to the BiDiMode of the control that activates it. If the mode is bdRightToLeft, then the hint is left-aligned to the cursor.


THintWindow properties

THintWindow	Alphabetically	Legend

Derived from TCustomControl

Canvas

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Align

BiDiMode

BoundsRect

Caption

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

Enabled

Font

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


THintWindow properties

THintWindow	By object	Legend

Align

BiDiMode

BoundsRect

Brush

Canvas

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

Parent

ParentWindow

ShowHint

Showing

TabOrder

TabStop

Tag

Top

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


THintWindow methods

THintWindow	Alphabetically

In THintWindow

ActivateHint

ActivateHintData

CalcHintRect

Create

IsHintMsg

ReleaseHandle

Derived from TCustomControl

Destroy

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


THintWindow methods

THintWindow	By object

ActivateHint

ActivateHintData

Assign

BeginDrag

BringToFront

Broadcast

CalcHintRect

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsHintMsg

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

ReleaseHandle

RemoveComponent

RemoveControl

Repaint

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateControlState


THintWindow.ActivateHint

THintWindow	See also

Displays the hint window.

procedure ActivateHint(Rect: TRect; const AHint: string); virtual;

Description

Call ActivateHint to display the hint window at the coordinates provided by the Rect parameter. If the Rect parameter appears off screen, ActivateHint moves the hint window to the closest approximation to the coordinates supplied by Rect that appears entirely on screen. ActivateHint sets the Caption property to the AHint parameter before showing the window, so that the AHint string appears to the user.

After an application displays a hint window, it automatically deactivates it after a time period has elapsed, or when it receives a message that requires hiding the hint message. To hide the hint window that is brought up automatically by the application, use the HideHint method of the global Application object. To hide a hint window that is activated directly by calling ActivateHint, use the ReleaseHandle method.


THintWindow.ActivateHintData

THintWindow	See also

Displays the hint window using a provided data value.

procedure ActivateHintData(Rect: TRect; const AHint: string; AData: Pointer); virtual;

Description

Call ActivateHintData to display the hint window at the coordinates provided by the Rect parameter. The ActivateHintData method for THintWindow sets the Caption property to the AHint parameter and ignores the AData parameter. Descendant classes can override this method to combine the AHint and AData parameters into a customized Hint value.

After an application displays a hint window, it automatically deactivates it after a time period has elapsed, or when it receives a message that requires hiding the hint message. To hide the hint window that is brought up automatically by the application, use the HideHint method of the global Application object. To hide a hint window that is activated directly by calling ActivateHint, use the ReleaseHandle method.


THintWindow.CalcHintRect

THintWindow	See also

Returns the size needed to display a given hint.

function CalcHintRect(MaxWidth: Integer; const AHint: string; AData: Pointer): TRect; virtual;

Description

Call CalcHintRect to determine the size needed to display a hint window for the string and data supplied by the AHint and AData parameters. The MaxWidth parameter limits how wide the Hint window can grow before the text wraps to a new line.


THintWindow.Create

THintWindow	See also

Creates and initializes an instance of THintWindow.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a hint window at runtime. Hint windows activated by the application in response to the ShowHint property of a control are created automatically.


THintWindow.IsHintMsg

THintWindow	See also

Determines whether an application message requires hiding the hint window.

type

  TMsg = packed record

    hwnd: HWND;

    message: UINT;

    wParam: WPARAM;

    lParam: LPARAM;

    time: DWORD;

    pt: TPoint;

  end;

function IsHintMsg(var Msg: TMsg): Boolean; virtual;

Description

Call IsHintMsg to determine whether the message specified by the Msg parameter requires hiding the hint window. Upon seeing a mouse, keyboard, command, or activation message, IsHintMsg returns True. The global Application object calls IsHintMsg to check messages while the hint window is on the screen, and hides the window if IsHintMsg returns True.


THintWindow.ReleaseHandle

THintWindow	See also

Destroys the window displayed by THintWindow.

procedure ReleaseHandle;

Description

Call ReleaseHandle to destroy a hint window that was activated by directly calling the ActivateHint method. Hint windows activated automatically by the application object are deactivated by the application as well.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


THandleStream

Hierarchy	Properties	Methods	See also

THandleStream enables applications to read from and write to communications resources identified by a Windows handle.

Unit

classes

Description

Use THandleStream to access files, sockets, named pipes, mailslots, or other communications resources that provide a Windows handle when opened. For example, the FileOpen function provides a Windows handle for a file on disk. THandleStream allows applications to use a uniform stream interface when performing I/O using a Windows handle.

To avoid the overhead of managing file handles, use TFileStream to work with disk files.


THandleStream properties

THandleStream	Alphabetically	Legend

In THandleStream

Handle

Size

Derived from TStream

Position


THandleStream properties

THandleStream	By object	Legend

Handle

Position

Size


THandleStream.Handle

THandleStream	See also

Specifies the handle for the communications resource the stream reads from and writes to.

property Handle: Integer;

Description

Read Handle to get the handle for Windows API calls or file management functions. To read from or write to the resource, use the methods of the THandleStream object.

Handle is a read-only property. The handle property cannot be changed to allow the handle stream to switch from reading to writing or vice versa. For example, to change from a file handle that is opened in read-only mode to one that is opened in write mode:

1	Free the stream object.

2	Call FileClose to close the file.

3	Re-open the file in write mode, and use the handle to create a new instance of a handle stream. Alternately, open a TFileStream object for the file, specifying a write mode for the stream.

Note:	Do not call the FileClose function on the Handle until after the THandleStream object has been destroyed.


THandleStream.Size

THandleStream	See also

Specifies the length, in bytes, of the resource identified by the Handle property.

property Size: Longint;

Description

Read Size to determine the number of bytes in the resource. Set Size to truncate the information in the resource. Not every communications resource that can be accessed using a THandleStream object can support the Size property. For example, do not use the Size property with named pipes.


THandleStream methods

THandleStream	Alphabetically	Legend

In THandleStream

Create

Read

Seek

SetSize

Write

Derived from TStream

CopyFrom

FixupResourceHeader

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


THandleStream methods

THandleStream	By object	Legend

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

CopyFrom

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

FixupResourceHeader

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Read

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

SafeCallException

Seek

SetSize

Write

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader


THandleStream.Create

THandleStream	See also

Creates an instance of THandleStream.

constructor Create(AHandle: Integer);

Description

Call Create to instantiate a THandleStream for a given handle. The handle must be obtained by opening or creating the resource in the appropriate mode. For example, to create a handle stream for reading from a file, obtain the file handle by opening the file with an fmOpenRead or fmOpenReadWrite mode. To create a handle stream for writing to a file, obtain the file handle by opening the file with an fmOpenWrite or fmOpenReadWrite mode.


THandleStream.Read

THandleStream	See also

Reads up to Count bytes of data from the resource associated with the handle stream into Buffer.

function Read(var Buffer; Count: Longint): Longint; override;

Description

Use Read to read data from the resource associated with the handle stream when the number of bytes in the file is not known. Read transfers up to Count bytes from the resource, starting at the current position, and then advances the current position in the resource by the number of bytes actually transferred. Read returns the number of bytes actually transferred, which may be less than Count if the end of file marker is encountered.

All other data-reading methods of a handle stream (ReadBuffer, ReadComponent) call Read to do the actual reading.


THandleStream.Seek

THandleStream	See also

Resets the current position of the handle stream.

function Seek(Offset: Longint; Origin: Word): Longint; override;

Description

Use Seek to move the current position within the resource associated with the handle stream by the indicated offset. Seek allows an application to read from or write to a particular location within the resource.

The Origin parameter indicates how to interpret the Offset parameter. Origin should be one of the following values:

Value	Meaning

soFromBeginning	Offset is from the beginning of the resource. Seek moves to the position Offset. Offset must be >= 0.

soFromCurrent	Offset is from the current position in the resource. Seek moves to Position + Offset.

soFromEnd	Offset is from the end of the resource. Offset must be <= 0 to indicate a number of bytes before the end of the file.

Seek returns the new value of the Position property, the new current position in the resource.


THandleStream.SetSize

THandleStream	See also

Sets the end of file marker to truncate the resource at the indicated position.

procedure SetSize(NewSize: Longint); override;

Description

Call SetSize to set the size of the resource. Size overrides the inherited method to allow the size of the resource identified by the handle to be changed. SetSize calls Seek to go to the indicated position, and then writes an end of file marker. If the size of the resource can not be changed, an exception is raised. For example, calling SetSize for a file handle that was opened in fmOpenRead mode will raise an exception.


THandleStream.Write

THandleStream	See also

Writes Count bytes from the Buffer to the current position in the resource.

function Write(const Buffer; Count: Longint): Longint; override;

Description

Use Write to write Count bytes to the resource associated with the handle stream, starting at the current position. After writing to the resource, Write advances the current position by the number bytes written, and returns the number of bytes written.

All other data-writing methods of a handle stream (WriteBuffer, WriteComponent) call Write to do the actual writing.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TStream


 THotKey

Hierarchy	Properties	Methods	Events

THotKey is a wrapper for a hot key Windows Common Control.

Unit

comctrls

Description

THotKey implements the generic behavior introduced in TCustomHotKey. THotKey publishes many of the properties inherited from TCustomHotKey, but does not introduce any new behavior.

Use THotKey to create key combinations that can be used as a shortcut.


THotKey properties

THotKey	Alphabetically	Legend

Derived from TCustomHotKey

AutoSize

HotKey

InvalidKeys

Modifiers

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


THotKey properties

THotKey	By object	Legend

Action

Align

Anchors

AutoSize

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

HotKey

InvalidKeys

Left

LRDockWidth

Modifiers

Name

Owner

Parent

ParentBiDiMode

ParentShowHint

ParentWindow

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


THotKey events

THotKey	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnContextPopup

OnMouseDown

OnMouseMove

OnMouseUp


THotKey events

THotKey	By object	Legend

OnContextPopup

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp


THotKey methods

THotKey	Alphabetically

Derived from TCustomHotKey

Create

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


THotKey methods

THotKey	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomHotKey


TIconOptions

Hierarchy	Properties	Methods	See also

TIconOptions describes how the icons in a list view should be arranged.

Unit

comctrls

Description

Use TIconOptions with a list view object that has a ViewStyle of vsIcon or vsSmallIcon. Set the properties of the icon options object owned by the list view to represent how the icons in the list view should be arranged.

The properties of a TIconOptions object are not valid unless a list view object owns it.

Note:	TIconOptions has no effect if the associated list view does not have a ViewStyle of vsIcon or vsSmallIcon.


TIconOptions properties

TIconOptions	Alphabetically	Legend

In TIconOptions

Arrangement

AutoArrange

WrapText


TIconOptions properties

TIconOptions	By object	Legend

Arrangement

AutoArrange

WrapText


TIconOptions.Arrangement

TIconOptions	See also

Determines where the items are to be aligned in the list view.

type TIconArrangement = (iaTop, iaLeft);

property Arrangement: TIconArrangement;

Description

Set Arrangement to indicate whether the list view should display icon entries in rows or columns. Arrangement has no effect on the arrangement of entries in the list view when the ViewStyle is not vsIcon or vsSmallIcon. These are the possible values of Arrangement:

Value	Meaning

iaTop	Items are aligned left to right in rows at the top of the list view control

iaLeft	Items are aligned in columns top to bottom at the left of the list view control


TIconOptions.AutoArrange

TIconOptions	See also

Determines if icons in a list view are automatically rearranged when a list item is added, removed, or moved.

property AutoArrange: Boolean;

Description

Set AutoArrange to specify whether the list view object should rearrange its items whenever changes are made. If AutoArrange is True, the icons are automatically arranged. If AutoArrange is False, the icons are not arranged until the Arrange method of the list view is called.


TIconOptions.WrapText

TIconOptions	See also

Determines whether the caption of an icon in a list view is displayed all on one line, or if it can wrap.

property WrapText: Boolean;

Description

Set WrapText to True to have the caption of icons wrap rather than display on one line when it exceeds the width of the icon.


TIconOptions methods

TIconOptions	Alphabetically

In TIconOptions

Create

Derived from TPersistent

Assign

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TIconOptions methods

TIconOptions	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TIconOptions.Create

TIconOptions	See also

Creates an instance of TIconOptions.

constructor Create(AOwner: TCustomListView);

Description

Do not call Create directly in an application. The properties of TIconOptions are only valid when it is owned by a list view object. The list view instantiates a TIconOptions object to represent the arrangement properties of its icon views.

After calling the inherited constructor, Create initializes

Arrangement to iaTop.

AutoArrange to False.

WrapText to True.


Scope

Published


Hierarchy

TObject

TPersistent


IComponent

Hierarchy	Properties	Methods	See also

IComponent is the interface used by the IDE when working with components

Unit

Dsgnintf

Description

The IDE uses IComponent to obtain information about and manipulate components in the form designer or in component editors. By supporting the IComponent interface, classes that are not descended from TComponent can be enabled to work with component editors.


IComponent properties

IComponent	Alphabetically	Legend

In IComponent

ComponentCount

Components

ComponentState

ComponentStyle

DesignInfo

DesignOffset

DesignSize

Name

Owner

Parent

Derived from IPersistent

ClassName

EventInfos

NamePath


IComponent properties

IComponent	By object	Legend

ClassName

ComponentCount

Components

ComponentState

ComponentStyle

DesignInfo

DesignOffset

DesignSize

EventInfos

Name

NamePath

Owner

Parent


IComponent.ComponentCount

IComponent	See also

Indicates the number of components owned by the component.

property ComponentCount: Integer;

Description

Use ComponentCount to find or verify the number of components owned by a component, or when iterating through the Components list to perform some action on all owned components.


IComponent.Components

IComponent	See also

Lists all components owned by the component.

property Components[Index: Integer]: IComponent;

Description

Use Components to obtain the interface for of the components owned by this component, such as the components owned by a form.

Note:	For convenience use Components with ComponentCount for iterative processing.


IComponent.ComponentState

IComponent	See also

Describes the current state of the component, indicating when a component needs to avoid certain actions.

type TComponentState = set of (csLoading, csReading, csWriting, csDestroying, csDesigning, csAncestor, csUpdating, csFixups);

property ComponentState: TComponentState;

Description

Use the ComponentState property to detect how the component is currently being used. ComponentState is a set that can contain zero or more of the following values:

Flag	Component state

csAncestor	The component was introduced in an ancestor form. Only set if csDesigning is also set.

csDesigning	The component is in a form being manipulated by the form designer.

csDestroying	The component is about to be destroyed.

csFixups	The component is linked to a component in another form that has not yet been loaded. This flag is cleared when all pending fixups are resolved.

csLoading	A filer object is currently loading the component.

csReading	The component is reading its property values from a stream.

csUpdating	The component is being updated to reflect changes in an ancestor form. Only set if csAncestor is also set.

csWriting	The component is writing its property values to a stream.


IComponent.ComponentStyle

IComponent

Governs the behavior of the component.

type TComponentStyle = set of (csInheritable, csCheckPropAvail);

property ComponentStyle: TComponentStyle;

Description

ComponentStyle determines whether a component (and therefore the forms that contain it) is inheritable, and whether it needs to check its properties for readability. Most of the standard components are inheritable.

ComponentStyle is a set containing zero or more of the following values:

Value	Meaning

csInheritable	Descendant form types can inherit from the component. If any of the components in a form do not have the csInheritable style, the form cannot be used as the ancestor of an inherited form.

csCheckPropAvail	The component needs to check its properties for readability. This is used for COM controls, where the Object Inspector cannot tell directly that a property is readable, and therefore displayable. Native components do not use this style.


IComponent.DesignInfo

IComponent	See also

Contains information used by the Form designer.

property DesignInfo: TSmallPoint;

Description

DesignInfo is used internally by the form designer. When implementing an object that supports IComponent, allocate memory that can hold a TSmallPoint value, and implement the GetDesignInfo and SetDesignInfo methods to access this memory.


IComponent.DesignOffset

IComponent	See also

Contains information used by the Form designer.

property DesignOffset: TPoint;

Description

DesignOffset represents the position of the component as it appears in the form designer. When implementing an object that supports IComponent, allocate memory that can hold a TPoint value, and implement the GetDesignOffset and SetDesignOffset methods to access this memory.


IComponent.DesignSize

IComponent	See also

Contains information used by the Form designer.

property DesignSize: TPoint;

Description

DesignSize represents the width and height of the component as it appears in the form designer.


IComponent.Name

IComponent	See also

Specifies the name of the component as referenced in code.

property Name: TComponentName;

Description

Name is the string used to refer to the component in code.


IComponent.Owner

IComponent	See also

Indicates the component that is responsible for freeing this component.

property Owner: IComponent;

Description

Use Owner to find the interface of the component’s owner. When one component owns another, the memory for the owned component is freed when its owner's memory is freed. This means that when a form is destroyed, all the components on the form are also destroyed.

By default, a form owns all components that are on it. In turn, the form is owned by the application. Thus when the application shuts down and its memory is freed, the memory for all forms (and all their owned components) is also freed.

The owner of a component is determined by the parameter passed to the constructor when the component is created. For components created in the form designer, the form is automatically assigned as the owner.


IComponent.Parent

IComponent	See also

Indicates the interface of the component’s parent, if any.

property Parent: IComponent;

Description

The parent of a component is responsible for writing the control to a stream when the form is saved. If the component represents a control, the parent is a windowed control that visually contains the component. Not all components have parents.

Note:	Don't confuse the Parent property with the Owner property. The component is always a constituent part of its parent (such as a tool button on a tool bar), while the owner is responsible for freeing the component.


IComponent methods

IComponent	Alphabetically

In IComponent

FindComponent

GetComponentCount

GetComponents

GetComponentState

GetComponentStyle

GetDesignInfo

GetDesignOffset

GetDesignSize

GetName

GetOwner

GetParent

SetDesignInfo

SetDesignOffset

SetDesignSize

SetName

Derived from IPersistent

DestroyObject

Equals

GetClassname

GetEventInfos

GetNamePath

InheritsFrom

IsComponent

IsControl

IsWinControl

Derived from IUnknown

_AddRef

_Release

QueryInterface


IComponent methods

IComponent	By object

_AddRef

_Release

DestroyObject

Equals

FindComponent

GetClassname

GetComponentCount

GetComponents

GetComponentState

GetComponentStyle

GetDesignInfo

GetDesignOffset

GetDesignSize

GetEventInfos

GetName

GetNamePath

GetOwner

GetParent

InheritsFrom

IsComponent

IsControl

IsWinControl

QueryInterface

SetDesignInfo

SetDesignOffset

SetDesignSize

SetName


IComponent.FindComponent

IComponent	See also

Indicates whether a given component is owned by the component.

function FindComponent(const Name: string): IComponent;

Description

FindComponent returns the component in the Components property array with the name that matches the string in the Name parameter. Use FindComponent to determine whether a given component is owned by another.


IComponent.GetComponentCount

IComponent	See also

Returns the value of the ComponentCount property.

function GetComonentCount: Integer;

Description

GetComponentCount is the property access method for the ComponentCount property.


IComponent.GetComponents

IComponent	See also

Returns the value of the Components property.

function GetComponents(Index: Integer): IComponent;

Description

GetComponents is the property access method for the Components property.


IComponent.GetComponentState

IComponent	See also

Returns the value of the ComponentState property.

function GetComponentState: TComponentState;

Description

GetComponentState is the property access method for the ComponentState property.


IComponent.GetComponentStyle

IComponent	See also

Returns the value of the ComponentStyle property.

function GetComponentStyle: TComponentStyle;

Description

GetComponentStyle is the property access method for the ComponentStyle property.


IComponent.GetDesignInfo

IComponent	See also

Returns the value of the DesignInfo property.

function GetDesignInfo: TSmallPoint;

Description

GetDesignInfo is the property access method for the DesignInfo property.


IComponent.GetDesignOffset

IComponent	See also

Returns the value of the DesignOffset property.

function GetDesignOffset: TPoint;

Description

GetDesignOffset is the property access method for the DesignOffset property.


IComponent.GetDesignSize

IComponent	See also

Returns the value of the DesignSize property.

function GetDesignSize: TPoint;

Description

GetDesignSize is the property access method for the DesignSize property.


IComponent.GetName

IComponent	See also

Returns the value of the Name property.

function GetName: string;

Description

GetName is the property access method for the Name property.


IComponent.GetOwner

IComponent	See also

Returns the value of the Owner property.

function GetOwner: IComponent;

Description

GetOwner is the property access method of the Owner property.


IComponent.GetParent

IComponent	See also

Returns the value of the Parent property.

function GetParent: IComponent;

Description

GetParent is the property access method for the Parent property.


IComponent.SetDesignInfo

IComponent	See also

Sets the DesignInfo property.

procedure SetDesignInfo(const Point:TSmallPoint);

Description

SetDesignInfo implements the DesignInfo property.


IComponent.SetDesignOffset

IComponent	See also

Sets the DesignOffset property.

procedure SetDesignOffset(const Point:TPoint);

Description

SetDesignOffset implements the DesignOffset property.


IComponent.SetDesignSize

IComponent	See also

Sets the DesignSize property.

procedure SetDesignSize(const Point:TPoint);

Description

SetDesignSize implements the DesignSize property.


IComponent.SetName

IComponent	See also

Sets the value of the Name property.

procedure SetName(const Value:string);

Description

SetName implements the Name property.


Accessibility

Read-only


Hierarchy

IUnknown

IPersistent


TIcon

Hierarchy	Properties	Methods	Events	See also

TIcon is an encapsulation of a Windows icon.

Unit

graphics

Description

Use TIcon to represent one of the icons in an image list. Assign an icon to objects that have an Icon property, such as TForm or TPicture.

Icon objects represent the value loaded from a Windows icon file (.ICO file). Draw an icon on a canvas, using the Draw method of the TCanvas object. Icons do not stretch, so do not use TCanvas.StretchDraw with an icon.


TIcon properties

TIcon	Alphabetically	Legend

In TIcon

Empty

Handle

Height

Transparent

Width

Derived from TGraphic

Modified

Palette

PaletteModified


TIcon properties

TIcon	By object	Legend

Empty

Handle

Height

Modified

Palette

PaletteModified

Transparent

Width


TIcon.Empty

TIcon

Indicates whether the icon object contains an icon.

property Empty: Boolean;

Description

If Empty is True, no icon has been loaded into the icon object. If Empty is False, the icon object contains an icon.


TIcon.Handle

TIcon	See also

Provides access to the Windows GDI icon handle.

property Handle: HIcon;

Description

Use Handle to specify the icon when using a Windows API function that requires the handle of an icon object. The Handle property is nil if the icon has not been loaded.

Call the ReleaseHandle method before changing the icon image by setting the Handle property. The icon image can also be loaded by assigning another icon object or using the LoadFromClipboardFormat, LoadFromFile, or LoadFromStream method.


TIcon.Height

TIcon	See also	Example

Specifies the vertical size of the icon in pixels.

property Height: Integer;

Description

All icons in an application have the same height, which is determined by Windows. Read Height to determine this common height.

Attempting to set the Height property raises an exception.


TIcon.Transparent

TIcon

Indicates whether the icon covers its rectangular area.

property Transparent: Boolean;

Description

Transparent specifies whether that the icon be drawn transparently. TIcon overrides the write method of the Transparent property to essentially make the property read-only, so setting the property for this object does not change their behavior.


TIcon.Width

TIcon	See also	Example

Specifies the horizontal size of the icon in pixels.

property Width: Integer;

Description

All icons in an application have the same width, which is determined by Windows. Read Width to determine this common width.

Attempting to set the Width property raises an exception.


TIcon events

TIcon	Alphabetically

Derived from TGraphic

OnChange

OnProgress


TIcon events

TIcon	By object

OnChange

OnProgress


TIcon methods

TIcon	Alphabetically

In TIcon

Assign

Create

Destroy

LoadFromClipboardFormat

LoadFromStream

ReleaseHandle

SaveToClipboardFormat

SaveToStream

Derived from TGraphic

LoadFromFile

SaveToFile

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TIcon methods

TIcon	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

LoadFromClipboardFormat

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

ReleaseHandle

SafeCallException

SaveToClipboardFormat

SaveToFile

SaveToStream


TIcon.Assign

TIcon	See also

Copies an icon image from another TIcon object.

procedure Assign(Source: TPersistent); override;

Description

Call Assign to copy another icon object. Assign copies the icon image from the Source parameter if it is another TIcon object. Otherwise, Assign calls the inherited method, which copies the icon image from any source object that specifies how to copy to a TIcon in its AssignTo method.


TIcon.Create

TIcon	See also	Example

Creates an instance of TIcon.

constructor Create; override;

Description

Call Create to create an empty icon object. Once an image has been read into the icon from a file or stream, or by assigning another icon object, the icon can be drawn on a canvas or added to an image list. Do not create an icon object for setting the icon property of a form or picture. These objects create a TIcon object in their own constructors. Instead, use the LoadFromFile, LoadFromStream, or LoadFromClipboardFormat method on the TIcon object returned when reading the Icon property.


TIcon.Destroy

TIcon	See also

Destroys an instance of TIcon.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TIcon reference is not nil, and only then calls Destroy.

Destroy releases the Windows icon handle before the object is freed.


TIcon.LoadFromClipboardFormat

TIcon	See also

Prevents applications from loading icons from the clipboard.

procedure LoadFromClipboardFormat(AFormat: Word; AData: THandle; APalette: HPALETTE); override;

Description

LoadFromClipboardFormat is overriden in TIcon because the clipboard format is not supported.


TIcon.LoadFromStream

TIcon	See also

Loads the icon from a stream.

procedure LoadFromStream(Stream: TStream);

Description

Use LoadFromStream to read the icon image from a stream. Set the Stream parameter to a stream object that provides access to the memory image of the icon. To load the icon from a .ICO file, use the LoadFromFile method. To load the icon from the Clipboard, use the LoadFromClipboardFormat method.


TIcon.ReleaseHandle

TIcon	See also

Releases the Windows GDI object represented by the icon.

function ReleaseHandle: HIcon;

Description

Call ReleaseHandle to release the resources used to represent the icon. ReleaseHandle sets the Handle property to nil.

ReleaseHandle informs the TIcon instance that it is no longer responsible for destroying the icon handle.


TIcon.SaveToClipboardFormat

TIcon	See also

Prevents applications from saving icons to the clipboard.

procedure SaveToClipboardFormat(var AFormat: Word; var AData: THandle; var APalette: HPALETTE); override;

Description

SaveToClipboardFormat is overriden in TIcon because the format is not supported for the Clipboard.


TIcon.SaveToStream

TIcon	See also

Saves the icon to a stream.

procedure SaveToStream(Stream: TStream);

Description

Use SaveToStream to write the icon image to a stream. Specify the Stream parameter as the stream object that receives the memory image of the icon. To write the icon to a .ICO file, use the SaveToFile method. To write the icon to the Clipboard, use the SaveToClipboardFormat method.


39Accessibility

Read-only


Hierarchy

TObject

TPersistent

TGraphic


TIconImage

Hierarchy	Methods	See also

TIconImage is the internal representation of the bitmap image for a TIcon object.

Unit

graphics

Description

TIconImage is used for internal implementation only in Delphi. It represents the internal image of the bitmap encapsulated by the TIcon object. All of the data and methods introduced in TIconImage are private. They contain information about the specific HICON, including pointers to the standard HICON structures defined by Windows. TIconImage is referenced in the constructor of the TIcon object when the icon image is created.


TIconImage methods

TIconImage	Alphabetically

In TIconImage

Destroy

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TIconImage methods

TIconImage	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TIconImage.Destroy

TIconImage	See also

Destroys the TIconImage instance and frees its memory.

destructor Destroy; override;

Description

You do not need to destroy the icon image. The TIconImage object is automatically destroyed by the icon object.


Hierarchy

TObject

TSharedImage


IDesignerNotify

Hierarchy	Methods	See also

IDesignerNotify is the interface for responding to notifications about changes to components in the designer.

Unit

Classes

Description

IDesignerNotify introduces two methods, Modified and Notification, that allow the designer to respond when components are added, deleted, or changed. These methods are called automatically by the form designer or by component and property editors.


IDesignerNotify methods

IDesignerNotify	Alphabetically

In IDesignerNotify

Modified

Notification

Derived from IUnknown

_AddRef

_Release

QueryInterface


IDesignerNotify methods

IDesignerNotify	By object

_AddRef

_Release

Modified

Notification

QueryInterface


IDesignerNotify.Modified
IDesignerNotify.::Modified

IDesignerNotify	See also

Notifies property and component editors when a change is made to a component.

procedure Modified;

Description

When any change is made to a component the property and component editors call this method, allowing the designer to respond to the change.


IDesignerNotify.Notification
IDesignerNotify.::Notification

IDesignerNotify	See also

Allows the designer to respond when a notification is sent to the form.

procedure Notification(AComponent: TComponent; Operation: TOperation);

Description

When a form receives a notification, it calls the Notification method of the designer, allowing the designer to respond to all the notifications the form receives.


Hierarchy

IUnknown


IDesigner

Hierarchy	Properties	Methods	See also

IDesigner is an interface that allows component writers to interact with the form designer in the IDE.

Unit

Forms

Description

IDesigner provides access to the form currently under construction in the form designer, and influences the behavior of the designer by specifying whether the object under construction is a form (as opposed to a composite component), drawing the grid that assists in layout, and so on.

Component writers can access the current IDesigner interface using the Designer property of a form, or access IFormDesigner (an IDesigner descendant) using the Designer property of a component editor or property editor.


IDesigner properties

IDesigner	Alphabetically

In IDesigner

Form

IsControl


IDesigner properties

IDesigner	By object

Form

IsControl


IDesigner.Form
IDesigner.::Form

IDesigner	See also

Provides a reference to the form currently being designed.

property Form: TCustomForm;

Description

Use Form to access the form, if any, that is being designed. When the user specifies changes in the form designer, the changes can be made to the form specified by the Form property.

Note:	Not every designer has a form.  For example, when the designer is used for a data module, remote data module, or active form, the Form property should not be used. Instead, use the object returned by GetRoot.


IDesigner.IsControl
IDesigner.::IsControl

IDesigner	See also

Specifies whether the form is in its form state or its control state.

property IsControl: Boolean;

Description

If the designer is used to create a control, rather than a form, set IsControl to True when the user finishes designing the control.


IDesigner methods

IDesigner	Alphabetically

In IDesigner

GetCustomForm

GetIsControl

GetRoot

IsDesignMsg

PaintGrid

SetCustomForm

SetIsControl

UniqueName

ValidateRename

Derived from IDesignerNotify

Modified

Notification

Derived from IUnknown

_AddRef

_Release

QueryInterface


IDesigner methods

IDesigner	By object

_AddRef

_Release

GetCustomForm

GetIsControl

GetRoot

IsDesignMsg

Modified

Notification

PaintGrid

QueryInterface

SetCustomForm

SetIsControl

UniqueName

ValidateRename


IDesigner.GetCustomForm
IDesigner.::GetCustomForm

IDesigner	See also

Specifies the value returned when the Form property is read.

function GetCustomForm: TCustomForm;

Description

Implement GetCustomForm to specify the value returned when the Form property is read.


IDesigner.GetIsControl
IDesigner.::GetIsControl

IDesigner	See also

Specifies the value returned when the IsControl property is read.

function GetIsControl: Boolean;

Description

Implement GetIsControl to specify the value returned when the IsControl property is read.


IDesigner.GetRoot

IDesigner	See also

Returns the current entity being edited by the form designer.

function GetRoot: TComponent;

Description

Call GetRoot to obtain the object the form designer is working on. If this object is a descendant of TCustomForm, GetRoot returns the value of the Form property.

Use GetRoot rather than the Form property, to ensure that code works even when editing a data module, remote data module, active form, or other entity that is not a descendant of TCustomForm.


IDesigner.IsDesignMsg
IDesigner.::IsDesignMsg

IDesigner	See also

Determines when the designer should handle a Windows message.

 IsDesignMsg(Controls:: TControl* Sender, Messages::TMessage &Message) = 0;

function IsDesignMsg(Sender: TControl; var Message: TMessage): Boolean;

Description

IsDesignMsg is called for each message sent to a component in the designer. This method returns True if the message is a design message, meaning one the designer should handle for the component.


IDesigner.PaintGrid
IDesigner.::PaintGrid

IDesigner	See also

Paints the alignment grid on the form's canvas.

procedure PaintGrid;

Description

Forms that are associated with a designer call the PaintGrid method in response to Windows paint messages. If there is no designer associated with the form, the form’s Paint method is called instead.


IDesigner.SetCustomForm
IDesigner.::SetCustomForm

IDesigner	See also

Specifies what happens when the Form property is set.

 SetCustomForm(TCustomForm* Value) = 0;

procedure SetCustomForm(Value: TCustomForm);

Description

Implement SetCustomForm to specify what happens when the Form property is set.


IDesigner.SetIsControl
IDesigner.::SetIsControl

IDesigner	See also

Specifies what happens when the IsControl property is set.

 SetIsControl( Value) = 0;

procedure SetIsControl(Value: Boolean);

Description

Implement SetIsControl specify what happens when the IsControl property is set.


IDesigner.UniqueName

IDesigner	See also

Generates a unique name from a specified base string.

function UniqueName(const BaseName: string): string;

Description

Call UniqueName to automatically generate a unique name for a component. Specify the base string for the name by the BaseName parameter. UniqueName appends a number to BaseName to ensure that there are no name-space conflicts.


IDesigner.ValidateRename
IDesigner.::ValidateRename

IDesigner	See also

Restricts the names that can be given to components on the form that is being designed.

 ValidateRename(Classes::TComponent* AComponent,  AnsiString CurName,  AnsiString NewName) = 0;

ValidateRename(AComponent: TComponent; const CurName, NewName: string);

Description

Call ValidateRename to determine if the component specified by AComponent, which currently has the name specified by CurName, can be renamed to the string specified by NewName. This method is usually called by the form's ValidateRename method to provide tighter restrictions on renaming, such as prohibiting reserved words.


Hierarchy

IUnknown

IDesignerNotify


TIDispatchField

Hierarchy	Properties	Methods	Events	See also

TIDispatchField represents an IDispatch field in a dataset.

Unit

DB

Description

TIDispatchField is a persistent field object that encapsulates the fundamental behavior common to fields that contain pointers to IDispatch interfaces as data. TIDispatchField introduces no new properties, methods or events, but reimplements the Value property to adapt them to accessing fields containing IDispatch interfaces.

As with all persistent field objects, a TIDispatchField can be created at design-time using the Fields Editor or at runtime by calling the constructor for the class. Persistent field objects exist solely in the memory space of an application. Creating a persistent field object only creates an object in the application, and does not result in the creation of a field in a table.

Fields in a table can be accessed without use of persistent field objects. Virtual field objects are created to provide access to a field when the field is referenced through such means as the TDataSet.Fields property or the TDataSet.FieldByName method. However, as both the Fields property and the FieldByName method return a value of type TIDispatchField, the return value must be typecast as a TIDispatchField before using any property specific to TIDispatchField.


TIDispatchField properties

TIDispatchField	Alphabetically	Legend

In TIDispatchField

Value

Derived from TInterfaceField

AsVariant

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TInterfaceField properties

TInterfaceField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

ValidChars

Value

VCLComObject

Visible


TIDispatchField.Value

TIDispatchField	See also

Represents the data in an interface field component.

property Value: Variant

Description

Use Value to read data directly from and write data directly to a field component at runtime. For example, use the Value property to affect the contents of a field that is not Visible.


TIDispatchField events

TIDispatchField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TIDispatchField events

TIDispatchField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TIDispatchField methods

TIDispatchField	Alphabetically

In TIDispatchField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

GetParentComponent

HasParent

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TIDispatchField methods

TIDispatchField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TIDispatchField.Create

TIDispatchField	See also

Creates and initializes an IDispatch field component.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TIDispatchField. After calling the inherited constructor, Create sets the DataType property to ftIDispatch.

After instantiating a TIDispatchField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TIDispatchField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TIDispatchField with a dataset component by setting its DataSet property to the name of the dataset component.

The example below creates a TIDispatchField object for a field named IDispatch accessed through a TQuery named Query1.

var

  T: TIDispatchField;

begin

  Query1.Close;

  T := TIDispatchField.Create(Self);

  T.FieldName := 'IDispatch';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TInterfaceField


TInterfaceField

Hierarchy	Properties	Methods	Events	See also

TInterFaceField represents an interface field in a dataset.

Unit

DB

Description

TInterfaceField is a persistent field object that encapsulates the fundamental behavior common to fields that contain pointers to interfaces (IUnknown) as data. TInterfaceField introduces no new properties, methods or events, but reimplements the Value and AsVariant properties to adapt them to accessing fields containing interfaces.

As with all persistent field objects, a TInterfaceField can be created at design-time using the Fields Editor or at runtime by calling the constructor for the class. Persistent field objects exist solely in the memory space of an application. Creating a persistent field object only creates an object in the application, and does not result in the creation of a field in a table.

Fields in a table can be accessed without use of persistent field objects. Virtual field objects are created to provide access to a field when the field is referenced through such means as the TDataSet.::Fields property or the TDataSet.FieldByName method. However, as both the Fields property and the FieldByName method return a value of type TInterfaceField, the return value must be typecast as a TInterfaceField before using any property specific to TInterfaceField.


TInterfaceField properties

TInterfaceField	Alphabetically	Legend

In TInterfaceField

AsVariant

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TInterfaceField properties

TInterfaceField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

ValidChars

Value

VCLComObject

Visible


TInterfaceField.AsVariant

TInterfaceField	See also

Represents the Value of the interface field as type Variant.

property AsVariant: Variant;

Description

AsVariant provides a property to read the value of the field’s data into a Variant, or to assign a Variant value to the contents of the field.


TInterfaceField.Value

TInterfaceField	See also

Represents the data in an interface field component.

property Value: Variant

Description

Use Value to read data directly from and write data directly to a field component at runtime. For example, use the Value property to affect the contents of a field that is not Visible.


TInterfaceField events

TInterfaceField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TInterfaceField events

TInterfaceField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TInterfaceField methods

TInterfaceField	Alphabetically

In TInterfaceField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

GetParentComponent

HasParent

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TInterfaceField methods

TInterfaceField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TInterfaceField.Create

TInterfaceField	See also

Creates and initializes an interface field component.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TInterfaceField. After calling the inherited constructor, Create sets the DataType property to ftInterface.

After instantiating a TInterfaceField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TInterfaceField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TInterfaceField with a dataset component by setting its DataSet property to the name of the dataset component.

The example below creates a TInterfaceField object for a field named Interface accessed through a TQuery named Query1.

var

  T: TInterfaceField;

begin

  Query1.Close;

  T := TInterfaceField.Create(Self);

  T.FieldName := 'Interface';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField


IFormDesigner

Hierarchy	Properties	Methods	See also

IFormDesigner is an interface to the form designer in the IDE.

Unit

Dsgnintf

Description

Use IFormDesigner to interact with the current unit when implementing a property editor or component editor. Access an object that implements IFormDesigner through the Designer property of the property editor or component editor. IFormDesigner introduces several methods that are useful for managing standard menu items and for creating and manipulating components and methods such as event handlers.


IFormDesigner properties

IFormDesigner	Alphabetically	Legend

In IFormDesigner

AncestorDesigner

ContainerWindow

IsDormant

Derived from IDesigner

Form

IsControl


IFormDesigner properties

IFormDesigner	By object	Legend

AncestorDesigner

ContainerWindow

Form

IsControl

IsDormant


IFormDesigner.AncestorDesigner

IFormDesigner	See also

Returns an interface to form designer’s ancestor.

property AncestorDesigner: IFormDesigner;

Description

Use AncestorDesigner to access the ancestor interface for the form designer.


IFormDesigner.ContainerWindow

IFormDesigner	See also

Provides a reference to the windowed control that implements the design surface.

property ContainerWindow: TWinControl;

Description

ContainerWindow is the object into which controls or component icons can be placed. When designing a form, this is the same as the Form property. For other designers, however, this can be a design-only object. For example, when designing a data module or the service in a service application, ContainerWindow is the windowed control for the design-time window into which components are placed. This allows these nonvisual components (TDataModule or TService) to be visually edited at design time.


IFormDesigner.IsDormant

IFormDesigner	See also

Indicates whether the current root object exists in the IDE, or is only available as a streamed-out memory image.

property IsDormant: Boolean;

Description

Component writers should not need to use the IsDormant property, which should always be False when property editors or component editors are up. IsDormant is used internally when loading and unloading packages.


IFormDesigner methods

IFormDesigner	Alphabetically

In IFormDesigner

AddToInterface

BuildLocalMenu

CanPaste

ChainCall

ClearSelection

CopySelection

CreateComponent

CreateMethod

CutSelection

DeleteSelection

Edit

GetAncestorDesigner

GetComponent

GetComponentName

GetComponentNames

GetContainerWindow

GetIsDormant

GetMethodName

GetMethods

GetObject

GetObjectName

GetObjectNames

GetPrivateDirectory

GetProjectModules

GetRootClassName

GetScrollRanges

GetSelections

HasInterface

HasInterfaceMember

IsComponentLinkable

IsSourceReadOnly

MakeComponentLinkable

MethodExists

MethodFromAncestor

ModuleFileNames

NoSelection

PasteSelection

RenameMethod

Revert

SelectComponent

SetContainerWindow

SetSelections

ShowMethod

Derived from IDesigner

GetCustomForm

GetIsControl

GetRoot

IsDesignMsg

PaintGrid

SetCustomForm

SetIsControl

UniqueName

ValidateRename

Derived from IDesignerNotify

Modified

Notification

Derived from IUnknown

_AddRef

_Release

QueryInterface


IFormDesigner methods

IFormDesigner	By object

_AddRef

_Release

AddToInterface

BuildLocalMenu

CanPaste

ChainCall

ClearSelection

CopySelection

CreateComponent

CreateMethod

CutSelection

DeleteSelection

Edit

GetAncestorDesigner

GetComponent

GetComponentName

GetComponentNames

GetContainerWindow

GetCustomForm

GetIsControl

GetIsDormant

GetMethodName

GetMethods

GetObject

GetObjectName

GetObjectNames

GetPrivateDirectory

GetProjectModules

GetRoot

GetRootClassName

GetScrollRanges

GetSelections

HasInterface

HasInterfaceMember

IsComponentLinkable

IsDesignMsg

IsSourceReadOnly

MakeComponentLinkable

MethodExists

MethodFromAncestor

Modified

ModuleFileNames

NoSelection

Notification

PaintGrid

PasteSelection

QueryInterface

RenameMethod

Revert

SelectComponent

SetContainerWindow

SetCustomForm

SetIsControl

SetSelections

ShowMethod

UniqueName

ValidateRename


IFormDesigner.AddToInterface

IFormDesigner	See also

Adds an item to the form designer’s interface.

procedure AddToInterface(InvKind: Integer; const Name: string; VT: Word; const TypeInfo: string);

Description

Use AddToInterface to define a new procedure, function, or property for the interface of a remote data module or active form.

The InvKind parameter specifies the type of interface to add. It is of the following values:

Value	Meaning

INVOKE_FUNC	The interface member calls a method.

INVOKE_PROPERTYGET	The interface member returns a property value.

INVOKE_PROPERTYPUT	The interface member sets a property value.

INVOKE_PROPERTYPUTREF	The interface member sets a property by reference.

The Name parameter specifies the name of the property or method.

The T parameter indicates the return type of the interface member.  It is a VARENUM value such as VT_BOOL (boolean), VT_DISPATCH (IDISPATCH pointer), VTERROR (SCODE), and so on.

The TypeInfo parameter gives the name of the typeinfo of the return type if the T parameter is VT_USERDEFINED.  The typeinfo is the same value that defines the type in the type library.


IFormDesigner.BuildLocalMenu

IFormDesigner	See also

Adds the standard component menu items to a popup menu.

function BuildLocalMenu(Base: TPopupMenu, Filter:TLocalMenuFilters): TPopupMenu;

Description

Use BuildLocalMenu to add the standard component menu commands to the popup menu specified by Base. The resulting menu includes the menu items in Base followed by the items common to all components.

Base is the menu to which the standard commands are added.

Filter identifies which commands are to be added.

Most component writers do not need to call this method because TComponentEditor automatically builds a popup menu from its verbs and calls BuildLocalMenu to add in the common menu items.


IFormDesigner.CanPaste

IFormDesigner	See also

Indicates whether the user can paste the contents of the clipboard into the designer.

function CanPaste: Boolean;

Description

CanPaste indicates whether the Paste command on the Edit menu should be grayed. When CanPaste returns True, the current selection in the designer can accept the contents of the Windows clipboard.

If the user subsequently chooses the Paste command, the PasteSelection method handles the details of pasting the contents of the clipboard.


IFormDesigner.ChainCall

IFormDesigner

Used internally when creating event methods that call another event handler inherited from a frame.

procedure ChainCall(const MethodName, InstanceName, InstanceMethod: string; TypeData: PTypeData);

Description

ChainCall is used internally to generate the method call to an inherited method. Applications should not use this method.


IFormDesigner.ClearSelection

IFormDesigner	See also

Clears the contents of the selected component or components.

procedure ClearSelection;

Description

Call ClearSelection to delete the contents of the components returned by GetSelections.


IFormDesigner.CopySelection

IFormDesigner	See also

Copies the selected component or components to the Windows clipboard

procedure CopySelection;

Description

Call CopySelection to copy the components returned by GetSelections to the Windows clipboard.


IFormDesigner.CreateComponent

IFormDesigner	See also

Creates a specified component.

CreateComponent(ComponentClass: TComponentClass; Parent: TComponent; Left, Top, Width, Height: Integer): TComponent;

Description

Call CreateComponent to create an instance of ComponentClass at the position specified by the Left and Height parameters with the size specified by the Width and Height parameters. The new component will be a child of the component specified by the Parent parameter.


IFormDesigner.CreateMethod

IFormDesigner	See also

Creates an event handler.

function CreateMethod(const Name: string; TypeData: PTypeData): TMethod;

Description

Call CreateMethod to add an event handler to the unit of the object returned by the GetRoot method. Allocate a TTypeData structure and fill in the MethodKind, ParamCount, and ParamList fields. The event handler gets the name specified by the Name parameter and the type specified by the TypeData parameter. CreateMethod returns a method pointer to the new event handler.


IFormDesigner.CutSelection

IFormDesigner	See also

Copies the selected component or components to the Windows clipboard

procedure CutSelection;

Description

Call CutSelection to cut the components returned by GetSelections to the Windows clipboard. CutSelection has the same effect as a call to CopySelection and to DeleteSelection, but in a single action.


IFormDesigner.DeleteSelection

IFormDesigner	See also

Deletes the selected component or components

procedure DeleteSelection;

Description

Call DeleteSelection to remove the components returned by GetSelections from the designer and free their memory.

To remove the components from the set of selected components without deleting them, use SetSelections instead.  To delete the contents of the components but not the components themselves, use ClearSelection instead.


IFormDesigner.Edit

IFormDesigner	See also

Displays the component editor for the specified component.

procedure Edit(const Component: IComponent);

Description

Call Edit to display the component editor for the component with the interface specified by Component. Passing nil displays the Form editor.


IFormDesigner.GetAncestorDesigner

IFormDesigner	See also

Implements the AncestorDesigner property.

function GetAncestorDesigner: IFormDesigner;

Description

GetAncestorDesigner is the read implementation of the AncestorDesigner property.


IFormDesigner.GetComponent

IFormDesigner	See also

Returns the component with the name passed as a parameter.

function GetComponent(const Name: string): TComponent;

Description

Call GetComponent to access a component given its name. If the component is not in the current root object, the Name parameter should include the name of the entity in which it resides. For example, to obtain a reference to a component in a data module named 'DataModule2', use a line such as

TheComponent := Designer.GetComponent('DataModule2.Button1');

If DataModule2’s unit is in the uses clause of the current root object, GetComponent will return the component.

Note:	To obtain a reference to a persistent object that is not a component, use the GetObject method instead.


IFormDesigner.GetComponentName

IFormDesigner	See also

Returns the name of the component passed as its parameter.

function GetComponentName(Component: TComponent): string;

Description

Call GetComponentName to obtain the name of a component. This is the inverse of GetComponent.

Note:	If the component is in the current root object, GetComponentName returns the Name property of the component itself. If the component is in another entity, GetComponentName qualifies the component name with the name of the object in which it resides.


IFormDesigner.GetComponentNames

IFormDesigner	See also

Executes a callback for every component that can be assigned a property of a specified type.

procedure GetComponentNames(TypeData: PTypeData; Proc: TGetStrProc);

Description

Use GetComponentNames to call the procedure specified by the Proc parameter for every component that can be assigned a property that matches the TypeData parameter. For each component, Proc is called with its S parameter set to the name of the component. This parameter can be used to obtain a reference to the component by calling the GetComponent method.

Note:	GetComponentNames will call the Proc parameter for components in units used by the current root object as well as the entity returned by the GetRoot method.


IFormDesigner.GetContainerWindow

IFormDesigner	See also

Implements the ContainerWindow property.

function GetContainerWindow: TWinControl;

Description

GetContainerWindow is the read implementation of the ContainerWindow property.


IFormDesigner.GetIsDormant

IFormDesigner	See also

Implements the read-only IsDormant property.

function GetIsDormant: Boolean;

Description

GetIsDormant is the read implementation of the IsDormant property.


IFormDesigner.GetMethodName

IFormDesigner	See also

Returns the name of a specified event handler.

function GetMethodName(const Method: TMethod): string;

Description

Call GetMethodName to obtain the name of an event handler given a pointer to it.


IFormDesigner.GetMethods

IFormDesigner	See also

Executes a callback for every method of a specified type.

procedure GetMethods(TypeData: PTypeData; Proc: TGetStrProc);

Description

Use GetMethods to call the procedure specified by the Proc parameter for every event handler that matches the TypeData parameter. For each event handler, Proc is called with its S parameter set to the name of the method. This parameter can be used to bring up a code editor for the method by calling the ShowMethod method.


IFormDesigner.GetObject

IFormDesigner	See also

Returns the persistent object with the name passed as a parameter.

function GetObject(const Name: string): TPersistent;

Description

Call GetObject to access a persistent object given its name. This is useful when working with components that include constituent objects such as the TStatusPanel objects that are used by TStatusBar.

To obtain the name of a persistent object, use the GetObjectName method.


IFormDesigner.GetObjectName

IFormDesigner	See also

Returns the name of the object passed as its parameter.

function GetObjectName(Instance: TPersistent): string;

Description

Call GetObjectName to obtain the name of a persistent object. This is the inverse of GetObject. GetObjectName is useful when working with components that include constituent objects, such as the TStatusPanel objects that are used by TStatusBar.


IFormDesigner.GetObjectNames

IFormDesigner	See also

Executes a callback for every object that can be assigned a property of a specified type.

procedure GetObjectNames(TypeData: PTypeData; Proc: TGetStrProc);

Description

Use GetObjectNames to call the procedure specified by the Proc parameter for every persistent object that can be assigned a property that matches the TypeData parameter. For each object, Proc is called with its S parameter set to the name of the object. This parameter can be used to obtain a reference to the object by calling the GetObject method.

Note:	GetObjectNames will call the Proc parameter for components in forms or modules used by the current root object as well as the entity returned by the GetRoot method.


IFormDesigner.GetPrivateDirectory

IFormDesigner

Returns the private directory for the form designer.

function GetPrivateDirectory: string;

Description

Call GetPrivateDirectory to obtain the location specified in the registry under the key:

HKEY_CURRENT_USER\Software\Borland\Delphi\5.0\Globals\PrivateDir

This directory can be used for housing executables or auxiliary files that store state information, examples, templates, and so on.


IFormDesigner.GetProjectModules

IFormDesigner	See also

Executes a callback for every module being edited by the form designer.

type

  TGetModuleProc = procedure(const FileName, UnitName, FormName, DesignClass: string; CoClasses: TStrings) of object;

procedure GetProjectModules(Proc: TGetModuleProc);

Description

Call GetProjectModules to execute a callback function for every module in the current project. The callback is of type TGetModuleProc.

The FileName parameter specifies the file name for the module.  The UnitName parameter specifies the name of the unit (usually the same as the file base name).  The FormName parameter indicates the name of the associated form, data module, property page, or other registered base component.  The DesignClass parameter indicates the class of the object named by the FormName parameter.  The CoClasses parameter lists all CoClasses supported by the module.


IFormDesigner.GetRootClassName

IFormDesigner	See also

Returns the class name for the root component.

function GetRootClassName: string;

Description

Call GetRootClassName to obtain the name of the component returned by the GetRoot method.


IFormDesigner.GetScrollRanges

IFormDesigner	See also

Returns the size of the logical designer window.

function GetScrollRanges(const ScrollPosition: TPoint): TPoint;

Description

Call GetScrollRanges to determine the farthest point to which the designer can scroll. The ScrollPosition parameter specifies a point that must be included in the scroll range. GetScrollRanges returns the coordinates that minimally contain all components on the design surface plus the point specified by ScrollPosition.


IFormDesigner.GetSelections

IFormDesigner	See also

Fills a list with all selected components on the current root object.

procedure GetSelections(const List: IDesignerSelections);

Description

Use GetSelections to access every component currently selected on the root object returned by the GetRoot method.

Pass a component (such as TDesignerSelectionList) that supports the IDesignerSelections interface as the List parameter. GetSelections fills this component with references to the selected objects.

Note:	GetSelections can return persistent objects that are not components, as well as components.


IFormDesigner.HasInterface

IFormDesigner	See also

Indicates whether the current root object has an associated interface.

function HasInterface: Boolean;

Description

Call HasInterface to determine whether the designer is working on an entity with an associated interface, such as a remote data module or active form. If HasInterface returns True, then the HasInterfaceMember and AddToInterface methods can be used.


IFormDesigner.HasInterfaceMember

IFormDesigner	See also

Indicates whether the interface associated with the current root object has a specified property or method.

function HasInterfaceMember(const Name: string): Boolean;

Description

Call HasInterfaceMember to determine whether the interface of the current root object has a property or method with the name specified by the Name parameter.

Note:	If the object returned by the GetRoot method does not have an associated interface, then HasInterfaceMember always returns False.


IFormDesigner.IsComponentLinkable

IFormDesigner	See also

Indicates whether a component is declared in a unit used by the current root object.

function IsComponentLinkable(Component: TComponent): Boolean;

Description

Call IsComponentLinkable to determine whether the component specified by the Component parameter can be referenced from within the object returned by the GetRoot method. IsComponentLinkable returns True if the specified component is declared in a unit used by the root object.

If IsComponentLinkable returns False, the component’s unit can be added to the uses clause of the root unit by calling MakeComponentLinkable.


IFormDesigner.IsSourceReadOnly

IFormDesigner

Indicates whether the source file for the component being designed is read-only.

function IsComponentLinkable(Component: TComponent): Boolean;

Description

Call IsSourceReadOnly to determine whether the unit module for the object in the designer is a read-only file.


IFormDesigner.MakeComponentLinkable

IFormDesigner	See also

Adds a component’s unit to the uses clause of the root unit.

procedure MakeComponentLinkable(Component: TComponent);

Description

Call MakeComponentLinkable to add the specified component's unit to the uses clause of the object being designed.


IFormDesigner.MethodExists

IFormDesigner	See also

Indicates whether an event handler with a specified name already exists.

function MethodExists(const Name: string): Boolean;

Description

Call MethodExists to determine whether an event handler with a given name has already been created. If MethodExists returns True, the specified event handler exists and can be displayed by calling the ShowMethod method. If MethodExists returns False, the specified event handler does not exist, and can be created by calling the CreateMethod method.


IFormDesigner.MethodFromAncestor

IFormDesigner	See also

Indicates whether an event handler is inherited from an ancestor of the root object.

function MethodFromAncestor(const Method: TMethod): Boolean;

Description

Call MethodFromAncestor to determine whether the object returned by the GetRoot method implements a given method. MethodFromAncestor returns False if the method is introduced by the root object, True if it is introduced by an ancestor.


IFormDesigner.ModuleFileNames

IFormDesigner	See also

Indicates the files associated with the current root object.

procedure ModuleFileNames(var ImplFileName, IntfFileName, FormFileName: string);

Description

Call ModuleFileNames to obtain the names of files that contain information about the current root object.

ImplFileName is the source code file that contains the root object’s implementation.

IntfFileName is the file that contains the root object’s declaration. Typically, this is the same as ImplFileName.

FormFileName is the form file (.dfm) for the root object.


IFormDesigner.NoSelection

IFormDesigner	See also

Deselects all components in the form designer.

procedure NoSelection;

Description

Use NoSelection to programmatically deselect all components in the designer.

Note:	To set the selection to a specific component or set of components, use the SelectComponent or SetSelections method.


IFormDesigner.PasteSelection

IFormDesigner	See also

Pastes the contents of the clipboard into the selected component or components

procedure DeleteSelection;

Description

Call PasteSelection to paste the contents of the Windows clipboard to the components returned by GetSelections.


IFormDesigner.RenameMethod

IFormDesigner	See also

Renames an existing event handler.

procedure RenameMethod(const CurName, NewName: string);

Description

Call RenameMethod to provide an event handler with a new name. The CurName parameter specifies the current name of the event handler, and the NewName parameter specifies the value that the name should be changed to.

Note:	Before calling RenameMethod, check whether a method with the new name already exists by calling MethodExists.


IFormDesigner.Revert

IFormDesigner	See also

Restores a specified property to its value before any edits were made.

type

  TTypeKind = (tkUnknown, tkInteger, tkChar, tkEnumeration, tkFloat, tkString, tkSet, tkClass, tkMethod, tkWChar, tkLString, tkWString, tkVariant, tkArray, tkRecord, tkInterface);

  PPTypeInfo = ^PTypeInfo;

  PTypeInfo = ^TTypeInfo;

  TTypeInfo = record

    Kind: TTypeKind;

    Name: ShortString;

  end;

PPropInfo = ^TPropInfo;

  TPropInfo = packed record

    PropType: PPTypeInfo;

    GetProc: Pointer;

    SetProc: Pointer;

    StoredProc: Pointer;

    Index: Integer;

    Default: Longint;

    NameIndex: SmallInt;

    Name: ShortString;

  end;

procedure Revert(Instance: TPersistent; PropInfo: PPropInfo);

Description

Call Revert to undo all changes that have been made to the property specified by the PropInfo parameter on the object specified by the Instance parameter. Revert restores the property to the setting it had when Instance was first created.


IFormDesigner.SelectComponent

IFormDesigner	See also

Replaces the current set of selected components by a single specified object.

procedure SelectComponent(Instance: TPersistent);

Description

Call SelectComponent to select a single persistent object in the designer. Any previous set of selected components is de-selected. To select a set of objects, use the SetSelections method instead.


IFormDesigner.SetContainerWindow

IFormDesigner	See also

Implements the ContainerWindow property.

procedure SetContainerWindow(const NewContainer: TWinControlTWinControl);

Description

SetContainerWindow is the write implementation of the ContainerWindow property.


IFormDesigner.SetSelections

IFormDesigner	See also

Changes the currently selected set of components.

procedure SetSelections(const List: IDesignerSelections);

Description

Call SetSelections to programmatically change which objects in the root object are selected. Pass in a list of selections using an object such as TDesignerSelectionList that supports the IDesignerSelections interface.

Note:	The List parameter of SetSelections can contain persistent objects that are not components.


IFormDesigner.ShowMethod

IFormDesigner	See also

Activates the code editor with the input cursor in a specified event handler.

procedure ShowMethod(const Name: string);

Description

Call ShowMethod to allow the user to edit the method specified by the Name parameter.


Accessibility

Read-only


Hierarchy

IUnknown

IDesignerNotify

IDesigner


 TImage

Hierarchy	Properties	Methods	Events	See also

TImage displays a graphical image.

Unit

extctrls

Description

Use TImage to display a graphical image on a form. Use a TPicture object to specify the actual bitmap, icon, metafile, or other graphic object displayed by TImage. TImage introduces several properties to determine how the image is displayed within the boundaries of the TImage object.

To add an image to a form or data module so that it is available for display by other controls, use TImageList instead.


TImage properties

TImage	Alphabetically	Legend

In TImage

Canvas

Center

IncrementalDisplay

Picture

Stretch

Transparent

Derived from TControl

Action

Align

Anchors

AutoSize

BiDiMode

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TImage properties

TImage	By object	Legend

Action

Align

Anchors

AutoSize

BiDiMode

BoundsRect

Canvas

Center

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlState

ControlStyle

Cursor

DesignInfo

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

IncrementalDisplay

Left

LRDockWidth

Name

Owner

Parent

ParentShowHint

Picture

PopupMenu

ShowHint

Stretch

Tag

TBDockHeight

Top

Transparent

VCLComObject

Visible

Width

WindowProc


TImage.AutoSize

TImage	See also

Determines whether the image control resizes to accommodate the image it displays.

property AutoSize: Boolean;

Description

Set AutoSize to True to ensure that the entire image is visible within the image control. When AutoSize is True, the image control resizes to accommodate the image specified by the Picture property. When AutoSize is False, the image control remains the same size, regardless of the size of the image. If the image control is smaller than the image, only the portion of the picture that fits inside the image control is visible.

To resize the image to fit the image control rather than resizing the control to fit the image, use the Stretch property.


TImage.Canvas

TImage	See also 	Example

Provides a drawing surface for embellishing bitmap images.

property Canvas: TCanvas;

Description

Use Canvas to add to the image specified by the Picture property. For example, use the TextOut method of the TCanvas object to add labels to portions of the image.

Note:	Canvas is only available if the Picture property represents a bitmap. Trying to read Canvas when Picture is another type of graphic image raises an EInvalidOperation exception.


TImage.Center

TImage	See also

Indicates whether the image is centered in the image control.

property Center: Boolean;

Description

When the image does not fit perfectly within the image control, use Center to specify how the image is positioned. When Center is True, the image is centered in the control. When Center is False, the upper left corner of the image is positioned at the upper left corner of the control.

Note:	Center has no effect if the AutoSize property is True or if the Stretch property is True and Picture does not specify an icon.


TImage.IncrementalDisplay

TImage	See also

Specifies whether successive approximations of the image should be drawn during slow operations.

property IncrementalDisplay: Boolean;

Description

Set IncrementalDisplay to True on large compressed images that take a long time to load or on images that may be altered by a computationally slow process. When IncrementalDisplay is True, partial renderings of the image are drawn periodically during slow operations such as loading. Set IncrementalDisplay to False to wait until the entire operation is complete before drawing the image.

For some classes of graphic objects, an OnProgress event occurs at various points during slow operations. If IncrementalDisplay is True, the OnProgress event occurs immediately after the approximate image is drawn. If IncrementalDisplay is False, OnProgress occurs, but the image is not updated.


TImage.Picture

TImage	Example

Specifies the image that appears on the image control.

property Picture: TPicture;

Description

Set Picture to a TPicture object that contains an icon, metafile, bitmap graphic, or user-defined graphic to be displayed by the image control. Setting Picture at design time brings up the Picture Editor, which can be used to specify the file that contains the image.


TImage.Stretch

TImage	See also

Indicates whether the image should be changed so that it exactly fits the bounds of the image control.

property Stretch: Boolean;

Description

Set Stretch to True to cause the image to assume the size and shape of the image control. When the image control resizes, the image resizes also. Stretch resizes the height and width of the image independently. Thus, unlike a simple change in magnification, stretch can distort the image if the image control is not the same shape as the image.

To resize the control to the image rather than resizing the image to the control, use the AutoSize property instead.

Note:	Stretch has no effect if the Picture property contains an icon.


TImage.Transparent

TImage	See also

Specifies whether the background of the image obscures objects below the image object.

property Transparent: Boolean;

Description

Set Transparent to True to allow objects behind the TImage object to show through the background of the bitmap.  Set Transparent to False to make the background of the bitmap opaque. Setting Transparent sets the Transparent property of the Picture.

Note:	Transparent has no effect unless the Picture property specifies a bitmap.


TImage events

TImage	Alphabetically	Legend

In TImage

OnProgress

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TImage events

TImage	By object	Legend

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnProgress

OnStartDock

OnStartDrag


TImage.OnProgress

TImage	See also

Occurs periodically during slow operations that affect the image.

type

  TProgressStage = (psStarting, psRunning, psEnding);

  TProgressEvent = procedure (Sender: TObject; Stage: TProgressStage; PercentDone: Byte; RedrawNow: Boolean; const R: TRect; const Msg: string) of object;

property OnProgress: TProgressEvent

Description

Write an OnProgress event handler to provide the user with feedback during slow operations such as loading large compressed images.

The Stage parameter indicates whether the operation is beginning, continuing, or ending. If the OnProgress event handler displays an indicator such as a progress bar, the indicator can be created when Stage is psStarting, updated while Stage is psRunning, and removed when Stage is psEnding. The PercentDone parameter is an approximation of how much of the operation has completed. Use PercentDone to update the position of a progress bar or other indicator.

The RedrawNow parameter indicates whether the image can safely be drawn on screen at this point. If the IncrementalDisplay property is True, an approximate image is drawn immediately before the OnProgress event when RedrawNow is True. The R parameter specifies the portion of the image that has changed and needs to be redrawn.

The Msg parameter contains one or two words that describe what operation is occurring. For example, the value of Msg could be a string such as Loading, Storing, or Reducing colors. The Msg string can also be empty.

Note:	The PercentDone parameter is only an approximation. With some image formats, the value of PercentDone may actually decrease from the value in previous events, as the graphic object discovers there is more work to do.


TImage methods

TImage	Alphabetically

In TImage

Create

Destroy

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

Invalidate

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

Repaint

ReplaceDockedControl

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TImage methods

TImage	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

NewInstance

Perform

Refresh

RemoveComponent

Repaint

ReplaceDockedControl

SafeCallException

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

TImage

Update

UpdateAction

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TImage.Create

TImage	See also

Creates and initializes an instance of TImage.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TImage object at runtime. Images placed on forms at design time are created automatically.


TImageTImage.Destroy
TImage.Destroy

TImage	See also

Destroys an instance of TImage.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TImage reference is not nil, and only then calls Destroy.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl


 TImageList

Hierarchy	Properties	Methods	Events	See also

TImageList represents a collection of same-sized images, each of which can be referred to by its index.

Unit

controls

Description

Image lists are used to efficiently manage large sets of icons or bitmaps. All images in an image list are contained in a single, wide bitmap in screen device format. An image list may also include a monochrome bitmap that contains masks used to draw images transparently (icon style).

The image list is capable of holding a large number of same sized images and retrieving them via their index within the range 0 to n - 1. The image list also has methods to facilitate storing, retrieving, and drawing of the stored images.

To add images to an image list at design time, right click and choose Image List Editor

Note:	Image lists depend on Comctl32.dll. If the system does not have the latest version installed, there may be problems getting images to appear.


TImageList properties

TImageList	Alphabetically	Legend

Derived from TDragImageList

DragCursor

Dragging

Derived from TCustomImageList

AllocBy

BkColor

BlendColor

Count

DrawingStyle

Handle

Height

ImageType

Masked

ShareImages

Width

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TImageList properties

TImageList	By object	Legend

AllocBy

BkColor

BlendColor

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Count

DesignInfo

DragCursor

Dragging

DrawingStyle

Handle

Height

ImageType

Masked

Name

Owner

ShareImages

Tag

VCLComObject

Width


TImageList events

TImageList	Alphabetically	Legend

Derived from TCustomImageList

OnChange


TImageList events

TImageList	By object	Legend

OnChange


TImageList methods

TImageList	Alphabetically

Derived from TDragImageList

BeginDrag

DragLock

DragMove

DragUnlock

EndDrag

GetHotSpot

HideDragImage

SetDragImage

ShowDragImage

Derived from TCustomImageList

Add

AddIcon

AddImages

AddMasked

Assign

Clear

Create

CreateSize

Delete

Destroy

Draw

DrawOverlay

FileLoad

GetBitmap

GetIcon

GetImageBitmap

GetInstRes

GetMaskBitmap

GetResource

HandleAllocated

Insert

InsertIcon

InsertMasked

Move

Overlay

RegisterChanges

Replace

ReplaceIcon

ReplaceMasked

ResInstLoad

ResourceLoad

UnRegisterChanges

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TImageList methods

TImageList	By object

Add

AddIcon

AddImages

AddMasked

AfterConstruction

Assign

BeforeDestruction

BeginDrag

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

CreateSize

DefaultHandler

Delete

Destroy

DestroyComponents

Destroying

Dispatch

DragLock

DragMove

DragUnlock

Draw

DrawOverlay

EndDrag

ExecuteAction

FieldAddress

FileLoad

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetBitmap

GetHotSpot

GetIcon

GetImageBitmap

GetInstRes

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetMaskBitmap

GetNamePath

GetParentComponent

GetResource

HandleAllocated

HasParent

HideDragImage

InheritsFrom

InitInstance

Insert

InsertComponent

InsertIcon

InsertMasked

InstanceSize

MethodAddress

MethodName

Move

NewInstance

Overlay

RegisterChanges

RemoveComponent

Replace

ReplaceIcon

ReplaceMasked

ResInstLoad

ResourceLoad

SafeCallException

SetDragImage

ShowDragImage

UnRegisterChanges

UpdateAction


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomImageList

TDragImageList


TIndexDef

Hierarchy	Properties	Methods	See also

TIndexDef describes an index in a database table.

Unit

db

Description

Use the properties and methods of an index definition to:

Set the attributes of a new index (when used with TTable.CreateTable).

Determine the name of an index.

Identify the fields that make up the index, or the dBASE expression that orders the index.

Determine the characteristics of the index.

Datasets that represent physical database tables use TIndexDef to create the indexes of the database table or to obtain information about the indexes when the table is not active.


TIndexDef properties

TIndexDef	Alphabetically	Legend

In TIndexDef

CaseInsFields

DescFields

Expression

FieldExpression

Fields

GroupingLevel

Options

Source

Derived from TNamedItem

DisplayName

Name

Derived from TCollectionItem

Collection

ID

Index


TIndexDef properties

TIndexDef	By object	Legend

CaseInsFields

Collection

DescFields

DisplayName

Expression

FieldExpression

Fields

GroupingLevel

ID

Index

Name

Options

Source


TIndexDef.CaseInsFields

TIndexDef 	See also

Specifies the fields of the index that are case-insensitive.

property CaseInsFields: String;

Description

Set CaseInsFields to a string containing a list of field names, separated by semi-colons. The fields specified in CaseInsFields are the fields used in the new index for which the ordering will be case-insensitive. Fields in the index definition but not in the CaseInsFields list use the case sensitivity ordering that is default for the database type. It is possible that a single index can have fields using both case-insensitive and case-sensitive ordering.

For a field to be included in CaseInsFields, the field must be included in the fields on which the index is based. These fields are specified in the Fields property of the TIndexDef object.

Note:	Not all database systems necessarily support having both case-insensitive and case-sensitive field orderings in the same index. Consult the documentation for the particular database system used to determine whether this is actually supported. Some database systems require an index be designated case-insensitive as a whole (all of its base fields).

In the example below, the CaseInsFields property is given a list of two table fields for the index being created: LastName and Company.

with Table1 do begin

  …

  with IndexDefs do begin

    with AddIndexDef do begin

      Name := 'MultiIndex'

      Fields := 'LastName;Company;State'

      Options := [ixUnique];

    end;

    Items[IndexDefs.Count – 1].CaseInFields := 'LastName;Company';

  end;

  …

  CreateTable;

end;


TIndexDef.DescFields

TIndexDef 	See also

Specifies the fields of the index that are to be in descending order.

property DescFields: String;

Description

Set DescFields to a string containing a list of field names, separated by semi-colons. The fields specified in DescFields are the fields used in the new index for which the ordering will be descending. Fields in the index definition but not in the DescFields list use the default ascending ordering. It is possible that a single index can have fields using both ascending and descending ordering.

For a field to be included in DescFields, the field must be included in the fields on which the index is based. These fields are specified in the Fields property of the TIndexDef object.

Note:	Not all database systems necessarily support having both ascending and descending field orderings in the same index. Consult the documentation for the particular database system used to determine whether this is actually supported.

In the example below, the DescFields property is given a list of two table fields for the index being created: TransDate and Company.

with Table1 do begin

  …

  with IndexDefs do begin

    with AddIndexDef do begin

      Name := 'MultiIndex'

      Fields := 'TransDate;Company;State'

      Options := [ixUnique];

    end;

    Items[IndexDefs.Count – 1].DescInFields := 'TransDate;Company';

  end;

  …

  CreateTable;

end;


TIndexDef.Expression

TIndexDef	See also

Contains a dBASE key expression.

property Expression: String;

Description

Read Expression to learn the key expression of a dBASE expression index.

A key expression for a dBASE table is a field name, or a combination of field names, functions, and operators that specifies how the index orders records in the table. If the table is not a dBASE table, Expression is an empty string.

If the Options property set does not contain the value ixExpression, the Expression property string returned is an empty string. To learn the fields in an index that is not a dBASE expression index, use the Fields property.

Note:	For more information about key expressions, see your dBASE documentation.


TIndexDef.Expression
TIndexDef.FieldExpression

TIndexDef 	See also

FieldExpression provides access to either a list of field names or an index expression.

property FieldExpression: String;

Description

FieldExpression provides access to the private data member on TIndexDef which contains either a list of field names or an index expression. This data member is used to return the value for the Fields property or the Expression property depending on whether ixExpression is in Options.

This property is used by TBDEDataset but normally a developer should use the Fields or Expression properties instead.


TIndexDef.Fields

TIndexDef	See also	Example

Identifies the fields that comprise the index.

property Fields: String;

Description

When creating an index, set Fields to a list of fields separated by semi-colons (no semi-colon is required if there is only one field in the index).

When inspecting already-existing indexes, read Fields to determine the fields that make up the index. The string returned can be either the names of the fields, or the numbers of the field. When numbers are used, the numbers correspond to the physical field numbers in the table. Multiple fields in the string are separated by semicolons (;).

Note: When creating dBASE expression indexes, do not use a list of fields separated by semi-colons. Instead, set Fields to a dBASE data manipulation language (DML) expression concatenating multiple fields, converting field data types, or using field substrings. You must include the TIndexOption value ixExpression in the Options parameter of such functions as TIndexDefs.Add or in the Options property of a TIndexDef object. When inspecting existing dBASE expression indexes, use the Expression property instead of the Fields property.


TIndexDef.GroupingLevel

TIndexDef 	See also

Indicates the depth of grouping provided by the index.

property GroupingLevel: Integer;

Description

Grouping level specifies the level of grouping information maintained by the index.


TIndexDef.Options

TIndexDef	See also	Example

Describes the characteristics of the index.

property Options: TIndexOptions;

Description

When creating a new index, use Options to specify the attributes of the index. Options can contain any one, multiple, or none of the TIndexOptions constants ixPrimary, ixUnique, ixDescending, ixCaseInsensitive, and ixExpression. See the topic for the TIndexOptions type for definitions of individual options and the implications of their use.

When inspecting the definitions of existing indexes, read Options to determine the option(s) used to create the index.

Note:	Different database drivers may support only a subset of these options. For example, with dBASE tables, ixCaseInsensitive is not supported. Including an option that is not valid for a table will raise an exception.

Note:	Primary indexes are, by definition unique. If using the Options value ixPrimary, you need not also use ixUnique.


TIndexDef.Source

TIndexDef	See also

Contains the name of a dBASE maintained index.

property Source: String;

Description

When the table uses dBASE .MDX indexes, Name indicates the index tag name and Source is the name of the index file. Source is applicable to dBASE table indexes only.


TIndexDef methods

TIndexDef	Alphabetically

In TIndexDef

Assign

Create

Derived from TCollectionItem

Destroy

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TIndexDef methods

TIndexDef	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TIndexDef.Assign

TIndexDef	See also

Copies the properties of one index definition to another.

procedure Assign(ASource: TPersistent); override;

Description

Call Assign to copy an index definition. Assign checks whether the ASource parameter is another index definition, and, if so, copies the values of the Options, Name, Source, Expression, and Fields properties.

If the source is not an index definition, Assign calls the inherited method, which assigns properties from any object that specifies how to copy to an index definition in its AssignTo method.


TIndexDef.Create

TIndexDef	See also

Creates an instance of TIndexDef.

constructor Create(Owner: TIndexDefs; const Name, Fields: String; Options: TIndexOptions); reintroduce; overload;

Description

Applications should not call Create directly. A TIndexDef is created automatically by the dataset for each existing index of the table. When creating new indexes, the TIndexDefs.Add and TTable.AddIndexmethods both create the needed instance of TIndexDef.


Accessibility

Read-only

Scope

Published


Hierarchy

TObject

TPersistent

TCollectionItem

TNamedItem


TIndexDefs

Hierarchy	Properties	Methods	See also

TIndexDefs holds the list of available index definitions for a table.

Unit

db

Description

Use the properties and methods of TIndexDefs to:

Access a specific index definition.

Determine how many index definitions this TIndexDefs object contains.

Add or delete index definitions.

Copy all index definitions from one TIndexDefs to another.

Datasets that represent physical database tables use TIndexDefs to create the indexes of the database table.


TIndexDefs properties

TIndexDefs	Alphabetically	Legend

In TIndexDefs

Items

Derived from TDefCollection

DataSet

Updated

Derived from TCollection

Count

ItemClass


TIndexDefs properties

TIndexDefs	By object	Legend

Count

DataSet

ItemClass

Items

Updated


TIndexDefs.Items

TIndexDefs	See also 	Example

Lists the index definitions that describe each index of a table.

property Items[Index: Integer]: TIndexDef; default;

Description

Use Items to access a particular index definition. Specify the index definition to access with the Index parameter. Index is an integer identifying the index definition’s position in the list of index definitions, in the range 0 to Count - 1.

IdxFldsVar := Table1.IndexDefs.Items[i].Fields;


TIndexDefs methods

TIndexDefs	Alphabetically

In TIndexDefs

Add

AddIndexDef

Create

Find

FindIndexForFields

GetIndexForFields

Update

Derived from TDefCollection

GetItemNames

IndexOf

Derived from TCollection

Assign

BeginUpdate

Clear

Delete

Destroy

EndUpdate

FindItemID

GetNamePath

Insert

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TIndexDefs methods

TIndexDefs	By object

Add

AddIndexDef

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

Find

FindIndexForFields

FindItemID

Free

FreeInstance

GetIndexForFields

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetItemNames

GetNamePath

IndexOf

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

Update


TIndexDefs.Add

TIndexDefs	See also	Example

Creates a new index definition and adds it to the Items property.

procedure Add(const Name, Fields: String; Options: TIndexOptions);

Description

Add is provided for backward compatibility. The recommended way to add new index definitions before creating a table is to use the AddIndexDef method. To add an index to an existing table, use the AddIndex method of the TTable object instead. To change the array of indexes when a new index has been added to the dataset, use the Update method instead.

Add creates an index definition and assigns the values passed in the Name, Fields, and Options parameters to the TIndexDef properties of the same names. If an index definition with same name already exists, an EDatabaseError exception is raised.

Name is the name of the index created.

Fields is a list of fields separated by semi-colons (no semi-colon is required if the index is based on only one field).

Options describes the attributes of the new index.

Note:	Different database drivers may support only a subset of these options. For example, with dBASE tables, ixCaseInsensitive is not supported. Including an option that is not valid for a table will raise an exception.

Note:	Primary indexes are, by definition unique. If using the Options value ixPrimary, you need not also use ixUnique.

Note:	dBASE multi-field indexes cannot be created using a list of fields separated by semi-colons in the Fields parameter. To create these indexes, use an expression with dBASE data manipulation (DML) functions and operators to concatenate the multiple fields into a single expression.


TIndexDefs.AddIndexDef

TIndexDefs	See also	Example

Creates a new index definition object and adds it to the Items property.

function AddIndexDef: TIndexDef;

Description

Call AddIndexDef to add index definitions when creating a database table. AddIndexDef returns the new TIndexDef object that was added to the IndexDefs collection of index definitions. After calling AddIndexDef, set the properties of the newly added TIndexDef object to specify the name, type, and options of index that will be created.

with Table1.IndexDefs.AddIndexDef do begin

  Name := 'Company;Contact';

  Fields := 'ContactFirst';

  Options := [];

end;

Note:	AddIndexDef is only valid in the context of creating index definitions for a table to be created with a subsequent call to the CreateTable or CreateDataSet method. It cannot be used to add indexes to an already-existing table.


TIndexDefs.Create

TIndexDefs	See also

Creates an instance of TIndexDefs.

constructor Create(ADataSet: TDataSet);

Description

Applications should not call Create directly. TIndexDefs is created automatically by the dataset to specify the indexes for the table (even if the table currently has no indexes). An example of such a default TIndexDefs object is the IndexDefs property of the TDataSet component.


TIndexDefs.Find

TIndexDefs	See also

Locates an index definition in the Items array from the name of the index.

function Find(const Name: String): TIndexDef;

Description

Call Find to obtain information about a particular index definition. Specify the name of the index as the value of the Name parameter.

Find raises an EDatabaseError exception if there is no index definition with the given name.

Note:	To locate an index definition based on the indexed fields rather than the name of the index, use the FindIndexForFields method.


TIndexDefs.FindIndexForFields

TIndexDefs	See also

Locates an index definition in the Items array.

function FindIndexForFields(const Fields: String): TIndexDef;

Description

Use FindIndexForFields to search for the index that starts with the fields specified in the Fields parameter. If the index is constructed using more than one field, separate the fields with semi-colons.

FindIndexForFields returns the index definition that exactly matches the fields specified (in the order specified), if one exists. If no exact match is found, FindIndexForFields returns the first index that begins with the indicated fields. If no match is found, FindIndexForFields raises an EDatabaseError exception.

Note:	 FindIndexForFields can only locate ascending indexes. To include descending indexes in the search, use getIndexForFields.

Note:	To restrict the search to case insensitive indexes, use the GetIndexForFields method.


TIndexDefs.GetIndexForFields

TIndexDefs	See also

Locates an index definition in the Items array.

function GetIndexForFields(const Fields: String; CaseInsensitive: Boolean): TIndexDef;

Description

Use GetIndexForFields to search for the index that starts with the fields specified in the Fields parameter. If more than one field comprises the index, separate the fields with semicolons. Set the CaseInsensitive parameter to True to restrict the search to only the case insensitive indexes in the Items array.

GetIndexForFields returns the index definition that exactly matches the specified fields in the order specified, if it exists. If no exact match is found, GetIndexForFields returns the first index that begins with the indicated fields. If no match can be found, GetIndexForFields returns nil.

Note:	When CaseInsensitive is True, descending indexes are considered even if they are case-sensitive.


TIndexDefs.Update

TIndexDefs	See also 	Example

Refreshes index definitions in Items to reflect the current state of the table.

procedure Update; reintroduce;

Description

Call Update when the set of indexes for the table may have changed. Update refreshes the index definitions without opening the table.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection

TOwnedCollection

TDefCollection


TIniFile

Hierarchy	Properties	Methods	See also

TIniFile is a low-level wrapper for the 16-bit Windows 3.x INI file system that enables storage and retrieval of application-specific information and settings in an application-specific INI file.

Unit

inifiles

Description

TIniFile enables handling the storage and retrieval of application-specific information and settings in a Windows 3.x INI file. The INI file text format is the standard way for Windows 3.x applications to store and retrieve application settings from session to session. An INI file stores information in logical groupings, called “sections.” For example, the WIN.INI file contains a section called “[Desktop]”. Within each section, actual data values are stored in named keys. Keys take the form:

<keyname>=<value>

The FileName passed to a TIniFile object when it is created is the name of the INI file the object accesses.

Note:	Under 32-bit Windows systems, applications typically replace INI files with the system registry where all applications store and retrieve their settings. Delphi provides additional classes for handling the system registry. TRegistry encapsulates the system registry. TRegistryIniFile also encapsulates the registry, but shares a common ancestor with TIniFile so that the same code can access entries stored in either format.


TIniFile properties

TIniFile	Alphabetically	Legend

Derived from TCustomIniFile

FileName


TIniFile properties

TIniFile	By object	Legend

FileName


TIniFile.FileName

TIniFile	See also

Contains the name of the INI file from which to read and to which to write application-specific information.

property FileName: string;

Description

Use FileName to examine the name of the INI file used by the application for its application settings and information. The methods that read and write INI file information automatically handle opening and closing the file specified by FileName.

Note:	Usually INI files are stored in the \WINDOWS directory. To work with an INI file in another location, specify the full path name of the file in the FileName parameter passed to the Create method of TIniFile.


TIniFile methods

TIniFile	Alphabetically

In TIniFile

DeleteKey

EraseSection

ReadSection

ReadSections

ReadSectionValues

ReadString

UpdateFile

WriteString

Derived from TCustomIniFile

Create

ReadBool

ReadDate

ReadDateTime

ReadFloat

ReadInteger

ReadTime

SectionExists

WriteBool

WriteDate

WriteDateTime

WriteFloat

WriteInteger

WriteTime

ValueExists

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TIniFile methods

TIniFile	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

DeleteKey

Destroy

Dispatch

EraseSection

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadBool

ReadDate

ReadDateTime

ReadFloat

ReadInteger

ReadSection

ReadSections

ReadSectionValues

ReadString

ReadTime

SafeCallException

SectionExists

UpdateFile

ValueExists

WriteBool

WriteDate

WriteDateTime

WriteFloat

WriteInteger

WriteString

WriteTime


TIniFile.DeleteKey

TIniFile	See also 	Example

Erases the data value associated with an INI file entry.

procedure DeleteKey(const Section, Ident: string); override;

Description

Call DeleteKey to erase a data value associated with an INI file entry. Section is string containing the name of an INI file section, and Ident is a string containing the name of the key from for which to set a nil value.

Note:	Attempting to erase a data value in a non-existent section or attempting to erase data from a non-existent key are not errors. In these cases, DeleteKey creates the section and key and sets its initial value to an empty value.


TIniFile.EraseSection

TIniFile	See also

Erases an entire section of an INI file.

procedure EraseSection(const Section: string); override;

Description

Call EraseSection to remove a section, all its keys, and their data values from an INI file. Section identifies the INI file section to remove. If a section cannot be removed, an exception is raised.


TIniFile.ReadSection

TIniFile	See also	Example

Reads all the key names from a specified section of an INI file into a string list.

procedure ReadSection (const Section: string; Strings: TStrings); override;

Description

Call ReadSection to retrieve the names of all keys within a specified section of an INI file into a string list object.

Section identifies the section from which to retrieve a list of key names. Strings specifies the string object to hold the retrieved names. Strings can point to a TString object such as a string list, or to a component property, such as Items for a TListBox component, that is a TString object itself.


TIniFile.ReadSections

TIniFile	See also 	Example

Reads the names of all sections in an INI file into a string list.

procedure ReadSections(Strings: TStrings); override;

Description

Call ReadSections to retrieve the names of all sections in an INI file into a string list object.

Strings specifies the string object to hold the retrieved names. Strings can point to a TString object, or to a component property, such as Items for a TListBox component, that is a TString object itself.


TIniFile.ReadSectionValues

TIniFile	See also 	Example

Reads the values from all keys within a section of an INI file into a string list.

procedure ReadSectionValues(const Section: string; Strings: TStrings); override;

Description

Call ReadSectionValues to read the keys, and the values from all keys, within a specified section of an INI file into a string list object. Section identifies the section in the file from which to read key values. Strings is the string list object into which to read the values.

Strings specifies the string object to hold the retrieved names. Strings can point to a TString object, or to a component property, such as Items for a TListBox component, that is a TString object itself.


TIniFile.ReadString

TIniFile	See also 	Example

Retrieves a string value from an INI file.

function ReadString(const Section, Ident, Default: string): string; override;

Description

Call ReadString to read a string value from an INI file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the value. Default is the string value to return if the:

Section does not exist.

Key does not exist.

Data value for the key is not assigned.


TIniFile.UpdateFile

TIniFile	See also

Flushes buffered INI file data to disk.

function UpdateFile; override;

Description

Call UpdateFile to flush buffered reads from and writes to the INI file to disk. UpdateFile is useful under Windows95, but has no effect under Windows NT as NT does not buffer INI file reads and writes.


TIniFile.WriteString

TIniFile	See also 	Example

Writes a string value to an INI file.

procedure WriteString(const Section, Ident, Value: string); override;

Description

Call WriteString to write a string value to an INI file. Section identifies the section in the file that contain the key to which to write. Ident is the name of the key for which to set a value. Value is the string value to write.

Note:	Attempting to write a data value to a non-existent section or attempting to write data to a non-existent key are not errors. In these cases, WriteString creates the section and key and sets its initial value to Value.


Accessibility

Read-only


Hierarchy

TObject

TCustomIniFile


TInplaceEdit

Hierarchy	Properties	Methods	See also

TInPlaceEdit provides text editing capabilities for grid controls.

Unit

grids

Description

TInPlaceEdit is a helper object tailored to work with grid controls. It provides a multiline editing window that appears in the appropriate cell of a grid control. TInPlaceEdit provides services so that the grid can influence the response of the control to user actions, and can move or resize the editing window as cells are moved or resized.

The TInPlaceEdit window has no border, so it does not stand out as a separate control. TInPlaceEdit is not a data-aware control, but can work with a data-aware grid such as TDBGrid, allowing the grid to fetch or post the text, and allowing the grid to impose a mask to limit the text of the edit control to data that is valid.


TInplaceEdit properties

TInplaceEdit	Alphabetically	Legend

In TInplaceEdit

Grid

Derived from TCustomMaskEdit

EditText

IsMasked

Text

Derived from TCustomEdit

CanUndo

Modified

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TInplaceEdit properties

TInplaceEdit	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

CanUndo

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

EditText

Enabled

Floating

FloatingDockSiteClass

Grid

Handle

Height

HelpContext

Hint

HostDockSite

IsMasked

Left

LRDockWidth

Modified

Name

Owner

Parent

ParentWindow

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Text

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TInplaceEdit.Grid

TInplaceEdit	See also

Specifies the grid object that owns and controls this TInplaceEdit.

property Grid: TCustomGrid;

Description

Read Grid to obtain the grid object for which TInplaceEdit provides editing services. TInplaceEdit uses the Grid property so that it can receive information about the text to be edited and so that it can pass on relevant events.


TInplaceEdit methods

TInplaceEdit	Alphabetically	Legend

In TInplaceEdit

BoundsChanged

Create

CreateParams

DblClick

Deselect

DoMouseWheel

EditCanModify

Hide

Invalidate

KeyDown

KeyPress

KeyUp

Move

PosEqual

SetFocus

UpdateContents

UpdateLoc

WndProc

Derived from TCustomMaskEdit

Clear

GetTextLen

ValidateEdit

Derived from TCustomEdit

ClearSelection

ClearUndo

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Undo

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TInplaceEdit methods

TInplaceEdit	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BoundsChanged

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClearSelection

ClearUndo

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

Create

CreateParams

CreateParented

CreateParentedControl

CutToClipboard

DblClick

DefaultHandler

Deselect

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DoMouseWheel

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EditCanModify

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

KeyDown

KeyPress

KeyUp

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

Move

NewInstance

PaintTo

PasteFromClipboard

Perform

PosEqual

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

Undo

Update

UpdateAction

UpdateContents

UpdateControlState

UpdateLoc

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

ValidateEdit

WndProc


TInplaceEdit.BoundsChanged

TInplaceEdit	See also

Indents the text area of the window slightly after the grid repositions the edit control.

procedure BoundsChanged; virtual;

Description

BoundsChanged re-initializes the editing window after the control has been moved or resized. It creates a slight indentation in the text formatting area so that the contents of the editor do not appear to crowd the edges of the cell.

BoundsChanged is exposed as a protected method so that derived objects can add further enhancements when the editing window changes size or location.


TInplaceEdit.Create

TInplaceEdit	See also

Creates an instance of TInplaceEdit.

constructor Create(AOwner: TComponent); override;

Description

Do not create instances of TInplaceEdit. These are created automatically by the grid that uses the editor.

Create overrides the default constructor to make sure that the control has no border to provide a visual indication that the control exists.


TInplaceEdit.TInplaceEdit
TInplaceEdit.CreateParams

TInplaceEdit	See also

Initializes a window-creation parameter record passed in the Params parameter.

procedure CreateParams( var Params: TCreateParams); override;

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle. TInplaceEdit overrides the inherited method to specify a multiline edit control.


TInplaceEdit.DblClick

TInplaceEdit	See also

Informs the grid when the user double-clicks in the edit window.

procedure DblClick; override;

Description

DblClick is called when the user double-clicks in the edit window. DblClick simply passes the event on to the grid. The grid must interpret and respond to the double-click. If the edit window needs to respond to the double-click, the grid must trigger the response by calling a method or setting a property of the TInplaceEdit.


TInplaceEdit.Deselect

TInplaceEdit	See also

Removes the selection from the edit window.

procedure Deselect;

Description

Use Deselect to cause all text in the edit window to be unselected. Deselect simply changes the selection, it does not change the actual text.


TInplaceEdit.DoMouseWheel

TInplaceEdit	See also

Delegates mouse wheel messages to the associated grid.

function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; override;

Description

TInplaceEdit overrides the inherited DoMouseWheel method so that it can pass any mouse wheel messages on to the grid specified by the Grid property. This causes the grid’s OnMouseWheel event handler to execute even though the inplace edit control has focus.


TInplaceEdit.EditCanModify

TInplaceEdit	See also

Determines whether the user can edit the Text.

function EditCanModify: Boolean; override;

Description

EditCanModify is called automatically when the user tries to edit the value of Text. EditCanModify calls the CanEditModify method of the grid to determine whether the current cell of the grid should be edited. When EditCanModify returns True, the user is permitted to edit the text. When EditCanModify returns False, the user is prevented from editing the text.


TInplaceEdit.Hide

TInplaceEdit	See also

Hides the edit control window and moves input focus to the grid.

procedure Hide;

Description

Hide makes the edit control window invisible without destroying it. Hide also moves the input focus from the editor window to the grid, so that the invisible window does not swallow keyboard events.

The grid calls Hide to hide the edit window when changing out of edit mode. It also calls Hide when scrolling the cell that is being edited out of the grid window.


TInplaceEdit.Invalidate

TInplaceEdit	See also

Invalidates the edit window and the corresponding portion of the grid window.

procedure Invalidate; reintroduce;

Description

Invalidate ensures that the portion of the grid window under the edit control is invalidated at the same time as the edit window. This is important when the edit window is hidden or destroyed so that the grid window can repaint the cell that was covered by the edit window.


TInplaceEdit.KeyDown

TInplaceEdit	See also

Responds when the user presses a key.

procedure KeyDown(var Key: Word; Shift: TShiftState); override;

Description

When the user presses a key, KeyDown checks whether the edit control or grid should process the KeyDown event. The Enter key is always passed on to the grid. The F2 key calls Deselect to remove the current selection. Navigation keystrokes are passed on to the grid when the movement cannot be accommodated within the text window. For example, if the user types Left when the cursor is already at the left edge of the edit window, the keystroke is passed to the grid which moves focus to the previous cell. If the cursor is in the middle of a line, the keystroke is processed by the edit window, which moves left a single character.

KeyDown calls the OnKeyDown event handler for the grid, if there is one, before calling the inherited KeyDown for the edit control.


TInplaceEdit.KeyPress

TInplaceEdit	See also

Responds when the user types a key.

procedure KeyPress(var Key: Char); override;

Description

KeyPress allows the grid to handle the keystroke, and only processes keystrokes that the grid does not fully handle. If the grid is not in edit mode after handling the keystroke, KeyPress throws away the keystroke. Keystroke processes the Return Key and calls the inherited method to handle all other unprocessed keystrokes.

Pressing the Return key causes KeyPress to select all the text, unless it is already selected, in which case it causes KeyPress to deselect all the text.


TInplaceEdit.KeyUp

TInplaceEdit	See also

Responds when the user releases a key.

procedure KeyUp(var Key: Word; Shift: TShiftState); override;

Description

The inplace edit control does not process the KeyUp event at all. It simply passes this event on to the grid, which may or may not process the event.


TInplaceEdit.Move

TInplaceEdit	See also

Changes the position of the edit window and repaints the contents.

procedure Move(const Loc: TRect);

Description

The grid calls Move to move the edit window to the indicated rectangle when the corresponding cell moves or resizes. The position of Loc is relative to the grid’s client area.


TInplaceEdit.PosEqual

TInplaceEdit	See also

Indicates whether the edit window has the size and position indicated by Rect.

function PosEqual(const Rect: TRect): Boolean;

Description

Use PosEqual to determine if the edit window occupies a particular rectangle, where Rect is given in global coordinates. PosEqual can be used to determine whether the inplace edit control represents a particular cell in the grid, by checking the bounding rectangle of the cell.


TInplaceEdit.SetFocus

TInplaceEdit	See also

Gives the editor window input focus if it is visible.

procedure SetFocus; reintroduce;

Description

Use SetFocus to cause keyboard events to go to the editor window. Focus will not move to the window if it is hidden by a call to the Hide method.


TInplaceEdit.UpdateContents

TInplaceEdit	See also

Sets the EditMask and Text properties to values specified by the grid.

procedure UpdateContents; virtual;

Description

UpdateContents calls the GetEditMask and GetEditText methods of the grid, and sets the EditMask and Text properties accordingly. UpdateContents allows the grid to bring up the inplace edit control with the contents of a particular cell, and to impose a mask to restrict the editor to valid input for the particular cell.


TInplaceEdit.UpdateLoc

TInplaceEdit	See also

Changes the position of the edit window but does not repaint the contents.

procedure UpdateLoc(const Loc: TRect);

Description

The grid calls UpdateLoc to move the edit window when the grid is moved. Unlike the Move method, UpdateLoc does not invalidate the edit window to cause a repaint.


TInplaceEdit.WndProc

TInplaceEdit	See also

Supplements the inherited method to add special processing to some Windows messages.

procedure WndProc(var Message: TMessage); override;

Description

WndProc is the first method that receives messages for a Delphi control.

WndProc for TInplaceEdit passes focus events on to the grid. It calls the inherited method for all other Windows messages. WndProc converts mouse clicks to double clicks when the grid receives the first click within the double-click time period.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMaskEdit


TInterfaceList

Hierarchy	Properties	Methods

TInterfaceList represents a list of interfaces.

Unit

Classes

Description

Use TInterfaceList to manage a list of interfaces.


TInterfaceList properties

TInterfaceList	Alphabetically	Legend

In TInterfaceList

Capacity

Count

Items

Derived from TInterfacedObject

RefCount


TInterfaceList properties

TInterfaceList	By object	Legend

Capacity

Count

Items

RefCount


TInterfaceList.Capacity

TInterfaceList	See also

Specifies the list capacity.

property Capacity: Integer;

Description

Use Capacity to determine the list capacity. Before adding many interfaces to the list, you can improve performance by setting Capacity to the final number of interfaces. This prevents the interface list from having to reallocate the list every time an interface is added.


TInterfaceList.Count

TInterfaceList	See also

Specifies the number of interfaces in the list.

property Count: Integer;

Description

Use Count to determine the number of interfaces in the list.


TInterfaceList.Items

TInterfaceList	See also

Provides direct access to an interface in the list.

property Items[Index: Integer]: IUnknown;

Description

Use Items to directly access an interface in the list. Index identifies each interface by its position in the list.


TInterfaceList methods

TInterfaceList	Alphabetically

In TInterfaceList

Add

Clear

Create

Delete

Destroy

Exchange

Expand

First

IndexOf

Insert

Last

Lock

Remove

Unlock

Derived from TInterfacedObject

AfterConstruction

BeforeDestruction

NewInstance

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

SafeCallException


TInterfaceList methods

TInterfaceList	By object

Add

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

Exchange

Expand

FieldAddress

First

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

IndexOf

InheritsFrom

InitInstance

Insert

InstanceSize

Last

Lock

MethodAddress

MethodName

NewInstance

Remove

SafeCallException

Unlock


TInterfaceList.Add

TInterfaceList	See also

Adds an interface to the list.

function Add(Item: IUnknown): Integer;

Description

Call Add to add an interface to the list.


TInterfaceList.Clear

TInterfaceList	See also

Clears the interface list.

procedure Clear;

Description

Call Clear to remove all interfaces from the list.


TInterfaceList.Create

TInterfaceList

Creates an interface list.

constructor Create;

Description

Call Create to create an interface list.


TInterfaceList.Delete

TInterfaceList	See also

Deletes an interface from the list.

procedure Delete(Index: Integer);

Description

Call Delete to delete an interface from the list.


TInterfaceList.Destroy

TInterfaceList	See also

Destroys the interface list.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call the Free method.


TInterfaceList.Exchange

TInterfaceList	See also

Swaps the position of two interfaces in the list.

procedure Exchange(Index1, Index2: Integer);

Description

Call Exchange to move the interface at position Index1 so that it appears at position Index2 and move the interface at position Index2 so that it appears at position Index1. Index1 and Index2 indentify two positions (zero offset) in the Items property array.


TInterfaceList.Expand

TInterfaceList	See also

Increases the capacity of the interface list.

function Expand: TInterfaceList;

Description

If Capacity is greater than 64, then Capacity is increased by Capacity / 4. If Capacity is between eight and 64, Capacity is increased by 16. If Capacity is less than eight, Capacity is increased by four.


TInterfaceList.First

TInterfaceList	See also

Returns the first interface in the list.

function First: IUnknown;

Description

Call First to obtain the first interface in the list.


TInterfaceList.IndexOf

TInterfaceList	See also

Returns the index of an interface.

function IndexOf(Item: IUnknown): Integer;

Description

Call IndexOf to obtain the index of an interface.


TInterfaceList.Insert

TInterfaceList	See also

Inserts an interface into the list at a specified position.

procedure Insert(Index: Integer; Item: IUnknown);

Description

Call Insert to insert an interface into the list. Item is the interface to insert, and Index indicates the position (zero-offset) where the interface should be added.


TInterfaceList.Last

TInterfaceList	See also

Returns the last interface in the list.

function Last: IUnknown;

Description

Call Last to obtain the last interface in the list.


TInterfaceList.Lock

TInterfaceList	See also

Locks the list, preventing changes.

procedure Lock;

Description

Call Lock to lock the list, preventing changes.


TInterfaceList.Remove

TInterfaceList	See also

Removes an interface from the list.

function Remove(Item: IUnknown): Integer;

Description

Call Remove to remove an interface from the list.

Remove returns the index of the removed interface, or –1 if the interface was not found.


TInterfaceList.Unlock

TInterfaceList	See also

Unlocks the list, allowing changes.

procedure Unlock;

Description

Call Unlock to unlock the list, allowing changes.


Accessibility

Read-only


Hierarchy

TObject

TInterfacedObject


TIntegerField

Hierarchy	Properties	Methods	Events	See also

TIntegerField represents a signed 32-bit integer field in a dataset.

Unit

db

Description

TIntegerField is a persistent field object that encapsulates the fundamental behavior common to integer data. In addition to the properties, methods, and events common to all fields that are introduced by the TField class, TIntegerField introduces new properties to convert between integer values and other data types, and to limit the range of valid integers that the field will permit. As a descendant of TNumericField, TIntegerField includes many properties, methods, and events that are useful for managing the value and properties of an integer field in a database.

As with all persistent field objects, a TIntegerField can be created at design-time using the Fields Editor or at runtime by calling the constructor for the class. Persistent field objects exist solely in the memory space of a Delphi application. Creating a persistent field object only creates an object in the application, and does not result in the creation of a field in a table.

Fields in a table can be accessed without use of persistent field objects. Virtual field objects are created to provide access to a field when the field is referenced through such means as the TDataSet.::Fields property or the TDataSet.FieldByName method. However, as both the Fields property and the FieldByName method return a value of type TField, the return value must be typecast as a TIntegerField before using any property specific to TIntegerField.

TIntegerField is the direct ancestor of three other field types that represent whole numbers: TAutoIncField, TSmallintField, and TWordField.

Integer fields can hold values in the range -2,147,483,648 to 2,147,483,647, and are frequently used to hold values that are large, signed whole numbers.


TIntegerField properties

TIntegerField	Alphabetically	Legend

In TIntegerField

AsFloat

AsInteger

AsString

AsVariant

DataSize

MaxValue

MinValue

Value

Derived from TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TIntegerField properties

TIntegerField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

MaxValue

MinValue

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

ValidChars

Value

VCLComObject

Visible


TIntegerField.AsFloat

TIntegerField	See also

Represents the value of the integer field as a floating-point value.

property AsFloat: Double;

Description

Use AsFloat to

Assign the integer field value to a floating-point variable.

Round a floating-point value to an integer value and assign it to an integer field.

For example, this code assigns a floating-point value to an integer field value, rounding the value to 12:

MyIntegerField.AsFloat := 12.23;

To assign an integer field value to a floating-point value, use code similar to this:

FloatVariable := MyIntegerField.AsFloat;

If the value assigned to the field does not fall within the range specified by the MinValue and MaxValue properties, an EDatabaseError exception is raised.


TIntegerField.AsInteger

TIntegerField	See also	Example

Represents the value of an integer field as a 32-bit integer.

property AsInteger: Longint;

Description

Use AsInteger to work with the value of an integer field as a 32-bit integer. Integer field components store and manipulate their values as 32-bit integers, so AsInteger is the same as the Value property.

Long integer values need no conversion, because the native storage format of an integer field is a 32-bit integer. Descendants of TIntegerField that represent other types of integer fields convert the value of the physical database field to a 32-bit integer for the AsInteger property.

If the value assigned to the field does not fall within the range specified by the MinValue and MaxValue properties, an EDatabaseError exception is raised.


TIntegerField.AsString

TIntegerField	See also	Example

Represents the value of an integer field as a string.

property AsString: String;

Description

Use AsString to

Assign the integer field value to string variable.

Assign a string value to the integer field.

For example, this code assigns a string value to an integer field value:

MyIntegerField.AsString := '27';

To assign an integer field value to a string, use code similar to this:

NewString := MyIntegerField.AsString;

If the string assigned to the field does not represent a valid integer value, an EDatabaseError exception is raised. Also, if the assigned string does not convert to an integer value that falls within the range specified by the MinValue and MaxValue properties, an EDatabaseError exception is raised.


TIntegerField.AsVariant

TIntegerField	See also

Represents the value of an integer field as a Variant value.

property AsVariant: Variant;

Description

Use AsVariant to

Assign the integer field value to variant variable.

Assign a variant value to the integer field.

Using variants is useful when you don't know the actual field type and don't want to use one of the other As... properties to convert the field value to another type.

If the value assigned to the field can’t be converted to a valid integer or does not fall within the range specified by the MinValue and MaxValue properties, an EDatabaseError exception is raised.


TIntegerField.DataSize

TIntegerField	See also	Example

Indicates the amount of memory needed to store the value of an integer field in its native database format.

property DataSize: Word;

Description

Check DataSize to determine the number of bytes required to store an integer field component’s value. Use DataSize to determine the size needed for a buffer when working with the GetData and SetData methods.

For integer fields, DataSize is always 4. Some descendants of TIntegerField such as TSmallintField, represent database fields with smaller values of DataSize.


TIntegerField.MaxValue

TIntegerField	See also

Limits the maximum value in the integer field.

property MaxValue: Longint;

Description

Use MaxValue to get or set the maximum value that can be entered into the field. If a value greater than MaxValue is entered, an EDatabaseError exception is raised.

If the value of MaxValue is 0, the integer field can have a value up to the maximum value that can be represented by the native database type. For 32-bit integer fields, this value is 2147483647.


TIntegerField.MinValue

TIntegerField	See also

Limits the minimum value in the integer field.

property MinValue: Longint;

Description

Use MinValue to get or set the minimum value that can be entered into the field. If a value smaller than MinValue is entered, an EDatabaseError exception is raised.

If the value of MinValue is 0, the integer field can have a value as small as the native database type can represent. For 32-bit integer fields, this minimum value is -2147483648.


TIntegerField.Value

TIntegerField	See also

Represents the value of the integer field.

property Value: Longint;

Description

Use Value to read data directly from and write data directly to an integer field. Using the Value property is the same as using the AsInteger property. Use Value when you know the field component is a 32-bit integer field. Use AsInteger when working with a generic field component.


TIntegerField events

TIntegerField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TIntegerField events

TIntegerField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TIntegerField methods

TIntegerField	Alphabetically

In TIntegerField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

GetParentComponent

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TIntegerField methods

TIntegerField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TIntegerField.Create

TIntegerField	See also

Creates an instance of TIntegerField.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TIntegerField. After calling the inherited constructor, Create sets the DataType property to ftInteger, MinValue to -2147483648, and MaxValue to 2147483647.

After instantiating a TIntegerField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TIntegerField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TIntegerField with a dataset component by setting its DataSet property to the name of the dataset component.

The example below creates a TIntegerField object for a field named Quantity accessed through a TQuery named Query1.

var

  T: TIntegerField;

begin

  Query1.Close;

  T := TIntegerField.Create(Self);

  T.FieldName := 'Quantity';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TNumericField


TInterfacedObject

Hierarchy	Properties	Methods

TInterfacedObject implements the IUnknown interface, and can be used as a base for simple COM-compatible classes that benefit from having the IUnknown methods implemented.

Unit

system

Description

TInterfacedObject is a base class for classes that support interfaces. Unlike COM classes, TInterfacedObject does not have a class factory or a registered CLSID. This means that it must be instantiated by calling a constructor directly.

TInterfacedObject serves as a convenient base class for classes that implement interfaces because it implements the methods of IUnknown. Variables declared to be of type TInterfacedObject have dynamic-binding, meaning that an instance of a descendant class can be assigned to that variable at runtime. This is because TInterfacedObject implements QueryInterface, which is called at runtime to query whether the instantiated object supports the requested interface. If it does, then the descendant object is successfully assigned to the variable. The same assignment of a descendant COM object, to a variable declared as a base class type, will generate a compile-time error if that base class does not implement IUnknown.

There is no class factory for TInterfacedObject.

Implemented methods of IUnknown

QueryInterface, AddRef, and Release.


TInterfacedObject properties

TInterfacedObject	Alphabetically	Legend

In TInterfacedObject

RefCount


TInterfacedObject properties

TInterfacedObject	By object	Legend

RefCount


TInterfacedObject.RefCount

TInterfacedObject

Indicates the number of interface pointers currently dependent upon the COM object.

property RefCount: Integer;

Description

RefCount defines the lifetime of the object. When RefCount is zero, the object is destroyed.

RefCount is incremented by calls to the IUnknown method AddRef and decremented by the  IUnknown method Release.


TInterfacedObject methods

TInterfacedObject	Alphabetically 	Legend

In TInterfacedObject

_AddRef

AfterConstruction

BeforeDestruction

NewInstance

QueryInterface

_Release

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

SafeCallException


TInterfacedObject methods

TInterfacedObject	By object 	Legend

_AddRef

_Release

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

QueryInterface

SafeCallException


TInterfacedObject._AddRef

TInterfacedObject 	See also

Implements the IUnknown AddRef method.

function _AddRef: Integer; stdcall;

Description

Do not call the protected _AddRef method directly. _AddRef is called through the IUnknown interface to indicate that another object is using the interfaced object’s interface pointer. When the other object is through with the interface, it calls _Release through the IUnknown interface. This allows the interfaced object to free itself when it is no longer used (when the reference count goes to zero).

_AddRef increments the RefCount property.


TInterfacedObject.AfterConstruction

TInterfacedObject	See also

Responds after the last constructor executes.

procedure AfterConstruction; override;

Description

AfterConstruction is called automatically after the object’s last constructor has executed. Do not call it explicitly in your applications.

When an instance of TInterfacedObject is allocated, RefCount is incremented to prevent its destruction while processing the constructor. AfterConstruction decrements that RefCount to re-establish the correct reference count after all constructors have executed.


TInterfacedObject.BeforeDestruction

TInterfacedObject 	See also

Checks that the reference count is zero before allowing the interfaced object to be destroyed.

procedure BeforeDestruction; override;

Description

BeforeDestruction is called automatically immediately before the interfaced object’s destructor. It checks that the reference count is zero, and if not, raises an exception.


TInterfacedObject.NewInstance

TInterfacedObject	See also

Allocates memory for each instance of an interfaced object.

class function NewInstance: TObject; override;

Description

All constructors call NewInstance automatically. NewInstance calls InstanceSize to determine how much memory to allocate from the heap to contain a particular instance. Do not call NewInstance directly.

TInterfacedObject overrides NewInstance to increment the reference count when a new instance is created. This prevents any constructor from accidentally deleting the instance due to a RefCount of zero. The AfterConstruction method decrements the value of RefCount after all constructors have executed.


TInterfacedObject.QueryInterface

TInterfacedObject 	See also

Implements the IUnknown QueryInterface method.

function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;

Description

Do not call the protected QueryInterface method directly. QueryInterface is called through the IUnknown interface to obtain an interface pointer for the interface identified by the IID parameter. If the object supports the requested interface, it is returned in the Obj parameter and QueryInterface returns S_OK. If the object does not support the interface, QueryInterface returns E_NOINTERFACE.

After successfully obtaining an interface by calling QueryInterface, clients should increase the reference count by calling the IUnknown AddRef method.


TInterfacedObject._Release

TInterfacedObject 	See also

Implements the IUnknown Release method.

function _Release: Integer; stdcall;

Description

Do not call the protected _Release method directly. _Release is called through the IUnknown interface to indicate that another object is through with the interfaced object’s interface pointer. This allows the interfaced object to free itself when it is no longer used (when the reference count goes to zero).

_Release decrements the RefCount property.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject


IPersistent

Hierarchy	Properties	Methods	See also

IPersistent is the interface used by the IDE when working with persistent objects

Unit

Dsgnintf

Description

The IDE uses IPersistent to obtain information about and manipulate persistent objects in the form designer or object inspector.


IPersistent properties

IPersistent	Alphabetically	Legend

In IPersistent

ClassName

EventInfos

NamePath

Owner


IPersistent properties

IPersistent	By object	Legend

ClassName

EventInfos

NamePath

Owner


IPersistent.ClassName

IPersistent	See also

Indicates the type of the object instance.

property Classname: string;

Description

Use ClassName to find the name (such as “TButton“) of an object’s type.


IPersistent.EventInfos

IPersistent

Used internally.

property EventInfos: IEventInfos;

Description

EventInfos is used internally by the form designer to locate and manage event handlers for the object. The IEventInfo interface supports methods to get the number of event handlers, their names, and their values (the code), as well as a method to delete an event handler.


IPersistent.NamePath

IPersistent	See also

Specifies the name of the object as it appears in the Object Inspector.

property NamePath: string;

Description

The Object Inspector reads NamePath to determine what name to display for the object being edited.


IPersistent.Owner

IPersistent	See also

Indicates the object to which the persistent object belongs.

property Owner: IPersistent;

Description

The object inspector uses the Owner property to determine the relationship between items. For example, collection items specify the collection that manages them as their owner. Components specify the value of their owner property.

Note:	The IPersistent Owner property is not synonymous with a component’s Owner property. It has no implications about the freeing of objects but merely serves to represent relationships to the Object Inspector.


IPersistent methods

IPersistent	Alphabetically

In IPersistent

DestroyObject

Equals

GetClassname

GetEventInfos

GetNamePath

GetOwner

InheritsFrom

IsComponent

IsControl

IsWinControl

Derived from IUnknown

_AddRef

_Release

QueryInterface


IPersistent methods

IPersistent	By object

_AddRef

_Release

DestroyObject

Equals

GetClassname

GetEventInfos

GetNamePath

GetOwner

InheritsFrom

IsComponent

IsControl

IsWinControl

QueryInterface


IPersistent.DestroyObject

IPersistent

Destroys the object instance.

procedure DestroyObject;

Description

The form designer calls DestroyObject to free design-time instances of objects when they are deleted in the designer.


IPersistent.Equals

IPersistent

Indicates whether the persistent object is identical to another persistent object.

function Equals(const Other: IPersistent): Boolean;

Description

Equals compares the persistent object with the object specified by the Other parameter. It returns True if they are identical, False otherwise.


IPersistent.GetClassname

IPersistent	See also

Returns the value of the Classname property.

function GetClassname: string;

Description

GetComponents is the property access method for the Classname property.


IPersistent.GetEventInfos

IPersistent	See also

Returns the value of the EventInfos property.

function GetEventInfos: IEventInfos;

Description

GetEventInfos is the property access method for the EventInfos property.


IPersistent.GetNamePath

IPersistent	See also

Returns the value of the NamePath property.

function GetNamePath: string;

Description

GetNamePath is the property access method for the NamePath property.


IPersistent.GetOwner

IPersistent	See also

Returns the value of the Owner property.

function GetOwner: IPersistent;

Description

GetOwner is the property access method of the Owner property.


IPersistent.InheritsFrom

IPersistent	See also

Indicates whether the persistent object is a descendant of a specified class.

function InheritsFrom(const Classname: string): Boolean;

Description

Use InheritsFrom to determine if the object is an instance of a class or one of its descendants. InheritsFrom returns True if the object type specified in the Classname parameter is an ancestor of the object type or the type of the object itself. Otherwise, it returns False.


IPersistent.IsComponent

IPersistent	See also

Indicates whether the object is a descendant of TComponent.

function IsComponent: Boolean;

Description

IsComponent returns true if the object is a descendant of TComponent, False otherwise. This method is used by the streaming system to determine which objects can be created.


IPersistent.IsControl

IPersistent	See also

Indicates whether the object is a descendant of TControl.

function IsControl: Boolean;

Description

IsControl returns true if the object is a descendant of TControl, False otherwise.


IPersistent.IsWinControl

IPersistent	See also

Indicates whether the object is a descendant of TWinControl.

function IsWinControl: Boolean;

Description

IsWinControl returns true if the object is a descendant of TWinControl, False otherwise.


Accessibility

Read-only


Hierarchy

IUnknown


TJPEGData

Hierarchy	Methods	See also

TJPEGData encapsulates the compressed file that contains the data source for the original compressed JPEG image used by a TJPEGImage object.

Unit

jpeg

Description

TJPEGData is used for the internal implementation of TJPEGImage. TJPEGData is created automatically by the TJPEGImage object when that image object is created.

TJPEGData owns the file handle to the JPEG data source. Thus, TJPEGData implements how TJPEGImage does reference counting and handle sharing. When a JPEG image object is copied using the Assign method, those multiple instances of the image object refer to the same TJPEGData object.

The TJPEGData file itself is never modified. Each TJEPGImage instance that shares it has its own properties that determine how this data is decompressed into its own internal, local bitmap representation. However, if a TJEPGImage needs to modify the actual JPEG data, it breaks its link to that particular TJEPGData instance and creates a new one.


TJPEGData methods

TJPEGData	Alphabetically

In TJPEGData

Destroy

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TJPEGData methods

TJPEGData	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TJPEGData.Destroy

TJPEGData	See also

Destroys of an instance of a JPEG data object.

destructor Destroy; override;

Description

The JPEG data object is automatically destroyed by the JPEG image object that uses it. It is not necessary to call Destroy or to directly access the JPEG data object.

The Destroy method of a JPEG data object handles the freeing of the data.


Hierarchy

TObject

TSharedImage


TJPEGImage

Hierarchy	Properties	Methods	Events	See also 	Example

TJPEGImage encapsulates a JPEG graphic.

Unit

jpeg

Description

Use TJPEGImage to read and write JPEG compressed image data. TJPEGImage handles the digital compression and decompression of still images for use in computer systems. It uses the data from an instance of TJPEGData, which contains the actual JPEG data source and is never modified. Each JPEG image object may share its TJPEGData object with other instances of a JPEG image by creating copies using the Assign method. The JPEG data source handles reference counting for the JPEG image objects that are linked to it.

TJPEGImage has an internal bitmap that represents the JPEG image. This internal image and the original source of the JPEG image are read only. TJPEGImage has properties that determine how each instance will handle color conversion, compression, decompression, performance, and so on.

The following are characteristics of this object. A TJPEGImage object:

Has no canvas (so it cannot draw onto a canvas). However, TJPEGImage implements the protected Draw method introduced in TGraphic, so it can draw itself on the canvas of another object.

Provides no access to the internal bitmap image that it creates for the JPEG image.

Performs reference counting and handle sharing by means of the TJPEGData object. Multiple instances can refer to the same TJPEGData image. TJPEGData is the actual owner of the file handle to the JPEG data source.


TJPEGImage properties

TJPEGImage	Alphabetically	Legend

In TJPEGImage

CompressionQuality

Empty

Grayscale

Height

Palette

Performance

PixelFormat

ProgressiveDisplay

ProgressiveEncoding

Scale

Smoothing

Width

Derived from TGraphic

Modified

PaletteModified

Transparent


TJPEGImage properties

TJPEGImage	By object	Legend

CompressionQuality

Empty

Grayscale

Height

Modified

Palette

PaletteModified

Performance

PixelFormat

ProgressiveDisplay

ProgressiveEncoding

Scale

Smoothing

Transparent

Width


TJPEGImage.CompressionQuality

TJPEGImage

Indicates the trade-off ratio between the image quality and the file size.

type TJPEGQualityRange = 1..100;

property CompressionQuality: TJPEGQualityRange;

Description

Use CompressionQuality to set the compression quality of the JPEG image when writing out a JPEG image. Higher compression results in a poorer picture quality, but a smaller file size. This property is not used for reading in files.

TJPEGQualityRange is the type of the CompressionQuality property. The higher the TJPEGQualityRange value (up to a maximum of 100), the better the image quality, but the larger the file size. The lower the TJPEGQualityRange value (to a minimum of 1), the smaller the resulting file size, but at the expense of picture quality.


TJPEGImage.Empty

TJPEGImage

Specifies whether the JPEG image object contains a graphic.

property Empty: Boolean;

Description

Use Empty to determine if a image has been loaded into the JPEG image object. Empty is True if the JPEG image contains an image, and False if it does not.


TJPEGImage.Grayscale

TJPEGImage

Determines whether the image output of a JPEG image is black and white, or color.

property Grayscale: Boolean;

Description

Use GrayScale for reading in and writing out, that is, for decompressing and compressing, a JPEG image. This property affects how the image is displayed.

GrayScale is used for speed in output optimization. When GrayScale is set to True, the color is separated from luminosity. Color takes the most time to decompress, so for previewing the image, GrayScale can be set to True for speed. The output then contains 255 shades of gray.


TJPEGImage.Height

TJPEGImage

Indicates the vertical size (in pixels) of the JPEG image.

property Height: Integer;

Description

Use Height to find the vertical size in pixels of the JPEG image.


TJPEGImage.Palette

TJPEGImage	See also

Specifies the color palette of the JPEG image.

property Palette: HPALETTE;

Description

Use Palette to get or set the color palette of a JPEG image. If the JPEG image does not need or does not use a palette, the Palette property is zero. Changing the Palette property sets PaletteModified to True only if an image has been loaded into the TJPEGImage object.


TJPEGImage.Performance

TJPEGImage

Controls the trade-off between color quality and speed of decompression.

type TJPEGPerformance = (jpBestQuality, jpBestSpeed);

property Performance: TJPEGPerformance;

Description

Use Performance to set the performance of the JPEG image when reading, that is, for decompressing files. This property is not used for writing out files.

Performance affects the display of the internal bitmap image. This image is a 256 color bitmap. Setting Performance to jpBestSpeed may cause some dithering in the bitmap image.


TJPEGImage.PixelFormat

TJPEGImage

Determines whether the JPEG image is displayed in 24 or 8-bit format.

type TJPEGPixelFormat = (jf24Bit, jf8Bit);

property PixelFormat: TJPEGPixelFormat;

Description

Use PixelFormat to set the pixel format of the JPEG image to 8-bit for video drivers that cannot display 24-bit. the native format of a JPEG image is 24-bit. PixelFormat is used for decompression, that is, for reading in files. PixelFormat will also apply to a bitmap if the image is copied to it.


TJPEGImage.ProgressiveDisplay

TJPEGImage	See also

Controls how the image is displayed when decompressing files.

property ProgressiveDisplay: Boolean;

Description

Use ProgressiveDisplay to turn on or off the incremental display of an image when reading in files. For example, if the JPEG data source file is on the hard drive, progressively displaying it slows down the display time: in this case setting ProgressiveDisplay to False speeds up the displaying of the image. If the file must be downloaded, set ProgressiveDisplay to True if the downloading process will take as long as the progressive displaying of the image.

ProgressiveDisplay is used only for decompression, but is affected by the manner in which the image was compressed. Images that were compressed with ProgressiveEncoding set to False cannot take advantage of ProgressiveDisplay. Setting ProgressiveDisplay to True for these images has no effect.


TJPEGImage.ProgressiveEncoding

TJPEGImage	See also

Determines whether an image can be progressively displayed when it is decompressed.

property ProgressiveEncoding: Boolean;

Description

Use ProgressiveEncoding to compress an image when writing out files, so that it can be progressively displayed when it is decompressed. Setting the ProgressiveDisplay property to True has no effect if ProgressiveEncoding was not set to True when the image was compressed.


TJPEGImage.Scale

TJPEGImage

Determines the size of the JPEG image when it is displayed.

type TJPEGScale = (jsFullSize, jsHalf, jsQuarter, jsEighth);

property Scale: TJPEGScale;

Description

Use Scale to optimize performance for previewing an image. jsFullSize displays the image as maximum size, whereas jsEight displays an eighth of the image size, but 8 times faster.

TJPEGScale is the type of the Scale property. The following table lists the values of TJPEGScale:

Value	Meaning

jsFullSize	Displays a full-size image.

jsHalf	Displays a half-size image in half the time it takes to display a full-size image.

jsQuarter	Displays a quarter-size image in a quarter of the time it takes to display a full-size image.

jsEighth	Displays an eighth-size image in an eighth of the time it takes to display a full-size image.

Scale it used for reading in files, that is, for decompression.


TJPEGImage.Smoothing

TJPEGImage	See also

Determines whether the JPEG image displays in blocks or with blurred edges.

property Smoothing: Boolean;

Description

Smoothing is used if ProgressiveDisplay is True, to determine whether the JPEG image is displayed in small blocks or with blurred edges. If Smoothing is True, the edges are blurred during progressive displaying of the image. If Smoothing is False, raw blocks of color are used to display the image.


TJPEGImage.Width

TJPEGImage

Specifies the horizontal size in pixels of the JPEG image.

property Width: Integer;

Description

Use Width to find the vertical size in pixels of the JPEG image.


TJPEGImage events

TJPEGImage	Alphabetically

Derived from TGraphic

OnChange

OnProgress


TJPEGImage events

TJPEGImage	By object

OnChange

OnProgress


TJPEGImage methods

TJPEGImage	Alphabetically

In TJPEGImage

Assign

Compress

Create

Destroy

DIBNeeded

JPEGNeeded

LoadFromClipboardFormat

LoadFromStream

SaveToClipboardFormat

SaveToStream

Derived from TGraphic

LoadFromFile

SaveToFile

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TJPEGImage methods

TJPEGImage	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Compress

Create

DefaultHandler

Destroy

DIBNeeded

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

JPEGNeeded

LoadFromClipboardFormat

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

SafeCallException

SaveToClipboardFormat

SaveToFile

SaveToStream


TJPEGImage.Assign

TJPEGImage	See also	Example

Copies the JPEG image object and creates a new reference to the internal data source object.

procedure Assign(Source: TPersistent); override;

Description

Assign copies the JPEG image contained in Source to the JPEG image object. Assign then calls the inherited Assign. Assign creates a new link to the internal JPEG data source by which the JPEG image objects do reference counting and handle sharing.

Tip:	To draw on a JPEG image, Assign the JPEG image to a bitmap, and then draw on that.

Note:	An object of one type can always be assigned to another object of the same type. Also, the Source can be of type TPicture if the Graphic property of the picture is a JPEG image or a bitmap.


TJPEGImage.Create

TJPEGImage	See also	Example

Instantiates a JPEG image object.

type

  TJPEGDefaults = record

    CompressionQuality: TJPEGQualityRange;

    Grayscale: Boolean;

    Performance: TJPEGPerformance;

    PixelFormat: TJPEGPixelFormat;

    ProgressiveDisplay: Boolean;

    ProgressiveEncoding: Boolean;

    Scale: TJPEGScale;

    Smoothing: Boolean;

  end;

constructor Create; override;

Description

Call Create to instantiate a JPEG image object at runtime.

Create allocates memory for a JPEG image object, and then uses a TJPEGDefaults type record to initialize values for the following properties:

CompressionQuality

Grayscale

Performance

PixelFormat

ProgressiveDisplay

ProgressiveEncoding

Scale

Smoothing

After the JPEG is loaded from a file, an internal bitmap is created of the image.


TJPEGImage.Compress

TJPEGImage	See also

Forces the action of compression.

procedure Compress;

Description

Call Compress to compress for optimization, such as before streaming out when assigning a bitmap to a JPEG. Changing properties like CompressionQuality does not force a compression. To force a compression, call Compress.


TJPEGImage.DIBNeeded

TJPEGImage	See also

Decompress the JPEG image into a bitmap.

procedure DIBNeeded;

Description

DIBNeeded is used when the JPEG image needs a bitmap representation of its image. Call DIBNeeded just before drawing rather than while drawing for optimization.


TJPEGImage.Destroy

TJPEGImage	See also

Destroys of an instance of a JPEG image object.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TJPEGImage reference is not nil before it calls Destroy.

Destroy handles the freeing of the internal bitmap image and decrements the reference count on the JPEG data source to which it was linked.


TJPEGImage.JPEGNeeded

TJPEGImage	See also

Creates a new TJPEGData object if the JPEG image only has a bitmap and a JPEG is needed.

procedure JPEGNeeded;

Description

Call JPEGNeeded to create a new JPEG data source when the JPEG image has thrown away the JPEG data and only has an internal bitmap. JPEGNeeded creates a new JPEG data source. The SaveToStream method uses JPEGNeeded.


TJPEGImage.LoadFromClipboardFormat

TJPEGImage	See also

Reads in a JPEG image from the Clipboard into the JPEG image object.

procedure LoadFromClipboardFormat(AFormat: Word; AData: THandle; APalette: HPALETTE); override;

Description

LoadFromClipboardFormat is called if the JPEG image is registered with the TPicture object using the RegisterClipboardFormat method. LoadFromClipboardFormat can also recognize, and supports, a bitmap format on the Clipboard.

LoadFromClipboardFormat replaces the current image with the data pointed to by the AData parameter. The palette for the JPEG image is specified by the APalette parameter.


TJPEGImage.LoadFromStream

TJPEGImage	See also

Loads the JPEG image from a stream.

procedure LoadFromStream(Stream: TStream); override;

Description

Use LoadFromStream by specifying the stream from which the JPEG image is loaded as the value of Stream. LoadFromStream reads a JPEG data source from a stream and replaces the current image with it.


TJPEGImage.SaveToClipboardFormat

TJPEGImage	See also

Writes a JPEG image to a variable in Clipboard format.

procedure SaveToClipboardFormat(var AFormat: Word; var AData: THandle; var APalette: HPALETTE); override;

Description

Use SaveToClipboardFormat to save the JPEG image to a variable. The palette is returned as the APalette parameter, the format as the Aformat parameter, and the data as the AData parameter. Before the JPEG image can be saved, an application must have registered the format with the TJPEG object using the RegisterClipboardFormat method.


TJPEGImage.SaveToStream

TJPEGImage	See also

Writes the JPEG data to a stream.

procedure SaveToStream(Stream: TStream); override;

Description

Use SaveToStream to save the JPEG data to the stream specified by the Stream parameter. SaveToStream expects JPEG image data and may incur overhead of a compression cycle if the source is a bitmap.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TGraphic


 TLabel

Hierarchy	Properties	Methods	Events	See also

TLabel is a nonwindowed control that displays text on a form. This text can be used to label another control, and can set focus to that control when the user types an accelerator key.

Unit

stdctrls

Description

TLabel is not a descendant of TWinControl, so it does not have its own window and can’t receive direct input from the keyboard. To add an object to a form that can respond to keyboard input (other than setting focus to another object when an accelerator key is typed) in addition to displaying text, use TStaticText.

To add an object to a form that displays text that a user can scroll or edit, use TEdit.


TLabel properties

TLabel	Alphabetically	Legend

Derived from TCustomLabel

Alignment

AutoSize

FocusControl

Layout

ShowAccelChar

Transparent

WordWrap

Derived from TGraphicControl

Canvas

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TLabel properties

TLabel	By object	Legend

Action

Align

Alignment

Anchors

AutoSize

BiDiMode

BoundsRect

Canvas

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlState

ControlStyle

Cursor

DesignInfo

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

FocusControl

Font

Height

Hint

HostDockSite

Layout

Left

LRDockWidth

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowAccelChar

ShowHint

Tag

TBDockHeight

Top

Transparent

UndockHeight

UndockWidth

VCLComObject

Visible

Width

WindowProc

WordWrap


TLabel events

TLabel	Alphabetically	Legend

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TLabel events

TLabel	By object	Legend

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TLabel methods

TLabel	Alphabetically

Derived from TCustomLabel

Create

Derived from TGraphicControl

Destroy

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

Invalidate

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

Repaint

ReplaceDockedControl

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TLabel methods

TLabel	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

NewInstance

Perform

Refresh

RemoveComponent

Repaint

ReplaceDockedControl

SafeCallException

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

UpdateAction

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl

TCustomLabel


TLanguages

Hierarchy	Properties	Methods	See also

TLanguages lists all available Windows locales.

Unit

sysutils

Description

The Languages function returns a TLanguages instance that lists the Windows locales supported by the current system. For each locale, TLanguages indicates the locale ID (LCID), standard name, and recommended file-name extension. This information is obtained from the operating system; all TLanguages properties are read-only.


TLanguages properties

TLanguages	Alphabetically	Legend

In TLanguages

Count

Ext

ID

LocaleID

Name

NameFromLCID

NameFromLocaleID


TLanguages properties

TLanguages	By object	Legend

Count

Ext

ID

LocaleID

Name

NameFromLCID

NameFromLocaleID


TLanguages.Count

TLanguages	See also

The number of locales listed in the TLanguages object.

property Count: Integer;

Description

Read Count to determine the number of locales supported by the current system.


TLanguages.Ext

TLanguages	See also

Returns the standard file-name extension at the specified position in the array.

property Ext[Index: Integer]: string;

Description

Read Ext to get the standard three-letter file-name extension for a locale. For example, Ext[IndexOf($0409)] returns the string ENU.

Ext is a zero-based array.


TLanguages.ID

TLanguages	See also

Returns a locale ID as a string.

property ID[Index: Integer]: string;

Description

Read ID to get the locale ID at a specified position in the array as a string. (To get the same ID as an integer, use the LocaleID property.) For example, if U.S. English is the first locale listed in TLanguages, then ID[0] returns the string $00000409. You can iterate through the ID array (from 0 to Count - 1) to determine whether a specific locale is in the array.


TLanguages.LocaleID

TLanguages	See also

Returns a locale ID as an integer.

property LocaleID[Index: Integer]: LCID;

Description

Read LocaleID to get the locale ID at a specified position in the array as an integer. (To get the same ID as a string, use the ID property.) For example, if U.S. English is the first locale listed in TLanguages, then LocaleID[0] returns the integer $409. You can iterate through the LocaleID array (from 0 to Count - 1) to determine whether a specific locale is in the array.


TLanguages.Name

TLanguages	See also

Returns the locale name at the specified position in the array.

property Name[Index: Integer]: string;

Description

Read Name to get the standard Windows name for a locale. For example, Name[IndexOf($0409)] returns the string English (United States).

Name is a zero-based array.


TLanguages.NameFromLCID

TLanguages	See also

Returns the locale name specified by a string representation of a locale ID.

property NameFromLCID[const ID: string]: string;

Description

Read NameFromLCID to get the standard Windows name for a locale using a locale ID representd by a string. For example, NameFromLCID['$0409'] returns the string English (United States).


TLanguages.NameFromLocaleID

TLanguages	See also

Returns the locale name specified by an integer locale ID.

property NameFromLocaleID[ID: LCID]: string;

Description

Read NameFromLocaleID to get the standard Windows name for a locale using an integer locale ID. For example, NameFromLCID[$0409] returns the string English (United States).


TLanguages methods

TLanguages	Alphabetically

In TLanguages

Create

IndexOf

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

IndexOf

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TLanguages methods

TLanguages	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

IndexOf

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TLanguages.IndexOf

TLanguages	See also

Returns the index of the first locale in the array with the specified LCID.

function IndexOf(ID: LCID): Integer;

Description

Call IndexOf to get the position in the array of a specified locale ID. For example, if U.S. English is the first locale listed in TLanguages, then IndexOf($0409) returns 0.

If the specified LCID is not found, IndexOf returns -1.


TLanguages.Create

TLanguages	See also

Creates a new TLanguages object.

constructor Create;

Description

Do not construct a TLanguages object directly. Instead, call the Languages function, which returns an instance of TLanguages with locale information obtained from Windows.


Accessibility

Read-only


Hierarchy

TObject


TLargeintField

Hierarchy	Properties	Methods	Events	See also

A TLargeintField object represents a large integer field in a dataset.

Unit

Db

Description

TLargeintField fields are database fields that contain large integer values.

TLargeintField introduces no new events or methods. It introduces the AsLargeInt property. It overrides the Size property and Create method to reflect the specifics of a field of type ftLargeint.


TLargeintField properties

TLargeintField	Alphabetically	Legend

In TLargeintField

AsFloat

AsInteger

AsLargeInt

AsString

AsVariant

DataSize

MaxValue

MinValue

Value

Derived from TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TLargeintField properties

TLargeintField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsLargeInt

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Lookup

MaxValue

MinValue

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

ValidChars

Value

VCLComObject

Visible


TLargeIntField.AsFloat

TLargeintField	See also

AsFloat converts the value of the field to or from a floating-point value.

property AsFloat: Double;

Description

Use AsFloat to

Assign the large integer field value to a floating-point value.

Assign a floating-point value to the large integer field.

For example, this code assigns a floating-point value to a large integer field value:

MyLargeintField.AsFloat := FloatVariable;

To assign a large integer field value to a floating-point value, use code similar to this:

FloatVariable := MyLargeintField.AsFloat;

If a value assigned to the field is not within the range established by the MinValue and the MaxValue properties, an EDatabaseError exception is raised.


TLargeIntField.AsInteger

TLargeintField	See also

AsInteger converts the value of the field to or from an integer.

property AsInteger: Longint;

Description

Use AsInteger to

Assign the large integer field value to an integer variable.

Assign an integer value to the large integer field.

For example, this code assigns integer value to a large integer field value:

MyLargeIntegerField.AsInteger := IntegerVariable;

To assign a large integer field value to an integer value, use code similar to this:

IntegerVariable := MyLargeIntegerField.AsInteger;

If a value assigned to the field is not within the range established by the MinValue and the MaxValue properties, an EDatabaseError exception is raised.


TLargeIntField.AsLargeInt

TLargeintField	See also

AsLargeInt reads or writes the field value as a large integer.

property AsLargeInt: LargeInt;

Description

Use AsLargeInt to

Assign the large integer field value to a largeInt variable.

Assign a LargeInt value to the large integer field.

For example, this code assigns integer value to a large integer field value:

LargeIntegerVariable := MyLargeIntegerField.AsLargeInt;

To assign a large integer field value to a LargeInt value, use code similar to this:

LargeIntegerVariable := MyLargeIntegerField.AsLargeInt;

If a value assigned to the field is not within the range established by the MinValue and the MaxValue properties, an EDatabaseError exception is raised.


TLargeIntField.AsString

TLargeintField	See also

AsString converts the value of the field to or from a string.

property AsString: String;

Description

Use AsString to

Assign the large integer field value to string variable.

Assign a string value to the large integer field.

For example, this code assigns a string value to a large integer field value:

MyLargeIntegerField.AsString := '1232';

To assign a large integer field value to a string value, use code similar to this:

NewString := MyLargeIntegerField.AsString;

If the string assigned to the field does not represent a valid currency value within the range specified by the MinValue and MaxValue properties, an EDatabaseError exception is raised.


TLargeIntField.AsVariant

TLargeintField	See also

AsVariant converts the value of a large integer field to or from a variant value.

property AsVariant: Variant;

Description

Use AsVariant to

Assign the large integer field value to variant value.

Assign a variant value to the large integer field.

For example, this code assigns a Variant value to a large integer field value:

MyLargeIntegerField.AsVariant := VariantVariable;

To assign a large integer field value to a variant value, use code similar to this:

VariantVariable:= MyLargeIntegerField.AsVariant;

Using variants is useful when both the actual field type and the type of the data are unknown.

If a value assigned to the field is not within the range established by the MinValue and the MaxValue properties, an EDatabaseError exception is raised.


TLargeIntField.DataSize

TLargeintField	See also

DataSize is the amount of memory that is needed to store the value of a large integer field in its native large integer format.

property DataSize: Word;

Description

Check DataSize to determine the number of bytes required to store a large integer field component’s value. Use DataSize to determine the size needed for a buffer when working with the GetData and SetData methods.

For large integer fields, DataSize is always 8. This is the size of 64-bit integer values in the database tables.


TLargeIntField.MaxValue

TLargeintField	See also

MaxValue limits the maximum value in the large integer field.

property MaxValue: Largeint;

Description

Use MaxValue to get or set the maximum value that can be entered into the field. If a value greater than MaxValue is entered, an EDatabaseError exception is raised.

If the value of MaxValue is 0, the large integer field can have a value up to the maximum value that can be represented by the native database type. For 64-bit integer fields, this value is 2 ^63 - 1.


TLargeIntField.MinValue

TLargeintField	See also

MinValue limits the minimum value in the large integer field.

property MinValue: Largeint;

Description

Use MinValue to get or set the minimum value that can be entered into the field. If a value smaller than MinValue is entered, an EDatabaseError exception is raised.

If the value of MinValue is 0, the large integer field can have a value as small as the native database type can represent. For 64-bit integer fields, this minimum value is -2 ^63


TLargeIntField.Value

TLargeintField	See also

Value is the actual data in the large integer field.

property Value: Largeint;

Description

Use Value to read data directly from and write data directly to a large integer field. Using the Value property is the same as using the AsLargeInt property. Use Value when you know the field component is a 64-bit integer field. Use AsInteger when working with a generic field component.

If a value assigned to the field is not within the range established by the MinValue and the MaxValue properties, an EDatabaseError exception is raised.


TLargeintField events

TLargeintField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TLargeintField events

TLargeintField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TLargeintField methods

TLargeintField	Alphabetically

In TLargeintField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TLargeintField methods

TLargeintField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TLargeIntField.Create

TLargeintField	See also

Create creates an instance of TLargeintField.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TLargeintField. After calling the inherited constructor, Create sets the DataType to ftLargeInt, and valid characters to '+', '-', and '0'..'9'.

After instantiating a TLargeintField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TLargeintField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TLargeintField with a dataset component by setting its DataSet property to the name of the dataset component.

The example below creates a TLargeintField object for a field named Population accessed through a TQuery named Query1.

var

  T: TLargeintField;

begin

  Query1.Close;

  T := TLargeintField.Create(Self);

  T.FieldName := 'Population';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TNumericField


TList

Hierarchy	Properties	Methods	See also

TList stores an array of pointers.

Unit

classes

Description

TList, which stores an array of pointers, is often used to maintain lists of objects. TList introduces properties and methods to

Add or delete the objects in the list.

Rearrange the objects in the list.

Locate and access objects in the list.

Sort the objects in the list.


TList properties

TList	Alphabetically	Legend

In TList

Capacity

Count

Items

List


TList properties

TList	By object	Legend

Capacity

Count

Items

List


TList.Capacity

TList	See also

Specifies the allocated size of the array of pointers maintained by the TList object.

property Capacity: Integer;

Description

Set Capacity to the number of pointers the list will need to contain. When setting the Capacity property, an EOutOfMemory exception occurs if there is not enough memory to expand the list to its new size.

Read Capacity to learn number of objects the list can hold without reallocating memory. Don’t confuse Capacity with the Count property, which is the number of entries in the list that are in use. The value of Capacity is always greater than or equal to the value of Count. When Capacity is greater than Count, the unused memory can be reclaimed by setting Capacity to Count.

When an object is added to a list that is already filled to capacity, the Capacity property is automatically increased. Setting Capacity before adding objects can reduce the number of memory reallocations and thereby improve performance. For example,

List.Clear;

List.Capacity := Count;

for I := 1 to Count do List.Add(...);

The assignment to Capacity before the for loop ensures that each of the following Add operations doesn't cause the list to be reallocated. Avoiding reallocations on the calls to Add improves performance and ensures that the Add operations never raise an exception.


TList.Count

TList	See also 	Example

Indicates the number of entries in the list that are in use.

property Count: Integer;

Description

Read Count to determine the number of entries in the Items array.

Increasing the size of Count will add the necessary number of nil pointers to the end of the Items array. Decreasing the size of Count will remove the necessary number of entries from the end of the Items array.

Count is not always the same as the number of objects referenced in the list. Some of the entries in the Items array may contain nil pointers. To remove the nil pointers and set Count to the number of entries that contain references to objects, call the Pack method.


TList.Items

TList	See also 	Example

Lists the object references.

property Items[Index: Integer]: Pointer;

Description

Use Items to obtain a pointer to a specific object in the array. The Index parameter indicates the index of the object, where 0 is the index of the first object, 1 is the index of the second object, and so on. Set Items to change the reference at a specific location.

Use Items with the Count property to iterate through all of the objects in the list.

Not all of the entries in the Items array need to contain references to objects. Some of the entries may be nil pointers. To remove the nil pointers and reduce the size of the Items array to the number of objects, call the Pack method.


TList.List

TList	See also

Specifies the array of pointers that make up the Items array.

type

  TPointerList = array[0..MaxListSize-1] of Pointer;

  PPointerList = ^TPointerList;

property List: PPointerList;

Description

Use List to gain direct access to the Items array.


TList methods

TList	Alphabetically

In TList

Add

Clear

Delete

Destroy

Error

Exchange

Expand

Extract

First

IndexOf

Insert

Last

Move

Pack

Remove

Sort

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TList methods

TList	By object

Add

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

Error

Exchange

Expand

Extract

FieldAddress

First

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

IndexOf

InheritsFrom

InitInstance

Insert

InstanceSize

Last

MethodAddress

MethodName

Move

NewInstance

Pack

Remove

SafeCallException

Sort


TList.Add

TList	See also 	Example

Inserts a new item at the end of the list.

function Add(Item: Pointer): Integer;

Description

Call Add to insert a new object at the end of the Items array. Add returns the index of the new item, where the first item in the list has an index of 0.

Add increments Count and, if necessary, allocates memory by increasing the value of Capacity.

Note:	Add always inserts the Item pointer at the end of the Items array, even if the Items array contains nil pointers.


TList.Clear

TList	See also

Deletes all items from the list.

procedure Clear; virtual;

Description

Call Clear to empty the Items array and set the Count to 0. Clear also frees the memory used to store the Items array and sets the Capacity to 0.


TList.Delete

TList	See also

Removes the item at the position given by the Index parameter.

procedure Delete(Index: Integer);

Description

Call Delete to remove the item at a specific position from the list. The index is zero-based, so the first item has an Index value of 0, the second item has an Index value of 1, and so on. Calling Delete moves up all items in the Items array that follow the deleted item, and reduces the Count.

In TList, the Extract and Delete methods behave exactly the same way. Descendant classes (including TObjectList and TComponentList) distinguish the two methods.

To remove the reference to an item without deleting the entry from the Items array and changing the Count, set the Items property for Index to nil.

Note:	Delete does not free any memory associated with the item. To free the memory that was used to store a deleted item, set the Capacity property.


TList.Destroy

TList	See also

Destroys an instance of TList.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead, call Free. Free verifies that the TList reference is not nil, and only then calls Destroy.

Destroy frees the memory used to store the list of items.

Note:	Destroy does not free the memory pointed to by the elements of the list.


TList.Error

TList	See also

Raises an EListError exception.

class procedure Error(const Msg: string; Data: Integer); overload; virtual;

class procedure Error(Msg: PResStringRec; Data: Integer); overload;

Description

Call Error to raise an exception when an error occurs working with a TList object. Error assembles an error message from the format string (or resourcestring) passed as the Msg parameter and the data value passed as the Data parameter, and then raises an EListError exception.

Call Error rather than adding a line such as

raise EListError.CreateFmt(MyMsg, iBadValue);

or

resourcestring sBadValueMessage = '%s not a valid list value';

...

EListError.Create(@sBadValueMessage, iBadValue);

to reduce the code size of an application.


TList.Exchange

TList	See also

Swaps the position of two items in the Items array.

procedure Exchange(Index1, Index2: Integer);

Description

Call Exchange to swap the positions of the items at positions Index1 and Index2 of the Items array. The indexes are zero-based, so the first item in the list has an index value of 0, the second item has an index value of 1, and so on.


TList.Expand

TList	See also

Increases the Capacity of the list.

function Expand: TList;

Description

Call Expand to create more space for adding new items to the list. Expand does nothing if the list is not already filled to Capacity.

If Count = Capacity, Expand increases the Capacity of the list as follows. If the value of Capacity is greater than 8, Expand increases the Capacity of the list by 16. If the value of Capacity is greater than 4, but less than 9, the Capacity of the list increases by 8. If the value of Capacity is less than 4, the Capacity of the list grows by 4.

The returned value is the expanded list object.


TList.Extract

TList	See also

Removes a specified item from the list.

function Extract(Item: Pointer): Pointer;

Description

Call Extract to remove an item from the list. After the item is removed, all the objects that follow it are moved up in index position and Count is decremented.

In TList, the Extract and Delete methods behave exactly the same way. Descendant classes (including TObjectList and TComponentList) distinguish the two methods.

To remove the reference to an item without deleting the entry from the Items array and changing the Count, set the Items property for Index to nil.


TList.First

TList	See also

Returns Items[0].

function First: Pointer;

Description

Call First to get the first pointer in the Items array.


TList.IndexOf

TList	See also 	Example

Returns the index of the first entry in the Items array with a specified value.

function IndexOf(Item: Pointer): Integer;

Description

Call IndexOf to get the index for a pointer in the Items array. Specify the pointer as the Item parameter.

The first item in the array has index 0, the second item has index 1, and so on. If an item is not in the list, IndexOf returns -1. If a pointer appears more than once in the array, IndexOf returns the index of the first appearance.


TList.Insert

TList	See also

Adds an object to the Items array at the position specified by Index.

procedure Insert(Index: Integer; Item: Pointer);

Description

Call Insert to add Item to the middle of the Items array. The Index parameter is a zero-based index, so the first position in the array has an index of 0. Insert adds the item at the indicated position, shifting the item that previously occupied that position, and all subsequent items, up. Insert increments Count and, if necessary, allocates memory by increasing the value of Capacity.

To replace a nil pointer in the array with a new item, without growing the Items array, set the Items property.


TList.Last

TList	See also 	Example

Returns Items[Count - 1].

function Last: Pointer;

Description

Call Last to retrieve the last pointer in the Items array.


TList.Move

TList	See also

Changes the position of an item in the Items array.

procedure Move(CurIndex, NewIndex: Integer);

Description

Call Move to move the item at the position CurIndex so that it occupies the position NewIndex. CurIndex and NewIndex are zero-base indexes into the Items array.


TList.Pack

TList	See also 	Example

Deletes all nil items from the Items array.

procedure Pack;

Description

Call Pack to move all non-nil items to the front of the Items array and reduce the Count property to the number of items actually used. Pack does not free up the memory used to store the nil pointers. To free up the memory for the unused entries removed by Pack, set the Capacity property to the new value of Count.


TList.Remove

TList	See also 	Example

Deletes the first reference to the Item parameter from the Items array.

function Remove(Item: Pointer): Integer;

Description

Call Remove to remove a specific item from the Items array when its index is unknown. The value returned is the index of the item in the Items array before it was removed. After an item is removed, all the items that follow it are moved up in index position and the Count is reduced by one.

If the Items array contains more than one copy of the pointer, only the first copy is deleted.


TList.Sort

TList	See also

Performs a QuickSort on the list based on the comparison function Compare.

type TListSortCompare = function (Item1, Item2: Pointer): Integer;

procedure Sort(Compare: TListSortCompare);

Description

Call Sort to sort the items in the Items array. Compare is a comparison function that indicates how the items are to be ordered. Compare returns < 0 if Item1 is less and Item2, 0 if they are equal and > 0 if Item1 is greater than Item2.


Accessibility

Read-only


Hierarchy

TObject


 TListBox

Hierarchy	Properties	Methods	Events

TListBox is a wrapper for a Windows list box control.

Unit

stdctrls

Description

TListBox implements the generic behavior introduced in TCustomListbox. TListBox publishes many of the properties inherited from TCustomListBox, but does not introduce any new behavior.

Use TListBox to display a scrollable list of items that users can select, add or delete. For specialized list boxes use other descendant classes of TCustomListBox or derive from it.


TListBox properties

TListBox	Alphabetically	Legend

Derived from TCustomListBox

BorderStyle

Canvas

Columns

ExtendedSelect

IntegralHeight

ItemHeight

ItemIndex

Items

MultiSelect

SelCount

Selected

Sorted

Style

TabWidth

TopIndex

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TListBox properties

TListBox	By object	Legend

Action

Align

Anchors

BiDiMode

BorderStyle

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Columns

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

ExtendedSelect

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

ImeMode

ImeName

IntegralHeight

ItemHeight

ItemIndex

Items

Left

LRDockWidth

MultiSelect

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

SelCount

Selected

ShowHint

Showing

Sorted

Style

TabOrder

TabStop

TabWidth

Tag

TBDockHeight

Top

TopIndex

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TListBox events

TListBox	Alphabetically	Legend

Derived from TCustomListBox

OnDrawItem

OnMeasureItem

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TListBox events

TListBox	By object	Legend

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnDrawItem

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMeasureItem

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TListBox methods

TListBox	Alphabetically

Derived from TCustomListBox

Clear

Create

Destroy

ItemAtPos

ItemRect

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TListBox methods

TListBox	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ItemAtPos

ItemRect

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomListBox


TListItem

Hierarchy	Properties	Methods	See also

TListItem is an individual item of a TListView control.

Unit

comctrls

Description

Use TListItem to specify the appearance and data associations of an item in a list view. All the list items of the list view are collected by a TListItems object to make up the Items property of the TListView control.


TListItem properties

TListItem	Alphabetically	Legend

In TListItem

Caption

Checked

Cut

Data

DropTarget

Focused

Handle

ImageIndex

Indent

Index

Left

ListView

OverlayIndex

Owner

Position

Selected

StateIndex

SubItemImages

SubItems

Top


TListItem properties

TListItem	By object	Legend

Caption

Checked

Cut

Data

DropTarget

Focused

Handle

ImageIndex

Indent

Index

Left

ListView

OverlayIndex

Owner

Position

Selected

StateIndex

SubItemImages

SubItems

Top


TListItem.Caption

TListItem	See also 	Example

Specifies the text that labels the item in the list.

property Caption: string;

Description

Use Caption to name the list item. The Caption appears with an associated image that depends on the ViewStyle property of the list view.

If the ReadOnly property of the list view is False, the user can edit the caption.


TlistItemChecked
TListItem.Checked

TListItem	See also

Determines whether a check mark appears next to the list item.

property Checked: Boolean;

Description

Use Checked to indicate whether the list item represents a selected option by displaying a check mark next to the item in the list view. When Checked is True, a check mark appears next to the item. When Checked is False, no check mark appears.

Note:	Set the CheckBoxes property of the ListView to True before using the Checked property.


TListItem.Cut

TListItem	See also

Determines if the list item is drawn as if it is selected for a cut operation.

property Cut: Boolean;

Description

Set the Cut property to give the list item the grayed-out appearance of an item selected for cutting in the Windows Explorer. Cut does not copy the item to the Clipboard or remove it from the list: the application must still perform these operations.


TListItem.Data

TListItem	See also

Specifies any application-specific data associated with the list item.

property Data: Pointer;

Description

Use Data to associate arbitrary data structure with the list item. When the user selects or deletes the list item, Data allows the application to quickly access information about the meaning of the list item to implement the appropriate response.


TListItem.DropTarget

TListItem	See also

Determines whether the list item appears selected as a drag and drop target.

property DropTarget: Boolean;

Description

Use DropTarget to display the list item as the current drop target of the object the user is dragging. Setting DropTarget to True sets the DropTarget property of all other items in the list view to False.


TListItem.Focused

TListItem	See also

Indicates whether the list item has input focus.

property Focused: Boolean;

Description

Set Focused to True to allow the user to edit the Caption.

Note:	Only one item in the tree view should have focus at a time.  When setting Focused to True, be sure to set the Focused property of all other items in the list view to False. When the list item is Focused, it appears surrounded by a standard focus rectangle.


TListItem.Handle

TListItem	See also

Specifies the window handle of the list view that owns the list item.

property Handle: HWND;

Description

Use Handle as a parameter in Windows API function calls that require the handle to the list view window.


TListItem.ImageIndex

TListItem	See also 	Example

Determines which image is displayed as the icon for the list item.

property ImageIndex: TImageIndex;

Description

Set ImageIndex to associate the list item with one of the images in the LargeImages or SmallImages property of the list view. If the ViewStyle of the list view is vsIcon, ImageIndex is the index of the image in the LargeImages property of the list view, where 0 specifies the first image. If the ViewStyle of the list view is vsSmallIcon, vsList, or vsReport, ImageIndex is the index of the image in the SmallImages property of the list view.


TListItem.Index

TListItem	See also 	Example

Indicates the position of the list item in the TListItems collection.

property Index: Integer;

Description

Use Index to locate the item in the list view. The first item has an index of 0, the second item has an index of 1, and so on.


TListItem.Indent

TListItem	See also

Specifies how far the list item is indented.

property Indent: Integer;

Description

Use Indent to get or set how far the list item is indented when the listview’s ViewStyle property is vsReport. Indent specifies the factor times which the Width property of the SmallImages image list is multiplied to obtain the indent in a report style list view. That is, items are indented by

Indent*ListView.SmallImages.Width.


TListItem.Left

TListItem	See also

Specifies the distance, in pixels, from the left edge of the list view to the left edge of the list item.

property Left: Integer;

Description

Use Left to horizontally position the list item within the list view. Only use the Left property when the ViewStyle property of the list view is vsIcon or vsSmallIcon.


TListItem.ListView

TListItem	See also

Indicates the list view control that displays the list item.

property ListView: TCustomListView;

Description

Read ListView to access the list view object that displays the item. Use the properties and methods of the list view object to make changes that affect the list item or to manipulate other items in the list.

Do not confuse the ListView that displays the item with the Owner of the item. The Owner is the TListItems object that manages the collection of all list items. The list view is the Owner of that TListItems object.


TListItem.OverlayIndex

TListItem	See also

Determines which image from the image list is used as an overlay mask.

property OverlayIndex: TImageIndex;

Description

Use OverlayIndex to display an overlay mask on an item in the list when the ViewStyle of the list view is vsIcon or vsSmallIcon. OverlayIndex is the index of the overlay image in the StateImages property of the list view.

An overlay mask is an image drawn transparently over the icon for the item in the list view. For example, to indicate that an item is no longer available, an application could use an overlay image of an X over the item's image.


TListItem.Owner

TListItem	See also

Specifies the TListItems object that owns the list item.

property Owner: TListItems;

Description

Use Owner to access the TListItems object that manages all the list items for the list view. Use the methods of the Owner object to temporarily prevent updates to the image of the list item while it is changed or to add or delete list items.

Do not confuse the Owner property with the list view control that displays the item. The ListView property specifies the list view control that owns the TListItems object.


TListItem.Position

TListItem

Specifies the position of the list item.

property Position: TPoint;

Description

Use Position to get or set the position of the list item.


TListItem.Selected

TListItem	See also

Indicates whether the list item is selected.

property Selected: Boolean;

Description

Use Selected to select or unselect the list item. If the MultiSelect property of the list view is False, setting Selected to True sets the Selected property of all other list items in the list view to False. The appearance of a selected item depends on whether it has focus and whether the system colors are used for selection.


TListItem.StateIndex

TListItem	See also

Specifies which image from the StateImages image list to display for the item.

property StateIndex: TImageIndex;

Description

Set StateIndex to associate the list item with one of the images in the StateImages property of the list view, where 0 specifies the first image. Change StateIndex to display a different image when the state of the item changes.

The state image appears to the left of the normal list item.


TListItem.SubItemImages

TListItem	See also

Indicates which images (if any) should appear next to subitems of the item.

property SubItemImages[Index: Integer]: Integer;

Description

Use SubItemImages to associate the subitems of this list item with images from the list view’s SmallImages property, where 0 identifies the first image in SmallImages, 1 identifies the second image, and so on.

The Index parameter identifies the subitem. It corresponds to the index of each sub item string in the SubItems property.

The value of any sub item image index can be overridden in an OnGetSubItemImage event handler.

Note:	Subitems are only visible when the list view's ViewStyle property is set to vsReport.


TListItem.SubItems

TListItem	See also 	Example

Contains any strings that appear as subitems to the list item.

property SubItems: TStrings;

Description

Use SubItems to add strings that appear in the additional columns to the right of the list view item when the list view’s ViewStyle property is vsReport. The TStrings object that implements the SubItems property is created when the list item is created. To the methods of the SubItems object to add or delete subitems.

Note:	Subitems are only visible when the list view's ViewStyle property is set to vsReport.


TListItem.Top

TListItem	See also

Specifies the distance, in pixels, from the top of the list view to the top of the list item.

property Top: Integer;

Description

Use Top to vertically position the list item within the list view. Only use the Top property when the ViewStyle property of the list view is vsIcon or vsSmallIcon.


TListItem methods

TListItem	Alphabetically

In TListItem

Assign

CancelEdit

Create

Delete

Destroy

DisplayRect

EditCaption

GetPosition

MakeVisible

SetPosition

Update

WorkArea

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TListItem methods

TListItem	By object

AfterConstruction

Assign

BeforeDestruction

CancelEdit

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Delete

Destroy

Dispatch

DisplayRect

EditCaption

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetPosition

InheritsFrom

InitInstance

InstanceSize

MakeVisible

MethodAddress

MethodName

NewInstance

SafeCallException

SetPosition

Update

WorkArea


TListItem.Assign

TListItem	See also

Copies the properties of another list item.

procedure Assign(Source: TPersistent); override;

Description

It the Source parameter is a TListItem object, Assign copies its Caption, Data, ImageIndex, OverlayIndex, StateIndex, and SubItems properties. Otherwise, Assign calls the inherited method so that any object that copies properties to a list item in its AssignTo method can do so.


TListItem.CancelEdit

TListItem	See also

Cancels the editing of the list item's caption.

procedure CancelEdit;

Description

Call CancelEdit to end the editing of the item’s caption, discarding any changes made by the user.


TListItem.Create

TListItem	See also

Creates an instance of TListItem.

constructor Create(AOwner: TListItems);

Description

Call Create to instantiate a TListItem object at runtime. List items added to the list view at design time are created automatically. At runtime, use the Add method of the TListItems object to create a list item and add it to the list view.


TListItem.Delete

TListItem	See also

Deletes the list item from its list view.

procedure Delete;

Description

Use the Delete method to delete a list item. Delete removes the item from the image of the list view before freeing all associated memory by calling the Free method.


TListItem.Destroy

TListItem	See also

Destroys an instance of TListItem.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead, use Delete, which removes the item from the list view windows before freeing the associated memory.


TListItem.DisplayRect

TListItem	See also

Returns the bounding rectangle of the list item.

type TDisplayCode = (drBounds, drIcon, drLabel, drSelectBounds);

function DisplayRect(Code: TDisplayCode): TRect;

Description

Use DisplayRect to get the coordinates of the list item in the client coordinates of the containing listview. The Code parameter specifies what part of the item the bounding rectangle surrounds. These are the possible values for the Code parameter.

Value	Meaning

drBounds	Returns the bounding rectangle of the entire list item, including the icon and label.

drIcon	Returns the bounding rectangle of the icon or small icon

drLabel	Returns the bounding rectangle of the item text

drSelectBounds	Returns the union of the icon and label rectangles, but excludes columns in report view


TListItem.EditCaption

TListItem	See also

Begins in-place editing of the list item's caption.

function EditCaption: Boolean;

Description

Call EditCaption to put the list item into edit mode. Before bringing up the in-place editor for the item’s caption, EditCaption makes the item the only selected item in the list view and gives it input focus.


TListItem.GetPosition

TListItem	See also

Returns the position of the list item as a point.

function GetPosition: TPoint;

Description

Call GetPosition to obtain the upper left coordinate of the list item. GetPosition returns a point with the x coordinate set to the value of Left and the y coordinate set to the value of Top.


TListItem.MakeVisible

TListItem	See also

Scrolls the list view, if necessary, to ensure a list item is in view.

procedure MakeVisible(PartialOK: Boolean);

Description

Call MakeVisible to ensure that the user can see the list item in the list view. The PartialOK parameter specifies whether the item must be entirely visible. If PartialOK is True, no scrolling occurs if the item is at least partially visible. If PartialOK is False, MakeVisible ensures that the entire list item is visible in the list view.


TListItem.SetPosition

TListItem	See also

Positions the list item in its list view control.

procedure SetPosition(const Value: TPoint);

Description

Call SetPosition to move the list item to a specified position. The Value parameter specifies the desired coordinates of the upper left corner of the list item.

Note:	The list view control must have its ViewStyle property set to either vsIcon or vsSmallIcon.


TListItem.Update

TListItem	See also

Updates the image of the list item in the list view display.

procedure Update;

Description

Call Update to update the image of the list view to reflect any changes made to the list item. Changing the Caption, position, or state of the list item automatically updates the list item’s image.


TListItem.WorkArea

TListItem	See also

Returns the work area (if any) that contains the list item.

function WorkArea: Integer;

Description

When the list view that contains the list item organizes its client area into separate rectangular work areas, each list item is associated with a single work area. WorkArea returns the index of this work area in the list maintained by the list view’s WorkAreas property. If the list view does not use work areas, WorkArea returns –1.

To change the work area of a list item, move it into a position of the list view’s client area that is covered by a different work area.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


 TListView

Hierarchy	Properties	Methods	Events	See also

TListView displays a list of items in various ways.

Unit

comctrls

Description

Use TListView to manage and display a list of items in a form. The items can be displayed in columns with column headers and sub-items, or vertically or horizontally, with small or large icons.

TListView publishes many of the properties, events, and methods of TCustomListView, but does not introduce any new behavior.


TListView properties

TListView	Alphabetically	Legend

Derived from TCustomListView

AllocBy

BorderStyle

BoundingRect

Canvas

Checkboxes

Column

ColumnClick

Columns

DropTarget

FlatScrollBars

FullDrag

GridLines

HideSelection

HotTrack

HotTrackStyles

HoverTime

IconOptions

ItemFocused

Items

LargeImages

MultiSelect

OwnerData

OwnerDraw

ReadOnly

RowSelect

SelCount

Selected

ShowColumnHeaders

ShowWorkAreas

SmallImages

SortType

StateImages

TopItem

ViewOrigin

ViewStyle

VisibleRowCount

WorkAreas

Derived from TWinControl

BorderWidth

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TListView properties

TListView	By object	Legend

Action

Align

AllocBy

Anchors

BiDiMode

BorderStyle

BorderWidth

BoundingRect

BoundsRect

Brush

Canvas

Checkboxes

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Column

ColumnClick

Columns

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

DropTarget

Enabled

FlatScrollBars

Floating

FloatingDockSiteClass

Font

FullDrag

GridLines

Handle

Height

HelpContext

HideSelection

Hint

HostDockSite

HotTrack

HotTrackStyles

HoverTime

IconOptions

ItemFocused

Items

LargeImages

Left

LRDockWidth

MultiSelect

Name

Owner

OwnerData

OwnerDraw

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ReadOnly

RowSelect

SelCount

Selected

ShowColumnHeaders

ShowHint

Showing

ShowWorkAreas

SmallImages

SortType

StateImages

TabOrder

TabStop

Tag

TBDockHeight

Top

TopItem

UndockHeight

UndockWidth

VCLComObject

ViewOrigin

ViewStyle

Visible

VisibleDockClientCount

VisibleRowCount

Width

WindowProc

WorkAreas


TListView events

TListView	Alphabetically	Legend

Derived from TCustomListView

OnAdvancedCustomDraw

OnAdvancedCustomDrawItem

OnAdvancedCustomDrawSubItem

OnChange

OnChanging

OnColumnClick

OnColumnDragged

OnColumnRightClick

OnCompare

OnCustomDraw

OnCustomDrawItem

OnCustomDrawSubItem

OnData

OnDataFind

OnDataHint

OnDataStateChange

OnDeletion

OnDrawItem

OnEdited

OnEditing

OnGetImageIndex

OnGetSubItemImage

OnInfoTip

OnInsert

OnSelectItem

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock

OnStartDrag


TListView events

TListView	By object	Legend

OnAdvancedCustomDraw

OnAdvancedCustomDrawItem

OnAdvancedCustomDrawSubItem

OnChange

OnChanging

OnClick

OnColumnClick

OnColumnDragged

OnColumnRightClick

OnCompare

OnContextPopup

OnCustomDraw

OnCustomDrawItem

OnCustomDrawSubItem

OnData

OnDataFind

OnDataHint

OnDataStateChange

OnDblClick

OnDeletion

OnDragDrop

OnDragOver

OnDrawItem

OnEdited

OnEditing

OnEndDock

OnEndDrag

OnEnter

OnExit

OnGetImageIndex

OnGetSubItemImage

OnInfoTip

OnInsert

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnSelectItem

OnStartDock

OnStartDrag


TListView methods

TListView	Alphabetically

Derived from TCustomListView

AlphaSort

Arrange

Create

CustomSort

Destroy

FindCaption

FindData

GetHitTestInfoAt

GetItemAt

GetNearestItem

GetNextItem

GetSearchString

IsEditing

Scroll

StringWidth

UpdateItems

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TListView methods

TListView	By object

AfterConstruction

AlphaSort

Arrange

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

CustomSort

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindCaption

FindChildControl

FindComponent

FindData

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetHitTestInfoAt

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetItemAt

GetNamePath

GetNearestItem

GetNextItem

GetParentComponent

GetSearchString

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsEditing

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

Scroll

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

StringWidth

Update

UpdateAction

UpdateControlState

UpdateItems

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomListView


TLookupList

Hierarchy	Methods	See also

TLookupList maintains a list of lookup values associated with a set of key field values.

Unit

db

Description

TLookupList is used by TField to implement a cache of lookup values. Each value in the lookup list is associated with a set of values on the key fields in the lookup data set. Lookup fields match the values of the fields identified by their KeyFields property with the values of the key fields from the lookup data set. When these values match, the value of the lookup field is set to the associated value from TLookupList.

Use TLookupList to generate a lookup list programmatically when there is no actual lookup dataset. Set the LookupList property of the lookup field to a programmatically created TLookupList object and set the LookupCache property of the field to True. If the other lookup properties of the field are not set, the field will use the supplied lookup list without overwriting it with values from a lookup dataset.


TLookupList methods

TLookupList	Alphabetically

In TLookupList

Add

Clear

Create

Destroy

ValueOfKey

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TLookupList methods

TLookupList	By object

Add

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

ValueOfKey


TLookupList.Add

TLookupList	See also

Adds a lookup value to the list for a given key value.

procedure Add(const AKey, AValue: Variant);

Description

Lookup fields call Add when building the lookup cache to associate lookup values with the values of the key fields in the lookup dataset. The AKey parameter is a variant or variant array that represents the value or values of the key fields. AValue is a variant that represents the value of the lookup field associated with the key field values.

Use Add to build a lookup list from scratch when there is no actual lookup dataset.


TLookupList.Clear

TLookupList	See also

Empties the lookup list and frees the associated memory.

procedure Clear;

Description

Call Clear to empty the current values in the lookup list when building a lookup list programmatically. Lookup fields call Clear automatically before regenerating the lookup cache if the list represents the values in a lookup dataset.


TLookupList.Create

TLookupList	See also

Creates an instance of TLookupList.

constructor Create;

Description

Applications should not need to call Create. Instances of TLookupList are created by the lookup field that uses the list for its lookup cache. To obtain one of these instances, read the LookupList property of the field.

Create allocates the helper objects it uses to maintain the list of lookup values.


TLookupList.Destroy

TLookupList	See also

Destroys an instance of TLookupList.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. The lookup field that uses TLookupList destroys the lookup list when it is done.

Destroy frees all memory used to store the list of lookup values.


TLookupList.ValueOfKey

TLookupList	See also

Returns the lookup value associated with a set of key field values.

function ValueOfKey(const AKey: Variant): Variant;

Description

Call ValueOfKey to look up the value for a lookup field that has the set of values specified by the AKey parameter on the fields identified by its KeyFields property. AKey is a variant or variant array that contains the values on the key fields in the lookup data set that uniquely specify a lookup field value.


Hierarchy

TObject


TListColumn

Hierarchy	Properties	Methods	See also

TListColumn represents a column in a report-style list view.

Unit

comctrls

Description

TListView objects use TListColumns to maintain a collection of TListColumn objects.


TListColumn properties

TListColumn	Alphabetically	Legend

In TListColumn

Alignment

AutoSize

Caption

DisplayName

ImageIndex

MaxWidth

MinWidth

Tag

Width

WidthType

Derived from TCollectionItem

Collection

ID

Index


TListColumn properties

TListColumn	By object	Legend

Alignment

AutoSize

Caption

Collection

DisplayName

ID

ImageIndex

Index

MaxWidth

MinWidth

Tag

Width

WidthType


TListColumn.Alignment

TListColumn	See also

Specifies how all text is aligned within the list column.

property Alignment: TAlignment;

Description

Use Alignment to specify the horizontal placement of text in the column. The text includes the Caption that appears at the top of the column and the text labels of individual list items that appear in the column.


TListColumn.AutoSize

TListColumn

Specifies whether the list column automatically sizes itself to the width of its text.

property AutoSize: Boolean;

Description

Use AutoSize to get or set whether the list column automatically sizes itself to the width of its text.


TListColumn.Caption

TListColumn	See also 	Example

Specifies the text that appears at the top of the column.

property Caption: string;

Description

Use Caption to label the type of item that appears in the column. If the list-view control’s ViewStyle and ShowColumnHeaders properties are set to vsReport and True, respectively, the value of Caption appears at the top of the column.


TListColumn.DisplayName

TListColumn	See also

DisplayName is a string that names an individual list view column within a collection of columns.

property DisplayName: string;

Description

Use DisplayName to specify the name of the column as it should appear in the columns editor at design time. If the Caption property is set, the value of DisplayName is the same as Caption. Otherwise, DisplayName is the name of the list column class.


TListColumn.ImageIndex

TListColumn	See also

Specifies the index of the image displayed in the column.

property ImageIndex: TImageIndex;

Description

Use ImageIndex to get or set the index of the image displayed in the column. This index identifies an image in the list view’s SmallImages property.


TListColumn.MaxWidth

TListColumn	See also

Specifies the maximum column width.

type TWidth = ColumnHeaderWidth..MaxInt;

property MaxWidth: TWidth;

Description

Use MaxWidth to get or set the maximum column width.


TListColumn.MinWidth

TListColumn	See also

Specifies the mininum column width.

type TWidth = ColumnHeaderWidth..MaxInt;

property MinWidth: TWidth;

Description

Use MinWidth to get or set the minimum column width.


TListColumn.Tag

TListColumn

Stores an arbitrary integer value with the column.

property Tag: Integer;

Description

Tag has no predefined meaning. The Tag property is provided for the convenience of developers. It can be used for storing an additional integer value or it can be typecast to any 32-bit value such as a component reference or a pointer.


TListColumn.Width

TListColumn	See also

Specifies the width of the column.

type TWidth = ColumnHeaderWidth..MaxInt;

property Width: TWidth;Description

Use Width to specify the width of the list column, in pixels. If Width is assigned the value -1, the list column is automatically resized to accommodate the text in the column. If Width is assigned the value -2, the list column is automatically resized to accommodate the column header (that is, the text in the Caption property). For more readable code, use the global ColumnTextWidth and ColumnHeaderWidth constants when assigning negative values to Width:

Constant	Value	Meaning

ColumnTextWidth	-1	Column is resized to fit text of items.

ColumnHeaderWidth	-2	Column is resized to fit header only.

For example, the following statement causes the leftmost column of ListView1 to be resized automatically to accommodate its text:

ListView1.Columns[0].Width := ColumnTextWidth;

In the form designer, the same thing can be accomplished by opening the Columns editor for ListView1, selecting the first list column, and typing -1 next to Width in the Object Inspector.

When a column is automatically resized, the value of Width changes to indicate the actual column width. The read-only WidthType property, however, retains its value of -1 or -2.


TListColumn.WidthType

TListColumn	See also

Indicates whether the column is sized automatically.

type TWidth = ColumnHeaderWidth..MaxInt;

property WidthType: TWidth;

Description

The read-only WidthType property indicates how the column width is determined. WidthType is set to the same value as Width. WidthType, however, retains its negative value when Width changes automatically.

If WidthType returns -1, the list column is automatically resized to accommodate the text in the column. If WidthType returns -2, the list column is automatically resized to accommodate the column header. If WidthType returns a nonnegative value, the column is not resized automatically; in this case, the value of Width and WidthType should be the same.

To enable automatic column resizing, assign the value -1 or -2 directly to Width.


TListColumn methods

TListColumn	Alphabetically

In TListColumn

Assign

Create

Destroy

Derived from CollectionItem

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TListColumn methods

TListColumn	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TListColumn.Assign

TListColumn	See also

Copies the properties of the source list-column.

procedure Assign(Source: TPersistent); override;

Description

Use Assign to copy the display attributes of another list column. Assign sets the Alignment, Width, and Caption values to match the source object. If the Source parameter is not a list column, Assign calls the inherited method to allow assignment from any object that can copy to a list column in its AssignTo method.


TListColumn.Create

TListColumn	See also

Creates and initializes a list column.

constructor Create(Collection: TCollection); override;

Description

Description

Do not call Create to create an instance of TListColumn at runtime. Columns added to list view objects at design time are created automatically. At runtime, create list columns indirectly using the Add method of the TListColumns object.

The Collection parameter specifies the TListColumns object that represents the list columns for the list view that uses this column. Create initializes the Alignment property to taLeftJustify and the Width property to 50.


TListColumn.Destroy

TListColumn 	See also

Destroys the list column and frees its memory.

destructor Destroy; override;

Description

Do not call Destroy. TListColumn objects are destroyed by the TListColumns object that contains them.

Destroy eliminates the TListColumn instance and, if necessary, deletes the column from the list-view control.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem


TListColumns

Hierarchy	Properties	Methods	See also

TListColumns is a collection of TListColumn objects.

Unit

comctrls

Description

Each TListColumns represents a collection of TListColumn objects in a TListView. At design time, use the list-view control’s Columns editor to add, remove, or modify columns.


TListColumns properties

TListColumns	Alphabetically	Legend

In TListColumns

Items

Owner

Derived from TCollection

Count

ItemClass


TListColumns properties

TListColumns	By object	Legend

Count

ItemClass

Items

Owner


TListColumns.Items

TListColumns	See also

Lists the columns in the collection.

property Items[Index: Integer]: TListColumn; default;

Description

Use Items to directly access the list column objects in the collection. The value of the Index parameter corresponds to the Index property of TListColumn. It represents the position of the column in the list view.


TListColumns.Owner

TListColumns	See also

Specifies the list-view control to which the TListColumns instance belongs.

property Owner: TCustomListView;

Description

The read-only Owner property indicates which list-view control uses the TListColumns object to implement its Columns property.


TListColumns methods

TListColumns	Alphabetically

In TListColumns

Add

Create

Derived from TCollection

Assign

BeginUpdate

Clear

Delete

Destroy

EndUpdate

FindItemID

GetNamePath

Insert

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TListColumns methods

TListColumns	By object

Add

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

FindItemID

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TListColumns.Add

TListColumns	See also 	Example

Creates a new TListColumn instance and adds it to the Items array.

function Add: TListColumn;

Description

Call Add to add a new list column to the end of the items array. Add returns the new list column. At design time, use the list-view control’s Columns editor to add columns to the list view.


TListColumns.Create

TListColumns	See also

Creates and initializes a TListColumns object.

constructor Create(AOwner: TCustomListView);

Description

Applications should not need to call the Create method directly. Instances of TListView create the TListColumns object from their own constructors. The AOwner parameter is the TListVew instance that uses the TListColumns object to implement its Columns property.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


TListItems

Hierarchy	Properties	Methods	See also

TListItems maintains the list of items that appear in a list view control.

Unit

comctrls

Description

Use the properties and methods of TListItems to manipulate the list of items displayed by a list view control. TListItems only lists the main items in the list view. Subitems are specified using a property of the individual TListItem objects.


TListItems properties

TListItems	Alphabetically	Legend

In TListItems

Count

Handle

Item

Owner


TListItems properties

TListItems	By object	Legend

Count

Handle

Item

Owner


TListItems.Count

TListItems	See also

Indicates the number of items in the Item property array.

property Count: Integer;

Description

Use Count to determine the number of items displayed by the list view. Count provides an upper bound when iterating through the individual TListItem objects in the Item property array.

Set the Count when the list view's OwnerData property is False to make the control allocate its internal data structures for the specified number of items. This prevents the control from having to allocate the data structures every time an item is added.

Set the Count when the list view's OwnerData property is True to set the virtual number of items that the control contains.


TListItems.Handle

TListItems	See also

Specifies the window handle for the list view that displays the items managed by TListItems.

property Handle; HWND;

Description

Use Handle as a parameter when making Windows API function calls that require a handle to the list view.


TListItems.Item

TListItems	See also

Lists all list items managed by the TListItems object.

property Item[Index: Integer]: TListItem;

Description

Use Item to directly access a list item, given its position in the list view. The first item has an index of 0, the second an index of 1, and so on.


TListItems.Owner

TListItems	See also

Indicates the list view object that uses the list items object to manage its items.

property Owner: TCustomListView;

Description

Use Owner to access the list view object that uses this TListItems object to implement its Items property.


TListItems methods

TListItems	Alphabetically

In TListItems

Add

Assign

BeginUpdate

Clear

Create

Delete

Destroy

EndUpdate

IndexOf

Insert

SetCount

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TListItems methods

TListItems	By object

Add

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

IndexOf

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

SetCount


TListItemsAdd
TListItems.Add

TListItems	See also 	Example

Creates a new list item and adds it to the list view control.

function Add: TListItem;

Description

Call Add to add a new list item to the end of the list. Add returns the newly created TListItem object.

To create an item and insert it into the beginning or middle of the list, use the Insert method instead.


TListItems.Assign

TListItems	See also

Copies the list of list items from another TListItems object.

procedure Assign(Source: TPersistent); override;

Description

Call Assign to copy the list of items from another object. If the Source parameter specifies another TListItems object, Assign discards the current value of Item and rebuilds the list by copying the items maintained by Source. If Source is any other type of object, Assign calls the inherited method, which will copy the list from any object that specifies how to copy to a TListItems object in its AssignTo method.


TListItems.BeginUpdate

TListItems	See also

Prevents updating of the list view until the EndUpdate method is called.

procedure BeginUpdate;

Description

Call BeginUpdate before making multiple changes to the list of items. When all changes are complete, call EndUpdate so that the changes can be reflected on screen. BeginUpdate and EndUpdate prevent excessive redraws and speed processing time when new items are added, deleted, or inserted.


TListItems.Clear

TListItems	See also

Removes all items from the list.

procedure Clear;

Description

Call Clear to empty the list view of all items. Clear frees all memory associated with the list items and updates the image of the list view.


TListItems.Create

TListItems	See also

Creates an instance of TListItems.

constructor Create(AOwner: TCustomListView);

Description

Call Create to instantiate a TListItems object at runtime. The TListItems object used by TListView to implement its Items property is created automatically from the constructor of the list view.


TListItems.Delete

TListItems	See also

Deletes a specified item and updates the list view accordingly.

procedure Delete(Index: Integer);

Description

The Delete method deletes the item in the list view specified with the Index parameter. The first item has an index of 0, the second item has an index of 1, and so on.


TListItems.Destroy

TListItems	See also

Destroys an instance of TListItems.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead, call Free, which verifies that the TListItems reference is not nil before calling Destroy.

Destroy frees the list before calling the inherited destructor.


TListItems.EndUpdate

TListItems	See also

Reenables screen repainting that was turned off with the BeginUpdate method.

procedure EndUpdate;

Description

Call EndUpdate after completing changes to the list that were begun with a call to the BeginUpdate method. When every call to BeginUpdate is matched by a subsequent call to EndUpdate, the list view image updates to reflect all changes that occurred while repaints were disabled.


TListItems.IndexOf

TListItems	See also

Returns the position of a list item in the list view window.

function IndexOf(Value: TListItem): Integer;

Description

Call IndexOf to determine the position of the list item specified by the Value parameter. IndexOf returns -1 if the list item is not in the list view.


TListItems.Insert

TListItems	See also 	Example

Creates a new list item and inserts it into the list view.

function Insert(Index: Integer): TListItem;

Description

Call Insert to insert a new TListItem object into the list view after the item specified by the Index parameter. Insert returns the list item that is inserted.


TListItems.SetCount

TListItems

Sets the number of list items.

procedure SetCount(Value: Integer);

Description

Call SetCount to set the number of list items.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TListSourceLink

Hierarchy	Properties	Methods	See also

TListSourceLink helps manage the link to the ListSource of a TDBLookupControl object.

Unit

dbctrls

Description

TListSourceLink is tailored to work with TDBLookupControl. It should only be used by the TDBLookupControl class.


TListSourceLink properties

TListSourceLink	Alphabetically	Legend

Derived from TDataLink

Active

ActiveRecord

BOF

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

Eof

ReadOnly

RecordCount


TListSourceLink properties

TListSourceLink	By object	Legend

Active

ActiveRecord

BOF

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

Eof

ReadOnly

RecordCount


TListSourceLink methods

TListSourceLink	Alphabetically	Legend

In TListSourceLink

ActiveChanged

Create

DataSetChanged

Derived from TDataLink

Destroy

Edit

ExecuteAction

UpdateAction

UpdateRecord

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TListSourceLink methods

TListSourceLink	By object	Legend

ActiveChanged

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DataSetChanged

DefaultHandler

Destroy

Dispatch

Edit

ExecuteAction

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

UpdateAction

UpdateRecord


TListSourceLink.ActiveChanged

TListSourceLink	See also

Informs the TDBLookupControl of changes to the Active property of the dataset that it maintains for the ListSource.

procedure ActiveChanged; override;

Description

Applications should not call the ActiveChanged procedure directly. Changes in the Active property of the dataset trigger this procedure. ActiveChanged causes the TDBLookupControl to reacquire its lookup list.


TListSourceLink.Create

TListSourceLink	See also

Creates an instance of TDataSourceLink.

constructor Create;

Description

Create is called from the constructor of any TlookupControl descendant object that uses a TListSourceLink to implement its ListSource property.

Create calls the inherited Create method and then sets VisualControl to True.


TListSourceLink.DataSetChanged

TListSourceLink	See also

Informs the TDBLookupControl of changes to the current record of the dataset that the TDBLookupControl uses to populate its list.

procedure DataSetChanged; override;

Description

Applications should not call the DataSetChanged procedure directly. These calls are triggered automatically by the dataset. DataSetChanged informs the TListSourceLink of dataset changes so that it can move to the appropriate record in the dataset.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink


 TMainMenu

Hierarchy	Properties	Methods	Events	See also

TMainMenu encapsulates a menu bar and its accompanying drop-down menus for a form.

Unit

menus

Description

Use TMainMenu to provide the main menu for a form. To begin designing a menu, add a main menu to a form, and double-click the component.

TMainMenu introduces properties and methods for merging the drop-down menus of the main menu with the main menu of another form, and for assisting in the menu negotiation process of an OLE container.


TMainMenu properties

TMainMenu	Alphabetically	Legend

In TMainMenu

AutoMerge

Handle

Derived from TMenu

AutoHotkeys

AutoLineReduction

BiDiMode

Images

Items

OwnerDraw

ParentBiDiMode

WindowHandle

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TMainMenu properties

TMainMenu	By object	Legend

AutoHotkeys

AutoLineReduction

AutoMerge

BiDiMode

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Handle

Images

Items

Name

Owner

OwnerDraw

ParentBiDiMode

Tag

VCLComObject

WindowHandle


TMainMenu.AutoMerge

TMainMenu	See also

Determines if the main menus of secondary forms merge with the main menu of the main form in non-MDI applications at runtime.

property AutoMerge: Boolean;

Description

To merge a form's menus with the main menu in the main form, set the AutoMerge property of each main menu you want merged to True. Make sure that the AutoMerge property of the main menu of the main form (the one other menus are merged into) remains False. How menus merge depends on the value of the GroupIndex property for each menu item.

If the application is an MDI application (the FormStyle properties are set so the main form is a parent form and subsequent forms are child forms), menu merging occurs automatically without using the AutoMerge property.


TMainMenu.Handle

TMainMenu	See also

Provides access to the menu’s window handle.

property Handle: HMENU;

Description

Use the Handle property to call a Windows API function that requires a Windows menu handle.

For example, the following line uses the Windows API function HiliteMenuItem to highlight the first menu item in MainMenu1 on Form1.

HiliteMenuItem(Form1.Handle, MainMenu1.Handle, 0, MF_BYPOSITION+MF_HILITE);

If the menu has an associated OLE menu handle, Handle is the OLE2 menu handle. Otherwise, Handle is the Windows menu handle for the menu that contains exactly the elements described in the Items property.


TMainMenu events

TMainMenu	Alphabetically	Legend

Derived from TMenu

OnChange


TMainMenu events

TMainMenu	Alphabetically	Legend

OnChange


TMainMenu methods

TMainMenu	Alphabetically

In TMainMenu

GetOle2AcceleratorTable

Merge

PopulateOle2Menu

SetOle2MenuHandle

Unmerge

Derived from TMenu

Create

Destroy

DispatchCommand

DispatchPopup

FindItem

GetHelpContext

IsShortCut

ProcessMenuChar

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMainMenu methods

TMainMenu	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DispatchCommand

DispatchPopup

FieldAddress

FindComponent

FindItem

Free

FreeInstance

FreeNotification

FreeOnRelease

GetHelpContext

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetOle2AcceleratorTable

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsShortCut

Merge

MethodAddress

MethodName

NewInstance

PopulateOle2Menu

ProcessMenuChar

RemoveComponent

SafeCallException

SetOle2MenuHandle

Unmerge


TMainMenu.GetOle2AcceleratorTable

TMainMenu	See also

Returns the main menu’s accelerator table.

procedure GetOle2AcceleratorTable(var AccelTable: HAccel; var AccelCount: Integer; Groups: array of Integer);

Description

Call GetOle2AcceleratorTable to obtain a handle to an accelerator table for all menu items with a GroupIndex value that appears in the Groups parameter. The AccelTable parameter is set to the accelerator table handle, and the AccelCount is set to the number of entries in the table. GetOle2AccleratorTable is used by OLE containers when merging menus.


TMainMenu.Merge

TMainMenu	See also

Combines the main menu of one form with the main menu of another in non-MDI applications.

procedure Merge(Menu: TMainMenu);

Description

Call Merge to merge another main menu with this one. Specify the menu you want merged with this menu as the Menu parameter.

For example, to use the main menu of the first form in an application as the main menu for the application, call Merge to merge the main menu of any additional forms in the application with the main menu of the first form.

Depending on the value of the GroupIndex property of menu items on the main menu, the merged menu items can replace menu items on the menu bar, or insert menu items into the menu bar. See GroupIndex for information on how to do these things.

To merge and unmerge main menus automatically when other forms are displayed, change the value of the AutoMerge property to True on all forms whose menus should be merged in.


TMainMenu.PopulateOle2Menu

TMainMenu	See also

Populates an OLE menu with items from the main menu.

procedure PopulateOle2Menu(SharedMenu: HMenu; Groups: array of Integer; var Widths: array of Longint);

Description

Call PopulateOle2Menu to merge the menu items with GroupIndex values specified by the Groups parameter into the menu that uses the SharedMenu handle. PopulateOle2Menu appends all menu items in the specified groups to the menu, and increments the corresponding entries in the Widths array for every menu item appended. PopulateOle2Menu is used by OLE containers when merging menus.

Note:	PopulateOle2Menu populates the menu specified by the SharedMenu parameter but does not set this as the OLE menu associated with the menu.


TMainMenu.SetOle2MenuHandle

TMainMenu	See also

Associates the handle for an OLE menu with the main menu.

procedure SetOle2MenuHandle(Handle: HMENU);

Description

Call SetOle2MenuHandle to temporarily replace the menu of a form with the menu represented by the Handle parameter. To restore the original menu, call SetOle2MenuHandle with the Handle parameter set to 0. SetOle2MenuHandle allows an OLE container to use menu items provided by an OLE server.


TMainMenu.Unmerge

TMainMenu	See also

Reverses the merging of two menus in a non-MDI application.

procedure Unmerge(Menu: TMainMenu);

Description

Call Unmerge to remove items from another main menu that were added using the Merge method. The Menu parameter is the merged menu whose items should be removed from the main menu.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TMenu


 TMaskEdit

Hierarchy	Properties	Methods	Events	See also

TMaskEdit implements a generic masked edit control.

Unit

mask

Description

Use a TMaskEdit object to put a masked edit control on your form. Masked edit controls validate the text the user enters against a mask that encodes the valid forms the text can take. The mask can also format text that is displayed to the user.

TMaskEdit implements the generic behavior introduced in TCustomMaskEdit. TMaskEdit publishes many of the properties and methods inherited from TCustomMaskEdit, but does not introduce any new behavior.


TMaskEdit properties

TMaskEdit	Alphabetically	Legend

Derived from TCustomMaskEdit

EditMask

EditText

IsMasked

MaxLength

Text

Derived from TCustomEdit

AutoSelect

AutoSize

BorderStyle

CanUndo

CharCase

Modified

PasswordChar

ReadOnly

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Font

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TMaskEdit properties

TMaskEdit	By object	Legend

Action

Align

Anchors

AutoSelect

AutoSize

BiDiMode

BorderStyle

BoundsRect

Brush

CanUndo

CharCase

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

EditMask

EditText

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

ImeMode

ImeName

IsMasked

Left

LRDockWidth

MaxLength

Modified

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PasswordChar

PopupMenu

ReadOnly

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Text

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TMaskEdit events

TMaskEdit	Alphabetically	Legend

Derived from TCustomEdit

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TMaskEdit events

TMaskEdit	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TMaskEdit methods

TMaskEdit	Alphabetically

Derived from TCustomMaskEdit

Clear

Create

GetTextLen

ValidateEdit

Derived from TCustomEdit

ClearSelection

ClearUndo

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Undo

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMaskEdit methods

TMaskEdit	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClearSelection

ClearUndo

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

Create

CreateParented

CreateParentedControl

CutToClipboard

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

Undo

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

ValidateEdit


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMaskEdit


 TMediaPlayer

Hierarchy	Properties	Methods	Events

TMediaPlayer controls devices that provide a Media Control Interface (MCI) driver.

Unit

mplayer

Description

The TMediaPlayer component includes a set of buttons (Play, Stop, Eject, and so on) that control a multimedia device such as a CD-ROM drive, MIDI sequencer, or VCR. A multimedia device may be hardware or software.

The media player component contains of multiple buttons. These buttons can be clicked with the mouse, but are not separate objects or button components.

Button	Value	Action

Play	btPlay	Plays the media player

Pause	btPause	Pauses playing or recording. If already paused when clicked, resumes playing or recording.

Stop	btStop	Stops playing or recording

Next	btNext	Skips to the next track, or to the end if the medium doesn’t use tracks

Prev	btPrev	Skips to the previous track, or to the beginning if the medium doesn’t use tracks

Step	btStep	Moves forward a number of frames

Back	btBack	Moves backward a number of frames

Record	btRecord	Starts recording

Eject	btEject	Ejects the medium

The multimedia device is played, paused, stopped, and so on when the user clicks the corresponding button on the TMediaPlayer component. The device can also be controlled by the control methods that correspond to the buttons (Play, Pause, Stop, Next, Previous, Step, Back, StartRecording, and Eject).

The type of multimedia device (such as dtWaveAudio or dtVideodisc) is specified by the DeviceType property. If the device stores its media in a file, the name of the media file is specified by the FileName property. If DeviceType is dtAutoSelect, the media player attempts to determine the type of device from the extension of the file specified by FileName.

To have the media player attempt to open the device specified by DeviceType automatically when the media player component is created at runtime, set the AutoOpen property to True.


TMediaPlayer properties

TMediaPlayer	Alphabetically	Legend

In TMediaPlayer

AutoEnable

AutoOpen

AutoRewind

Capabilities

ColoredButtons

DeviceID

DeviceType

Display

DisplayRect

EnabledButtons

EndPos

Error

ErrorMessage

FileName

Frames

Length

Mode

Notify

NotifyValue

Position

Shareable

Start

StartPos

TimeFormat

TrackLength

TrackPosition

Tracks

VisibleButtons

Wait

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TMediaPlayer properties

TMediaPlayer	By object	Legend

Action

Align

Anchors

AutoEnable

AutoOpen

AutoRewind

BiDiMode

BoundsRect

Brush

Capabilities

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ColoredButtons

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DeviceID

DeviceType

Display

DisplayRect

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

EnabledButtons

EndPos

Error

ErrorMessage

FileName

Floating

FloatingDockSiteClass

Frames

Handle

Height

HelpContext

Hint

HostDockSite

Left

Length

LRDockWidth

Mode

Name

Notify

NotifyValue

Owner

Parent

ParentShowHint

ParentWindow

PopupMenu

Position

Shareable

ShowHint

Showing

Start

StartPos

TabOrder

TabStop

Tag

TBDockHeight

TimeFormat

Top

TrackLength

TrackPosition

Tracks

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleButtons

VisibleDockClientCount

Wait

Width

WindowProc


TMediaPlayer.AutoEnable

TMediaPlayer	See also 	Example

Determines whether the media player automatically enables and disables individual buttons in the component.

property AutoEnable: Boolean;

Description

Use AutoEnable to automatically enable or disable the control buttons on the media player. If AutoEnable is True, the media player automatically enables or disables its control buttons. The media player determines which buttons to enable or disable by the current mode specified in the Mode property, and the current multimedia device type specified in the DeviceType property.

AutoEnable overrides the EnabledButtons property. The buttons enabled or disabled automatically by the media player supersede any buttons enabled or disabled with EnabledButtons.

If AutoEnable is False, the media player does not enable or disable buttons. The buttons must enabled or disabled with the EnabledButtons property.

The following table shows whether buttons are automatically enabled or disabled for each device mode:

Button	Play	Record	Pause	Stop	Not Open
Back	Enabled	Enabled	Enabled	Enabled	Disabled
Eject	Enabled	Enabled	Enabled	Enabled	Disabled
Next	Enabled	Enabled	Enabled	Enabled	Disabled
Pause	Enabled	Enabled	Enabled	Disabled	Disabled
Play	Disabled	Disabled	Enabled	Enabled	Disabled
Prev	Enabled	Enabled	Enabled	Enabled	Disabled
Record	Disabled	Disabled	Enabled	Enabled	Disabled
Step	Enabled	Enabled	Enabled	Enabled	Disabled
Stop	Enabled	Enabled	Disabled	Disabled	Disabled


TMediaPlayer.AutoOpen

TMediaPlayer	See also

Determines if the media player is opened automatically when the application is run.

property AutoOpen: Boolean;

Description

Use AutoOpen to have the media player automatically open at runtime.

If AutoOpen is True, the media player attempts to open the multimedia device specified by the DeviceType property (or FileName if DeviceType is dtAutoSelect) when the form containing the media player component is created at runtime.

If AutoOpen is False, the device must be opened with a call to the Open method.

If an error occurs when opening the device, an exception of type EMCIDeviceError exception is raised that contains the error message. Upon completion, a numerical error code is stored in the Error property, and the corresponding error message is stored in the ErrorMessage property.

The Wait property determines whether control is returned to the application before opening the multimedia device. The Notify property determines whether opening the device generates an OnNotify event.


TMediaPlayer.AutoRewind

TMediaPlayer	See also 	Example

Determines if the media player control rewinds before playing or recording.

property AutoRewind: Boolean;

Description

If AutoRewind is True and the current position is at the end of the medium, Play or StartRecording moves the current position to the beginning of the medium before playing or recording. If AutoRewind is False, the user must click the Prev button or write code to call Previous to move to the beginning.

If values have been assigned to StartPos or EndPos or if the multimedia device uses tracks, AutoRewind has no effect on playing or recording. When calling Play or StartRecording, the current position remains at the end of the medium.


TMediaPlayer.Capabilities

TMediaPlayer	See also 	Example

Determines the capabilities of the open multimedia device.

type

  TMPDevCaps = (mpCanStep, mpCanEject, mpCanPlay, mpCanRecord, mpUsesWindow);

  TMPDevCapsSet = set of TMPDevCaps;

property Capabilities: TMPDevCapsSet;

Description

The various capabilities specified in Capabilities are determined when the device is opened with the Open method. The following table lists the capabilities a device can have:

Value	Capability

mpCanEject	Can eject media

mpCanPlay	Can play media

mpCanRecord	Can record media

mpCanStep	Can step forward or backward within media

mpUsesWindow	Uses a window for displaying output

Note:	Currently, there is no way to check whether a device can step forward or backward. Capabilities includes mpCanStep only if the device type (specified in the DeviceType property) is Animation, AVI Video, Digital Video, Overlay, or VCR.


TMediaPlayer.ColoredButtons

TMediaPlayer	See also

Determines which buttons on the media player control have color.

property ColoredButtons: TButtonSet;

Description

ColoredButtons controls which buttons on the media player are colored.

If a button is not colored with ColoredButtons, it appears in black-and-white when visible. All media player control buttons are colored by default.


TMediaPlayer.DeviceID

TMediaPlayer	See also

Specifies the device ID for the currently open multimedia device.

property DeviceID: Word;

Description

The value of DeviceID is determined when a device is opened with the Open method. If no device is open, DeviceID is 0.


TMediaPlayer.DeviceType

TMediaPlayer	See also 	Example

Specifies a multimedia device type to open the media player.

type TMPDeviceTypes = (dtAutoSelect, dtAVIVideo, dtCDAudio, dtDAT, dtDigitalVideo, dtMMMovie, dtOther, dtOverlay, dtScanner, dtSequencer, dtVCR, dtVideodisc, dtWaveAudio);

property DeviceType: TMPDeviceTypes;

Description

DeviceType specifies a multimedia device type to open with the Open method.

TMPDeviceTypes type contains the multimedia device types that can be opened by a TMediaPlayer component. The valid values for TMPDeviceTypes are dtAutoSelect, dtAVIVideo, dtCDAudio, dtDAT, dtDigitalVideo, dtMMMovie, dtOther, dtOverlay, dtScanner, dtSequencer, dtVCR, dtVideodisc, or dtWaveAudio. The default is dtAutoSelect.

If DeviceType is dtAutoSelect, the device type is determined by the file extension specified in the FileName property. If no device type is associated with the extension, the correct device type must be explicitly specified by setting DeviceType to a value other than dtAutoSelect.

A multimedia device is typically associated with an appropriate file name extension when the device is installed. Associations are specified in the registry or SYSTEM.INI file. See the documentation for the specific device for instructions about how to associate file name extensions with the device.


TMediaPlayer.Display

TMediaPlayer 	See also	Example

Specifies the display window for an multimedia device that uses a window for output.

property Display: TWinControl;

Description

To use Display, assign the name of a windowed control such as a form or panel to Display to display output in that control.

The default value of Display is nil, meaning that the device creates its own window to display output. Also, by freeing the control assigned to Display after the device has been opened, video output will be in its own default window.

Examples of multimedia devices that use a window to display output are Animation, AVI Video, Digital Video, Overlay, and VCR.


TMediaPlayer.DisplayRect

TMediaPlayer	See also

Specifies a rectangular area in the control specified by the Display property that is used to display output from a multimedia device.

property DisplayRect: TRect;

Description

To display output in a specific rectangle area on a form assign a TRect record to DisplayRect. The Rect function can be used to create a TRect record.

Media that use a rectangle to display output usually perform best if the default DisplayRect size is used. To set DisplayRect to the default size, position the rectangle in the upper left corner and use 0, 0 for the lower right corner.

DisplayRect is ignored if Display is nil.

Examples of multimedia devices that use a window to display output are Animation, AVI Video, Digital Video, Overlay, and VCR.

Note:	DisplayRect can be set only after the media device is opened.


TMediaPlayer.EnabledButtons

TMediaPlayer	See also 	Example

Determines which buttons on the media player are usable.

property EnabledButtons: TButtonSet;

Description

EnabledButtons controls which buttons on the media player are enabled and usable.

An enabled button is colored and usable. A disabled button is dimmed and not usable. If a button is not enabled with EnabledButtons, it is disabled. By default, all buttons are enabled.

If the AutoEnable property is True, AutoEnable supersedes EnabledButtons. The buttons automatically enabled or disabled by the media player override any buttons enabled or disabled with the EnabledButtons property.


TMediaPlayer.EndPos

TMediaPlayer	See also 	Example

Specifies the position within the currently loaded medium at which to stop playing or recording.

property EndPos: Longint;

Description

EndPos is specified using the current time format, which is specified in the TimeFormat property.

The EndPos property affects only the next Play or StartRecording method called after setting EndPos. Reset EndPos to affect any subsequent calls to Play or StartRecording.


TMediaPlayer.Error

TMediaPlayer	See also 	Example

Specifies the MCI error code returned by the media control method.

property Error: Longint;

Description

Error specifies the MCI error code returned by the most recent media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, StartRecording, Resume, Rewind, Step, or Stop). The ErrorMessage property describes the Error.

The error code returned by media control methods are the same error code returned by the mciSendCommand function. The message describing the error code is stored in the ErrorMessage property.

The value of Error is zero if the most recent media control method didn't cause an error. If a method results in an error, a value other than zero is stored in Error. If the error occurs during the opening of the device, an EMCIDeviceError exception occurs.


TMediaPlayer.ErrorMessage

TMediaPlayer	See also 	Example

Describes the error code stored in the Error property.

property ErrorMessage: string;

Description

ErrorMessage specifies the error message that describes the error code returned from the most recent media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, StartRecording, Resume, Rewind, Step, or Stop).

The error code described by the message is stored in the Error property.


TMediaPlayer.FileName

TMediaPlayer	See also 	Example

Specifies the opened or saved media file.

property FileName: string;

Description

FileName specifies the media file to be opened by the Open method, or the file to save by the Save method.

At design time, use a file open dialog box to specify the FileName property by clicking the ellipses button (...) in the Object Inspector.


TMediaPlayer.Frames

TMediaPlayer	See also

Specifies the number of frames moved forward or backward.

property Frames: Longint;

Description

Frames specifies the number of frames the Step method steps forward or the Back method steps backward. Frames defaults to ten percent of the length of the currently loaded medium, which is specified by the Length property.

The definition of a frame varies by multimedia device. For display media, a frame is one still image.


TMediaPlayer.Length

TMediaPlayer	See also 	Example

Specifies the length of the medium in the open multimedia device.

property Length: Longint;

Description

Length is specified using the current time format, which is specified by the TimeFormat property.


TMediaPlayer.Mode

TMediaPlayer 	See also Example

Indicates the state of the currently open multimedia device.

type TMPModes = (mpNotReady, mpStopped, mpPlaying, mpRecording, mpSeeking, mpPaused, mpOpen);

property Mode: TMPModes;

Description

Mode specifies the current state or mode of the currently open multimedia device.

The TMPModes type defines the modes for a multimedia device used with a TMediaPlayer.

The following table lists the possible values for of the TMPModes type:

Value	Mode

mpNotReady	Not ready

mpStopped	Stopped

mpPlaying	Playing

mpRecording	Recording

mpSeeking	Seeking

mpPaused	Paused

mpOpen	Open


TMediaPlayer.Notify

TMediaPlayer	See also	Example

Determines whether an OnNotify event is generated.

property Notify: Boolean;

Description

Notify determines whether the next call to a media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, StartRecording, Resume, Rewind, Step, or Stop) generates an OnNotify event when the method has completed.

If Notify is True, the next media control method generates OnNotify event upon completion and stores the notification message in the NotifyValue property. If Notify is False, the method does not generate an OnNotify event and NotifyValue remains unchanged.

Notify affects only the next call to a media control method. After an OnNotify event, Notify must be reset to affect any subsequent media control methods.

By default, Play and StartRecording function as if Notify is True. Set Notify to False before calling Play or StartRecording to prevent an OnNotify event from being generated when playing or recording has finished. By default, all other media control methods function as if Notify is False.

Tip:	Set Notify to True if the next media control is expected to take a long time, so the application is notified when the media control method has completed. If Notify is set to True, it is recommended to set Wait to False so that control returns to the application before the media control method is finished.

Note:	When trying to resume a device that doesn't support Resume, the device is resumed as if the Play method was called. If Notify was assigned True before calling Resume (or any other media control method), Notify doesn't affect the call to Resume. Resume does not generate an OnNotify event upon completion, and NotifyValue remains unchanged.


TMediaPlayer.NotifyValue

TMediaPlayer 	See also Example

Indicates the result of the last media control method that requested a notification.

type TMPNotifyValues = (nvSuccessful, nvSuperseded, nvAborted, nvFailure);

property NotifyValue: TMPNotifyValues;

Description

NotifyValue reports the result of the last media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, StartRecording, Resume, Rewind, Step, or Stop) that requested a notification.

To request notification, set Notify to True before calling a media control method.

The TMPNotifyValues type defines the notification values for a multimedia device used with a TMediaPlayer. The possible values for the TMPNotifyValues type are as follows.

Value	Result

nvSuccessful	Command completed successfully

nvSuperseded	Command was superseded by another command

nvAborted	Command was aborted by the user

nvFailure	Command failed


TMediaPlayer.Position

TMediaPlayer	See also

Specifies the current position within the currently loaded medium.

property Position: Longint;

Description

The value of Position is specified according to the current time format, which is specified in the TimeFormat property.

Position defaults to the beginning of the medium. If the medium supports multiple tracks, Position defaults to the beginning of the first track.


TMediaPlayer.Shareable

TMediaPlayer	See also 	Example

Determines whether more than one application can share a multimedia device.

property Shareable: Boolean;

Description

If Shareable is False, no other components or applications can access the device. If Shareable is True, more than one component or application can access the device. Shareable defaults to False.

Be sure to set Shareable before opening a device.

Some devices are not shareable. If Shareable is set to True for a device that isn't shareable, the Open method fails and the error code is returned to the Error property.


TMediaPlayer.Start

TMediaPlayer	See also

Specifies the starting position within the currently loaded medium.

property Start: Longint;

Description

Start is the beginning of the medium for devices that don't use tracks, or the beginning of the first track for devices that use tracks. Start is defined when a multimedia device is opened with the Open method. Start is specified according to the current time format, which is stored in the TimeFormat property. Start is read-only at runtime and is unavailable at design time.


TMediaPlayer.StartPos

TMediaPlayer	See also

Specifies the position within the currently loaded medium from which to begin playing or recording.

property StartPos: Longint;

Description

StartPos is specified using the current time format, which is specified in the TimeFormat property.

The StartPos property affects only the next Play or StartRecording method called after setting StartPos. Reset must be set to StartPos to affect any subsequent calls to Play or StartRecording.

StartPos does not affect the current position of the medium (specified in the Position property) until the next Play or StartRecording method is called.


TMediaPlayer.TimeFormat

TMediaPlayer	See also 	Example

Determines the format used to specify position information.

type TMPTimeFormats = (tfMilliseconds, tfHMS, tfMSF, tfFrames, tfSMPTE24, tfSMPTE25, tfSMPTE30, tfSMPTE30Drop, tfBytes, tfSamples, tfTMSF);

property TimeFormat: TMPTimeFormats;

Description

TimeFormat determines how the StartPos, Length, Position, Start, and EndPos properties are interpreted. For example, if Position is 180 and TimeFormat is tfMilliseconds, the current position is 180 milliseconds into the medium. If Position is 180 and TimeFormat is tfMSF, the current position is 180 minutes into the medium.

Not all formats are supported by every device. When trying to set an unsupported format, the assignment is ignored.

The current timing information is always passed in a 4-byte integer. In some formats, the timing information returned is not really one integer, but single bytes of information packed in the long integer.

The TMPTimeFormats type defines the time formats for a multimedia device used with a TMediaPlayer. The following table lists the possible values for the TMPTimeFormats type:

Value	Time format

tfMilliseconds	Milliseconds are stored as a 4-byte integer variable.

tfHMS	Hours, minutes, and seconds packed into a 4-byte integer. From least significant to most significant byte, the data values are

  Hours (least significant byte)

  Minutes

  Seconds

  Unused (most significant byte)

tfMSF	Minutes, seconds, and frames packed into a 4-byte integer. From least significant to most significant byte, the data values are

  Minutes (least significant byte)

  Seconds

  Frames

  Unused (most significant byte)

tfFrames	Frames are stored as a 4-byte integer variable.

tfSMPTE24	24-frame SMPTE packs values in a 4-byte variable. From least significant to most significant byte, the data values are

  Hours (least significant byte)

  Minutes

  Seconds

  Frames (most significant byte)

SMPTE (Society of Motion Picture and Television Engineers) time is an absolute time format expressed in hours, minutes, seconds, and frames. The standard SMPTE division types are 24, 25, and 30 frames per second.

tfSMPTE25	25-frame SMPTE packs data into a 4-byte variable in the same order as 24-frame SMPTE.

tfSMPTE30	30-frame SMPTE packs data into the 4-byte variable in the same order as 24-frame SMPTE.

tfSMPTE30Drop	30-drop-frame SMPTE packs data into the 4-byte variable in the same order as 24-frame SMPTE.

tfBytes	Bytes are stored as a 4-byte integer variable.

tfSamples	Samples are stored as a 4-byte integer variable.

tfTMSF	Tracks, minutes, seconds, and frames are packed in the 4-byte variable. From least significant to most significant byte, the data values are

  Tracks (least significant byte)

  Minutes

  Seconds

  Frames (most significant byte)

Note that MCI uses continuous track numbering.

Note:	Functions provided with MCI to help decoding the 4-byte integer specified in a given time format are documented under MCI Macros for Encoding and Decoding Time Data in the MMSYSTEM.HLP Help file.


TMediaPlayer.TrackLength

TMediaPlayer	See also 	Example

Reports the length of the track.

property TrackLength[TrackNum: Integer]: Longint;

Description

TrackLength reports the length of the track specified by the TrackNum index.

The value of TrackLength is specified according to the current time format, which is specified in the TimeFormat property.


TMediaPlayer.TrackPosition

TMediaPlayer	See also

Reports the starting position of the track.

property TrackPosition[TrackNum: Integer]: Longint;

Description

TrackPosition reports the starting position of the track specified by the TrackNum index.

The value of TrackPosition is specified according to the current time format, which is specified in the TimeFormat property.


TMediaPlayer.Tracks

TMediaPlayer 	See also

Specifies the number of playable tracks on the open multimedia device.

property Tracks: Longint;

Description

Tracks indicates how many of playable tracks are available on the open multimedia device.

Tracks is undefined for devices that don't use tracks.


TMediaPlayer.VisibleButtons

TMediaPlayer	See also 	Example

Indicates which of the buttons on the media player are visible.

property VisibleButtons: TButtonSet;

Description

VisibleButtons determines which buttons on the media player that are visible. If a button is not made visible with VisibleButtons, it does not appear on the media player control. By default, all buttons are visible when a media player component is added to a form.


TMediaPlayer.Wait

TMediaPlayer 	See also	Example

Determines whether a media control method returns control to the application only after it has been completed.

property Wait: Boolean;

Description

Wait determines whether a media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, StartRecording, Resume, Rewind, Step, or Stop) returns control to the application only after it has been completed.

Wait is unavailable at design time.

If Wait is True, the media player component waits until the next media control method has completed before returning control to the application. If Wait is False, the application won't wait for the next media control method to finish before continuing.

Wait affects only the next media control method called after setting Wait. Wait must be reset to affect any subsequent call to a media control method.

By default, Play and StartRecording function as if Wait is False. Wait must be set to True before calling Play or StartRecording to prevent control from returning to the application before playing or recording has finished. By default, all other media control methods function as if Wait is True.

Note:	Wait is usually set to False only if the next media control is expected to take a long time, so that the application can execute other code before the media control method has completed. If Wait is set to False, you should set Notify to True so the application is notified when the media control method completes.


TMediaPlayer events

TMediaPlayer	Alphabetically	Legend

In TMediaPlayer

OnClick

OnNotify

OnPostClick

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnContextPopup


TMediaPlayer events

TMediaPlayer	By object	Legend

OnClick

OnContextPopup

OnEnter

OnExit

OnNotify

OnPostClick


TMediaPlayer.OnClick

TMediaPlayer	See also 	Example

Occurs when the user presses and releases the mouse button while the mouse pointer is over one of the control buttons, or when the user presses Spacebar while the media player control has focus.

type

  EMPNotify = procedure (Sender: TObject; Button: TMPBtnType; var DoDefault: Boolean) of object;

property OnClick: EMPNotify;

Description

When the media player control has focus and the Spacebar is pressed, the user can use the Left Arrow or Right Arrow keys to select which control button to click.

The EMPNotify type is a method pointer that is called when an OnClick event for a TMediaPlayer components occurs. The Button argument can be one of the following values: btBack, btEject, btNext, btPause, btPlay, btPrev, btRecord, btStep, or btStop.

The default value of the DoDefault argument is True. If DoDefault is True, the media player control calls the method that corresponds to the clicked button. For example, if the user clicks the Play button (btPlay), the Play method is called.

If DoDefault is False, the user must write code that executes when a media player control button is clicked in the OnClick event handler. The following table lists the default methods corresponding to the media player control buttons:

Control button	Button value	Method called

Play	btPlay	Play

Record	btRecord	StartRecording

Stop	btStop	Stop

Next	btNext	Next

Prev	btPrev	Previous

Step	btStep	Step

Back	btBack	Back

Pause	btPause	Pause

Eject	btEject	Eject


TMediaPlayer.OnNotify

TMediaPlayer	See also	Example

Occurs upon the completion of a media control method.

property OnNotify: TNotifyEvent;

Description

OnNotify occurs upon the completion of a media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, Resume, Rewind, StartRecording, Step, or Stop) when the Notify property is set to True before the call to the media control method. After an OnNotify event, the Notify property must be reset to True for the next OnNotify event to occur.


TMediaPlayer.OnPostClick

TMediaPlayer	See also

Occurs after the OnClick event handler is called.

type

  EMPPostNotify = procedure (Sender: TObject; Button: TMPBtnType) of object;

property OnPostClick: EMPPostNotify;

Description

OnPostClick is generated after the code of the OnClick event handler has been called. If Wait is True when the media player was clicked, OnPostClick won't be called until the completion of the OnClick code. If Wait is False, control can return to the application before completion of the OnClick code; therefore, the OnPostClick event may occur before the actions initiated by the OnClick event have completed.

For example, if the user clicks the Play button and the DoDefault parameter of the OnClick event handler for the media player is True, the media is played. If the media is long enough, it will still be playing when the OnPostClick event is generated if Wait is True. If Wait is False, however, OnPostClick won't occur until the media has finished playing.

The EMPPostNotify type is a method that is called when an OnPostClick event for a TMediaPlayer component occurs. The Button argument can be one of the following values: btBack, btEject, btNext, btPause, btPlay, btPrev, btRecord, btStep, or btStop.


TMediaPlayer methods

TMediaPlayer	Alphabetically	Legend

In TMediaPlayer

AutoButtonSet

Back

Click

Close

Create

Destroy

DoNotify

Eject

KeyDown

Loaded

MMNotify

Next

Notification

Open

Paint

Pause

PauseOnly

Play

PostClick

Previous

Resume

Rewind

Save

StartRecording

Step

Stop

Updated

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMediaPlayer methods

TMediaPlayer	By object	Legend

AfterConstruction

Assign

AutoButtonSet

Back

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Click

ClientToScreen

Close

ContainsControl

ControlAtPos

Create

CreateParented

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DoNotify

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

Eject

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

KeyDown

Loaded

ManualDock

ManualFloat

MethodAddress

MethodName

MMNotify

MouseWheelHandler

NewInstance

Next

Notification

Open

Paint

PaintTo

Pause

PauseOnly

Perform

Play

PostClick

Previous

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

Resume

Rewind

SafeCallException

Save

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

StartRecording

Step

Stop

Update

UpdateAction

UpdateControlState

Updated

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TMediaPlayer.AutoButtonSet

TMediaPlayer	See also

Enables or Disables the media player’s buttons.

procedure AutoButtonSet(Btn: TMPBtnType); dynamic;

Description

AutoButtonSet implements the automatic enabling and disabling of the media player's buttons when the AutoEnable property is True. The Btn parameter indicates which of the media player's buttons the user pressed.


TMediaPlayer.Back

TMediaPlayer	See also 	Example

Steps backward a number of frames (determined by the value of the Frames property) in the currently loaded medium.

procedure Back;

Description

Back is called when the Back button on the media player control is clicked at runtime.

Upon completion, Back stores a numerical error code in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Back method has been completed. The Notify property determines whether Back generates an OnNotify event.


TMediaPlayer.Click

TMediaPlayer	See also

Generates an OnClick event.

procedure Click(Button: TMPBtnType; var DoDefault: Boolean); reintroduce; dynamic;

Description

Click for media-player components is the implementation method for the OnClick event. By default, Click does nothing other than call any event handler attached to the media player's OnClick event.Click can be overriden in descendant classes to customize responses to clicks.


TMediaPlayer.Close

TMediaPlayer	See also 	Example

Closes the open multimedia device.

procedure Close;

Description

Upon completion, Close stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Close method is completed. The Notify property determines whether Close generates an OnNotify event.

Close is called automatically when the application is terminated.


TMediaPlayer.Create

TMediaPlayer	See also

Creates a media player object.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a media player at runtime. For media players created at design time, Create is called automatically.

Create allocates memory for a media player and calls the inherited Create. Then it loads the bitmaps for the media player’s buttons and intializes its properties, setting AutoEnable, AutoRewind, Colored, Enabled, and Visible to True, AutoOpen to False, and DeviceType to dtAutoSelect.


TMediaPlayer.Destroy

TMediaPlayer	See also

Destroys an instance of the media player.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Call Free instead. Free checks that the TMediaPlayer reference is not nil before it calls Destroy.

Destroy first verifies that no device is open, then destroys the bitmaps used for the media player’s buttons and calls the inherited Destroy.


TMediaPlayer.DoNotify

TMediaPlayer	See also

Generates an OnNotify event.

procedure DoNotify; dynamic;

Description

DoNotify is the implementation method for a media-player component's OnNotify event. The media player's MMNotify method calls DoNotify after correcting the enabling and disabling of buttons and setting internal flags from the values passed in the notification message parameters.

By default, DoNotify does nothing except call any event handler attached to the media player's OnNotify event. DoNotify can be overridden to provide other responses in addition to the inherited event-handler call.


TMediaPlayer.Eject

TMediaPlayer	See also 	Example

Releases the loaded medium from the open multimedia device.

procedure Eject;

Description

Eject is called when the Eject button on the media player control is clicked at runtime. It ejects the loaded medium from the open multimedia device.

Upon completion, Eject stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Eject method has been completed. The Notify property determines whether Eject generates an OnNotify event.


TMediaPlayer.KeyDown

TMediaPlayer	See also

Provides responses when the user types arrow keys or the space bar.

procedure KeyDown(var Key: Word; Shift: TShiftState); override;

Description

KeyDown overrides the inherited method to implement the media player’s response to certain keystrokes. It changes the current button when the user types the left or right arrow keys. When the user presses the space bar, KeyDown simulates a click on the current button.


TMediaPlayer.Loaded

TMediaPlayer	See also

Initializes the media player after it is loaded from a stream.

procedure Loaded; override;

Description

Loaded provides an opportunity for a component to initialize itself after all its parts have loaded from a stream. TMediaPlayer overrides the inherited method to implement the AutoOpen property.


TMediaPlayer.Next

TMediaPlayer	See also 	Example

Moves to the beginning of the next track of the currently loaded medium.

procedure Next;

Description

If the current position is at the last track when Next is called, Next makes the current position the beginning of the last track. If the multimedia device doesn't use tracks, Next goes to the end of the medium. Next is called when the Next button on the media player control is clicked at runtime.

Upon completion, Next stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Next method has completed. The Notify property determines whether Next generates an OnNotify event.


TMediaPlayer.MMNotify

TMediaPlayer	See also

Responds to a notification that the MCI device has completed an operation.

procedure MMNotify(var Message: TMessage); message MM_MCINOTIFY;

Description

MMNotify responds to a notification message from Windows that a multimedia command completed by updating button states if the AutoEnable property is True, setting internal flags to reflect the outcome of the command, then calling the DoNotify method to trigger the OnNotify event and any other special responses.


TMediaPlayer.Notification

TMediaPlayer	See also

Responds when components are about to be inserted or removed.

procedure Notification(AComponent: TComponent; Operation: TOperation); override;

Description

By default, components pass along the notification to their owned components, if any. Notification calls the inherited Notification and then, if the Display window is deleted at runtime, it sets the video display back to original window.


TMediaPlayer.Open

TMediaPlayer	See also 	Example

Opens a multimedia device.

procedure Open;

Description

Use Open to open a multimedia device. The multimedia device type must be specified in the DeviceType property before a device can be opened.

Upon completion, Open stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Open method is completed. The Notify property determines whether Open generates an OnNotify event.


TMediaPlayer.Paint

TMediaPlayer 	See also

Renders the image of the media player.

procedure Paint; override;

Description

When the media player component receives a WM_PAINT message, like other custom controls, it responds by initializing the control's canvas and calling Paint. Paint draws the frame and all visible buttons.

When creating a descendant media player class, Paint can be overriden to draw the image of the corresponding media player object.


TMediaPlayer.PostClick

TMediaPlayer	See also

Determines the action that takes place when an OnPostClick event occurs.

procedure PostClick(Button: TMPBtnType); dynamic;

Description

PostClick is the implementation method for the OnPostClick event. By default, PostClick does nothing other than call any event handler attached to the media player's OnPostClick event. PostClick can be overriden in descendant types to customize responses to clicks.


TMediaPlayer.Pause

TMediaPlayer	See also 	Example

Toggles the open multimedia device on or off.

procedure Pause;

Description

If the device is already paused when Pause is called, the device resumes playing or recording by calling the Resume method. Pause is called when the Pause button on the media player control is clicked at runtime.

Upon completion, Pause stores a numerical error code in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Pause method has completed. The Notify property determines whether Pause generates an OnNotify event.


TMediaPlayer.PauseOnly

TMediaPlayer	See also 	Example

Pauses the open multimedia device.

procedure PauseOnly;

Description

If the device is already paused when PauseOnly is called, the device will remain paused.

Upon completion, PauseOnly stores a numerical error code in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the PauseOnly method has completed. The Notify property determines whether PauseOnly generates an OnNotify event.


TMediaPlayer.Play

TMediaPlayer	See also 	Example

Plays the media loaded in the open multimedia device.

procedure Play;

Description

Play is called when the Play button on the media player control is clicked at runtime.

Upon completion, Play stores a numerical error code in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Play method has completed. The Notify property determines whether Play generates an OnNotify event.

If the StartPos property is set, playing starts at the position specified in StartPos. Otherwise, playing starts at the current position, specified in the Position property. Similarly, if the EndPos property is set, playing stops at the position specified in EndPos. Otherwise, playing stops at the end of the medium.

Whether the medium (specified in the Position property) is rewound before playing starts depends on the AutoRewind property.


TMediaPlayer.Previous

TMediaPlayer	See also 	Example

Sets the current position to the beginning of the previous track if the position was at the beginning of a track when Previous was called.

procedure Previous;

Description

If the position is at the first track or somewhere other than the beginning of a track when Previous was called, Previous sets the current position to the beginning of the current track. If the device doesn't use tracks, Previous sets the current position to the beginning of the medium, which is specified in the Start property. Previous is called when the Previous button on the media player control is clicked at runtime.

Upon completion, Previous stores a numerical error code in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Previous method has completed. The Notify property determines whether Previous generates an OnNotify event.


TMediaPlayer.Resume

TMediaPlayer	See also

Resumes playing or recording the currently paused multimedia device.

procedure Resume;

Description

Resume is called when the Pause button on the media player control is clicked at runtime, when the device is paused.

Upon completion, Resume stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Resume method has completed. The Notify property determines whether Resume generates an OnNotify event.


TMediaPlayer.Rewind

TMediaPlayer	See also 	Example

Sets the current position to the beginning of the the medium, which is stored in the Start property.

procedure Rewind;

Description

Upon completion, Rewind stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Rewind method has completed. The Notify property determines whether Rewind generates an OnNotify event.


TMediaPlayer.Save

TMediaPlayer	See also

Saves the currently loaded medium to the file specified in the FileName property.

procedure Save;

Description

Save is ignored for devices that don't use media stored in files (videodiscs, for example).

Upon completion, Save stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Save method has completed. The Notify property determines whether Save generates an OnNotify event.


TMediaPlayer.StartRecording

TMediaPlayer	See also

Begins recording from the current Position or from the position specified in StartPos.

procedure StartRecording;

Description

StartRecording is called when the Record button on the media player control is clicked at runtime.

Upon completion, StartRecording stores a numerical error code in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the StartRecording method has completed. The Notify property determines whether StartRecording generates an OnNotify event.

By default, the Notify property becomes True, and the Wait property becomes False upon completion of the StartRecording method. However, if these properties have been set to specific values prior to calling StartRecording, they remain unchanged.


TMediaPlayer.Step

TMediaPlayer	See also

Moves forward a number of frames (determined by the Frames property) in the currently loaded medium.

procedure Step;

Description

Step is called when the Step button on the media player control is clicked at runtime.

Upon completion, Step stores a numerical error code in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Step method has completed. The Notify property determines whether Step generates an OnNotify event.


TMediaPlayer.Stop

TMediaPlayer	See also

Halts playing or recording.

procedure Stop;

Description

Stop is called when the Stop button on the media player control is clicked at runtime.

Upon completion, Stop stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Stop method has completed. The Notify property determines whether Stop generates an OnNotify event.


TMediaPlayer.Updated

TMediaPlayer	See also

Signals that the media player has finished updating.

procedure Updated; override;

Description

Updated calls the inherited Updated before it modifies the layout of the media player buttons and forces a repaint.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TMemIniFile

Hierarchy	Properties	Methods	See also

TMemIniFile is a wrapper for the Windows INI file system that enables storage and retrieval of application-specific information and settings in an INI file.

Unit

inifiles

Description

Use TMemIniFile to store and retrieve application-specific information and settings in a Windows INI file. The INI file text format is the standard way for Windows 3.x applications to store and retrieve application settings from session to session. An INI file stores information in logical groupings, called “sections.” For example, the WIN.INI file contains a section called “[Desktop]”. Within each section, actual data values are stored in named keys. Keys take the form:

<keyname>=<value>

Unlike the TIniFile object, which also encapsulates INI file data, TMemIniFile buffers all changes to the INI file. The INI file is read once, when the object is first created. Data from the INI file is stored in nested TString objects. Each section in the INI file occupies one element in the top-most TStrings object, and each element in this may itself contain a TStrings object. Each element in each of the contained TStrings object represents a key within the section. After the data is read, any changes to the data are stored in memory. A method is provided to write the data from memory to the associated INI file.

All TMemIniFile methods to read, write, and erase sections, keys, and values operate on the in-memory copy of the INI file.

This buffering of INI file data is important under the Windows NT environment, where INI file writes are not buffered. In applications where there is a significant amount of reading from or writing to an INI file, this buffering prevents degradation of the application’s performance.

The FileName passed to a TIniFile object when it is created is the name of the INI file the object accesses. Because Delphi, and not the operating system, writes the data to the INI file, saving data changes is faster in all supported versions of Windows.

Note:	32-bit Windows applications usually replace INI files with the system registry where all applications store and retrieve their settings. Delphi provides separate classes for handling the system registry, such as TRegistry. TRegistryIniFile also encapsulates the registry, but shares a common ancestor with TMemIniFile so that the same code can operate on both types of object.


TMemIniFile properties

TMemIniFile	Alphabetically	Legend

Derived from TCustomIniFile

FileName


TMemIniFile properties

TMemIniFile	By object	Legend

FileName


TMemIniFile methods

TMemIniFile	Alphabetically

In TMemIniFile

Clear

Create

DeleteKey

Destroy

EraseSection

GetStrings

ReadSection

ReadSections

ReadSectionValues

ReadString

Rename

SetStrings

UpdateFile

WriteString

Derived from TCustomIniFile

ReadBool

ReadDate

ReadDateTime

ReadFloat

ReadInteger

ReadTime

SectionExists

ValueExists

WriteBool

WriteDate

WriteDateTime

WriteFloat

WriteInteger

WriteTime

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TMemIniFile methods

TMemIniFile	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

DeleteKey

Destroy

Dispatch

EraseSection

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetStrings

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadBool

ReadDate

ReadDateTime

ReadFloat

ReadInteger

ReadSection

ReadSections

ReadSectionValues

ReadString

ReadTime

Rename

SafeCallException

SectionExists

SetStrings

UpdateFile

ValueExists

WriteBool

WriteDate

WriteDateTime

WriteFloat

WriteInteger

WriteString

WriteTime


TMemIniFile.Clear

TMemIniFile	See also

Erases all data from the INI file in memory.

procedure Clear;

Description

Call Clear to erase all data from the INI file that is currently buffered in memory. All sections, keys, and values are erased. No exception is generated when using Clear and the data has not been saved to the INI file with the UpdateFile method.


TMemIniFile.Create

TMemIniFile	See also	Example

Creates a TMemIniFile object for an application.

constructor Create(const FileName String);

Description

Call Create to instantiate a TMemIniFile object for an application. Create inherits Create from TCustomIniFile, and creates an additional property, FileName, which is used to specify the name of the INI file to use. Create also loads a copy of the INI file into memory, in an internal string list object.

FileName is the name of the INI file the TMemIniFile uses.

Note:	Typically, INI files are stored in the \WINDOWS directory or the application’s directory. To work with an INI file in another location, specify the full path name of the file in FileName.


TMemIniFile.DeleteKey

TMemIniFile	See also	Example

Erases the data value associated with an INI file entry.

procedure DeleteKey(const Section, Ident: String); override;

Description

Call DeleteKey to erase a data value associated with an INI file entry. Section is string containing the name of an INI file section, and Ident is a string containing the name of the key from for which to set a nil value.

Note:	Attempting to erase a data value in a non-existent section or attempting to erase data from a non-existent key are not errors. In these cases, DeleteKey creates the section and key and sets its initial value to an empty value.

DeleteKey only affects the in-memory copy of the INI file, not the copy on disk.


TMemIniFile.Destroy

TMemIniFile	See also

Frees the memory associated with the TMemIniFile object.

destructor Destroy; override;

Description

Do not call Destroy directly; instead call Free.


TMemIniFile.EraseSection

TMemIniFileTMemIniFile>Main	See also!ALink(TCustomIniFile_SectionExists;TMemIniFile_DeleteKey)

Erases an entire section of an INI file.

procedure EraseSection(const Section: String); override;

Description

Call EraseSection to remove a section, all its keys, and their data values from an INI file. Section identifies the INI file section to remove. If a section cannot be removed, an exception is raised.

EraseSection only affects the in-memory copy of the INI file, not the copy on disk.


TMemIniFile.GetStrings

TMemIniFile	See also

Populates a string list with INI file data.

procedure GetStrings(List: TStrings TStrings);

Description

Call GetStrings to copy the INI file data currently stored in memory into a pre-existing string list.

List is a string list object, created and maintained by the application, into which the INI file data is copied.


TMemIniFile.ReadSection

TMemIniFile	See also

Reads all the key names from a specified section of an INI file into a string list.

procedure ReadSection (const Section: string; Strings: TStrings); override;

Description

Call ReadSection to retrieve the names of all keys within a specified section of an INI file into a string list object.

Section identifies the section from which to retrieve a list of key names. Strings specifies the string object to hold the retrieved names. Strings can point to a TString object such as a string list, or to a component property, such as Items for a TListBox component, that is a TString object itself.

Data read by ReadSection comes from the in-memory copy of the INI file, not the copy on disk.


TMemIniFile.ReadSections

TMemIniFile	See also

Reads the names of all sections in an INI file into a string list.

procedure ReadSections(Strings: TStrings); override;

Description

Call ReadSections to retrieve the names of all sections in an INI file into a string list object.

Strings specifies the string object to hold the retrieved names. Strings can point to a TString object, or to a component property, such as Items for a TListBox component, that is a TString object itself.

Data read by ReadSections comes from the in-memory copy of the INI file, not the copy on disk.


TMemIniFile.ReadSectionValues

TMemIniFile	See also 	Example

Reads the values from all keys within a section of an INI file into a string list.

procedure ReadSectionValues(const Section: String; Strings: TStrings); override;

Description

Call ReadSectionValues to read the values from all keys within a specified section of an INI file into a string list object. Section identifies the section in the file from which to read key values. Strings is the string list object into which to read the values.

Strings specifies the string object to hold the retrieved names. Strings can point to a TString object, or to a component property, such as Items for a TListBox component, that is a TString object itself.

Data read by ReadValues comes from the in-memory copy of the INI file, not the copy on disk.


TMemIniFile.ReadString

TMemIniFile	See also 	Example

Retrieves a string value from an INI file.

function ReadString(const Section, Ident, Default: String): string; override;

Description

Call ReadString to read a string value from an INI file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the value. Default is the string value to return if the:

Section does not exist.

Key does not exist.

Data value for the key is not assigned.

The ReadString method inherited from TCustomIniFile is modified to operate on the in-memory copy of the INI file data. The read methods for all other data types is effected internally by ReadString and then translated to the appropriate data type.


TMemIniFile.Rename

TMemIniFile	See also

Associates the TMemIniFile with a different INI file.

procedure Rename(const FileName: String; Reload: Boolean);

Description

Call Rename to change the INI file used by the TMemIniFile object to a file other than the one specified when the object was created.

FileName is name of the new INI file to use.

Reload determines whether data is immediately loaded into memory from the INI file specified in FileName.


TMemIniFile.SetStrings

TMemIniFile	See also

Populates the memory buffer with contents of a string list.

procedure SetStrings(List: TStrings TStrings);

Description

Call UpdateFile to populate the in-memory copy of the INI file data with the contents of a string list.

List is a string list object, created and maintained by the application, from which the INI file data is copied.

SetStrings uses the Clear method to erase any existing INI file data prior to copying the new data.

SetStrings can be used to reread data from the INI file from disk after it is erased with the Clear method. The LoadFromFile method of a string list can be used to retrieve the contents of the INI file and SetStrings to copy the data into the memory buffer for TMemIniFile.


TMemIniFile.UpdateFile

TMemIniFile	See also

Flushes buffered INI file data to disk.

function UpdateFile; override;

Description

Call UpdateFile to copy INI file data stored in memory to the copy of the INI file on disk. UpdateFile is useful under Windows95, but has no effect under Windows NT as NT does not buffer INI file reads and writes.

UpdateFile overwrites all data in the disk copy of the INI file with the INI file data stored in memory.

If the Rename method is used to change the INI file the TMemIniFile uses, UpdateFile copies the INI file data in memory to a file of the new name. If the file does not already exist, it is created. I the new file already exists, it is overwritten.


TMemIniFile.WriteString

TMemIniFile	See also	Example

Writes a string value to an INI file.

procedure WriteString(const Section, Ident, Value: String); override;

Description

Call WriteString to write a string value to an INI file. Section identifies the section in the file that contain the key to which to write. Ident is the name of the key for which to set a value. Value is the string value to write.

The WriteString method inherited from TCustomIniFile is modified to operate on the in-memory copy of the INI file data. The write methods for all other data types is effected internally by WriteString after data values are translated from the original data type.

Note:	Attempting to write a data value to a non-existent section or attempting to write data to a non-existent key are not errors. In these cases, WriteString creates the section and key and sets its initial value to Value.

Accessibility

Read-only


Hierarchy

TObject

TCustomIniFile


 TMemo

Hierarchy	Properties	Methods	Events	See also

TMemo is a wrapper for a windows multiline edit control.

Unit

stdctrls

Description

Use TMemo to put a standard Windows multiline edit control on a form. Multiline edit boxes allow the user to enter more than one line of text. They are appropriate for representing lengthy information.

TMemo implements the generic behavior introduced in TCustomMemo. TMemo publishes many of the properties inherited from TCustomMemo, but does not introduce any new behavior.


TMemo properties

TMemo	Alphabetically	Legend

Derived from TCustomMemo

Alignment

CaretPos

Lines

ScrollBars

WantReturns

WantTabs

WordWrap

Derived from TCustomEdit

CanUndo

BorderStyle

HideSelection

MaxLength

Modified

OEMConvert

ReadOnly

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Text

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TMemo properties

TMemo	By object	Legend

Action

Align

Alignment

Anchors

BiDiMode

BorderStyle

BoundsRect

Brush

CanUndo

CaretPos

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

HideSelection

Hint

HostDockSite

ImeMode

ImeName

Left

Lines

LRDockWidth

MaxLength

Modified

Name

OEMConvert

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ReadOnly

ScrollBars

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Text

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

WantReturns

WantTabs

Width

WindowProc

WordWrap


TMemo events

TMemo	Alphabetically	Legend

Derived from TCustomEdit

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TMemo events

TMemo	By object	Legend

OnChange

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TMemo methods

TMemo	Alphabetically

Derived from TCustomMemo

Create

Destroy

Derived from TCustomEdit

Clear

ClearSelection

ClearUndo

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Undo

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMemo methods

TMemo	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClearSelection

ClearUndo

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

Create

CreateParented

CreateParentedControl

CutToClipboard

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

Undo

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMemo


TMemoField

Hierarchy	Properties	Methods	Events	See also

TMemoField represents a memo field in a dataset.

Unit

db

Description

TMemoField is a persistent field object that encapsulates the fundamental behavior common to multi-line text data. Memo fields are a form of binary large object (BLOB) field where the data consists of simple text. TMemoField differs from its immediate ancestor TBlobField only in having a DataType of ftMemo. As a descendant of TBlobField, TMemoField includes many properties, methods, and events that are useful for managing the value and properties of a BLOB field in a database.

As with all persistent field objects, a TMemoField can be created at design-time using the Fields Editor or at runtime by calling the constructor for the class. Persistent field objects exist solely in the memory space of a Delphi application. Creating a persistent field object only creates an object in the application, and does not result in the creation of a field in a table.

Fields in a table can be accessed without use of persistent field objects. Virtual field objects are created to provide access to a field when the field is referenced through such means as the TDataSet.Fields property or the TDataSet.FieldByName method. However, as both the Fields property and the FieldByName method return a value of type TField, the return value must be typecast as a TMemoField or TBlobField before using any property specific to TMemoField or TBlobField.


TMemoField properties

TMemoField	Alphabetically	Legend

Derived from TBlobField

AsString

AsVariant

BlobSize

BlobType

IsNull

Modified

Transliterate

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TMemoField properties

TMemoField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

BlobSize

BlobType

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Modified

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

Transliterate

ValidChars

Value

VCLComObject

Visible


TMemoField events

TMemoField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TMemoField events

TMemoField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TMemoField methods

TMemoField	Alphabetically

In TMemoField

Create

Derived from TBlobField

Assign

Clear

IsBlob

LoadFromFile

LoadFromStream

SaveToFile

SaveToStream

SetFieldType

Derived from TField

AssignValue

Destroy

FocusControl

GetData

IsValidChar

RefreshLookupList

SetData

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMemoField methods

TMemoField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SaveToFile

SaveToStream

SetData

SetFieldType

UpdateAction

Validate


TMemoField.Create

TMemoField	See also

Creates an instance of TMemoField.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TMemoField object at runtime. TMemoField objects added using the fields editor at design time, are created automatically, as are dynamic field components that reflect a table’s underlying fields. After calling the inherited constructor, Create sets the DataType to ftMemo, and initializes the Transliterate property to True.

After instantiating a TMemoField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TMemoField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TMemoField with a dataset component by setting its DataSet property to the name of the dataset component.

The example below creates a TMemoField object for a field named Notes accessed through a TQuery named Query1.

var

  T: TMemoField;

begin

  Query1.Close;

  T := TMemoField.Create(Self);

  T.FieldName := 'Notes';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;

Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TBlobField


TMemoryStream

Hierarchy	Properties	Methods	See also	Example

TMemoryStream is a stream that stores its data in dynamic memory.

Unit

classes

Description

Use TMemoryStream to store data in a dynamic memory buffer that is enhanced with file-like access capabilities. TMemoryStream provides the general I/O capabilities of a stream object while introducing methods and properties to manage a dynamic memory buffer.

Memory streams are useful as intermediary objects that can hold information as well as read it from or write it to another storage medium. They provide a useful format for comparing the contents of streams, or for manipulating data that is stored in a less accessible medium.


TMemoryStream properties

TMemoryStream	Alphabetically	Legend

Derived from TCustomMemoryStream

Memory

Derived from TStream

Position

Size


TMemoryStream properties

TMemoryStream	By object	Legend

Memory

Position

Size


TMemoryStream methods

TMemoryStream	Alphabetically

In TMemoryStream

Clear

Destroy

LoadFromFile

LoadFromStream

SetSize

Write

Derived from TCustomMemoryStream

Read

SaveToFile

SaveToStream

Seek

Derived from TStream

CopyFrom

FixupResourceHeader

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TMemoryStream methods

TMemoryStream	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

CopyFrom

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

FixupResourceHeader

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

Read

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

SafeCallException

SaveToFile

SaveToStream

Seek

SetSize

Write

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader


TMemoryStream.Clear

TMemoryStream	See also

Frees the memory buffer, discarding all data associated with the memory stream.

procedure Clear;

Description

Use Clear to empty the memory buffer for the memory stream and free all associated memory. In addition to freeing the memory associated with the memory buffer, Clear

Sets the Memory property to nil.

Sets the Position property to 0.

Sets the Size property to 0.


TMemoryStream.Destroy

TMemoryStream	See also

Destroys an instance of TMemoryStream.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TMemoryStream reference is not nil, and only then calls Destroy.

Destroy a TMemoryStream object when it is no longer needed to store or write data. Destroy calls Clear to free the memory buffer before calling the inherited destructor.


TMemoryStream.LoadFromFile

TMemoryStream	See also

Loads the entire contents of a file into the memory buffer.

procedure LoadFromFile(const FileName: string);

Description

Use LoadFromFile to fill the memory stream with the contents of a file. Pass the name of the file as the FileName parameter. LoadFromFile allows an application to read the contents of a file into the memory stream without having to explicitly create and free a file stream object.

LoadFromFile reallocates the memory buffer so that the contents of the file will exactly fit. It sets the Size property accordingly, and then reads the entire contents of the file into the memory buffer. Thus, LoadFromFile will discard any pre-existing data stored in the memory stream.


TMemoryStream.LoadFromStream

TMemoryStream	See also

Loads the entire contents of a stream into the memory buffer.

procedure LoadFromStream(Stream: TStream);

Description

Use LoadFromStream to fill the memory stream with the contents of the stream specified by the Stream parameter. LoadFromStream always sets the Position of the source stream to 0, before streaming in the number of bytes indicated by the source stream’s Size property.

LoadFromStream reallocates the memory buffer so that the contents of the source stream will exactly fit. It sets the Size property accordingly, and then reads the entire contents of the source stream into the memory buffer. Thus, LoadFromStream will discard any pre-existing data stored in the memory stream.

If the source stream is a TFileStream object, LoadFromStream does the same thing as LoadFromFile, except that the application must create and free the TFileStream object. LoadFromStream also allows applications to fill a memory stream object from other types of stream objects.


TMemoryStream.SetSize

TMemoryStream	See also

Sets the Size property of the memory stream.

procedure SetSize(NewSize: Longint); override;

Description

Use SetSize to set the Size of a memory stream before filling it with data. SetSize allocates the memory buffer to hold NewSize bytes, preserving as much of the existing data as possible.

Use SetSize before filling the memory buffer with data from various sources, or from a portion of another stream. If the intended contents of the memory stream is exactly the same as the contents of another stream or file, use LoadFromStream or LoadFromFile instead.


TMemoryStream.Write

TMemoryStream	See also

Writes Count bytes from Buffer to the current position in the memory buffer and updates the current position by Count bytes.

function Write(const Buffer; Count: Longint): Longint; override;

Description

Use Write to insert Count bytes into the memory buffer of the memory stream, starting at the current position. Write will increase the size of the memory buffer, if necessary, to accommodate the data being written in. If the current position is not the end of the memory buffer, Write will overwrite the data following the current position.

Write updates the Size property to Position + Count, and sets the Position property to the new value of Size. Thus, any data that was stored in the memory stream in the Count bytes after the current position is lost when calling Write.

Write always writes the Count bytes in the Buffer, unless there is a memory failure. Thus, for TMemoryStream, Write is equivalent to the WriteBuffer method.

All other data-writing methods of a memory stream (WriteBuffer, WriteComponent) call Write to do the actual writing.


Accessibility

Read-only


Hierarchy

TObject

TStream

TCustomMemoryStream


TMenu

Hierarchy	Properties	Methods	Events	See also	Example 1	Example 2

TMenu is the base type for menu components such as TMainMenu and TPopupMenu.

Unit

menus

Description

Use TMenu as a base class when defining a component that represents a collection of menu items. TMenu introduces properties and methods to create a Windows menu that represents a set of menu items, dispatch commands associated with those menu items, and locate the help context id for any of those menu items.


TMenu properties

TMenu	Alphabetically	Legend

In TMenu

AutoHotkeys

AutoLineReduction

BiDiMode

Handle

Images

Items

OwnerDraw

ParentBiDiMode

WindowHandle

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TMenu properties

TMenu	By object	Legend

AutoHotkeys

AutoLineReduction

BiDiMode

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Handle

Images

Items

Name

Owner

OwnerDraw

ParentBiDiMode

Tag

VCLComObject

WindowHandle


TMenu.AutoHotkeys

TMenu	See also

Determines whether the accelerator keys for menu items can be reset automatically.

property AutoHotkeys: TMenuAutoFlag;

Description

Set AutoHotkeys to indicate whether Delphi should automatically ensure that accelerator keys for the items in the menu are reset if necessary so that every menu item has an accelerator key and no two items have the same accelerator key. This ensures that menu items added dynamically at runtime can have accelerator keys that do not introduce conflicts.  Delphi tries to preserve all existing accelerator key mappings when adjusting the accelerator keys, but may be forced to change some in order to ensure that every item has a unique accelerator.

Before the menu is displayed, Delphi checks and adjusts the accelerator key mappings if AutoHotkeys is maAutomatic. When AutoHotkeys is maManual, Delphi does not alter the top-level menu items, but may adjust the accelerator keys for submenus, depending on the AutoHotkeys property of the menu item that is the parent of the submenu.

When AutoHotkeys is maManual, an application can still adjust the menu items by calling the Items property’s RethinkHotkeys method. AutoHotkeys merely controls whether this adjustment occurs automatically.

Note:	The AutoHotkeys property of a menu is linked to the AutoHotkeys property of the TMenuItems object that implements its Items property. Setting one sets the other.


TMenu.AutoLineReduction

TMenu	See also

Determines whether redundant separator bars are automatically removed from the menu.

property AutoLineReduction: TMenuAutoFlag;

Description

Set AutoLineReduction to indicate whether Delphi should automatically ensure that the menu does not start or end with a separator bar and that two separator bars do not appear next to each other. This ensures that menus built dynamically at runtime do not have separator bars in undesired positions.

Before the menu is displayed, Delphi removes superfluous separator bars when AutoLineReduction is maAutomatic. When AutoLineReduction is maManual, Delphi does not remove separators from the top-level menu items, but may remove superfluous separators from submenus, depending on the AutoLineReduction property of the menu item that is the parent of the submenu.

When AutoLineReduction is maManual, an application can still remove superfluous separators by calling the Items property’s RethinkLines method. AutoLineReduction merely determines whether this adjustment occurs automatically.

Note:	The AutoLineReduction property of a menu is linked to the AutoLineReduction property of the TMenuItems object that implements its Items property. Setting one sets the other.


TMenu.BiDiMode

TMenu	See also

Determines the layout of the menu in Middle East locales.

property BiDiMode: TBiDiMode;

Description

Set BiDiMode to control the layout of menu items. BiDiMode controls whether the menu items read from left to right or right to left.


TMenu.Handle

TMenu	See also

Provides access to the Windows menu handle for the menu.

property Handle: HMENU;

Description

Use Handle to call a Windows API function that requires a menu handle. Handle is the handle for the menu that contains only the items described by the Items property. If no other menus have been merged with this menu, this is the same as the WindowHandle property.


TMenu.Images

TMenu	See also

Lists the images that can appear beside individual menu items.

property Images: TCustomImageList;

Description

Use Images to hold the set of images that can appear beside menu items in the menu. Individual menu items set their ImageIndex property to indicate which image in the list appears to the left of the menu item caption.

Tip:	If the application uses action lists, this property should be the value of the action list’s Images property. This way, menu items and buttons that do the same thing can display the same image.


TMenu.Items

TMenu	See also

Describes the elements of the menu.

property Items: TMenuItem; default;

Description

Use Items to access information about the elements in the menu. Items is a single TMenuItem object that describes the elements of the menu in its own Items property. Because Items is the default property of TMenuItem, the Items property of TMenu can be treated as an indexed array of menu items that describe the individual items in the menu. That is, instead of writing

FirstItem := Menu1.Items.Items[0];

use

FirstItem := Menu1.Items[0];

Set the Items property at design time by clicking on the Items property in the Property Inspector. The Menu Designer automatically inserts a menu item. As each menu item is entered, outlined regions appear at the possible locations of additional menu items. Click in those regions to specify additional menu items. At runtime, create a TMenuItem that describes the elements of the menu programmatically, and set the Items property of the menu.


TMenu.OwnerDraw

TMenu	See also

Specifies whether the menu items are drawn by the application.

property OwnerDraw: Boolean;

Description

Set OwnerDraw to True to indicate that the application will draw menu items in an OnDrawItem event handler. When OwnerDraw is True, menu items receive an OnMeasureItem and an OnDrawItem event when they need to be rendered on screen.

Set OwnerDraw to False to accept the default drawing. When OwnerDraw is False, menu items display the caption with an optional image to the left (If the Images and ImageIndex properties are set).

Owner-draw menus are useful for displaying the value that appears when selecting a menu item. For example, in a menu that allows users to choose a color, an owner-draw menu could display rectangles drawn in the designated color, rather than color names.


TMenu.ParentBiDiMode

TMenu	See also

Indicates whether the BiDiMode property is inherited from the control that uses the menu.

property ParentBiDiMode: Boolean;

Description

By default, ParentBiDiMode is True, indicating that the layout of menu items follows the BiDiMode setting of the associated form or control. Change ParentBiDiMode to False to override the default BiDiMode setting and control the menu’s layout independently.


TMenu.WindowHandle

TMenu	See also

Provides access to the handle of the window that uses the menu.

property WindowHandle: HWnd;

Description

Read WindowHandle to get the window handle of the control that receives WM_COMMAND messages when the user clicks on an item in the menu. When menu items are selected, use this handle in an OnClick event handler to send messages to the control that uses the menu or to make Windows API calls that affect the control.

Set WindowHandle to associate the menu with a control.


TMenu events

TMenu	Alphabetically	Legend

In TMenu

OnChange


TMenu events

TMenu	By object	Legend

OnChange


TMenu.OnChange

TMenu	See also

Occurs when the menu changes.

type TMenuChangeEvent = procedure (Sender: TObject; Source: TMenuItem; Rebuild: Boolean) of object;

property OnChange: TMenuChangeEvent;

Description

Write an OnChange event handler to respond to changes in the menu’s structure. OnChange occurs when the menu is loaded into memory, and in response to property changes that affect the menu’s structure.

The Sender parameter is the menu that changed. The Source parameter indicates the menu item (if any) whose properties changed. Rebuild indicates whether the menu will be rebuilt to reflect the change (for example when items are added or deleted).


TMenu methods

TMenu	Alphabetically

In TMenu

AdjustBiDiBehavior

Create

Destroy

DispatchCommand

DispatchPopup

DoBiDiModeChanged

DoChange

DoGetMenuString

FindItem

GetChildren

GetHandle

GetHelpContext

IsOwnerDraw

IsRightToLeft

IsShortCut

Loaded

MenuChanged

Notification

ParentBiDiModeChanged

ProcessMenuChar

SetChildOrder

UpdateItems

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMenu methods

TMenu	By object

AdjustBiDiBehavior

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DispatchCommand

DispatchPopup

DoBiDiModeChanged

DoChange

DoGetMenuString

ExecuteAction

FieldAddress

FindComponent

FindItem

Free

FreeInstance

FreeNotification

FreeOnRelease

GetChildren

GetHandle

GetHelpContext

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsOwnerDraw

IsRightToLeft

IsShortCut

Loaded

MenuChanged

MethodAddress

MethodName

NewInstance

Notification

ParentBiDiModeChanged

ProcessMenuChar

RemoveComponent

SafeCallException

SetChildOrder

UpdateAction

UpdateItems


TMenu.AdjustBiDiBehavior

TMenu	See also

Applies the BiDiMode property to the menu when the Windows control is created.

procedure AdjustBiDiBehavior;

Description

AdjustBiDiBehavior is called automatically when the Windows control for the menu is created. It ensures that the BiDiMode property is properly reflected in the menu if the application is running in a Middle Eastern locale.


TMenu.Create

TMenu	See also

Creates an instance of TMenu.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create a menu at runtime. Menus placed on forms at design time are created automatically. Create calls the inherited Create method, then sets the initial values for the menu component, including creating an Items property.

The AOwner parameter indicates the component (usually a form) that is responsible for managing the memory associated with the menu.


TMenu.Destroy

TMenu	See also

Destroys the menu component.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TMenu reference is not nil, and only then calls Destroy. Destroy frees the Items property, and then calls the inherited Destroy method.


TMenu.DispatchCommand

TMenu	See also

Calls the Click method of the menu item with the specified value as its Command property.

function DispatchCommand(ACommand: Word): Boolean; dynamic;

Description

Call DispatchCommand to simulate a click on the menu item associated with a command ID. If DispatchCommand locates a menu item that matches the command ID, it calls the Click method for that menu item and returns True. If there is no such item, DispatchCommand returns False.


TMenu.DispatchPopup

TMenu	See also

Dispatches a pop-up menu command.

function DispatchPopup(AHandle: HMENU): Boolean;

Description

Call DispatchPopup to simulate a click on the menu item associated with the pop-up menu handle. If DispatchPopup locates a menu item that matches the pop-up menu handle, it calls the Click method for that menu item and returns True. If there is no such item, DispatchPopup returns False.


TMenu.DoBiDiModeChanged

TMenu	See also

Updates the menu when the BiDiMode property changes.

procedure DoBiDiModeChanged;

Description

Do not call DoBiDiModeChanged. It is called automatically when the menu’s BiDiMode property changes to update the menu to reflect the current setting.


TMenu.DoChange

TMenu	See also

Generates an OnChange event.

procedure DoChange(Source: TMenuItem; Rebuild: Boolean); virtual;

Description

DoChange is called automatically when the properties of any menu items change. The Source parameter specifies the menu item (if any) that changed. The Rebuild parameter indicates whether the change requires the menu to regenerate its items.


TMenu.DoGetMenuString

TMenu	See also

Returns the caption for an item in the menu.

function DoGetMenuString(Menu: HMENU; ItemID: UINT; Str: PChar; MaxCount: Integer; Flag: UINT): Integer;

Description

DoGetMenuString is used internally to obtain menu item captions, given the Windows menu handle. The Menu parameter indicates the menu’s handle. The ItemID parameter specifies the menu item whose caption is desired. If the Flag parameter is MF_BYCOMMAND, ItemID is the Command property of the menu item. If Flag is MF_BYPOSITION, ItemID is the 0-based index of the menu item. The caption is returned in a buffer pointed to by the Str parameter. MaxCount indicates the size of that buffer.

Unlike the Windows API function GetMenuString, DoGetMenuString returns the correct caption for owner-draw menu items.


TMenu.FindItem

TMenu	See also

Locates and returns a menu item.

type TFindItemKind = (fkCommand, fkHandle, fkShortCut);

function FindItem(Value: Word; Kind: TFindItemKind): TMenuItem;

Description

Call FindItem to locate a menu item in the menu or one of its submenus. The menu item is identified by either a pop-up menu handle, command ID, or menu shortcut value. The Kind parameter specifies how the menu item is to be identified. It can be any of these values:

Value	Meaning

fkCommand	Command ID used by Windows WM_COMMAND message matches the Value parameter.

fkHandle	Pop-up menu handle matches the Value parameter.

fkShortCut	Menu shortcut key code matches the Value parameter.


TMenu.GetChildren

TMenu	See also

Executes a callback for child menu items.

procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;

Description

GetChildren is called automatically by the streaming system so that child menu items are saved and read with their parent menu.


TMenu.GetHandle

TMenu	See also

Returns the value of the Handle property.

function GetHandle: HMENU; virtual;

Description

GetHandle is the protected implementation of the Handle property. Override this method to change the implementation of the handle property. For example, TMainMenu overrides GetHandle to adjust for menus added by embedded OLE objects.


TMenu.GetHelpContext

TMenu	See also

Returns the help context ID associated with a menu item.

function GetHelpContext(Value: Integer; ByCommand: Boolean): THelpContext;

Description

Call GetHelpContext to obtain the ID for context-sensitive help on a particular menu item. Identify the menu item as the item that matches the Value property. If ByCommand is True, Value is the Command property of the TMenuItem. If ByCommand is False, Value is the Handle property.


TMenu.IsOwnerDraw

TMenu	See also

Indicates whether menu items can contain more than simple captions.

function IsOwnerDraw: Boolean;

Description

IsOwnerDraw returns True when the OwnerDraw property is True or the Images property is not nilNULL. This is used internally to determine how the menu should be painted.


TMenu.IsRightToLeft

TMenu	See also

Indicates whether menu items read from right to left.

function IsRightToLeft: Boolean;

Description

Call IsRightToLeft to determine the layout of main menu items. IsRightToLeft returns True if the application is running on a system with a Middle Eastern locale and the BiDiMode property is not bdLeftToRight.


TMenu.IsShortCut

TMenu	See also

Dispatches a key message if it represents a shortcut key for an item in the menu.

function IsShortCut(var Message: TWMKey): Boolean;

Description

Call IsShortCut when processing a keydown message to identify shortcut keys and trigger the appropriate menu action. IsShortCut decodes the key message passed in the Message parameter. It then encodes the state of the Shift, Control, and Alt keys with the value of the character that was typed to obtain the ShortCut property of a menu item. If IsShortCut locates a menu item associated with the shortcut key combination, it calls the item's Click method and returns True. If no item in the menu has a shortcut corresponding to the message, IsShortCut returns False.


TMenu.Loaded

TMenu	See also

Calls the DoChange method when the menu is first loaded into memory.

procedure Loaded; override;

Description

Loaded is called automatically immediately after the menu is loaded into memory. It calls the DoChange method to allow any necessary fixup.


TMenu.MenuChanged

TMenu	See also

Responds when the menu changes.

procedure MenuChanged(Sender: TObject; Source: TMenuItem; Rebuild: Boolean); virtual;

Description

MenuChanged is called automatically when changes occur that affect the structure of the menu. The Sender parameter indicates the object that originates the change. It’s value can be nil. Source indicates which menu item is affected. Rebuild indicates whether the menu must be rebuilt to reflect the change (for example when items are added or deleted).

MenuChanged calls the DoChange method, which generates an OnChange event.

Note:	Changes that affect individual items rather than the menu as a whole trigger the UpdateItems method instead of MenuChanged. For example, when the Images property changes, UpdateItems is called rather than MenuChanged.


TMenu.Notification

TMenu	See also

Responds when components are added or deleted.

procedure Notification(AComponent: TComponent; Operation: TOperation); override;

Description

TMenu overrides the inherited method to set the Images property to nil if the ImageList is deleted.


TMenu.ParentBiDiModeChanged

TMenu	See also

Ensures that the menu’s layout follows the current settings of the BiDiMode and ParentBiDiMode properties.

procedure ParentBiDiModeChanged; overload;

procedure ParentBiDiModeChanged(AControl: TObject); overload;

Description

ParentBiDiMode changed is called when the menu’s BiDiMode property must be updated to reflect the bi-directional mode of its associated control.


TMenu.ProcessMenuChar

TMenu	See also

Responds to keyboard input for the menu.

TWMMenuChar = record

    Msg: Cardinal;

    User: Char;

    Unused: Byte;

    MenuFlag: Word; { MF_POPUP, MF_SYSMENU }

    Menu: HMENU;

    Result: Longint;

  end;

procedure ProcessMenuChar(var Message: TWMMenuChar);

Description

ProcessMenuChar handles keyboard messages from Windows. It checks whether the character typed (Message.User) is an accelerator character from one of the menu’s items. If so, ProcessMenuChar executes the menu item (or, if the item is disabled, selects it). If the key is not an accelerator, ProcessMenuChar checks for captions that begin with the character. If there is only one, it is treated like an accelerator. Otherwise, the first item beginning with that character is selected.

When calling ProcessMenuChar programmatically, the User, MenuFlag, and Menu fields of Message must be supplied.


TMenu.SetChildOrder

TMenu	See also

Ensures that the menu item indexes reflect the order in which they are loaded and saved.

procedure SetChildOrder(Child: TComponent; Order: Integer); override;

Description

SetChildOrder is called automatically when menus are loaded into memory.  The Child parameter specifies the child object that was just loaded. The Order parameter specifies the order in which it was loaded. SetChildOrder assigns the MenuIndex for each child to match the order in which the items are loaded.


TMenu.UpdateItems

TMenu	See also

Causes all menu items to update themselves.

procedure UpdateItems;

Description

UpdateItems is called automatically when changes occur that must be reflected by individual menu items. Changes that affect the menu as a whole trigger the MenuChanged method instead.


Scope

Published

Protected

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent


TMenuActionLink

Hierarchy	Properties	Methods	Events

TMenuActionLink menu item clients to the corresponding menu action.

Unit

Menus

Description

TMenuActionLink is designed to link actions to menu item clients. TMenuActionLink overrides methods to determine whether the action and client are linked, and to ensure that action events are appropriate for properties of and events of menu item clients.

TMenuActionLink overrides methods to support linking the following actions with menu item client properties or events, most of which have the same name:

Caption

Checked

Enabled

HelpContext

Hint

ImageIndex

ShortCut

Visible

OnExecute


TMenuActionLink properties

TMenuActionLink	Alphabetically

Derived from TBasicActionLink

Action


TMenuActionLink properties

TMenuActionLink	By object

Action


TMenuActionLink events

TMenuActionLink	Alphabetically

Derived from TBasicActionLink

OnChange


TMenuActionLink events

TMenuActionLink	By object

OnChange


TMenuActionLink methods

TMenuActionLink	Alphabetically	Legend

In TMenuActionLink

AssignClient

IsCaptionLinked

IsCheckedLinked

IsEnabledLinked

IsHelpContextLinked

IsHintLinked

IsImageIndexLinked

IsOnExecuteLinked

IsShortCutLinked

IsVisibleLinked

SetCaption

SetChecked

SetEnabled

SetHelpContext

SetHint

SetImageIndex

SetOnExecute

SetShortCut

SetVisible

Derived from TBasicActionLink

Create

Destroy

Execute

Update

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TMenuActionLink methods

TMenuActionLink	By object	Legend

AfterConstruction

AssignClient

BeforeDestruction

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

Execute

FieldAddress

FreeInstance

Free

GetInterfaceEntry

GetInterfaceTable

GetInterface

InheritsFrom

InitInstance

InstanceSize

IsCaptionLinked

IsCheckedLinked

IsEnabledLinked

IsHelpContextLinked

IsHintLinked

IsImageIndexLinked

IsOnExecuteLinked

IsShortCutLinked

IsVisibleLinked

MethodAddress

MethodName

NewInstance

SafeCallException

SetCaption

SetChecked

SetEnabled

SetHelpContext

SetHint

SetImageIndex

SetOnExecute

SetShortCut

SetVisible

Update


TMenuActionLink.AssignClient

TMenuActionLink	See also

Assigns a client menu item that is linked to the associated action.

procedure AssignClient(AClient: TObject); override;

Description

TMenuActionLink overrides AssignClient to ensure that the client for the link is a menu item.


TMenuActionLink.IsCaptionLinked

TMenuActionLink	See also

Indicates whether the action for the caption and the client are linked.

function IsCaptionLinked: Boolean; override;

Description

IsCaptionLinked indicates whether the action, for the caption, is linked to the appropriate client property. IsCaptionLinked returns True if the client requests that the action control this event, False otherwise.


TMenuActionLink.IsCheckedLinked

TMenuActionLink	See also

Indicates whether the action for the checked state and the client are linked.

function IsCheckedLinked: Boolean; override;

Description

IsCheckedLinked indicates whether the action, for the checked state, is linked to the appropriate client property. IsCheckedLinked returns True if the client requests that the action control this event, False otherwise.


TMenuActionLink.IsEnabledLinked

TMenuActionLink	See also

Indicates whether the action for the enabled state and the client are linked.

function IsEnabledLinked: Boolean; override;

Description

IsEnabledLinked indicates whether the action, for the enabled state, is linked to the appropriate client property. IsEnabledLinked returns True if the client requests that the action control this event, False otherwise.


TMenuActionLink.IsHelpContextLinked

TMenuActionLink	See also

Indicates whether the action for the Help context and the client are linked.

function IsHelpContextLinked: Boolean; override;

Description

IsHelpContextLinked indicates whether the action, for the Help context, is linked to the appropriate client property. IsHelpContextLinked returns True if the client requests that the action control this event, False otherwise.


TMenuActionLink.IsHintLinked

TMenuActionLink	See also

Indicates whether the action for the hint and the client are linked.

function IsHintLinked: Boolean; override;

Description

IsHintLinked indicates whether the action, for the hint, is linked to the appropriate client property. IsHintLinked returns True if the client requests that the action control this event, False otherwise.


TMenuActionLink.IsImageIndexLinked

TMenuActionLink	See also

Indicates whether the action for the image index and the client are linked.

function IsImageIndexLinked: Boolean; override;

Description

IsImageIndexLinked indicates whether the action, for the image index, is linked to the appropriate client property. IsImageIndexLinked returns True if the client requests that the action control this event, False otherwise.


TMenuActionLink.IsOnExecuteLinked

TMenuActionLink	See also

Indicates whether the action for the OnExecute event handler and the client are linked.

function IsOnExecuteLinked: Boolean; override;

Description

IsOnExecuteLinked indicates whether the action, for the OnExecute event handler, is linked to the appropriate client event. IsOnExecuteLinked returns True if the client requests that the action control this event, False otherwise.


TMenuActionLink.IsShortCutLinked

TMenuActionLink	See also

Indicates whether the action for the shortcut and the client are linked.

function IsShortCutLinked: Boolean; override;

Description

IsShortCutLinked indicates whether the action, for the visible state, is linked to the appropriate client property. IsVisibleLinked returns True if the client requests that the action control this event, False otherwise.


TMenuActionLink.IsVisibleLinked

TMenuActionLink	See also

Indicates whether the action for the visible state and the client are linked.

function IsVisibleLinked: Boolean; override;

Description

IsVisibleLinked indicates whether the action, for the visible state, is linked to the appropriate client property. IsVisibleLinked returns True if the client requests that the action control this event, False otherwise.


TMenuActionLink.SetCaption

TMenuActionLink	See also

Sets the caption of a menu item if the client is linked to the action for this event.

procedure SetCaption(const Value: string); override;

Description

SetCaption sets the caption of a menu item, and is called only if the client is linked for this event. Value is the string to which the caption should be set.


TMenuActionLink.SetChecked

TMenuActionLink	See also

Sets the checked state of a menu item if the client is linked to the action for this event.

procedure SetChecked(Value: Boolean); override;

Description

SetChecked sets the checked state of a menu item, and is called only if the client is linked for this event. Value specifies whether the checked state should be set.


TMenuActionLink.SetEnabled

TMenuActionLink	See also

Sets the enabled state of a menu item if the client is linked to the action for this event.

procedure SetEnabled(Value: Boolean); override;

Description

SetEnabled sets the enabled state of a menu item, and is called only if the client is linked for this event. Value specifies whether the enabled state should be set.


TMenuActionLink.SetHelpContext

TMenuActionLink	See also

Sets the Help context of a windowed control if the client is linked to the action for this event.

procedure SetHelpContext(Value: THelpContext); override;

Description

SetHelpContext sets the help context of a client windowed control, and is called only if the client is linked for this event. Value specifies whether what the help context should be.


TMenuActionLink.SetHint

TMenuActionLink	See also

Sets the hint of a menu item if the client is linked to the action for this event.

procedure SetHint(const Value: string); override;

Description

SetHint sets the hint of a menu item, and is called only if the client is linked for this event. Value is the string that to which the hint should be set.


TMenuActionLink.SetImageIndex

TMenuActionLink	See also

Sets the image index of a menu item if the client is linked to the action for this event.

procedure SetImageIndex(Value: Integer); override;

Description

SetImageIndex sets the image index of a menu item, and is called only if the client is linked for this event. Value specifies what the image index should be.


TMenuActionLink.SetOnExecute

TMenuActionLink	See also

Sets the execution event handler for a menu item if the client is linked to the action for this event.

procedure SetOnExecute(Value: TNotifyEvent); override;

Description

SetOnExecute sets the appropriate execution event handler of a menu item, and is called only if the client is linked for this event. Value specifies the procedure that should be used for this event.


TMenuActionLink.SetShortCut

TMenuActionLink	See also

Sets the shortcut of a menu item if the client is linked to the action for this event.

procedure SetShortCut(Value: TShortCut); override;

Description

SetShortCut sets the shortcutof a menu item, and is called only if the client is linked for this event. Value specifies what the shortcut should be.


TMenuActionLink.SetVisible

TMenuActionLink	See also

Sets the visible state of a menu item if the client is linked to the action for this event.

procedure SetVisible(Value: Boolean); override;

Description

SetVisible sets the visible state of a menu item, and is called only if the client is linked for this event. Value specifies whether the visible state should be set.


Scope

Protected


Hierarchy

TObject

TBasicActionLink

TActionLink


TMenuItem

Hierarchy	Properties	Methods	Events	See also

TMenuItem describes the properties of an item in a menu.

Unit

menus

Description

Use TMenuItem to specify the appearance and behavior of an item in a menu. Each TMainMenu or TPopupMenu component can contain multiple menu items. When a menu is defined at design time, the Menu Designer automatically creates menu item objects for each command on the menu.


TMenuItem properties

TMenuItem	Alphabetically	Legend

In TMenuItem

Action

AutoHotkeys

AutoLineReduction

Bitmap

Break

Caption

Checked

Command

Count

Default

Enabled

GroupIndex

Handle

HelpContext

Hint

ImageIndex

Items

MenuIndex

Parent

RadioItem

ShortCut

SubMenuImages

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TMenuItem properties

TMenuItem	By object	Legend

Action

AutoHotkeys

AutoLineReduction

Bitmap

Break

Caption

Checked

Command

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Count

Default

DesignInfo

Enabled

GroupIndex

Handle

HelpContext

Hint

ImageIndex

Items

MenuIndex

Name

Owner

Parent

RadioItem

ShortCut

SubMenuImages

Tag

VCLComObject

Visible


TMenuItem.Action

TMenuItem

Designates the action associated with the menu item.

property Action: TBasicAction;

Description

Action designates the action object that is associated with the menu item. Actions can be associated with a menu item by using the action list editor at design-time. Actions are a way of centralizing user responses to commands.


TMenuItem.AutoHotkeys

TMenuItem	See also

Determines whether the accelerator keys for submenu items can be reset automatically.

property AutoHotkeys: TMenuItemAutoFlag;

Description

Set AutoHotkeys to indicate whether the accelerator keys for the items in the Items property can be reset if necessary to ensure that every menu item has an accelerator key and no two items have the same accelerator key. This ensures that menu items added dynamically at runtime can have accelerator keys that do not introduce conflicts.  Delphi tries to preserve all existing accelerator key mappings when adjusting the accelerator keys, but may be forced to change some in order to ensure that every item has a unique accelerator.

Before the menu is displayed, Delphi checks and adjusts the accelerator key mappings if AutoHotkeys is maAutomatic or if AutoHotkeys is maParent and the parent menu item adjusts accelerator key mappings. Otherwise, Delphi does not alter the items listed in the Items property, but may adjust the accelerator keys for submenus, depending on the AutoHotkeys property of the menu item that is the parent of the submenu.

Note:	When AutoHotkeys disallows automatic adjustment of accelerator keys, an application can still adjust the menu items by calling the RethinkHotkeys method. AutoHotkeys merely controls whether this adjustment occurs automatically.


TMenuItem.AutoLineReduction

TMenuItem	See also

Determines whether redundant separator bars are automatically removed from the submenu.

property AutoLineReduction: TMenuItemAutoFlag;

Description

Set AutoLineReduction to indicate whether Delphi should automatically ensure that the submenu defined by the Items property does not start or end with a separator bar and that two separator bars do not appear next to each other. This ensures that menus built dynamically at runtime do not have separator bars in undesired positions.

Before the menu is displayed, Delphi removes superfluous separator bars if AutoLineReduction is maAutomatic or AutoLineReduction is maParent and the parent menu item removes superfluous separator bars. Otherwise, Delphi does not remove separators from the Items property, but may remove superfluous separators from submenus, depending on the AutoLineReduction property of the menu item that is the parent of the submenu.

Note:	When AutoLineReduction disallows automatic removal of separator bars, an application can still remove superfluous separators by calling the RethinkLines method. AutoLineReduction merely controls whether this adjustment occurs automatically.


TMenuItem.Bitmap

TMenuItem	See also

Designates a bitmap that is drawn for the menu item.

property Bitmap: TBitmap;

Description

Use Bitmap to provide a custom image that appears next to the caption in the menu item. On owner-draw menus, Bitmap can be used from an OnDrawItem event handler to represent the entire menu item or a portion of the menu item.

Note:	If the ImageIndex property is set and the parent menu has a non-nil Images property, the image identified by ImageIndex is used instead of Bitmap.


TMenuItem.Break

TMenuItem	See also

Determines whether the menu item starts a new column in the menu.

type TMenuBreak = (mbNone, mbBreak, mbBarBreak);

property Break: TMenuBreak;

Description

Set Break to break a long menu into columns at the item described by this menu item. These are the possible values:

Value	Meaning

mbNone	No menu breaking occurs. This is the default value.

mbBarBreak	The Parent menu breaks into another column with the menu item appearing at the top of the new column. A bar separates the new and the old columns.

mbBreak	The Parent menu breaks into another column with the menu item appearing at the top of the new column. Only space separates the new and the old columns.


TMenuItem.Caption

TMenuItem	See also 	Example

Specifies the text of the menu item.

property Caption: string;

Description

Set Caption to the string the user sees for this item in the menu. To underline a character in a string, include an ampersand (&) before the character. This type of character is called an accelerator character. If Caption includes an accelerator character, the user can select the menu item by pressing Alt while typing the underlined character.

Tip:	To automatically assign or adjust the accelerator characters in menu item captions, use the RethinkHotkeys method.

Use the Caption property to identify the menu item as a line that separates the menu into parts. Specify a hyphen character (-) as the value of Caption for the menu item to indicate that the menu item is a separator. To separate the menu into multiple columns, use the Break property instead.

Note:	This property is not stored with the menu item if it is supplied by a TAction object.


TMenuItem.Checked

TMenuItem	See also

Specifies whether a check mark should appear beside the Caption.

property Checked: Boolean;

Description

Use Checked to allow a menu item to work like a check box. If Checked is True, the menu item appears checked. If Checked is False, the menu item remains unchecked.

Note:	This property is not stored with the menu item if it is supplied by a TAction object.


TMenuItem.Command

TMenuItem	See also	Example

Specifies the Windows Command ID associated with the menu item.

property Command: Word;

Description

Use Command in an application that directly handles WM_COMMAND messages. When the user selects the menu item, Windows sends a WM_COMMAND to the window associated with the menu. The ItemID of the message contains the value of the Command property of the menu item that was selected.


TMenuItem.Count

TMenuItem	See also 	Example

Indicates the number of subitems of the menu item.

property Count: Integer;

Description

Read Count to determine the number of subitems listed in the Items property array. When the user clicks on a menu item that has subitems, a dropdown menu appears which displays those subitems. Each subitem can, in turn, contain additional subitems. The Count property counts only the immediate subitems of the menu item.


TMenuItem.Default

TMenuItem	See also

Specifies whether the menu item is invoked when the parent item is double clicked.

property Default: Boolean;

Description

Set Default to specify whether a menu item is the default item in a submenu. Default menu items are executed when the parent item is double-clicked, allowing users to avoid navigating the submenus that contain them.

The default item appears in boldface. A submenu can have only one default item. If the Items list of the parent menu item already contains a default menu item, setting the Default property to True sets the Default property of the previous default item to False.


TMenuItem.Enabled

TMenuItem	See also 	Example

Specifies whether the menu item is enabled.

property Enabled: Boolean;

Description

Use Enabled to enable or disable a menu item. If Enabled is True, the Click method is called when the user selects the item with the mouse. If Enabled is False, the menu item appears dimmed and the user cannot select it. However, calling the Click method works even when Enabled is False.

Note:	This property is not stored with the menu item if it is supplied by a TAction object.


TMenuItem.GroupIndex

TMenuItem	See also

Identifies the logical group to which the menu item belongs.

property GroupIndex: Byte;

Description

Use GroupIndex to control how menus are merged. In applications that contain multiple forms, items from the menus of secondary forms can be merged into the application’s main menu as those forms become active. MDI applications always merge the menus of child windows with the main menu of the parent window.

By default, all menu items in a menu bar (main menu) have the same GroupIndex value. To use GroupIndex to merge menus, set the GroupIndex value of each successive menu item to a value equal to or greater than that of the previous menu item.

When a menu item in a menu bar that is merged into the application’s main menu has the same GroupIndex value as a menu item in the main menu, the menu item in the application’s main menu is replaced by the corresponding menu item. If multiple menu items in the application’s main menu have the same GroupIndex value, they can be replaced only by separate menu items from the other form’s menu that also have repeated GroupIndex values. Thus, the first main menu item with a given value is replaced by the first item in the second form with that value, the second item in the main form is replaced by the second item in the second form, and so on.

When a menu item in a menu bar that is merged into the application’s main menu has a GroupIndex that falls between the GroupIndex values of two adjacent items on the application’s main menu, that menu item is inserted between the two adjacent items. If the item’s GroupIndex value is greater than all other GroupIndex values in the application’s main menu, the item appears at the end of the main menu. If the GroupIndex value is less than all other GroupIndex values in the application’s main menu, the menu item appears at the beginning of the main menu bar.

When an object created by an OLE 2.0 server application is activated, the server can try to merge its menus with the menus of the container application. The GroupIndex property is used to replace up to three main menu items with items from the server, in the manner described above. The server application uses the following predefined GroupIndex values to locate menu items to replace:

Group	Index	Description

Edit	1	Server menu items for editing the active OLE object

View	3	Server menu items for modifying the view of the OLE object.

Help	5	Server menu items for accessing the server’s online Help.

Note:	 See the documentation for the OLE server for information about whether it attempts menu merge during in-place activation.

GroupIndex can also be used to define groups of menu items that act like radio buttons. To allow menu items to behave like radio buttons, set the RadioItem property to all menu items in the group to True, and assign each menu item the same value of GroupIndex. Checking any menu item in the group will then uncheck the others.


TMenuItem.Handle

TMenuItem	See also

Indicates the Windows menu handle of the drop-down menu associated with the menu item.

property Handle: HMENU;

Description

Use Handle when calling a Windows API function that requires a menu handle. Handle is only valid if the Count property is greater than 0.


TMenuItem.HelpContext

TMenuItem	See also

Specifies the help context ID associated with the menu item.

property HelpContext: THelpContext;

Description

Use HelpContext to associate the menu item with a screen in the Help system of the application. Each screen in the Help system should have a unique context ID. When a menu item is selected using the keyboard, pressing F1 displays a Help screen. Which Help screen appears depends on the value of the HelpContext property.

Note:	This property is not stored with the menu item if it is supplied by a TAction object.


TMenuItem.Hint

TMenuItem	See also

Specifies the text string that can appear when the user moves the mouse pointer over a menu item.

property Hint: string;

Description

Set Hint to a string that provides more information about the meaning of the menu item than the Caption. The hint text appears in a Help Hint window when the user pauses with the mouse over the menu item if Help Hints are enabled (that is, if the Form’s and the Application’s ShowHint properties are True). It is also available for the code in the application’s OnHint event handler.

The value of Hint can specify both a short value for the Help Hint window and a longer string to be used by the OnHint event handler. To provide both a short and a long hint, set Hint to the short string, followed by a vertical bar (|), followed by the long string.

Note:	This property is not stored with the menu item if it is supplied by a TAction object.


TMenuItem.ImageIndex

TMenuItem	See also

Indicates which image maintained by the parent menu appears next to the menu item.

property ImageIndex: TImageIndex;

Description

Set ImageIndex to designate an image that should appear next to the caption when the menu item is drawn. On top-level menu items, ImageIndex specifies a zero-offset index into the Images property of the parent menu (TMenu or TPopupMenu). On submenu items, ImageIndex is the zero-offset index into the parent item’s SubMenuImages property.

If the parent menu or item does not maintain a list of images, use the Bitmap property to provide an image for a single menu item. However, any image specified by ImageIndex takes precedence over the Bitmap property. Bitmap is only used when ImageIndex has a negative value or the parent’s Images or SubMenuImages property is nil.

Note:	This property is not stored with the menu item if it is supplied by a TAction object.


TMenuItem.Items

TMenuItem	See also 	Example

Lists the menu items in the submenu of the menu item.

property Items[Index: Integer]: TMenuItem; default;

Description

Use Items to access to a subitem by its position in the list of subitems. The value of Index is the position of the subitem within the Items array. For example, if an application has a File drop-down menu that contains the menu items New, Open, and Save, in that order, FileMenu.Items[2] refers to the Save command.


TMenuItem.MenuIndex

TMenuItem	See also

Indicates the index of the menu item within its parent menu.

property MenuIndex: Integer;

Description

Use MenuIndex to locate the menu item in the Items property of its parent menu item. Changing this value moves the menu item within its menu.

Note:	MenuIndex may not correspond to the position of the item in the menu the user sees. The menu can include items that are not visible.


TMenuItem.Parent

TMenuItem	See also

Identifies the parent menu item of this menu item.

property Parent: TMenuItem;

Description

Read Parent to determine the menu item that represents the dropdown menu that contains this menu item. If the menu item is a top level menu item in a main menu or pop-up menu, Parent is the value of that menu’s Items property.


TMenuItem.RadioItem

TMenuItem	See also

Specifies whether the menu item is mutually exclusive with other menu items in its group.

property RadioItem: Boolean;

Description

Use RadioItem to make the menu item behave like a radio button with a group of other menu items. When RadioItem is True, only one menu item in the group that contains the menu item can be selected at a time. The group of menu items is the set of all menu items in a pop-up or drop-down menu that have the same value of GroupIndex. The single selected menu item in the group is indicated by a round dot next to the Caption.

RadioItem does not work for the top-level items in a main menu.

Note:	Under Windows NT 3.51, the round dot indicator only appears if the “new shell” has been installed.


TMenuItem.ShortCut

TMenuItem	See also

Specifies the key combination users can type to quickly access the menu item.

property ShortCut: TShortCut

Description

Use ShortCut to allow the user to type a key combination instead of selecting the item using the menu. This key combination appears to the right of the menu item in the menu.

When setting menu shortcuts at design time, the Object Inspector provides a long list of key combinations to choose from. To create menu shortcuts at runtime, use the global ShortCut or TextToShortCut function. For example, the following line creates a shortcut, Ctrl+C and assigns it to a menu item named CloseCommand.

CloseCommand.ShortCut := ShortCut(Word('C'), [ssCtrl]);

Note:	This property is not stored with the menu item if it is supplied by a TAction object.


TMenuItem.SubMenuImages

TMenuItem	See also

Lists the images that can appear beside individual items in a submenu of this menu item.

property SubMenuImages: TCustomImageList;

Description

Use SubMenuImages to supply a set of images that can appear beside items listed in the Items property. Individual menu items set their ImageIndex property to indicate which image in the list appears to the left of the menu item caption.

Tip:	If the application uses action lists, this property can be the value of the command list’s Images property. This way, menu items and buttons that do the same thing can display the same image.


TMenuItem.Visible

TMenuItem	See also

Specifies whether the menu item appears in the menu.

property Visible: Boolean;

Description

Use Visible to prevent the user from seeing an item in the menu. For example, remove menu items that do not apply to the current component of a pop-up menu in an OnPopup event handler.

If Visible is True, the menu item appears. If Visible is False, the menu item is hidden.

Note:	This property is not stored with the menu item if it is supplied by a TAction object.


TMenuItem events

TMenuItem	Alphabetically	Legend

In TMenuItem

OnAdvancedDrawItem

OnClick

OnDrawItem

OnMeasureItem


TMenuItem events

TMenuItem	By object	Legend

OnAdvancedDrawItem

OnClick

OnDrawItem

OnMeasureItem


TMenuItem.OnAdvancedDrawItem

TMenuItem	See also

Occurs when an owner-draw menu needs to be drawn.

type TAdvancedMenuDrawItemEvent = procedure (Sender: TObject; ACanvas: TCanvas; ARect: TRect; State: TOwnerDrawState) of object;

property OnAdvancedDrawItem: TAdvancedMenuDrawItemEvent;

Description

Write an OnAdvancedDrawItem event handler to render the image of a menu item in an owner-draw menu. The ACanvas parameter provides a drawing surface on which to draw the menu item. The ARect parameter indicates the boundaries (in pixels) of the menu item on that canvas. The State parameter is a set indicating various aspects of the menu items state such as whether it is selected, checked, grayed, and so on.

Use the Bitmap property or the ImageIndex property to access a bitmap that represents the menu item.

Note:	OnAdvancedDrawItem will only occur if the parent menu’s OwnerDraw property is True or the parent menu has a non-nil Images property.


TMenuItem.OnClick

TMenuItem	See also 	Example

Occurs when the user clicks menu item.

property OnClick: TNotifyEvent;

Description

Write an OnClick event handler to implement the desired behavior for when the user selects the menu item. An advantage of using the OnClick event handler over directly handling WM_COMMAND messages sent when the user selects the menu item, is that only the OnClick event occurs when the Click method is called.

Note:	This event handler is not stored with the menu item if it is supplied by a TAction object.


TMenuItem.OnDrawItem

TMenuItem	See also

Occurs when an owner-draw menu needs to be drawn.

type TMenuDrawItemEvent = procedure (Sender: TObject; ACanvas: TCanvas; ARect: TRect; Selected: Boolean) of object;

property OnDrawItem: TMenuDrawItemEvent;

Description

Write an OnDrawItem event handler to render the image of a menu item in an owner-draw menu. The ACanvas parameter provides a drawing surface on which to draw the menu item. The ARect parameter indicates the boundaries (in pixels) of the menu item on that canvas. The Selected parameter indicates whether the menu item is selected (that is, if it will be clicked if the user presses return).

Use the Bitmap property or the ImageIndex property to access a bitmap that represents the menu item.

Note:	OnDrawItem will only occur if the parent menu’s OwnerDraw property is True or the parent menu has a non-nil Images property.

Tip:	For more precise information about the menu item’s state, use the OnAdvancedDrawItem event instead.


TMenuItem.OnMeasureItem

TMenuItem	See also

Occurs on owner-draw menu items to determine menu item size before the menu is drawn.

type TMenuMeasureItemEvent = procedure (Sender: TObject; ACanvas: TCanvas; var Width, Height: Integer) of object;

property OnMeasureItem: TMenuMeasureItemEvent;

Description

Write an OnMeasureItem event handler to indicate the size of owner-draw menu items. The ACanvas property represents the canvas where the menu item will be drawn. Use its methods, if necessary, to determine the size of the menu item. Return the size of the menu item as the Width and Height parameters.

If the menu item is using a bitmap image, use the Bitmap property or the ImageIndex property to access the bitmap to determine its size.

Note:	OnMeasureItem will only occur if the parent menu’s OwnerDraw property is True or the parent menu has a non-nil Images property.


TMenuItem methods

TMenuItem	Alphabetically

In TMenuItem

Add

Clear

Click

Create

Delete

Destroy

Find

GetImageList

GetParentComponent

GetParentMenu

HasParent

IndexOf

InitiateAction

Insert

InsertNewLineAfter

InsertNewLineBefore

IsLine

NewBottomLine

NewTopLine

Remove

RethinkHotkeys

RethinkLines

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMenuItem methods

TMenuItem	By object

Add

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Click

Create

DefaultHandler

Delete

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

Find

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetImageList

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetParentMenu

HasParent

IndexOf

InheritsFrom

InitiateAction

InitInstance

Insert

InsertComponent

InsertNewLineAfter

InsertNewLineBefore

InstanceSize

IsLine

MethodAddress

MethodName

NewBottomLine

NewInstance

NewTopLine

Remove

RemoveComponent

RethinkHotkeys

RethinkLines

SafeCallException

UpdateAction


TMenuItem.Add

TMenuItem	See also 	Example

Adds one or more menu items to the end of the Items property array.

procedure Add(Item: TMenuItem); overload;

procedure Add(const AItems: array of TMenuItem); overload;

Description

Use Add to add new menu items to the dropdown menu for this menu item. If this menu item is the value of the Items property of a main menu or pop-up menu, Add adds the items to the end of the menu.

Specify a single new menu item to add as the value of the Item parameter, or an array of new menu items as the value of the AItems parameter.


TMenuItem.Clear

TMenuItem	See also

Removes and frees all menu items listed in the Items property.

procedure Clear;

Description

Use Clear to free all the items listed in the Items property array.


TMenuItem.Click

TMenuItem	See also

Simulates a mouse click.

procedure Click; virtual;

Description

Click generates an OnClick event, as if the user had clicked the menu item. Unlike a real mouse click, Click does not generate a WM_COMMAND message to the window associated with the menu.

Component writers can override click to provide a different response when the user selects the menu item.


TMenuItem.Create

TMenuItem	See also 	Example

Creates an instance of TMenuItem.

constructor Create(AOwner: TComponent); override;

Description

Use Create to create a menu item at runtime.

Menu items defined at design time using the Menu designer are created automatically. After calling the inherited constructor, Create initializes the Visible and Enabled properties to True, and generates a unique value for the Command property.

The Component parameter is the Owner component that is responsible for freeing the menu item.


TMenuItem.Delete

TMenuItem	See also

Removes a menu item from the Items property array.

procedure Delete(Index: Integer);

Description

Call Delete to remove a menu item and all its submenus from a menu. The Index parameter is the index of the item to be deleted, where 0 specifies the first item in the menu, 1 specifies the second item, and so on.

Delete does not free the removed item's memory. To remove an item from the menu and free its memory, call the Free method in the item you want to remove.

To temporarily hide a menu item, without deleting it, use the Visible property.


TMenuItem.Destroy

TMenuItem	See also

Destroys an instance of TMenuItem.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TMenuItem reference is not nil, and only then calls Destroy.


TMenuItem.Find

TMenuItem	See also

Locates a menu item in the Items property array given its caption.

function Find(ACaption: string): TMenuItem;

Description

Use Find to locate the menu item in the Items property array with the caption specified by the ACaption parameter. Find ignores accelerator characters when comparing item captions to the ACaption parameter.

Find returns the first menu item in the Items property array with the specified caption, or, if no item is found, nil.


TMenuItem.GetImageList

TMenuItem	See also

Returns the Image list that supplies an image for the menu item.

function GetImageList: TCustomImageList;

Description

Use GetImageList to access the list of images that contains the image for this menu item. The ImageIndex property indentifies a specific image from the list that GetImageList returns.

GetImageList first checks the Parent of this menu item for a SubMenuImages property. If the parent menu item does not maintain a list of images, it checks that menu item’s parent, and so on until reaching a top-level menu item (a menu item where Parent is nil). If none of the parent menu items has a SubMenuImages property, GetImageList checks the top-level menu for an Images property.

GetImageList returns the first image list it finds, or nil if it doesn’t find an image list.


TMenuItem.GetParentComponent

TMenuItem

Returns the parent component of the menu item.

function GetParentComponent: TComponent; override;

Description

GetParentComponent is called by the streaming system that loads and saves VCL components. It ensures that objects are loaded and saved with their parent objects. GetParentComponent is overriden in descendant classes to return the appropriate parent for their particular type of component.TMenuItem overrides it to identify its associated menu, if it has one, as its parent.


TMenuItem.GetParentMenu

TMenuItem	See also

Returns the main menu of which the menu item is part.

function GetParentMenu: TMenu;

Description

GetParentMenu returns the menu that contains the menu item.


TMenuItem.HasParent

TMenuItem	See also

Indicates that the menu item has a parent that is responsible for loading and saving its data.

function HasParent: Boolean; override;

Description

TMenuItem overrides HasParent to return True, indicating that menu items have a parent. Applications seldom call the HasParent method. It is used by the streaming system that loads and saves VCL objects to determine when another object is responsible for writing a component to a stream.


TMenuItem.IndexOf

TMenuItem	See also

Returns the position of a menu item within the Items array.

function IndexOf(Item: TMenuItem): Integer;

Description

Call IndexOf to locate a menu item in the submenu headed by this menu item. IndexOf returns 0 for the first menu item, 1 for the second menu item, and so on. If the menu item is not in the submenu, IndexOf returns -1.

Note:	IndexOf may not correspond to the position of the item in the menu the user sees if the menu includes some items that are not visible.


TMenuItem.InitiateAction

TMenuItem	See also

Calls the action link’s Update method if the menu item is associated with an action link.

procedure InitiateAction; virtual;

Description

InitiateAction calls the action link, if there is one for the menu item, to update the association between the action and the menu item.


TMenuItem.Insert

TMenuItem	See also 	Example

Inserts a menu item into a specified position in the Items array.

procedure Insert(Index: Integer; Item: TMenuItem);

Description

Use Insert to insert a new menu item to the dropdown menu for this menu item. If this menu item is the value of the Items property of a main menu or pop-up menu, Insert inserts an item into that menu. Specify the new menu item to add as the value of the Item parameter, and the position in the Items array as the value of the Index parameter.


TMenuItem.InsertNewLineAfter

TMenuItem	See also

Inserts a separator bar after a specified item from the Items property array.

function InsertNewLineAfter(AItem: TMenuItem): Integer;

Description

Use InsertNewLineAfter to insert a separator bar after the menu item specified by AItem. If AItem is not an item in the Items property array, InsertnewLineAfter raises an exception.

InsertNewLineAfter returns the index of the newly inserted separator item in the Items property array.

Tip:	When inserting separator bars at runtime, it is a good idea to set AutoLineReduction to True so that superfluous separators can be automatically removed.


TMenuItem.InsertNewLineBefore

TMenuItem	See also

Inserts a separator bar before a specified item from the Items property array.

function InsertNewLineBefore(AItem: TMenuItem): Integer;

Description

Use InsertNewLineBefore to insert a separator bar before the menu item specified by AItem. If AItem is not an item in the Items property array, InsertNewLineBefore raises an exception.

InsertNewLineBefore returns the index of the newly inserted separator item in the Items property array.

Tip:	When inserting separator bars at runtime, it is a good idea to set AutoLineReduction to True so that superfluous separators can be automatically removed.


TMenuItem.NewBottomLine

TMenuItem	See also

Inserts a separator bar at the end of the Items property array.

function NewBottomLine: Integer;

Description

Use NewBottomLine to insert a separator bar at the end of the items property array. This is useful when building up submenus dynamically at runtime.

NewBottomLine returns the index of the newly inserted separator item in the Items property array.

Tip:	When inserting separator bars at runtime, it is a good idea to set AutoLineReduction to True so that superfluous separators can be automatically removed.


TMenuItem.IsLine

TMenuItem	See also

Indicates whether the menu item represents a separator bar.

function IsLine: Boolean;

Description

Call IsLine to determine whether the menu item is a separator bar. IsLine checks the Caption of the menu item and returns True if the value of Caption is ‘-‘. Menu items with this Caption appear as separator bars.


TMenuItem.NewTopLine

TMenuItem	See also

Inserts a separator bar at the beginning of the Items property array.

function NewTopLine: Integer;

Description

Use NewTopLine to insert a separator bar at the beginning of the items property array. This is useful when building up submenus dynamically at runtime.

NewTopLine returns the index of the newly inserted separator item in the Items property array.

Tip:	When inserting separator bars at runtime, it is a good idea to set AutoLineReduction to True so that superfluous separators can be automatically removed.


TMenuItem.Remove

TMenuItem	See also

Removes a menu item from the Items property array

procedure Remove(Item: TMenuItem);

Description

Call Remove to remove a menu item and all its submenus from a menu. The Item parameter is the item to be removed. If Item is not a menu item in the Items array, Remove raises an exception.

Remove does not free the item's memory. To remove an item from the menu and free its memory, call the Free method in the item you want to remove.

To temporarily hide a menu item, without deleting it, use the Visible property.


TMenuItem.RethinkHotkeys

TMenuItem	See also

Adjusts the captions of subitems so that every item has an accelerator and there are no duplicate accelerator keys.

function RethinkHotkeys: Boolean;

Description

Call RethinkHotkeys to adjust the accelerator keys for the items in the Items property and in any submenu of those items. RethinkHotkeys checks for items that do not have an accelerator key or that have duplicate accelerator keys. It then replaces any duplicate accelerators with unique characters and adds accelerator keys to items that don’t have them. RethinkHotkeys gives first priority to existing accelerator key mappings, but may change them if necessary to ensure uniqueness.

RethinkHotkeys lets a menu adjust the accelerator keys when the AutoHotkeys property is False. For any menu or submenu that has AutoHotkeys set to True, this adjustment occurs automatically.

RethinkHotkeys returns True if RethinkHotkeys changed the Caption property of any menu items, False otherwise.


TMenuItem.RethinkLines

TMenuItem	See also

Removes superfluous separator lines from the Items property array.

function RethinkLines: Boolean;

Description

Call RethinkLines to remove superfluous spearators from the items in the Items property and in any submenu of those items. RethinkLines removes separators that appear at the very beginning or end of a submenu and separators that immediately follow another separator.

RethinkLines lets a menu remove superfluous separators when the AutoLineReduction property is False. For any menu or submenu that has AutoLineReduction set to True, this adjustment occurs automatically.

RethinkLines returns True if RethinkLines removed any menu items, False otherwise.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TMetafile

Hierarchy	Properties	Methods	Events	See also

TMetafile is an encapsulation of the Win32 Enhanced metafile.

Unit

graphics

Description

TMetafile contains a metafile graphic (EMF file format).

Properties of TMetafile indicate the size and characteristics of the metafile.

To draw a metafile on a canvas, call the Draw or StretchDraw methods of a TCanvas object, passing a TMetafile as a parameter. The Enhanced property determines how the metafile will be stored on disk. If Enhanced is True, the metafile is stored as an .EMF (Win32 Enhanced Metafile) file. If Enhanced is False, the metafile is stored as a .WMF (Windows 3.1 Metafile, with Aldus header).


TMetafile properties

TMetafile	Alphabetically	Legend

In TMetafile

CreatedBy

Description

Empty

Enhanced

Handle

Height

Inch

MMHeight

MMWidth

Palette

Transparent

Width

Derived from TGraphic

Modified

PaletteModified


TMetafile properties

TMetafile	By object	Legend

CreatedBy

Description

Empty

Enhanced

Handle

Height

Inch

MMHeight

MMWidth

Modified

Palette

PaletteModified

Transparent

Width


TMetafile.CreatedBy

TMetafile	See also

Specifies the name of the author or application used to create the metafile.

property CreatedBy: string;

Description

Use CreatedBy to set the string to an optional name of the author or application used to create the metafile. To set the CreatedBy string of a new metafile, call the CreateWithComment method of TMetafileCanvas.


TMetafile.Description

TMetafile	See also

Provides an optional text description that is embedded in the metafile.

property Description: string;

Description

Set the Description string of a new metafile by calling the CreateWithComment method of TMetafileCanvas.


TMetafile.Empty

TMetafile

Specifies whether the metafile object contains a metafile.

property Empty: Boolean;

Description

Empty is True if no metafile has been loaded into the metafile object and False if the metafile object contains a metafile.


TMetafile.Enhanced

TMetafile

Determines how the metafile will be stored on disk.

property Enhanced: Boolean;

Description

Use Enhanced to determine how the metafile is stored on disk. If Enhanced is True, the metafile is stored as an .EMF (Win32 Enhanced Metafile). If Enhanced is False, the metafile is stored as a .WMF (Windows 3.1 Metafile, with Aldus header).

The in-memory format is always EMF. WMF has very limited capabilities; storing as WMF will lose information that would be retained by EMF. This property is set to match the metafile type when loaded from a stream or file. If loaded as WMF, then save as WMF.


TMetafile.Handle

TMetafile 	See also

Provides access to the Windows GDI metafile handle, for accessing the GDI metafile object.

property Handle: HMetafile;

Description

Use Handle when calling a Windows API function that requires the handle of a metafile object. Pass the handle from the Handle property of the metafile object to the function.


TMetafile.Height

TMetafile	See also

Specifies the vertical size in pixels of the metafile.

property Height: Integer;

Description

Use Height to find or set the vertical height of the metafile.


TMetafile.Inch

TMetafile

Returns the units per inch that are used for the metafile's coordinate mapping.

property Inch: Word;

Description

Use Inch to find the units per inch assumed by a WMF metafile, and to alter scale when writing as WMF, but otherwise this property is obsolete. Enhanced metafiles maintain complete scale information internally. For example, if the metafile was created in a Twips coordinate system (using MM_TWIPS mapping), the value of Inch is 1440.


TMetafile.MMHeight

TMetafile	See also

Contains the height of the metafile image in 0.01 millimeter units, the native scale used by enhanced metafiles.

property MMHeight: Integer;

Description

MMHeight is used for a more accurate reading of the vertical size of the graphic. The Height property, by contrast, is always in screen device pixel units; to avoid loss of precision in converting between device pixels and millimeters, set or read the dimensions in millimeters with MMHeight.


TMetafile.MMWidth

TMetafile	See also

Contains the width of the metafile image in 0.01 millimeter units, the native scale used by enhanced metafiles.

property MMWidth: Integer;

Description

MMWidth is used for a more accurate reading of the horizontal size of the graphic. The Width property, by contrast, is always in screen device pixel units; to avoid loss of precision in converting between device pixels and millimeters, set or read the dimensions in millimeters with MMWidth.

The MMWidth property is always in screen device pixel units.


TMetafile.Palette

TMetafile

Controls a metafile's color mapping.

property Palette: HPalette;

Description

Use Palette to assign custom palettes created with the Windows API CreatePalette function to this property.

The Palette of a metafile contains up to 256 colors that can be used to display the metafile on screen. When running in a 256-color video mode, and if the metafile is drawn by an application running in the foreground, all colors of Palette are added to the Windows system palette. If the metafile is drawn by an application running in the background and another application has loaded the system palette with its own colors, the metafile's colors are mapped to the system palette. Palette=0 if the metafile has no palette.


TMetafile.Transparent

TMetafile

Indicates whether the image covers its rectangular area.

property Transparent: Boolean;

Description

Transparents specifies whether that the metafile be drawn transparently. TMetafile overrides the write method of the Transparent property to essentially make the property read-only, so setting the property for this object does not change their behavior.


TMetafile.Width

TMetafile	See also

Specifies the horizontal size in pixels of the metafile.

property Width: Integer;

Description

Use Width to find the horizontal size in pixels of the metafile.


TMetafile events

TMetafile	Alphabetically

Derived from TGraphic

OnChange

OnProgress


TMetafile events

TMetafile	By object

OnChange

OnProgress


TMetafile methods

TMetafile	Alphabetically

In TMetafile

Assign

Clear

Create

Destroy

LoadFromClipboardFormat

LoadFromStream

ReleaseHandle

SaveToClipboardFormat

SaveToFile

SaveToStream

Derived from TGraphic

LoadFromFile

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TMetafile methods

TMetafile	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

LoadFromClipboardFormat

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

ReleaseHandle

SafeCallException

SaveToClipboardFormat

SaveToFile

SaveToStream


TMetafile.Assign

TMetafile	See also

Copies an object to the metafile.

procedure Assign(Source: TPersistent);

Description

Assign copies the Enhanced and Palette properties of an object to the metafile. If the metafile is nil, Assign creates one. Otherwise, Assign calls the inherited method. For assignment, metafiles are polymorphic with other TGraphic objects, and with TPicture.


TMetafile.Clear

TMetafile	See also

Deletes the metafile image.

procedure Clear;

Description

Use Clear to release the old metafile image, create a new image, and increment a reference count on it.


TMetafile.Create

TMetafile	See also	Example

Instantiates a metafile object.

constructor Create; override;

Description

Call Create to instantiate a metafile at runtime.

Create allocates memory for a metafile object, and calls the inherited Create. Then sets the Enhanced and Transparent properties to True.

To create a metafile image from scratch, draw the image in a metafile canvas.  When the metafile canvas is destroyed, it transfers the image into the metafile object provided to the metafile canvas constructor. After the image is drawn on the canvas and the canvas is destroyed, the image is 'playable' in the metafile object.


TMetafile.Destroy

TMetafile	See also

Destroys an instance of a metafile object.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, an application should call Free. Free verifies that the TMetafile reference is not nil before it calls Destroy.

Destroy releases the image, which frees the image and the handle when the reference count on the metafile image is zero. Then Destroy calls the inherited Destroy.


TMetafile.LoadFromClipboardFormat

TMetafile	See also

Loads a metafile from the Clipboard.

procedure LoadFromClipboardFormat(AFormat: Word; AData: THandle; APalette: HPALETTE); override;

Description

LoadFromClipboardFormat replaces the current image with the data pointed to by the AData parameter. The palette for the metafile is specified by the APalette parameter. LoadFromClipboardFormat is called if the metafile is registered with the TPicture object using the RegisterClipboardFormat method.


TMetafile.LoadFromStream

TMetafile	See also

Loads the metafile from a stream.

procedure LoadFromStream(Stream: TStream); override;

Description

Use LoadFromStream by specifying the stream from which the metafile is loaded as the value of Stream. LoadFromStream reads a metafile from a stream and replaces the current image with it.


TMetafile.ReleaseHandle

TMetafile	See also

Releases the Windows GDI object represented by the metafile.

function ReleaseHandle: HENHMETAFILE;

Description

Call ReleaseHandle to release the resources used to represent the metafile. ReleaseHandle sets the Handle property to nil.

Call ReleaseHandle before setting the Handle property, so that the resources associated with the metafile are not lost.


TMetafile.SaveToClipboardFormat

TMetafile	See also

Saves a metafile to a Clipboard format.

procedure SaveToClipboardFormat(var AFormat: Word; var AData: THandle; var APalette: HPALETTE); override;

Description

Use SaveToClipboardFormat to copy the metafile to a Clipboard format. The resulting values can then be copied to the Windows clipboard using the clipboard’s SetAsHandle method.

The metafile’s palette is returned in the APalette parameter, the format in the AFormat parameter, and a handle to the data in the AData parameter. Before the metafile can be saved, an application must have registered the format with the metafile object using the RegisterClipboardFormat method.

To save a metafile to a file, call SaveToFile.


TMetafile.SaveToFile

TMetafile	See also

Writes the metafile to disk.

procedure SaveToFile(const Filename: String); override;

Description

Use SaveToFile to save the metafile to a file provided by the Filename parameter. To load a metafile from a file, call the LoadFromFile method.


TMetafile.SaveToStream

TMetafile	See also

Writes the metafile to a stream.

procedure SaveToStream(Stream: TStream); override;

Description

Use SaveToStream to save the metafile to the stream specified by the value of the Stream parameter.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TGraphic


TMonitor

Hierarchy	Properties	Methods	See also

TMonitor represents a monitor on which an application runs.

Unit

forms

Description

TMonitor represents a monitor that displays the user interface of an application. It introduces properties to describe the dimensions of a single monitor. When writing multi-monitor applications, use TMonitor to help lay out forms and dialogs so that they are not split over several monitors.

Applications do not create instances of TMonitor. Instead, monitor components for all available monitors are listed by the Monitors property of the global Screen variable. The global Screen variable also provides global information about the monitors on which the application runs, such as screen resolution, available fonts, and so on.


TMonitor properties

TMonitor	Alphabetically	Legend

In TMonitor

Handle

Height

Left

MonitorNum

Top

Width


TMonitor properties

TMonitor	By object	Legend

Handle

Height

Left

MonitorNum

Top

Width


TMonitor.Handle

TMonitor	See also

Indicates the Windows handle for the monitor.

type

  HMONITOR = type Integer;

property Handle: HMONITOR;

Description

Read Monitor to obtain a Windows handle for the monitor represented by this TMonitor component. Use this handle for Windows API calls such as GetMonitorInfo.


TMonitor.Height

TMonitor	See also

Indicates the vertical size of the monitor in pixels.

property Height: Integer;

Description

Read Height to learn the size of the monitor in pixels. Use this value along with the Top property to calculate how to position objects vertically in multi-monitor applications.


TMonitor.Left

TMonitor	See also

Indicates the logical position of the left edge of the monitor.

property Left: Integer;

Description

In multi-monitor applications, the available screen space can span multiple monitors from left to right. Read Left to determine where, in the entire available screen space, this monitor appears.


TMonitor.MonitorNum

TMonitor	See also

Specifies the index of the monitor in the global screen object’s Monitors list.

property MonitorNum: Integer;

Description

The global screen variable maintains a list of all monitors in a multi-monitor application. MonitorNum is the index of this monitor in the list object that is the screen’s Monitors property.

Use MonitorNum to identify a specific monitor when working with multiple monitors.


TMonitor.Top

TMonitor	See also

Indicates the logical position of the top edge of the monitor.

property Top: Integer;

Description

In multi-monitor applications, the available screen space can span multiple monitors from top to bottom. Read Top to determine where, in the entire available screen space, this monitor appears.


TMonitor.Width

TMonitor	See also

Indicates the horizontal size of the monitor in pixels.

property Width: Integer;

Description

Read Width to learn the size of the monitor in pixels. Use this value along with the Left property to calculate vertical positions for objects in multi-monitor applications.


TMonitor methods

TMonitor	Alphabetically

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TMonitor methods

TMonitor	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Scope

Published

Accessibility

Read-only


Hierarchy

TObject


TMouse

Hierarchy	Properties	Methods

Contains information about the mouse.

Unit

Controls

Description

Use the global Mouse variable, which is a TMouse object, to get information about the mouse.


TMouse properties

TMouse	Alphabetically	Legend

In TMouse

Capture

CursorPos

DragImmediate

DragThreshold

MousePresent

RegWheelMessage

WheelPresent

WheelScrollLines


TMouse properties

TMouse	By object	Legend

Capture

CursorPos

DragImmediate

DragThreshold

MousePresent

RegWheelMessage

WheelPresent

WheelScrollLines


TMouse.Capture

TMouse

Specifies the handle of the window that is capturing mouse events.

property Capture: HWND;

Description

Use Capture to get the handle of the window that is capturing mouse events.


TMouse.CursorPos

TMouse

Specifies the position of the mouse cursor.

property CursorPos: TPoint;

Description

Use CursorPos to get the position of the mouse cursor.


TMouse.DragImmediate

TMouse

Specifies whether clicking the left mouse button starts a drag event immediately.

property DragImmediate: Boolean;

Description

Use DragImmediate to determine whether clicking the left mouse button starts a drag event immediately. If DragImmediate is False, then drag events are delayed until the mouse cursor is moved the number of pixels specfied in the DragTheshold property.


TMouse.DragThreshold

TMouse

Specifies the number of pixels that the mouse cursor must be moved with the left mouse button held down in order to cause a drag event.

property DragThreshold: Integer;

Description

Use DragThreshold to specify the number of pixels that the mouse cursor must be moved with the left mouse button down in order to cause a drag event.


TMouse.MousePresent

TMouse

Specifies whether a mouse is present on the system.

property MousePresent: Boolean;

Description

Use MousePresent to determine whether a mouse is present on the system.


TMouse.RegWheelMessage

TMouse

Specifies the windows message that is sent when the user scrolls the mouse wheel.

type UINT = LongWord;

property RegWheelMessage: UINT;

Description

Use RegWheelMessage to get the windows message that is sent when the user scrolls the mouse wheel.

RegWheelMessage is used in Windows 95, but not Windows 98 and Windows NT. (Mouse support is built into the later operating systems.)


TMouse.WheelPresent

TMouse

Specifies whether the mouse has a wheel.

property WheelPresent: Boolean;

Description

Use WheelPresent to determine whether the mouse has a wheel.


TMouse.WheelScrollLines

TMouse

Specifies the number of lines that are scrolled for each notch that the mouse wheel is rotated.

property WheelScrollLines: Integer;

Description

Use WheelScrollLines to get the number of lines that are scrolled for each notch that the mouse wheel is rotated.

The WheelScrollLines can be set under Mouse in the Windows Control Panel.


TMouse methods

TMouse	Alphabetically

In TMouse

Create

Destroy

SettingChanged

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TMouse methods

TMouse	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

FreeInstance

Free

GetInterfaceEntry

GetInterfaceTable

GetInterface

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

SettingChanged


TMouse.Create

TMouse

Creates and initializes a TMouse object.

constructor Create;

Description

Use Create to create and initialize a TMouse object.

Create sets DragImmediate to True and DragThreshold to 5.


TMouse.Destroy

TMouse

Destroys an instance of TMouse.

destructor Destroy; override;

Description

Do not call Destroy. Instead, call Free.

Destroy calls the inherited destructor and then sets Capture to 0.


TMouse.SettingChanged

TMouse

Called when a Mouse setting is changed.

procedure SettingChanged(Setting: Integer);

Description

SettingChanged is called automatically when the application receives notification from Windows that the control panel settings have changed. It updates the Mouse object to reflect the current control panel settings.

Applications should not need to call this method.


Accessibility

Read-only


Hierarchy

TObject


TMasterDataLink

Hierarchy	Properties	Methods	Events	See also

TMasterDataLink allows a dataset to establish a master/detail relationship.

Unit

db

Description

Use TMasterDataLink as a private member of a dataset object that can represent the detail records for another dataset. TMasterDataLink maintains a list of field components from the master dataset, and passes on data events to the data source that owns it. In the constructor of the dataset that uses TMasterDataLink to link to another data source, create the TMasterDataLink object and set any event handlers to respond to data events.

Do not confuse the dataset that is the value of the DataSet property of TMasterDataLink with the dataset that uses TMasterDataLink to link to a master dataset. The DataSet property is the master dataset, while the dataset that owns the TMasterDataLink object is the detail set.

TClientDataSet and TTable objects already include a TMasterDataLink object.


TMasterDataLink properties

TMasterDataLink	Alphabetically	Legend

In TMasterDataLink

FieldNames

Fields

DetailDataSet

Derived from TDataLink

Active

ActiveRecord

BOF

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

Eof

ReadOnly

RecordCount


TMasterDataLink properties

TMasterDataLink	By object	Legend

Active

ActiveRecord

BOF

BufferCount

DataSet

DataSource

DataSourceFixed

DetailDataSet

Editing

Eof

FieldNames

Fields

ReadOnly

RecordCount


TMasterDataLink.DetailDataSet

TMasterDataLink

Indicates the detail dataset in the master/detail relationship.

property DetailDataSet: TDataSet;

Description

Read DetailDataSet to access the detail dataset. This is the dataset that includes the master data link as a member to connect it to a master dataset.


TMasterDataLink.FieldNames

TMasterDataLink	See also

Contains the names of fields from the data source that are represented by the dataset that owns the TMasterDataLink object.

property FieldNames: String;

Description

Set FieldNames to the fields that the dataset which owns the TMasterDataLink object should represent. Each field name in the string must be separated from other field names with a semicolon.

Setting FieldNames causes TMasterDataLink to regenerate the Fields property from the field components of the source dataset. Once the Fields property has been regenerated, TMasterDataLink triggers an OnMasterChange event.


TMasterDataLink.Fields

TMasterDataLink	See also

Lists all the field components from the data source that are used by the dataset that owns the TMasterDataLink.

property Fields: TList;

Description

Use Fields to access individual field components from the source data set. Fields provides the values for the Fields property of the dataset that owns the TMasterDataLink.

Fields is a read-only property. Fields is generated by locating the field components referenced by the FieldNames property in the source dataset.


TMasterDataLink events

TMasterDataLink	Alphabetically

In TMasterDataLink

OnMasterChange

OnMasterDisable


TMasterDataLink events

TMasterDataLink	By object

OnMasterChange

OnMasterDisable


TMasterDataLink.OnMasterChange

TMasterDataLink	See also

Occurs after the Fields property changes.

property OnMasterChange: TNotifyEvent;

Description

Write an OnMasterChange event handler to update the dataset that owns the TMasterSourceLink to reflect any changes that occurred in the source dataset or the FieldNames property. The Fields property reflects the new state of the source dataset and the FieldNames property. If FieldNames refers to any fields that disappeared from the source dataset, the Fields property contains undefined field components for those fields.


TMasterDataLink.OnMasterDisable

TMasterDataLink	See also

Occurs when the source dataset becomes inactive.

property OnMasterDisable: TNotifyEvent;

Description

Write an OnMasterDisable event handler to respond when the source dataset that provides the data for the dataset which owns the TMasterDataLink becomes inactive. When the source dataset is inactive, the field components in the Fields property can not be used to obtain the data from records in the source dataset. Thus, only information cached by the dataset which owns the TMasterDataLink can be used after OnMasterDisable until the next OnMasterChange event occurs.


TMasterDataLink methods

TMasterDataLink	Alphabetically	Legend

In TMasterDataLink

ActiveChanged

CheckBrowseMode

Create

Destroy

GetDetailDataSet

LayoutChanged

RecordChanged

Derived from TDataLink

Edit

ExecuteAction

UpdateAction

UpdateRecord

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TMasterDataLink methods

TMasterDataLink	By object	Legend

ActiveChanged

AfterConstruction

Assign

BeforeDestruction

CheckBrowseMode

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

Edit

ExecuteAction

FieldAddress

Free

FreeInstance

GetDetailDataSet

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

LayoutChanged

MethodAddress

MethodName

NewInstance

RecordChanged

SafeCallException

UpdateAction

UpdateRecord


TMasterDataLink.ActiveChanged

TMasterDataLink	See also

Regenerates the Fields property and triggers an OnMasterChange or OnMasterDisable event.

procedure ActiveChanged; override;

Description

Applications can not call the ActiveChanged procedure directly. Changes in the Active property trigger this procedure. When the source dataset becomes inactive, ActiveChanged empties the Fields property and generates an OnMasterDisable event. When the dataset becomes active, ActiveChanged regenerates Fields from the source dataset and generates an OnMasterChange event.


TMasterDataLink.CheckBrowseMode

TMasterDataLink	See also

Informs the dataset that owns the TMasterDataLink object when the current record in the source dataset is about to change.

procedure CheckBrowseMode; override;

Description

Applications can not call the CheckBrowseMode procedure directly. CheckBrowseMode is called immediately before the current record in the source dataset changes. It calls the CheckBrowseMode method of the dataset that owns the TMasterDataLink object, so that it can post any pending edits before the record changes.


TMasterDataLink.Create

TMasterDataLink	See also

Creates an instance of TMasterDataLink.

constructor Create(DataSet: TDataSet);

Description

Call Create from the constructor of the dataset that uses TMasterDataLink to link to a secondary data source. The dataset that uses the TMasterDataLink passes itself as the DataSet parameter.

Create associates the instance of TMasterDataLink with the dataset that owns it, and creates the helper objects it uses to manage the list of field components.


TMasterDataLink.Destroy

TMasterDataLink	See also

Destroys an instance of TMasterDataLink.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call the Free method   from the destructor of the dataset that owns the TMasterDataLink object. Free checks that the TMasterDataLink reference is not already freed, and only then calls Destroy.

Destroy frees up the memory used to manage the list of field components.


TMasterDataLink.GetDetailDataSet

TMasterDataLink	See also

Returns the value of the DetailDataSet property.

function GetDetailDataSet: TDataSet; override;

Description

GetDetailDataSet is the protected read implementation of the DetailDataSet property.


TMasterDataLink.LayoutChanged

TMasterDataLink	See also

Informs the dataset that owns the TMasterDataLink object after the data source has changed the number of records buffered.

procedure LayoutChanged; override;

Description

Applications can not call the LayoutChanged method directly. LayoutChanged is called automatically when the source dataset changes to reflect a change in the layout of a control linked to that source dataset. LayoutChanged regenerates the Fields property and triggers an OnMasterChange event.


TMasterDataLink.RecordChanged

TMasterDataLink	See also

Generates an OnMasterChange event when the contents of one of the fields in the current record changes.

procedure RecordChanged(Field: TField); override;

Description

Applications can not call RecordChanged directly. It is called automatically when the contents of the current record change. The Field parameter indicates which field in the current record has changed. If Field is nil, the entire record has changed.

If the Field parameter is nil, or if the Field parameter is one of the fields listed in the Fields property, RecordChanged triggers an OnMasterChange event.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink

TDetailDataLink


TMultiReadExclusiveWriteSynchronizer

Hierarchy	Methods	See also

TMultiReadExclusiveWriteSynchronizer protects memory in a multi-threaded application.

Unit

sysutils

Description

Use TMultiReadExclusiveWriteSynchronizer to guard access to memory in a multi-threaded application. Unlike a critical section, which blocks all other threads from reading or writing its associated memory, TMultiReadExclusiveWriteSynchronizer allows multiple threads to read from the protected memory simultaneously, while ensuring that any thread writing to the memory has exclusive access.

In applications where threads read from an object or variable frequently and only write to it occasionally, using the multi-read exclusive-write synchronizer instead of a critical section can result in considerable performance improvement.

All access to the protected memory must be bracketed by calls to the BeginRead and EndRead or BeginWrite and EndWrite methods. Any thread that reads from or writes to this memory without using these calls can introduce thread conflicts.


TMultiReadExclusiveWriteSynchronizer methods

TMultiReadExclusiveWriteSynchronizer	Alphabetically

In TMultiReadExclusiveWriteSynchronizer

BeginRead

BeginWrite

Create

Destroy

EndRead

EndWrite

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TMultiReadExclusiveWriteSynchronizer methods

TMultiReadExclusiveWriteSynchronizer	By object

AfterConstruction

BeforeDestruction

BeginRead

BeginWrite

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

EndRead

EndWrite

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TMultiReadExclusiveWriteSynchronizer.BeginRead

TMultiReadExclusiveWriteSynchronizer	See also

Allows a thread to read from the protected memory when it is safe to do so.

procedure BeginRead;

Description

Call BeginRead before reading from the memory protected by the multi-read exclusive-write synchronizer. BeginRead does not return until there are no other threads writing to the memory. After calling BeginRead, other threads can be granted read access to the protected memory by the BeginRead method. However, any thread asking for write permission by calling BeginWrite must wait until all reading threads have called EndRead.


TMultiReadExclusiveWriteSynchronizer.BeginWrite

TMultiReadExclusiveWriteSynchronizer 	See also

Allows a thread to write to the protected memory when it is safe to do so.

procedure BeginWrite;

Description

Call BeginWrite before writing to the memory that the multi-read exclusive-write synchronizer protects. BeginWrite does not return until no other threads are reading from or writing to the memory. After calling BeginWrite, any thread asking to access that memory by calling BeginRead or BeginWrite must wait until the writing thread calls EndWrite.


TMultiReadExclusiveWriteSynchronizer.Create

TMultiReadExclusiveWriteSynchronizer

Creates and initializes an instance of TMultiReadExclusiveWriteSynchronizer.

constructor Create;

Description

Call Create to instantiate TMultiReadExclusiveWriteSynchronizer. The synchronizer must be created in the same thread as the memory it protects, so that it is accessible to all threads that need to access that memory.


TMultiReadExclusiveWriteSynchronizer.Destroy

TMultiReadExclusiveWriteSynchronizer 	See also

Destroys an instance of TMultiReadExclusiveWriteSynchronizer.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TMultiReadExclusiveWriteSynchronizer reference is not nil, and only then calls Destroy.


TMultiReadExclusiveWriteSynchronizer.EndRead

TMultiReadExclusiveWriteSynchronizer	See also

Removes a thread from the internal list of threads that are accessing the protected memory.

procedure EndRead;

Description

Call EndRead after reading from the memory protected by the multi-read exclusive-write synchronizer. Each call to BeginRead must be matched by a call to EndRead, or other threads can never return from the BeginWrite method.


TMultiReadExclusiveWriteSynchronizer.EndWrite

TMultiReadExclusiveWriteSynchronizer 	See also

Allows other threads to access the associated memory.

procedure EndWrite;

Description

Call EndWrite after writing to the memory that is protected by the multi-read exclusive-write synchronizer. Each call to BeginWrite must be matched by a call to EndWrite, or other threads can never return from the BeginRead or BeginWrite methods.


Hierarchy

TObject


TMetaFileCanvas

Hierarchy	Properties	Methods	Events	See also

TMetafileCanvas allows applications to create metafile images from scratch.

Unit

graphics

Description

Use TMetafileCanvas as a surface on which to draw a metafile image. When the canvas is destroyed, it transfers the image into the metafile object provided to the canvas constructor. After the image is drawn on the canvas and the canvas is destroyed, the image is 'playable' in the metafile object.


TMetaFileCanvas properties

TMetaFileCanvas	Alphabetically	Legend

Derived from TCanvas

Brush

CanvasOrientation

ClipRect

CopyMode

Font

Handle

LockCount

Pen

PenPos

Pixels

TextFlags


TMetaFileCanvas properties

TMetaFileCanvas	By object	Legend

Brush

CanvasOrientation

ClipRect

CopyMode

Font

Handle

LockCount

Pen

PenPos

Pixels

TextFlags


TMetaFileCanvas events

TMetaFileCanvas	Alphabetically

Derived from TCanvas

OnChange

OnChanging


TMetaFileCanvas events

TMetaFileCanvas	By object

OnChange

OnChanging


TMetaFileCanvas methods

TMetaFileCanvas	Alphabetically

In TMetaFileCanvas

Create

CreateWithComment

Destroy

Derived from TCanvas

Arc

BrushCopy

Chord

CopyRect

Draw

DrawFocusRect

Ellipse

FillRect

FloodFill

FrameRect

LineTo

Lock

MoveTo

Pie

PolyBezier

PolyBezierTo

Polygon

Polyline

Rectangle

Refresh

RoundRect

StretchDraw

TextExtent

TextHeight

TextOut

TextRect

TextWidth

TryLock

Unlock

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TMetaFileCanvas methods

TMetaFileCanvas	By object

AfterConstruction

Arc

Assign

BeforeDestruction

BrushCopy

Chord

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

CopyRect

Create

CreateWithComment

DefaultHandler

Destroy

Dispatch

Draw

DrawFocusRect

Ellipse

FieldAddress

FillRect

FloodFill

FrameRect

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

LineTo

Lock

MethodAddress

MethodName

MoveTo

NewInstance

Pie

PolyBezier

PolyBezierTo

Polygon

Polyline

Rectangle

Refresh

RoundRect

SafeCallException

StretchDraw

TextExtent

TextHeight

TextOut

TextRect

TextWidth

TryLock

Unlock


TMetafileCanvas.Create

TMetafileCanvas	See also	Example

Creates an instance of TMetafileCanvas and acquires a handle to a metafile device context.

constructor Create(AMetafile: TMetafile; ReferenceDevice: HDC);

Description

Call Create to create an instantiate a TMetafileCanvas object. Pass in the associated metafile whose image is about to be drawn as the AMetafile parameter. Pass in a handle to a device context on which to base the metafile’s device context as the ReferenceDevice parameter. In most cases, this is the device context for a window on which the image is normally drawn.

Create sets the size of the TMetafile object from ReferenceDevice if it does not already have the MMHeight and MMWidth properties set. Create then creates a metafile device context, and sets the Handle property to its handle. All subsequent drawing methods will draw to the metafile device context.

When the TMetaFileCanvas is destroyed, The CreatedBy and Description strings will be used to set the properties of the same name in the TMetafile object.


TMetafileCanvas.CreateWithComment

TMetafileCanvas	See also

Creates an instance of TMetafileCanvas and acquires a handle to a metafile device context with a comment string.

constructor CreateWithComment(AMetafile: TMetafile; ReferenceDevice: HDC; const CreatedBy, Description: String);

Description

Call CreateWithComment to create an instantiate a TMetafileCanvas object for a metafile that will receive the CreatedBy and Description strings. CreateWithComment sets the size of the TMetafile object from the ReferenceDevice if it does not already have the MMHeight and MMWidth properties set. Create then creates a metafile device context using the CreatedBy and Description strings as a description, and sets the Handle property to its handle. All subsequent drawing methods will draw to the metafile device context.

When the TMetaFileCanvas is destroyed, the CreatedBy and Description strings are used to set the properties of the same name in the TMetafile object.


TMetafileCanvas.Destroy

TMetafileCanvas	See also

Destroys an instance of the TMetafileCanvas after transferring the image to the TMetaFile object that was passed to the constructor.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TMetafileCanvas reference is not nil, and only then calls Destroy.

Destroy sets the Handle property of the TMetaFile object that was passed to the constructor before freeing the memory associated with the object.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCanvas


TMetafileImage

Hierarchy	Methods	See also

TMetafileImage is the internal representation of the metafile image for a TMetafile object.

Unit

graphics

Description

TMetafileImage is used for internal implementation only. It represents the internal image of the metafile encapsulated by the TMetafile object. All of the data and methods introduced in TMetafileImage are private. They contain information about the specific metafile image, including pointers to the standard HENHMETAFILE (enhanced metafile handle) and HPALETTE (handle to palette) structures defined by Windows.


TMetafileImage methods

TMetafileImage	Alphabetically

In TMetafileImage

Destroy

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TMetafileImage methods

TMetafileImage	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TMetafileImage.Destroy

TMetafileImage	See also

Disposes of the instance of a metafile image.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TMetaFileImage reference is not nil before it calls Destroy.

Destroy frees the metafile handle and palette before calling the inherited Destroy.


Hierarchy

TObject

TSharedImage


TNamedItem

Hierarchy	Properties	Methods	See also

TNamedItem is the base class for definitions used by datasets.

Unit

db

Description

Use TNamedItem as a base class when defining a class of definition that is maintained in a collection by a dataset.  Sets of TNamedItem objects are maintained by a descendant of TDefCollection that is specific to the type of object defined.

Definition objects are used by datasets to specify the properties of database entities such as fields or indexes.


TNamedItem properties

TNamedItem	Alphabetically	Legend

In TNamedItem

DisplayName

Name

Derived from TCollectionItem

Collection

ID

Index


TNamedItem properties

TNamedItem	By object	Legend

Collection

DisplayName

ID

Index

Name


TNamedItem.DisplayName

TNamedItem	See also

Specifies the name of the named item as it appears in the collection editor at design time.

property DisplayName: String;

Description

TNamedItem overrides the DisplayName property to ensure that its value is the same as the value of the Name property. Thus, the name that appears in the collection editor is the same as the name of the defined database entity as it appears (or will appear) in the dataset.


TNamedItem.Name

TNamedItem	See also 	Example

Specifies the name of the database entity defined by the TNamedItem object.

property Name: String;

Description

Use Name to specify the name that the underlying database table uses to refer to the defined object. For example, if the TNamedItem object is a field definition, the value of Name is the name of the corresponding field in the underlying database table.

Note:	For dBASE maintained indexes, Name refers to the tag name of the index. For Paradox tables, the Name of the primary key is an empty string.


TNamedItem methods

TNamedItem	Alphabetically

Derived from TCollectionItem

Create

Destroy

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TNamedItem methods

TNamedItem	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem


TNavDataLink

Hierarchy	Properties	Methods	See also

TNavDataLink helps manage the link to the dataset for a TDBNavigator object.

Unit

dbctrls

Description

TNavDataLink is tailored to work with a TDBNavigator. It should only be used by the TDBNavigator class.


TNavDataLink properties

TNavDataLink	Alphabetically	Legend

Derived from TDataLink

Active

ActiveRecord

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

ReadOnly

RecordCount

VisualControl


TNavDataLink properties

TNavDataLink	By object	Legend

Active

ActiveRecord

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

ReadOnly

RecordCount

VisualControl


TNavDataLink methods

TNavDataLink	Alphabetically	Legend

In TNavDataLink

ActiveChanged

Create

DataSetChanged

Destroy

EditingChanged

Derived from TDataLink

Edit

ExecuteAction

UpdateAction

UpdateRecord

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TNavDataLink methods

TNavDataLink	By object	Legend

ActiveChanged

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DataSetChanged

DefaultHandler

Destroy

Dispatch

Edit

EditingChanged

ExecuteAction

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

UpdateAction

UpdateRecord


TNavDataLink.ActiveChanged

TNavDataLink	See also

Informs TDBNavigator of changes in the Active property.

procedure ActiveChanged; override;

Description

Applications should not call the ActiveChanged procedure directly. Changes in the Active property trigger this procedure, which in turn causes the navigator to enable or disable its buttons, as appropriate.


TNavDataLink.Create

TNavDataLink	See also

Creates an instance of TNavDataLink.

constructor Create(ANav: TDBNavigator);

Description

Applications should not call the Create method for a TNavDataLink directly. The TDBNavigator that owns a TNavDataLink calls Create from its own constructor.

Create calls its inherited Create constructor, and then sets VisualControl to True.


TNavDataLink.DataSetChanged

TNavDataLink	See also

Informs the TDBNavigator of changes to the dataset.

procedure DataSetChanged; override;

Description

Applications do not need to call the DataSetChanged procedure. It is called automatically following changes to the contents of the dataset. TNavDataLink informs the TDBNavigator of these changes so that it can enable and disable buttons as appropriate.


TNavDataLink.Create
TNavDataLink.Destroy

TNavDataLink	See also

Destroys an instance of TNavDataLink.

destructor Destroy; override;

Description

Applications should not call the Destroy method for a TNavDataLink directly. The TDBNavigator that owns a TNavDataLink calls Free to destroy the TNavDataLink from its own destructor.


TNavDataLink.EditingChanged

TNavDataLink	See also

Informs TDBNavigator of changes to the editing state of the DataSource.

procedure EditingChanged; override;

Description

Applications should not call the EditingChanged procedure directly. Changes to the editing state of the DataSource trigger this procedure, which in turn causes the navigator to enable or disable editing buttons as appropriate.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink


 TNestedTable

Hierarchy	Properties	Methods	Events

A nested table is a dataset component that encapsulates a database table that is nested as a field within another table.

Unit

Dbtables

Description

Use TNestedTable to access data contained in a nested dataset. A nested table inherits BDE functionality from TBDEDataSet and so uses the Borland Database Engine (BDE) to access the nested table data. A nested table provides much of the functionality of a table component, except that the data it accesses is stored in a nested table.


TNestedTable properties

TNestedTable	Alphabetically	Legend

Derived from TBDEDataSet

BlockReadSize

CacheBlobs

CachedUpdates

CanModify

ExpIndex

Filter

Filtered

FilterOptions

Handle

KeySize

Locale

RecNo

RecordCount

RecordSize

UpdateObject

UpdateRecordTypes

UpdatesPending

Derived from TDataSet

Active

AggFields

AutoCalcFields

Bof

Bookmark

DataSetField

DataSource

DefaultFields

Designer

Eof

FieldCount

FieldDefList

FieldDefs

FieldList

Fields

FieldValues

Found

Modified

Name

ObjectView

SparseArrays

State

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TNestedTable properties

TNestedTable	By object	Legend

Active

AggFields

AutoCalcFields

BlockReadSize

Bof

Bookmark

CacheBlobs

CachedUpdates

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DataSetField

DataSource

DefaultFields

Designer

DesignInfo

Eof

ExpIndex

FieldCount

FieldDefList

FieldDefs

FieldList

Fields

FieldValues

Filter

Filtered

FilterOptions

Found

Handle

KeySize

Locale

Modified

Name

ObjectView

Owner

RecNo

RecordCount

RecordSize

SparseArrays

State

Tag

UpdateObject

UpdateRecordTypes

UpdatesPending

VCLComObject


TNestedTable events

TNestedTable	Alphabetically	Legend

Derived from TBDEDataSet

OnUpdateError

OnUpdateRecord

Derived from TDataSet

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TNestedTable events

TNestedTable	By object	Legend

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnUpdateError

OnUpdateRecord


TNestedTable methods

TNestedTable	Alphabetically

In TNestedTable

Create

Derived from TBDEDataSet

ApplyUpdates

BookmarkValid

Cancel

CancelUpdates

CommitUpdates

CompareBookmarks

ConstraintCallBack

ConstraintsDisabled

CreateBlobStream

Destroy

DisableConstraints

EnableConstraints

FetchAll

FlushBuffers

GetBlobFieldData

GetCurrentRecord

GetFieldData

GetIndexInfo

IsSequenced

Locate

Lookup

Post

RevertRecord

Translate

UpdateStatus

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

CheckBrowseMode

ClearFields

Close

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetDetailDataSets

GetDetailLinkFields

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsEmpty

IsLinkedTo

Last

MoveBy

Next

Open

Prior

Refresh

Resync

SetFields

UpdateCursorPos

UpdateRecord

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TNestedTable methods

TNestedTable	By object

ActiveBuffer

AfterConstruction

Append

AppendRecord

ApplyUpdates

Assign

BeforeDestruction

BookmarkValid

Cancel

CancelUpdates

CheckBrowseMode

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClearFields

Close

CommitUpdates

CompareBookmarks

ConstraintCallBack

ConstraintsDisabled

ControlsDisabled

Create

CreateBlobStream

CursorPosChanged

DefaultHandler

Delete

Destroy

DestroyComponents

Destroying

DisableConstraints

DisableControls

Dispatch

Edit

EnableConstraints

EnableControls

ExecuteAction

FetchAll

FieldAddress

FieldByName

FindComponent

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FlushBuffers

Free

FreeBookmark

FreeInstance

FreeNotification

FreeOnRelease

GetBlobFieldData

GetBookmark

GetCurrentRecord

GetDetailDataSets

GetDetailLinkFields

GetFieldData

GetFieldList

GetFieldNames

GetIndexInfo

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GotoBookmark

HasParent

InheritsFrom

InitInstance

Insert

InsertComponent

InsertRecord

InstanceSize

IsEmpty

IsLinkedTo

IsSequenced

Last

Locate

Lookup

MethodAddress

MethodName

MoveBy

NewInstance

Next

Open

Post

Prior

Refresh

RemoveComponent

Resync

RevertRecord

SafeCallException

SetFields

Translate

UpdateAction

UpdateCursorPos

UpdateRecord

UpdateStatus


TNestedTable.Create

TNestedTable 	See also

Creates an instance of a TNestedTable component.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a nested table declared in an application if it was not placed on a form at design time. Create calls its inherited Create constructor and sets ObjectView to True.

Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataSet

TBDEDataSet


TNotebook

Hierarchy	Properties	Methods	Events

TNotebook displays multiple pages, each with its own set of controls.

Unit

extctrls

Description

Notebook components are frequently used with tab set controls (TTabSet) to let the user select pages in the notebook by clicking a tab.  TNotebook is provided for backward compatibility. New applications should use TPageControl instead.


TNotebook properties

TNotebook	Alphabetically	Legend

In TNotebook

ActivePage

PageIndex

Pages

Derived from TWinControl

Brush

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TNotebook properties

TNotebook	By object	Legend

Action

ActivePage

Align

Anchors

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

PageIndex

Pages

Parent

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TNotebook.ActivePage

TNotebook	See also

Determines which page displays in the notebook.

property ActivePage: string;

Description

ActivePage determines which page displays in the notebook. The value of ActivePage must be one of the strings contained in the Pages property.

To get or set the active page by index rather than string, use the PageIndex property instead.


TNotebook.PageIndex

TNotebook	See also

Determines which page displays in the notebook control.

property PageIndex: Integer;

Description

The value of PageIndex determines which page displays in the notebook. Changing the PageIndex value changes the page in the control.

Each string in the Pages property is automatically assigned a PageIndex value when the page is created. The first page receives a value of 0, the second has a value of 1, and so on. If you delete a string from the Pages property, the PageIndex values are reassigned so that the values always begin with 0 and continue to increase without any gaps between values.

To get or set the current page using its string rather than its index, use the ActivePage property instead.


TNotebook.Pages

TNotebook	See also

Contains the strings that identify the individual pages of the notebook control.

property Pages: TStrings;

Description

The Pages property contains the strings that identify the individual pages of the notebook control. Both these controls create a separate page for each string in the Pages property. For example, if Pages contains three strings, First, Second, and Third, the control has three separate pages.

You can access the various pages in a notebook or tabbed notebook control with either the ActivePage or PageIndex property.


TNotebook events

TNotebook	Alphabetically	Legend

In TNotebook

OnPageChanged

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TNotebook events

TNotebook	By object	Legend

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp

OnPageChanged

OnStartDock

OnStartDrag


TNotebook.OnPageChanged

TNotebook

Occurs when the user selects a new page in the notebook.

property OnPageChanged: TNotifyEvent;

Description

Use the OnPageChanged event when you want special processing to occur when the active page changes.


TNotebook methods

TNotebook	Alphabetically

In TNotebook

Create

Destroy

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TNotebook methods

TNotebook	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TNotebook.Destroy

TNotebook	See also

Destroys the TNotebook component.

Description

Do not call Destroy directly in an application. Instead, use Free, which checks that the TNotebook reference is not nil before calling Destroy.


TNotebook.Create

TNotebook

Constructs a TNotebook component.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a notebook at runtime. Notebook components placed in forms at design time are created automatically.

The AOwner parameter specifies the component (usually the form) that is responsible for freeing the notebook.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


Link not found

The topic you requested is either not available or not linked to this Help system. This can occur if you launched this Help file from a system on which Delphi has not yet been installed, or if the subject matter you are requesting is not available in your edition of Delphi.


The topic you requested is now loading. If it does not appear within a few seconds, the topic is either not available or not linked to this Help system. This can occur if you launched this Help file from a system on which Delphi has not yet been installed, or if the subject matter you are requesting is not available in your edition of Delphi.


TNumericField

Hierarchy	Properties	Methods	Events	See also

TNumericField is the common ancestor of all the numeric fields in a dataset.

Unit

db

Description

TNumericField is an abstract base class that encapsulates the fundamental behavior common to all numeric field components. In addition to the properties, events, and methods common to all field components introduced by TField, TNumericField introduces new properties for formatting numeric data for display or editing purposes.

Do not instantiate objects of type TNumericField. Instead, use one of its descendant classes such as TIntegerField and TFloatField.


TNumericField properties

TNumericField	Alphabetically	Legend

In TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TNumericField properties

TNumericField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataType

DefaultExpression

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

ValidChars

VCLComObject

Visible


TNumericField.DisplayFormat

TNumericField	See also

Determines how a numeric field’s value is formatted for display in a data-aware control.

property DisplayFormat: String;

Description

Use the DisplayFormat property to override automatic formatting of a field for display purposes.

The value of DisplayFormat is a string that encodes the formatting of numeric data using the specifiers in the following table:

Specifier	Represents

0	Digit placeholder. If the value being formatted has a digit in the position where the "0" appears in the format string, then that digit is copied to the output string. Otherwise, a "0" is stored in that position in the output string.

#	Digit placeholder. If the value being formatted has a digit in the position where the "#" appears in the format string, then that digit is copied to the output string. Otherwise, nothing is stored in that position in the output string.

.	Decimal point. The first "." character in the format string determines the location of the decimal separator in the formatted value; any additional "." characters are ignored. The actual character used as a the decimal separator in the output string is determined by the DecimalSeparator global variable. The default value of DecimalSeparator is specified in the Number Format of the Regional Settings section in the Windows Control Panel.

,	Thousand separator. If the format string contains one or more "," characters, the output will have thousand separators inserted between each group of three digits to the left of the decimal point. The placement and number of "," characters in the format string does not affect the output, except to indicate that thousand separators are wanted. The actual character used as a the thousand separator in the output is determined by the ThousandSeparator global variable. The default value of ThousandSeparator is specified in the Number Format of the Regional Settings section in the Windows Control Panel.

E+	Scientific notation. If any of the strings "E+", "E-", "e+", or "e-" are contained in the format string, the number is formatted using scientific notation. A group of up to four "0" characters can immediately follow the "E+", "E-", "e+", or "e-" to determine the minimum number of digits in the exponent. The "E+" and "e+" formats cause a plus sign to be output for positive exponents and a minus sign to be output for negative exponents. The "E-" and "e-" formats output a sign character only for negative exponents.

'xx'/"xx"	Characters enclosed in single or double quotes are output as-is, and do not affect formatting.

;	Separates sections for positive, negative, and zero numbers in the format string.

The locations of the leftmost "0" before the decimal point in the format string and the rightmost "0" after the decimal point in the format string determine the range of digits that are always present in the output string.

The number being formatted is always rounded to as many decimal places as there are digit placeholders ("0" or "#") to the right of the decimal point. If the format string contains no decimal point, the value being formatted is rounded to the nearest whole number.

If the number being formatted has more digits to the left of the decimal separator than there are digit placeholders to the left of the "." character in the format string, the extra digits are output before the first digit placeholder.

The following table shows the effect of various format strings:

DisplayFormat	Value	Result	Comment

#.##	12.2	12.2	Note extra digit to left of decimal still appears

#.00	2.5	2.50	Note extra zero: field will always show two decimal places

00.##	.006	00.01	Note extra 0s to right of decimal point and rounding to two decimal places.

To allow different formats for positive, negative, and zero values, the format string can contain between one and three sections separated by semicolons.

One section: The format string applies to all values.

Two sections: The first section applies to positive values and zeros, and the second section applies to negative values.

Three sections: The first section applies to positive values, the second applies to negative values, and the third applies to zeros.

If the section for negative values or the section for zero values is empty, that is, if there is nothing between the semicolons that delimit the section, the section for positive values is used instead.

If the section for positive values is empty, or if the entire format string is empty, the value is formatted using general floating-point formatting with 15 significant digits. General floating-point formatting is also used if the value has more than 18 digits to the left of the decimal point and the format string does not specify scientific notation.

Note:	DisplayFormat affects only the display of the field’s data. It does not affect the  validity of strings assigned to a numeric field using the AsString property.


TNumericField.EditFormat

TNumericField	See also

Determines how a numeric field’s value is formatted when it is being edited in a data-aware control.

property EditFormat: String;

Description

Use the EditFormat property to override the formatting of a field when the field’s value is being edited in a data-aware control.

When EditFormat is unassigned, but the DisplayFormat property has a value, the DisplayFormat string is used.

The value of EditFormat is a string that encodes the formatting of numeric data using the specifiers in the following table:

Specifier	Represents

0	Digit placeholder. If the value being formatted has a digit in the position where the "0" appears in the format string, then that digit is copied to the output string. Otherwise, a "0" is stored in that position in the output string.

#	Digit placeholder. If the value being formatted has a digit in the position where the "#" appears in the format string, then that digit is copied to the output string. Otherwise, nothing is stored in that position in the output string.

.	Decimal point. The first "." character in the format string determines the location of the decimal separator in the formatted value; any additional "." characters are ignored. The actual character used as a the decimal separator in the output string is determined by the DecimalSeparator global variable. The default value of DecimalSeparator is specified in the Number Format of the Regional Settings section in the Windows Control Panel.

,	Thousand separator. If the format string contains one or more "," characters, the output will have thousand separators inserted between each group of three digits to the left of the decimal point. The placement and number of "," characters in the format string does not affect the output, except to indicate that thousand separators are wanted. The actual character used as a the thousand separator in the output is determined by the ThousandSeparator global variable. The default value of ThousandSeparator is specified in the Number Format of the Regional Settings section in the Windows Control Panel.

E+	Scientific notation. If any of the strings "E+", "E-", "e+", or "e-" are contained in the format string, the number is formatted using scientific notation. A group of up to four "0" characters can immediately follow the "E+", "E-", "e+", or "e-" to determine the minimum number of digits in the exponent. The "E+" and "e+" formats cause a plus sign to be output for positive exponents and a minus sign to be output for negative exponents. The "E-" and "e-" formats output a sign character only for negative exponents.

'xx'/"xx"	Characters enclosed in single or double quotes are output as-is, and do not affect formatting.

;	Separates sections for positive, negative, and zero numbers in the format string.

The locations of the leftmost "0" before the decimal point in the format string and the rightmost "0" after the decimal point in the format string determine the range of digits that are always present in the output string.

The number being formatted is always rounded to as many decimal places as there are digit placeholders ("0" or "#") to the right of the decimal point. If the format string contains no decimal point, the value being formatted is rounded to the nearest whole number.

If the number being formatted has more digits to the left of the decimal separator than there are digit placeholders to the left of the "." character in the format string, the extra digits are output before the first digit placeholder.

To allow different formats for positive, negative, and zero values, the format string can contain between one and three sections separated by semicolons.

One section: The format string applies to all values.

Two sections: The first section applies to positive values and zeros, and the second section applies to negative values.

Three sections: The first section applies to positive values, the second applies to negative values, and the third applies to zeros.

If the section for negative values or the section for zero values is empty, that is if there is nothing between the semicolons that delimit the section, the section for positive values is used instead.

If the section for positive values is empty, or if the entire format string is empty, the value is formatted using general floating-point formatting with 15 significant digits. General floating-point formatting is also used if the value has more than 18 digits to the left of the decimal point and the format string does not specify scientific notation.

Note:	EditFormat affects only the display of the field’s data when it is being edited. It does not affect the validity of strings assigned to a numeric field using the AsString property, nor does it affect the display of the field’s data when it is not being edited.


TNumericField events

TNumericField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TNumericField events

TNumericField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TNumericField methods

TNumericField	Alphabetically

In TNumericField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TNumericField methods

TNumericField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TNumericField.Create

TNumericField	See also

Creates an instance of a TNumericField object.

constructor Create(AOwner: TComponent); override;

Description

Do not call the create method for TNumericField directly. TNumericField is an abstract class and its constructor should only be called as an inherited method from the constructor of a derived class.

After calling the inherited Create method, Create changes the Alignment property to taRightJustify.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField


TObjectList

Hierarchy	Properties	Methods	See also

TObjectList maintains a list of (owned) objects.

Unit

contnrs

Description

Use a TObjectList to store and maintain a list of objects. TObjectList provides properties and methods to add, delete, rearrange, locate, access, and sort objects. If the OwnsObjects property is set to True (the default), TObjectList controls the memory of its objects, freeing an object when its index is reassigned; when it is removed from the list with the Delete, Remove, or Clear method; or when the TObjectList instance is itself destroyed.


TObjectList properties

TObjectList	Alphabetically	Legend

In TObjectList

Items

OwnsObjects

Derived from TList

Capacity

Count

List


TObjectList properties

TObjectList	By object	Legend

Capacity

Count

Items

List

OwnsObjects


TObjectList.Items

TObjectList	See also

Lists the object references.

property Items[Index: Integer]: TObject; default;

Description

Use Items to access objects in the list. Items is a zero-based array: The first object is indexed as 0, the second object is indexed as 1, and so forth. You can read or change the value at a specific index, or use Items with the Count property to iterate through the list.

If OwnsObjects is True, reassigning an Items index frees the object that previously occupied that position in the list.

Items can contain nil references. To remove nil references and reduce the size of the array, call the Pack method.


TObjectList.OwnsObjects

TObjectList	See also

Allows TObjectList to free objects when they are deleted from the list or the list is destroyed.

property OwnsObjects: Boolean;

Description

OwnsObjects allows TObjectList to control the memory of its objects. If OwnsObjects is True (the default),

calling Delete or Remove frees the deleted object in addition to removing it from the list.

calling Clear frees all the objects in the list in addition to emptying the list.

calling the destructor frees all the objects in the list in addition to destroying the TObjectList itself.

assigning a new value to an index in Items frees the object that previously occupied that position in the list.

Even if OwnsObjects is True, the Extract method can be used to remove objects from the list without freeing them.


TObjectList methods

TObjectList	Alphabetically

In TObjectList

Add

Clear

Create

Delete

Extract

Destroy

FindInstanceOf

IndexOf

Insert

Remove

Derived from TList

Error

Exchange

Expand

First

Last

Move

Pack

Sort

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TObjectList methods

TObjectList	By object

Add

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

Error

Exchange

Expand

Extract

FieldAddress

FindInstanceOf

First

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

IndexOf

InheritsFrom

InitInstance

Insert

InstanceSize

Last

MethodAddress

MethodName

Move

NewInstance

Pack

Remove

SafeCallException

Sort


TObjectList.Destroy

TObjectList	See also

Destroys an instance of TObjectList.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead, call Free, which checks that the TObjectList reference is not nil before calling Destroy.

Before destroying the TObjectList, Destroy calls Clear, which frees the objects in the list if OwnsObjects is True.


TObjectList.Add

TObjectList	See also

Inserts an object at the end of the list.

function Add(AObject: TObject): Integer;

Description

Call Add to insert an object at the end of the list. Add places the object after the last item, even if the array contains nil references, and returns the index of the inserted object. (The first object in the list has an index of 0.)

Add increments Count and, if necessary, allocates memory by increasing the value of Capacity.


TObjectList.Clear

TObjectList	See also

Deletes all items from the list.

procedure Clear; virtual;

Description

Clear empties the list, frees the memory used to store the Objects array, and sets Count and Capacity to 0. If OwnsObjects is True, Clear also frees the objects in the list.


TObjectList.Create

TObjectList	See also

Creates and initializes a TObjectList.

constructor Create; overload;

constructor Create(AOwnsObjects: Boolean); overload;

Description

Create creates a TObjectList instance. If no parameter is specified, or if the constructor is called with the True parameter, the new TObjectList is initialized with OwnsObjects set to True.


TObjectList.Delete

TObjectList	See also

Removes the object at a specified position and (if OwnsObject is True) frees the object.

procedure Delete(Index: Integer);

Description

Call Delete to remove the object at Index from the list. (The first object is indexed as 0, the second object is indexed as 1, and so forth.) After an object is deleted, all the objects that follow it are moved up in index position and Count is decremented.

To use an object reference (rather than an index position) to specify the object to be removed, call Remove.

If OwnsObjects is True, Delete frees the object in addition to removing it from the list. To remove an object from the list without freeing it, call Extract.


TObjectList.Extract

TObjectList	See also

Removes a specified object from the list without freeing the object.

function Extract(Item: Pointer): Pointer;

Description

Call Extract to remove an object from the list without freeing the object itself. After an object is removed, all the objects that follow it are moved up in index position and Count is decremented.


TObjectList.FindInstanceOf

TObjectList	See also

Finds the first instance of a specified class in the list.

function FindInstanceOf(AClass: TClass; AExact: Boolean = True; AStartAt: Integer = 0): Integer;

FindInstanceOf returns the index of the first instance of AClass appearing after AStartAt in the Items array. If AExact is True, FindInstanceOf returns instances only of AClass itself, ignoring instances descendant classes. If no instance of the specified class is found, FindInstanceOf returns –1.


TObjectList.IndexOf

TObjectList	See also

Returns the index of the first object in the list with a specified value.

function IndexOf(AObject: TObject): Integer;

Description

Call IndexOf to get the index for a specified object in the list, where the first object has index 0, the second object has index 1, and so on. If an object is not in the list, IndexOf returns -1. If an object appears more than once, IndexOf returns the index of the first appearance.


TObjectList.Insert

TObjectList	See also

Adds an object to the list at a specified position.

procedure Insert(Index: Integer; AObject: TObject);

Call Insert to add an object at a specified position in the list, shifting the item that previously occupied that position (and all subsequent items) up. Insert increments Count and, if necessary, allocates memory by increasing the value of Capacity.

The Index parameter is zero-based, so the first position in the list has an index of 0.

To replace a nil reference with a new object without growing the array, set the Items property directly.


TObjectList.Remove

TObjectList	See also

Removes a specified object from the list and (if OwnsObject is True) frees the object.

function Remove(AObject: TObject): Integer;

Call Remove to delete a specific object from the list when its index is unknown. The value returned is the index of the object in the Items array before it was removed. If the specified object is not found on the list, Remove returns –1. If OwnsObjects is True, Remove frees the object in addition to removing it from the list.

After an object is deleted, all the objects that follow it are moved up in index position and Count is decremented. If an object appears more than once on the list, Remove deletes only the first appearance. Hence, if OwnsObjects is True, removing an object that appears more than once results in empty object references later in the list.

To use an index position (rather than an object reference) to specify the object to be removed, call Delete.

To remove an object from the list without freeing it, call Extract.


Accessibility

Read-only


Hierarchy

TObject

TList


TObjectQueue

Hierarchy	Methods	See also

TObjectQueue maintains a first-in first-out list of objects.

Unit

contnrs

Description

Use a TObjectQueue to store and maintain a first-in first-out list of objects.


TObjectQueue methods

TObjectQueue	Alphabetically

In TObjectQueue

Peek

Pop

Push

Derived from TOrderedList

AtLeast

Count

Create

Destroy

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TObjectQueue methods

TObjectQueue	By object

AfterConstruction

AtLeast

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Count

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Peek

Pop

Push

SafeCallException


TObjectQueue.Peek

TObjectQueue	See also

Returns a reference to the front of the queue.

function Peek: TObject;

Description

Call Peek to access the queue without removing an object. Peek returns a reference to the next object in the queue (that is, the earliest object added).

To remove an object from the queue, call Pop.


TObjectQueue.Pop

TObjectQueue	See also

Removes and returns the object at the front of the queue.

function Pop: TObject;

Description

Call Pop to retrieve an object from the queue. Pop removes the next object from the queue (that is, the earliest object added), then returns a reference to the deleted object.

To access the queue without removing an object, call Peek.


TObjectQueue.Push

TObjectQueue	See also

Adds an object to the end of the queue.

procedure Push(AObject: TObject);

Description

Call Push to add an object to the queue.

To retrieve objects added with Push, call Pop or Peek.


Hierarchy

TObject

TOrderedList

TQueue


TObjectStack

Hierarchy	Methods	See also

TObjectStack maintains a last-in first-out list of objects.

Unit

contnrs

Description

Use a TObjectStack to store and maintain a last-in first-out list of objects.


TObjectStack methods

TObjectStack	Alphabetically

In TObjectStack

Peek

Pop

Push

Derived from TOrderedList

AtLeast

Count

Create

Destroy

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TObjectStack methods

TObjectStack	By object

AfterConstruction

AtLeast

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Count

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Peek

Pop

Push

SafeCallException


TObjectStack.Peek

TObjectStack	See also

Returns a reference to the top of the stack.

function Peek: TObject;

Description

Call Peek to access the stack without removing an object. Peek returns a reference to the next object in the stack (that is, the last object added).

To remove an object from the stack, call Pop.


TObjectStack.Pop

TObjectStack	See also

Removes and returns the object at the top of the stack.

function Pop: TObject;

Description

Call Pop to retrieve an object from the stack. Pop removes the next object from the stack (that is, the last object added), then returns a reference to the deleted object.

To access the stack without removing an object, call Peek.


TObjectStack.Push

TObjectStack	See also

Adds an object to the top of the stack.

procedure Push(AObject: TObject);

Description

Call Push to add an object to the stack.

To retrieve the last object added with Push, call Pop or Peek.


Hierarchy

TObject

TOrderedList

TStack


TObject

Methods	See also

TObject is the ultimate ancestor for all VCL objects and components.

Unit

system

Description

TObject encapsulates the fundamental behavior common to all objects in the VCL by introducing methods that provide:

The ability to create, maintain and destroy an instance of the object by allocating, initializing and freeing the memory needed for that object.

Class type and instance information on an object, and run-time type information (RTTI) about its published properties.

Support for message-handling.

Support for interfaces that the object implements.

Use TObject as an immediate base class when declaring simple objects that do not need to persist (are not saved and reloaded) and that do not to be assigned to other objects. If no ancestor type is specified when declaring a new object class, Delphi automatically uses TObject as the ancestor.

Much of the powerful capability of Delphi objects is established by the methods that TObject introduces. Many of these methods are used internally by the Delphi environment and are not intended for users to call directly. Several others are generally overridden in descendant objects and components that have more complex behavior.

Note:	While TObject is not technically an abstract class, objects of this type are not normally instantiated.


TObject methods

TObject	Alphabetically

In TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TObject methods

TObject	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TObject.AfterConstruction

TObject	See also

Responds after the last constructor has executed.

procedure AfterConstruction; virtual;

Description

AfterConstruction is called automatically after the object’s last constructor has executed. Do not call it explicitly in your applications.

The AfterConstruction method implemented in TObject does nothing. Override this method when creating a class that takes some action after the object is created. For example, TCustomForm overrides AfterConstruction to generate an OnCreate event.

Note:	It is only important to override AfterConstruction rather than the object’s constructor if the derived class is used in C++Builder applications.


TObject.BeforeDestruction

TObject	See also

Responds before the first destructor executes.

procedure BeforeDestruction; virtual;

Description

BeforeDestruction is called automatically immediately before the object’s first destructor executes. Do not call it explicitly in your applications.

The BeforeDestruction method implemented in TObject does nothing. Override this method when creating a class that takes some action before the object is destroyed. For example, TCustomForm overrides BeforeDestruction to generate an OnDestroy event.

Note:	It is only important to override BeforeDestruction rather than the object’s destructor if the derived class is used in C++Builder applications.


TObject.ClassInfo

TObject	See also

Returns a pointer to the run-time type information (RTTI) table for the object type.

class function ClassInfo: Pointer;

Description

Use ClassInfo to access the RTTI table that contains information about the object type, its ancestor type, and all of its published properties.

RTTI is used internally in the Delphi environment. ClassInfo is rarely called directly in an application. TObject includes other methods intended to provide easier access to RTTI information.


TObject.ClassName

TObject	See also

Returns a string indicating the type of the object instance (as opposed to the type of the variable passed as an argument).

class function ClassName: ShortString;

Description

Use ClassName to find the name (such as ’TButton’) of an object’s type. This is useful for differentiating object instances that are assigned to a variable that has the type of an ancestor class. ClassName returns a string indicating the actual type of the object, rather than a string containing the type of the declared variable.

When reporting exception-handling errors on a particular object, the on statement uses ClassName to do a string comparison of classes.


TObject.ClassNameIs

TObject	See also

Determines whether an object is of a specific type.

class function ClassNameIs(const Name: string): Boolean;

Description

Use ClassNameIs when writing conditional code based on an object’s type or to query objects across modules, or DLLs.

ClassNameIs returns True if the string passed in the Name parameter matches the name of the class. Otherwise, it returns False.

ClassNameIs performs much the same function as the is operator, except that it requires an exact match, returning False for descendants of the named class.


TObject.ClassParent

TObject	See also 	Example

Returns the type of the immediate ancestor of a class.

class function ClassParent: TClass;

Description

ClassParent is used internally by the is and as operators and to implement the InheritsFrom method. Because it is a class method, it can be used to determine the type of any class reference.

ClassParent returns nil for type TObject because TObject is not derived from an ancestor class.

Note:	Applications should rarely, if ever, call ClassParent directly.  Instead, use the is or as operator.


TObject.ClassType

TObject	See also 	Example

Returns a pointer to the run-time type information of an object instance.

function ClassType:

Description

ClassType dynamically determines the type of an object. It is used internally by the is and as operators.

Note:	Applications should rarely, if ever, call ClassType directly.  Instead, use the is or as operator.


TObject.CleanupInstance

TObject	See also

Performs finalization on long strings, Variants, and interface variables within a class.

procedure CleanupInstance;

Description

Do not call CleanupInstance directly. CleanupInstance is called automatically when the object instance is destroyed.

CleanupInstance releases all long strings and Variants. It set long strings to empty and Variants to Unassigned.


TObject.Create

TObject	See also

Constructs an object and initializes its data before the object is first used.

constructor Create;

Description

Create constructs a properly initialized instance of an object. The purpose, size and behavior of objects can differ greatly. The Create method defined by TObject does nothing special; that is, it does not initialize any data. Memory allocation is, however, handled automatically when Create is called.

Descendant objects usually define a constructor that is customized to create the particular kind of object and initializing its data as needed.

Note:	If an exception escapes from a constructor, the object’s destructor is called to clean up the failed instance.


TObject.DefaultHandler

TObject	See also

Provides the interface for a method that processes message records.

procedure DefaultHandler(var Message); virtual;

Description

DefaultHandler is called by Dispatch when it cannot find a method for a particular message. DefaultHandler provides message handling for all messages for which an object does not have specific handlers. Descendant classes that process messages override DefaultHandler according to the type of messages they handle. For example, TWinControl overrides DefaultHandler to call DefWindowProc.

Calling inherited in a message-handling method results in a call to the ancestor's DefaultHandler method only if that ancestor does not specify a message method for the particular message being handled. Otherwise calling inherited results in a call to the specific handler for that type of message.


TObject.Destroy

TObject	See also

Disposes of an object instance.

destructor Destroy; virtual;

Description

It is not recommended coding style to call Destroy directly. Call Free instead. Free checks to ensure that the object reference is not nil before calling Destroy.

Destroy defined by TObject does nothing special, however memory deallocation is handled automatically when Destroy is called. Descendant objects usually define a destructor that is customized to destroy that particular kind of object.

When declaring a Destroy method in a descendant object class, always add the override directive to the declaration and call the inherited Destroy as the last statement in the overriding method. Since Destroy is a virtual method, overriding it ensures that the proper inherited behavior occurs.

Note:	If an exception escapes from the constructor, the destructor is called to destroy the partially constructed object instance that failed to initialize completely. Therefore, destructors should check that allocated resources, such as handles, were actually allocated before trying to release them, since their value might be zero.

Destroy should be implemented so that it calls Free on all sub-objects created within the object’s constructor (that is, allocated by the constructor). Unlike Destroy, Free provides a safeguard when destroying objects that are nil.


TObject.Dispatch

TObject	See also

Calls message-handling methods for the object, based on the contents of the Message parameter.

procedure Dispatch(var Message); virtual;

Description

Call Dispatch to automatically pass messages to the appropriate message handler.

Dispatch determines whether a message is in the list of message handlers declared for the object. If the object does not handle the message, Dispatch then examines the message-handler list of the ancestor class, and continues checking ancestors until it either finds a specific handler or runs out of ancestors, in which case it calls DefaultHandler.

The Message parameter is untyped. The only assumption Dispatch makes about the data in Message is that the first two bytes contain a message ID, that is an integer-that determines which message handler Dispatch calls to handle the message. Although any kind of data can be passed to Dispatch, most TObject descendants expect a message record such as TMessage or a specific message-record type.


TObject.FieldAddress

TObject

Returns the address of a published object field.

function FieldAddress(const Name: ShortString): Pointer;

Description

FieldAddress is used internally by the component streaming system to access a specified published field of an object. FieldAddress returns a pointer to the field if it exists. If the object has no published field by that name, FieldAddress returns nil.

Programs should access and manipulate fields by using properties instead of FieldAddress.


TObject.Free

TObject	See also

Destroys an object and frees its associated memory, if necessary.

procedure Free;

Description

Use Free to destroy an object. Free automatically calls the destructor if the object reference is not nil. Any object instantiated at runtime that does not have an Owner should be destroyed by a call to Free, so that can be properly destroyed and the memory released. Unlike Destroy, Free is successful even if the object is nil, so if the object was never initialized, Free won’t result in an error.

When you call Free for a component, it calls Free for all components that it owns, that is, all components in its component list. A form owns all the controls and non-visual components that are created on it in design mode. When it is freed, all of these components are automatically freed as well. Since, by default, all forms are owned by the Application object, when the application terminates, it frees the Application object, which frees all forms. For all objects that are not components, or for components created with a nil owner, be sure to call Free after you are finished with the object; otherwise the allocated memory will not be usable until after the application terminates.

Warning:	Never explicitly free a component within one of its own event handlers or free a component from the event handler of a component it owns or contains. For example, don’t free a button in its OnClick event handler or free the form that owns the button from the button's OnClick event.

To free a form, call its Release method, which destroys the form and releases the memory allocated for it after all its event handlers and those of the components it contains are through executing.


TObject.FreeInstance

TObject	See also

Deallocates memory allocated by a previous call to the NewInstance method.

procedure FreeInstance; virtual;

Description

All destructors call FreeInstance automatically to deallocate memory that was allocated by overriding NewInstance.

Do not call FreeInstance directly. FreeInstance should be overridden if NewInstance was overridden to change the way the object’s instance data was allocated.

Like NewInstance, FreeInstance uses the value returned from InstanceSize to deallocate the object's memory.


TObject.GetInterface

TObject

Retrieves the interface identified by a given identifier.

function GetInterface(const IID: TGUID; out Obj): Boolean;

Description

GetInterface is used internally by the as operator to retrieve any interfaces implemented by an object. GetInterface is used by TInterfacedObject to implement the QueryInterface method. An interface type name, such as IUnknown, can be supplied as the IID parameter since the compiler will replace the interface with the associated GUID.

Some VCL objects that are not descended from TInterfacedObject still implement interfaces.The as operator can be used to cast these objects to obtain the interface, but that approach raises an exception if handed an object that does not implement the interface. Use GetInterface to obtain an interface from an object instance when the object may not support the interface, but an exception should not be raised upon failure.

GetInterface returns, as the out parameter Obj, a pointer to the interface identified by the IID parameter. If the interface is supported by the object, GetInterface returns True. If the interface is not supported by the object, GetInterface returns False, and the Obj parameter is nil.


TObject.GetInterfaceEntry

TObject

Returns the entry for a specific interface implemented in a class.

class function GetInterfaceEntry(const IID: TGUID): PInterfaceEntry;

Description

GetInterfaceEntry returns the class entry for the interface specified by the IID parameter. GetInterfaceEntry is used internally. It is rarely called directly.

One use for this method is to describe to COM how to automatically dispatch calls to a dual-IDispatch interface. An interface type name, such as IUnknown, can be supplied as the IID parameter since the compiler will replace the interface with the associated GUID.


TObject.GetInterfaceTable

TObject	See also

Returns a pointer to a structure containing all of the interfaces implemented by a given class.

type

  PInterfaceTable = ^TInterfaceTable;

  TInterfaceTable = packed record

    EntryCount: Integer;

    Entries: array[0..9999] of TInterfaceEntry;

  end;

class function GetInterfaceTable: PInterfaceTable;

Description

GetInterfaceTable returns the TInterfaceEntries for the class. This list only contains interfaces implemented by this class, not its ancestor. To find the ancestor list, call GetParentClass and then call its GetInterfaceTable method. To find the entry for a specific interface, use the GetInterfaceEntry method instead.


TObject.InheritsFrom

TObject	See also

Determines the relationship of two object types.

class function InheritsFrom(AClass: TClass): Boolean;

Description

Use InheritsFrom to determine if a particular class type is an ancestor of an object. InheritsFrom returns True if the object type specified in the AClass parameter is an ancestor of the object type or the type of the object itself. Otherwise, it returns False.

Note:	The is and as operators use InheritsFrom in their implementations. The is operator, however, can only determine the inheritance relationship of an instance. As a class method InheritsFrom can determine the relationship of class references.


TObject.InitInstance

TObject	See also

Initializes a newly allocated object instance to all zeros and initializes the instance’s virtual method table pointer.

class procedure InitInstance(Instance: Pointer): TObject;

Description

There should be no reason to call InitInstance directly. InitInstance is called automatically by NewInstance when an object is created. When overriding NewInstance be sure to call InitInstance as the last statement.

InitInstance is not virtual, so you cannot override it: Instead, initialize any data for an object in the constructor.


TObject.InstanceSize

TObject	See also

Returns the size in bytes of each instance of the object type.

class function InstanceSize: Longint;

Description

Use InstanceSize to determine how many bytes of memory are required for a class’s instance data. Delphi uses InstanceSize internally for methods that allocate and deallocate memory. InstanceSize is not a virtual method, so it cannot be overridden. InitInstance should only be called in the context of implementing a custom version of NewInstance.


TObject.MethodAddress

TObject	See also

Returns the address of a published method.

class function MethodAddress(const Name: ShortString): Pointer;

Description

MethodAddress is used internally by the VCL streaming system. When reading an event property from a stream, MethodAddress converts a method name, specified by Name, to a pointer containing the method address. There should be no need to call MethodAddress directly.

If Name does not specify a published method for the object, MethodAddress returns nil.


TObject.MethodName

TObject	See also

Returns a string containing the name of the method located at Address.

class function MethodName(Address: Pointer): ShortString;

Description

MethodName is used internally by the VCL streaming system. When writing event properties to a stream, MethodName converts a pointer containing the method address to a string containing the method name. It is the counterpart to MethodAddress. There should be no need to call MethodName directly.

If Address does not point to a published method of the object, MethodName returns an empty string.


TObject.NewInstance

TObject	See also

Allocates memory for each instance of an object type and returns a pointer to that new instance.

class function NewInstance: TObject; virtual;

Description

All constructors call NewInstance automatically. NewInstance calls InstanceSize to determine how much memory to allocate from the heap to contain a particular instance. Do not call NewInstance directly.

Override NewInstance only for special memory allocation requirements. For example, when allocating a large number of identical objects that all need to be in memory at the same time, one could allocate a large block of memory for the entire group, then override NewInstance to use part of that larger block for each instance.

Overriding NewInstance may necessitate overriding FreeInstance to deallocate that same memory. When overriding NewInstance, call InitInstance, and not inherited, as the last statement.

Note:	By default NewInstance calls InitInstance.


TObject.SafeCallException

TObject

Handles OLE exceptions.

type HResult = Longint;

function SafeCallException(ExceptObject: TObject; ExceptAddr: Pointer): HResult; virtual;

Description

SafeCallException is used for COM exception handling support. As implemented in TObject, SafeCallException returns E_UNEXPECTED. This is a default case that is appropriate for classes that do not support any COM interfaces. Classes that implement COM interfaces should override this method to handle other errors that might occur.

COM classes in Delphi override SafeCallException.


TObjectField

Hierarchy	Properties	Methods	Events

TObjectField is the common ancestor of TADTField, TArrayField, TDataSetField, and TReferenceField components in a dataset.

Unit

Db

Description

TObjectField encapsulates the fundamental behavior common to TADTField, TArrayField, TDataSetField, and TReferenceField components.


TObjectField properties

TObjectField	Alphabetically	Legend

In TObjectField

AsString

AsVariant

DataSet

FieldCount

FieldKind

Fields

FieldValues

HasConstraints

ObjectType

UnNamed

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSize

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldName

FieldNo

FullName

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TObjectField properties

TObjectField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMaskPtr

EditMask

FieldCount

FieldKind

FieldName

FieldNo

Fields

FieldValues

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Lookup

Name

NewValue

ObjectType

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

UnNamed

ValidChars

Value

VCLComObject

Visible


TObjectField.AsString

TObjectField	See also

Represents the value of an object field as a string.

property AsString: string;

Description

Use AsString to read the value of the child fields of an object field as a comma delimited string. An exception will be raised if an attempt is made to assign the value of an object field as a string.


TObjectField.AsVariant

TObjectField	See also

Represents the value of an object field as a variant.

property AsVariant: Variant;

Description

Use AsVariant to read or write the value of the child fields of an object field as a variant. The returned variant will be an array with the child values.


TObjectField.DataSet

TObjectField

Identifies the dataset to which a field component and its children belong.

property DataSet: TDataSet;

Description

Check the value of the DataSet property to determine the dataset that uses the field component to represent one of its fields and each of its child fields.

Applications should not directly assign the DataSet property of a field. It is assigned automatically when the field is created from a TFieldDef object.


TObjectField.FieldCount

TObjectField	See also

Indicates the number of child fields associated with the field.

property FieldCount: Integer;

Description

Examine FieldCount to determine the number of child fields associated with the field.


TObjectField.FieldKind

TObjectField	See also

Indicates whether a field represents a column in a dataset, a calculated field, or a lookup field.

Type TFieldKind = (fkData, fkCalculated, fkLookup, fkInternalCalc, fkAggregate);

property FieldKind: TFieldKind;

Description

Use FieldKind to determine if a field is a data field, a calculated field, or a lookup field. The value of FieldKind can be changed programmatically, but in practice FieldKind for the field and its child fields is automatically set at design time when creating Field components with the Fields editor.

The FieldKind property can take one of the following values:

Value	Description

fkData	Field represents a physical field in a database table

fkCalculated	Field is calculated in an OnCalcFields event handler

fkLookup	Field is a lookup field

fkInternalCalc	Field is calculated but values are stored in the dataset

fkAggregate	Field is an aggregated field


TObjectField.FieldValues

TObjectField	See also

Provides access to the values for all child fields in the field.

property FieldValues[Index: Integer]: Variant;

Description

Use FieldValues to read and write values for fields in a dataset.

FieldValues accepts and returns a Variant, so it can handle and convert fields of any type. For example, the following statements are syntactically identical and write the value from an edit box into an ADT field with a child string field called STREET:

Table1.FieldByName('ADDRESS.STREET').Value := Edit1.Text;

TADTField(Table1.FieldByName('ADDRESS')).FieldValues[0] := Edit1.Text;

The next statements reads a string value from the first child field of the object field ADDRESS into an edit box:

Edit1.Text := Table1.FieldByName('ADDRESS').FieldValues[0];

Note:	Because FieldValues always uses Variants, it may be a somewhat slower method of accessing data, than using a field’s native format (i.e., using a field’s AsXXX property), especially in applications that process large amounts of data.


TObjectField.Fields

TObjectField

Specifies the TFields object that contains an array of child fields.

property Fields: TFields;

Description

Child fields of the object field are maintained in a TFields object specified by the Fields property.


TObjectField.HasConstraints

TObjectField	See also

Indicates whether the object field or any of its child field values are constrained.

property HasConstraints: Boolean;

Description

Read HasConstraints to determine whether the field component imposes custom constraints, imported constraints, or a default expression. HasConstraints is True if the CustomConstraint, DefaultExpression, or ImportedConstraint property is set. Otherwise, HasConstraints is False, indicating that the server or database engine are not imposing any constraints on field values.

Field values can still be limited when HasConstraints is False. For example, an edit mask or OnValidate event handler can constrain field values. However, these constraints are imposed by the application, not by the server or database engine.


TObjectField.ObjectType

TObjectField

Specifies the classification of the field object in Oracle.

property ObjectType: string;

Description

In Oracle, objects are classified into object types.


TObjectField.UnNamed

TObjectField

Indicates whether an object field in a nested table has a name associated with it.

property UnNamed: Boolean;

Description

UnNamed is set to True when the object field in a nested table has no name associated with it.


TObjectField.Value

TObjectField	See also

Contains the actual data in an object field component.

property Value: Variant;

Description

Use Value to read data directly from and write data directly to an object field component at runtime.

The following example creates a variant array from the contents of edit boxes on a form, and assigns the values to an ADT field called ADDRESS. Each child field of the ADT field will be filled according to the order of the contents of the variant array.

Table1.FieldByName('ADDRESS').Value := VarArrayOf([Edit1.Text, Edit2.Text, Edit3.Text, Edit4.Text]);

Note:	TDataSet.ObjectView must be True for this example.


TObjectField events

TObjectField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TObjectField events

TObjectField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TObjectField methods

TObjectField	Alphabetically

In TObjectField

Create

Destroy

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TObjectField methods

TObjectField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

DestroyComponents

Destroying

Destroy

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

FreeOnRelease

Free

GetData

GetInterfaceEntry

GetInterfaceTable

GetInterface

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TObjectField.Create

TObjectField	See also

Creates and initializes a TObjectField object.

constructor Create(AOwner: TComponent); override;

Description

Do not create TObjectField instances. TObjectField is an abstract base class that should not be directly instantiated. The constructor for descendant classes is usually called indirectly by using the Fields editor at design time to create a persistent field component. Dataset objects also call field constructors automatically to create dynamic field components.

After calling the inherited constructor, Create creates a TFields object for child fields of the object field.


TObjectField.Destroy

TObjectField	See also

Destroys an instance of TObjectField.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. The destructor is called automatically by the dataset that owns the object field component, and applications never need to call it explicitly.

If an application creates a descendant of TObjectField without an owner, it should call Free instead of Destroy. Free checks that the field reference is not nil, and only then calls Destroy.

Destroy closes the dataset, deletes the instance of TObjectField from the dataset, and calls the inherited destructor.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TObjectField


 TOleContainer

Hierarchy	Properties	Methods	Events	See also

TOleContainer embeds or links OLE objects.

Unit

olectnrs

Description

Use TOleContainer to handle many of the complexities of OLE 2.0. TOleContainer lets the user choose an OLE object to insert by simply calling the InsertObjectDialog method. TOleContainer can create either an embedded OLE object or a linked OLE object.

TOleContainer automatically handles menu merging -- the process of combining the container form's menu with that of an in-place activated OLE object's server application. The menu items' GroupIndex property settings control how menus are merged. Those main menu items with GroupIndex values of 0, 2, and 4 remain; TOleContainer merges the server application's menus and replaces the main menu items with GroupIndex values of 1, 3, and 5 (if they exist).

OLE objects that are activated in-place add their servers' toolbars directly into the container application's window. Normally, any panels used for toolbars are replaced by the OLE object's server's toolbars. Prevent this by setting a panel's Locked property to True.

When using TOleContainer in an SDI application (the main form's FormStyle property is fsNormal rather than fsMDIForm), place the TOleContainer component inside a panel whose Align property is set to alClient. TOleContainer replaces an SDI form's toolbars as described above, and using a panel automatically adjusts the amount of space available to the OLE container.


TOleContainer properties

TOleContainer	Alphabetically	Legend

In TOleContainer

AllowActiveDoc

AllowInPlace

AutoActivate

AutoVerbMenu

BorderStyle

CanPaste

CopyOnSave

Iconic

Linked

Modified

NewInserted

ObjectVerbs

OldStreamFormat

OleClassName

OleObject

OleObjectInterface

PrimaryVerb

SizeMode

SourceDoc

State

StorageInterface

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

Caption

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragMode

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TOleContainer properties

TOleContainer	By object	Legend

Action

Align

AllowActiveDoc

AllowInPlace

Anchors

AutoActivate

AutoVerbMenu

BiDiMode

BorderStyle

BoundsRect

Brush

CanPaste

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

CopyOnSave

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragMode

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

Iconic

Left

Linked

LRDockWidth

Modified

Name

NewInserted

ObjectVerbs

OldStreamFormat

OleClassName

OleObject

OleObjectInterface

Owner

Parent

ParentColor

ParentCtl3D

ParentShowHint

ParentWindow

PopupMenu

PrimaryVerb

ShowHint

Showing

SizeMode

SourceDoc

State

StorageInterface

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TOleContainer.AllowActiveDoc

TOleContainer	See also

Specifies whether the OLE container supports the IOleDocumentSite interface.

property AllowActiveDoc: Boolean;

Description

Set AllowActiveDoc to True to specify that the OLE container can house an ActiveDoc (DocObject). Set AllowActiveDoc to False to limit the OLE container to hosting OLE controls that use the more usual interfaces such as IOleClientSite. ActiveDoc-enabled controls have a slightly different border. Set AllowActiveDoc to False to maintain a consistent appearance in forms that do not need to support the IOleDocumentSite interface.


TOleContainer.AllowInPlace

TOleContainer	See also

Determines whether the OLE container allows in-place activation.

property AllowInPlace: Boolean;

Description

Set AllowInPlace to specify what happens when the user activates the OLE object. If AllowInPlace is True and Iconic is False, the OLE object is activated in place. If AllowInPlace is False, the OLE object is activated in a separate window. The default value is True.


TOleContainer.AutoActivate

TOleContainer	See also

Determines how the object in an OLE container is activated.

type TAutoActivate = (aaManual, aaGetFocus, aaDoubleClick);

property AutoActivate: TAutoActivate;

Description

Set AutoActivate to specify what actions activate the OLE object. AutoActivate takes one of the values in the following table:

Values	Meaning

aaManual	The OLE object must be activated programmatically by calling DoVerb (ovShow).

aaGetFocus	The OLE object is activated when the OLE container gets focus (by clicking on it with the mouse or pressing Tab to move the focus to it).

aaDoubleClick	(Default) The OLE object is activated by double-clicking it or pressing Enter while the container has the focus.


TOleContainer.AutoVerbMenu

TOleContainer	See also

Determines whether the OLE container automatically creates a pop-up menu containing the OLE object's verbs.

property AutoVerbMenu: Boolean;

Description

Use AutoVerbMenu to specify whether the OLE object can replace the OLE container’s popup menu. If AutoVerbMenu is True (the default), the OLE object replaces any existing PopupMenu property. If AutoVerbMenu is False, no popup menu is automatically created.


TOleContainer.BorderStyle

TOleContainer	See also

Determines whether a single line is drawn around the OLE container.

property BorderStyle: TBorderStyle;

Description

Set BorderStyle to specify whether the OLE container should be framed by a single line. These are the possible values:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border


TOleContainer.CanPaste

TOleContainer	See also

Indicates whether the Windows clipboard contains an OLE object that can be pasted into the OLE container.

property CanPaste: Boolean;

Description

Read CanPaste before trying to paste or paste link an OLE object from the clipboard.


TOleContainer.CopyOnSave

TOleContainer	See also

Determines whether the SaveToFile and SaveToStream methods first create a copy of the OLE object.

property CopyOnSave: Boolean;

Description

When CopyOnSave is True, the SaveToFile and SaveToStream methods create a temporary OLE object, compressing redundant data to save space. This compressed copy is then saved to the file or stream. When CopyOnSave is False, the OLE object is saved directly to the file or stream without using a temporary copy to compress redundant information.

Set CopyOnSave to False when the container holds very large embedded objects and there might not be enough memory to make the temporary copy. The default value is True.


TOleContainer.Iconic

TOleContainer	See also

Determines whether the OLE object is displayed as an icon.

property Iconic: Boolean;

Description

Set Iconic to specify whether the OLE container displays the icon for the server application instead of the image of the object. If Iconic is True, the OLE object is displayed as an icon; if False, it's displayed as it would be in the server application.


TOleContainer.Linked

TOleContainer	See also

Indicates whether the OLE object is linked or embedded.

property Linked: Boolean;

Description

Read Linked to determine whether the OLE object is linked to the OLE server. If Linked is True, the OLE object is linked; if False, it's embedded. An OLE object must already be loaded in the container before accessing the Linked property.


TOleContainer.Modified

TOleContainer	See also

Indicates whether the OLE object has been modified.

property Modified: Boolean;

Description

Use Modified to determine when the OLE object has been modified (including being deleted or replaced by another OLE object). To keep track of incremental changes, set Modified to False and later check it to see if the OLE object has been modified after since Modified was set to False. If there is no OLE object loaded into the container, Modified returns False.


TOleContainer.NewInserted

TOleContainer	See also

Indicates whether the OLE object was created rather than pasted in or created as a link to a file.

property NewInserted: Boolean;

Description

Read NewInserted to determine whether the OLE object was newly created via a call to InsertObjectDialog. If there is no OLE object loaded into the container, NewInserted returns False. If NewInserted is True after a call to InsertObjectDialog, call DoVerb(ovShow) to let the user edit the object.


TOleContainer.ObjectVerbs

TOleContainer	See also

Lists the verbs that the OLE object supports.

property ObjectVerbs: TStrings;

Description

Read ObjectVerbs to determine the verbs that can be used with the OLE object. The verb names can have embedded ampersand (&) characters to indicate shortcut keys. An OLE object must already be loaded in the container before accessing the ObjectVerbs property.


TOleContainer.OldStreamFormat

TOleContainer	See also

Indicates whether the OLE object is loaded and saved using the Delphi format.

property OldStreamFormat: Boolean;

Description

Set OldStreamFormat to True to read OLE objects that were saved to file using Delphi or to save OLE objects that will be used by Delphi. If OldStreamFormat is False (the default), the LoadFromFile, LoadFromStream, SaveToFile, and SaveToStream methods use the newer format that contains extra header information. The extra header information is used to validate a file or stream. This property is provided for backward compatibility only.


TOleContainer.OleClassName

TOleContainer	See also

Specifies the class name of the OLE object.

property OleClassName: string;

Description

Read OleClassName to obtain the class name (programmatic identifier) for the OLE object. The class name is a string describing the class of OLE object that is registered in the Windows registry. An OLE object must already be loaded in the container before accessing the OleClassName property.


TOleContainer.OleObject

TOleContainer	See also

Represents the OLE object hosted by the OLE container.

property OleObject: Variant;

Description

Read OleObject to access the OLE object hosted by the OLE container as a variant. To interact with the OLE object using the IOleObject interface, use the OleObjectInterface property instead. If the OLE object is not loaded in the container before reading OleObject, an EOleError exception is raised.


TOleContainer.OleObjectInterface

TOleContainer	See also

Provides access to the IOleObject interface for the OLE object.

property OleObjectInterface: IOleObject;

Description

Use OleObjectInterface for low-level access to the OLE API. If there is no OLE object loaded into the container, OleObjectInterface returns nil.


TOleContainer.PrimaryVerb

TOleContainer	See also

Specifies the index of the primary (default) verb for the OLE object.

property PrimaryVerb: Integer;

Description

Use PrimaryVerb to determine which verb in the ObjectVerbs list specifies the default action for the OLE object. In a call to the DoVerb method, DoVerb(ovPrimary) is the same as DoVerb(PrimaryVerb). An OLE object must already be loaded in the container before accessing the PrimaryVerb property.


TOleContainer.SizeMode

TOleContainer	See also

Determines how the OLE object is sized in the OLE container.

type TSizeMode = (smClip, smCenter, smScale, smStretch, smAutoSize);

property SizeMode: TSizeMode;

Description

Set SizeMode to specify how the OLE object is fit into the client area of the OLE container. The following table gives the possible values :

Value	Meaning

smClip	(Default)- Displays the OLE object at its normal size, clipping any parts that don't fit within the container.

smCenter	Displays the OLE object at its normal size, centering it within the container.

smScale	Scales or shrinks the view of the OLE object to fit within the container, by scaling width and height proportionally.

smStretch	Scales or shrinks the view of the OLE object to fill the OLE container, without regard to preserving the proportions of the OLE object.

smAutoSize	Displays the OLE object at its normal size and automatically resizes the container to fit the size of the OLE object.


TOleContainer.SourceDoc

TOleContainer	See also

Specifies the name of the source document for a linked OLE object.

property SourceDoc: string;

Description

Read SourceDoc to obtain the name of the OLE object when it is linked. An OLE object must already be loaded in the container before accessing the SourceDoc property. If the OLE object isn't linked, SourceDoc returns an empty string.


TOleContainer.State

TOleContainer	See also

Describes the state of the OLE object.

Type TObjectState = (osEmpty, osLoaded, osRunning, osOpen, osInPlaceActive, osUIActive);

property State: TObjectState;

Description

Read State to determine the state of the OLE object and its server application. State has one of the following values:

Values	Meaning

osEmpty	There is no OLE object in the container.

osLoaded	There is an OLE object in the container, but its server application isn't currently running.

osRunning	The OLE object's server is running.

osOpen	The OLE object is open in a separate window.

osInPlaceActive	The OLE object is activated in place, but  hasn't yet merged its menus or toolbars. This is an intermediate state; the State property will shift to osUIActive as soon as the menus and toolbars have been merged.

osUIActive	The OLE object is activated in place and menus and toolbars have been merged


TOleContainer.StorageInterface

TOleContainer	See also

Provides access to the IStorage interface for the OLE object.

property StorageInterface: IStorage;

Description

Use StorageInterface for low-level access to the OLE API. If there is no OLE object loaded into the container, StorageInterface returns nil.


TOleContainer events

TOleContainer	Alphabetically	Legend

In TOleContainer

OnActivate

OnDeactivate

OnObjectMove

OnResize

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TOleContainer events

TOleContainer	By object	Legend

OnActivate

OnDeactivate

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnObjectMove

OnResize

OnStartDrag


TOleContainer.OnActivate

TOleContainer	See also

Occurs immediately after the OLE object is activated.

property OnActivate: TNotifyEvent;

Description

Write an OnActivate event handler to take specific action when the OLE object becomes active.


TOleContainer.OnDeactivate

TOleContainer	See also

Occurs immediately after the OLE object is deactivated.

property OnDeactivate: TNotifyEvent;

Description

Write an OnDeactivate event handler to respond when the OLE object is deactivated.


TOleContainer.OnObjectMove

TOleContainer	See also

Occurs when the OLE container is notified that the OLE object has moved or resized.

Type TObjectMoveEvent = procedure(OleContainer: TOleContainer; const Bounds: TRect) of object;

property OnObjectMove: TObjectMoveEvent;

Description

Write an OnObjectMove event handler to respond when the OLE object changes size or position. The Bounds parameter specifies the boundaries of the in-place object in the client coordinates of OLE container. OnObjectMove occurs before the OLE object’s image is updated to reflect the change.


TOleContainer.OnResize

TOleContainer	See also

Occurs immediately after the OLE container window is resized.

property OnResize: TNotifyEvent;

Description

Write an OnResize event handler to respond to changes in the size of the OLE container window. If SizeMode is smAutoSize, the container window changes size whenever the OLE object resizes.


TOleContainer methods

TOleContainer	Alphabetically

In TOleContainer

ChangeIconDialog

Close

Copy

Create

CreateLinkToFile

CreateObject

CreateObjectFromFile

CreateObjectFromInfo

Destroy

DestroyObject

DoVerb

GetIconMetaPict

InsertObjectDialog

LoadFromFile

LoadFromStream

ObjectPropertiesDialog

Paste

PasteSpecialDialog

Run

SaveAsDocument

SaveToFile

SaveToStream

UpdateObject

UpdateVerbs

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOleContainer methods

TOleContainer	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ChangeIconDialog

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

Close

ContainsControl

ControlAtPos

Copy

Create

CreateLinkToFile

CreateObject

CreateObjectFromFile

CreateObjectFromInfo

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DestroyObject

DisableAlign

Dispatch

Dock

DockDrop

DoVerb

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetIconMetaPict

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InsertObjectDialog

InstanceSize

Invalidate

IsRightToLeft

LoadFromFile

LoadFromStream

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

ObjectPropertiesDialog

PaintTo

Paste

PasteSpecialDialog

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

Run

SafeCallException

SaveAsDocument

SaveToFile

SaveToStream

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UpdateObject

UpdateVerbs

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TOleContainer.ChangeIconDialog

TOleContainer	See also

Displays the Change Icon OLE dialog box.

function ChangeIconDialog: Boolean;

Description

Call ChangeIconDialog to let the user choose a different icon (from .ICO, .DLL, and .EXE files) to use when displaying the OLE object as an icon. An OLE object must already be loaded before calling ChangeIconDialog. ChangeIconDialog returns True if the dialog box was successfully displayed and the user chose the OK button. ChangeIconDialog returns False otherwise.


TOleContainer.Close

TOleContainer	See also

Deactivates the OLE object.

procedure Close

Description

Call Close to deactivate the OLE object and terminate its server application, without removing it from the container. Any changes the user made to the OLE object are automatically saved. After calling Close, the container's State property is osLoaded.

Note:	If Close is called when no OLE object is loaded, TOleContainer raises an exception.


TOleContainer.Copy

TOleContainer	See also

Copies the OLE object to the Windows clipboard.

procedure Copy;

Description

Call Copy to write the OLE object to the clipboard. If there is no OLE object in the container, Copy raises an exception.


TOleContainer.Create

TOleContainer	See also

Creates and initializes an instance of TOleContainer.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TOleContainer object at runtime. OLE containers placed on forms at design time are created automatically.

Pass a component to the constructor to supply the OLE container with an Owner that is responsible for freeing it.

After calling the inherited constructor, Create

Sets ControlStyle to [csClickEvents, csSetCaption, csOpaque, csDoubleClicks].

Sets TabStop to True.

Sets ParentColor to False and BorderStyle to bsSingle.

Sets AllowActiveDoc and AllowInPlace to True.

Sets AutoActivate to aaDoubleClick and AutoVerbMenu to True.

Sets CopyOnSave to True.


TOleContainer.CreateLinkToFile

TOleContainer	See also

Creates a linked OLE object from the contents of a file.

procedure CreateLinkToFile(FileName: string; Iconic: Boolean);

Description

Call CreateLinkToFile to create a linked OLE object from the file specified by the FileName parameter. Iconic specifies whether the object is shown as an icon (True) or displayed as it would be in the server application (False). If there is already an OLE object in the container, it is destroyed and any changes the user made to it are discarded.


TOleContainer.CreateObject

TOleContainer	See also

Creates an embedded OLE object given its class name (also known as programmatic identifier).

Procedure CreateObject(const OleClassName: string; Iconic: Boolean);

Description

Call CreateObject to create an OLE object using the class name (also known as programmatic identifier) specified by the OleClassName parameter. The Iconic parameter indicates whether the object is shown as an icon (True) or displayed as it would be in the server application (False). If there's already an OLE object in the container, it is destroyed and any changes the user made to it are discarded.


TOleContainer.CreateObjectFromFile

TOleContainer	See also

Creates an embedded OLE object from the contents of a file.

Procedure CreateObjectFromFile(const FileName: string; Iconic: Boolean);

Description

Call CreateObjectFromFile to create an OLE object from the file specified by the FileName parameter. The Iconic parameter indicates whether the object is shown as an icon (True) or displayed as it would be in the server application (False). If there's already an OLE object in the container, it is destroyed and any changes the user made to it are discarded.


TOleContainer.CreateObjectFromInfo

TOleContainer	See also

Creates an OLE object matching the specified TCreateInfo record.

procedure CreateObjectFromInfo(const CreateInfo: TCreateInfo

Description

Call CreateObjectFromInfo to create a linked or embedded OLE object based on the specifications in the CreateInfo parameter. CreateInfo specifies whether the object should be created from a file, from a data transfer object, or from a class identifier, and provides the necessary supporting information. CreateInfo also indicates whether the OLE object should be displayed as an Icon, and allows the icon to be specified. If there's already an OLE object in the container, it is destroyed and any changes the user made to it are discarded.

Note:	The CreateLinkToFile, CreateObject, and CreateObjectFromFile methods are one-line calls for the most common types of OLE objects. They can be used instead of filling out the TCreateInfo record.


TOleContainer.Destroy

TOleContainer	See also

Destroys an instance of TOleContainer.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TOleContainer reference is not nil, and only then calls Destroy.Destroy frees the OLE object before calling the inherited destructor.


TOleContainer.DestroyObject

TOleContainer	See also

Destroys the container’s OLE object.

procedure DestroyObject;

voidDescription

Call DestroyObject to destroy the OLE object, discarding any unsaved changes the user made to it.


TOleContainer.DoVerb

TOleContainer	See also

Requests that the OLE object perform some action.

procedure DoVerb(Verb: Integer);

Description

Call DoVerb to request that the OLE object perform one of the actions listed by the ObjectVerbs property. OLE defines several verbs, such as ovShow (to display the OLE object) and ovPrimary (the default action, usually to activate the OLE object). OLE objects can also define their own custom verbs. Use the ObjectVerbs property to get a list of those custom verbs.


TOleContainer.GetIconMetaPict

TOleContainer	See also

Returns the global memory handle of a metafile containing the OLE object's icon.

function GetIconMetaPict: HGlobal;

Description

Call GetIconMetaPict to obtain a metafile handle for drawing the OLE object’s icon on another canvas. Use the global DestroyMetaPict procedure to destroy the handle. If the OLE container is empty, GetIconMetaPict raises an exception.


TOleContainer.InsertObjectDialog
TOleContainer.

TOleContainer	See also

Displays the Insert Object OLE dialog box.

function InsertObjectDialog: Boolean;

Description

Call InsertObjectDialog to let the user create an OLE object. The OLE object can be embedded or linked. InsertObjectDialog returns True if the dialog box was successfully displayed and the user chose the OK button. InsertObjectDialog returns False otherwise. If the user chose OK and there's already an OLE object in the container, it is destroyed and any changes the user made to it are discarded.


TOleContainer.LoadFromFile

TOleContainer	See also

Loads an OLE object from the specified file.

procedure LoadFromFile(const FileName: string);

Description

Call LoadFromFile to load an OLE object that was saved using the SaveToFile method. If OldStreamFormat is True, LoadFromFile loads files saved by Delphi's TOleContainer object as well as files saved using the current format; if OldStreamFormat is False, LoadFromFile will not load files saved by Delphi. If there's already an OLE object in the container, it is destroyed and any changes the user made to it are discarded.


TOleContainer.LoadFromStream

TOleContainer	See also

Loads an OLE object from the specified stream.

procedure LoadFromStream(Stream: TStream);

Description

Call LoadFromStream to load an OLE object from a stream. If OldStreamFormat is True, LoadFromStream loads OLE objects saved by Delphi's TOleContainer object as well as OLE objects saved using the current format; if OldStreamFormat is False, LoadFromStream will not load OLE objects saved by Delphi. If there's already an OLE object in the container, it is destroyed and any changes the user made to it are discarded.


TOleContainer.ObjectPropertiesDialog

TOleContainer	See also

Displays the OLE Object Properties property sheet.

function ObjectPropertiesDialog: Boolean;

Description

Call ObjectPropertiesDialog to let the user see and edit the properties of the OLE object. Any changes the user makes in the property sheet are automatically made to the OLE object. ObjectPropertiesDialog returns True if the property sheet was successfully displayed and the user chose the OK button. It returns False otherwise.

If the OLE container is empty, ObjectPropertiesDialog raises an exception.


TOleContainer.Paste

TOleContainer	See also

Pastes the contents of the Windows clipboard as an embedded object.

procedure Paste;

Description

Call Paste to embed the object on the clipboard in the OLE container. If there's already an OLE object in the container, it is destroyed and any changes the user made to it are discarded.


TOleContainer.PasteSpecialDialog

TOleContainer	See also

Displays the Paste Special OLE dialog box.

function PasteSpecialDialog: Boolean;

Description

Call PasteSpecialDialog to let the user control how the contents of the Windows clipboard are pasted into the container. The Paste Special dialog box lets the user select the format of the data, whether it should be embedded or linked, and whether the OLE object should be displayed as an icon (and if so, to choose a different icon). PasteSpecialDialog returns True if the dialog box was successfully displayed and the user chose the OK button. It returns False otherwise. If the user chose the OK button when there's already an OLE object in the container, it is destroyed and any changes the user made to it are discarded.


TOleContainer.Run

TOleContainer	See also

Runs the OLE object's server application, but doesn't open or active the OLE object iself.

procedure Run;

Description

Call Run to ensure that the server application is running. Once the server application is running, opening and activating the OLE object happens much more quickly. An OLE object must already be loaded in the container before calling Run, Otherwise, Run raises an exception.


TOleContainer.SaveAsDocument

TOleContainer	See also

Saves the OLE object to the specified file in native OLE Document format.

procedure SaveAsDocument(const FileName: string);

Description

Call SaveAsDocument to save the OLE object in its native OLE Document format. An OLE object must already be loaded in the container before calling SaveAsDocument. Otherwise, SaveAsDocument raises an exception.

Note:	Saving an OLE object to a file or a stream limits the ability of another application, such as Word, to open the file, even if it is saved with the correct extension. Saving to a file or a stream loses information necessary to open such a file. Use SaveAsDocument when needing to save files in a native OLE Document format.


TOleContainer.SaveToFile

TOleContainer	See also

Saves the OLE object to the specified file.

procedure SaveToFile(const FileName: string);

Description

Call SaveToFile to save the OLE object. If CopyOnSave is True, SaveToFile first creates a temporary OLE object that compresses redundant data, saving space in the file that is saved. If OldStreamFormat is True, SaveToFile writes a file that can be read by Delphi's TOLEContainer component.

An OLE object must already be loaded in the container before calling SaveToFile. Otherwise, SaveToFile raises an exception.


TOleContainer.SaveToStream

TOleContainer	See also

Saves the OLE object to the specified stream.

procedure SaveToStream(Stream: TStream);

Description

Call SaveToStream to save the OLE object. If CopyOnSave is True, SaveToStream first creates a temporary OLE object that compresses redundant data, reducing the information that must be saved. If OldStreamFormat is True, SaveToStream writes the object in a format that can be read by Delphi's TOLEContainer component.

An OLE object must already be loaded in the container before calling SaveToStream. Otherwise, SaveToStream raises an exception.


TOleContainer.UpdateObject

TOleContainer	See also

Refreshes the OLE object.

procedure UpdateObject;

Description

Linked OLE objects and embedded objects that contain linked OLE objects get out of date when the source of the link is updated. UpdateObject rereads the source to ensure that the OLE object has current data. If there is no OLE object loaded in the container, UpdateObject has no effect.


TOleContainer.UpdateVerbs

TOleContainer	See also

Refreshes the list of verbs the OLE object can respond to.

procedure UpdateVerbs;

Description

TOleContainer automatically calls UpdateVerbs when the ObjectVerbs property is first read, but some OLE objects change their verbs when they perform some actions. The Media Clip OLE object, for example, changes its Play verb to Stop while running. Call UpdateVerbs to ensure that the list of verbs is appropriate to the state of the OLE object.

An OLE object must already be loaded in the container before calling UpdateVerbs. Otherwise, UpdateVerbs raises an exception.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TOleControl

Hierarchy	Properties	Methods	See also

TOleControl is the base class from which ActiveX controls are derived.

Unit

olectrls

Description

TOleControl is derived from TWinControl and handles the interactions with OLE necessary for using ActiveX controls in the Delphi environment. It is unlikely that you will ever need to derive a component from this class.


TOleControl properties

TOleControl	Alphabetically	Legend

In TOleControl

DefaultDispatch

Name

OleObject

Parent

PerPropBrowsing

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TOleControl properties

TOleControl	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DefaultDispatch

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

OleObject

Owner

Parent

ParentWindow

PerPropBrowsing

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TOleControl.DefaultDispatch

TOleControl

The default dispatch interface.

property DefaultDispatch: Idispatch);

Description

DefaultDispatch default dispatch interface for that the ToleControl object encapsulates. For those ActiveX controls that have multiple dispatch interfaces, one is typically identified as the default.


TOleControl.Name

TOleControl

The name of the associated ActiveX control.

property Name: TComponentName;

Description

Name is used to get the name of the ActiveX control associated with the OLE control object.


TOleControl.OleObject

TOleControl

The ActiveX control associated with the TOleControl object.

property OleObject: Variant;

Description

OleObject is used to get the ActiveX control that is associated with the TOleControl


TOleControl.Parent

TOleControl

Specifies the control that contains the OleControl visually inside it.

property Parent: TWinControl;

Description

Use the Parent property to determine the parent of the OLE control or to assign a control to be the parent of this OLE control. When creating a new OLE control, always assign a parent. Usually, this is a form, panel, group box, or some control that is designed to contain others. Changing the Parent property moves the OLE control onscreen so that it is displayed within the new parent.


TOleControl.PerPropBrowsing

TOleControl 	See also

Provides access to information about the property page properties of the OleControl.

property PerPropBrowsing: IPerPropertyBrowsing;

Description

PerPropBrowsing is an interface to information about the properties of the OleControl as they appear on the associated property page.


TOleControl methods

TOleControl	Alphabetically

In TOleControl

BrowseProperties

Create

DefaultHandler

Destroy

DoObjectVerb

GetEnumPropDesc

GetHelpContext

GetObjectVerbs

GetPropDisplayString

GetPropDisplayStrings

IsCustomProperty

IsPropPageProperty

SetBounds

SetPropDisplayString

ShowAboutBox

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOleControl methods

TOleControl	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

BrowseProperties

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DoObjectVerb

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetEnumPropDesc

GetHelpContext

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetObjectVerbs

GetParentComponent

GetPropDisplayString

GetPropDisplayStrings

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsCustomProperty

IsPropPageProperty

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetPropDisplayString

SetTextBuf

Show

ShowAboutBox

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TOleControl.BrowseProperties

TOleControl

Notifies the ActiveX control to display its Properties dialog box.

procedure BrowseProperties;

Description

Use BrowseProperties to notify the ActiveX control to display its Properties dialog box. The Properties dialog box contains property pages for the ActiveX control.


TOleControl.DoObjectVerb

TOleControl

Notifies the ActiveX control to perform one of its actions.

procedure DoObjectVerb(Verb: Integer);

Description

Use DoObjectVerb to notify the ActiveX control to perform one of its actions. Verb is an integer that corresponds to the action.  Most application-defined verbs are small positive integers.  In addition,

VerbName	Verb

OLEIVERB_PRIMARY	0

OLEIVERB_SHOW	–1

OLEIVERB_OPEN	–2

OLEIVERB_HIDE	–3

OLEIVERB_UIACTIVATE	–4

OLEIVERB_INPLACEACTIVATE	–5

OLEIVERB_DISCARDUNDOSTATE	–6

OLEIVERB_PROPERTIES	–7

For more information about verbs, search the OLE.HLP file or the latest Microsoft Developer Network CD.


TOleControl.Create

TOleControl	See also

Creates a new instance of TOleControl.

constructor Create(AOwner: TComponent); override;

Description

Use Create to create a new instance of the TOleControl object. Create calls the inherited Create method and creates and initializes internal objects.


TOleControl.DefaultHandler

TOleControl	See also

The default message-handling routine.

procedure DefaultHandler(var Message); override;

Description

DefaultHandler handles all messages not already handled in a control’s WndProc or message handling methods. The inherited method should always be called for unhandled messages.


TOleControl.GetHelpContext

TOleControl

GetHelpContext retrieves the Help context of a member of the ActiveX control.

function GetHelpContext(Member: string; var HelpCtx: Integer; var HelpFile: string): Boolean;

Description

Use GetHelpContext to retrieve the Help context of a member of the ActiveX control.

Member is the name of a property, method, or event of the ActiveX control. To retrieve the help context of the ActiveX control itself, set Member to nil.

HelpCtx is a variable in which the Help context identifier of Member is to be stored.

HelpFile is a variable in which the name of the Help file containing HelpCtx is to be stored.

The information about the ActiveX control is retrieved from its ITypeInfo interfaces. For more information, search the OLE.HLP file for ITypeInfo.

GetHelpContext returns False if Member is not found; otherwise, GetHelpContext returns True.


TOleControl.Destroy

TOleControl	See also

Frees the memory associated with this instance of TOleControl.

destructor Destroy; override;

Description

Do not call Destroy. Instead, call Free, which calls Destroy if this instance of TOleControl is not nil.


TOleControl.GetObjectVerbs

TOleControl

GetObjectVerbs retrieves the names of the verbs implemented by the ActiveX control.

procedure GetObjectVerbs(List: TStrings);

Description

Use GetObjectVerbs to retrieve the names of the verbs implemented by the ActiveX control.

List is where the names of the verbs are to be stored.


TOleControl.GetPropDisplayString

TOleControl	See also

GetPropDisplayString returns the display string for an interface for the ActiveX control.

function GetPropDisplayString(DispID: Integer): string;

Description

GetPropDisplayString returns the display string for an interface for the ActiveX control.

DispID is the identifier for the interface. For more information, search the OLE.HLP file for DISPID.

For more information about GetPropDisplayString, search the latest Microsoft Developer Network CD for GetDisplayStrings.


TOleControl.GetEnumPropDesc

TOleControl

GetEnumPropDesc returns descriptions of the ActiveX control’s properties.

function GetEnumPropDesc(DispID: Integer): TEnumPropDesc;

Description

Use GetEnumPropDesc to return descriptions of the ActiveX control’s properties. GetEnumPropDesc returns the descriptions in a TEnumPropDesc object.


TOleControl.GetPropDisplayStrings

TOleControl	See also

GetPropDisplayStrings returns the display strings for an interface for the ActiveX control.

procedure GetPropDisplayStrings(DispID: Integer; List: TStrings);

Description

List is where the strings are to be stored.

For more information about GetPropDisplayStrings, search the latest Microsoft Developer Network CD for GetDisplayStrings.


TOleControl.IsCustomProperty

TOleControl

IsCustomProperty indicates whether an interface for the ActiveX control is a custom property.

function IsCustomProperty(DispID: Integer): Boolean;

Description

Use IsCustomProperty to determine whether an interface for the ActiveX control is a custom property.

DispID is the identifier for the interface. For more information, search the OLE.HLP file for DISPID.

IsCustomProperty returns True if an interface is a custom property; otherwise, IsCustomProperty returns False.


TOleControl.SetBounds

TOleControl

SetBounds sets the boundaries of the ActiveX control.

procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;

Description

Use SetBounds to set the boundaries of the ActiveX control.

ALeft, ATop, AWidth, and AHeight are the x-coordinate of the upper-left corner, the y-coordinate of the upper-left corner, the width and the height of the ActiveX control.


TOleControl.SetPropDisplayString

TOleControl	See also

SetPropDisplayString sets the display string for an interface for the ActiveX control.

procedure SetPropDisplayString(DispID: Integer; const Value: string);

Description

Use SetPropDisplayString to set the display string for an interface for the ActiveX control.

DispID is the identifier for the interface. For more information, search the OLE.HLP file for DISPID.

Value is the new display string for the interface.


TOleControl.ShowAboutBox

TOleControl

ShowAboutBox notifies the ActiveX control to display its About box.

procedure ShowAboutBox;

Description

Use ShowAboutBox to notify the ActiveX control to display its About box.


TOleControl.IsPropPageProperty

TOleControl

IsCustomProperty indicates whether an interface for the OCX control is a property page property.

function IsPropPageProperty(DispID: Integer): Boolean;

Description

Use IsPropPageProperty to determine whether an interface for the OCX control is a property page property.

DispID is the identifier for the interface. For more information, search the OLE.HLP file for DISPID.

IsPropPageProperty returns True if an interface is a property page property; otherwise, IsPropPageProperty returns False.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TOleForm

Hierarchy	Properties	Methods

TOleForm is an object that provides OLE support for a TForm object.

Unit

olectnrs

Description

TOleFrom implements the IOleForm, IOleWindow, IOleInPlaceUIWindow, and IOleInPlaceFrame interfaces, as well as a Delphi-defined interface for internal use. The implementation of the TOleForm object is used internally by the Visual Component Library.


TOleForm properties

TOleForm	Alphabetically	Legend

Derived from TInterfacedObject

RefCount


TOleForm properties

TOleForm	By object	Legend

RefCount


TOleForm methods

TOleForm	Alphabetically

In TOleForm

Create

Destroy

In TInterfacedObject

AfterConstruction

BeforeDestruction

NewInstance

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

SafeCallException


TOleForm methods

TOleForm	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TOleForm.Create

TOleForm	See also

Create creates a new instance of the TOleForm object.

constructor Create(Form: TCustomForm);

Description

Create is used to create a new instance of the TOleForm object. Form is the form upon which to base the new TOleForm object.


TOleForm.Destroy

TOleForm	See also

Destroy frees the memory associated with this instance of the TOleForm object.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead, call Free, which calls Destroy if this instance of the TOleForm object is not nil.

Destroy frees private objects allocated and used by this instance of the TOleForm object.


Accessibility

Read-only


Hierarchy

TObject

TInterfacedObject


 TOpenDialog

Hierarchy	Properties	Methods	Events	See also

TOpenDialog displays a file-selection dialog.

Unit

dialogs

Description

TOpenDialog displays a modal Windows dialog box for selecting and opening files. The dialog does not appear at runtime until it is activated by a call to the Execute method. When the user clicks Open, the dialog closes and the selected file or files are stored in the Files property.


TOpenDialog properties

TOpenDialog	Alphabetically	Legend

In TOpenDialog

DefaultExt

FileEditStyle

FileName

Files

Filter

FilterIndex

HistoryList

InitialDir

Options

Title

Derived from TCommonDialog

Ctl3D

Handle

HelpContext

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TOpenDialog properties

TOpenDialog	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Ctl3D

DefaultExt

DesignInfo

FileEditStyle

FileName

Files

Filter

FilterIndex

Handle

HelpContext

HistoryList

InitialDir

Name

Options

Owner

Tag

Title

VCLComObject


TOpenDialog.DefaultExt

TOpenDialog 	Example

Specifies a default file extension.

property DefaultExt: string;

Description

DefaultExt specifies a file extension that is appended automatically to the selected file name, unless the selected file name already includes a registered extension. If the user selects a file name with an extension that is unregistered, DefaultExt is appended to the unregistered extension.

Extensions longer than three characters are not supported. Do not include the period (.) that divides the file name and its extension.


TOpenDialog.FileEditStyle

TOpenDialog

Determines the style of the file-selection dialog. (Obsolete.)

type TFileEditStyle = (fsEdit, fsComboBox);

property FileEditStyle: TFileEditStyle;

Description

FileEditStyle is maintained for compatibility with older versions of Delphi.


TOpenDialog.FileName

TOpenDialog	See also 	Example

Indicates the name and directory path of the last file selected.

property FileName: TFileName;

Description

The FileName property returns the name and complete directory path of the most recently selected file. The value of FileName is the same as the first item in the Files property.

To make a file name appear by default in the dialog’s edit box, assign a value to FileName in the Object Inspector or in program code. Programmatic changes to FileName have no effect while the dialog is active.


TOpenDialog.Files

TOpenDialog	See also 	Example

Returns a list of the selected file names.

property Files: TStrings;

Description

FileName is a TStrings instance that contains each selected file name with its full directory path. (To let users select multiple file names, set the ofAllowMultiSelect flag in Options.)


TOpenDialog.Filter

TOpenDialog	See also 	Example

Determines the file masks (filters) available in the dialog.

property Filter: string;

Description

The file-selection dialog includes a drop-down list of file types under the edit box. When the user picks a file type from the list, only files of the selected type are displayed in the dialog.

To configure file masks at design time, click on the ellipsis marks (...) to the right of the Filter property in the Object Inspector. This opens the Filter editor. In the left column of the Filter editor, under Filter Name, type a brief description of each file type that will be available at runtime. In the right column, under Filter, type the file mask corresponding to each description. For example, the description “Text files” might appear to the left of the mask “*.TXT”, and the description “Pascal source files” might appear to the left of the mask “*.PAS”. Since the description appears in the drop-down list at runtime, it is often helpful to show the mask explicitly in the description (for example, “Text files (*.txt)”).

To create file masks in program code, assign a value to the Filter property that consists of a description and a mask separated by a vertical bar (pipe) character. Do not include spaces around the vertical bar. For example,

OpenDialog1.Filter := 'Text files (*.txt)|*.TXT';

Multiple filters should be separated by vertical bars. For example,

OpenDialog1.Filter := 'Text files (*.txt)|*.TXT|Pascal files (*.pas)|*.PAS';

To include multiple masks in a single filter, separate the masks with semicolons. This works both in the Object Inspector and in program code. For example,

OpenDialog1.Filter := 'Pascal files|*.PAS;*.DPK;*.DPR';

If no value is assigned to Filter, the dialog displays all file types.


TOpenDialog.FilterIndex

TOpenDialog	See also 	Example

Determines which filter is selected by default when the dialog opens.

property FilterIndex: Integer;

Description

FilterIndex determines which of the file types in Filter is selected by default when the dialog opens. Set FilterIndex to 1 to choose the first file type in the list as the default, or set FilterIndex to 2 to choose the second file type as the default, and so forth. If the value of FilterIndex is out or range, the first file type listed in Filter is the default.


TOpenDialog.HistoryList

TOpenDialog	See also

Maintains a list of previously selected files. (Obsolete.)

property HistoryList: TStrings;

Description

HistoryList is maintained for compatibility with older versions of Delphi.


TOpenDialog.InitialDir

TOpenDialog	See also

Determines the current directory when the dialog opens.

property InitialDir: string;

Description

InitialDir determines the default directory displayed in the file-selection dialog when it opens. For example, to point the dialog at the WINDOWS\SYSTEM directory, set the value of InitialDir to C:\WINDOWS\SYSTEM.

If no value is assigned to InitialDir, or if the specified directory does not exist, the initial directory is controlled by the global ForceCurrentDirectory variable. If ForceCurrentDirecotry is True, the dialog opens with the current working directory displayed. Otherwise, the dialog opens with either the current working directory or the My Documents directory, depending on the version of Windows.


TOpenDialog.Options

TOpenDialog	See also 	Example

Determines the appearance and behavior of the file-selection dialog.

type

  TOpenOption = (ofReadOnly, ofOverwritePrompt, ofHideReadOnly, ofNoChangeDir, ofShowHelp, ofNoValidate, ofAllowMultiSelect, ofExtensionDifferent, ofPathMustExist, ofFileMustExist, ofCreatePrompt, ofShareAware, ofNoReadOnlyReturn, ofNoTestFileCreate, ofNoNetworkButton, ofNoLongNames, ofOldStyleDialog, ofNoDereferenceLinks, ofEnableIncludeNotify, ofEnableSizing);

TOpenOptions = set of TOpenOption;

property Options: TOpenOptions;

Description

Use the Options property to customize the appearance and functionality of the dialog. The possible values of Options are

Value	Meaning

ofReadOnly	Selects the Open As Read Only check box by default when the dialog opens.

ofOverwritePrompt	Generates a warning message if the user tries to select a file name that is already in use, asking whether to overwrite the existing file. (Use with TSaveDialog and TSavePictureDialog.)

ofHideReadOnly	Removes the Open As Read Only check box from the dialog.

ofNoChangeDir	After the user clicks OK, resets the current directory to whatever it was before the file-selection dialog opened.

ofShowHelp	Displays a Help button in the dialog.

ofNoValidate	Disables checking for invalid characters in file names. Allows selection of file names with invalid characters.

ofAllowMultiSelect	Allows users to select more than one file in the dialog.

ofExtensionDifferent	This flag is turned on at runtime whenever the selected filename has an extension that differs from DefaultExt. If you use this flagin an application, remember to reset it.

ofPathMustExist	Generates an error message if the user tries to select a file name with a nonexistent directory path.

ofFileMustExist	Generates an error message if the user tries to select a nonexistent file. (only applies to Open dialogs).

ofCreatePrompt	Generates a warning message if the user tries to select a nonexistent file, asking whether to create a new file with the specified name.

ofShareAware	Ignores sharing errors and allows files to be selected even when sharing violations occur.

ofNoReadOnlyReturn	Generates an error message if the user tries to select a read-only file.

ofNoTestFileCreate	Disables checking for network file protection and inaccessibility of disk drives. Applies only when the user tries to save a file in a create-no-modify shared network directory.

ofNoNetworkButton	Removes the Network button (which opens a Map Network Drive dialog) from the file-selection dialog. Applies only if the ofOldStyleDialog flag is on.

ofNoLongNames	Displays 8.3-character file names only. This option is only valid if Options also includes ofOldStyleDialog.

ofOldStyleDialog	Creates the older style of file-selection dialog.

ofNoDereferenceLinks	Disables dereferencing of Windows shortcuts. If the user selects a shortcut, assigns to FileName the path and file name of the shortcut itself (the .LNK file), rather than the file linked to the shortcut.

ofEnableIncludeNotify	Sends include notification messages to the dialog. (Windows 2000 and later.)

ofEnableSizing	Allows users to resize the dialog.


TOpenDialog.Title

TOpenDialog 	Example

Specifies the text in the dialog’s title bar.

property Title: string;

Description

Use Title to specify the text that appears in the file-selection dialog’s title bar. If no value is assigned to Title, the dialog has the title “Open”.


TOpenDialog events

TOpenDialog	Alphabetically	Legend

In TOpenDialog

OnCanClose

OnFolderChange

OnIncludeItem

OnSelectionChange

OnTypeChange

Derived from TCommonDialog

OnClose

OnShow


TOpenDialog events

TOpenDialog	By object	Legend

OnCanClose

OnClose

OnFolderChange

OnIncludeItem

OnSelectionChange

OnShow

OnTypeChange


TOpenDialog.OnCanClose

TOpenDialog 	See also

Occurs when the user tries to close the dialog without canceling.

type TCloseQueryEvent = procedure(Sender: TObject; var CanClose: Boolean) of object;

property OnCanClose: TCloseQueryEvent;

Description

Write an OnCanClose event handler to provide custom validation of the value of FileName. File selection dialogs provide a number of built-in validations, such as checking for invalid characters, prompting for confirmation before overwriting, checking whether a file or path exists, and so on. These validations can be specified using the Options property. However, applications can provide additional validation of file names in an OnCanClose event handler.

Set the CanClose parameter to False to prevent the dialog from closing. The OnCanClose event handler is responsible for telling the user why the dialog doesn’t close.

Note:	OnCanClose does not occur under Windows NT 3.51 unless the new shell is installed.


TOpenDialog.OnFolderChange

TOpenDialog

Occurs when a directory is opened or closed from the dialog.

property OnFolderChange: TNotifyEvent;

Description

The OnFolderChange event occurs when the user changes the directory whose contents are displayed in the dialog. This can happen when the user double-clicks on a directory, clicks the Up arrow, or uses the list box at the top of the dialog to navigate through the directory structure.


TOpenDialog.OnIncludeItem

TOpenDialog	See also

Occurs before the dialog adds a file to the file list box.

type

  _OFNOTIFYEXA = packed record

    hdr: TNMHdr;

    lpOFN: POpenFilename;

    psf: IShellFolder;

    pidl: Pointer;

  end;

  TIncludeItemEvent = procedure(const OFN:TOFNotifyEx; var Include: Boolean) of object;

property OnIncludeItem: TIncludeItemEvent;

Description

Write an OnIncludeItem event handler to programmatically filter the items that appear in the shell folder’s item list.  The OFN parameter is a Windows structure that includes information about the shell folder. The pidl field points to the item identifier list of the item being added. Set the Include parameter to False to prevent this item from being added to the list.

This event does not occur unless the Options property includes ofEnableIncludeNotify.


TOpenDialog.OnSelectionChange

TOpenDialog	See also

Occurs when file names displayed in the dialog are changed.

property OnSelectionChange: TNotifyEvent;

Description

The OnSelectionChange event occurs when the user does something to change the list displayed in the dialog. This can include opening the file-selection dialog, highlighting a file or directory, selecting a new filter, selecting a new directory, or creating a new folder.


TOpenDialog.OnTypeChange

TOpenDialog	See also

Occurs when the file types displayed in the dialog are changed.

property OnSelectionChange: TNotifyEvent;

Description

The OnTypeChange event occurs when the user selects a new filter from the Files of Type list box at the bottom of the dialog.


TOpenDialog methods

TOpenDialog	Alphabetically	Legend

In TOpenDialog

Create

Destroy

Execute

GetStaticRect

Derived from TCommonDialog

DefaultHandler

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOpenDialog methods

TOpenDialog	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Execute

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetStaticRect

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TOpenDialog.Create

TOpenDialog	See also

Creates and initializes a TOpenDialog instance.

constructor Create(AOwner: TComponent); override;

Description

The Create method generates a TOpenDialog instance, but the new dialog does not appear on the form at runtime until the Execute method is called.


TOpenDialog.Destroy

TOpenDialog	See also

Destroys the TOpenDialog and frees its memory.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Call Free instead. Free verifies that the TOpenDialog reference is not nil before calling Destroy.


TOpenDialog.Execute

TOpenDialog 	Example

Displays the file-selection dialog.

function Execute: Boolean; override;

Description

Execute opens the file-selection dialog, returning True when the user selects a file and clicks Open. If the user clicks Cancel, Execute returns False.


TOpenDialog.GetStaticRect

TOpenDialog	See also 	Example

Returns the coordinates of the reserved area of the dialog box.

function GetStaticRect: TRect; virtual;

Description

GetStaticRect is provided for components that descend from TOpenDialog and require the placement of new controls alongside the standard ones inherited from the parent class. For Explorer-style dialogs (running under Windows 95 or NT 4.0), GetStaticRect returns the size and location of the standard controls within the dialog. For older versions of Windows, or if ofOldStyleDialog is enabled in Options, GetStaticRect returns the client dimensions of the entire dialog box.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog


 TOpenPictureDialog

Hierarchy	Properties	Methods	Events	See also

TOpenPictureDialog displays a graphics-file selection dialog.

Unit

extdlgs

Description

TOpenPictureDialog displays a modal Windows dialog box for selecting and opening graphics files. This component is just like TOpenDialog, except that it includes a rectangular preview region. If the selected image can be read by TPicture, it is displayed in the preview region; supported file types include bitmap (.BMP), icon (.ICO), Windows metafile (.WMF), and enhanced Windows metafile (.EMF). If the selected image cannot be displayed, “(None)” appears in the preview region.

If the user selects a file of an unrecognized type, TPicture raises an EInvalidGraphic exception.


TOpenPictureDialog properties

TOpenPictureDialog	Alphabetically	Legend

Derived from TOpenDialog

DefaultExt

FileEditStyle

FileName

Files

Filter

FilterIndex

HistoryList

InitialDir

Options

Title

Derived from TCommonDialog

Ctl3D

Handle

HelpContext

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TOpenPictureDialog properties

TOpenPictureDialog	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Ctl3D

DefaultExt

DesignInfo

FileEditStyle

FileName

Files

Filter

FilterIndex

Handle

HelpContext

HistoryList

InitialDir

Name

Options

Owner

Tag

Title

VCLComObject


TOpenPictureDialog events

TOpenPictureDialog	Alphabetically	Legend

Derived from TOpenDialog

OnCanClose

OnFolderChange

OnIncludeItem

OnSelectionChange

OnTypeChange

Derived from TCommonDialog

OnClose

OnShow


TOpenPictureDialog events

TOpenPictureDialog	By object	Legend

OnCanClose

OnClose

OnFolderChange

OnIncludeItem

OnSelectionChange

OnShow

OnTypeChange


TOpenPictureDialog methods

TOpenPictureDialog	Alphabetically

In TOpenPictureDialog

Create

Destroy

Execute

Derived from TCommonDialog

DefaultHandler

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOpenPictureDialog methods

TOpenPictureDialog	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Execute

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TOpenPictureDialog.Create

TOpenPictureDialog	See also 	Example

Creates and initializes a TOpenPictureDialog instance.

constructor Create(AOwner: TComponent); override;

Description

The Create method generates a TOpenPictureDialog instance, but the dialog does not appear at runtime until the Execute method is called. Create initializes the Filter property by defining a filter for each file type that TPicture supports.


TOpenPictureDialog.Destroy

TOpenPictureDialog	See also

Destroys the TOpenPictureDialog and frees its memory.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Call Free instead. Free verifies that the object reference is not nil before calling Destroy.


TOpenPictureDialog.Execute

TOpenPictureDialog

Displays the file-selection dialog.

function Execute: Boolean; override;

Description

Execute opens the file-selection dialog, returning True when the user selects a file and clicks Open. If the user clicks Cancel, Execute returns False.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog

TOpenDialog


TOrderedList

Hierarchy	Methods	See also

TOrderedList maintains an array of pointers that must be accessed in serial order.

Unit

contnrs

Description

TOrderedList is an abstract class that represents a list. Descendant classes like TStack and TQueue override the protected PushItem method to determine the order in which items are accessed.


TOrderedList methods

TOrderedList	Alphabetically	Legend

In TOrderedList

AtLeast

Count

Create

Destroy

Peek

Pop

Push

PushItem

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TOrderedList methods

TOrderedList	By object	Legend

AfterConstruction

AtLeast

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Count

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Peek

Pop

Push

PushItem

SafeCallException


TOrderedList.AtLeast

TOrderedList	See also

Checks the size of the list.

function AtLeast(ACount: Integer): Boolean;

Description

Call AtLeast to verify the size of the list. AtLeast returns True if the number of items in the list is greater than or equal to ACount.


TOrderedList.Count

TOrderedList	See also

Returns the size of the list.

function Count: Integer;

Description

Count returns the number of items in the list.


TOrderedList.Create

TOrderedList	See also

Creates a TOrderedList instance.

constructor Create;

Description

Create generates a new list.


TOrderedList.Destroy

TOrderedList	See also

Destroys the TOrderedList instance.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead, call Free. Free verifies that the TOrderedList reference is not nil, and only then calls Destroy.

Destroy frees the memory used to store the TOrderedList instance. It does not free the memory pointed to by the items in the list.


TOrderedList.Peek

TOrderedList	See also

Returns a pointer to the next item in the list.

function Peek: Pointer;

Description

Call Peek to access the list without removing an item. Peek returns a pointer to the next item in the list.

To remove an item from the list, call Pop.


TOrderedList.Pop

TOrderedList	See also

Removes and returns the next item in the list.

function Pop: Pointer;

Description

Call Pop to retrieve an item from the list. Pop removes the next item from the list, then returns a pointer to the deleted item.

To access the list without removing an item, call Peek.


TOrderedList.Push

TOrderedList	See also

Adds an item to the list.

procedure Push(AItem: Pointer);

Description

Call Push to add an item to the list.

To retrieve items added with Push, call Pop or Peek.


TOrderedList.PushItem

TOrderedList	See also

Adds an item to the list.

procedure PushItem(AItem: Pointer); virtual; abstract;

Description

Descendant classes implement PushItem, which is called by Push, to determine the position at which items are added to the list. In TStack, items are added to the same end of the list from which Pop retrieves them (so that the list is last-in first-out). In TQueue, items are added to the opposite end (so that the list is first-in first-out).


Scope

Protected


Hierarchy

TObject


 TOutline

Hierarchy	Properties	Methods	Events	See also

TOutline is a multilevel outline that displays the values of TOutlineNode objects.

Unit

Outline

Description

Use an outline to visually organize information in a hierarchical tree. Each item in an outline is contained in a TOutlineNode object. Outline controls allow an application to manage a hierarchy of outline nodes, including the ability to control the appearance and layout of those nodes and the ability to expand or collapse branches of the outline tree.

TOutline implements the generic behavior introduced in TCustomOutline. TOutline publishes many of the properties and events inherited from TCustomOutline, but does not introduce any new behavior.


TOutline properties

TOutline	Alphabetically	Legend

Derived from TCustomOutline

ItemCount

ItemHeight

Items

ItemSeparator

Lines

Options

OutlineStyle

PictureClosed

PictureLeaf

PictureMinus

PictureOpen

PicturePlus

SelectedItem

Style

Derived from TCustomGrid

BorderStyle

Row

ScrollBars

Derived from TCustomControl

Canvas

Derived from TWinControl

Brush

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TOutline properties

TOutline	By object	Legend

Action

Align

Anchors

BiDiMode

BorderStyle

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

ItemCount

ItemHeight

Items

ItemSeparator

Left

Lines

LRDockWidth

Name

Options

OutlineStyle

Owner

Parent

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PictureClosed

PictureLeaf

PictureMinus

PictureOpen

PicturePlus

PopupMenu

Row

ScrollBars

SelectedItem

ShowHint

Showing

Style

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TOutline events

TOutline	Alphabetically	Legend

Derived from TCustomOutline

OnCollapse

OnDrawItem

OnExpand

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TOutline events

TOutline	By object	Legend

OnClick

OnCollapse

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnDrawItem

OnEndDock

OnEndDrag

OnEnter

OnExit

OnExpand

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TOutline methods

TOutline	Alphabetically

Derived from TCustomOutline

Add

AddChild

AddChildObject

AddObject

BeginUpdate

Clear

Create

Delete

Destroy

EndUpdate

FullCollapse

FullExpand

GetDataItem

GetItem

GetNodeDisplayWidth

GetTextItem

GetVisibleNode

Insert

InsertObject

LoadFromFile

LoadFromStream

SaveToFile

SaveToStream

SetUpdateState

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOutline methods

TOutline	By object

Add

AddChild

AddChildObject

AddObject

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BeginUpdate

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Delete

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

EndUpdate

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

FullCollapse

FullExpand

GetControlsAlignment

GetDataItem

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetItem

GetNamePath

GetNodeDisplayWidth

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextItem

GetTextLen

GetVisibleNode

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

Insert

InsertComponent

InsertControl

InsertObject

InstanceSize

Invalidate

IsRightToLeft

LoadFromFile

LoadFromStream

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

SaveToFile

SaveToStream

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

SetUpdateState

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGrid

TCustomOutline


OutlineError

Hierarchy	Methods	See also

OutlineError is a special exception class for invalid outline-node indexes.

Unit

outline

Description

OutlineError is raised when an application cannot access a specified outline node. In most cases, this occurs because the index used is invalid.

OutlineError is raised internally to abort look-ups of outline components. Because it does not descend from Exception, it never appears at runtime—even if the debugger is set to break on exceptions. Thus it is a useful tool for aborting deep recursions.

Note:	OutlineError is raised by the TOutline component, which is maintained for compatibility with older versions of Delphi only.


OutlineError methods

OutlineError	Alphabetically

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


OutlineError methods

OutlineError	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject


TOutlineNode

Hierarchy	Properties	Methods	See also

TOutlineNode represents a node in a TCustomOutline object.

Unit

outline

Description

Use TOutlineNode to describe a node in a Win 3.1 outline. Each outline node appears as a line, or row, of the outline. An outline node can have from 0 to 16368 subnodes, which are subordinate to the parent node in the outline structure.


TOutlineNode properties

TOutlineNode	Alphabetically	Legend

In TOutlineNode

Data

Expanded

FullPath

HasItems

Index

IsVisible

Level

Parent

Text

TopItem


TOutlineNode properties

TOutlineNode	By object	Legend

Data

Expanded

FullPath

HasItems

Index

IsVisible

Level

Parent

Text

TopItem


TOutlineNode.Data

TOutlineNode	See also

Points to application-specific data associated with the node.

property Data: Pointer;

Description

Use Data to associate an arbitrary value with a node in an outline. For example, if the outline represents the table of contents to an electronic document, Data could point to an object that provides jump information for accessing the section of the document named by the node.

The Data property is usually described by the Text property, which is displayed in the rendered image of the node.


TOutlineNode.Expanded

TOutlineNode	See also

Determines whether descendants of the outline node are displayed.

property Expanded: Boolean;

Description

Set Expanded to True to display all subnodes of a node. When an outline node is expanded, its descendants are displayed and, depending on the OutlineStyle property of the outline in which the node is contained, the minus picture or open picture is displayed.

Set Expanded to False to collapse the node. When an outline node is collapsed, its descendants are hidden and, depending on the OutlineStyle property of the outline in which the node is contained, the plus picture or closed picture is displayed.

Expanded is not meaningful for nodes that have no descendants.


TOutlineNode.FullPath

TOutlineNode	See also

Describes an outline node, using its text and the text of all ancestor nodes in the outline.

property FullPath: string;

Description

Read FullPath to obtain a description of the entire branch of the outline leading to the outline node. FullPath consists of the values of the Text properties of all outline items, starting with the text of the node at the first level and traversing the outline down to the outline node. The string specified as the ItemSeparator property of the outline separates the text for each node in the path.


TOutlineNode.HasItems

TOutlineNode	See also

Indicates whether the outline node has any subnodes.

property HasItems: Boolean;

Description

Read HasItem to determine whether the outline node is a leaf node. Depending on the OutlineStyle property of the outline that contains the node, leaf nodes may appear with the leaf bitmap. If the node is not a leaf, subnodes appear below and indented from the node when it is expanded.

HasItem returns True if the node has any descendants, even if the node is collapsed and the descendants are not visible. HasItem returns False if the node is a leaf node.


TOutlineNode.Index

TOutlineNode	See also

Identifies the node in the Items array maintained by the outline.

property Index: LongInt;

Description

Read Index to determine the row of the outline where the node appears. The first node has an Index value of 1, and subsequent nodes are indexed sequentially. If a node has subnodes, the Index value of the parent node is one less than the Index value of its first descendant.

When nodes in the outline are added, moved, or deleted, the values of the Index properties of all subsequent nodes must be recalculated to be valid. Sometimes, the recalculation of indexes is deferred until all changes to the nodes are complete. To ensure that the value of Index is valid, call the SetUpdateState method of the outline that contains the node.


TOutlineNode.IsVisible

TOutlineNode	See also

Indicates whether the outline node is visible in the outline.

property IsVisible: Boolean;

Description

Read IsVisible to determine whether the node is part of the current image of the outline. A node is visible if it is on level 1 or if all its parents are expanded.

Note:	Do not confuse IsVisible with the Visible property of TControl objects. Outline nodes are not controls, but merely helper objects that describe nodes for an outline control. IsVisible indicates whether a node is visible because its parents are expanded or collapsed. It does not provide information about whether the node has been scrolled out of view, or even if the outline is not visible.


TOutlineNode.Level

TOutlineNode	See also

Indicates the level of indentation of a node within the outline.

property Level: Cardinal;

Description

The value of Level is 1 for nodes that directly descend from the root of the outline (the top level). The value of Level is 2 for their children, and so on.


TOutlineNode.Parent

TOutlineNode	See also

Identifies the immediate ancestor of the node.

property Parent: TOutlineNode;

Description

Read Parent to find the parent of an outline node. A parent node is one level higher and contains the child node as a subnode.


TOutlineNode.Text

TOutlineNode	See also

Specifies the string that identifies the outline node.

property Text: string;

Description

Use Text to determine the string that is displayed in the outline to represent the node.


TOutlineNode.TopItem

TOutlineNode	See also

Indicates which outline node is the topmost ancestor of a node.

property TopItem: LongInt;

Description

Read TopItem to determine the first node in the branch of the outline tree that contains the outline node. The TopItem property specifies the Index value of the level 1 ancestor of the outline node. For a node on level 1, TopItem has the same value as the Index property.


TOutlineNode methods

TOutlineNode	Alphabetically

In TOutlineNode

ChangeLevelBy

Collapse

Create

Destroy

Expand

FullExpand

GetDisplayWidth

GetFirstChild

GetLastChild

GetNextChild

GetPrevChild

MoveTo

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TOutlineNode methods

TOutlineNode	By object

AfterConstruction

Assign

BeforeDestruction

ChangeLevelBy

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Collapse

Create

DefaultHandler

Destroy

Dispatch

Expand

FieldAddress

Free

FreeInstance

FullExpand

GetDisplayWidth

GetFirstChild

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetLastChild

GetNamePath

GetNextChild

GetPrevChild

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

MoveTo

NewInstance

SafeCallException


TOutlineNode.Destroy

TOutlineNode	See also

Frees the memory associated with the TOutlineNode object.

destructor Destroy; override;

Description

Do not call Destroy directly. The preferred method of deleting nodes is to use the Delete method of the containing outline component.


TOutlineNode.ChangeLevelBy

TOutlineNode	See also

Changes the level of an outline node.

procedure ChangeLevelBy(Value: TChangeRange);

Description

Call ChangeLevelBy to move a node up or down a branch in the outline. Specify a Value parameter value of -1 to move up (toward the root) one level. Specify a Value parameter value of 1 to move down (away from the root) one level.

When moving up one level, an item becomes the next sibling of its former parent. When moving down one level, an item becomes the last child of its former prior sibling.

Nodes at the first level can not be moved up, as they have no parent. The first node in the outline can not be moved down either, as it has no prior sibling.

Note:	Before calling ChangeLevelBy, be sure that the node has the appropriate number of parents or that the appropriate prior siblings exist.


TOutlineNode.Collapse

TOutlineNode	See also

Collapses an outline item.

procedure Collapse;

Description

Collapse sets the Expanded property to False. When an outline node is collapsed, its descendants are hidden and, depending on the OutlineStyle property of the outline in which the node is contained, the plus picture or closed picture is displayed.

Collapse does nothing to nodes that have no descendants.


TOutlineNode.Expand

TOutlineNode	See also

Expands an outline item.

procedure Expand;

Description

Expand sets the Expanded property to True. When an outline node is expanded, its descendants are displayed and, depending on the OutlineStyle property of the outline in which the node is contained, the minus picture or open picture is displayed.

Expand does nothing to nodes that have no descendants.

Note:	Expand only ensures that the immediate children of a node are visible. To expand all descendants of a node, use the FullExpand method.


TOutlineNode.FullExpand

TOutlineNode	See also

Expands an outline node and all its descendants.

procedure FullExpand;

Description

Use FullExpand to expand all the nodes in the subtree of the outline rooted at the outline node. FullExpand sets the Expanded property of the node and all its descendants to True.


TOutlineNode.GetDisplayWidth

TOutlineNode	See also

Returns the distance, in pixels, from the left edge of the outline to the right edge of the outline node.

function GetDisplayWidth: Integer;

Description

Call GetDisplayWidth to determine the length of the line in the outline that contains the outline node. GetDisplayWidth adjusts for the lines and bitmaps specified by the OutlineStyle property of the outline.


TOutlineNode.GetFirstChild

TOutlineNode	See also

Returns the Index value of the first subnode.

function GetFirstChild: LongInt;

Description

Call GetFirstChild to locate the first subnode of a node when traversing the outline tree. If the node has no descendants, GetFirstChild returns -1.


TOutlineNode.GetLastChild

TOutlineNode	See also

Returns the Index value of the last subnode.

function GetLastChild: LongInt;

Description

Call GetLastChild to locate the last subnode of a node. If the node has no descendants, GetLastChild returns -1.


TOutlineNode.GetNextChild

TOutlineNode	See also

Returns the Index value of the next child of an outline node.

function GetNextChild(Value: LongInt): LongInt;

Description

Call GetNextChild to obtain the index of the next immediate descendant of a node, following the child node with the index given by the Value parameter. If the child node indicated by Value has no next sibling, or if the child node indicated by Value is not an immediate descendant of the outline node, GetNextChild returns -1.

Index values reflect a depth-first traversal of the outline. Thus, the next sibling of the child node indicated by Value is not simply one more than Value, unless the child node has no descendants. GetNextChild allows a breadth first traversal of the outline.


TOutlineNode.GetPrevChild

TOutlineNode	See also

Returns the Index value of the previous child of an outline node.

function GetPrevChild(Value: LongInt): LongInt;

Description

Call GetPrevChild to obtain the index of the previous immediate descendant of a node, preceding the child node with the index given by the Value parameter. If the child node indicated by Value has no prior sibling, or if the child node indicated by Value is not an immediate descendant of the outline node, GetPrevChild returns -1.

Index values reflect a depth-first traversal of the outline. Thus, the previous sibling of the child node indicated by Value is not simply one less than Value, unless that previous sibling has no descendants.


TOutlineNode.MoveTo

TOutlineNode	See also

Moves an outline node from one location within the outline to another.

procedure MoveTo(Destination: LongInt, AttachMode: TAttachMode);

Description

Call MoveTo to reposition the node to the position indicated by the Destination parameter. Destination is the Index value of another outline node. The AttachMode parameter specifies how to attach the moved node to the destination position.

Note:	To change only the level of a node, use the ChangeLevelBy method.


TOutlineNode.Create

TOutlineNode	See also

Creates a new TOutlineNode object.

constructor Create(AOwner: TCustomOutline);

Description

Do not call the constructor for TOutlineNode directly. Instead, use one of the methods of the outline component in which the node should appear. These methods are as follows:

Method	Action

Add	Creates the node as the last sibling of a specified node.

AddObject	Same as Add, but also initializing the node’s Data property.

AddChild	Creates the node as the last child of a specified node.

AddChildObject	Same as AddChild, but also initializing the node’s Data property.

Insert	Creates the node in the current position of an existing node.

InsertObject	Same as Insert, but also initializing the node’s Data property.


Accessability

Read-only


Hierarchy

TObject

TPersistent


TOwnedCollection

Hierarchy	Properties	Methods	See also

TOwnedCollection is a collection that maintains information about its owner.

Unit

classes

Description

By maintaining information about its owner, TOwnedCollection lets the Object Inspector display the collection's name at design time.

Note:	This information is not part of TOwnedCollection’s public interface.

New collection classes should descend from TOwnedCollection. By descending from TOwnedCollection, the derived class does not need to add anything in order to appear in the Object Inspector. Classes that descend directly from TCollection must implement a GetOwner method if they are to appear in the Object Inspector.


TOwnedCollection properties

TOwnedCollection	Alphabetically	Legend

Derived from TCollection

Count

ItemClass

Items


TOwnedCollection properties

TOwnedCollection	By object	Legend

Count

ItemClass

Items


TOwnedCollection methods

TOwnedCollection	Alphabetically

In TOwnedCollection

Create

Derived from TCollection

Add

Assign

BeginUpdate

Clear

Delete

Destroy

EndUpdate

FindItemID

GetNamePath

Insert

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TOwnedCollection methods

TOwnedCollection	By object

Add

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

FindItemID

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TOwnedCollection.Create

TOwnedCollection	See also

Creates and initializes a TOwnedCollection instance.

type TCollectionItemClass = class of TCollectionItem;

constructor Create(AOwner: TPersistent; ItemClass: TCollectionItemClass);

Description

The Create method takes two parameters: the name of an instance object descended from TPersistent and the name of a TCollectionItem descendant class. The first parameter is the owner of the TOwnedCollection instance. The second parameter determines the class of the items created by the Add method.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


 TPageControl

Hierarchy	Properties	Methods	Events	See also

TPageControl is a set of pages used to make a multiple page dialog box.

Unit

comctrls

Description

Use TPageControl to create a multiple page dialog or tabbed notebook. TPageControl displays multiple overlapping pages that are TTabSheet objects. The user selects a page by clicking the page’s tab that appears at the top of the control. To add a new page to a TPageControl object at design time, right-click the TPageControl object and choose New Page.

To create a tabbed control that uses only a single body portion (page), use TTabControl instead.


TPageControl properties

TPageControl	Alphabetically	Legend

In TPageControl

ActivePage

ActivePageIndex

PageCount

Pages

Derived from TCustomTabControl

Canvas

HotTrack

Images

MultiLine

OwnerDraw

RaggedRight

ScrollOpposite

Style

TabHeight

TabPosition

TabWidth

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DockSite

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TPageControl properties

TPageControl	By object	Legend

Action

ActivePage

ActivePageIndex

Align

Anchors

BiDiMode

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DockSite

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

HotTrack

Images

Left

LRDockWidth

MultiLine

Name

Owner

OwnerDraw

PageCount

Pages

Parent

ParentBiDiMode

ParentFont

ParentShowHint

ParentWindow

PopupMenu

RaggedRight

ScrollOpposite

ShowHint

Showing

Style

TabHeight

TabOrder

TabPosition

TabStop

TabWidth

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TPageControl.ActivePage

TPageControl	See also	Example

Specifies the page currently displayed by the page control.

property ActivePage: TTabSheet;

Description

Read ActivePage to determine which page is selected by the user. The user selects a page by clicking the mouse on its tab. Set ActivePage to bring a page to the foreground. Only one page can be active at a time.

To change the ActivePage to the page that precedes or follows the active page, use the SelectNextPage method. To iterate through all the pages to locate a specific page, use the FindNextPage method.


TPageControl.ActivePageIndex

TPageControl	See also

Specifies the page currently displayed by the page control.

property ActivePageIndex: Integer;

Description

Use ActivePageIndex to get or set the active page by index rather than by object. The value of ActivePageIndex identifies a page in the Pages property array.  Changing the value of ActivePageIndex changes the ActivePage property, and vice versa.

If there is no active page, reading ActivePageIndex gives a value of –1.

Setting ActivePageIndex to a value that is out of bounds (less than 0 or greater than PageCount - 1) results in the page control having no active page.


TPageControl.PageCount

TPageControl	See also	Example

Indicates the number of pages in the TPageControl object.

property PageCount: Integer;

Description

Use PageCount to determine the number of pages listed by the Pages property. If the MultiLine property is False, not all pages may have tabs visible to the user.


TPageControl.Pages

TPageControl	See also	Example

Lists all the pages in the TPageControl.

property Pages[Index: Integer]: TTabSheet;

Description

Use Pages to gain direct access to a particular page in the page control. For example, use Pages to disable individual pages in the page control. Specify which page to access using Index, where an Index of 0 specifies the first page, an Index of 1 specifies the second page, and so on. Each page is a TTabSheet object.

To locate a page in the page control by its position relative to another page, use the FindNextPage method.

Note:	Pages is a read-only property. To add a tab sheet to a page control at design time, right click and select New Page. To add a tab sheet to a page control at runtime, create the tab sheet and set its PageControl property to the page control.


TPageControl events

TPageControl	Alphabetically	Legend

Derived from TCustomTabControl

OnChange

OnChanging

OnDrawTab

OnGetImageIndex

Derived from TWinControl

OnDockDrop

OnDockOver

OnEnter

OnExit

OnGetSiteInfo

OnUnDock

Derived from TControl

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock

OnStartDrag


TPageControl events

TPageControl	By object	Legend

OnChange

OnChanging

OnContextPopup

OnDockDrop

OnDockOver

OnDragDrop

OnDragOver

OnDrawTab

OnEndDock

OnEndDrag

OnEnter

OnExit

OnGetImageIndex

OnGetSiteInfo

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock

OnStartDrag

OnUnDock


TPageControl methods

TPageControl	Alphabetically	Legend

In TPageControl

CanShowTab

Change

Create

Destroy

DoAddDockClient

DockOver

DoRemoveDockClient

FindNextPage

GetChildren

GetImageIndex

GetPageFromDockClient

GetSiteInfo

Loaded

SetChildOrder

SelectNextPage

ShowControl

UpdateActivePage

Derived from TCustomTabControl

GetHitTestInfoAt

IndexOfTabAt

RowCount

ScrollTabs

TabRect

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPageControl methods

TPageControl	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

CanShowTab

Change

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

DoAddDockClient

Dock

DockDrop

DockOver

DoRemoveDockClient

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FindNextPage

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetChildren

GetControlsAlignment

GetHitTestInfoAt

GetImageIndex

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetPageFromDockClient

GetParentComponent

GetSiteInfo

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

IndexOfTabAt

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

Loaded

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

RowCount

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

ScrollTabs

SelectNextPage

SendToBack

SetBounds

SetChildOrder

SetFocus

SetTextBuf

Show

ShowControl

TabRect

Update

UpdateAction

UpdateActivePage

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TPageControl.CanShowTab

TPageControl	See also

Indicates whether a tab sheet in the page control can be selected.

function CanShowTab(TabIndex: Integer): Boolean; override;

Description

Call CanShowTab to determine whether a tab can be selected or accessed.

TabIndex is the index of the tab in the list of tab sheets maintained by the Pages property.

CanShowTab returns True if the specified Tab sheet is enabled (its Enabled property is True ).


TPageControl.Create

TPageControl	See also	Example

Creates an instance of PageControl.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a page control at runtime. Page controls added to forms at design time are created automatically.

Pass a single Component as a parameter to provide the page control with an Owner that is responsible for freeing it.

After calling the inherited constructor, Create sets ControlStyle to csDoubleClicks, and creates a TList object to hold the pages of the control.

When creating a page control at runtime, the pages must be added programmatically. To add a page to a page control at runtime, create the TTabSheet object for the page and set its PageControl property.


TPageControl.Change

TPageControl 	See also

Responds to changes in the page control.

procedure Change; override;

Description

Change is called automatically when Windows notifies the page control of a change. TPageControl responds to this notification by updating its display to show the new current page.


TPageControl.Destroy

TPageControl	See also

Destroys an instance of TPageControl.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TPageControl reference is not nil, and only then calls Destroy. Destroy frees the TList object that holds the pages of the control, and then calls the inherited destructor.


TPageControl.DoAddDockClient

TPageControl 	See also

Provides necessary adjustments when a new client is docked in the page control.

procedure DoAddDockClient(Client: TControl); override;

Description

DoAddDockClient is called when a new client is docked to the page control. It sets the page control’s tab sheet as the new client’s parent.

Client is the client being docked.


TPageControl.DockOver

TPageControl 	See also

Indicates whether an object that is dragged over the page control can be docked.

procedure DockOver(Source: TDragDockObject; X, Y: Integer; State: TDragState; var Accept: Boolean); override;

Description

DockOver is called automatically when the user drags a dockable window over the page control.

The Source parameter describes the object that is being dragged.

The X and Y parameters give the current position of the dragged control.

The State parameter indicates how the mouse is moving.

DockOver initializes the Source parameter to reflect the dockable region of the page control and generates an OnDockOver event. An OnDockOver event handler can change the Accept parameter to False if the Source control should not be docked.

Note:	DockOver is only called if the DockSite property is True.


TPageControl.DoRemoveDockClient

TPageControl 	See also

Provides necessary adjustments when a control is undocked from the page control.

procedure DoRemoveDockClient(Client: TControl); override;

Description

DoRemoveDockClient is called when a client is undocked from the page control. It selects the next page in the tab sheet.

Client is the client being undocked.


TPageControl.FindNextPage

TPageControl	See also	Example

Returns the next page in the page control before or after a specified page.

function FindNextPage(CurPage: TTabSheet; GoForward, CheckTabVisible: Boolean): TTabSheet;

Description

Call FindNextPage to locate a page in the page control by its position relative to the page specified by the CurPage parameter. If the GoForward parameter is True, FindNextPage returns the next page in the page control after CurPage. If GoForward is False, FindNextPage returns the previous page. If CurPage is not a page in the page control, FindNextPage returns the first page when GoForward is True or the last page when GoForward is False. If GoForward is True and CurPage is the last page in the page control, FindNextPage returns the first page. If GoForward is False and CurPage is the first page in the page control, FindNextPage returns the last page.

When CheckTabVisible is True, FindNextPage returns the next page with a TabVisible property set to True; if CheckTabVisible is False, FindNextPage returns the next page, including pages with TabVisible set to False.


TPageControl.GetChildren

TPageControl	See also

Calls a specified procedure for every page in the page control.

procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;

Description

Call GetChildren to execute a callback for every page in the page control. The Proc parameter is the callback. The Root parameter is ignored by TPageControl.

GetChildren is intended primarily for the streaming system that loads and saves VCL components.


TPageControl.GetImageIndex

TPageControl	Methods

Specifies the image to display for a particular page.

function GetImageIndex(TabIndex: Integer): Integer; override;

Description

Override GetImageIndex in a derived class to specify the index of the image to display for a particular page.

TabIndex is the page’s index that is about to be displayed.

Integer is the image’s index (in the Images property) that will be displayed in the tab.

By default, if there is no OnGetImageIndex event handler, GetImageIndex returns the ImageIndex property for the page with the specified index; otherwise, GetImageIndex calls the inherited GetImageIndex method, returning the result.


TPageControl.GetPageFromDockClient

TPageControl	Methods

Returns the tab sheet on which a client is docked.

function GetPageFromDockClient(Client: TControl): TTabSheet;

Description

Call GetPageFromDockClient to get the tab sheet on which Client is docked.

Returns nil if Client is not docked.


TPageControl.GetSiteInfo

TPageControl	See also

Returns the page control’s docking information.

procedure GetSiteInfo(Client: TControl; var InfluenceRect: TRect; MousePos: TPoint; var CanDock: Boolean);

Description

Call GetSiteInfo to determine the docking region of the page control and whether a dragged window can be docked.

Client is a potential docking client.

InfluenceRect returns the area in which the client can be docked.

MousePos is the current mouse position.

CanDock indicates whether the client can be docked in the page control.

GetSiteInfo Initializes CanDock to True if Client is not already docked in the page control. It then inflates the influence rectangle by 10 pixels and generates an OnGetSiteInfo event.


TPageControl.Loaded

TPageControl	See also

Initializes the page control after all its parts have been loaded from a stream.

procedure Loaded; override;

Description

Loaded is called automatically when the form containing the page control is first loaded into memory. TPageControl overrides the Loaded method to ensure that all tab sheets with a Highlighted property of True appear highlighted.


TPageControl.SelectNextPage

TPageControl	See also	Example

Changes the ActivePage to the first visible page that is before or after the currently active page.

procedure SelectNextPage(GoForward: Boolean);

Description

Use SelectNextPage to select the page next to the currently active page. If the GoForward parameter is True, SelectNextPage selects the first page after ActivePage; if GoForward is False, SelectNextPage selects the first page previous to ActivePage. SelectNextPage will only considers pages with their TabVisible property set to True.

Note:	To select a page at design-time, right-click the TPageControl and choose Previous Page or Next Page.


TPageControl.SetChildOrder

TPageControl	See also

Assigns indexes to the pages that reflect the order in which pages are loaded from a stream.

procedure SetChildOrder(Child: TComponent; Order: Integer); override;

Description

SetChildOrder is called automatically when the children of the page control are loaded from a stream. It assigns each page an index that reflects the order in which pages are loaded and saved.

The Child parameter is a page of the page control. The Order parameter indicates when the page is loaded or saved. The first page loaded or saved is called with Order set to 0, the second with Order set to 1, and so on.

SetChildOrder assigns the PageIndex property of the individual pages to the value of Order.


TPageControl.ShowControl

TPageControl	See also

Displays a specified page.

procedure ShowControl(AControl: TControl); override;

Description

ShowControl is called automatically when a particular page of the page control should be visible. The AControl parameter specifies the page that should be displayed on screen.

ShowControl makes the specified page active it is not already active, and sets its own Visible property to True. It then calls the ShowControl method of its parent object to ensure that the page control is showing (and therefore able to display the active page).


TPageControl.UpdateActivePage

TPageControl	See also

Updates the ActivePage property when changes are made to the Pages property.

procedure UpdateActivePage; virtual;

Description

This protected method is used internally when the pages listed in the Pages property change. It ensures that the page control is internally consistent and that the active page is displayed.


Scope

Published

Accessibility

Read-only


Scope

Published


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomTabControl


 TPaintBox

Hierarchy	Properties	Methods	Events	See also

TPaintBox is a simple graphic control that provides a canvas for applications to use for rendering an image.

Unit

extctrls

Description

Use TPaintBox to add custom images to a form. Unlike TImage, which displays an image that is stored in a bitmap, icon, or metafile, TPaintBox requires an application to draw the image directly on a canvas. Use the OnPaint event handler to draw on the paint box’s Canvas, the drawing surface of the paint box.


TPaintBox properties

TPaintBox	Alphabetically	Legend

Derived from TGraphicControl

Canvas

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TPaintBox properties

TPaintBox	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlState

ControlStyle

Cursor

DesignInfo

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

Width

WindowProc


TPaintBox events

TPaintBox	Alphabetically	Legend

In TPaintBox

OnPaint

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TPaintBox events

TPaintBox	By object	Legend

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnPaint

OnStartDock

OnStartDrag


TPaintBox.OnPaint

TPaintBox	See also 	Example

OnPaint occurs when the paintbox receives a Windows paint message.

property OnPaint: TNotifyEvent;

Description

Write an OnPaint event handler to draw the image of the paint box. Use the methods of the canvas to construct the image that the paintbox presents on a form. If an OnPaint event handler is not provided, the paintbox can’t be seen on the form at runtime.


TPaintBox methods

TPaintBox	Alphabetically	Legend

In TPaintBox

Create

Paint

Derived from TGraphicControl

Destroy

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

Invalidate

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

Repaint

ReplaceDockedControl

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPaintBox methods

TPaintBox	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

NewInstance

Paint

Perform

Refresh

RemoveComponent

Repaint

ReplaceDockedControl

SafeCallException

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

UpdateAction

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TPaintBox.Create

TPaintBox	See also

Creates an instance of TPaintBox.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TPaintBox object at runtime. TPaintBox objects added to forms at design time are created automatically.

Create allocates memory and sets the default values for the instance of the TPaintBox object.


TPaintBox.Paint

TPaintBox	See also

Generates an OnPaint event.

procedure Paint; override;

Description

Paint responds to WM_PAINT messages from Windows by initializing the canvas and calling the OnPaint event handler if it is assigned.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl


TPaintControl

Hierarchy	Properties	Methods	See also

TPaintControl draws data aware controls that are replicated in a data control grid.

Unit

dbctrls

Description

Several data-aware controls use TPaintControl — including TDBCheckBox, TDBComboBox, and TDBMemo—to replicate themselves within a data control grid (TDBCtrlGrid).


TPaintControl properties

TPaintControl	Alphabetically	Legend

In TPaintControl

Ctl3DButton

Handle


TPaintControl properties

TPaintControl	By object	Legend

Ctl3DButton

Handle


TPaintControl.Ctl3DButton

TPaintControl

Determines whether the control has a three-dimensional look.

property Ctl3DButton: Boolean;

Description

If Ctl3DButton is True, the data-aware control has beveled borders, creating a three-dimensional appearance.


TPaintControl.Handle

TPaintControl 	See also

Provides access to paint control’s window handle.

property Handle: HWnd;

Description

Handle is the window handle of the TPaintControl instance. It represents a window with the classname supplied to the constructor of the TPaintControl object.  The characteristics of the window are determined by the Owner supplied to the constructor of the paint control object.


TPaintControl methods

TPaintControl	Alphabetically

In TPaintControl

Create

Destroy

DestroyHandle

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TPaintControl methods

TPaintControl	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyHandle

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TPaintControl.Create

TPaintControl 	See also

Creates and initializes a TPaintControl object.

constructor Create(AOwner: TWinControl; const ClassName: String);

Description

The Create method creates an instance of TPaintControl.  The Owner parameter specifies the data-aware control that uses this TPaintControl object to paint its image. The ClassName parameter specifies the Window class that should be created by the paint control.


TPaintControl.Destroy

TPaintControl	See also

Destroys the TPaintControl and frees its memory.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TPaintControl reference is not nil, and only then calls Destroy.

Destroy frees the window used by the paint control.


TPaintControl.DestroyHandle

TPaintControl	See also

Destroys the window used by the paint control.

procedure DestroyHandle;

Description

The destructor of TPaintControl calls DestroyHandle to release the Windows resources allocated on behalf of the paint control.


Accessibility

Read-only


Hierarchy

TObject


 TPanel

Hierarchy	Properties	Methods	Events	See also

TPanel implements a generic panel control.

Unit

extctrls

Description

Use TPanel to put an empty panel on a form. Panels provide properties for providing a bevelled border around the control, as well as methods to help manage the placement of child controls embedded in the panel.

TPanel implements the generic behavior introduced in TCustomPanel. TPanel publishes many of the properties inherited from TCustomPanel, but does not introduce any new behavior.


TPanel properties

TPanel	Alphabetically	Legend

Derived from TCustomPanel

Alignment

BevelInner

BevelOuter

BevelWidth

BorderStyle

BorderWidth

FullRepaint

Locked

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DockManager

DockSite

DoubleBuffered

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

UseDockManager

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

AutoSize

BiDiMode

BoundsRect

Caption

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TPanel properties

TPanel	By object	Legend

Action

Align

Alignment

Anchors

AutoSize

BevelInner

BevelOuter

BevelWidth

BiDiMode

BorderStyle

BorderWidth

BoundsRect

Brush

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockManager

DockOrientation

DockSite

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

FullRepaint

Handle

Height

HelpContext

Hint

HostDockSite

Left

Locked

LRDockWidth

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

UseDockManager

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TPanel events

TPanel	Alphabetically	Legend

Derived from TWinControl

OnDockDrop

OnDockOver

OnEnter

OnExit

OnGetSiteInfo

OnUnDock

Derived from TControl

OnCanResize

OnClick

OnConstrainedResize

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock

OnStartDrag


TPanel events

TPanel	By object	Legend

OnCanResize

OnClick

OnConstrainedResize

OnContextPopup

OnDblClick

OnDockDrop

OnDockOver

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnGetSiteInfo

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock

OnStartDrag

OnUnDock


TPanel methods

TPanel	Alphabetically

Derived from TCustomPanel

Create

Derived from TCustomControl

Destroy

GetControlsAlignment

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPanel methods

TPanel	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomPanel


TParaAttributes

Hierarchy	Properties	Methods	See also

TParaAttributes represents paragraph formatting properties for a rich edit control.

Unit

comctrls

Description

TParaAttributes includes a number of properties that describe the formatting characteristics of a paragraph in a rich text document. TParaAttributes is tailored to allow a descendant of TCustomRichEdit to read and write formatting characteristics of selected paragraphs. The properties of a TParaAttributes object are invalid unless it is owned by a descendant of TCustomRichEdit.


TParaAttributes properties

TParaAttributes	Alphabetically

In TParaAttributes

Alignment

FirstIndent

LeftIndent

Numbering

RightIndent

Tab

TabCount


TParaAttributes properties

TParaAttributes	By object

Alignment

FirstIndent

LeftIndent

Numbering

RightIndent

Tab

TabCount


TParaAttributes.Alignment

TParaAttributes	See also 	Example

Specifies how text is aligned within a paragraph.

property Alignment: TAlignment;

Description

Use Alignment to specify the alignment of text within individual paragraphs. Unlike the Alignment property of a TCustomMemo, which applies to the entire body of text, the Alignment property of TParaAttributes applies only to the selected paragraphs.These are the possible values:

Value	Meaning

taLeftJustify	Align text to the left side of the paragraph.

taCenter	Center text horizontally in the paragraph.

taRightJustify	Align text to the right side of the paragraph.


TParaAttributes.FirstIndent

TParaAttributes	See also 	Example

Specifies the indent, in pixels, of the first line of the paragraph relative to the left margin.

property FirstIndent: Longint;

Description

Use FirstIndent to specify the number of pixels to indent the first line of the paragraph. This value is relative to the value of LeftIndent.


TParaAttributes.LeftIndent

TParaAttributes	See also

Specifies the indent, in pixels, of the paragraph relative to the left margin.

property LeftIndent: Longint;

Description

Use LeftIndent to indent a paragraph from the left margin of the entire body of text. LeftIndent is useful for making individual paragraphs stand out from the rest of the text.

Note:	Adding bullets to a set of paragraphs by using the Numbering property also affects the left indentation.


TParaAttributes.Numbering

TParaAttributes	See also 	Example

Specifies whether the paragraph is one of a set of bulleted paragraphs.

type TNumberingStyle = (nsNone, nsBullet);

property Numbering: TNumberingStyle;

Description

To insert a bullet to the left of the paragraph, and indent the paragraph sufficiently to accommodate the bullet, set Numbering to nsBullet. If the LeftIndent property is set, bullets will appear at the indentation indicated by LeftIndent, and the body of the paragraph will be further indented to accommodate the bullets.

These are the possible values:

Value	Meaning

nsNone	No numbering on the left.

nsBullet	Bullets on the left with sufficient indentation for the bullets.


TParaAttributes.RightIndent

TParaAttributes	See also

Specifies the indent, in pixels, of the paragraph relative to the right margin.

property RightIndent: Longint;

Description

Use RightIndent to indent a paragraph from the right margin of the entire body of text. RightIndent is useful for making individual paragraphs stand out from the rest of the text, especially when Alignment is set to taRightJustify.


TParaAttributes.Tab

TParaAttributes	See also

Specifies the position, in pixels, of a particular tab stop.

property Tab[Index: Byte]: Longint;

Description

Tab is an indexed property into an array of absolute tab stop positions. The position of the first tab stop is Tab[0], the next tab stop is Tab[1], and so on to Tab[TabCount - 1].

When setting Tab, values of Index below TabCount change the positions of existing tab stops. Values of Index greater than or equal to TabCount increase the number of tab stops in the paragraph and change the value of TabCount.

Note:	Setting Tab does not insert a tab into the text of the paragraph. It sets the positions within the paragraph where tabs will occur if they are inserted. The actual tab characters are inserted into the paragraph by using the Tab key.


TParaAttributes.TabCount

TParaAttributes	See also

Indicates the number of tab stops that are defined for the paragraph.

property TabCount: Integer;

Description

Read TabCount to determine the number of tab stops in the Tab array. Use TabCount with the Tab property to iterate over all the tab stops defined for the paragraph.


TParaAttributes methods

TParaAttributes	Alphabetically

In TParaAttributes

Assign

Create

Derived from TPersistent

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TParaAttributes methods

TParaAttributes	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TParaAttributes.Assign

TParaAttributes	See also

Copies the properties specified in another TParaAttributes object.

procedure Assign(Source: TPersistent); override;

Description

Use Assign to set the paragraph attributes of the selected paragraph from one rich edit control to match the attributes of the selected paragraph of another rich edit control. Since the properties of a TParaAttributes object are only valid when the TParaAttributes exists within a rich edit control, Assign is only useful for copying attributes between rich edit controls.

Note:	Assign only succeeds at runtime when the Source is a TParaAttributes object or an object that has an AssignTo method that is enabled for a TParaAttributes object. Other source objects will raise an EConvertError exception.


TParaAttributes.Create

TParaAttributes	See also

Creates an instance of TParaAttributes.

constructor Create(AOwner: TCustomRichEdit);

Description

Do not call the constructor for a TParaAttributes object, as the properties of a TParaAttributes object are not valid outside of a TCustomRichEdit object. Create is called from the constructor of a rich edit control that uses TParaAttributes.


Hierarchy

TObject

TPersistent


TParam

Hierarchy	Properties	Methods	See also

TParam represents a field parameter for a BDE-enabled query or stored procedure.

Unit

db

Description

Use the properties of a TParam to set the value of a parameter that represents the value of a field. Objects that use parameters for the values of fields in BDE-enabled datasets create TParam objects to represent those parameters. For example, TParams is used by TQuery objects and TStoredProc objects.

TParam shares many properties with TField, as both describe the value of a field in a dataset. However, a TField object has several properties to describe the field binding, and how the field is displayed, edited, or calculated that are not needed in a TParam object. Conversely, TParam includes properties that indicate how the field value is passed as a parameter.


TParam properties

TParam	Alphabetically	Legend

In TParam

AsBCD

AsBlob

AsBoolean

AsCurrency

AsDate

AsDateTime

AsFloat

AsInteger

AsMemo

AsSmallInt

AsString

AsTime

AsWord

Bound

DataType

IsNull

Name

NativeStr

ParamType

Text

Value

Derived from TCollectionItem

Collection

DisplayName

ID

Index


TParam properties

TParam	By object	Legend

AsBCD

AsBlob

AsBoolean

AsCurrency

AsDate

AsDateTime

AsFloat

AsInteger

AsMemo

AsSmallInt

AsString

AsTime

AsWord

Bound

Collection

DataType

DisplayName

ID

Index

IsNull

Name

NativeStr

ParamType

Text

Value


TParam.AsBCD

TParam	See also 	Example

Specifies the value of the parameter when it represents a binary-coded decimal (BCD) field.

property AsBCD: Currency;

Description

Set AsBCD to assign the value for a BCD field to the parameter. AsBCD does not actually take a BCD value. As BCD field objects use the Currency type to represent the value of BCD fields, AsBCD takes a Currency value. Setting AsBCD will set the DataType property to ftBCD.

Read the AsBCD property to determine the value that was assigned to an output parameter, represented as a Currency type. The value of the parameter will be converted to a Currency value if possible.


TParam.AsBlob

TParam	See also

Specifies the value of the parameter when it represents a binary large object (BLOB) field.

type TBlobData = String;

property AsBlob: TBlobData;

Description

Set AsBlob to assign the value for a Blob field to the parameter. AsBlob takes a TBlobData value, which is an untyped string of bytes. Setting AsBlob will set the DataType property to ftBlob.

For example, if the variable Buffer is of type PChar and contains binary data read from a file, the contents of Buffer are directly assigned to the BLOB column using the AsBlob property.

Query1.Params[0].AsBlob := Buffer;

Note:	Applications seldom need to read AsBlob because Blob fields can not be used as output parameters.


TParam.AsBoolean

TParam	See also 	Example

Specifies the value of the parameter when it represents a boolean field.

property AsBoolean: Boolean;

Description

Set AsBoolean to assign the value for a boolean field to the parameter. Setting AsBoolean will set the DataType property to ftBoolean.

Read the AsBoolean property to determine the value that was assigned to an output parameter, represented as a Boolean. The value of the parameter will be converted to a Boolean value if possible.


TParam.AsCurrency

TParam	See also 	Example

Specifies the value of the parameter when it represents a field of type Currency.

property AsCurrency: Currency;

Description

Set AsCurrency to assign the value for a parameter of type Currency. Setting AsCurrency will set the DataType property to ftCurrency.

Read the AsCurrency property to determine the value that was assigned to an output parameter, represented as a Currency type. The value of the parameter will be converted if possible.


TParam.AsDate

TParam	See also	Example

Specifies the value of the parameter when it represents a date field.

property AsDate: TDateTime;

Description

Set AsDate to assign the value for a date field to the parameter. Setting AsDate will set the DataType property to ftDate.

Read the AsDate property to determine the value that was assigned to an output parameter, represented as a TDateTime. The value of the parameter will be converted to a DateTime value if possible. If the DataType for the parameter is ftDate, only the date portion of the TDateTime value is valid. If a TDateTime value is assigned to a parameter via the AsDate property and the TDateTime value has a nonzero time, the time is ignored and only the date is assigned. If AsDate is used to get the value for a TDateTime container, the date from the parameter is stored but the TDateTime gets a zero time value.

Note:	It is not possible to store a NULL value directly to a parameter using AsDate. Use the TParam.Clear method instead.


TParam.AsDateTime

TParam	See also	Example

Specifies the value of the parameter when it represents a date-time field.

property AsDateTime: TDateTime;

Description

Set AsDate to assign the value for a date-time field to the parameter. Setting AsDateTime will set the DataType property to ftDateTime.

Read the AsDateTime property to determine the value that was assigned to an output parameter, represented as a DateTime. The value of the parameter will be converted to a DateTime value if possible. If a TDate value is assigned to a parameter via the AsDateTime property, the date portion of the TDate value is assigned to the parameter and the time portion is assigned a zero value. If AsDateTime is used to get the value for a TDate container, the date from the parameter is stored but the time value returned by AsDateTime is ignored.

Note:	It is not possible to store a NULL value directly to a parameter using AsDateTime. Use the TParam.Clear method instead.


TParam.AsFloat

TParam	See also 	Example

Specifies the value of the parameter when it represents a float field.

property AsFloat: Double;

Description

Set AsFloat to assign the value for a float field to the parameter. Setting AsFloat will set the DataType property to ftFloat.

Read the AsFloat property to determine the value that was assigned to an output parameter, represented as a Double. The value of the parameter will be converted to a Double value if possible.


TParam.AsInteger

TParam	See also 	Example

Specifies the value of the parameter when it represents an integer field.

property AsInteger: LongInt;

Description

Set AsInteger to assign the value for an integer field to the parameter. Setting AsInteger will set the DataType property to ftInteger.

Read the AsInteger property to determine the value that was assigned to an output parameter, represented as a 32-bit integer. The value of the parameter will be converted to a LongInt value if possible.


TParam.:AsMemo
TParam.AsMemo

TParam	See also

Specifies the value of the parameter when it represents a memo field.

property AsMemo: String;

Description

Set AsMemo to assign the value for a memo field to the parameter. Setting AsMemo will set the DataType property to ftMemo.

A literal string or a null-terminated string may be directly assigned to the parameter for a memo column using the AsMemo property. For example:

Query1.Params[0].AsMemo := 'Some text in a long Pascal String';

It is seldom necessary to read AsMemo, because memo fields can not be used as output parameters.

Note:	Some servers support string field types that are too long to fit in the record buffer. These fields are represented as memo fields, although they are not actually Blob fields. When working with such “pseudo-Blob” fields, use the AsString property instead.


TParam.AsSmallInt

TParam	See also 	Example

Specifies the value of the parameter when it represents a small integer field.

property AsSmallInt: LongInt;

Description

Set AsSmallInt to assign the value for a small integer field to the parameter. Setting AsSmallInt will set the DataType property to ftSmallint.

Read the AsSmallInt property to determine the value that was assigned to an output parameter, represented as a 32-bit integer. The value of the parameter will be converted to a LongInt value if possible.

Note:	AsSmallInt works with a 32-bit integer. Small integer field objects store and manipulate their data as 32-bit integers even though the values in the underlying database are 16-bit integers.


TParam.AsString

TParam	See also 	Example

Specifies the value of the parameter when it represents a string field.

property AsString: String;

Description

Set AsString to assign the value for a string field to the parameter. Setting AsString will set the DataType property to ftString.

Read the AsString property to determine the value that was assigned to an output parameter, represented as a string. The value of the parameter will be converted to a string.

Note:	Some servers support string field types that are too long to fit in the record buffer. These fields are represented as memo fields, although they are not actually Blob fields. When working with such “pseudo-Blob” fields, use the AsString property rather than the AsMemo property.


TParam.AsTime

TParam	See also	Example

Specifies the value of the parameter when it represents a time field.

property AsTime: TDateTime;

Description

Set AsTime to assign the value for a time field to the parameter. Setting AsTime will set the DataType property to ftTime.

Read the AsTime property to determine the value that was assigned to the parameter, represented as a DateTime. The value of the parameter will be converted to a DateTime value if possible. If the DataType for the parameter is ftTime, only the time portion of the TDateTime value is valid.

Note:	It is not possible to store a NULL value directly to a parameter using AsTime. Use the TParam.Clear method instead.


TParam.AsWord

TParam	See also 	Example

Specifies the value of the parameter when it represents a word field.

property AsWord: LongInt;

Description

Set AsWord to assign the value for a word field to the parameter. Setting AsWord will set the DataType property to ftWord.

Read the AsWord property to determine the value that was assigned to the parameter, represented as a 32-bit integer. The value of the parameter will be converted to a LongInt value if possible.

Note:	AsWord works with a 32-bit integer. Word field objects store and manipulate their data as 32-bit integers even though the values in the underlying database are unsigned 16-bit values.


TParam.Bound

TParam	See also

Indicates whether a value (NULL or otherwise) has been assigned to the parameter.

property Bound: Boolean;

Description

Read Bound to determine whether a value has been assigned to the parameter. Whenever a value is assigned to the TParam object, Bound is automatically set to True. Set Bound to False to undo the setting of a value. The Clear method will replace the value of the parameter with NULL, but will not set Bound to False. If the Clear method is used to bind the parameter to a NULL value, Bound must be separately set to True.

TQuery objects and TStoredProc objects use the value of Bound to determine whether or not to assign a default value for the parameter. If Bound is False, A TQuery object attempts to assign a value from the dataset indicated by the DataSource property of the query. Similarly, when Bound is False, a TStoredProc object attempts to supply a value directly from the server.


TParam.DataType

TParam 	Example

Indicates the type of field whose value the parameter represents.

property DataType: TFieldType;

Description

DataType is set automatically when a value is assigned to the parameter. Do not set DataType for bound fields, as that may cause the assigned value to be misinterpreted.

Read DataType to discover the type of data that was assigned to the parameter. Each possible value of DataType corresponds to a type of database field.


TParam.IsNull

TParam	See also 	Example

Indicates whether the value assigned to the parameter is NULL (blank).

property IsNull: Boolean;

Description

Inspect IsNull to discover if the value of the parameter is NULL, indicating the value of a blank field. NULL values can arise in the following ways:

Assigning the value of another, NULL, parameter.

Assigning the value of a blank field.

Calling the Clear method.

Note:	NULL parameters are not the same as unbound parameters. Unbound parameters have not had a value assigned. NULL parameters have a NULL value. NULL parameters may be bound or unbound.


TParam.Name

TParam	See also

Specifies the name of the parameter.

property Name: String;

Description

Use Name to identify a particular parameter within a TParams object. Name is the name of the parameter, not the name of the field the value of which the parameter represents.


TParam.NativeStr

TParam	See also

Indicates the value of the parameter as a string, using the locale of the database table.

property NativeStr: String;

Description

Use NativeStr to obtain a string version of the parameter value that uses the character set (code page) associated with the underlying database table.


TParam.ParamType

TParam 	Example

Indicates the type of the parameter the TParam represents.

property ParamType: TParamType;

Description

Objects that use TParam objects to represent field parameters set ParamType to indicate the  use for the parameter. ParamType must be one of the following values:

Value	Description

ptUnknown	Unknown or undetermined. Before executing a stored procedure, the application must set parameters of this type to another kind.

ptInput	Used to input a field value. Identifies a parameter used to pass values to a stored procedure for processing.

ptOutput	Used to output a field value. Identifies a parameter used by a stored procedure to return values to an application.

ptInputOutput	Used for both input and output.

ptResult	Used as a return value. Identifies a parameter used by a stored procedure to return an error or status value. A stored procedure can only have one parameter of type ptResult.


TParam.Text

TParam	See also

Represents the value of the parameter as a string.

property Text: String;

Description

Set the Text property to assign the value of the parameter to a string without changing the DataType. Unlike the AsString property, which sets the value to a string and changes the DataType, setting the text property converts the string to the DataType of the parameter, and sets the value accordingly. Thus, use AsString to treat the parameter as representing the value of a string field. Use Text instead when assigning a value that is in string form, when making no assumptions about the field type. For example, Text is useful for assigning user data that was input using an edit control.

Reading the Text property is the same as reading the AsString property.


TParam.Value

TParam	See also

Represents the value of the parameter as a Variant.

property Value: Variant;

Description

Use Value in generic code that manipulates the values of parameters without needing to know the field type the parameters represent.


TParam methods

TParam	Alphabetically

In TParam

Assign

AssignField

AssignFieldValue

Clear

Create

GetData

GetDataSize

LoadFromFile

LoadFromStream

SetBlobData

SetData

Derived from TCollectionItem

Destroy

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TParam methods

TParam	By object

AfterConstruction

Assign

AssignField

AssignFieldValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetData

GetDataSize

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

SafeCallException

SetBlobData

SetData


TParam.Assign

TParam	See also

Copies the Name and Value of another TParam object.

procedure Assign(Source: TPersistent); override;

Description

Use Assign to copy from another parameter or from a field component. If the Source parameter is another parameter, Assign transfers the value of

•	The DataType property

•	The Bound property

•	The Value property

•	The Name property

•	The ParamType property only if it is currently ftUnknown.

If the Source parameter is a field component, Assign transfers the value of

•	The DataType property

•	The Value property

•	The Name property (from the FieldName of the field)

When assigning values from a field, Assign sets the Bound property to True.

Note:	Assign does not alter the use of a parameter, only the identifier and the value.


TParam.AssignField

TParam	See also

Assigns the DataType, Name, and Value properties from a TField object.

procedure AssignField(Field: TField);

Description

Use AssignField to set a parameter to represent a particular TField object. AssignField sets the Bound property to True.

Unlike AssignFieldValue, AssignField names the parameter after the field object as well as taking its value.


TParam.AssignFieldValue

TParam	See also

Assigns the DataType and Value properties from a TField object.

procedure AssignFieldValue(Field: TField; const Value: Variant);

Description

Use AssignFieldValue to set the Value property to the value passed as the Value parameter. AssignFieldValue assumes that the Value represents a value from a field like the Field parameter, and assigns the DataType property accordingly. AssignFieldValue sets the Bound property to True.

Unlike AssignField, AssignFieldValue does not name the parameter after the field object.


TParam.Clear

TParam	See also

Sets the Value of the parameter to NULL.

procedure Clear;

Description

Use Clear to assign a NULL value to a parameter. Calling Clear neither sets nor clears the Bound property. When assigning a NULL value to a parameter, set the Bound property as well as calling Clear.


TParam.Create

TParam	See also

Creates an instance of TParam and inserts it in a parameter list.

constructor Create(AParams: TParams; AParamType: TParamType); reintroduce; overload;

constructor Create(Collection: TCollection; overload; override;

Description

Call Create to instantiate a TParam object. TParam objects are usually created by the object that uses them, such as a TQuery object or a TStoredProc object, to represent its field parameters.

After allocating the memory for an instance of TParam, Create

Adds the new TParam object to AParamList.

Sets the ParamType to AParamType.

Initializes the DataType to ftUnknown.

Sets the Bound property to False.


TParam.GetData

TParam	See also 	Example

Fills the buffer with the Value of the parameter in the native format of a database field of the appropriate type.

procedure GetData(Buffer: Pointer);

Description

Use GetData to obtain the value of a parameter in the format ready to be written directly to a record buffer. That format is the format used by physical database fields corresponding to DataType. Buffer must have enough space to hold the information. Use the GetDataSize method to determine the necessary size.

The native format for a database field may not be the same as the datatype used by the corresponding field object. Use the As... properties to get the value in the type used by the corresponding field object. Use GetData to get the value in the native database format.

For example, when DataType is ftBCD, GetData retrieves the value in binary-coded decimal, even though the TBCDField object uses Currency to store and manipulate its values. AsBCD gets the value in the Currency type.


TParam.GetDataSize

TParam	See also 	Example

Returns the number of bytes needed to hold the parameter’s value in the format used by the corresponding type of database field.

function GetDataSize: Integer;

Description

Call GetDataSize to determine the number of bytes used to represent the parameter’s value. GetDataSize indicates the buffer size needed before calling the GetData method. The value returned by GetDataSize depends on the Value of the parameter. For some values of DataType, this is always the same:

DataType	Value of DataSize

ftBoolean	2

ftSmallInt	2

ftWord	2

ftAutoInc	4

ftDate	4

ftInteger	4

ftTime	4

ftCurrency	8

ftDateTime	8

ftFloat	8

ftBCD	34

ftString	length of the string + 1.

ftVarBytes	raises an EDatabaseError exception

ftBytes	raises an EDatabaseError exception

ftBlob	number of bytes of blob data.

ftDBaseOle	number of bytes of blob data.

ftFmtMemo	number of bytes of blob data.

ftGraphic	number of bytes of blob data.

ftMemo	length of memo string + 1.

ftParadoxOle	number of bytes of blob data.

ftTypedBinary	raises an EDatabaseError exception

ftUnknown	raises an EDatabaseError exception

ftCursor	0

Note:	The size returned by GetDataSize is the size required for the physical database representation of the Value. The field object that corresponds to that physical database field may store its data in another format requiring a different number of bytes.


TParam.LoadFromFile

TParam	See also

Loads the value of a BLOB parameter from the specified file.

procedure LoadFromFile(const FileName: String; BlobType: TBlobType;

Description

Use LoadFromFile to set the value of a BLOB parameter from a value stored in the file specified by the FileName parameter. The DataType property is set to the value passed as the BlobType parameter.

Query2.ParamByName('Notes').LoadFromFile('c:\Files\Note1234.txt', ftMemo);


TParam.LoadFromStream

TParam	See also

Loads the value of a BLOB parameter from a stream.

procedure LoadFromStream(Stream: TStream; BlobType:TBlobType;

Description

Use LoadFromStream to set the value of a BLOB parameter from a value read from the stream specified by the Stream parameter. For example, use LoadFromStream to set the value of a BLOB parameter directly from a TBlobStream object. The DataType property is set to the value passed as the BlobType parameter.


TParam.SetBlobData

TParam	See also

Copies a new value for the parameter in physical database format from Buffer.

procedure SetBlobData(Buffer: Pointer; Size: Integer);

Description

Use SetBlobData to set the value of a parameter from a buffer that contains data from a Binary Large Object (BLOB) field. SetBlobData copies the number of bytes specified by the Size parameter from the buffer specified by the Buffer parameter, and sets the DataType property to ftBlob.


TParam.SetData

TParam	See also 	Example

Copies a new value for the parameter in physical database format from Buffer.

procedure SetData(Buffer: Pointer);

Description

Use SetData to set the value of a parameter from a buffer that contains data in the physical database format. The GetData method of a TField object fetches data in the physical database format. Borland Database Engine API calls can also provide data in physical database format.

Note:	When the DataType property is ftUnknown, ftBytes, ftVarBytes, ftAutoInc, ftBlob, ftGraphic, ftFmtMemo, ftParadoxOle, ftDBaseOle, or ftTypedBinary, SetData raises an EDatabaseError exception. For BLOB fields, use the SetBlobData method instead.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem


TParams

Hierarchy	Properties	Methods	See also

TParams manages a list of field parameters.

Unit

db

Description

Use TParams to manage a list of TParam objects for a BDE-enabled object that uses field parameters. For example, TStoredProc objects and TQuery objects use TParams objects to create and access their parameters.

Use the properties and methods of TParams to:

Access a specific field parameter.

Add or delete field parameters from the list.

Get or set the values of individual field parameters.

Compare field parameters.

Iterate through all field parameters.

Copy a set of field parameters to another parameter list.

Note:	When working with an ADO-enabled dataset, use TParameters instead.


TParams properties

TParams	Alphabetically	Legend

In TParams

Items

ParamValues

Derived from TCollection

Count

ItemClass


TParams properties

TParams	By object	Legend

Count

ItemClass

Items

ParamValues


TParams.Items

TParams	See also	Example

Lists the individual field parameters of a TParams object.

property Items[Index: Word]: TParam;

Description

Use Items to iterate through all the field parameters. Index identifies the index in the range 0 to Count - 1. Items can reference a particular parameter by its index, but the ParamByName method is preferred, so as to avoid depending on the order of the parameters.


TParams.ParamValues

TParams	See also

Lists the values of individual field parameters that are specified by name.

property ParamValues[const ParamName: String]: Variant;

Description

Use ParamValues to get or set the values of individual field parameters that are identified by name. ParamName is a string containing the names of the individual field parameters of interest. If ParamValues is used to access more than one field parameter, the names are separated by semicolons (;).

Setting ParamValues sets the Value property for each parameter listed in the ParamName string. Specify the values as Variants, in order, in a variant array.

Getting ParamValues retrieves a variant array of variants, each of which represents the value of one of the named parameters.

If ParamName includes a name that does not match any of the field parameters in Items, an exception is raised.


TParams methods

TParams	Alphabetically

In TParams

AddParam

AssignValues

Create

CreateParam

FindParam

GetParamList

IsEqual

ParamByName

ParseSQL

RemoveParam

Derived from TCollection

Add

Assign

BeginUpdate

Clear

Delete

Destroy

EndUpdate

FindItemID

GetNamePath

Insert

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TParams methods

TParams	By object

Add

AddParam

AfterConstruction

Assign

AssignValues

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

CreateParam

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

FindItemID

FindParam

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParamList

InheritsFrom

InitInstance

Insert

InstanceSize

IsEqual

MethodAddress

MethodName

NewInstance

ParamByName

ParseSQL

RemoveParam

SafeCallException


TParams.AddParam

TParams	See also 	Example

Inserts a new field parameter into the Items list.

procedure AddParam(Value: TParam);

Description

Use AddParam to add an instantiated parameter to the Items list. To create a field parameter as well as add it to the list, use CreateParam instead.

Note:	Parameters for TQuery components are only created by specifying parameters in the SQL statement. The TParam objects in a TQuery component’s Params property are created automatically when parameter tokens are added to the SQL statement.


TParams.AssignValues

TParams	See also	Example

Assigns new values to the parameters of the Items property.

procedure AssignValues(Value: TParams);

Description

Use AssignValues to update the values of the field parameters in the Items list to match the values of the corresponding field parameters in another TParams object. For each entry in Items, the AssignValues method attempts to find a parameter with the same Name property in Value. If successful, the parameter information (type and current data) from the Value parameter is assigned to the Items entry. Entries in Items for which no match is found are left unchanged.


TParams.Create

TParams	See also	Example

Creates an instance of TParams.

constructor Create; overload;

constructor Create(Owner: TPersistent); overload;

Description

Call Create to instantiate a TParams object. Most applications will not need to create a TParams list, as it is created by the TQuery or TStoredProc object that uses the TParams object.


TParams.CreateParam

TParams	See also 	Example

Creates a new field parameter object and inserts it into the Items list.

function CreateParam(FldType: TFieldType; const ParamName: string; ParamType: TParamType): TParam;

Description

Call CreateParam to instantiate a new TParam object and add it to the Items managed by this TParams object. Specify the field type of the new parameter as the value of FldType, specify the name of the parameter as the value of ParamName, and specify the type of parameter as the value of ParamType.

Note:	Parameters for TQuery components are only created by specifying parameters in the SQL statement. The TParam objects in a TQuery component’s Params property are created automatically when parameter tokens are added to the SQL statement.


TParams.FindParam

TParams 	See also

Locates the parameter with a given name.

function FindParam(const Value: String): TParam;

Description

Use ParamByName method to find a parameter with the name passed in Value. If a match is found, ParamByName returns the parameter. Otherwise, it returns nil. Use this method rather than a direct reference to the Items property to avoid depending on the order of the entries.

To locate more than one parameter at a time, by name, use the GetParamList method instead. To get only the value of a named parameter, use the ParamValues property.


TParams.GetParamList

TParams	See also

Fills a TList object with the individual TParam objects named by ParamNames.

procedure GetParamList(List: TList; const ParamNames: String);

Description

Use GetParamList to obtain a subset of the field parameters in the Items list that have been identified by name. ParamNames is a string giving the names of all field parameters of interest. Multiple parameter names are separated by semicolons (;).

GetParamList adds the field parameters to List in the order they appear in ParamNames. If ParamNames includes a name that does not match any of the field parameters in Items, an exception is raised.


TParams.IsEqual

TParams	See also

Indicates whether two TParams objects have identical Items.

function IsEqual(Value: TParams): Boolean;

Description

IsEqual returns True if the Items property of the Value parameter exactly matches the Items property. To match, each Items list must have the same number of field parameters, in the same order, which match on name, datatype, parameter type, and value.


TParams.ParamByName

TParams	See also 	Example

Locates the parameter with a given name.

function ParamByName(const Value: String): TParam;

Description

Use ParamByName method to find a parameter with the name passed in Value. If a match is found, ParamByName returns the parameter. Otherwise, an exception is raised. Use this method rather than a direct reference to the Items property to avoid depending on the order of the entries.

To locate a parameter by name without raising an exception if the parameter is not found, use the FindParam method.

To locate more than one parameter at a time, by name, use the GetParamList method instead. To get only the value of a named parameter, use the ParamValues property.


TParams.ParseSQL

TParams 	See also

Locates the parameters in an SQL statement and replaces them with question marks.

function ParseSQL(SQL: String; DoCreate: Boolean): String;

Description

Call ParseSQL to replace all the parameters in the SQL statement passed as the SQL parameters with question marks (?). ParseSQL recognizes parameters by a preceding colon (:). Double colons (::) or colons contained in quoted strings are parsed as literals, and the immediately following name is not replaced with a question mark. The converted SQL statement is returned.

If the DoCreate parameter is True, all parameters in the Items property are replaced with a set of TParam objects whose names are the same as the strings removed from the SQL statement.

For example, given the SQL string

SELECT * FROM EMPLOYEES

WHERE (ID = :EMP_ID) AND (NAME = :EMP_NAME)

ParseSQL returns the string

SELECT *

FROM EMPLOYEES

WHERE (ID = ?) AND (NAME = ?)

and, if DoCreate is True, the Items property contains two TParam objects with the names EMP_ID and EMP_NAME.


TParams.RemoveParam

TParams	See also 	Example

Removes the specified parameter from the Items property of a TParams object.

procedure RemoveParam(Value: TParam);

Description

Use RemoveParam to remove a field parameter from the Items list. RemoveParam will take Value out of the list but does not free it.

Note:	Parameters for TQuery components are only created and removed by specifying parameters in the SQL statement. The TParam objects in a TQuery component’s Params property are deleted automatically when the corresponding parameter tokens are removed from the SQL statement.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


TPasswordDialog

Hierarchy	Properties	Methods	Events	See also

TPasswordDialog is a dialog box that allows the user to specify passwords for the current session.

Unit

dbpwdlg

Description

Use TPasswordDialog to allow the user to specify passwords for the current session. (The current session is represented by a TSession object.) The passwords are used when the application opens a Paradox table that requires a password. If a table requires a password that has not been added to the current session, the user will be prompted for the password.

A TPasswordDialog object is usually created with the PasswordDialog function. However, TPasswordDialog can also be used as a base object for other types of password dialog boxes.


TPasswordDialog properties

TPasswordDialog	Alphabetically	Legend

Derived from TCustomForm

Active

ActiveControl

ActiveMDIChild

ActiveOleControl

BorderIcons

BorderStyle

Canvas

ClientHandle

ClientHeight

ClientRect

ClientWidth

DefaultMonitor

Designer

DropTarget

Floating

FormState

FormStyle

HelpFile

Icon

KeyPreview

MDIChildCount

MDIChildren

Menu

ModalResult

Monitor

ObjectMenuItem

OldCreateOrder

OleFormObject

Parent

ParentBiDiMode

PixelsPerInch

Position

PrintScale

Scaled

TileMode

Visible

WindowMenu

WindowState

Derived from TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

BorderWidth

Brush

ClientOrigin

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DockManager

DockSite

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

UseDockManager

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

AutoSize

BiDiMode

BoundsRect

Caption

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragKind

DragMode

Enabled

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

ParentFont

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TPasswordDialog properties

TPasswordDialog	By object	Legend

Action

Active

ActiveControl

ActiveMDIChild

ActiveOleControl

Align

Anchors

AutoScroll

AutoSize

BiDiMode

BorderIcons

BorderStyle

BorderWidth

BoundsRect

Brush

Canvas

Caption

ClientHandle

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DefaultMonitor

Designer

DesignInfo

DockClientCount

DockClients

DockManager

DockOrientation

DockSite

DoubleBuffered

DragKind

DragMode

DropTarget

Enabled

Floating

FloatingDockSiteClass

Font

FormState

FormStyle

Handle

Height

HelpContext

HelpFile

Hint

HorzScrollBar

HostDockSite

Icon

KeyPreview

Left

LRDockWidth

MDIChildCount

MDIChildren

Menu

ModalResult

Monitor

Name

ObjectMenuItem

OldCreateOrder

OleFormObject

Owner

Parent

ParentBiDiMode

ParentFont

ParentWindow

PixelsPerInch

PopupMenu

Position

PrintScale

Scaled

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

TileMode

Top

UndockHeight

UndockWidth

UseDockManager

VCLComObject

VertScrollBar

Visible

VisibleDockClientCount

Width

WindowMenu

WindowProc

WindowState


TPasswordDialog events

TPasswordDialog	Alphabetically	Legend

Derived from TCustomForm

OnActivate

OnClose

OnCloseQuery

OnCreate

OnDeactivate

OnDestroy

OnHelp

OnHide

OnPaint

OnShortCut

OnShow

Derived from TWinControl

OnDockDrop

OnDockOver

OnGetSiteInfo

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseWheel

OnMouseWheelDown

OnMouseWheelUp

OnUndock

Derived from TControl

OnCanResize

OnClick

OnConstrainedResize

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock


TPasswordDialog events

TPasswordDialog	By object	Legend

OnActivate

OnCanResize

OnClick

OnClose

OnCloseQuery

OnConstrainedResize

OnContextPopup

OnCreate

OnDblClick

OnDeactivate

OnDestroy

OnDockDrop

OnDockOver

OnDragDrop

OnDragOver

OnEndDock

OnGetSiteInfo

OnHelp

OnHide

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnMouseWheel

OnMouseWheelDown

OnMouseWheelUp

OnPaint

OnResize

OnShortCut

OnShow

OnStartDock

OnUndock


TPasswordDialog methods

TPasswordDialog	Alphabetically

In TPasswordDialog

AddButtonClick

EditChange

OKButtonClick

RemoveAllButtonClick

RemoveButtonClick

Derived from TForm

ArrangeIcons

Cascade

Next

Previous

Tile

Derived from TCustomForm

AfterConstruction

BeforeDestruction

Close

CloseQuery

Create

CreateNew

DefaultHandler

DefocusControl

Destroy

Dock

FocusControl

GetFormImage

Hide

IsShortCut

MouseWheelHandler

Print

Release

SendCancelMode

SetFocus

SetFocusedControl

Show

ShowModal

WantChildKey

Derived from TScrollingWinControl

DisableAutoRange

EnableAutoRange

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPasswordDialog methods

TPasswordDialog	By object

AddButtonClick

AfterConstruction

ArrangeIcons

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

Cascade

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

Close

CloseQuery

ContainsControl

ControlAtPos

Create

CreateNew

CreateParented

CreateParentedControl

DefaultHandler

DefocusControl

Destroy

DestroyComponents

Destroying

DisableAlign

DisableAutoRange

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EditChange

EnableAlign

EnableAutoRange

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

FocusControl

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetFormImage

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

IsShortCut

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

Next

OKButtonClick

PaintTo

Perform

Previous

Print

Realign

Refresh

Release

RemoveAllButtonClick

RemoveButtonClick

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendCancelMode

SendToBack

SetBounds

SetFocus

SetFocusedControl

SetTextBuf

Show

ShowModal

Tile

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

WantChildKey


TPasswordDialog.AddButtonClick

TPasswordDialog	See also

Controls what happens when the Add button is clicked.

procedure AddButtonClick(Sender: TObject);

Description

AddButtonClick adds the password in the edit box to the current session by calling the TSession.AddPassword method. Then AddButtonClick clears and sets focus to the edit box.

After the AddButtonClick method is called, the OK Button is enabled, regardless of whether the edit box currently contains a password.


TPasswordDialog.EditChange

TPasswordDialog	See also

Controls what happens when the contents of the edit box change.

procedure EditChange(Sender: TObject);

Description

EditChange enables or disables the Add, OK, and Remove buttons according to whether the edit box contains a password. If the edit box contains a password, the buttons are enabled. Otherwise the buttons are disabled.

Note:	If the AddButtonClick method has been called, then the OK button is enabled, regardless of whether the edit box contains a password.


TPasswordDialog.OKButtonClick

TPasswordDialog	See also

Controls what happens when the OK button is clicked.

procedure OKButtonClick(Sender: TObject);

Description

OKButtonClick adds the password in the edit box to the current session by calling the TSession.AddPassword method.


TPasswordDialog.RemoveAllButtonClick

TPasswordDialog	See also

Removes all passwords from the current session.

procedure RemoveAllButtonClick(Sender: TObject);

Description

RemoveAllButtonClick removes all passwords from the current session by calling the TSession.RemoveAllPasswords method. Then RemoveAllButtonClick sets focus to the edit box.


TPasswordDialog.RemoveButtonClick

TPasswordDialog	See also

Removes the password in the edit box from the current session.

procedure RemoveButtonClick(Sender: TObject);

Description

RemoveButtonClick removes the password in the edit box from the current session by calling the TSession.RemovePassword method. Then RemoveButtonClick clears and sets focus to the edit box.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TScrollingWinControl

TCustomForm

TForm


TPen

Hierarchy	Properties	Methods	Events	See also

TPen is used to draw lines or outline shapes on a canvas.

Unit

graphics

Description

Use TPen to describe the attributes of a Windows pen when drawing an image to a canvas (TCanvas). TPen encapsulates the pen properties that are selected into the device context of the canvas.


TPen properties

TPen	Alphabetically	Legend

In TPen

Color

Handle

Mode

Style

Width

Derived from TGraphicsObject

OwnerCriticalSection


TPen properties

TPen	By object	Legend

Color

Handle

Mode

OwnerCriticalSection

Style

Width


TPen.Color

TPen	See also 	Example

Determines the color used to draw lines on the canvas.

property Color: TColor;

Description

Set Color to change the color used to draw lines or outline shapes. The way the color is used by the pen depends on the Mode and Style properties.


TPen.Handle

TPen	See also

Specifies the Windows pen object handle.

property Handle: HPen;

Description

Use Handle when making a Windows API function call that requires the handle of a pen object. Handle is the Windows handle currently selected into the device context of the canvas.


TPen.Mode

TPen	See also

Determines how the pen draws lines on the canvas.

type

 TPenMode = (pmBlack, pmWhite, pmNop, pmNot, pmCopy, pmNotCopy, pmMergePenNot, pmMaskPenNot, pmMergeNotPen, pmMaskNotPen, pmMerge, pmNotMerge, pmMask, pmNotMask, pmXor, pmNotXor)

property Mode: TPenMode;

Description

Set Mode to determine how the color of the pen interacts with the color on the canvas. The effects of Mode are described in the following table:

Mode	Pixel color

pmBlack	Always black

pmWhite	Always white

pmNop	Unchanged

pmNot	Inverse of canvas background color

pmCopy	Pen color specified in Color property

pmNotCopy	Inverse of pen color

pmMergePenNot	Combination of pen color and inverse of canvas background

pmMaskPenNot	Combination of colors common to both pen and inverse of canvas background.

pmMergeNotPen	Combination of canvas background color and inverse of pen color

pmMaskNotPen	Combination of colors common to both canvas background and inverse of pen

pmMerge	Combination of pen color and canvas background color

pmNotMerge	Inverse of pmMerge: combination of pen color and canvas background color

pmMask	Combination of colors common to both pen and canvas background

pmNotMask	Inverse of pmMask: combination of colors common to both pen and canvas background

pmXor	Combination of colors in either pen or canvas background, but not both

pmNotXor	Inverse of pmXor: combination of colors in either pen or canvas background, but not both


TPen.Style

TPen	See also 	Example

Determines the style in which the pen draws lines.

type TPenStyle = (psSolid, psDash, psDot, psDashDot, psDashDotDot, psClear, psInsideFrame);

property Style: TPenStyle;

Description

Use Style to draw a dotted or dashed line, or to omit the line that appears as a frame around shapes. These are the possible values of Style:

Style	Meaning

psSolid	A solid line.

psDash	A line made up of a series of dashes

psDot	A line made up of a series of dots

psDashDot	A line made up of alternating dashes and dots

psDashDotDot	A line made up of a serious of dash-dot-dot combinations

psClear	No line is drawn (used to omit the line around shapes that draw an outline using the current pen).

psInsideFrame	A solid line, but one that may use a dithered color if Width is greater than 1.

Note:	Only the psInsideFrame style will produce a dithered color to match a Color property that is not in the color table. All others choose the closest color from the Windows color table.

Note:	Dotted or dashed pen styles are not available when the Width property is not 1.


TPen.Width

TPen	See also 	Example

Specifies the maximum width of the pen in pixels.

property Width: Integer;

Description

Use Width to give the line greater weight. If Width is set to a value less than 1, the pen is given a Width of 1.

Note:	The value of Width influences which values of Style are valid.


TPen events

TPen	Alphabetically

Derived from TGraphicsObject

OnChange


TPen events

TPen	By object

OnChange


TPen methods

TPen	Alphabetically

In TPen

Assign

Create

Destroy

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TPen methods

TPen	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TPen.Assign

TPen	See also

Assigns the properties of the pen from another TPen object.

procedure Assign(Source: TPersistent); override;

Description

If the Source parameter identifies another TPen object, Assign copies the Color, Width, Style, and Mode properties of the source pen. Otherwise, the inherited method copies the properties from any object that can write to a TPen object in its AssignTo method.


TPen.Create

TPen	See also

Creates an instance of TPen.

constructor Create;

Description

Call Create to create a TPen object for assigning the pen property of a canvas. The pen for the canvas is created automatically in the constructor for the TCanvas object.

Create allocates the resources for the TPen object and initializes the Mode property to pmCopy.


TPen.Destroy

TPen	See also

Destroys an instance of TPen.

destructor Destroy; override;

Description

Do not call Destroy directly from an application. Instead, call Free. Free verifies that the TPen reference is not nil, and only then calls Destroy.


Scope

Published


Hierarchy

TObject

TPersistent

TGraphicsObject


TPersistent

Hierarchy	Methods	See also

TPersistent is the ancestor for all objects that have assignment and streaming capabilities

Unit

classes

Description

TPersistent encapsulates the behavior common to all objects that can be assigned to other objects, and that can read and write their properties to and from a stream. For this purpose TPersisent introduces methods that can be overriden to:

Define the procedure for loading and storing unpublished data to a stream.

Provide the means to assign values to properties.

Provide the means to assign the contents of one object to another.

Do not create instances of TPersistent. Use TPersistent as a base class when declaring objects that are not components, but that need to be saved to a stream or have their properties assigned to other objects.


TPersistent methods

TPersistent	Alphabetically	Legend

In TPersistent

Assign

AssignTo

DefineProperties

Destroy

GetNamePath

GetOwner

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TPersistent methods

TPersistent	By object	Legend

AfterConstruction

Assign

AssignTo

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

DefineProperties

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetOwner

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TPersistent.Assign

TPersistent	See also

Copies the contents of another, similar object.

procedure Assign(Source: TPersistent);

Description

Call Assign to copy the properties or other attributes of one object from another. The standard form of a call to Assign is

Destination.Assign(Source);

which tells the Destination object to copy the contents of the Source object to itself.

Most objects override Assign to handle the assignment of properties from similar objects. When overriding Assign, call the inherited method if the destination object can’t handle the assignment of properties from the class of the Source parameter.

If no overridden Assign method can handle the assignment of properties from Source, the method implemented in TPersistent calls the source object’s AssignTo method. This allows the source object to handle the assignment. If the Source object is nil, TPersistent.Assign raises an EConvertError exception.

In general, the statement “Destination := Source” is not the same as the statement “Destination.Assign(Source)”. The statement “Destination := Source” makes Destination reference the same object as Source, whereas "Destination.Assign(Source)" copies the contents of the object referenced by Source into the object referenced by Destination.

Note:	The types of some properties are also objects. If these properties have write methods that use Assign to set the value of the property, then in these cases the statement "Destination := Source" is the same as "Destination.Assign(Source)".


TPersistent.AssignTo

TPersistent	See also

Copies the properties of an object to a destination object.

procedure AssignTo(Dest: TPersistent); virtual;

Description

Override the AssignTo method to extend the functionality of the Assign method of destination objects so that they handle newly created object classes. When defining a new object class, override the Assign method for every existing object class that should be able to copy its properties to the new class.  Override the AssignTo method for every existing class that the new class can copy to.

The Assign method of TPersistent calls AssignTo if the descendant object does not succeed in copying the properties of a source object. The AssignTo method defined by TPersistent raises an EConvertError exception.

For example, given the following code in which A and B are instance variables:

A.Assign(B);

if A knows how to handle B, then it does so and returns. If A doesn’t know how to handle B’s type, execution will trickle to TPersistent.Assign, which calls:

B.AssignTo(A);

If B knows how to copy to A, the assignment succeeds. Otherwise, TPersistent raises an exception.


TPersistent.DefineProperties

TPersistent	See also	Example

Provides an interface for a method that reads and writes otherwise unpublished data.

procedure DefineProperties(Filer: TFiler); virtual;

Description

Descendants of TPersistent override DefineProperties to designate a method for storing the object's unpublished data to a stream such as a form file. By default, writing an object to a stream writes the values of all its published properties, and reading the object in reads those values and assigns them to the properties. Objects can also specify methods that read and write data other than published properties by overriding the DefineProperties method.

When overriding DefineProperties, consider including some or all of the following:

A call to the inherited method

Calls to the filer object's DefineProperty method

Calls to the filer object's DefineBinaryProperty method

DefineProperties is virtual, so descendant classes can override it as necessary but are not required to do so.


TPersistent.Destroy

TPersistent	See also

Destroys the TPersistent instance and frees its memory.

procedure Destroy; override;

Description

Destroy cleans up references in the global fix-up list for form linking. It then calls the inherited destructor.

Do not call Destroy directly. Call Free instead. Free checks that the object reference is not nil before calling Destroy.


TPersistent.GetNamePath

TPersistent	See also

Returns the name of the object as it appears in the Object Inspector.

function  GetNamePath: string; dynamic;

Description

GetNamePath is for internal use only. It determines the text that the Object Inspector displays for the name of the object being edited. GetNamePath is introduced in TPersistent so descendants such as collections can appear in the Object Inspector. Do not call GetNamePath directly.

For components, GetNamePath returns the component name. For TCollectionItem objects it returns the name of the hosting component, the name of the property, and the index into the collection surrounded by brackets.


TPersistent.GetOwner

TPersistent	See also

Returns the owner of an object.

function  GetOwner: TPersistent; dynamic;

Description

GetOwner is used by the GetNamePath method to find the owner of a persistent object. GetNamePath and GetOwner are introduced in TPersistent so descendants such as collections can appear in the Object Inspector. As implemented in TPersistent, GetOwner returns nil.

For TCollection, GetOwner returns the owner of the collection. For collection items, it returns the collection object into which the collection item has been inserted. For TComponent it is the value of the Owner property.


Scope

Protected


Hierarchy

TObject


TPicture

Hierarchy	Properties	Methods	Events	See also

TPicture contains a bitmap, icon, metafile graphic, or user-defined graphic.

Unit

graphics

Description

TPicture is a TGraphic container, used to hold a graphic, the type of which is specified in the Graphic property. It is used in place of a TGraphic if the graphic can be of any TGraphic class. LoadFromFile and SaveToFile are polymorphic. For example, if the TPicture is holding an Icon, it is valid to LoadFromFile a bitmap file, where the class TIcon can only read .ICO files.

If the TPicture contains a bitmap graphic, the Bitmap property specifies the graphic. If the TPicture contains an icon graphic, the Icon property specifies the graphic. If the TPicture contains a metafile graphic, the Metafile property specifies the graphic.

The properties of TPicture indicate the type of graphic that the picture object contains, and its size. The methods of TPicture are used to load, save, and manipulate graphics.

To load or save a picture to the Clipboard, use the Assign method of a TClipboard object.

To draw a picture on a canvas, call the Draw or StretchDraw methods of a TCanvas object, passing the Graphic property of a TPicture as a parameter.


TPicture properties

TPicture	Alphabetically	Legend

In TPicture

Bitmap

Graphic

Height

Icon

Metafile

PictureAdapter

Width


TPicture properties

TPicture	By object	Legend

Bitmap

Graphic

Height

Icon

Metafile

PictureAdapter

Width


TPicture.Bitmap

TPicture	See also	Example

Specifies the contents of the picture object as a bitmap graphic (.BMP file format).

property Bitmap: TBitmap;

Description

Use Bitmap to reference the picture object when it contains a bitmap. If Bitmap is referenced when the picture contains a Metafile or Icon graphic, the graphic won't be converted. Instead, the original contents of the picture are discarded and Bitmap returns a new, blank bitmap.


TPicture.Graphic

TPicture	See also 	Example

Specifies the graphic that the picture contains.

property Graphic: TGraphic;

Description

Use Graphic to specify what graphic the TPicture object contains. The graphic can be a bitmap, icon, or metafile, or user-defined graphic class.


TPicture.Height

TPicture 	See also

Specifies the vertical size (in pixels) of the graphic.

property Height: Integer;

Description

Use Height to find the height of the graphic image contained in the picture object. Height is the native, unstretched, height of the picture.


TPicture.Icon

TPicture	See also

Specifies the contents of the TPicture object as an icon graphic (.ICO file format).

property Icon: TIcon;

Description

If Icon is referenced when the TPicture contains a Bitmap or Metafile graphic, the graphic won't be converted. Instead, the original contents of the TPicture are discarded and Icon returns a new, blank icon.


TPicture.Metafile

TPicture	See also

Specifies the contents of the picture object as an Enhanced Windows metafile graphic (.EMF file format).

property Metafile: TMetafile;

Description

If Metafile is referenced when the TPicture contains a Bitmap or Icon graphic, the graphic won't be converted. Instead, the original contents of the TPicture are discarded and Metafile returns a new, blank metafile.


TPicture.PictureAdapter

TPicture	See also

Represents an OLE interface for the picture.

property PictureAdapter: IChangeNotifier;

Description

PictureAdapter is for internal use only.


TPicture.Width

TPicture	See also

Specifies the horizontal size (in pixels) of the picture.

property Width: Integer;

Description

Use Width to find the width of a graphic image. Width contains the native, unstretched, width of the picture.


TPicture events

TPicture	Alphabetically

In TPicture

OnChange

OnProgress


TPicture events

TPicture	By object

OnChange

OnProgress


TPicture.OnChange

TPicture

Occurs when the specific graphics item encapsulated by the picture object changes.

property OnChange: TNotifyEvent;

Description

Use OnChange to write an event handler to process an action when the graphic is modified.


TPicture.OnProgress

TPicture	See also

Occurs periodically during slow operations that affect the graphic.

type

  TProgressStage = (psStarting, psRunning, psEnding);

  TProgressEvent = procedure (Sender: TObject; Stage: TProgressStage; PercentDone: Byte; RedrawNow: Boolean; const R: TRect; const Msg: string) of object;

property OnProgress: TProgressEvent;

Description

OnProgress is generated by the particular graphic that the picture object contains. Whether OnProgress occurs depends upon the type of graphic in the Graphic property. Some graphics generate this event, others do not. JPeg images, for example, generate an OnProgress event.

Write an OnProgress event handler to provide the user with feedback during slow operations such as loading large compressed images. TImage, for example, hooks the OnProgress event of TPicture.

The Stage parameter indicates whether the operation is beginning, continuing, or ending. If the OnProgress event handler displays an indicator such as a progress bar, the indicator can be created when Stage is psStarting, updated while Stage is psRunning, and removed when Stage is psEnding. The PercentDone parameter is an approximation of how much of the operation has completed. Use PercentDone to update the position of a progress bar or other indicator.

The RedrawNow parameter indicates whether the image can safely be drawn on screen at this point. The R parameter specifies the portion of the image that has changed and needs to be redrawn.

The Msg parameter contains one or two words that describe what operation is occurring. For example, the value of Msg could be a string such as Loading, Storing, or Reducing colors. The Msg string can also be empty.

Note:	The PercentDone parameter is only an approximation. With some image formats, the value of PercentDone may actually decrease from the value in previous events, as the graphic object discovers there is more work to do.


TPicture methods

TPicture	Alphabetically

In TPicture

Assign

Create

Destroy

LoadFromClipboardFormat

LoadFromFile

RegisterClipboardFormat

RegisterFileFormat

RegisterFileFormatRes

SaveToClipboardFormat

SaveToFile

SupportsClipboardFormat

UnregisterGraphicClass

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TPicture methods

TPicture	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

LoadFromClipboardFormat

LoadFromFile

MethodAddress

MethodName

NewInstance

RegisterClipboardFormat

RegisterFileFormat

RegisterFileFormatRes

SafeCallException

SaveToClipboardFormat

SaveToFile

SupportsClipboardFormat

UnregisterGraphicClass


TPicture.Assign

TPicture	See also 	Example

Copies one object to another by copying the contents of that object to the other.

procedure Assign(Source: TPersistent);

Description

When Source is a object type that is valid for the Graphic property, Assign makes that graphic the value of the Graphic property.

The actions performed by Assign depend on the actual types of the TPicture Graphic property and Source. For example, if the Graphic property and Source are bitmaps (TBitmap), the bitmap contained in Source is copied into the Graphic property. Similar conversions are valid, for example, for TIcon or TMetafile.

If the Source parameter is not a valid object for the Graphic property, Assign calls the inherited method so that the picture can be copied from any object with which it is compatible.


TPicture.Create

TPicture	See also

Creates a TPicture object.

constructor Create;

Description

Call Create to create an instance of TPicture at runtime. Create allocates the memory for the picture object and initializes its internal formats. After creating the TPicture object, use the LoadFromClipboardFormat or LoadFromFile method to assign a graphical image to the picture, so that it is available to the application.


TPicture.Destroy

TPicture	See also

Destroys an instance of a picture object.

destructor Destroy; override;

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TPicture reference is not nil before it calls Destroy.

Destroy frees the graphic image it contains before calling the inherited Destroy.


TPicture.LoadFromClipboardFormat

TPicture	See also

Reads the picture from the handle provided in the given Clipboard format.

procedure LoadFromClipboardFormat(AFormat: Word; AData: THandle; APalette: HPALETTE);

Description

Use LoadFromClipboardFormat to read in a graphic from the Clipboard. If the format is not supported, an EInvalidGraphic exception is raised.


TPicture.LoadFromFile

TPicture	See also

Reads the file specified in FileName and loads the data into the TPicture object.

procedure LoadFromFile(const FileName: string);

Description

Use LoadFromFile to read a picture from disk. The TGraphic class created determined by the file extension of the file. If the file extension is not recognized an EInvalidGraphic exception is raised.


TPicture.RegisterClipboardFormat

TPicture	See also

Registers a new TGraphic class for use in the LoadFromClipboardFormat method.

type TGraphicClass = class of TGraphic;

class procedure RegisterClipboardFormat(AFormat: Word; AGraphicClass: TGraphicClass);

Description

Use RegisterClipboardFormat register a new graphic format with TPicture so that it can be used with the LoadFromClipboardFormat method.


TPicture.RegisterFileFormat

TPicture	See also

Registers a new TGraphic class for use in LoadFromFile.

type TGraphicClass = class of TGraphic;

class procedure RegisterFileFormat(const AExtension, ADescription: string; AGraphicClass: TGraphicClass);

Description

Use RegisterFileFormat to register a graphic file format with TPicture so that it can be used with a Open or Save dialog box.

The AExtension parameter specifies the three-character system file extension to associate with the graphic class (for example, "BMP" is associated with TBitmap). The ADescription parameter specifies the description of the graphic to appear in the drop down list of the dialog box (for example, "Bitmaps" is the description of TBitmap). The AGraphicClass parameter registers the new graphic class to associate with the file format.


TPicture.RegisterFileFormatRes

TPicture	See also

Registers a new TGraphic class for use in the LoadFromFile method.

type TGraphicClass = class of TGraphic;

class procedure RegisterFileFormatRes(const AExtension: String; ADescriptionResID: Integer; AGraphicClass: TGraphicClass);

Description

Use RegisterFileFormatRes by specifying a string resource ID in the ADescriptionResID parameter.


TPicture.SaveToClipboardFormat

TPicture	See also

Allocates a global handle and writes the picture in its native Clipboard format (CF_BITMAP for bitmaps, CF_METAFILE for metafiles, and so on).

procedure SaveToClipboardFormat(var AFormat: Word; var AData: THandle; var APalette: HPALETTE);

Description

Use SaveToClipboardFormat to copy the picture to a Clipboard format. The resulting values can then be copied to the Windows clipboard using the clipboard’s SetAsHandle method.

The picture’s palette is returned in the APalette parameter, the format in the AFormat parameter, and a handle to the data in the AData parameter. Before the picture can be saved, an application must have registered the format using the RegisterClipboardFormat method.


TPicture.SaveToFile

TPicture	Example

Writes the picture to disk.

procedure SaveToFile(const FileName: string);

Description

Use SaveToFile to save a TPicture object to the file specified in FileName.


TPicture.SupportsClipboardFormat

TPicture	See also

Indicates if the given Clipboard format is supported by the LoadFromClipboardFormat method.

class function SupportsClipboardFormat(AFormat: Word): Boolean;

Description

If the LoadFromClipboardFormat method supports the Clipboard format specified as the value of AFormat, SupportsClipboardFormat returns True. If the format is not supported, the method returns False.


TPicture.UnregisterGraphicClass

TPicture	See also

Removes all references to the specified TGraphic class and all its descendants from the internal lists of file formats and clipboard formats.

class procedure UnregisterGraphicClass(AClass: TGraphicClass);

Description

Call UnregisterGraphicClass to make a graphic class unavailable to all picture objects. UnregisterGraphicClass reverses the registration accomplished by the RegisterFileFormat, RegisterFileFormatRes, or RegisterClipboardFormat method.

When a graphic class is registered, the global GraphicFilter, GraphicExtension, and GraphicFileMask functions can return dialog filter strings, default file extensions or file filters for the graphic class. Call UnregisterGraphicClass when these values should not be available. For example, component writers who implement custom graphic classes unregister those classes in the finalization block of the unit that implements the custom class. (File formats and clipboard formats for the custom class are registered in the initialization block).


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TParamList

Hierarchy	Properties	Methods	See also

TParamList manages a list of session parameters.

Unit

dbtables

Description

Do not use TParamList directly. TParamList is an internal object used to manage a list of session parameters for a TSession component.


TParamList properties

TParamList	Alphabetically	Legend

In TParamList

Buffer

FieldCount

FieldDescs


TParamList properties

TParamList	By object	Legend

Buffer

FieldCount

FieldDescs


TParamList.Buffer

TParamList	See also

Contains all parameter strings for the parameter list.

property Buffer: PChar;

Description

Buffer is used internally to store parameters in the the parameter list object. While applications can parse this list, there is usually no need to do so.


TParamList.FieldCount

TParamList	See also

Indicates the number of session parameters in the parameter list.

property FieldCount: Integer;

Description

Check FieldCount to determine how many parameters there are for a session.


TParamList.FieldDescs

TParamList 	See also

Contains the field descriptors for each parameter maintained by the parameter list object.

type

  TFieldDescList = array of FLDDesc;

property FieldDescs: TFieldDescList;

Description

Examine FieldDescs to determine the characteristics of each parameter maintained by the parameter list object. Applications usually have no need to access this property directly.


TParamList methods

TParamList	Alphabetically

In TParamList

Create

Destroy

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TParamList methods

TParamList	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TParamList.Create

TParamList	See also

Creates an instance of TParamList.

constructor Create (Params: TStrings);

Description

Call Create to instantiate a TParamList object. Most applications do not need to create a TParamList object because it is automatically created by TSession.

Params is a string list containing the names of the parameters to create for the session. These parameters correspond to Borland Database Engine (BDE) configuration parameters.


TParamList.Destroy

TParamList	See also

Destroys an instance of TParamList.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free, which checks for a nil reference before calling Destroy.

Destroy frees the memory previously allocated for field descriptors and the buffer used by TParamList.

Note:	An application should never need to destroy a TParamList object. It is automatically destroyed when its parent session object is destroyed.


Accessibility

Read-only


Hierarchy

TObject


 TPopupMenu

Hierarchy	Properties	Methods	Events	See also	Example 1	Example 2

TPopupMenu encapsulates the properties, methods, and events of a pop-up menu.

Unit

menus

Description

Use TPopupMenu to define the pop-up menu that appears when the user clicks on a control with the right mouse button. To make a pop-up menu available, assign the TPopupMenu object to the control’s PopupMenu property.

If the popup menu’s ParentBiDiMode is True, the popup menu’s BiDiMode is set to the BiDiMode of the control that activates it. If a control cannot be found, the BiDiMode is set to Application.BiDiMode.

The popup menu’s BiDiMode affects all of its menu items.


TPopupMenu properties

TPopupMenu	Alphabetically	Legend

In TPopupMenu

Alignment

AutoPopup

HelpContext

MenuAnimation

PopupComponent

PopupPoint

TrackButton

Derived from TMenu

AutoHotkeys

AutoLineReduction

BiDiMode

Handle

Images

Items

OwnerDraw

ParentBiDiMode

WindowHandle

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TPopupMenu properties

TPopupMenu	By object	Legend

Alignment

AutoHotkeys

AutoLineReduction

AutoPopup

BiDiMode

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Handle

HelpContext

Images

Items

MenuAnimation

Name

Owner

OwnerDraw

ParentBiDiMode

PopupComponent

PopupPoint

Tag

TrackButton

VCLComObject

WindowHandle


TPopupMenu.Alignment

TPopupMenu	See also

Determines where the pop-up menu appears when the user clicks the right mouse button.

property Alignment: TPopupAlignment;

Description

Set Alignment to control the placement of the popup menu. Alignment controls whether the menu appears to the left of the mouse, to the right of the mouse, or centered over the mouse.

By default, the menu appears with its top left corner under the mouse (paLeft).


TPopupMenu.AutoPopup

TPopupMenu	See also 	Example

Determines whether the pop-up menu appears automatically when the user clicks the right mouse button.

property AutoPopup: Boolean;

Description

Set AutoPopup to True to cause the pop-up menu to appear automatically when the user clicks the right mouse button on a control that has the pop-up menu specified as its PopupMenu property. The application key present on keyboards specifically designed for Windows 95 will also show this menu when pressed.

Set AutoPopup to False if the appearance of the pop-up menu should be controlled programmatically. To display a pop-up menu when AutoPopup is False, use the Popup method.


TPopupMenu.HelpContext

TPopupMenu	See also

Specifies a context ID for the entire pop-up menu.

property HelpContext: THelpContext;

Description

Use HelpContext to associate a help screen with the entire pop-up menu. Each screen in the Help system should have a unique context ID. When a component is selected in the application, pressing F1 displays the Help screen associated with the value of HelpContext.

To associate a help screen with the individual items in the pop-up menu, use the HelpContext property of the associated TMenuItem objects.


TPopupMenu.MenuAnimation

TPopupMenu	See also

Specifies how the menu appears when it is first displayed.

property MenuAnimation: TMenuAnimation;

Description

Use MenuAnimation to specify how the popup menu appears on the screen. The menu can simply appear as a whole, or can slide into view like a window shade being drawn from any edge.

Note:	MenuAnimation only has an effect when running on Windows 98, NT 5.0, or later.


TPopupMenu.PopupComponent

TPopupMenu	See also 	Example

Indicates the component that last displayed the popup menu in response to a right mouse click.

property PopupComponent: TComponent;

Description

Read PopupComponent to determine which control is currently using the popup menu. In applications where multiple controls share the same pop-up menu, use PopupComponent to determine which of them displayed the menu.

Set PopupComponent to associate a control with the menu before calling the Popup method programmatically to bring up the pop-up menu.


TPopupMenu.PopupPoint

TPopupMenu	See also

Indicates the location where the pop-up menu appears.

property PopupPoint: TPoint;

Description

This protected property is used internally to locate the popup menu. Its value is set by the Popup method.


TPopupMenu.TrackButton

TPopupMenu

Specifies which mouse button activates the popup menu when it is associated with a toolbar button.

property TrackButton: TTrackButton;

Description

Use TrackButton to specify which mouse button activates the popup menu when it is associated with a toolbar button.


TPopupMenu events

TPopupMenu	Alphabetically	Legend

In TPopupMenu

OnPopup

Derived from TMenu

OnChange


TPopupMenu events

TPopupMenu	By object	Legend

OnChange

OnPopup


TPopupMenu.OnPopup

TPopupMenu	See also 	Example

Occurs just before the pop-up menu appears.

property OnPopup: TNotifyEvent;

Description

Write an OnPopup event handler to take specific action just before the pop-up menu appears. For example, use an OnPopup event handler to set the Checked, Enabled, or Visible property of individual items in the menu so that they are appropriate to the PopupComponent.


TPopupMenu methods

TPopupMenu	Alphabetically	Legend

In TPopupMenu

Create

Destroy

DoPopup

Popup

UseRightToLeftAlignment

Derived from TMenu

DispatchCommand

DispatchPopup

FindItem

GetHelpContext

IsRightToLeft

IsShortCut

ParentBiDiModeChanged

ProcessMenuChar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstrucion

BeforeDestrucion

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPopupMenu methods

TPopupMenu	By object	Legend

AfterConstrucion

Assign

BeforeDestrucion

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DispatchCommand

DispatchPopup

DoPopup

ExecuteAction

FieldAddress

FindComponent

FindItem

Free

FreeInstance

FreeNotification

FreeOnRelease

GetHelpContext

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsRightToLeft

IsShortCut

MethodAddress

MethodName

NewInstance

ParentBiDiModeChanged

Popup

ProcessMenuChar

RemoveComponent

SafeCallException

UpdateAction

UseRightToLeftAlignment


TPopupMenu.Create

TPopupMenu	See also

Creates an instance of TPopupMenu.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create to create a pop-up menu at runtime. Pop-up menus placed in forms or data modules at design time are created automatically.


TPopupMenu.Destroy

TPopupMenu	See also

Destroys an instance of TPopupMenu.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TPopupMenu reference is not nil, and only then calls Destroy.


TPopupMenu.DoPopup

TPopupMenu	See also

Generates an OnPopup event.

procedure DoPopup(Sender: TObject); virtual;

Description

DoPopup is called automatically just before the pop-up menu appears to generate an OnPopup event. Override DoPopup in a descendant class to change the event.


TPopupMenu.Popup

TPopupMenu	See also 	Example

Displays the pop-up menu onscreen.

procedure Popup(X, Y: Integer); virtual;

Description

Call Popup to bring up the pop-up menu. The menu appears at the screen coordinates indicated by the values (in pixels) of X and Y.


TPopupMenu.UseRightToLeftAlignment

TPopupMenu

Specifies whether the control’s alignment is in a right-to-left mode.

function UseRightToLeftAlignment: Boolean;

Description

Call UseRightToLeftAlignment to determine whether the control’s alignment is in a right-to-left mode. This information can be used when painting the control or when responding to mouse events.

UseRightToLeftAlignment returns the setting from the control that activated the popup. If the popup was not activated by a control, UseRightToLeftAlignment returns the setting used in the global Application object.


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TMenu


TPopupList

Hierarchy	Properties	Methods	See also

TPopupList manages the window that handles popup menu messages.

Unit

menus

Description

TPopupList is the type of the global PopupList variable, which provides centralized message handling for all popup menus in an application.


TPopupList properties

TPopupList	Alphabetically	Legend

In TPopupList

Window

Derived from TList

Capacity

Count

Items

List


TPopupList properties

TPopupList	By object	Legend

Capacity

Count

Items

List

Window


TPopupList.Window

TPopupMenu

Provides access to the Window handle of the hidden window that processes popup menu messages.

property Window: HWND;

Description

Use Window for Windows API calls that require a window handle. The hidden window that processes messages for the popup menus in an application is not created until the first popup menu is added to the list. If the list contains no popup menus (that is, if no popup menus are created by the application), Window is 0.


TPopupList methods

TPopupList	Alphabetically	Legend

In TPopupList

Add

MainWndProc

Remove

WndProc

Derived from TList

Clear

Delete

Destroy

Error

Exchange

Expand

Extract

First

IndexOf

Insert

Last

Move

Pack

Sort

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TList methods

TPopupList	By object	Legend

Add

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

Error

Exchange

Expand

Extract

FieldAddress

First

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

IndexOf

InheritsFrom

InitInstance

Insert

InstanceSize

Last

MainWndProc

MethodAddress

MethodName

Move

NewInstance

Pack

Remove

SafeCallException

Sort

WndProc


TPopupList.Add

TPopupListClass	See also

Inserts a new popup menu at the end of the list.

procedure Add(Popup: TPopupMenu): Integer;

Description

Do not call the Add method. Popup menus automatically add themselves to the list when they are created.

Add increments Count and, if necessary, allocates memory by increasing the value of Capacity. When the first popup menu is added to the list, Add creates the hidden window whose handle is available as the Window property.


TPopupList.MainWndProc

TPopupList	See also

Wraps the WndProc method with an exception-handling layer.

procedure MainWndProc(var Message: TMessage);

Description

Do not use the protected MainWndProc method. It is used internally when creating the hidden window that responds to popup menu messages. To subclass the window procedure that handles messages sent to popup menus, override the WndProc method instead.


TPopupList.Remove

TPopupList	See also

Removes a popup menu from the list.

procedure Remove(Popup: TPopupMenu);

Description

Do not call the Remove method. It is called automatically by popup menus from their destructors, to remove themselves from the list.


TPopupList.WndProc

TPopupList

Provides centralized message handling for all popup menus in the application.

procedure WndProc(var Message: TMessage); virtual;

Description

Override WndProc to subclass the window procedure that handles messages directed at the popup menus in an application. WndProc handles messages by dispatching commands, displaying help, painting menu item, and so on.


Accessibility

Read-only


Hierarchy

TObject

TList


 TProgressBar

Hierarchy	Properties	Methods	Events	Example

TProgressBar is a wrapper for a Windows progress bar.

Unit

comctrls

Description

Use TProgressBar to add a progress bar to a form. Progress bars provide users with visual feedback about the progress of a procedure within an application. As the procedure progresses, the rectangular progress bar gradually fills from left to right with the system highlight color.


TProgressBar properties

TProgressBar	Alphabetically	Legend

In TProgressBar

Max

Min

Orientation

Position

Smooth

Step

Derived from TWinControl

BorderWidth

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

Constraints

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TProgressBar properties

TProgressBar	By object	Legend

Action

Align

Anchors

BiDiMode

BorderWidth

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Max

Min

Name

Orientation

Owner

Parent

ParentShowHint

ParentWindow

PopupMenu

Position

ShowHint

Showing

Smooth

Step

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TProgressBar.Max

TProgressBar	See also	Example

Specifies the upper limit of the range of possible positions.

property Max: Integer;

Description

Use Max along with the Min property to establish the range of possible positions a progress bar. When the process tracked by the progress bar is complete, the value of Position should equal Max.


TProgressBar.Min

TProgressBar	See also	Example

Specifies the lower limit of the range of possible positions.

property Min: Integer;

Description

Use Max along with the Min property to establish the range of possible positions a progress bar. When the process tracked by the progress bar begins, the value of Position should equal Min.


TProgressBar.Orientation

TProgressBar

Specifies whether the progress bar is oriented vertically or horizontally.

property Orientation: TProgressBarOrientation;

Description

Use Orientation to get or set whether the progress bar is oriented vertically or horizontally.


TProgressBar.Position

TProgressBar	See also	Example

Specifies the current position of the progress bar.

property Position: Integer;

Description

You can read Position to determine how far the process tracked by the progress bar has advanced from Min toward Max. Set Position to cause the progress bar to display a position between Min and Max. For example, when the process tracked by the progress bar completes, set Position to Max so that it appears completely filled.

When a progress bar is created, Min and Max represent percentages, where Min is 0 (0% complete) and Max is 100 (100% complete). If these values are not changed, Position is the percentage of the process that has already been completed.


TProgressBar.Smooth

TProgressBar

Specifies whether the progress bar is smooth or segmented.

property Smooth: Boolean;

Description

Use Smooth to specify whether the progress bar is smooth or segmented.


TProgressBar.Step

TProgressBar	See also	Example

Specifies the amount that Position increases when the StepIt method is called.

property Step: Integer;

Description

Set Step to specify the granularity of the progress bar. Step should reflect the size of each step in the process tracked by the progress bar, in the logical units used by the Max and Min properties.

When a progress bar is created, Min and Max represent percentages, where Min is 0 (0% complete) and Max is 100 (100% complete). If these values are not changed, Step is the percentage of the process completed before the user is provided with additional visual feedback.

When the StepIt method is called, the value of Position increases by Step.


TProgressBar events

TProgressBar	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TProgressBar events

TProgressBar	By object	Legend

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TProgressBar methods

TProgressBar	Alphabetically

In TProgressBar

Create

StepBy

StepIt

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TProgressBar methods

TProgressBar	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

StepBy

StepIt

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TProgressBar.Create

TProgressBar	See also	Example

Creates an instance of TProgressBar.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create a progress bar at runtime. Progress bars placed on forms at design time are created automatically.

Pass a single Component as a parameter to provide the progress bar with an Owner that is responsible for freeing it.After calling the inherited constructor, Create initializes the following values:

Min is set to 0 and Max to 100.

Step is set to 10.

Width is set to 150.

Height is set to the height the arrow bitmap on a scrollbar.


TProgressBar.StepBy

TProgressBar	See also	Example

Advances the Position of the progress bar by a specified amount.

procedure StepBy(Delta: Integer);

Description

Call StepBy to increase the value of Position by the value of the Delta parameter. To advance Position by a default amount that represents a single step in the process, use the StepIt method.


TProgressBar.StepIt

TProgressBar	See also	Example

Advances Position by the amount specified in the Step property.

procedure StepIt;

Description

Call the StepIt method to increase the value of Position by the value of the Step property. If Step represents the size of one logical step in the process tracked by the progress bar, call Step after each logical step is completed.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


 TPrintDialog

Hierarchy	Properties	Methods	Events	See also

TPrintDialog displays a Print dialog.

Unit

dialogs

Description

The TPrintDialog component displays a standard Windows dialog box for sending jobs to a printer. The dialog is modal and does not appear at runtime until it is activated by a call to the Execute method.


TPrintDialog properties

TPrintDialog	Alphabetically	Legend

In TPrintDialog

Collate

Copies

FromPage

MaxPage

MinPage

Options

PrintRange

PrintToFile

ToPage

Derived from TCommonDialog

Ctl3D

Handle

HelpContext

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TPrintDialog properties

TPrintDialog	By object	Legend

Collate

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Copies

Ctl3D

DesignInfo

FromPage

Handle

HelpContext

MaxPage

MinPage

Name

Options

Owner

PrintRange

PrintToFile

Tag

ToPage

VCLComObject


TPrintDialog.Collate

TPrintDialog	See also

Indicates whether the Collate check box is selected.

property Collate: Boolean;

Description

Collate is True whenever the Collate check box is selected in the Print dialog. To make the dialog open with the check box selected, set Collate to True in the Object Inspector or in program code.


TPrintDialog.Copies

TPrintDialog	See also

Indicates the number copies selected in the Print dialog.

property Copies: Integer;

Description

If Copies is 0 or 1, the dialog will have 1 in the Number of Copies field. To make the dialog open with 2 or more copies selected, set the value of Copies in the Object Inspector or in program code.


TPrintDialog.FromPage

TPrintDialog	See also 	Example

Indicates the page on which the print job is to begin.

property FromPage: Integer;

Description

The FromPage property corresponds to the From field in the Print dialog.


TPrintDialog.MaxPage

TPrintDialog	See also 	Example

Determines the greatest page number the user can enter when specifying pages to print.

property MaxPage: Integer;

Description

If the user tries to enter a number greater than MaxPage, an error message appears.

Note

The user can specify page numbers only if the poPageNums flag is set in Options. If poPageNums is on, MaxPage must be set to a value greater than MinPage or the Print dialog will not open.


TPrintDialog.MinPage

TPrintDialog	See also 	Example

Determines the smallest page number the user can enter when specifying pages to print.

property MinPage: Integer;

Description

If the user tries to enter a number smaller than MinPage, a error message appears.

Note

The user can specify page numbers only if the poPageNums flag is set in Options. If poPageNums is on, MaxPage must be set to a value greater than MinPage or the Print dialog will not open.


TPrintDialog.Options

TPrintDialog	See also 	Example

Determines the appearance and behavior of the Print dialog.

type

  TPrintDialogOption = (poPrintToFile, poPageNums, poSelection, poWarning, poHelp, poDisablePrintToFile);

TPrintDialogOptions = set of TPrintDialogOption;

property Options: TPrintDialogOptions;

Description

The possible values of Options are:

Value	Meaning

poDisablePrintToFile	Disables (grays) the Print To File Check box. (Applicable only if the poPrintToFile flag is set.)

poHelp	Displays a Help button in the dialog. May not work in some versions of Windows 95.

poPageNums	Enables the Pages radio button, allowing the user to specify a page range.

poPrintToFile	Displays a Print To File check box in the dialog.

poSelection	Enables the Selection radio button, allowing the user to print selected (highlighted) text.

poWarning	Generates a warning message if the user tries to send a job to an uninstalled printer.

By default, all options flags are off.


TPrintDialog.PrintRange

TPrintDialog	See also 	Example

Indicates the type of print range selected in the dialog.

type TPrintRange = (prAllPages, prSelection, prPageNums);

property PrintRange: TPrintRange;

Description

The value of PrintRange corresponds the All, Selection, and Pages (From/To) radio buttons in the Print dialog:

Value	Meaning

prAllPages	The All radio button is selected.

prSelection	The Selection radio button is selected.

prPageNums	The Pages radio button is selected.

To determine which radio button is selected by default when the dialog opens, set the value of PrintRange in the Object Inspector or in program code.

To enable the Pages radio button, set the poPageNums flag in Options. To enable the Selection radio button, set the poSelection flag in Options and set MaxPage to a greater value than MinPage.


TPrintDialog.PrintToFile

TPrintDialog	See also 	Example

Indicates whether the Print To File check box is selected.

property PrintToFile: Boolean;

Description

PrintToFile is True whenever the Print To File check box is selected in the dialog. To make the dialog open with the check box selected, set PrintToFile to True in the Object Inspector or in program code.

To make the Print To File check box appear in the dialog, set the poPrintToFile flag in Options. To disable (gray) the Print To File check box, set the poDisablePrintToFile flag.


TPrintDialog.ToPage

TPrintDialog	See also 	Example

Indicates the page on which the print job is to end.

property ToPage: Integer;

Description

The ToPage property corresponds to the To field in the Print dialog.


TPrintDialog events

TPrintDialog	Alphabetically	Legend

Derived from TCommonDialog

OnClose

OnShow


TPrintDialog events

TPrintDialog	By object	Legend

OnClose

OnShow


TPrintDialog methods

TPrintDialog	Alphabetically

In TPrintDialog

Execute

Derived from TCommonDialog

Create

DefaultHandler

Destroy

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPrintDialog methods

TPrintDialog	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Execute

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TPrintDialog.Execute

TPrintDialog 	Example

Displays the Print dialog box.

function Execute: Boolean; override;

Description

Execute opens the Print dialog, returning True when the user clicks Print and False when the user clicks Cancel.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog


TPrinter

Hierarchy	Properties	Methods	See also

TPrinter encapsulates the Windows printer interface.

Unit

printers

Description

Use TPrinter to manage any printing performed by an application. Obtain an instance of TPrinter by calling the Printer function in the Printers unit.

To determine how the printed image of the form appears, use the PrintScale property of a TForm component.

A print job is started whenever any rendering is done through a Text variable or the printer’s canvas. This job stays open until EndDoc is called. The title displayed in the Print Manager (and on network header pages) is determined by the Title property. To start a print job, call the BeginDoc method. To end a print job that is sent successfully to the printer, call the EndDoc method. If a problem occurs and you need to terminate a print job that was not sent to the printer successfully, call the Abort method.


TPrinter properties

TPrinter	Alphabetically	Legend

In TPrinter

Aborted

Canvas

Capabilities

Copies

Fonts

Handle

Orientation

PageHeight

PageNumber

PageWidth

PrinterIndex

Printers

Printing

Title


TPrinter properties

TPrinter	By object	Legend

Aborted

Canvas

Capabilities

Copies

Fonts

Handle

Orientation

PageHeight

PageNumber

PageWidth

PrinterIndex

Printers

Printing

Title


TPrinter.Aborted

TPrinter	See also 	Example

Determines if the user aborted the print job, thereby calling the Abort method.

property Aborted: Boolean;

Description

If Aborted is True, the print job was aborted. If it is False, the user did not abort the print job.


TPrinter.Canvas

TPrinter	See also 	Example

Represents the surface of the currently printing page.

property Canvas: TCanvas;

Description

Canvas represents the printing surface of a page. Use the Brush, Font, and Pen properties of the Canvas object to determine how drawing or text appears on the page.

Note:	Some printers do not support graphics. Therefore, the Draw, StretchDraw, or CopyRect methods might fail on these printers.


TPrinter.Capabilities

TPrinter

Indicates the current settings of a printer device driver.

type

  TPrinterCapability = (pcCopies, pcOrientation, pcCollation);

  TPrinterCapabilities = set of TPrinterCapability;

property Capabilities: TPrinterCapabilities;

Description

Capabilities contains the capabilities for the printer, indicating the orientation, number of copies, and whether or not collated is selected.


TPrinter.Copies

TPrinter

Specifies the number of copies printed.

property Copies: Integer;

Description

Copies returns information from the device mode that is set to select the number of copies printed.


TPrinter.Fonts

TPrinter

Lists the fonts supported by the current printer.

property Fonts: TStrings;

Description

Use Fonts to get a list of the fonts supported by the printer. The list contains TrueType fonts even if the printer doesn't support them natively because the Windows Graphics Device Interface (GDI) can draw TrueType fonts accurately when a print job uses them.


TPrinter.Handle

TPrinter 	Example

Provides access to the handle of the printer object.

property Handle: HDC;

Description

Use Handle to gain access to the handle of the printer object.


TPrinter.Orientation

TPrinter 	Example

Determines if the print job prints vertically or horizontally on a page.

type TPrinterOrientation = (poPortrait, poLandscape);

property Orientation: TPrinterOrientation;

Description

Use Orientation to determine if a print job prints in landscape or portrait.

TPrinterOrientation is the type of the Orientation property. These are the possible values for TPrinterOrientation:

Value	Meaning

poPortrait	The job prints vertically on the page.

poLandscape	The job prints horizontally on the page.


TPrinter.PageHeight

TPrinter	See also 	Example

Indicates the height (in pixels) of the currently printing page.

property PageHeight: Integer;

Description

Use PageHeight to find the height in pixels of the currently printing page.


TPrinter.PageNumber

TPrinter	See also 	Example

Indicates the number of the page currently printing.

property PageNumber: Integer;

Description

Use PageNumber to find the page number of the currently printing page.

PageNumber is incremented whenever the NewPage method is called. It is also incremented when a Text variable is written and a CR is encountered on the last line of the page.


TPrinter.PageWidth

TPrinter	See also 	Example

Indicates the value of width (in pixels) of the currently printing page.

property PageWidth: Integer;

Description

Use PageWidth to find the width in pixels of the currently printing page.


TPrinter.PrinterIndex

TPrinter	See also

Specifies which printer listed in the Printers property is the currently selected printer.

property PrinterIndex: Integer;

Description

The value of PrinterIndex is the currently selected printer. If this value is changed, EndDoc is called automatically. To select the default printer, set the value of PrinterIndex to -1.

The list of installed printers is found in the Printers property. The list of fonts supported by the current printer is found in the Fonts property.


TPrinter.Printers

TPrinter	See also

Lists all printers installed in Windows.

property Printers: TStrings;

Description

The list of installed printers is found in the Printers property. The value of the PrinterIndex property is the currently selected printer. The list of fonts supported by the current printer is found in the Fonts property.


TPrinter.Printing

TPrinter	See also 	Example

Indicates whether a print job is printing.

property Printing: Boolean;

Description

Use Printing to determine if a job is printing.

Printing is True when the application has called the BeginDoc method but the EndDoc method (or the Abort method) hasn't yet been called.


TPrinter.Title

TPrinter

Determines the text that is listed in the Print Manager and on network header pages.

property Title: string;

Description

Title is used by Windows in the Print Manager and for network title pages.


TPrinter methods

TPrinter	Alphabetically

In TPrinter

Abort

BeginDoc

Create

Destroy

EndDoc

GetPrinter

NewPage

Refresh

SetPrinter

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TPrinter methods

TPrinter	By object

Abort

AfterConstruction

BeforeDestruction

BeginDoc

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

EndDoc

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetPrinter

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

NewPage

Refresh

SafeCallException

SetPrinter


TPrinter.Abort

TPrinter	See also 	Example

Terminates the printing of a print job, dropping all unprinted data.

procedure Abort;

Description

Use Abort to terminate the print job before it completes; otherwise, use the EndDoc method.

When Abort is called, the device is then set for the next print job.


TPrinter.BeginDoc

TPrinter	See also 	Example

Sends a print job to the printer.

procedure BeginDoc;

Description

Call BeginDoc to initiate a print job. If the print job is sent successfully, the application calls EndDoc to end the print job. The print job won't actually start printing until EndDoc is called.


TPrinter.Create

TPrinter	See also

Creates a printer.

constructor Create;

Description

Never call Create directly. Create is called automatically by the Printer function. Create allocates memory for a printer and calls the inherited Create. Then it sets the correct driver, device, and port.


TPrinter.Destroy

TPrinter	See also

Destroys an instance of a printer.

destructor Destroy; override;

Description

Do not call Destroy directly. The printer object is automatically created and destroyed.

When Destroy is called, it verifies that any currently printing job has ended, then frees resources such as the handle, fonts, and canvas, closes the printer, and calls the inherited Destroy method.


TPrinter.EndDoc

TPrinter	See also 	Example

Ends the current print job and closes the text file variable.

procedure EndDoc;

Description

EndDoc terminates the print job (and closes the currently open Text). The print job will being printing on the printer after a call to EndDoc.

After the application calls EndDoc, the printer begins printing. Use EndDoc after successfully sending a print job to the printer. If the print job isn't successful, use the Abort method.


TPrinter.GetPrinter

TPrinter	See also

Retrieves the current printer.

procedure GetPrinter (ADevice, ADriver, APort: PChar; var ADeviceMode: THandle);

Description

It is not necessary to directly call GetPrinter. Instead, access the printer in the Printers property array. For more information, see the CreateDC function in the Win32 Developer's Reference (WIN32.HLP).


TPrinter.NewPage

TPrinter	See also 	Example

Starts a new page and increments the PageNumber property.

procedure NewPage;

Description

NewPage forces the current print job to begin printing on a new page in the printer.

NewPage increments the value of the PageNumber property. It also resets the value of the Pen property of the Canvas back to (0, 0).


TPrinter.Refresh

TPrinter	See also

Updates the Fonts and Printers properties.

procedure Refresh;

Description

Call Refresh when the installed fonts or printers on the current system may have changed. Refresh clears the internal cache of installed fonts and printers, so that the Fonts and Printers properties are updated when they are next read.


TPrinter.SetPrinter

TPrinter	See also

Specifies a printer as the current printer.

procedure SetPrinter(ADevice, ADriver, APort: PChar; ADeviceMode: THandle);

Description

Do not call SetPrinter directly. Instead, access the printer with the Printers property array. For more information, see the Windows API CreateDC function.


Accessibility

Read-only


Hierarchy

TObject


TPropertyCategory

Hierarchy	Properties	Methods	See also

Contains a list of property filters.

Unit

DsgnIntf

Description

TPropertyCategory contains and maintains a list of TPropertyFilter objects. It defines a number of “as a whole” access and manipulation methods for filters, as well as data about the category itself. TPropertyCategory also supports owner drawing via its PopDraw method.


TPropertyCategory properties

TPropertyCategory	Alphabetically	Legend

In TPropertyCategory

Editor

Filters

MatchCount

Visible


TPropertyCategory properties

TPropertyCategory	By object	Legend

Editor

Filters

MatchCount

Visible


TPropertyCategory.Editor

TPropertyCategory	See also

Indicates the property editor for the property category object.

property Editor: TPropertyEditor

Description

Set Editor to point to an already-existing TPropertyEditor object. Read Editor to get a reference to the property category object’s property editor.


TPropertyCategory.Filters

TPropertyCategory	See also

Provides an indexed collection of filters for a property category object.

property Filters[Index: Integer]: TPropertyFilter

Description

Read Filters to get a reference to one filter associated with a property category object.

Index is an Integer value indicating the filter to reference. Filters is a zero-based collection, so the first filter in the collection is referenced with an index of zero.


TPropertyCategory.MatchCount

TPropertyCategory	See also

Indicates the number of properties in the Object Inspector that fit a filter for this property category.

property MatchCount: Integer

Description

The Object Inspector uses MatchCount to determine how many properties to display within a category.


TPropertyCategory.Visible

TPropertyCategory	See also

Indicates whether properties in the category are visible in the Object Inspector.

property Visible: Boolean

Description

Set Visible to make properties in the category visible or invisible within the Object Inspector.


TPropertyCategory methods

TPropertyCategory	Alphabetically

In TPropertyCategory

Add

ClearMatches

Create

Description

Destroy

FreeEditorGroup

Match

Name

PropDraw

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TPropertyCategory methods

TPropertyCategory	By object

Add

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClearMatches

Create

DefaultHandler

Description

Destroy

Dispatch

FieldAddress

Free

FreeEditorGroup

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

Match

MethodAddress

MethodName

Name

NewInstance

PropDraw

SafeCallException


TPropertyCategory.Add

TPropertyCategory	See also

Adds a new filter to the property category object.

function Add(AFilter: TPropertyFilter): TPropertyFilter;

Description

Call Add to add a new property filter to the property category object.


TPropertyCategory.ClearMatches

TPropertyCategory	See also

Clears all matches established by the Match method.

procedure ClearMatches;

Description

Call ClearMatches to clear all matches established by the last call to the Match method. After matches are cleared, the MatchCount property is reset to zero.


TPropertyCategory.Count

TPropertyCategory	See also

Indicates the number of property filters in the property category object.

function Count: Integer;

Description

Call Count to determine the number of property filters that are contained in the property category object.

Count can form the basis of a loop to sequentially access each of the property filters of the property category object. A counter variable incremented in this loop would be used as the index for the Filters property.

for i := 0 to (PropertyCategory1.Count – 1) do begin

  with PropertyCategory1.Filters[i] do begin

    …

  end;

end;


TPropertyCategory.Create

TPropertyCategory	See also

Creates and initializes a property category.

constructor Create;

Description

The Create method instantiates a TPropertyCategory object.

Create performs the following tasks:

Calls the inherited constructor.

Initializes the list for the Filters property.

Sets the Visible property to True.


TPropertyCategory.Description

TPropertyCategory	See also

Returns the property category’s description.

class function Description: String; virtual;

Description

Call Description to obtain a longer description of the property category than the name that appears in the Object Inspector.


TPropertyCategory.Destroy

TPropertyCategory	See also

Destroys the collection and each item in it.

destructor Destroy; override;

Description

Destroy performs the following tasks:

Destroys the list object used for the Filters property.

Calls the inherited destructor.


TPropertyCategory.FreeEditorGroup

TPropertyCategory	See also

Deletes a group of filters.

procedure FreeEditorGroup(AGroup: Integer);

Description

Call FreeEditorGroup to delete a group of filters. Deletion of a filter group removes the filters from the Filters property.

AGroup is an Integer value indicating the group of filters to delete.


TPropertyCategory.Match

TPropertyCategory	See also

Indicates whether at least one property filter matches a profile.

function Match(const APropertyName: String; AComponentClass: TClass; APropertyType: PTypeInfo): Boolean;

Description

Call Match to determine how many property filters listed in the Filters property meet a matching criteria based on property name, component class, and property type.

APropertyName is is the property name for the property category to match.

AComponentClass is the class reference for the property category to match.

APropertyType is the property type. If AProperty contains a nil value, it is given a value based on the component class type specified in AComponentClass.

Match returns a Boolean value indicating that at least one property filter matched the specified criteria. Match also increments the MatchCount property by the number of property filter matches found.


TPropertyCategory.Name

TPropertyCategory	See also

Returns the name of the property category.

class function Name: String; virtual;

Description

Call Name to obtain the name of the category, as it appears in the Object Inspector.


TPropertyCategory.PropDraw

TPropertyCategory	See also

Draws a property’s value in the Object Inspector.

procedure PropDraw(ACanvas: TCanvas; const ARect: TRect; ASelected: Boolean); dynamic;

Description

Call PropDraw to draw a property’s value in the object inspector. As implemented in TPropertyCategory, PropDraw only writes the property’s name in the Object Inspector. Descendant classes override this behavior to provide custom value drawing capabilities, including text values and graphic representations of the property’s value.

ACanvas is the TCanvas object on which the property’s value is drawn.

ARect is a TRect value indicating the rectangular area within ACanvas that the property’s value is drawn.

ASelected is a Boolean value that indicates whether the property’s value is drawn as selected (a True value) or unselected (a False value) in the Object Inspector. Descendant classes that override PropDraw can perform different property drawing techniques based on ASelected, not limited to just highlighted or unhighlighted text.


Accessibility

Read-only


Hierarchy

TObject


TPropertyCategoryList

Hierarchy	Properties	Methods	See also

Contains a list of property categories.

Unit

DsgnIntf

Description

TPropertyCategoryList contains and maintains a list of TPropertyCategory objects. It defines a number of “as a whole” access and manipulation methods for property categories, as well as simplified access methods.


TPropertyCategoryList properties

TPropertyCategoryList	Alphabetically	Legend

In TPropertyCategoryList

Categories

HiddenCategories


TPropertyCategoryList properties

TPropertyCategoryList	By object	Legend

Categories

HiddenCategories


TPropertyCategoryList.Categories

TPropertyCategoryList	See also

Provides an indexed collection of property categories in the property category list object.

property Categories[Index: Integer]: TPropertyCategory;

Description

Read Filters to get a reference to one property category object associated with the property category list object.

Index is an Integer value indicating the property category to reference. Categories is a zero-based array, so the first property category in the collection is referenced with an index of zero.


TPropertyCategoryList.HiddenCategories

TPropertyCategoryList	See also

Hides property categories specified in a list.

property HiddenCategories: String

Description

Set HiddenCategories to a list of property categories to hide. Separate the individual category names in the list with semi-colons. Read HiddenCategories to get a semi-colon separated list of the categories in the property category list that are currently hidden.

Setting HiddenCategories causes the Visible property for each property category that has a name the same as one supplied in the semi-colon separated list


TPropertyCategoryList methods

TPropertyCategoryList	Alphabetically

In TPropertyCategoryList

ChangeVisibility

ClearMatches

Count

Create

Destroy

FindCategory

FreeEditorGroup

IndexOf

Match

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TPropertyCategoryList methods

TPropertyCategoryList	By object

AfterConstruction

BeforeDestruction

ChangeVisibility

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClearMatches

Count

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

FindCategory

Free

FreeEditorGroup

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

IndexOf

InheritsFrom

InitInstance

InstanceSize

Match

MethodAddress

MethodName

NewInstance

SafeCallException


TPropertyCategoryList.ChangeVisibility

TPropertyCategoryList

Changes the visibility of the property categories associated with the property category list.

TPropertyCategoryVisibleMode = (pcvAll, pcvToggle, pcvNone, pcvNotListed, pcvOnlyListed);

function ChangeVisibility(AMode: TPropertyCategoryVisibleMode): Boolean; overload;

function ChangeVisibility(AMode: TPropertyCategoryVisibleMode; const AClasses: array of TClass): Boolean; overload;

Description

Call ChangeVisibility to change the visibility of property categories associated with the property category list. Used in the first form, ChangeVisibility affects all property categories. Used in the second form, effects are limited to just those of the same class as specified in AClasses.

AMode is scope of the effects of the visibility change.

AClasses is an array of class types. Only those property categories of a class type that matches one in this array are affected by the call to ChangeVisibility.

ChangeVisibility returns a Boolean value that indicates whether the visibility of any categories is changed. If the visibility of at least one category is changed, ChangeVisibility returns True, otherwise it returns False.


TPropertyCategoryList.ClearMatches

TPropertyCategoryList	See also

Clears all matches established by the Match method.

procedure ClearMatches;

Description

Call ClearMatches to clear all filter matches in all property categories associated with the property category list object.


TPropertyCategoryList.Count

TPropertyCategoryList	See also

Indicates the number of property categories in the property category list object.

function Count: Integer;

Description

Call Count to determine the number of property categories that are contained in the property category list object.

Count can form the basis of a loop to sequentially access each of the property categories of the property category list object. A counter variable incremented in this loop would be used as the index for the Categories property.

for i := 0 to (PropertyCategoryList1.Count – 1) do

  ListBox1.Items.Add(Categories[i].Name);


TPropertyCategoryList.Create

TPropertyCategoryList	See also

Creates and initializes a property category list.

constructor Create;;

Description

Create performs the following tasks:

Calls the inherited constructor.

Initializes the list for the Categories property.


TPropertyCategoryList.Destroy

TPropertyCategoryList	See also

Destroys the collection and each item in it.

destructor Destroy; override;

Description

Destroy performs the following tasks:

Destroys the list object used for the Categories property.

Calls the inherited destructor.


TPropertyCategoryList.FindCategory

TPropertyCategoryList	See also

Returns a property category object given its class type.

TPropertyCategoryClass = class of TPropertyCategory;

function FindCategory(ACategoryClass: TPropertyCategoryClass): TPropertyCategory;

Description

Call FindCategory to get a reference to a property category object based on the property category’s class type. If the requested property category does not already exist a new property category object is created, the new category is added to the list, and a reference to the new category is used for the return value.

ACategoryClass is the class type for the property category to reference.


TPropertyCategoryList.FreeEditorGroup

TPropertyCategoryList	See also

Deletes a group of filters in associated property category objects.

procedure FreeEditorGroup(AGroup: Integer);

Description

Call FreeEditorGroup to delete a specific group of filters in every property category object associated with the property category list object. For any given property category, one of two things happen, depending on the group value specified in AGroup. If AGroup matches the group identifier for the property category, then the property category is removed from the category list. If the group identifier does not match, all filters in the property category are deleted.


TPropertyCategoryList.IndexOf

TPropertyCategoryList	See also

Finds the index number of a property category.

TPropertyCategoryClass = class of TPropertyCategory;

function IndexOf(ACategoryClass: TPropertyCategoryClass): Integer; overload;

function IndexOf(const ACategoryName: String): Integer; overload;

Description

Call IndexOf to determine the index number of a property category. IndexOf returns the index number of the first property category in the category list that matches the specified criteria. When IndexOf is used in one form, the criteria are based on property category class types. Used in its second form, the criteria are based on property category names. If no property category exists that matches the criteria, IndexOf returns –1.

ACategoryClass is class type of the property category for which an index is desired.

ACategoryName is name of the property category for which an index is desired.

The value returned can be used for such purposes as the index for the Categories property or just to determine whether a particular property category exists at all.


TPropertyCategoryList.Match

TPropertyCategoryList	See also

Identifies property categories matching a specified criteria.

function Match(const APropertyName: String; AComponentClass: TClass; APropertyType: PTypeInfo = nil): Boolean;

Description

Call Match to determine whether property categories in the category list object have filters that meet matching criteria based on property name, component class, and property type.

APropertyName is is the property name for the property category to match.

AComponentClass is the class reference for the property category to match.

APropertyType is the property type. If AProperty contains a nil value, it is given a value based on the component class type specified in AComponentClass.

Match returns True if at least one property category has at least one property filter that matches the criteria and that property category is currently visible.


Accessibility

Read-only


Hierarchy

TObject


TPropertyEditor

Hierarchy	Properties	Methods	See also

TPropertyEditor is the base class for all property editors.

Unit

dsgnintf

Description

Use TPropertyEditor or one of its descendants as a base class when defining a property editor for a specialized property in a new component class. TPropertyEditor has several descendants that can be used to set the values of properties with simple types. Create specialized property editors to allow users to set more complicated property values from the Object Inspector.

Individual descendants of TPropertyEditor are displayed based on the type of the property being edited. Individual property editors can be associated with all properties of a specified type, or with a particular property of a particular component class. To create the association between a property editor and a property type, call RegisterPropertyEditor. Once the property editor is registered, it appears when the user attempts to edit an appropriate property using the Object Inspector.


TPropertyEditor properties

TPropertyEditor	Alphabetically 	Legend

In TPropertyEditor

Designer

PrivateDirectory

PropCount

Value


TPropertyEditor properties

TPropertyEditor	By object 	Legend

Designer

PrivateDirectory

PropCount

Value


TPropertyEditor.Designer

TPropertyEditor

Provides access to the form designer object in the IDE.

property Designer: IFormDesigner;

Description

Use Designer to read from or make changes to the current form or module in the IDE. The IFormDesigner interface has methods that can access the components in the current unit and other units linked in by the uses clause, create or alter the methods in the current unit, and so on.


TPropertyEditor.PrivateDirectory

TPropertyEditor

Specifies the location where the property editor can store auxiliary files.

property PrivateDirectory: string;

Description

Use PrivateDirectory to store executables used by the property editor or auxiliary files that store state information, examples, templates, and so on. PrivateDirectory is the location specified in the registry under the key

HKEY_CURRENT_USER\Software\Borland\Delphi\x.0\Globals\PrivateDir

The property editor can use the directory to read files, write files, or store .DLLs and executables.


TPropertyEditor.PropCount

TPropertyEditor	See also

Indicates the number of components whose properties are being edited.

property PropCount: Integer;

Description

Use PropCount to determine the valid range of indexes to use when calling the GetComponent method. This value corresponds to the number of components selected when the property editor is created. Typically, it is not necessary to access individual components because the Getxxx and Setxxx methods propagate values appropriately.


TPropertyEditor.Value

TPropertyEditor	See also

Represents the current value of the property (as returned by GetValue) as a string.

property Value: string;

Description

Read Value to determine the current property setting as it is displayed in the Object Inspector. Set Value to apply a value to all selected components for which the property is appropriate.

The Value property is implemented using the GetValue and SetValue methods. Descendants of TPropertyEditor must override these methods to implement the Value property.


TPropertyEditor methods

TPropertyEditor	Alphabetically 	Legend

In TPropertyEditor

Activate

AllEqual

AutoFill

Destroy

Edit

GetAttributes

GetComponent

GetEditLimit

GetFloatValue

GetFloatValueAt

GetInt64Value

GetInt64ValueAt

GetMethodValue

GetMethodValueAt

GetName

GetOrdValue

GetOrdValueAt

GetProperties

GetPropInfo

GetPropType

GetStrValue

GetStrValueAt

GetValue

GetValues

GetVarValue

GetVarValueAt

Initialize

ListDrawValue

ListMeasureHeight

ListMeasureWidth

Modified

Revert

SetFloatValue

SetInt64Value

SetMethodValue

SetOrdValue

SetStrValue

SetValue

SetVarValue

ValueAvailable

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TPropertyEditor methods

TPropertyEditor	By object 	Legend

Activate

AfterConstruction

AllEqual

AutoFill

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

Edit

FieldAddress

Free

FreeInstance

GetAttributes

GetComponent

GetEditLimit

GetFloatValue

GetFloatValueAt

GetInt64Value

GetInt64ValueAt

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetMethodValue

GetMethodValueAt

GetName

GetOrdValue

GetOrdValueAt

GetProperties

GetPropInfo

GetPropType

GetStrValue

GetStrValueAt

GetValue

GetValues

GetVarValue

GetVarValueAt

InheritsFrom

Initialize

InitInstance

InstanceSize

ListDrawValue

ListMeasureHeight

ListMeasureWidth

MethodAddress

MethodName

Modified

NewInstance

Revert

SafeCallException

SetFloatValue

SetInt64Value

SetMethodValue

SetOrdValue

SetStrValue

SetValue

SetVarValue

ValueAvailable


TPropertyEditor.Activate

TPropertyEditor	See also

Responds when the property is selected in the Object Inspector.

procedure Activate; virtual;

Description

Do not call the Activate method. It is called automatically when the property is selected. TPropertyEditor.Activate does nothing. Override this method to determine attributes of the property dynamically when the property editor is displayed in the Object Inspector.

Before Activate is called, the GetAttributes method does not need to provide accurate information about any attributes other than paSubProperties and paMultiSelect. Any other attributes can be computed in an override of the Activate method and stored so that subsequent calls to GetAttributes can provide accurate information.


TPropertyEditor.AllEqual

TPropertyEditor	See also

Indicates whether all selected components have the same value for the property.

function AllEqual: Boolean; virtual;

Description

The Object Inspector calls AllEqual when there is more than one component selected to determine whether a value should appear for this property. If this method returns True, the Object Inspector displays a value for the property. If this method returns False, the line for the property in the Object Inspector remains blank.

TPropertyEditor.AllEqual always returns False if more than one selected component has the associated property. Override this method to check the properties of individual components and determine whether a property value can be displayed in the Object Inspector.

Note:	AllEqual is called only when the value returned by GetAttributes includes paMultiSelect.


TPropertyEditor.AutoFill

TPropertyEditor	See also

Returns True to indicate that values can be typed incrementally—and automatically completed—in the Object Inspector.

function AutoFill: Boolean; virtual;

If GetAttributes returns paValueList, AutoFill is called to verify that automatic typing completion is permitted. If AutoFill returns True, the Object Inspector uses the values provided by GetValues to fill in partially typed entries. For example, if the legal values for a property are prSmall and prLarge, the user can type “prS” and the Object Inspector automatically fills in “prSmall.”

AutoFill always returns True. But descendant property editors can override AutoFill to disable automatic completion of property values.


TPropertyEditor.Destroy

TPropertyEditor	See also

Destroys an instance of TPropertyEditor.

destructor Destroy; override;

Description

Do not call Destroy. The Object Inspector destroys the property editor automatically when it is finished.

Destroy frees the internal objects used to store information about the selected components and their property settings. Override Destroy to free any other internal structures created by the property editor.


TPropertyEditor.Edit

TPropertyEditor	See also

Responds when the user double-clicks the property in the Object Inspector.

procedure Edit; virtual;

Description

The Object Inspector calls Edit when the ellipsis button (...) is pressed or the property is double-clicked. The Edit method of TPropertyEditor cycles through the possible enumerated values of the property when the GetValues method returns one or more property strings to the callback method.

Override the Edit method to implement a response to the ellipsis button or double-clicking the property. For example, use the Edit method to bring up a dialog for editing the property in some more meaningful fashion than typing a text value in the Object Inspector.


TPropertyEditor.GetAttributes

TPropertyEditor	See also

Describes the property so the Object Inspector provides the appropriate controls.

type

  TPropertyAttribute = (paValueList, paSubProperties, paDialog, paMultiSelect, paAutoUpdate, paSortList, paReadOnly, paRevertable, paOwnerDrawList);

  TPropertyAttributes = set of TPropertyAttribute;

function GetAttributes: TPropertyAttributes; virtual;

Description

The Object Inspector calls GetAttributes to determine what controls to display for the property and what property editor methods to call. The GetAttributes method of TPropertyEditor returns [paMultiSelect, paRevertable]. Override GetAttributes to return the set of values that corresponds to the attributes of the associated property.

GetAttributes returns a set drawn from the following values.

Value	Meaning
paValueList	The property editor can return an enumerated list of values for the property. When paValueList is set, the GetValues method should be overridden to provide the enumerated values. When paValueList is set, the Object Inspector displays a drop-down button to the right of the property.
paSortList	The Object Inspector should sort the list returned by GetValues.
paSubProperties	The property has subproperties that are displayed indented and below the current property in standard outline format. If paSubProperties is set, the GetProperties method should be overridden to provide subproperties.
paDialog	The Edit method brings up a dialog. When paDialog is set, the Object Inspector displays an ellipsis button to the right of the property.
paMultiSelect	The property can be displayed when more than one component is selected.
paAutoUpdate	The SetValue method is called on each change made to the editor rather than after the change has been approved.
paReadOnly	Value is not allowed to change.
paRevertable	The property editor can restore the property value to the original value. Properties that shouldn't be reverted are nested properties such as fonts and elements of composite properties such as set element values.
paOwnerDrawList	The property editor can provide an owner draw list of property values that the Object Inspector displays. Use paOwnerDrawList in combination with paValueList. When paOwnerDrawList is set, the ListDrawValue method should draw individual list items on a canvas supplied by the Object Inspector, and the ListMeasureHeight and ListMeasureWidth methods should indicate the dimension required to draw each item.
Before the Object Inspector calls the Activate method, GetAttributes does not need to provide accurate information about any attributes other than paSubProperties and paMultiSelect.


TPropertyEditor.GetComponent

TPropertyEditor	See also

Returns the specified object from the set of all components currently being edited by the property editor.

function GetComponent(Index: Integer): TPersistent;

Description

Call GetComponent to access any of the objects with a property currently being edited by the property editor. The Index parameter is used to specify individual components in the internal list maintained by the property editor. Index should be a value between 0 and PropCount - 1, inclusive.

Use GetComponent to iterate over all objects currently being edited.


TPropertyEditor.GetEditLimit

TPropertyEditor	See also

Returns the maximum length, in characters, of the Value property.

function GetEditLimit: Integer; virtual;

Description

The Object Inspector calls GetEditLimit to determine how many characters the user can type when entering a value for the property. GetEditLimit returns 255. Override this method when the maximum length of the property string is some other value.


TPropertyEditor.GetFloatValue

TPropertyEditor	See also

Returns the property value of the first object currently being edited.

function GetFloatValue: Extended;

Description

Call GetFloatValue to obtain the current value of the property for the first object in the internal list of objects being edited. Call GetFloatValue only if the property is a float type.

If more than one object is currently being edited, GetFloatValue returns the value for the object returned by GetComponent(0). To obtain the current property value for every object currently being edited, use the GetFloatValueAt method.


TPropertyEditor.GetFloatValueAt

TPropertyEditor	See also

Returns the property value of the specified object.

function GetFloatValueAt(Index: Integer): Extended;

Description

Call GetFloatValueAt to obtain the current value of the property for an object in the internal list of objects being edited. Call GetFloatValueAt only if the property is a float type. The Index parameter identifies which object’s value should be returned. It corresponds to the Index parameter of the GetComponent method.

Use GetFloatValueAt to iterate over all current values, for example when implementing the AllEqual method.


TPropertyEditor.GetInt64Value

TPropertyEditor	See also

Returns the property value of the first object currently being edited.

function GetInt64Value: Int64;

Description

Call GetInt64Value to obtain the current value of the property for the first object in the internal list of objects being edited. Call GetInt64Value only if the property is 64-bit integer type.

If more than one object is currently being edited, GetInt64Value returns the value for the object returned by GetComponent(0). To obtain the current property value for every object currently being edited, use the GetInt64ValueAt method.


TPropertyEditor.GetInt64ValueAt

TPropertyEditor	See also

Returns the property value of the specified object.

function GetInt64ValueAt(Index: Integer): Int64;

Description

Call GetInt64ValueAt to obtain the current value of the property for an object in the internal list of objects being edited. Call GetInt64ValueAt only if the property is a 64-bit integer type. The Index parameter identifies which object’s value should be returned. It corresponds to the Index parameter of the GetComponent method.

Use GetInt64ValueAt to iterate over all current values, for example when implementing the AllEqual method.


TPropertyEditor.GetMethodValue

TPropertyEditor	See also

Returns the property value of the first object currently being edited.

function GetMethodValue: TMethod;

Description

Call GetMethodValue to obtain the current value of the property for the first object in the internal list of objects being edited. Call GetMethodValue only if the property is a method, such as the DefWndProc property of TWinControl or an event handler.

If more than one object is currently being edited, GetMethodValue returns the value for the object returned by GetComponent(0). To obtain the current property value for every object currently being edited, use the GetMethodValueAt method.


TPropertyEditor.GetMethodValueAt

TPropertyEditor	See also

Returns the property value of the specified object.

function GetMethodValueAt(Index: Integer): TMethod;

Description

Call GetMethodValueAt to obtain the current value of the property for an object in the internal list of objects being edited. Call GetMethodValueAt only if the property is a method, such as the DefWndProc property of TWinControl or an event handler. The Index parameter identifies which object’s value should be returned. It corresponds to the Index parameter of the GetComponent method.

Use GetMethodValueAt to iterate over all current values, for example when implementing the AllEqual method.


TPropertyEditor.GetName

TPropertyEditor

Returns the name of the property.

function GetName: string; virtual;

Description

The Object Inspector calls GetName to obtain the property name as it should appear in the Object Inspector. GetName returns the name of the property from the property type information with all underbars replaced by spaces. Override this method if the Object Inspector should display a string other than the property name.


TPropertyEditor.GetOrdValue

TPropertyEditor	See also

Returns the property value of the first object currently being edited.

function GetOrdValue: Longint;

Description

Call GetOrdValue to obtain the current value of the property for the first object in the internal list of objects being edited. Call GetOrdValue only if the property is an ordinal type.

If more than one object is currently being edited, GetOrdValue returns the value for the object returned by GetComponent(0). To obtain the current property value for every object currently being edited, use the GetOrdValueAt method.


TPropertyEditor.GetOrdValueAt

TPropertyEditor	See also

Returns the property value of the specified object.

function GetOrdValueAt(Index: Integer): Longint;

Description

Call GetOrdValueAt to obtain the current value of the property for an object in the internal list of objects being edited. Call GetOrdValueAt only if the property is an ordinal type. The Index parameter identifies which object’s value should be returned. It corresponds to the Index parameter of the GetComponent method.

Use GetOrdValueAt to iterate over all current values, for example when implementing the AllEqual method.


TPropertyEditor.GetProperties

TPropertyEditor	See also

Provides the subproperties of the property to a callback procedure.

type

  TGetPropEditProc = procedure(Prop: TPropertyEditor) of object;

procedure GetProperties(Proc: TGetPropEditProc); virtual;

Description

The Object Inspector calls GetProperties when the property is expanded to show sub-properties. The GetProperties method of TPropertyEditor does nothing. Property editors that return paSubProperties from the GetAttributes method should override GetProperties to create an appropriate property editor and pass it to the Proc parameter for every sub-property (or nested property) of the property.


TPropertyEditor.GetPropInfo

TPropertyEditor	See also

Returns the property information record for the object being edited.

type

  TTypeKind = (tkUnknown, tkInteger, tkChar, tkEnumeration, tkFloat, tkString, tkSet, tkClass, tkMethod, tkWChar, tkLString, tkWString, tkVariant, tkArray, tkRecord, tkInterface);

  PPTypeInfo = ^PTypeInfo;

  PTypeInfo = ^TTypeInfo;

  TTypeInfo = record

    Kind: TTypeKind;

    Name: ShortString;

  end;

  PPropInfo = ^TPropInfo;

  TPropInfo = packed record

    PropType: PPTypeInfo;

    GetProc: Pointer;

    SetProc: Pointer;

    StoredProc: Pointer;

    Index: Integer;

    Default: Longint;

    NameIndex: SmallInt;

    Name: ShortString;

  end;

function GetPropInfo: PPropInfo;

Description

Call GetPropInfo to access the property information record that describes the property being edited and its access functions. If more than one object is being edited, GetPropInfo returns the property information record for the object returned by GetComponent(0).

If only the type information record is desired (indirectly pointed to by the PropType field), use the GetPropType method instead.


TPropertyEditor.GetPropType

TPropertyEditor	See also

Returns the type information record for the object being edited.

type

  TTypeKind = (tkUnknown, tkInteger, tkChar, tkEnumeration, tkFloat, tkString, tkSet, tkClass, tkMethod, tkWChar, tkLString, tkWString, tkVariant, tkArray, tkRecord, tkInterface);

  PTypeInfo = ^TTypeInfo;

  TTypeInfo = record

    Kind: TTypeKind;

    Name: ShortString;

  end;

function GetPropType: PTypeInfo;

Description

Call GetPropType to obtain access to the type information record that describes the property being edited.  If more than one object is being edited, GetPropType returns the type information record for the object returned by GetComponent(0).

If information about the property access functions and storage details is desired as well, use the GetPropInfo method instead.


TPropertyEditor.GetStrValue

TPropertyEditor	See also

Returns the property value of the first object currently being edited.

function GetStrValue: string;

Description

Call GetStrValue to obtain the current value of the property for the first object in the internal list of objects being edited. Only call GetStrValue if the property is a string type.

If more than one object is currently being edited, GetStrValue returns the value for the object returned by GetComponent(0); To obtain the current property value for every object currently being edited, use the GetStrValueAt method.


TPropertyEditor.GetStrValueAt

TPropertyEditor	See also

Returns the property value of the specified object.

function GetStrValueAt(Index: Integer): string;

Description

Call GetStrValueAt to obtain the current value of the property for an object in the internal list of objects being edited. Call GetStrValueAt only if the property is an ordinal type. The Index parameter identifies which object’s value should be returned. It corresponds to the Index parameter of the GetComponent method.

Use GetStrValueAt to iterate over all current values, for example when implementing the AllEqual method.


TPropertyEditor.GetValue

TPropertyEditor	See also

Returns the value string displayed by the Object Inspector.

function GetValue: string; virtual;

Description

The Object Inspector calls GetValue to obtain the string it uses to display the property value. TPropertyEditor.GetValue returns the string '(unknown)'. Override this method to provide an appropriate string for the value currently represented in the object inspector.

GetValue is called to read the Value property.


TPropertyEditor.GetValues

TPropertyEditor	See also

Provides the enumerated values of the property to a callback procedure.

procedure GetValues(Proc: TGetStrProc); virtual;

Description

The Object Inspector calls GetValues when the drop-down button is clicked to show enumerated values. The GetValues method of TPropertyEditor does nothing. Property editors that return paValueList from the GetAttributes method should override GetValues to call the Proc parameter for every string that can represent a valid enumerated value. Even if the GetAttributes method does not return paValueList, property editors for enumerated types should still override GetValues to enumerate all possible values.


TPropertyEditor.GetVarValue

TPropertyEditor	See also

Returns the property value of the first object currently being edited.

function GetVarValue: Variant;

Description

Call GetVarValue to obtain the current value of the property for the first object in the internal list of objects being edited. Call GetVarValue only if the property value can be represented by a variant.

If more than one object is currently being edited, GetVarValue returns the value for the object returned by GetComponent(0); To obtain the current property value for every object currently being edited, use the GetVarValueAt method.


TPropertyEditor.GetVarValueAt

TPropertyEditor	See also

Returns the property value of the specified object.

function GetVarValueAt(Index: Integer): Variant;

Description

Call GetVarValueAt to obtain the current value of the property for an object in the internal list of objects being edited. Call GetVarValueAt only if the property value can be represented as a variant. The Index parameter identifies which object’s value should be returned. It corresponds to the Index parameter of the GetComponent method.

Use GetVarValueAt to iterate over all current values, for example when implementing the AllEqual method.


TPropertyEditor.Initialize

TPropertyEditor	See also

Initializes the property editor after it is created but before it is used.

procedure Initialize; virtual;

Description

Do not call the Initialize method. It is called automatically by the Object Inspector to allow property editors to perform any necessary initialization before they are used. The Initialize method of TPropertyEditor does nothing. Override the Initialize method to perform any special initialization, such as the creation of helper objects.

Property editors are often created and discarded without being used because they do not represent a common property across all selected components. Since Initialize is called only after it is determined that the property editor will be used, it is more efficient to initialize property values and create helper objects in the Initialize method rather than the constructor.


TPropertyEditor.ListDrawValue

TPropertyEditor	See also

Draws a list entry for a property value on a canvas supplied by the Object Inspector.

procedure ListDrawValue(const Value: string; Canvas: TCanvas; Rect: TRect; Selected: Boolean); virtual;

Description

The Object Inspector calls ListDrawValue when it needs to render the list item for a particular property value. This method is never called unless the GetAttributes method returns a set that includes paOwnerDrawList.

As implemented in TPropertyEditor, ListDrawValue displays the value string vertically centered in the supplied rectangle. Override this method to enable the property editor to customize the appearance of the drop-down list for the property values.

The Value parameter is the string representation of the value being rendered. This is the same as the string returned by GetValue when the Selected parameter is True.

The Canvas parameter specifies the drawing surface where ListDrawValue should render the image for the property value.

The Rect parameter indicates the coordinates on Canvas where the image should be drawn. The height and width of Rect is determined by the values returned by ListMeasureHeight and ListMeasureWidth.

The Selected parameter indicates whether this list value represents the currently selected property value.


TPropertyEditor.ListMeasureHeight

TPropertyEditor	See also

Calculates the height of an owner-draw list entry.

procedure ListMeasureHeight(const Value: string; Canvas: TCanvas; var AHeight: Integer); virtual;

Description

The Object Inspector calls ListMeasureHeight when calculating the dimensions of the drop-down list that displays owner-drawn property values. This method is never called unless the GetAttributes method returns a set that includes paOwnerDrawList.

As implemented in TPropertyEditor, ListMeasureHeight does nothing. Override this method to enable the property editor to customize the appearance of the drop-down list for the property values.

The Value parameter is the string representation of the value being measured.

The Canvas parameter specifies the drawing surface on which the list is drawn. Use its methods to determine the height required to render the property value.

The AHeight parameter indicates the height, in pixels, that is used for this item in the drop-down list. On entry to ListMeasureHeight, this value is initialized to a standard height. Change this value to indicate that the Object Inspector should use a different height when drawing this item.


TPropertyEditor.ListMeasureWidth

TPropertyEditor	See also

Calculates the width required by an owner-draw list entry.

procedure ListMeasureWidth(const Value: string; Canvas: TCanvas; var AWidth: Integer); virtual;

Description

The Object Inspector calls ListMeasureWidth when calculating the dimensions of the drop-down list that displays owner-drawn property values. This method is never called unless the GetAttributes method returns a set that includes paOwnerDrawList.

As implemented in TPropertyEditor, ListMeasureWidth does nothing. Override this method to enable the property editor to customize the appearance of the drop-down list for the property values.

The Value parameter is the string representation of the value being measured.

The Canvas parameter specifies the drawing surface on which the list is drawn. Use its methods to determine the width required to render the property value.

The AWidth parameter indicates the width, in pixels, that is needed for this item in the drop-down list. On entry to ListMeasureWidth, this value is initialized to a standard width. Change this value to indicate that the Object Inspector needs to use a different width when drawing this item.


TPropertyEditor.Modified

TPropertyEditor	See also

Informs the designer that the property value has changed.

procedure Modified;

Description

Call Modified after changing the property value so that the designer is aware that something has changed.

It is not necessary to call Modified if changes are made using the SetFloatValue, SetMethodValue, SetOrdValue, SetStrValue, or SetVarValue methods. These methods automatically call Modified.


TPropertyEditor.Revert

TPropertyEditor	See also

Restores all object properties to their original values.

procedure Revert;

Description

Call Revert to restore the original property values that each of the edited objects had before the user began making modification with the Object Inspector. Revert will not work if GetAttributes returns paAutoUpdate.


TPropertyEditor.SetFloatValue

TPropertyEditor	See also

Changes the property value for every object being edited.

procedure SetFloatValue(Value: Extended);

Description

Call SetFloatValue to change the property setting for every object that can be returned by the GetComponent method. Do not call SetFloatValue unless the property editor represents a float value. After changing a property value using SetFloatValue, it is not necessary to call Modified.


TPropertyEditor.SetInt64Value

TPropertyEditor	See also

Changes the property value for every object being edited.

procedure SetInt64Value(Value: Int64);

Description

Call SetInt64Value to change the property setting for every object that can be returned by the GetComponent method. Do not call SetInt64Value unless the property editor represents a 64-bit integer value. After changing a property value using SetInt64Value, it is not necessary to call Modified.


TPropertyEditor.SetMethodValue

TPropertyEditor	See also

Changes the property value for every object being edited.

procedure SetMethodValue(const Value: TMethod);

Description

Call SetMethodValue to change the property setting for every object that can be returned by the GetComponent method. Do not call SetMethodValue unless the property represents a method. After changing a property value using SetMethodValue, it is not necessary to call Modified.


TPropertyEditor.SetOrdValue

TPropertyEditor	See also

Changes the property value for every object being edited.

procedure SetOrdValue(Value: Longint);

Description

Call SetOrdValue to change the property setting for every object that can be returned by the GetComponent method. Do not call SetOrdValue unless the property represents an ordinal value. After changing a property value using SetOrdValue, it is not necessary to call Modified.


TPropertyEditor.SetStrValue

TPropertyEditor	See also

Changes the property value for every object being edited.

procedure SetStrValue(const Value: string);

Description

Call SetStrValue to change the property setting for every object that can be returned by the GetComponent method. Do not call SetStrValue unless the property represents a string value. After changing a property value using SetStrValue, it is not necessary to call Modified.


TPropertyEditor.SetValue

TPropertyEditor	See also

Responds when the user changes the value of the property.

procedure SetValue(const Value: string); virtual;

Description

Do not call SetValue. It is called automatically by the object inspector when the user has finished changing the property value. The SetValue method for TPropertyEditor does nothing. Descendant classes override SetValue to apply the value entered by the user (represented by the Value parameter) to all components that can be returned by the GetComponent method.

For many property editors, SetValue need only translate the Value string into an appropriate value and call SetFloatValue, SetMethodValue, SetOrdValue, SetStrValue, or SetVarValue. For properties that do not correspond to a float, method, ordinal, string, or variant, however, SetValue must directly propagate the new value to every component and then call the Modified method. If the value can’t be set, SetValue should raise an exception that describes the problem.

Note:	If the property is changed only through a dialog brought up by the Edit method, SetValue need not be overridden.


TPropertyEditor.SetVarValue

TPropertyEditor	See also

Changes the property value for every object being edited.

procedure SetVarValue(const Value: Variant);

Description

Call SetVarValue to change the property setting for every object that can be returned by the GetComponent method. Do not call SetVarValue unless the property can be represented by a variant value. After changing a property value using SetVarValue, it is not necessary to call Modified.


TPropertyEditor.ValueAvailable

TPropertyEditor	See also

Indicates whether all components being edited have a value for the property if their ComponentStyle includes csCheckPropAvail.

function ValueAvailable: Boolean;

Description

The Object Inspector calls ValueAvailable to determine which components can be edited for a particular property or which properties can be displayed for a particular component.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject


TPropertyFilter

Hierarchy	Properties	Methods	See also

Contains information about a single property filter.

Unit

DsgnIntf

Description

TPropertyFilter contains and maintains the information about a single filter associated with a property category. It also encapsulates the matching algorithm.


TPropertyFilter properties

TPropertyFilter	Alphabetically	Legend

In TPropertyFilter

ComponentClass

PropertyType


TPropertyFilter properties

TPropertyFilter	By object	Legend

ComponentClass

PropertyType


TPropertyFilter.ComponentClass

TPropertyFilter	See also

Indicates the class type the property filter is associated with.

property ComponentClass: TClass

Description

Read ComponentClass at runtime to determine class type with which the property filter is associated.


TPropertyFilter.PropertyType

TPropertyFilter	See also

Provides the property information record for the property.

property PropertyType: PTypeInfo

Description

Provides the property information record for the property.

Call GetPropInfo to obtain access to the property information record that describes the property being edited and its access functions.


TPropertyFilter methods

TPropertyFilter	Alphabetically

In TPropertyFilter

Create

Destroy

Match

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TPropertyFilter methods

TPropertyFilter	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

Match

MethodAddress

MethodName

NewInstance

SafeCallException


TPropertyFilter.Create

TPropertyFilter	See also

Creates and initializes a property filter.

constructor Create(const APropertyName: String; AComponentClass: TClass; APropertyType: PTypeInfo)

Description

Create performs the following tasks:

Calls the inherited constructor.

Checks APropertyName for a blank value and, if it is, creates a default property name.

Sets the ComponentClass property to the class type specified in AComponentClass.

Sets the PropertyType property to the property type specified in APropertyType.

Designates the new property filter as being in the current group.

After instantiating a new property filter, add it to a TPropertyCategory object’s list using the TPropertyCategory.Add method.


TPropertyFilter.Destroy

TPropertyFilter	See also

Destroys the collection and each item in it.

destructor Destroy; override;

Description

Destroy performs the following tasks:

Destroys the property name mask.

Calls the inherited destructor.


TPropertyFilter.Match

TPropertyFilter	See also

Indicates whether the property filter matches a profile.

function Match(const APropertyName: String; AComponentClass: TClass; APropertyType: PTypeInfo): Boolean;

Description

Call Match to determine whether the property filter contains specific property name, component class, and property type values.

APropertyName is is the property name for the property category to match.

AComponentClass is the class reference for the property category to match.

APropertyType is the property type. If AProperty contains a nil value, it is given a value based on the component class type specified in AComponentClass.

Match returns True if:

The filter’s property name value is the same as that specified in APropertyName.

The filter’s ComponentClass value is the same as or is an ancestor class of the class specified in AComponentClass.

The filter’s PropertyType is the same as that specified in APropertyType. If the property a filter represents is a class type, a match requires PropertyType be the same as or an ancestor class of the property type specified in APropertyType.


Accessibility

Read-only


Hierarchy

TObject


 TPrinterSetupDialog

Hierarchy	Properties	Methods	Events	See also

TPrinterSetupDialog displays a print-setup dialog for configuring printers.

Unit

dialogs

Description

TPrinterSetupDialog displays a modal Windows dialog box for configuring printers. The contents of the dialog vary depending on the printer driver selected.

The dialog does not appear at runtime until it is activated by a call to the Execute method.


TPrinterSetupDialog properties

TPrinterSetupDialog	Alphabetically	Legend

Derived from TCommonDialog

Ctl3D

Handle

HelpContext

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TPrinterSetupDialog properties

TPrinterSetupDialog	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Ctl3D

DesignInfo

Handle

HelpContext

Name

Owner

Tag

VCLComObject


TPrinterSetupDialog events

TPrinterSetupDialog	Alphabetically	Legend

Derived from TCommonDialog

OnClose

OnShow


TPrinterSetupDialog events

TPrinterSetupDialog	By object	Legend

OnClose

OnShow


TPrinterSetupDialog methods

TPrinterSetupDialog	Alphabetically

In TPrinterSetupDialog

Execute

Derived from TCommonDialog

Create

DefaultHandler

Destroy

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPrinterSetupDialog methods

TPrinterSetupDialog	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Execute

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TPrinterSetupDialog.Execute

TPrinterSetupDialog

Displays the printer configuration dialog box.

function Execute: Boolean; override;

Description

Execute opens the print-setup dialog. If the user clicks OK, Execute configures the printers as specified in the dialog and returns True. If the user clicks Cancel, Execute returns False.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog


 TQuery

Hierarchy	Properties	Methods	Events	See also

TQuery encapsulates a dataset with a result set that is based on an SQL statement.

Unit

dbtables

Description

Use TQuery to access one or more tables in a database using SQL statements. Query components can be used with remote database servers (such as Sybase, SQL Server, Oracle, Informix, DB2, and InterBase), with local tables (Paradox, InterBase, dBASE, Access, and FoxPro), and with ODBC-compliant databases.

Query components are useful because they can

Access more than one table at a time (called a “join” in SQL).

Automatically access a subset of rows and columns in its underlying table(s), rather than always returning all rows and columns.

Note:	TQuery is of particular importance to the development of scalable database applications. If there is any chance that an application built to run against local databases will be scaled to a remote SQL database server in the future, use TQuery components from the start to ensure easier scaling later.


TQuery properties

TQuery	Alphabetically	Legend

In TQuery

Constrained

DataSource

Handle

Local

ParamCheck

ParamCount

Params

Prepared

RequestLive

RowsAffected

SQL

SQLBinary

StmtHandle

Text

UniDirectional

Derived from TDBDataSet

AutoRefresh

Database

DatabaseName

DBHandle

DBLocale

DBSession

SessionName

UpdateMode

Derived from TBDEDataSet

BlockReadSize

CacheBlobs

CachedUpdates

CanModify

ExpIndex

Filter

Filtered

FilterOptions

KeySize

Locale

RecNo

RecordCount

RecordSize

UpdateObject

UpdateRecordTypes

UpdatesPending

Derived from TDataSet

Active

AggFields

AutoCalcFields

Bof

Bookmark

Constraints

DataSetField

DefaultFields

Designer

Eof

FieldCount

FieldDefList

FieldDefs

FieldList

Fields

FieldValues

Found

Modified

Name

ObjectView

State

SparseArrays

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TQuery properties

TQuery	By object	Legend

Active

AggFields

AutoCalcFields

AutoRefresh

BlockReadSize

Bof

Bookmark

CacheBlobs

CachedUpdates

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constrained

Constraints

Database

DatabaseName

DataSetField

DataSource

DBHandle

DBLocale

DBSession

DefaultFields

Designer

DesignInfo

Eof

ExpIndex

FieldCount

FieldDefList

FieldDefs

FieldList

Fields

FieldValues

Filter

Filtered

FilterOptions

Found

Handle

KeySize

Local

Locale

Modified

Name

ObjectView

Owner

ParamCheck

ParamCount

Params

Prepared

RecNo

RecordCount

RecordSize

RequestLive

RowsAffected

SessionName

SparseArrays

SQL

SQLBinary

State

StmtHandle

Tag

Text

UniDirectional

UpdateMode

UpdateObject

UpdateRecordTypes

UpdatesPending

VCLComObject


TQuery.Constrained

TQuery	See also

Indicates whether updates and inserts that don’t conform to the result set generated by a SELECT statement are permitted for Paradox and dBASE tables

property Constrained: Boolean;

Description

Use Constrained to determine whether or not edits and insertions are permitted to a Paradox or dBASE table underlying a result set when the UPDATE or INSERT statements contain one or more values that do not comply with the WHERE clause conditions of the SELECT statement that generated the result set. Constrained only applies to live result sets. Constraints are enforced during the editing process.

If Constrained is False (the default), updates and inserts are permitted regardless of the SELECT statement criteria. If True, updates and inserts are not permitted if they violate the criteria of the SELECT statement that generated the result set.

For example, if Constrained is True and a query component’s SQL property is

SELECT *

FROM CUSTOMERS

WHERE (CUSTNO > 1400) AND (CUSTNO < 1500)

then the user would not be allowed to enter a value for CustNo that fell outside this range of values.


TQuery.DataSource

TQuery	See also

Specifies the data source component from which to extract current field values to use with same-name parameters in the query’s SQL statement.

property DataSource: TDataSource;

Description

Set DataSource to automatically fill parameters in a query with fields values from another dataset. Parameters that have the same name as fields in the other dataset are filled with the field values. Parameters with names that are not the same as fields in the other dataset do not automatically get values, and must be programmatically set. For example, if the SQL property of the TQuery contains the SQL statement below and the dataset referenced through DataSource has a Custno field, the value from the current record in that other dataset is used in the CustNo parameter.

SELECT *

FROM Orders O

WHERE (O.CustNo = :CustNo)

DataSource must point to a TDataSource component linked to another dataset component; it cannot point to this query’s data source component.

The dataset specified in DataSource must be created, populated, and opened before attempting to bind parameters. Parameters are bound by calling the query’s Prepare method prior to executing the query.

Tip:	DataSource is especially of use when creating a master-detail relationship between tables using a linked query. It is also of use to guarantee binding for parameters that are not already set in the Params property or through a call to the ParamByName method.

If the SQL statement used by a query does not contain parameters, or all parameters are bound by the application using the Params property or the ParamByName method, DataSource need not be assigned. The example below shows setting the DataSource property of Query2 to the data source for Query1, preparing Query2, and activating Query2.

with Query2 do begin

  DataSource := DataSource1;

  Prepare;

  Open;

end;

If the SQL statement in the TQuery is a SELECT query, the query is executed using the new field values each time the record pointer in the other dataset is changed. It is not necessary to call the Open method of the TQuery each time. This makes using the DataSource property to dynamically filter a query result set useful for establishing Master-Detail relationships. Set the DataSource property in the Detail query to the TDataSource component for the Master dataset.

If the SQL statement uses other than a SELECT query (such as INSERT or UPDATE), the parameters with the same name as fields in the other dataset still get values, but the query must be explicitly executed each time the other dataset’s record pointer moves. For example, the SQL statement below uses the INSERT statement and has the parameters Custno and CompanyName.

INSERT INTO Customer

(CustNo, Company)

VALUES (:CustNo, :CompanyName)

Another dataset, Query1 and DataSource1, has a CustNo field but no CompanyName field. If this dataset is used through the DataSource property, the CompanyName parameter must be programmatically assigned a value. Because Query1 has a CustNo field and Query1 is referenced through the DataSource property, the CustNo parameter automatically receives a value.

with Query2 do begin

  DataSource := DataSource1;

  ParamByName('CompanyName').AsString := Edit1.Text;

  Prepare;

  ExecSQL;

end;

If the SQL statement contains parameters with the same name as fields in the other dataset, do not manually set values for these parameters. Any values programmatically set, such as by using the Params property or the ParamByName method, will be overridden with automatic values. Parameters of other names must be programmatically given values. These parameters are unaffected by setting DataSource.

DataSource can be set at runtime or at design-time using the Object Inspector. At design-time, select the desired TDataSource from the drop-down list or type in the name.


TQuery.Handle

TQuery	See also

Specifies the Borland Database Engine (BDE) cursor handle for the query.

type HDBICur: Longint;

property Handle: HDBICur;

Description

Use Handle only to bypass TQuery methods and call directly into the BDE. Many BDE function calls require a cursor handle parameter. Handle is assigned an initial value when a query is executed. If used with a BDE call that changes the current record position, call Resync immediately after returning from the BDE call.

Note:	Do not use this property unless an application requires BDE functionality not available through built-in components.


TQuery.Local

TQuery	See also

Indicates whether a query references one or more Paradox or dBASE tables rather than SQL tables on a remote server.

property Local: Boolean;

Description

Check Local to determine if a query accesses one or more Paradox or dBASE tables rather than SQL tables. If Local is True, then the query only accesses dBASE or Paradox tables. Otherwise Local is False. Local is set automatically when an application calls the query’s Prepare method prior to executing the query.

Some query component settings, such as Constrained, are only meaningful for queries against Paradox and dBASE tables. Others are only meaningful for queries against remote SQL servers. Local can provide useful information for branching logic in code based on the type of database accessed. It can also be used to determine whether or not the BDE parsed a query using its local query engine rather than passing SQL statements directly to a remote server.


TQuery.ParamCheck

TQuery	See also

Specifies whether the parameter list for a query is regenerated if the SQL property changes at runtime.

property ParamCheck: Boolean;

Description

Set ParamCheck to specify whether or not the Params property is cleared and regenerated if an application modifies the query’s SQL property at runtime. By default ParamCheck is True, meaning that the Params property is automatically regenerated at runtime. When ParamCheck is True, the proper number of parameters is guaranteed to be generated for the current SQL statement.

This property is useful for data definition language (DDL) statements that contain parameters as part of the DDL statement and that are not parameters for the TQuery. For example, the DDL statement to create a stored procedure may contain parameter statements that are part of the stored procedure. Set ParamCheck to False to prevent these parameters from being mistaken for parameters of the TQuery executing the DDL statement.

An application that does not use parameterized queries may choose to set ParamCheck to False, but otherwise ParamCheck should be True.


TQuery.ParamCount

TQuery	See also	Example

Indicates the current number of parameters for the query.

property ParamCount: Word;

Description

Inspect ParamCount to determine how many parameters are in the Params property. If the ParamCheck property is True, ParamCount always corresponds to the number of actual parameters in the SQL statement for the query.


TQuery.Params

TQuery	See also	Example

Contains the parameters for a query’s SQL statement.

property Params[Index: Word]TParams;

Description

Access Params at runtime to view and set parameter names, values, and data types dynamically (at design time use the collection editor for the Params property to set parameter information). Params is a zero-based array of TParams parameter records. Index specifies the array element to access.

Note:	An easier way to set and retrieve parameter values when the name of each parameter is known is to call ParamByName. ParamByName cannot, however, be used to change a parameter’s data type or name.

Parameters used in SELECT statements cannot be NULL, but they can be NULL for UPDATE and INSERT statements.


TQuery.Prepared

TQuery	See also	Example

Determines whether or not a query is prepared for execution.

property Prepared: Boolean;

Description

Examine Prepared to determine if a query is already prepared for execution. If Prepared is True, the query is prepared, and if Prepared is False, the query is not prepared. While a query need not be prepared before execution, execution performance is enhanced if the query is prepared beforehand, particularly if it is a parameterized query that is executed more than once using the same parameter values.

Note:	An application can change the current setting of Prepared to prepare or unprepare a query. If Prepared is True, setting it to False calls the Unprepare method to unprepare the query. If Prepared is False, setting it to True calls the Prepare method to prepare the query. Generally, however, it is better programming practice to call Prepare and Unprepare directly. These methods automatically update the Prepared property.


TQuery.RequestLive

TQuery	See also

Specifies whether an application expects to receive a live result set from the Borland Database Engine (BDE) when the query executes.

property RequestLive: Boolean;

Description

Set RequestLive to specify whether or not the BDE should attempt to return a live result set to the application. RequestLive is False by default, meaning that a query always returns a read-only result set.

Set RequestLive to True to request a live result set. Setting RequestLive to True does not guarantee that a live result set is returned by the BDE. The BDE returns a live result set only if the SELECT syntax of the query conforms to the syntax requirements for a live result set.

If RequestLive is True, but the syntax does not conform to the requirements, the BDE returns a read-only result set for Paradox or dBASE, or an error return code for remote servers.

After activating the TQuery, inspect the CanModify property to determine whether the request for a live result set was successful.

Note:	All multi-table queries return read-only result sets. Other conditions may cause a query to return a read-only result set. For local tables (such as dBASE and Paradox), see the local SQL help file for rules governing live result sets (updatable queries). For other table types (such as InterBase, Oracle, and Sybase), consult the documentation for the specific database system.


TQuery.RowsAffected

TQuery	See also

Returns the number of rows operated upon by the latest query execution.

property RowsAffected: Integer;

Description

Inspect RowsAffected to determine how many rows were updated or deleted by the last query operation. If no rows were updated or deleted, RowsAffected has a value of zero. RowsAffected will have a value of –1 if the execution of the SQL statement could not be executed due to an error condition. This latter situation would typically follow the raising of an exception.


TQuery.SQL

TQuery	See also	Example

Contains the text of the SQL statement to execute for the query.

property SQL: TStrings;

Description

Use SQL to provide the SQL statement that a query component executes when its ExecSQL or Open method is called. At design time the SQL property can be edited by invoking the String List editor in the Object Inspector.

The SQL property may contain only one complete SQL statement at a time. In general, multiple “batch” statements are not allowed unless a particular server supports them.

The SQL property can be used to access

Paradox or dBASE tables, using local SQL. The allowable syntax is a subset of SQL-92. See the local SQL help file for information on supported syntax.

Databases on the Local InterBase Server, using standard SQL-92 and specific InterBase extensions to SQL syntax. For information on syntax and limitations, see the InterBase Language Reference and online help.

Databases on remote database servers using the appropriate SQL Links driver or ODBC (not available in all versions). Any standard statement in the server's SQL dialect is allowed. For information on SQL syntax and limitations, see the server documentation.

The SQL statement in the SQL property may contain replaceable parameters, following standard SQL-92 syntax conventions. Parameters are created and stored in the Params property.

Note:	Developers with advanced versions can also invoke the Visual Query Builder to create an SQL statement for execution. Right-click the TQuery icon on the form in the IDE and select the command from the context menu.


TQuery.SQLBinary

TQuery	See also

Points to the binary data stream that represents an SQL query statement or result set.

property SQLBinary: PChar;

Description

Do not access SQLBinary. It is an internal binary data stream used by the query component to communicate directly with the Borland Database Engine. To access or set the SQL statement that this query component executes, use the SQL property. To access or set the parameters used in a parameterized SQL statement, use the Params property.


TQuery.StmtHandle

TQuery

Identifies the Borland Database Engine (BDE) statement handle for the query.

property StmtHandle: HDBIStmt;

Description

Retrieve StmtHandle if an application makes a direct call to the BDE, bypassing the methods of TQuery. Some BDE API calls require a statement handle as a parameter. Under all other circumstances an application does not need to access this property.


TQuery.Text

TQuery	See also

Points to the actual text of the SQL query passed to the Borland Database Engine (BDE).

property Text: PChar;

Description

Text is a read-only property that can be examined to determine the actual contents of SQL statement passed to the BDE. For parameterized queries, Text contains the SQL statement with parameters replaced by the parameter substitution symbol (?) in place of actual parameter values.

In general there should be no need to examine the Text property. To access or change the SQL statement for the query, use the SQL property. To examine or modify parameters, use the Params property.


TQuery.UniDirectional

TQuery	See also

Determines whether or not Borland Database Engine (BDE) bidirectional cursors are enabled for a query’s result set.

property UniDirectional: Boolean;

Description

Set UniDirectional to control whether or not a BDE cursor can move forward and backward through a result set. By default UniDirectional is False, enabling forward and backward navigation.

Note:	Traditionally SQL cursors are unidirectional. They can travel only forward through a dataset. The BDE, however, permits bidirectional travel by caching records. If an application does not need bidirectional access to records in a result set, set UniDirectional to True. When UniDirectional is True, an application requires less memory and performance is improved.


TQuery events

TQuery	Alphabetically	Legend

Derived from TBDEDataSet

OnUpdateError

OnUpdateRecord

Derived from TDataSet

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TQuery events

TQuery	By object	Legend

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnUpdateError

OnUpdateRecord


TQuery methods

TQuery	Alphabetically

In TQuery

Create

Destroy

ExecSQL

GetDetailLinkFields

ParamByName

Prepare

UnPrepare

Derived from TDBDataSet

CheckOpen

CloseDatabase

OpenDatabase

Derived from TBDEDataSet

ApplyUpdates

BookmarkValid

Cancel

CancelUpdates

CommitUpdates

CompareBookmarks

ConstraintCallBack

ConstraintsDisabled

CreateBlobStream

DisableConstraints

EnableConstraints

FetchAll

GetFieldData

FlushBuffers

GetBlobFieldData

GetCurrentRecord

GetIndexInfo

IsSequenced

Locate

Lookup

Post

RevertRecord

Translate

UpdateStatus

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

CheckBrowseMode

ClearFields

Close

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetDetailDataSets

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsEmpty

IsLinkedTo

Last

MoveBy

Next

Open

Prior

Refresh

Resync

SetFields

UpdateCursorPos

UpdateRecord

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TQuery methods

TQuery	By object

ActiveBuffer

AfterConstruction

Append

AppendRecord

ApplyUpdates

Assign

BeforeDestruction

BookmarkValid

Cancel

CancelUpdates

CheckBrowseMode

CheckOpen

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClearFields

Close

CloseDatabase

CommitUpdates

CompareBookmarks

ConstraintCallBack

ConstraintsDisabled

ControlsDisabled

Create

CreateBlobStream

CursorPosChanged

DefaultHandler

Delete

Destroy

DestroyComponents

Destroying

DisableConstraints

DisableControls

Dispatch

Edit

EnableConstraints

EnableControls

ExecSQL

ExecuteAction

FetchAll

FieldAddress

FieldByName

FindComponent

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FlushBuffers

Free

FreeBookmark

FreeInstance

FreeNotification

FreeOnRelease

GetBlobFieldData

GetBookmark

GetCurrentRecord

GetDetailDataSets

GetDetailLinkFields

GetFieldData

GetFieldList

GetFieldNames

GetIndexInfo

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GotoBookmark

HasParent

InheritsFrom

InitInstance

Insert

InsertComponent

InsertRecord

InstanceSize

IsEmpty

IsLinkedTo

IsSequenced

Last

Locate

Lookup

MethodAddress

MethodName

MoveBy

NewInstance

Next

Open

OpenDatabase

ParamByName

Post

Prepare

Prior

Refresh

RemoveComponent

Resync

RevertRecord

SafeCallException

SetFields

Translate

UnPrepare

UpdateAction

UpdateCursorPos

UpdateRecord

UpdateStatus


TQuery.Create

TQuery	See also

Creates an instance of a query component.

constructor Create(AOwner: TComponent);

Description

Call Create to instantiate a query at runtime. Query components placed in forms or data modules at design time are created automatically.

Create calls its inherited Create constructor, creates an empty SQL statement list, an empty parameter list, sets the OnChange event handler for the SQL statement list, establishes a data link, sets the RequestLive property to False, sets the ParamCheck property to True, and sets the RowsAffected property to -1.


TQuery.Destroy

TQuery	See also

Destroys the instance of a query.

destructor Destroy;

Description

Do not call Destroy directly. Instead, call Free, which checks that the TQuery is not nil before calling Destroy.

Destroy disconnects from the server, frees the SQL statement list, the parameter list, and the data link and SQL binary storage area, and then calls its inherited destructor.


TQuery.ExecSQL

TQuery	See also	Example

Executes the SQL statement for the query.

procedure ExecSQL;

Description

Call ExecSQL to execute the SQL statement currently assigned to the SQL property. Use ExecSQL to execute queries that do not return a cursor to data (such as INSERT, UPDATE, DELETE, and CREATE TABLE).

Note:	For SELECT statements, call Open instead of ExecSQL.

ExecSQL prepares the statement in SQL property for execution if it has not already been prepared. To speed performance, an application should ordinarily call Prepare before calling ExecSQL for the first time.


TQuery.GetDetailLinkFields

TQuery	See also

Fills lists with the master and detail fields of the link.

procedure GetDetailLinkFields(MasterFields, DetailFields: TList); override;

Description

Creates two lists of TFields from the master-detail relationship between two tables; one containing the master fields, and the other containing the detail fields.


TQuery.ParamByName

TQuery	See also	Example

Accesses parameter information based on a specified parameter name.

function ParamByName(const Value: String): TParam;

Description

Call ParamByName to set or use parameter information for a specific parameter based on its name.

Value is the name of the parameter for which to retrieve information.

ParamByName is primarily used to set an parameter’s value at runtime. For example, the following statement retrieves the current value of a parameter called “Contact” into an edit box:

Edit1.Text := Query1.ParamByName('Contact').AsString;

Parameters used in SELECT statements cannot be NULL, but they can be NULL for UPDATE and INSERT statements.


TQuery.Prepare

TQuery	See also	Example

Sends a query to the Borland Database Engine (BDE) and the server for optimization prior to execution.

procedure Prepare;

Description

Call Prepare to have the BDE and a remote database server allocate resources for the query and to perform additional optimizations. Calling Prepare before executing a query improves application performance.

Delphi automatically prepares a query if it is executed without first being prepared. After execution, Delphi unprepares the query. When a query will be executed a number of times, an application should always explicitly prepare the query to avoid multiple and unnecessary prepares and unprepares.

Preparing a query consumes some database resources, so it is good practice for an application to unprepare a query once it is done using it. The UnPrepare method unprepares a query.

Note:	When you change the text of a query at runtime, the query is automatically closed and unprepared.


TQuery.UnPrepare

TQuery	See also

Frees the resources allocated for a previously prepared query.

procedure UnPrepare;

Description

Call UnPrepare to free the resources allocated for a previously prepared query on the server and client sides.

Preparing a query consumes some database resources, so it is good practice for an application to unprepare a query once it is done using it. The UnPrepare method unprepares a query.

Note:	When you change the text of a query at runtime, the query is automatically closed and unprepared.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataSet

TBDEDataSet

TDBDataSet


TQueue

Hierarchy	Methods	See also

TQueue maintains a first-in first-out array of pointers.

Unit

contnrs

Description

Use a TQueue object to store and maintain a first-in first-out list.


TQueue methods

TQueue	Alphabetically

In TQueue

Peek

Pop

Push

Derived from TOrderedList

AtLeast

Count

Create

Destroy

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TQueue methods

TQueue	By object

AfterConstruction

AtLeast

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Count

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Peek

Pop

Push

SafeCallException


TQueue.Peek

TQueue	See also

Returns a pointer to the front of the queue.

function Peek: Pointer;

Description

Call Peek to access the queue without removing an item. Peek returns a pointer to the next item in the queue (that is, the earliest item added).

To remove an item from the queue, call Pop.


TQueue.Pop

TQueue	See also

Removes and returns the item at the front of the queue.

function Pop: Pointer;

Description

Call Pop to retrieve an item from the queue. Pop removes the next item from the queue (that is, the earliest item added), then returns a pointer to the deleted item.

To access the queue without removing an item, call Peek.


TQueue.Push

TQueue	See also

Adds an item to the end of the queue.

procedure Push(AItem: Pointer);

Description

Call Push to add an item to the queue.

To retrieve items added with Push, call Pop or Peek.


Hierarchy

TObject

TOrderedList


 TRadioButton

Hierarchy	Properties	Methods	Events	See also

TRadioButton is a wrapper for a Windows radio button.

Unit

stdctrls

Description

Use TRadioButton to add a radio button to a form. Radio buttons present a set of mutually exclusive options to the user—that is, only one radio button in a set can be selected at a time. When the user selects a radio button, the previously selected radio button becomes unselected. Radio buttons are frequently grouped in a radio group box (TRadioGroup). Add the group box to the form first, then get the radio buttons from the Component palette and put them into the group box.

By default, all radio buttons that are directly contained in the same windowed control container, such as a TRadioGroup or TPanel, are grouped. For example, two radio buttons on a form can be checked at the same time only if they are contained in separate containers, such as two different group boxes.


TRadioButton properties

TRadioButton	Alphabetically	Legend

In TRadioButton

Alignment

Checked

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

Caption

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TRadioButton properties

TRadioButton	By object	Legend

Action

Align

Alignment

Anchors

BiDiMode

BoundsRect

Brush

Caption

Checked

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TRadioButton.Alignment

TRadioButton	See also

Determines the position of the caption relative to the radio button.

type TLeftRight = taLeftJustify..taRightJustify;

property Alignment: TLeftRight;

Description

Set Alignment to determine where the caption of the radio button should appear. These are the possible values:

Value	Meaning

taLeftJustify	The caption appears to the left of the radio button.

taRightJustify	The caption appears to the right of the radio button.

Note:	Do not confuse the Alignment property with the alignment of the caption in the text area of the radio button. The caption always appears left aligned. Alignment only controls on which side of the button the text area appears.


TRadioButton.Checked

TRadioButton	See also 	Example

Determines whether the option represented by the radio button is selected.

property Checked: Boolean;

Description

Read Checked to determine whether the radio button is selected. Set Checked to True to select the radio button and deselect all other radio buttons in the same container. Set Checked to False to deselect the radio button, leaving no radio button in the group selected.


TRadioButton events

TRadioButton	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TRadioButton events

TRadioButton	By object	Legend

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TRadioButton methods

TRadioButton	Alphabetically

In TRadioButton

Create

GetChecked

GetControlsAlignment

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetTextBuf

GetTextLen

HasParent

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TRadioButton methods

TRadioButton	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TRadioButton.Create

TRadioButton	See also

Creates an instance of TRadioButton.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a radio button at runtime. Radio buttons added to forms at design time are created automatically.

Create calls the inherited constructor, then sets the initial values for the radio button, such as the Width and Height property values to 113 pixels and 17 pixels, respectively, the ControlStyle set to csSetCaption and csDoubleClicks, and the Alignment property value to taLeftJustify.


TRadioButton.GetChecked

TRadioButton

Returns the value of the Checked property.

function GetChecked: Boolean; override;

Description

GetChecked is the protected implementation of the Checked property. Override this method and the SetChecked method to change the Checked property in descendant classes.


TRadioButton.GetControlsAlignment

TRadioButton

Returns the alignment of any text in the control.

function GetControlsAlignment: TAlignment; override;

Description

Use GetControlsAlignment to determine the orientation of text in controls that do not have an Alignment property.

GetControlsAlignment overrides the inherited method, returning taRightJustify if UseRightToLeftAlignment returns False. If UseRightToLeftAlignment returns True, GetControlsAlignment returns the opposite of the Alignment property.


TRadioButton.SetChecked

TRadioButton

Sets the value of the Checked property.

procedure SetChecked(Value: Boolean); override;

Description

SetChecked is the protected implementation of the Checked property. Override this method and the GetChecked method to change the Checked property in descendant classes.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TButtonControl


 TRadioGroup

Hierarchy	Properties	Methods	Events	See also

TRadioGroup represents a group of radio buttons that function together.

Unit

extctrls

Description

A TRadioGroup object is a special group box that contains only radio buttons. Radio buttons that are placed directly in the same control component are said to be “grouped.” When the user checks a radio button, all other radio buttons in its group become unchecked. Hence, two radio buttons on a form can be checked at the same time only if they are placed in separate containers, such as group boxes.

To add radio buttons to a TRadioGroup, edit the Items property in the Object Inspector. Each string in Items makes a radio button appear in the group box with the string as its caption. The value of the ItemIndex property determines which radio button is currently selected.

Display the radio buttons in a single column or in multiple columns by setting the value of the Columns property.

Note:	Setting the radio group’s BiDiMode to bdRightToLeft automatically flips its radio buttons. The FlipChildren method has no effect.


TRadioGroup properties

TRadioGroup	Alphabetically	Legend

Derived from TCustomRadioGroup

Columns

ItemIndex

Items

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

Caption

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TRadioGroup properties

TRadioGroup	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Columns

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

ItemIndex

Items

Left

LRDockWidth

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TRadioGroup events

TRadioGroup	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnClick

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnStartDock

OnStartDrag


TRadioGroup events

TRadioGroup	By object	Legend

OnClick

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnStartDock

OnStartDrag


TRadioGroup methods

TRadioGroup	Alphabetically

Derived from TCustomRadioGroup

Create

Destroy

FlipChildren

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TRadioGroup methods

TRadioGroup	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGroupBox

TCustomRadioGroup


TReader

Hierarchy	Properties	Methods	Events	See also

TReader is a specialized filer object that reads component data from an associated stream.

Unit

classes

Description

TReader is used internally by the VCL streaming system to restore the state of a component that has been written to a stream. It handles the mechanics of reading the data associated with a component from the stream. The reader object, rather than the stream object, is responsible for handling the complexities of streaming components. These include methods for:

Creating component instances from class names read from the stream.

Assigning stream data to published component properties.

Enabling an object to store hidden or complex data as if they were published properties of the object.

Resolving references between components, such as when a property refers to another component.

Other methods and properties of TReader trigger the reader object's events and interaction with the stream.

Applications do not directly create reader objects. Readers are automatically created in a stream object’s methods or in global routines that initiate the streaming process. These include:

the global routine ObjectBinaryToText procedure, which directly creates a reader object.

the global ReadComponentResFile function, which creates a file stream that creates a reader object.

the TStream.ReadComponent method, which creates a reader object.

Once the streaming process is underway applications do not need to directly manipulate reader objects. The interaction between the reader, component, and stream objects happens automatically in methods of these objects that make calls to each other.


TReader properties

TReader	Alphabetically	Legend

In TReader

Owner

Parent

Position

Derived from TFiler

Ancestor

IgnoreChildren

LookupRoot

Root


TReader properties

TReader	By object	Legend

Ancestor

IgnoreChildren

LookupRoot

Owner

Parent

Position

Root


TReader.Owner

TReader	See also

Stores the component that is assigned as the Owner property of components read from the reader object's stream.

property Owner: TComponent;

Description

Owner is used internally by the VCL streaming system to determine which components to stream. The streaming process handles all components owned by the Root component.

Owner is the Owner property of the component read from the stream. The component’s Owner property is assigned its value from the reader’s Owner property. If the value of the reader’s Owner property is nil, then the Root property is assigned as the component’s Owner property.

For most components, Owner is nil. For components that can contain subcomponents that are not owned by the Root form, such as the nodes of a tree view component, the Owner is not the same as the Root. The GetChildOwner method of the component determines the Owner.


TReader.Parent

TReader	See also

Stores the component that is assigned as the Parent property of controls read from the reader’s stream.

property Parent: TComponent;

Description

Parent is used internally by the VCL streaming system. The value of the Parent property is determined by the order that components are read from the stream. The Parent relationship determines the visual containment of components.


TReader.Position

TReader	See also

Represents the current reading position in the associated stream.

property Position: Longint;

Description

Position is used to track the reader’s position within the stream. The value of Position will always be inside the most recent buffer block read. Thus, for reading, Position will always be less than the stream's Position.


TReader events

TReader	Alphabetically

In TReader

OnAncestorNotFOund

OnCreateComponent

OnError

OnFindComponentClass

OnFindMethod

OnReferenceName

OnSetName


TReader events

TReader	By object

OnAncestorNotFOund

OnCreateComponent

OnError

OnFindComponentClass

OnFindMethod

OnReferenceName

OnSetName


TReader.OnAncestorNotFound

TReader	See also

Occurs when the object from which a streamed object is derived can’t be found.

type TAncestorNotFoundEvent = procedure(Reader: TReader; const ComponentName: string; ComponentClass: TPersistentClass; var Component: TComponent) of object;

property OnAncestorNotFound: TAncestorNotFoundEvent;

Description

OnAncestorNotFound is for internal use.


TReader.OnCreateComponent

TReader	See also

Occurs when the reader has read a component’s class but has not yet instantiated the component.

type TCreateComponentEvent = procedure(Reader: TReader; ComponentClass: TComponentClass; var Component: TComponent) of object;

property OnCreateComponent: TCreateComponentEvent;

Description

OnCreateComponent is used internally to provide an alternate mechanism for instantiating components. If OnCreateComponent returns a component as the value of the Component parameter, the Reader uses that instance instead of calling the component’s constructor.

Reader is the reader that needs an instance for a component that it is reading.

ComponentClass is the class of the component to be instantiated.

Component returns new instance of ComponentClass.


TReader.OnError

TReader	See also

Occurs when a reader object encounters an error reading its data, such as reading the name of an undeclared property or an illegal value.

type TReaderError = procedure(Reader: TReader; const Message: string; var Handled: Boolean) of object;

property OnError: TReaderError;

Description

OnError is used internally by the Delphi environment to report errors. It can also be used to write an event handler to selectively choose to process or ignore errors.

The last parameter passed to the OnError event handler is a var parameter called Handled. By default, the Error method passes False in Handled, but a handler that corrects the error or chooses to ignore the error can set Handled to True, which prevents further processing of the error. If the event handler returns with Handler still set to False, the reader object raises an EReadError exception.


TReader.OnFindComponentClass

TReader	See also

Occurs when a reader first reads the name of a component class.

type TFindComponentClassEvent = procedure(Reader: TReader; const ClassName: string; var ComponentClass: TComponentClass) of object;

property OnFindComponentClass: TFindComponentClassEvent;

Description

The ReadComponent method generates an OnFindComponentClass event when it reads the class name for the component it is loading. An OnFindComponentClass event handler can replace the class reference with a different class to change the type of component that gets loaded.

Reader is the reader that has just read the class name.

ClassName is the name that was read from a stream.

ComponentClass is the class reference that corresponds to ClassName. The event handler can change it.


TReader.OnFindMethod

TReader	See also

Occurs each time the reader object reads an event, which is a method-pointer property, for an object.

type TFindMethodEvent = procedure(Reader: TReader; const MethodName: string; var Address: Pointer; var Error: Boolean) of object;

property OnFindMethod: TFindMethodEvent;

Description

OnFindMethod is used internally by the Delphi environment for reading events. It can also be used to write a handler to ask the user how to handle missing methods.

If the reader cannot locate the named method assigned to the method pointer, it sets the Error parameter of the OnFindMethod handler to True. The handler can set Error to False, which prevents FindMethod from raising an exception when the handler returns.


TReader.OnReferenceName

TReader	See also

Occurs when resolving references to other objects such as when one object is the property value of another.

type TReferenceNameEvent = procedure(Reader: TReader; var Name: string) of object;

property OnReferenceName: TReferenceNameEvent;

Description

OnReferenceName is for internal use only.


TReader.OnSetName

TReader	See also

Occurs just before the reader object sets the Name property of a component it reads from its stream.

type TSetNameEvent = procedure(Reader: TReader; Component: TComponent; var Name: string) of object;

property OnSetName: TSetNameEvent;

Description

OnSetName is used by internally by the Delphi environment to handle duplicate names of components and forms. It can also be used to write an event handler to perform special processing just before the Name property is set for the component which has just been created and is about to have its properties read from the stream.

The Name parameter to the OnSetName event handler is a var parameter, so the handler can change the name before the reader assigns it to the component. For example, OnSetName is useful for filtering all the component names in a form, to add or change part of the string.


TReader methods

TReader	Alphabetically	Legend

In TReader

BeginReferences

CheckValue

CopyValue

DefineBinaryProperty

DefineProperty

Destroy

EndOfList

EndReferences

Error

FindAncestorComponent

FindMethod

FixupReferences

FlushBuffer

NextValue

Read

ReadBoolean

ReadChar

ReadCollection

ReadComponent

ReadComponents

ReadCurrency

ReadDate

ReadFloat

ReadIdent

ReadInt64

ReadInteger

ReadListBegin

ReadListEnd

ReadPrefix

ReadProperty

ReadRootComponent

ReadSignature

ReadSingle

ReadStr

ReadString

ReadValue

ReadWideString

ReferenceName

SetName

Derived from TFiler

Create

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TReader methods

TReader	By object	Legend

AfterConstruction

BeforeDestruction

BeginReferences

CheckValue

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

CopyValue

Create

DefaultHandler

DefineBinaryProperty

DefineProperty

Destroy

Dispatch

EndOfList

EndReferences

Error

FieldAddress

FindAncestorComponent

FindMethod

FixupReferences

FlushBuffer

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

NextValue

Read

ReadBoolean

ReadChar

ReadCollection

ReadComponent

ReadComponents

ReadCurrency

ReadDate

ReadFloat

ReadIdent

ReadInt64

ReadInteger

ReadListBegin

ReadListEnd

ReadPrefix

ReadProperty

ReadRootComponent

ReadSignature

ReadSingle

ReadStr

ReadString

ReadValue

ReadWideString

ReferenceName

SafeCallException

SetName


TReader.BeginReferences

TReader	See also

Starts a block of commands that read components that might contain references to other components.

procedure BeginReferences;

Description

Do not call BeginReferences directly. BeginReferences is used internally in Delphi for streaming properties that reference other components.

Following the call to BeginReferences, the reader object creates a list of all the objects read and their names. After all of the interdependent objects are read, FixupReferences is called to resolve the named references from the stream into instance references. Finally, call EndReferences to dispose of the fixup list.

BeginReferences is always used together with FixupReferences and EndReferences in a try...finally block.


TReader.CheckValue

TReader	See also

Checks that the next value to be read from the stream is of a specified type.

procedure CheckValue(Value: TValueType);

Description

CheckValue ascertains that the next value to be read from the stream is of the type specified by Value. If it is not, CheckValue skips over that value, positioning the stream on the following value, and raises an EReadError exception.


TReader.CopyValue

TReader

Copies data while reading components.

procedure CopyValue(Writer: TWriter);

Description

Do not call CopyValue, it is used internally by the Delphi environment.


TReader.DefineBinaryProperty

TReader	See also

Defines binary data the reader object reads as if the data were a published property.

type TStreamProc = procedure(Stream: TStream) of object;

procedure DefineBinaryProperty(const Name: string; ReadData, WriteData: TStreamProc; HasData: Boolean); override;

Description

DefineBinaryProperty is called internally by the DefineProperties method of an object that has data it needs to store. Applications can call DefineBinaryProperty directly when overriding the DefineProperties method of a component with large custom data (like a bitmap). This is the only context in which DefineBinaryProperty (or DefineProperty) should be used.

DefineProperties takes a generic filer object as its parameter. For reading binary data, DefineProperties takes a TReader object and calls its DefineBinaryProperty method. DefineBinaryProperty then reads the property’s name data and passes the data to the indicated ReadData method.

The Name parameter specifies the name of the “fake” property to be read from the stream. A “fake” property is a property that is not published, and that exists only in the code for the DefineBinaryProperty method. The Top and Left properties of a non-visual component are examples of “fake” properties. These are also called “defined properties” or “custom defined properties.”

The TStreamProc type is the type of the ReadData and WriteData parameters. It is the method-pointer type that points to a procedure (defined in the component object) that reads or writes a binary representation of the object's data directly to or from the stream passed to them in the Stream parameter. For TReader the WriteData parameter is ignored.

The HasData parameter determines at run time whether the "fake" property has data to store (write). For TReader the HasData parameter is ignored.

Defined binary properties are rare. VCL objects that store graphics as binary data are the most common use of filer objects to store and retrieve binary data. More commonly, objects use the DefineProperty method. The difference between DefineBinaryProperty and DefineProperty is that when using DefineBinaryProperty, the component reads the binary property directly from a memory stream, rather than going through the filer object. Binary data is also harder to edit as text.

Note:	Streamable objects that are descended from TPersistent inherit a DefineProperties method, however DefineProperties does nothing until TComponent. Therefore, it is a component’s DefineProperties method that calls the reader’s DefineBinaryProperty when reading binary data.


TReader.DefineProperty

TReader	See also	Example

Defines data the reader object reads as if it were a published property.

type

  TReaderProc = procedure(Reader: TReader) of object;

  TWriterProc = procedure(Writer: TWriter) of object;

procedure DefineProperty(const Name: string; ReadData: TReaderProc; WriteData: TWriterProc; HasData: Boolean); override;

Description

DefineProperty is called internally by the DefineProperties method of an object that has data it needs to store. DefineProperties takes a generic filer object as its parameter. For reading data DefineProperties takes a TReader object and then calls the DefineProperties method of the reader object. DefineProperty then reads the property’s name and it’s data.

The Name parameter specifies the name of the “fake” property to be read from the stream.

The TReaderProc type is the type of the ReadData parameter. It is the method-pointer type that points to a procedure (defined in the storing object) which reads the object's data that represents a property value to the reader object. For TReader the WriteData parameter is ignored.

The HasData parameter determines at run time whether the "fake" property has data to store (write). For TReader the HasData parameter is ignored.

The difference between DefineBinaryProperty and DefineProperty is that the binary property is read directly from a stream, rather than going through a filer object, and binary data is harder to edit as text.


TReader.Destroy

TReader	See also

Moves the current position of the stream back to the beginning before calling the inherited destructor.

destructor Destroy; override;

Description

Do not call Destroy directly. Reader objects are created indirectly through the methods or routines that use them. These methods and routines handle freeing the TReader object.


TReader.EndOfList

TReader	See also

Indicates the end of a group of items that are sequentially read from the stream.

function EndOfList: Boolean;

Description

EndOfList is used by other methods that iterate through a list of items when reading in data. It checks for a value type that signals the end of that type of data. EndOfList returns True if the reader object has read to the end of a list of items.

When reading a list of items, the reader object calls ReadListBegin method, then the items are repeatedly read until EndOfList returns True. Finally, the reader calls ReadListEnd.

Note:	Component writers can use this in their defined property ReadData methods, as, for example, with TStrings.


TReader.EndReferences

TReader	See also

Terminates a block of code that reads components from the reader object's stream that might contain references to each other.

procedure EndReferences;

Description

EndReferences is used for streaming properties that reference another component. Programmers should not need to call EndReferences directly.

The reader object calls EndReferences and creates a list of all the objects read and their names. After all the interdependent objects are read, FixupReferences is called to resolve the named references from the stream into instance references. Finally, call EndReferences to dispose of the fixup list.

EndReferences is always used in the finally part of a try..finally block that also includes calls to BeginReferences and FixupReferences.


TReader.Error

TReader	See also

Generates an OnError event.

function Error(const Message: string): Boolean; virtual;

Description

The reader object calls Error whenever it encounters a problem reading a component or a property. By default, Error sets its return value to False, then calls any handler attached to the OnError event, which can change the return value.

Use Error to change the return value that indicates whether to continue error processing. A return value of True indicates that the application should continue to treat the condition as an error. A return value of False indicates that the error condition is either fixed or should be ignored.

Note:	This method is virtual only for the design-time environment. Programmers would not create descendant classes of a TReader object.


TReader.FindAncestorComponent

TReader	See also

Locates an ancestor component with a specified name.

function FindAncestorComponent(const Name: string; ComponentClass: TPersistentClass): TComponent; virtual;

Description

TReader objects use FindAncestorComponent internally to determine the ancestry of an object that is being read into memory. FindAncestorComponent locates the ancestor component with the specified name and class, and returns the corresponding component object. If the ancestor object has not already been read into memory, FindAncestorComponent generates an OnAncestorNotFound event to allow the appropriate event handler to locate the ancestor.


TReader.FindMethod

TReader	See also

Returns a pointer to a method for a specified component.

function FindMethod(Root: TComponent; const MethodName: string): Pointer; virtual;

Description

FindMethod is used by the reader object when it reads a property that is a method pointer (that is, usually an event). After reading the name of the assigned method (the event handler), the reader calls FindMethod to get the address of the method in the root object (the form).

FindMethod returns a pointer to the method, for the component passed in Root, that has the name passed in MethodName. Then it calls the event handler attached to the OnFindMethod event, if any. If FindMethod cannot locate the named method and the OnFindMethod handler does not clear its error flag, FindMethod raises an EReadError exception.

To customize the processing of method pointers read from the reader object, write an event handler for OnFindMethod.


TReader.FixupReferences

TReader	See also

Resolves references when streaming properties that are represented by another component.

procedure FixupReferences;

Description

FixupReferences is used internally by the streaming system to resolve the named references from the stream into instance references. Users would never need to call this method.

The reader object calls BeginReferences and creates a list of all the objects read and their names. After all the interdependent objects are read, FixupReferences is called to resolve the references among various mutually dependent components read from the reader object's stream after all of the objects have been read. Finally, call EndReferences to dispose of the fixup list.

FixupReferences is always used inside a try..finally block between calls to BeginReferences and EndReferences.


TReader.FlushBuffer

TReader	See also

Synchronizes the reader’s buffer with its stream’s buffer.

procedure FlushBuffer; override;

Description

FlushBuffer synchronizes the reader's buffer with the associated stream by setting the stream’s Position to match the reader’s Position.


TReader.NextValue

TReader	See also

Returns the type of the next item in the reader object's stream without moving the position of the stream.

function NextValue: TValueType;

Description

NextValue is used internally by reader methods to query the type of the next item in the stream. After identifying the type of the next item, NextValue returns with the stream position still before the value-type indicator.

The TValueType type defines the kinds of values written to and read from filer objects. Delphi's filers use a tagged value system, where each value on the stream is preceded by a prefix indicating its type. Those prefixes are of type TValueType.


TReader.Read

TReader	See also

Reads data from the associated stream.

procedure Read(var Buf; Count: Longint);

Description

Do not call read directly. Read is used internally to read data from the stream. Many other writer methods call Read, usually after setting pertinent values or verifying data types.


TReader.ReadBoolean

TReader	See also	Example

Reads a boolean from the reader object's stream and returns that boolean value.

function ReadBoolean: Boolean;

Description

ReadBoolean is a helper method used by other reader methods to read a tagged boolean value at the current reader Position. ReadBoolean uses ReadValue to check the type for a vaTrue value and returns that result.  Note that ReadBoolean will not verify that the value being read is a boolean, only whether or not the value is True.


TReader.ReadChar

TReader	See also

Reads a character from the reader object's stream and returns that character value.

function ReadChar: Char;

Description

ReadChar is a helper method used by other reader methods to read a tagged character value at the current reader Position. ReadChar first checks the value type (TValueType) by calling the ReadValue method. If the item is a vaString ReadString checks the length. If the length indicates that the value is a char, it calls Read and returns the character. Otherwise a EReadError exception is raised.

Note:	If the tagged data is a string with length = 1, it is char compatible. If length > 1, it is an error, however, the rest of the string data must be read to keep the reader in a consistent state. Each action that processes tagged data must leave the reader Position at the start of the next unread tag.


TReader.ReadCollection

TReader

Reads a collection from the reader object's stream and returns that character value.

procedure ReadCollection(Collection: TCollection);

Description

ReadCollection is a helper method used by other reader methods to read a tagged collection value at the current reader Position.  ReadCollection iterates through items in a collection so that each item in a collection property has an opportunity to stream out its properties.  This method does not write out the number of items and the collection indices, because a user can add or delete items.


TReader.ReadComponent

TReader	See also	Example

Reads the component specified by Instance from the stream and returns the component.

function ReadComponent(Component: TComponent): TComponent;

Description

ReadComponent is called by ReadRootComponent to read each of the components owned by Root. Users would not need to call ReadComponent directly.

ReadComponent handles the loading and initialization process for each component. After loading all the components in the list, ReadComponents calls the Loaded method of each loaded component in the order it read them. ReadComponent manages the complexities of reading the component from the stream through calls to other reader methods and to the component’s methods.


TReader.ReadComponents

TReader

Reads a list of owned components from the reader object's associated stream.

type TReadComponentsProc = procedure(Component: TComponent) of object;

procedure ReadComponents(AOwner, AParent: TComponent; Proc: TReadComponentsProc);

Description

ReadComponents is used internally by the Delphi environment for design-time streaming. Do not call ReadComponents directly.

ReadComponents first sets the reader object's Root and Owner properties to the component passed in the AOwner parameter and sets its Parent property to AParent. Next ReadComponents reads components by calling the ReadComponent method, passing each returned component to the method passed in Proc.

Note:	ReadComponents is used at design-time for clipboard cut and paste of multiple components.


TReader.ReadCurrency

TReader	See also

Reads a Currency value from the reader object's stream and returns its value.

function ReadCurrency: Currency;

Description;

ReadCurrency is a helper method used by other reader methods to read a tagged Currency data value at the current reader Position. ReadCurrency first checks the value type (TValueType) by calling the ReadValue method. If the item is a vaCurrency ReadCurrency calls Read and returns the value. Otherwise it calls ReadInteger.


TReader.ReadDate

TReader	See also

Reads a TDateTime value from the reader object's stream and returns its value.

function ReadDate: TDateTime;

Description

ReadDate is a helper method used by other reader methods to read a tagged TDateTime data value at the current reader Position. ReadDate first checks the value type (TValueType) by calling the ReadValue method. If the item is a vaDate ReadDate calls Read and returns the value. Otherwise it calls ReadInteger.


TReader.ReadFloat

TReader	See also

Reads a floating-point number from the reader object's stream and returns its value.

function ReadFloat: Extended;

Description

ReadFloat is a helper method used by other reader methods to read a tagged floating-point data value at the current reader Position. ReadFloat first checks the value type (TValueType) by calling the ReadValue method. If the item is a vaExtended ReadFloat calls Read and returns the float value. Otherwise it calls ReadInteger.


TReader.ReadIdent

TReader	See also

Reads an identifier from the reader object's stream and returns the identifier.

function ReadIdent: string;

Description

ReadIndent is a helper method used by other reader methods to read an identifying type at the current reader Position. ReadIndent first checks the value type (TValueType) by calling the ReadValue method. If the item is:

A vaIdent type, ReadIndent calls Read and returns the identifier string value.

A vaFalse type, ReadIdent returns the string ‘False.’

A vaTrue type, ReadIdent returns the string ‘True.’

A vaNil type, ReadIdent returns the string ‘Nil.’

Otherwise it raises an EReadError exception.


TReader.ReadInt64

TReader	See also

Reads an 64-bit integer from the reader object's stream and returns its value.

function ReadInt64: Int64;

Description

ReadInt64 is a helper method used by other reader methods to read a tagged 64-bit integer value at the current reader Position. ReadInt64 first checks the value type (TValueType) by calling the ReadValue method. If the item is a vaInt64, ReadInt64 calls Read and returns the integer value. Otherwise it calls ReadInteger, in case the value was saved in another integer format.


TReader.ReadInteger

TReader	See also

Reads an integer-type number from the reader object's stream and returns its value.

function ReadInteger: Longint;

Description

ReadInteger is a helper method used by other reader methods to read a tagged integer value at the current reader Position. ReadInteger first checks the value type (TValueType) by calling the ReadValue method. If the item is a vaString or a vaInt8, vaInt16 or vaInt32 type , ReadInteger calls Read and returns the integer value. Otherwise it raises an EReadError exception.


TReader.ReadListBegin

TReader	See also

Reads a start-of-list marker from the reader object's associated stream.

procedure ReadListBegin;

Description

ReadListBegin is used by other methods that iterate through a list of items to ensure that the type about to be read is a list. ReadListBegin is also used by component writers in defined property ReadData methods.

If the next item in the stream is not a start-of list marker as written by the WriteListBegin method, ReadListBegin raises an EReadError exception.

A call to ReadListBegin is generally followed by a reading loop that terminates when the EndOfList method returns True, indicating that an end-of-list marker is next on the stream, at which point a call to ReadListEnd is required.


TReader.ReadListEnd

TReader	See also

Reads an end-of-list marker from the reader object's associated stream.

procedure ReadListEnd;

Description

ReadListEnd is used by other methods that iterate through a list of items to signal the end of a group of items being read. ReadListEnd is also used by component writers in defined property ReadData methods.

A call to ReadListEnd is generally preceded by a reading loop that terminates when the EndOfList method returns True, indicating that an end-of-list marker is next on the stream.

If the item read is not an end-of-list marker, ReadListEnd raises an EReadError exception. A call to ReadListEnd must correspond to a preceding call to ReadListBegin.


TReader.ReadPrefix

TReader	See also

Reads preliminary information concerning form inheritance for a component.

type

  TFilerFlag = (ffInherited, ffChildPos, ffInline);

  TFilerFlags = set of TFilerFlag;

procedure ReadPrefix(var Flags: TFilerFlags; var AChildPos: Integer); virtual;

Description

ReadPrefix is used internally by the Delphi streaming system. It is called automatically by ReadComponent to read flags that determine whether a component in an inherited form (ffInherited), whether its creation order in the form is important (ffChildPos), and whether it is a top-level component such as a form or data module (ffInline) . It also reads the component’s position in the ancestor form's creation order if the ffChildPos flag is set. When a writer object writes a component to its stream, it prefaces the component with these flags.


TReader.ReadProperty

TReader	See also

Reads a property name and value from the reader’s stream.

procedure ReadProperty(AInstance: TPersistent);

Description

ReadProperty is used internally by the Delphi streaming system. It

1.	Reads a property name from the stream.

2.	Determines whether this is a valid property for an object of type AInstance

3.	Determines the type of the property’s value.

4.	Reads the property value.


TReader.ReadRootComponent

TReader	See also

Reads a component and all its owned components from the reader object's stream.

function ReadRootComponent(Root: TComponent): TComponent;

Description

Do not call ReadRootComponent directly. It is used internally by the streaming system. When the reader object is created by its stream in TStream.ReadComponent, it immediately calls the ReadRootComponent method, which initiates the streaming sequence of restoring an object.

ReadRootComponent first calls the ReadSignature method to ensure that it is reading a proper component. ReadRootComponent also handles initializations and fixup references. For example, the component passed in Root becomes the value of the Root property for the reader object.

ReadRootComponent calls the component’s ReadState method, which calls back to TReader.ReadData. TComponent.ReadState is virtual, thus providing an opportunity for the component to prepare itself for being loaded with the new data from the stream.


TReader.ReadSignature

TReader	See also

Reads the filer signature from the reader object's associated stream.

procedure ReadSignature;

Description

ReadSignature is used by several routines to ensure that the file about to be read is a valid Delphi component stream. For example, ReadRootComponent, calls ReadSignature before reading its component from the stream. By checking for the signature before loading objects, the reader object can guard against inadvertently reading invalid or corrupted data.

The signature is a four-character sequence.


TReader.ReadSingle

TReader	See also

Reads a Single value from the reader object's stream and returns its value.

function ReadSingle: Single;

Description

ReadSingle is a helper method used by other reader methods to read a tagged Single data value at the current reader Position. ReadSingle first checks the value type (TValueType) by calling the ReadValue method. If the item is a vaSingle ReadCurrency calls Read and returns the value. Otherwise it calls ReadInteger.


TReader.ReadStr

TReader	See also

Reads a string value.

function ReadStr: string;

Description

Do not call ReadStr directly. ReadStr is for internal use by certain VCL components.

Warning:	Use ReadString instead for reading component strings to streams. ReadStr can corrupt data if not used correctly.


TReader.ReadString

TReader	See also

Reads a tagged string value written by WriteString from the reader object's stream and returns its contents.

function ReadString: string;

Description

ReadString is a helper method used by other reader methods to read a string at the current reader Position. ReadString first checks the value type (TValueType) by calling the ReadValue method. If the item is a vaString or a vaLString type ReadString calls Read and returns the string. Otherwise it raises an EReadError exception.

Warning:	Always use ReadString for reading component strings to streams. The similarly-named ReadStr method is for internal use only by certain VCL components.


TReader.ReadValue

TReader	See also

Reads the type of the next item on the reader object's stream and returns with the stream positioned after the value-type indicator.

function ReadValue: TValueType;

Description

ReadValue is used by other reader methods when the subsequent processing depends upon a type check of the data about to be read.

The TValueType type defines the kinds of values written to and read from filer objects. Delphi's filers use a tagged value system, where each value on the stream is preceded by a prefix indicating its type. Those prefixes are of type TValueType.


TReader.ReadWideString

TReader	See also

Reads a tagged wide string value from the reader object's stream and returns its contents.

function ReadWideString: WideString;

Description

ReadWideString is a helper method used by other reader methods to read a wide string at the current reader Position. ReadWideString first checks the value type (TValueType) by calling the ReadValue method. If the item is a vaWString type ReadString calls Read and returns the string. Otherwise it raises an EReadError exception.


TReader.ReferenceName

TReader 	See also

Generates an OnReferenceName event.

procedure ReferenceName(var Name: string); virtual;

Description

Do not use the ReferenceName method.  It is used internally.


TReader.SetName

TReader	See also

Allows a reader object to change the names of components being read from the associated stream before assigning them to the Name properties of the components.

procedure SetName(Component: TComponent; var Name: string); virtual;

Description

SetName is called by ReadComponent. After reading the name, ReadComponent passes the name read from the stream in the Name parameter to SetName. Name is a var parameter, so SetName can change the string before returning.

SetName also calls any event handler attached to the OnSetName event, passing the name string in a var parameter, so the attached handler can also modify the string.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TFiler


TReferenceField

Hierarchy	Properties	Methods	Events

A TReferenceField object represents a REF field in a dataset.

Unit

DB

Description

Reference fields store a pointer or reference to another persistent object.

TReferenceField introduces new properties for working with references contained in other tables and for working directly with the reference field values. It also overrides the constructor to initialize the field to type ftReference.


TReferenceField properties

TReferenceField	Alphabetically	Legend

In TReferenceField

AsVariant

ReferenceTableName

Derived from TDataSetField

Fields

NestedDataSet

Derived from TObjectField

AsString

DataSet

FieldCount

FieldKind

FieldValues

HasConstraints

ObjectType

UnNamed

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSize

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldName

FieldNo

FullName

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TReferenceField properties

TReferenceField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldCount

FieldKind

FieldName

FieldNo

Fields

FieldValues

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Name

NestedDataSet

NewValue

ObjectType

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

ReferenceTableName

Required

Size

Tag

Text

UnNamed

ValidChars

Value

VCLComObject

Visible


TReferenceField.AsVariant

TReferenceField	see also

Represents the value of the reference field as a variant.

property AsVariant: Variant;

Description

Use AsVariant to

Assign the reference field value to a variant variable.

Assign a variant value to the reference field.

AsVariant represents the field value as a Variant array of bytes.


TReferenceField.ReferenceTableName

TReferenceField

Name of the table that contains the reference associated with the reference field.

property ReferenceTableName: string;

Description

When ReferenceTableName is set, an insert and post on the table of the reference field can be executed.


TReferenceField events

TReferenceField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TReferenceField events

TReferenceField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TReferenceField methods

TReferenceField	Alphabetically

In TReferenceField

Create

Derived from TObjectField

Destroy

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TReferenceField methods

TReferenceField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TReferenceField.Create

TReferenceField	see also

Create creates an instance of TReferenceField.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TReferenceField. Create calls the inherited Create method of TField and then sets the DataType to ftReference.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TObjectField


TRegistryIniFile

Hierarchy	Properties	Methods	See also

TRegistryIniFile is a wrapper for the Windows system registry.

Unit

registry

Description

TRegistryIniFile presents a simple interface to the system registry and hides the need to know about the underlying structure of the registry. TRegistryIniFile enables handling the Windows system registry as if it were a Windows 3.x INI file. Instead of processing an INI file, however, TRegistryIniFile reads from and writes to the system registry. This enables existing applications that used INI files to use the system registry with a minimum of coding changes. Because TRegistryIniFile, like TIniFile, descends from TCustomIniFile, developers may prefer to use it instead of TRegistry in their applications.

TRegistryIniFile adapts the methods inherited from TCustomIniFile to operate on Registry entries rather than INI file keys. It reinterprets the FileName property as a subkey under the system registry’s root key (HKEY_CURRENT_USER by default). What corresponds to a section in an INI file is treated as a key in the system registry, and what corresponds to data entries under a section in an INI file are treated as data values under a key in the system registry.

TRegistryIniFile is particularly useful for migrating a 16-bit Windows 3.x application to 32-bit Windows. By finding all references to TIniFile in an application’s source code, replacing them with TRegistryIniFile, and recompiling the application, a developer can update an application to use the system registry instead of INI files without having to code any new logic into the application.

Note:	Information contained in existing users’ INI files is not migrated into the system registry using the method described above. A one-time operation to explicitly copy the INI file data, through TRegistryIniFile, must be used to do this.


TRegistryIniFile properties

TRegistryIniFile	Alphabetically	Legend

In TRegistryIniFile

RegIniFile

Derived from TCustomIniFile

FileName


TRegistryIniFile properties

TRegistryIniFile	By object	Legend

FileName

RegIniFile


TRegistryIniFile.RegIniFile
TRegistryIniFile..RegIniFile

TRegistryIniFile	See also

Contains an internal instance of a TRegIniFile object.

property RegIniFile: TRegIniFile;

Description

RegIniFile is used internally by the TRegistryIniFile object as the gateway connection between TRegistryIniFile methods and the system registry.


TRegistryIniFile methods

TRegistryIniFile	Alphabetically

In TRegistryIniFile

Create

DeleteKey

EraseSection

ReadDate

ReadDateTime

ReadFloat

ReadInteger

ReadSection

ReadSections

ReadSectionValues

ReadString

ReadTime

UpdateFile

WriteDate

WriteDateTime

WriteFloat

WriteInteger

WriteString

WriteTime

Derived from TCustomIniFile

ReadBool

SectionExists

ValueExists

WriteBool

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TRegistryIniFile methods

TRegistryIniFile	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

DeleteKey

Destroy

Dispatch

EraseSection

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadBool

ReadDate

ReadDateTime

ReadFloat

ReadInteger

ReadSection

ReadSections

ReadSectionValues

ReadString

ReadTime

SafeCallException

SectionExists

UpdateFile

ValueExists

WriteBool

WriteDate

WriteDateTime

WriteFloat

WriteInteger

WriteString

WriteTime


TRegistryIniFile.Create

TRegistryIniFile	See also

Creates a TRegistryIniFile object for an application.

constructor Create(const FileName string); overload;

constructor Create(const FileName string, AAccess:LongWord); overload;

Description

Create constructs a TRegistryIniFile and creates an internal TRegIniFile object used to access the system registry. TRegistryIniFile uses this TRegIniFile object as a helper object to provide much of its functionality.

FileName is used as the FileName property for the internal TRegIniFile object in the RegIniFile property.

AAccess intitializes the Access property of the internal TRegIniFile object.


TRegistryIniFile.DeleteKey

TRegistryIniFile	See also 	Example

Erases the data value associated with an INI file entry.

procedure DeleteKey(const Section, Ident: string); override;

Description

Call DeleteKey to erase a data value associated with an INI file entry. Section is string containing the name of an INI file section, and Ident is a string containing the name of the key from for which to set a nil value.

Note:	Attempting to erase a data value in a non-existent section or attempting to erase data from a non-existent key are not errors. In these cases, DeleteKey creates the section and key and sets its initial value to an empty value.


TRegistryIniFile.EraseSection

TRegistryIniFile	See also

Erases an entire section of an INI file.

procedure EraseSection(const Section: string); override;

Description

Call EraseSection to remove a section, all its keys, and their data values from an INI file. Section identifies the INI file section to remove. If a section cannot be removed, an exception is raised.


TRegistryIniFile.ReadDate

TRegistryIniFile	See also

Retrieves a date value from an INI file.

function ReadDate (const Section, Ident: string; Default: TDateTime): TDateTime; override;

Description

Call ReadDate to read a date value from an INI file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the date value. Default is the date value to return if the:

Section does not exist.

Key does not exist.

Data value for the key is not assigned.


TRegistryIniFile.ReadDateTime

TRegistryIniFile	See also

Retrieves a date-time value from an INI file.

function ReadDateTime (const Section, Ident: string; Default: TDateTime): Boolean; override;

Description

Call ReadDateTime to read a date-time value from an INI file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the date-time value. Default is the date-time value to return if the:

Section does not exist.

Key does not exist.

Data value for the key is not assigned.


TRegistryIniFile.ReadFloat

TRegistryIniFile	See also

Retrieves a float value from an INI file.

function ReadFloat (const Section, Ident: string; Default: Double): Double; override;

Description

Call ReadFloat to read a float value from an INI file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the float value. Default is the float value to return if the:

Section does not exist.

Key does not exist.

Data value for the key is not assigned.


TRegistryIniFile.ReadInteger

TRegistryIniFile	See also 	Example

Retrieves an integer value from an INI file.

function ReadInteger(const Section, Ident: string; Default: Longint): Longint; override;

Description

Call ReadInteger to read an integer value from an INI file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the value. Default is the integer value to return if the:

Section does not exist.

Key does not exist.

Data value for the key is not assigned.


TRegistryIniFile.ReadSection

TRegistryIniFile	See also

Reads all the key names from a specified section of an INI file into a string list.

procedure ReadSection (const Section: string; Strings: TStrings); override;

Description

Call ReadSection to retrieve the names of all keys within a specified section of an INI file into a string list object.

Section identifies the section from which to retrieve a list of key names. Strings specifies the string object to hold the retrieved names. Strings can point to a TString object such as a string list, or to a component property, such as Items for a TListBox component, that is a TString object itself.


TRegistryIniFile.ReadSections

TRegistryIniFile	See also

Reads the names of all sections in an INI file into a string list.

procedure ReadSections(Strings: TStrings); override;

Description

Call ReadSections to retrieve the names of all sections in an INI file into a string list object.

Strings specifies the string object to hold the retrieved names. Strings can point to a TString object, or to a component property, such as Items for a TListBox component, that is a TString object itself.


TRegistryIniFile.ReadSectionValues

TRegistryIniFile	See also	Example

Reads the values from all keys within a section of an INI file into a string list.

procedure ReadSectionValues(const Section: string; Strings: TStrings); override;

Description

Call ReadSectionValues to read the values from all keys within a specified section of an INI file into a string list object. Section identifies the section in the file from which to read key values. Strings is the string list object into which to read the values.

Strings specifies the string object to hold the retrieved names. Strings can point to a TString object, or to a component property, such as Items for a TListBox component, that is a TString object itself.


TRegistryIniFile.ReadString

TRegistryIniFile	See also 	Example

Retrieves a string value from an INI file.

function ReadString(const Section, Ident, Default: string): string; override;

Description

Call ReadString to read a string value from an INI file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the value. Default is the string value to return if the:

Section does not exist.

Key does not exist.

Data value for the key is not assigned.


TRegistryIniFile.ReadTime

TRegistryIniFile	See also

Retrieves a time value from an INI file.

function ReadTime (const Section, Ident: string; Default: TDateTime): TDateTime; override;

Description

Call ReadTime to read a time value from an INI file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the time value. Default is the time value to return if the:

Section does not exist.

Key does not exist.

Data value for the key is not assigned.


TRegistryIniFile.UpdateFile

TRegistryIniFile	See also

Flushes buffered INI file data to disk.

function UpdateFile; override;

Description

Call UpdateFile to flush buffered reads from and writes to the INI file to disk. UpdateFile is useful under Windows95, but has no effect under Windows NT as NT does not buffer INI file reads and writes.


TRegistryIniFile.WriteDate

TRegistryIniFile	See also

Writes a date value to an INI file.

procedure WriteDate(const Section, Ident: string; Value: TDateTime); override;

Description

Call WriteDate to write a date value to an INI file. Section identifies the section in the file that contain the key to which to write. Ident is the name of the key for which to set a value. Value is the date value to write.

Note:	Attempting to write a data value to a non-existent section or attempting to write data to a non-existent key are not errors. In these cases, WriteDate creates the section and key and sets its initial value to Value.


TRegistryIniFile.WriteDateTime

TRegistryIniFile	See also

Writes a date-time value to an INI file.

procedure WriteDateTime(const Section, Ident: string; Value: TDateTime); override;

Description

Call WriteDateTime to write a date-time value to an INI file. Section identifies the section in the file that contain the key to which to write. Ident is the name of the key for which to set a value. Value is the date-time value to write.

Note:	Attempting to write a data value to a non-existent section or attempting to write data to a non-existent key are not errors. In these cases, WriteDateTime creates the section and key and sets its initial value to Value.


TRegistryIniFile.WriteFloat

TRegistryIniFile	See also

Writes a float value to an INI file.

procedure WriteFloat(const Section, Ident: string; Value: Double); override;

Description

Call WriteFloat to write a float value to an INI file. Section identifies the section in the file that contain the key to which to write. Ident is the name of the key for which to set a value. Value is the float value to write.

Note:	Attempting to write a data value to a non-existent section or attempting to write data to a non-existent key are not errors. In these cases, WriteFloat creates the section and key and sets its initial value to Value.


TRegistryIniFile.WriteInteger

TRegistryIniFile	See also 	Example

Writes an integer value to an INI file.

procedure WriteInteger(const Section, Ident: string; Value: Longint); override;

Description

Call WriteInteger to write an integer value to an INI file. Section identifies the section in the file that contain the key to which to write. Ident is the name of the key for which to set a value. Value is the integer value to write.

Note:	Attempting to write a data value to a non-existent section or attempting to write data to a non-existent key are not errors. In these cases, WriteInteger creates the section and key and sets its initial value to Value.


TRegistryIniFile.WriteString

TRegistryIniFile	See also 	Example

Writes a string value to an INI file.

procedure WriteString(const Section, Ident, Value: string); override;

Description

Call WriteString to write a string value to an INI file. Section identifies the section in the file that contain the key to which to write. Ident is the name of the key for which to set a value. Value is the string value to write.

Note:	Attempting to write a data value to a non-existent section or attempting to write data to a non-existent key are not errors. In these cases, WriteString creates the section and key and sets its initial value to Value.


TRegistryIniFile.WriteTime

TRegistryIniFile	See also

Writes a time value to an INI file.

procedure WriteTime(const Section, Ident: string; Value: TDateTime); override;

constDescription

Call WriteTime to write a time value to an INI file. Section identifies the section in the file that contain the key to which to write. Ident is the name of the key for which to set a value. Value is the time value to write.

Note:	Attempting to write a data value to a non-existent section or attempting to write data to a non-existent key are not errors. In these cases, WriteTime creates the section and key and sets its initial value to Value.


Accessibility

Read-only


Hierarchy

TObject

TCustomIniFile


TRegIniFile

Hierarchy	Properties	Methods	See also	Example

TRegIniFile is a low-level wrapper for the Windows 95/NT system registry.

Unit

registry

Description

TRegIniFile presents a simple interface to the system registry, hiding the need to know about the underlying structure of the registry. TRegIniFile acts as a helper object to TRegistryIniFile, which descends from TCustomIniFile (and is therefore more widely compatible with other types of INI file classes).

TRegIniFile enables handling the Windows 95/NT system registry as if it were a Windows 3.x INI file. Instead of processing an INI file, however, TRegIniFile reads from and writes to the system registry.

Although TRegIniFile descends from TRegistry, it adds the properties and methods used by a TIniFile object. The FileName passed to a TRegIniFile object becomes a subkey under the system registry’s root key (HKEY_CURRENT_USER by default). What corresponds to a section in an INI file is treated as a key in the system registry, and what corresponds to data entries under a section in an INI file are treated as data values under a key in the system registry.

Note:	TRegIniFile is intended to be used primarily as a helper object to TRegistryIniFile, which unifies the interface to INI files and the system registry. However, applications can use TRegIniFile directly.


TRegIniFile properties

TRegIniFile	Alphabetically	Legend

In TRegIniFile

FileName

Derived from TRegistry

Access

CurrentKey

CurrentPath

LazyWrite

RootKey


TRegIniFile properties

TRegIniFile	By object	Legend

Access

CurrentKey

CurrentPath

FileName

LazyWrite

RootKey


TRegIniFile.FileName

TRegIniFile	See also

Specifies the name of the key opened or created in the system registry.

property FileName: string;

Description

Query FileName to determine the name of the key in the system registry that is the root key for all TRegIniFile operations.


TRegIniFile methods

TRegIniFile	Alphabetically

In TRegIniFile

Create

DeleteKey

EraseSection

ReadBool

ReadInteger

ReadSection

ReadSections

ReadSectionValues

ReadString

WriteBool

WriteExpandString

WriteInteger

WriteString

Derived from TRegistry

CloseKey

CreateKey

DeleteValue

Destroy

GetDataInfo

GetDataSize

GetDataType

GetKeyInfo

GetKeyNames

GetValueNames

HasSubKeys

KeyExists

LoadKey

MoveKey

OpenKey

ReadBinaryData

ReadCurrency

ReadDate

ReadDateTime

ReadFloat

ReadTime

RegistryConnect

RenameValue

ReplaceKey

RestoreKey

SaveKey

UnLoadKey

ValueExists

WriteBinaryData

WriteCurrency

WriteDate

WriteDateTime

WriteFloat

WriteTime

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TRegIniFile methods

TRegIniFile	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

CloseKey

Create

CreateKey

DefaultHandler

DeleteKey

DeleteValue

Destroy

Dispatch

EraseSection

FieldAddress

Free

FreeInstance

GetDataInfo

GetDataSize

GetDataType

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetKeyInfo

GetKeyNames

GetValueNames

HasSubKeys

InheritsFrom

InitInstance

InstanceSize

KeyExists

LoadKey

MethodAddress

MethodName

MoveKey

NewInstance

OpenKey

ReadBinaryData

ReadBool

ReadCurrency

ReadDate

ReadDateTime

ReadFloat

ReadInteger

ReadSection

ReadSections

ReadSectionValues

ReadString

ReadTime

RegistryConnect

RenameValue

ReplaceKey

RestoreKey

SafeCallException

SaveKey

UnLoadKey

ValueExists

WriteBinaryData

WriteBool

WriteCurrency

WriteDate

WriteDateTime

WriteExpandString

WriteFloat

WriteInteger

WriteString

WriteTime


TRegIniFile.Create

TRegIniFile	See also	Example

Creates a TRegIniFile object for an application.

constructor Create(const FileName string); overload;

constructor Create(const FileName string, AAccess:LongWord); overload;

Description

Use Create to construct a TRegIniFile object for an application.

FileName initializes the FileName property.

AAccess initializes the Access property. If no AAccess parameter is supplied, Access is initialized to KEY_ALL_ACCESS.


TRegIniFile.DeleteKey

TRegIniFile	See also

Erases a data value that is associated with a key.

procedure DeleteKey(const  Ident: string);

Description

Call DeleteKey to erase a data value associated with a key. Section is string containing the name of the system registry key containing the value to delete. Ident is a string containing the name of the data value to delete.

Note:	DeleteKey for TRegIniFile obscures the DeleteKey method of TRegistry, from which TRegIniFile descends. You can access TRegistry's DeleteKey method by casting the call to DeleteKey as type TRegistry, or by using the scope resolution operator.

Note:	On Windows 95, DeleteKey will delete the key and all its subkeys. On Windows NT, the subkeys must be explicitly deleted by separate calls to DeleteKey.


TRegIniFile.EraseSection

TRegIniFile	See also

Deletes a key and its data values in the system registry.

procedure EraseSection(const Section: string);

Description

Call EraseSection to remove a key and its data values from the system registry. Section identifies the key to delete.


TRegIniFile.ReadBool

TRegIniFile	See also

Retrieves a Boolean value from a specified data value associated with a key.

function ReadBool(const Section, Ident: string; Default: Boolean): Boolean;

Description

Call ReadBool to retrieve a Boolean value from a specified data value associated with a key.

Section is a string that identifies the key from which to retrieve a data value. Ident is a string that identifies the name of the data value to return. Default is a Boolean value to use if there is no key corresponding to Section or no data value corresponding to Ident.

Note:	This function overrides the ReadBool function of TRegistry, from which TRegIniFile is derived. To call the ReadBool function of TRegistry instead of this function, cast the call to ReadBool as TRegistry.


TRegIniFile.ReadInteger

TRegIniFile	See also

Retrieves an integer value from a specified data value (Ident) associated with a key (Section).

function ReadInteger(const Section, Ident: string; Default: Longint): Longint;

Description

Call ReadInteger to retrieve an integer value from a specified data value associated with a key.

Section is a string that identifies the key from which to retrieve a data value. Ident is a string that identifies the name of the data value to return. Default is an integer value to use if there is no key corresponding to Section or no data value corresponding to Ident.

Note:	This function overrides the ReadInteger function of TRegistry, from which TRegIniFile is derived. To call the ReadInteger function of TRegistry instead of this function, cast the call to ReadInteger as TRegistry.


TRegIniFile.ReadSection

TRegIniFile	See also

Retrieves the names of all data values associated with a key, and stores the names in a TStrings object.

procedure ReadSection(const Section: string; Strings: TStrings);

Description

Call ReadSection to retrieve the names of all data values associated with a key into a TStrings object. Section is a string identifying the key for which to retrieve data-value names.

Strings specifies the string object to hold the retrieved names. Strings can point to a TStrings object such as a string list, or to a component property, such as Items for a TListBox component, that is a TStrings object itself.


TRegIniFile.ReadSections

TRegIniFile	See also

Retrieves the names of all subkeys associated with the current key.

procedure ReadSections(Strings: TStrings);

Description

Call ReadSections to retrieve the names of all subkeys associated with the current key.

Strings specifies the string object to hold the retrieved names. Strings can point to a TStrings object, or to a component property, such as Items for a TListBox component, that is a TStrings object itself.


TRegIniFile.ReadSectionValues

TRegIniFile	See also

Retrieves the data-values associated with a specified key, and stores the retrieved values in a string object.

procedure ReadSectionValues(const Section: string; Strings: TStrings);

Description

Call ReadSectionValues to read all data values associated with a specified key into a string object. Section is the name of the key from which to retrieve data-values. Strings specifies the string object to hold the retrieved values.

Strings can point to a TStrings object, or to a component property, such as Items for a TListBox component, that is a TStrings object itself. Use the Values property of the string object to access a specific string in the object.


TRegIniFile.ReadString

TRegIniFile	See also

Retrieves a string value from a specified data value (Ident) associated with a key (Section).

function ReadString(const Section, Ident, Default: string): string;

Description

Call ReadString to retrieve a string value from a specified data value associated with a key.

Section is a string that identifies the key from which to retrieve a data value. Ident is a string that identifies the name of the data value to return. Default is a string value to use if there is no key corresponding to Section or no data value corresponding to Ident.

Note:	This function overrides the ReadString function of TRegistry, from which TRegIniFile is derived. To call the ReadString function of TRegistry instead of this function, cast the call to ReadString as TRegistry.


TRegIniFile.WriteBool

TRegIniFile	See also

Writes a Boolean value to a specified data value associated with a specified key.

procedure WriteBool(const Section, Ident: string; Value: Boolean);

Description

Call WriteBool to store a Boolean value in a data value associated with a specified key.

Section is a string identifying the key into which to store a data value. Ident is a string identifying the name of the data value into which to write. Value is the Boolean value to write into the data value.

Note:	This function overrides the WriteBool procedure of TRegistry, from which TRegIniFile is derived. To call the WriteBool procedure of TRegistry instead of this procedure, cast the call to WriteBool as TRegistry.


TRegIniFile.WriteInteger

TRegIniFile	See also

Writes a long integer value to a specified data value associated with a specified key.

procedure WriteInteger(const Section, Ident: string; Value: Longint);

Description

Call WriteInteger to store an integer value in a data value associated with a specified key.

Section is a string identifying the key into which to store a data value. Ident is a string identifying the name of the data value into which to write. Value is the integer value to write into the data value.

Note:	This function overrides the WriteInteger procedure of TRegistry, from which TRegIniFile is derived. To call the WriteInteger procedure of TRegistry instead of this procedure, cast the call to WriteInteger as TRegistry.


TRegIniFile.WriteString

TRegIniFile	See also	Example

Writes a string value to a specified data value associated with a specified key.

procedure WriteString(const  Section, Ident, Value: string);

Description

Call WriteString to store a string value in a data value associated with a specified key.

Section is a string identifying the key into which to store a data value. Ident is a string identifying the name of the data value into which to write. Value is the string value to write into the data value.

Note:	This function overrides the WriteString procedure of TRegistry, from which TRegIniFile is derived. To call the WriteString procedure of TRegistry instead of this procedure, cast the call to WriteString as TRegistry.


Accessibility

Read-only


Hierarchy

TObject

TRegistry


TRegistry

Hierarchy	Properties	Methods	Example

TRegistry is a low-level wrapper for the system registry and functions that operate on the registry.

Unit

registry

Description

Use TRegistry to encapsulate access to the Windows system registry in an application. The registry is a database that an application can use to store and retrieve configuration information. Configuration information is stored in a hierarchical tree. Each node in the tree is called a key. Every key can contain subkeys and data values that represent part of the configuration information for an application.

All keys that an application creates, opens, reads, or writes are subkeys of predefined root keys. By default, a TRegistry object is created with a root key of HKEY_CURRENT_USER.

Only one key is accessible at a time in a TRegistry object. To determine the key that is currently accessible, read the value of the CurrentKey property. TRegistry methods enable an application to open, close, save, move, copy, and delete keys.

One or more data values containing actual configuration information can be stored in a key. TRegistry methods enable an application to query a key to see if it contains data, to read data in a key, and to write data to a key.


TRegistry properties

TRegistry	Alphabetically	Legend

In TRegistry

Access

CurrentKey

CurrentPath

LazyWrite

RootKey


TRegistry properties

TRegistry	By object	Legend

Access

CurrentKey

CurrentPath

LazyWrite

RootKey


TRegistry.Access

TRegistry	See also

Specifies the level of access to use when opening keys.

property Access: LongWord;

Description

Use Access to specify the level of security access to use when opening keys. The OpenKey method uses the value of Access when opening a registry key. Access is initialized by the TRegistry constructor, but can be altered before calling OpenKey.

The value of Access is a set of flags or’d together, where each flag indicates a type of permission. Choose a value that grants sufficient permission to allow the desired actions while not exceeding the access level of the system running the application. The following table lists the flags that can be included:

Flag	Meaning

KEY_ALL_ACCESS	combination of KEY_READ, KEY_WRITE, and KEY_CREATE_LINK.

KEY_READ	combination of KEY_QUERY_VALUE, KEY_ENUMERATE_SUB_KEYS, and KEY_NOTIFY.

KEY_WRITE	combination of KEY_SET_VALUE and KEY_CREATE_SUB_KEY.

KEY_QUERY_VALUE	grants permission to query subkey data.

KEY_ENUMERATE_SUB_KEYS	grants permission to enumerate subkeys.

KEY_NOTIFY	grants ability to receive change notifications.

KEY_SET_VALUE	grants permission to set subkey data.

KEY_CREATE_SUB_KEY	grants permission to create subkeys.

KEY_CREATE_LINK	grants permission to create symbolic links.

KEY_EXECUTE	restricts permission to read-only access.

Note:	Access is ignored by the CreateKey method, which always uses KEY_ALL_ACCESS.


TRegistry.CurrentKey

TRegistry	See also

Specifies the registry key that is currently open.

property CurrentKey: HKEY;

Description

Use CurrentKey to determine the registry key that is currently open. All operations performed by TRegistry affect only the current key. To access another key, call the OpenKey or OpenKeyReadOnly method.


TRegistry.CurrentPath

TRegistry	See also

Indicates the registry path associated with the current key.

property CurrentPath: String;

Description

Use CurrentPath to determine the registry path of the current key. The system registry is hierarchical, and CurrentPath returns a string that spells out the hierarchy of keys from the root key to the current key, inclusive.

CurrentPath is automatically reset each time a different key becomes the current key.


TRegistry.LazyWrite

TRegistry	See also

Specifies how keys are written to the registry when calling the CloseKey procedure.

property LazyWrite: Boolean;

Description

Use LazyWrite to specify how keys are written to the registry. LazyWrite is initialized to True when a registry object is first created. When LazyWrite is True, keys are written to the registry when they are closed, but the CloseKey procedure may return before the write operation takes place.

When LazyWrite is False, keys are written to the registry before CloseKey returns. Set LazyWrite to False only when absolutely necessary. Setting LazyWrite to False guarantees that the changes an application makes to keys are written to the registry before further application processing takes place, but it uses more system resources when keys are closed. If LazyWrite is False, and an application is displaying or changing many registry entries, there will be a degradation to application performance.


TRegistry.RootKey

TRegistry	See also	Example

Specifies the root key for the TRegistry object in an application.

property RootKey: HKEY;

Description

Use RootKey to determine the hierarchy of subkeys an application can access, or to specify the root key for the application.

By default, RootKey is set to HKEY_CURRENT_USER when the registry object is created. To change the root key, specify a valid integer value for the RootKey property.

Note:	For some operations, such as LoadKey or RegistryConnect, an application may need to change the default value of RootKey.


TRegistry methods

TRegistry	Alphabetically

In TRegistry

CloseKey

Create

CreateKey

DeleteKey

DeleteValue

Destroy

GetDataInfo

GetDataSize

GetDataType

GetKeyInfo

GetKeyNames

GetValueNames

HasSubKeys

KeyExists

LoadKey

MoveKey

OpenKey

OpenKeyReadOnly

ReadBinaryData

ReadBool

ReadCurrency

ReadDate

ReadDateTime

ReadFloat

ReadInteger

ReadString

ReadTime

RegistryConnect

RenameValue

ReplaceKey

RestoreKey

SaveKey

UnLoadKey

ValueExists

WriteBinaryData

WriteBool

WriteCurrency

WriteDate

WriteDateTime

WriteExpandString

WriteFloat

WriteInteger

WriteString

WriteTime

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TRegistry methods

TRegistry	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

CloseKey

Create

CreateKey

DefaultHandler

DeleteKey

DeleteValue

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetDataInfo

GetDataSize

GetDataType

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetKeyInfo

GetKeyNames

GetValueNames

HasSubKeys

InheritsFrom

InitInstance

InstanceSize

KeyExists

LoadKey

MethodAddress

MethodName

MoveKey

NewInstance

OpenKey

OpenKeyReadOnly

ReadBinaryData

ReadBool

ReadCurrency

ReadDate

ReadDateTime

ReadFloat

ReadInteger

ReadString

ReadTime

RegistryConnect

RenameValue

ReplaceKey

RestoreKey

SafeCallException

SaveKey

UnLoadKey

ValueExists

WriteBinaryData

WriteBool

WriteCurrency

WriteDate

WriteDateTime

WriteExpandString

WriteFloat

WriteInteger

WriteString

WriteTime


TRegistry.CloseKey

TRegistry	See also	Example

Writes the current key to the registry and closes the key.

procedure CloseKey;

Description

Call CloseKey to write the current key to the registry and close the key. An application should not keep keys open any longer than necessary. Many TRegistry methods routinely call CloseKey after reading from or writing to the registry. Calling CloseKey when there is no current key has no effect.

Note:	When an application closes a key, the key is written to the registry. The LazyWrite property determines how the write takes place.


TRegistry.Create

TRegistry	See also	Example

Creates a TRegistry object for an application.

constructor Create; overload;

constructor Create(AAccess:LongWord); overload;

Description

Create constructs a TRegistry object, and sets the RootKey property of TRegistry to HKEY_CURRENT_USER and the LazyWrite property to True.. If an AAccess parameter is supplied, this value is used to initialize the Access property. Otherwise, Access is initialized to KEY_ALL_ACCESS.


TRegistry.CreateKey

TRegistry	See also	Example

Creates a new key in the registry.

function CreateKey(const Key: String): Boolean;

Description

Use CreateKey to add a new key to the registry. Key is the name of the key to create. Key can be an absolute or relative name. An absolute key begins with a backslash (\) and is a subkey of the root key. A relative key is a subkey of the current key.

CreateKey returns True if key creation is successful. On error, an exception is raised. Attempting to create a key that already exists has no effect.

CreateKey creates only non-volatile keys. If you need to create volatile keys on Windows NT, you must call the Windows API directly.

CreateKey creates keys with a security access of KEY_ALL_ACCESS. If you need to create keys with more restricted access, you must call the Windows API directly.

A key created by CreateKey has no values. To set key values, use the WriteCurrency, WriteBinaryData, WriteBool, WriteDate, WriteDateTime, WriteFloat, WriteInteger, WriteString, or WriteTime procedures.


TRegistry.DeleteKey

TRegistry	See also	Example

Removes a specified key and its associated data from the registry.

function DeleteKey(const Key: String): Boolean;

Description

Call DeleteKey to remove a specified key and its associated data, if any, from the registry. Under Windows 95, if the key has subkeys, the subkeys and any associated data are also removed. Under Windows NT, subkeys must be explicitly deleted by separate calls to DeleteKey.

DeleteKey returns True if key deletion is successful. On error, DeleteKey returns False.


TRegistry.DeleteValue

TRegistry	See also

Erases a data value that is associated with the current key.

function DeleteValue(const Name: String): Boolean;

Description

Call DeleteValue to remove a specific data value associated with the current key. Name is string containing the name of the value to delete. Keys can contain multiple data values, and every value associated with a key has a unique name.

DeleteValue returns True if the deletion is successful, False if the deletion fails.


TRegistry.Destroy

TRegistry	See also

Closes the current key and destroys the TRegistry object.

destructor Destroy; override;

Description

Destroy closes the current key and frees the resources allocated for a registry object when it is no longer needed.


TRegistry.GetDataInfo

TRegistry	See also

Returns information about a specified data value associated with the current key.

type

  TRegDataType = (rdUnknown, rdString, rdExpandString, rdInteger, rdBinary);

  TRegDataInfo = record

    RegData: TRegDataType;

    DataSize: Integer;

  end;

function GetDataInfo(const ValueName: String; var Value: TRegDataInfo): Boolean;

Description

Call GetDataInfo to get information about a data value associated with the current key. ValueName is a string containing the name of the data value to query. Value is a record of type TRegDataInfo in which information about the data value is returned. If the data value is of type rdString or rdExpandString, the size of the data value includes an extra byte for the terminating null character.

GetDataInfo returns True if data value information is returned. If GetDataInfo fails, it returns False, and the Value record is filled with zeros.

Value is a record of type TRegDataInfo that is declared in an application. Records of type TRegDataInfo contain two fields: a field called RegData, of type TRegDataType, that specifies the data type of the data value; and a field called DataSize that specifies the size, in bytes, of the data value. RegData can have the following values:

Value	Meaning

rdUnknown	Data value type is of no defined value type.

rdString	Data value type is a null-terminated string. It is a Unicode or ANSI string depending on whether the application calls the Unicode or ANSI string functions.

rdExpandString	Data value type is a null-terminated string that contains unexpanded references to environment variables (for example, "%PATH%"). It is a Unicode or ANSI string depending on whether the application calls the Unicode or ANSI string functions.

rdInteger	Data value type is a32-bit number.

rdBinary	Data value type is binary data, in any form.


TRegistry.GetDataSize

TRegistry	See also

Returns the size, in bytes, of a specified data value associated with the current key.

function GetDataSize(const ValueName: String): Integer;

Description

Call GetDataSize to determine the size, in bytes, of a data value associated with the current key. ValueName is a string containing the name of the data value to query.

On success, GetDataSize returns the size of the data value. On failure, GetDataSize returns -1.

Note:	If the data value is a string, GetDataSize returns the size of the data value and one extra byte for the terminating null character.


TRegistry.GetDataType

TRegistry	See also

Returns the enumerated data type of a specified data value associated with the current key.

type TRegDataType= (rdUnknown, rdString, rdExpandString, rdInteger, rdBinary);

function GetDataType(const ValueName: String): TRegDataType;

Description

Call GetDataType to determine the data type of a data value associated with the current key. ValueName is a string containing the name of the data value to query.

GetDataType returns an enumerated value of type TRegDataType. TRegDataType can be one of the following values

Value	Meaning

rdUnknown	Data value type is of no defined value type.

rdString	Data value type is a null-terminated string. It is a Unicode or ANSI string depending on whether the application calls the Unicode or ANSI string functions.

rdExpandString	Data value type is a null-terminated string that contains unexpanded references to environment variables (for example, "%PATH%"). It is a Unicode or ANSI string depending on whether the application calls the Unicode or ANSI string functions.

rdInteger	Data value type is a32-bit number.

rdBinary	Data value type is binary data, in any form.


TRegistry.GetKeyInfo

TRegistry	See also

Returns information about the current key.

type

  TRegKeyInfo = record

    NumSubKeys: Integer;

    MaxSubKeyLen: Integer;

    NumValues: Integer;

    MaxValueLen: Integer;

    MaxDataLen: Integer;

    FileTime: TFileTime;

  end;

function GetKeyInfo(var Value: TRegKeyInfo): Boolean;

Description

Call GetKeyInfo to return all information about the current key to an application. Value is a variable declared in an application to store the key information returned by this function. Value must be of type TRegKeyInfo. Information returned by GetKeyInfo about the current key includes:

Number of subkeys

Longest subkey name length, in characters

Number of data values

Longest data-value name length

Longest data-value length

Time of last write to the key

On success GetKeyInfo returns True. On failure it returns False, and the Value record is set to zeroes.


TRegistry.GetKeyNames

TRegistry	See also

Returns a string list containing the names of all subkeys belonging to the current key.

procedure GetKeyNames(Strings: TStrings);

Description

Call GetKeyNames to determine the names of all subkeys belonging to the current key. Determining the names of subkeys is useful in an application that iterates through a set of keys.

Strings is a variable of type TStrings into which to return the list of subkey names.


TRegistry.GetValueNames

TRegistry	See also	Example

Returns a string list containing the names of all data values associated with the current key.

procedure GetValueNames(Strings: TStrings);

Description

Call GetValueNames to determine the names of all data values associated with the current key. Determining the names of data values is useful in an application that iterates through a set of data values for a key.

Strings is a variable of type TStrings into which to return the list of data value names.


TRegistry.HasSubKeys

TRegistry	See also

Determines if the current key has subkeys.

function HasSubKeys: Boolean;

Description

Call HasSubKeys to determine if the current key has any subkeys. HasSubKeys returns True if the current key has at least one subkey. Otherwise it returns False.


TRegistry.KeyExists

TRegistry	See also

Determines if a specified key exists.

function KeyExists(const Key: String): Boolean;

Description

Call KeyExists to determine if a key of a specified name exists. Key is the name of the key for which to search.


TRegistry.LoadKey

TRegistry	See also

Creates a subkey under the root key and loads registry information from a file into the newly created subkey.

function LoadKey(const Key, FileName: String): Boolean;

Description

Call LoadKey to:

1	Create a new subkey under the root key, and

2	Load registry information from a file into the subkey. Registry information can include data values, subkeys, and data values for those subkeys.

LoadKey is intended to simplify creation of a key, its values and subkeys, and the values for those subkeys in a single operation. A key, its subkeys, and all data values the key and its subkeys is called a hive. Rather than creating each key and value separately, an application can read a hive from a file. This is especially useful for applications that users can reconfigure at run time.

Note:	Before an application calls LoadKey the RootKey property must be set to HKEY_USERS, HKEY_LOCAL_MACHINE, or to a key returned by a previous call to RegistryConnect.

The Key parameter is the name of the subkey to create. The FileName parameter is the location of the file containing registry information to store in the subkey. The file specified by FileName must be one previously created using the SaveKey function or the RegSaveKey Windows API function. On systems that use a file allocation table (FAT), FileName cannot include an extension.


TRegistry.MoveKey

TRegistry	See also

Moves an existing key, its subkeys, and data values to a new location using a new key name.

procedure MoveKey(const OldName, NewName: String; Delete: Boolean);

Description

Call MoveKey to copy or move an existing key, its subkeys, and data values to a different location. Under Windows 95, copying is recursive. If a key contains subkeys and data values, they too, are copied. When the operation is complete, the new key is closed.  Under Windows NT, subkeys must be moved explicitly with separate calls to MoveKey.

OldName specifies the key to copy or move. NewName specifies a name for the duplicate key to create. If the key specified by NewName does not exist, MoveKey creates it. Delete specifies whether to delete the old key after the copy operation. If Delete is True, the key specified by OldName is deleted after it is copied. Otherwise the old key is closed.


TRegistry.OpenKey

TRegistry	See also	Example

Opens a specified key.

function OpenKey(const Key: String; CanCreate: Boolean): Boolean;

Description

Call OpenKey to make a specified key the current key. Key is the name of the key to open. If Key is nil, the CurrentKey property is set to the key specified by the RootKey property.

CanCreate specifies whether to create the specified key if it does not exist. If CanCreate is True, the key is created if necessary.

Key is opened or created with the security access value specified by the Access property. OpenKey only creates non-volatile keys, A non-volatile key is stored in the registry and is preserved when the system is restarted.

OpenKey returns True if the key is successfully opened or created


TRegistry.OpenKeyReadOnly

TRegistry	See also

Opens a specified key in a read-only manner.

function OpenKeyReadOnly(const Key: String): Boolean;

Description

Call OpenKeyReadOnly to make a specified key the current key. Key is the name of the key to open. If Key is nil, the CurrentKey property is set to the key specified by the RootKey property.

Key is opened with the security access value KEY_READ.

OpenKey returns True if the key is successfully opened and CurrentKey is set to the key.


TRegistry.ReadBinaryData

TRegistry	See also

Retrieves a binary value from a specified data value associated with the current key.

function ReadBinaryData(const Name: String; var Buffer; BufSize: Integer): Integer;

Description

Call ReadBinaryData to read a binary value from a specified data value associated with the current key. Name is the name of the data value to read. Buffer is the application variable into which to read the registry data. Buffer must be large enough to hold all of the data returned. BufSize specifies the size of Buffer.

If successful, ReadBinaryData returns the requested data. If the Registry entry contains a known type (such as a string), an exception is raised.

Note:	Binary data is typically a record. It might also be an icon or a bitmap although Microsoft recommends against storing graphics objects in the registry for performance reasons.


TRegistry.ReadBool

TRegistry	See also

Retrieves a Boolean value from a specified data value associated with the current key.

function ReadBool(const Name: String): Boolean;

Description

Call ReadBool to read a Boolean value from a specified data value associated with the current key. Name is the name of the data value to read.

If successful, ReadBool returns the requested Boolean value. If the Registry entry does not contain a boolean or integer value, an exception is raised.


TRegistry.ReadCurrency

TRegistry	See also

Retrieves a currency value from a specified data value associated with the current key.

function ReadCurrency(const Name: String): Currency;

Description

Call ReadCurrency to read a Currency value from a specified data value associated with the current key. Name is the name of the data value to read.

If successful, ReadCurrency returns a Currency value. If the Registry entry does not contain a Currency value, an exception is raised.


TRegistry.ReadDate

TRegistry	See also

Retrieves a date value from a specified data value associated with the current key.

function ReadDate(const Name: String): TDateTime;

Description

Call ReadDate to read a date value from a specified data value associated with the current key. Name is the name of the data value to read.

If successful, ReadDate returns a TDateTime value. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is the time of day.

If the Registry entry does not contain a date or time value, an exception is raised.

Note:	Only use ReadDate to read data values previously stored with the WriteDate procedure.


TRegistry.ReadDateTime

TRegistry	See also

Retrieves a date and time value from a specified data value associated with the current key.

function ReadDateTime(const Name: String): TDateTime;

Description

Call ReadDateTime to read a datetime value from a specified data value associated with the current key. Name is the name of the data value to read.

If successful, ReadDateTime returns a TDateTime value. The integral part of a TDateTime value is the number of days that have passed since12/30/1899. The fractional part of a TDateTime value is the time of day.

If the Registry entry does not contain a date or time value, an exception is raised.


TRegistry.ReadFloat

TRegistry	See also

Retrieves a float value from a specified data value associated with the current key.

function ReadFloat(const Name: String): Double;

Description

Call ReadFloat to read a float value from a specified data value associated with the current key. Name is the name of the data value to read.

If the Registry entry does not contain a floating-point value, an exception is raised.


TRegistry.ReadInteger

TRegistry	See also

Retrieves an integer value from a specified data value associated with the current key.

function ReadInteger(const Name: String): Integer;

Description

Call ReadInteger to read an integer value from a specified data value associated with the current key. Name is the name of the data value to read.

If the Registry entry does not contain an integer, an exception is raised.


TRegistry.ReadString

TRegistry	See also	Example

Retrieves a string value from a specified data value associated with the current key.

function ReadString(const Name: String): String;

Description

Call ReadString to read a string value from a specified data value associated with the current key. Name is the name of the data value to read.

If there is no Registry entry with the specified name, ReadString returns an empty string. If the Registry entry contains something other than a string, an exception is raised.

Note:	ReadString retrieves data stored by either the WriteString or WriteExpandString method.


TRegistry.ReadTime

TRegistry	See also

Retrieves a time value from a specified data value associated with the current key.

function ReadTime(const Name: String): TDateTime;

Description

Call ReadTime to read a time value from a specified data value associated with the current key. Name is the name of the data value to read.

If successful, ReadTime returns a TDateTime value. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is the time of day.

If the specified Registry entry does not contain a date or time value, an exception is raised.

Note:	Only use ReadTime to read data values previously stored with the WriteTime method.


TRegistry.RegistryConnect

TRegistry	See also

Establishes a connection to a registry on another computer.

function RegistryConnect(const UNCName: String): Boolean;

Description

Call RegistryConnect to establish a connection to a registry on another computer running Windows 95 or Windows NT. UNCName is the name of the remote computer, and must take the following form:

\\computername

where computername is the name of the remote computer. If UNCName is nil, the local machine name is used.

Note:	Before calling RegistryConnect, an application must set the RootKey property for its registry object to HKEY_USERS or HKEY_LOCAL_MACHINE.

If connection is successful, RegistryConnect sets the RootKey property to the root key of the remote computer and returns True. If unsuccessful, RegistryConnect returns False, and RootKey remains unchanged.


TRegistry.RenameValue

TRegistry	See also

Changes the name of a data value associated with the current key.

procedure RenameValue(const OldName, NewName: String);

Description

Call RenameValue to change the name of a data value associated with the current key. OldName is a string containing the current name of the data value. NewName is a string containing the replacement name for the data value.

If OldName is the name of an existing data value for the current key, and NewName is not the name of an existing data value for the current key, RenameValue changes the data value name as specified. Otherwise the current name remains unchanged.


TRegistry.ReplaceKey

TRegistry	See also

Replaces the hive file backing a key and all its subkeys with a hive stored in a different file, so that when the system is next started, the key and subkeys will have the values stored in the new file.

function ReplaceKey(const Key, FileName, BackUpFileName: String): Boolean;

Description

Call ReplaceKey to replace the hive file backing a key and all its subkeys with a different hive file. A hive is a discrete collection of keys, subkeys, and values that is rooted at the top of the registry hierarchy.

FileName indicates the name of the file containing the new key and subkey information. BackUpFileName is the name of a backup file used to store the current key and subkey information before it is overwritten.

ReplaceKey returns True if it is successful.

Note:	The file specified by FileName parameter must be created with the SaveKey function, or by directly calling the Windows 95/NT RegSaveKey API function. Under the FAT file system FileName cannot have an extension.


TRegistry.RestoreKey

TRegistry	See also

Reopens the specified key, and overwrites any information contained in this key and its subkeys keys with registry data stored in a hive file.

function RestoreKey(const Key, FileName: String): Boolean;

Description

Call RestoreKey to open the specified key with a security access value of KEY_ALL_ACCESS and overwrite any information in the key and its subkeys with registry data stored in a hive file. A hive is a discrete collection of keys, subkeys, and values that is rooted at the top of the registry hierarchy.

Key is the name of the key to open. FileName is the name of the file containing the hive information.

If RestoreKey successfully reads and copies the registry information in FileName to the specified key, the return value of RestoreKey is True and the key is closed.

Note:	The file specified by FileName parameter must be created with the SaveKey function, or by directly calling the Windows 95/NT RegSaveKey API function. Under the FAT file system FileName cannot have an extension.


TRegistry.SaveKey

TRegistry	See also

Opens the specified key with the security access value KEY_ALL_ACCESS and saves the specified key and all of its subkeys and values to a hive file.

function SaveKey(const Key, FileName: String): Boolean;

Description

Call SaveKey to open a key with a security access value of KEY_ALL_ACCESS, and save the key and its subkeys and data values to a hive file. A hive is a discrete collection of keys, subkeys, and values that is rooted at the top of the registry hierarchy.

Key is the key to save. FileName is the file into which to save the key information. It must be the name of a new file that does not already exist. On FAT file systems FileName cannot include an extension.

Files created by SaveKey are passed as parameters to the RestoreKey, ReplaceKey and LoadKey functions.

If SaveKey is successful it returns True and closes the key.


TRegistry.UnLoadKey

TRegistry	See also

Removes a hive from the registry.

function UnLoadKey(const Key: String): Boolean;

Description

Call UnLoadKey to remove a hive from the registry without modifying its associated hive file, if any. A hive is a discrete collection of keys, subkeys, and values that is rooted at the top of the registry hierarchy.

Key is the name of the key at the root of the hive to remove.

If successful, UnLoadKey returns True.

Note:	Before calling this function, set RootKey to HKEY_USERS, HKEY_LOCAL_MACHINE, or call RegistryConnect.


TRegistry.ValueExists

TRegistry	See also

Determines if a specified data value exists for the current key.

function ValueExists(const Name: string): Boolean;

Description

Call ValueExists to determine if a particular key exists in the registry. Calling Value Exists is especially useful before calling other TRegistry methods that operate only on existing keys.

Name is the name of the data value for which to check.

ValueExists returns True if a match if found, False otherwise.


TRegistry.WriteBinaryData

TRegistry	See also

Stores a specifically named data value associated with the current key.

procedure WriteBinaryData(const Name: String; var Buffer; BufSize: Integer);

Description

Call WriteBinaryData to store a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteBinary. If Name does not exist, it is created.

Buffer is a data buffer containing the data to store in the registry. BufSize indicates the size of Buffer.

Note:	Data-value lengths are limited by available memory. Long values (more than 2048 bytes) should be stored as separate files, and those file names should be stored in the registry. Application elements such as icons, bitmaps, and executable files should be stored as separate files rather than as values in the registry.

If WriteBinaryData fails, an exception is raised, and the value is not written to the registry.


TRegistry.WriteBool

TRegistry	See also

Stores a Boolean value in a specifically named data value associated with the current key.

procedure WriteBool(const Name: String; Value: Boolean);

Description

Call WriteBool to store a Boolean value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteBool. If Name does not exist, it is created.

If WriteBool fails, an exception is raised, and the value is not written to the registry.


TRegistry.WriteCurrency

TRegistry	See also

Stores a currency value in a specifically named data value associated with the current key.

procedure WriteCurrency(const Name: String; Value: Currency);

Description

Call WriteCurrency to store a Currency value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteCurrency. If Name does not exist, it is created.

Value is a Currency value to store in the registry.

If WriteCurrency fails, an exception is raised, and the value is not written to the registry.


TRegistry.WriteDate

TRegistry	See also

Stores a date value in a specifically named data value associated with the current key.

procedure WriteDate(const Name: String; Value: TDateTime);

Description

Call WriteDate to store a datetime value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteDate. If Name does not exist, it is created.

Value is a datetime value to store in the registry.

If WriteDate fails, an exception is raised, and the value is not written to the registry.

If successful, WriteDate stores a TDateTime value. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is the time of day.


TRegistry.WriteDateTime

TRegistry	See also

Stores a datetime value in a specifically named data value associated with the current key.

procedure WriteDateTime(const Name: String; Value: TDateTime);

Description

Call WriteDateTime to store a datetime value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteDateTime. If Name does not exist, it is created.

Value is a datetime value to store in the registry.

If WriteDateTime fails, an exception is raised, and the value is not written to the registry.

If successful, WriteDateTime stores a TDateTime value. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is the time of day.


TRegistry.WriteExpandString

TRegistry	See also

Stores a string containing unexpanded references to environment variables in a specifically named data value associated with the current key.

procedure WriteExpandString(const Name, Value: String);

Description

Call WriteExpandString to store a string that contains unexpanded references to environment variables such as “%PATH%”. The string is stored in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteExpandString. If Name does not exist, it is created.

Value is a string value to store in the registry.

If WriteExpandString fails, an exception is raised.

Note:	To write strings that do not contain unexpanded environment variables, use WriteString instead.


TRegistry.WriteFloat

TRegistry	See also

Stores a Double value in a specifically named data value associated with the current key.

procedure WriteFloat(const Name: String; Value: Double);

Description

Call WriteFloat to store a float value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteFloat. If Name does not exist, it is created.

Value is a float value to store in the registry.

If WriteFloat fails, an exception is raised, and the value is not written to the registry.


TRegistry.WriteInteger

TRegistry	See also

Stores an integer value in a specifically named data value associated with the current key.

procedure WriteInteger(const Name: string; Value: Integer);

Description

Call WriteInteger to store an integer value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteInteger. If Name does not exist, it is created.

Value is a integer value to store in the registry.

If WriteInteger fails, an exception is raised, and the value is not written to the registry.


TRegistry.WriteString

TRegistry	See also	Example

Stores a string value in a specifically named data value associated with the current key.

procedure WriteString(const Name, Value: String);

Description

Call WriteString to store a string value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteString. If Name does not exist, it is created.

Value is a string value to store in the registry.

If WriteString fails, an exception is raised, and the value is not written to the registry.


TRegistry.WriteTime

TRegistry	See also

Stores a time value in a specifically named data value associated with the current key.

procedure WriteTime(const Name: String; Value: TDateTime);

Description

Call WriteTime to store a datetime value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteTime. If Name does not exist, it is created.

Value is a datetime value to store in the registry.

If WriteTime fails, an exception is raised, and the value is not written to the registry.

If successful, WriteTime stores a TDateTime value. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is the time of day.


Accessibility

Read-only


Hierarchy

TObject


 TReplaceDialog

Hierarchy	Properties	Methods	Events	See also

TReplaceDialog displays a search-and-replace dialog.

Unit

dialogs

Description

TReplaceDialog is a special version of TFindDialog that prompts the user for both a search string and a replace string. Like the Find dialog, the Replace dialog is modeless and does not appear at runtime until activated by a call to the Execute method.


TReplaceDialog properties

TReplaceDialog	Alphabetically	Legend

In TReplaceDialog

ReplaceText

Derived from TFindDialog

FindText

Left

Options

Position

Top

Derived from TCommonDialog

Ctl3D

Handle

HelpContext

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TReplaceDialog properties

TReplaceDialog	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Ctl3D

DesignInfo

FindText

Handle

HelpContext

Left

Name

Options

Owner

Position

ReplaceText

Tag

Top

VCLComObject


TReplaceDialog.ReplaceText

TReplaceDialog	See also 	Example

Contains the text that should replace FindText.

property ReplaceText: string;

Description

FindText, taken from the Find What edit box, contains the text string that the user wants to search for. ReplaceText, taken from the Replace With edit box, contains the text string that will replace FindText. To make a default text string appear in the Replace With edit box when the dialog opens, assign a value to ReplaceText in the Object Inspector or in program code.


TReplaceDialog events

TReplaceDialog	Alphabetically	Legend

In TReplaceDialog

OnReplace

Derived from TFindDialog

OnFind

Derived from TCommonDialog

OnClose

OnShow


TReplaceDialog events

TReplaceDialog	By object	Legend

OnClose

OnFind

OnReplace

OnShow


TReplaceDialog.OnReplace

TReplaceDialog	See also 	Example

Occurs when the user clicks the Replace or Replace All button.

property OnReplace: TNotifyEvent;

Description

OnReplace occurs whenever the user clicks Replace or Replace All. In addition, when the user clicks Replace, the frReplace flag is set (and the frReplaceAll flag is turned off) in Options. When the user clicks ReplaceAll, the frReplaceAll flag is set (and the frReplace flag is turned off) in Options.

Write an OnReplace event handler that searches for the text specified in FindText and replaces it with the text in ReplaceText. Use the Options flags to determine how the search is conducted.


TReplaceDialog methods

TReplaceDialog	Alphabetically

In TReplaceDialog

Create

Derived from TFindDialog

CloseDialog

Destroy

Execute

Derived from TCommonDialog

DefaultHandler

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TReplaceDialog methods

TReplaceDialog	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

CloseDialog

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Execute

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TReplaceDialog.Create

TReplaceDialog	See also

Creates and initializes a TReplaceDialog instance.

constructor Create(AOwner: TComponent); override;

Description

The Create method generates a TReplaceDialog instance, but the new dialog does not appear on the form at runtime until the Execute method is called.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog

TFindDialog


 TRichEdit

Hierarchy	Properties	Methods	Events	See also

TRichEdit is a wrapper for a Windows rich text edit control.

Unit

comctrls

Description

Use a TRichEdit object to put a standard Windows rich text edit control on a form. Rich text edit controls let the user enter text that includes variation in font attributes and paragraph formatting information.

TRichEdit provides the properties and methods to enter and work with rich text. TRichEdit does not provide any user interface components to make these formatting options available to the user. Applications must implement the user interface components to surface the rich text capabilities of a TRichEdit object.

TRichEdit publishes many of the properties inherited from TCustomRichEdit, but does not introduce any new behavior.


TRichEdit properties

TRichEdit	Alphabetically	Legend

Derived from TCustomRichEdit

DefAttributes

DefaultConverter

GetCaretPos

HideScrollBars

HideSelection

Lines

PageRect

Paragraph

PlainText

SelAttributes

SelLength

SelStart

SelText

Derived from TCustomMemo

Alignment

CaretPos

ScrollBars

WantReturns

WantTabs

WordWrap

Derived from TCustomEdit

BorderStyle

CanUndo

MaxLength

Modified

ReadOnly

Derived from TWinControl

BorderWidth

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Text

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TRichEdit properties

TRichEdit	By object	Legend

Action

Align

Alignment

Anchors

BiDiMode

BorderStyle

BorderWidth

BoundsRect

Brush

CanUndo

CaretPos

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DefAttributes

DefaultConverter

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

GetCaretPos

Handle

Height

HelpContext

HideScrollBars

HideSelection

Hint

HostDockSite

ImeMode

ImeName

Left

Lines

LRDockWidth

MaxLength

Modified

Name

Owner

PageRect

Paragraph

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PlainText

PopupMenu

ReadOnly

ScrollBars

SelAttributes

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Text

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

WantReturns

WantTabs

Width

WindowProc

WordWrap


TRichEdit events

TRichEdit	Alphabetically	Legend

Derived from TCustomRichEdit

OnProtectChange

OnResizeRequest

OnSaveClipboard

OnSelectionChange

Derived from TCustomEdit

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseWheel

OnMouseWheelDown

OnMouseWheelUp

Derived from TControl

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TRichEdit events

TRichEdit	By object	Legend

OnChange

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnMouseWheel

OnMouseWheelDown

OnMouseWheelUp

OnProtectChange

OnResizeRequest

OnSaveClipboard

OnSelectionChange

OnStartDock

OnStartDrag


TRichEdit methods

TRichEdit	Alphabetically

Derived from TCustomRichEdit

Clear

Create

Destroy

FindText

GetSelTextBuf

Print

RegisterConversionFormat

Derived from TCustomEdit

ClearSelection

ClearUndo

CopyToClipboard

CutToClipboard

PasteFromClipboard

SelectAll

SetSelTextBuf

Undo

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

ReplaceDockedControl

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TRichEdit methods

TRichEdit	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

ClearSelection

ClearUndo

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

Create

CreateParented

CreateParentedControl

CutToClipboard

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FindText

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

PasteFromClipboard

Perform

Print

Realign

Refresh

RegisterConversionFormat

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

Undo

Update

UpdateAction

UpdateControlState


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMemo

TCustomRichEdit


Abs Example

var

  r: Single;

  i: Integer;

begin

  r := Abs(-2.3);	{ 2.3 }

  i := Abs(-157);	{ 157 }

end;


Addr Example

This example uses the Addr function to get the address of a numeric value that is stored as custom data in a tree node.  Once the assignment has been made, changes to the entries in the NodeNumbers array can be read by dereferencing the pointers that are stored in the Data property of the Tree nodes.

var

  I : Integer;

  NodeNumbers: array [0 .. 100] of Integer;

 begin

  with TreeView1 do

  begin

    for I := 0 to Items.Count - 1 do

    begin

      NodeNumbers[I] := CalculateValue(Items[I]);

      Items[I].Data := Addr(NodeNumber[I]);

    end;

  end;

end;


ArcTan Example

var
  R: Extended;

begin

  R := ArcTan(Pi);

end;


Assert Example

{$APPTYPE CONSOLE}

{ Defining OLDSTYLE for the compilation allows old-style runtime error handling to occur rather than the new exception-based method. If the old style is used, then the user-supplied string is not displayed. }

program Plop;

{$IFNDEF OLDSTYLE}

uses SysUtils;

{$ENDIF}

type

  TList = ^TListDesc;

  TListDesc = record

    name : string;

    next : TList;

  end;

var

  Head, Tail : TList;

procedure Add(name : string);

  var

    Item : TList;

begin

  NEW(Item);

  Item.name := name;

  Item.next := Head;

  Head := Item;

end;

procedure PrintList(nofItems : Integer; list : TList);

begin

  while (nofItems > 0) and (list <> nil) do

    begin

      WriteLn(list.name);

      list := list.next;

      Dec(nofItems);

    end;

  Assert(list = nil, 'Supplied length does not match actual length');

end;

begin

  Head := nil;

  Add('Dawg');

  Tail := Head;

  Add('Fifi');

  Add('Phideaux');

  Tail.next := Head;

  PrintList(3, Head);

end.


Assigned Example

var P: Pointer;

begin

  P := nil;

  if Assigned (P) then Writeln ('You won''t see this');

  GetMem(P, 1024);	{P valid}

  FreeMem(P, 1024);	{P no longer valid and still not nil}

  if Assigned (P) then Writeln ('You''ll see this');

end;


AssignFile, CloseFile, OpenDialog Example
AssignFile, OpenDialog, Readln, CloseFile Example

var

  F: TextFile;

  S: string;

begin

  if OpenDialog1.Execute then          { Display Open dialog box }

  begin

    AssignFile(F, OpenDialog1.FileName);   { File selected in dialog box }

    Reset(F);

    Readln(F, S);                          { Read the first line out of the file }

    Edit1.Text := S;                       { Put string in a TEdit control }

    CloseFile(F);

  end;

end;


AssignPrn Example

This code prints a line of text on the printer when the user clicks the button on the form:

procedure TForm1.Button1Click(Sender: TObject);

var

  MyFile: TextFile;

begin

  AssignPrn(MyFile);

  Rewrite(MyFile);

  Writeln(MyFile, 'Print this text');

  System.CloseFile(MyFile);

end;


BlockRead, BlockWrite, SaveDialog Example

var

  FromF, ToF: file;

  NumRead, NumWritten: Integer;

  Buf: array[1..2048] of Char;

begin

  if OpenDialog1.Execute then                               { Display Open dialog box }

  begin

    AssignFile(FromF, OpenDialog1.FileName);

    Reset(FromF, 1);	{ Record size = 1 }

    if SaveDialog1.Execute then                              { Display Save dialog box}

    begin

      AssignFile(ToF, SaveDialog1.FileName);	{ Open output file }

      Rewrite(ToF, 1);	{ Record size = 1 }

      Canvas.TextOut(10, 10, 'Copying ' + IntToStr(FileSize(FromF))

        + ' bytes...');

      repeat

        BlockRead(FromF, Buf, SizeOf(Buf), NumRead);

        BlockWrite(ToF, Buf, NumRead, NumWritten);

      until (NumRead = 0) or (NumWritten <> NumRead);

        CloseFile(FromF);

        CloseFile(ToF);

    end;

  end;

end;


Break Example

var

  S: string;

begin

  while True do

  begin

    ReadLn(S);

    try

      if S = '' then Break;

      WriteLn(S);

    finally

    { do something for all cases }

    end;

  end;

end;


ChDir Example

begin

  {$I-}

  { Change to directory specified in Edit1 }

  ChDir(Edit1.Text);

  if IOResult <> 0 then

    MessageDlg('Cannot find directory', mtWarning, [mbOk], 0);

end;


ColorToRGB Example

The following code converts the color of the current form, Form1, to a Windows RGB value:

var

  L : Longint;

begin

  L := ColorToRGB(Form1.Color);

end;


CompareStr_Example
CompareStr Example

The following code compares String1, 'STEVE', to String2, 'STEVe'. Note that CompareStr returns a number less than 0 because the value of 'e' is greater than the value of 'E'.

var

  String1, String2 : string;

  I : Integer;

begin

  String1 := 'STEVE';

  String2 := 'Steve';

  I := CompareStr(String1, String2);  { the value of I is < 0 }

  if I <> 0 then

    MessageDlg('The strings are not equal', mtWarning, [mbOK], 0)

end;


Concat Example

 var

  S: string;

begin

  S := Concat('ABC', 'DEF');     { 'ABCDEF' }

end;


Continue, Items, Selected Example

This example uses a file listbox and a regular listbox on a form. The following routine scans through the files listed in the file listbox and lists the sizes of any selected files to the regular list box:

var

  F: File;

  i: Integer;

begin

  for i := 0 to (FileListBox1.Items.Count - 1) do begin

  try

    if FileListBox1.Selected[i] then

    begin

      if not FileExists(FileListBox1.Items.Strings[i]) then begin

        MessageDlg('File: ' + FileListBox1.Items.Strings[i] +

                   ' not found', mtError, [mbOk], 0);

        Continue;

      end;

      AssignFile(F, FileListBox1.Items.Strings[i]);

      Reset(F, 1);

      ListBox1.Items.Add(IntToStr(FileSize(F)));

      CloseFile(F);

    end;

   finally

   { do something here }

   end;

  end;

end;


Cos Example

 var R: Extended;

begin

  R := Cos(Pi);

end;


Date Example
Date, DateToStr Example

This example uses a label and a button on a form. When the user clicks the button, the current date is displayed in the caption of the label:

procedure TForm1.Button1Click(Sender: TObject);

begin

  Label1.Caption := 'Today is  ' + DateToStr(Date);

end;


DateTimeToStr Example
Now, DateTimeToStr Example

This example uses a label and a button on a form. When the user clicks the button, the current date and time is converted to a string and displayed as the caption of the label:

procedure TForm1.Button1Click(Sender: TObject);

begin

  Label1.Caption := DateTimeToStr(Now);

end;


Dec Example

 var

  IntVar: Integer;

  LongintVar: Longint;

begin

  Intvar := 10;

  LongintVar := 10;

  Dec(IntVar);	{ IntVar := IntVar - 1 }

  Dec(LongintVar, 5);	{ LongintVar := LongintVar - 5 }

end;


DecodeDate Example
DecodeDate, DecodeTime Example

This example uses a button and two labels on a form. When the user clicks the button, the current date and time are reported in the captions of the two labels.

procedure TForm1.Button1Click(Sender: TObject);

var

  Present: TDateTime;

  Year, Month, Day, Hour, Min, Sec, MSec: Word;

 begin

  Present:= Now;

  DecodeDate(Present, Year, Month, Day);

  Label1.Caption := 'Today is Day ' + IntToStr(Day) + ' of Month '

    + IntToStr(Month) + ' of Year ' + IntToStr(Year);

  DecodeTime(Present, Hour, Min, Sec, MSec);

  Label2.Caption := 'The time is Minute ' + IntToStr(Min) + ' of Hour '

    + IntToStr(Hour);

end;


Delete Example

 var

   s: string;

 begin

   s := 'Honest Abe Lincoln';

   Delete(s,8,4);

   Canvas.TextOut(10, 10, s);	{ 'Honest Lincoln' }

 end;


DiskFree Example
DiskFree, DiskSize Example

var

  S: string;

  AmtFree: Int64;

  Total:   Int64;

begin

  AmtFree := DiskFree(0);

  Total := DiskSize(0);

  S := IntToStr(AmtFree div Total) + 'percent of the space on drive 0 is free: ' (AmtFree div 1024) + ' Kbytes free. ';

  Canvas.TextOut(10, 10, S);

end;


Dispose Example

type

  Str18 = string[18];

 var

  P: ^Str18;

begin

  New(P);

  P^ := 'Now you see it...';

  Dispose(P);	{ Now you don't... }

end;


EncodeDate Example

This example uses three edit controls, a label, and a button on a form. When the button is clicked, the day, month, and year specified in the edit controls is stored in a TDateTime object. Then the TDateTime object is converted to an AnsiString that is displayed in the label.

procedure TForm1.Button1Click(Sender: TObject);

var

  MyDate: TDateTime;

begin

  MyDate := EncodeDate(StrToInt(Edit1.Text), StrToInt(Edit2.Text), StrToInt(Edit3.Text));

  Label1.Caption := DateToStr(MyDate);

end;


EncodeTime Example

procedure TForm1.Button1Click(Sender: TObject);

var

  MyTime: TDateTime;

begin

  MyTime := EncodeTime(0, 45, 45, 7);

  Label1.Caption := TimeToStr(MyTime);

end;


Eof, Read, Write Example

var

  F1, F2: TextFile;

  Ch: Char;

begin

  if OpenDialog1.Execute then begin

    AssignFile(F1, OpenDialog1.Filename);

    Reset(F1);

    if SaveDialog1.Execute then begin

      AssignFile(F2, SaveDialog1.Filename);

      Rewrite(F2);

      while not Eof(F1) do

      begin

        Read(F1, Ch);

        Write(F2, Ch);

      end;

      CloseFile(F2);

    end;

    CloseFile(F1);

  end;

end;


Eoln Example

begin

 { Tells program to wait for keyboard input }

   WriteLn(Eoln);

 end;


Erase Example
Erase, OpenDialog.Title, OpenDialog.FileName Example

procedure TForm1.Button1Click(Sender: TObject);

var

  F: Textfile;

begin

  OpenDialog1.Title := 'Delete File';

  if OpenDialog1.Execute then begin

    AssignFile(F, OpenDialog1.FileName);

    try

      Reset(F);

      if MessageDlg('Erase ' + OpenDialog1.FileName + '?',

        mtConfirmation, [mbYes, mbNo], 0) = mrYes then

      begin

        CloseFile(F);

        Erase(F);

      end;

    except

      on EInOutError do

        MessageDlg('File I/O error.', mtError, [mbOk], 0);

    end;

  end;

end;


ExpandFileName Example

The following example uses a listbox, an edit control, and a button on a form. When the button is clicked, the filename specified in the edit control is expanded to a fully qualified filename and added to the list box.

procedure TForm1.Button1Click(Sender: TObject)

begin

  ListBox1.Items.Add(ExpandFileName(Edit1.Text));

end;


FileExists Example
FileExists, DeleteFile Example

The following code prompts for confirmation before deleting a file:

if FileExists(FileName) then

  if MessageDlg('Do you really want to delete ' + ExtractFileName(FileName) + '?'), []) = IDYes then

    DeleteFile(FileName);


FileExists, RenameFile, FileCreate, FileWrite, FileClose, ExtractFileName Example

The following example uses a button, a string grid, and a Save dialog box on a form. When the button is clicked, the user is prompted for a filename. When the user clicks OK, the contents of the string grid are written to the specified file. Additional information is also written to the file so that it can be read easily with the FileRead function.

procedure TForm1.Button1Click(Sender: TObject);

var

  BackupName: string;

  FileHandle: Integer;

  StringLen: Integer;

  X: Integer;

  Y: Integer;

begin

  if SaveDialog1.Execute then

  begin

    if FileExists(SaveDialog1.FileName) then

    begin

      BackupName := ExtractFileName(SaveDialog1.FileName);

      BackupName := ChangeFileExt(BackupName, '.BAK');

      if not RenameFile(SaveDialog1.FileName, BackupName) then

        raise Exception.Create('Unable to create backup file.');

    end;

    FileHandle := FileCreate(SaveDialog1.FileName);

    { Write out the number of rows and columns in the grid. }

    FileWrite(FileHandle,

      StringGrid1.ColCount, SizeOf(StringGrid1.ColCount));

    FileWrite(FileHandle,

      StringGrid1.RowCount, SizeOf(StringGrid1.RowCount));

    for X := 0 to StringGrid1.ColCount – 1 do

    begin

      for Y := 0 to StringGrid1.RowCount – 1 do

      begin

        { Write out the length of each string, followed by the string itself. }

        StringLen := Length(StringGrid1.Cells[X,Y]);

        FileWrite(FileHandle, StringLen, SizeOf(StringLen));

        FileWrite(FileHandle,

          StringGrid1.Cells[X,Y], Length(StringGrid1.Cells[X,Y]);

      end;

    end;

    FileClose(FileHandle);

  end;

end;


FileOpen Example

procedure OpenForShare(const FileName: String);

var

  FileHandle : Integer;

begin

  FileHandle := FileOpen(FileName, fmOpenWrite or fmShareDenyNone);

  if FileHandle > 0 then

    {valid file handle}

  else

    {Open error: FileHandle = negative DOS error code}

end;


FileSize, Seek, FilePos Example

var

   f: file of Byte;

   size : Longint;

   S: string;

   y: Integer;

 begin

   if OpenDialog1.Execute then

   begin

     AssignFile(f, OpenDialog1.FileName);

     Reset(f);

     size := FileSize(f);

     S := 'File size in bytes: ' + IntToStr(size);

     y := 10;

     Canvas.TextOut(5, y, S);

     y := y + Canvas.TextHeight(S) + 5;

     S := 'Seeking halfway into file...';

     Canvas.TextOut(5, y, S);

     y := y + Canvas.TextHeight(S) + 5;

     Seek(f,size div 2);

     S := 'Position is now ' + IntToStr(FilePos(f));

     Canvas.TextOut(5, y, S);

     CloseFile(f);

   end;

 end;


FileOpen, FileSeek, FileRead Example

The following example uses a button, a string grid, and an Open dialog box on a form. When the button is clicked, the user is prompted for a filename. When the user clicks OK, the specified file is opened, read into a buffer, and closed. Then the buffer is displayed in two columns of the string grid. The first column contains the character values in the buffer. The second column contains the numeric values of the characters in the buffer.

procedure TForm1.Button1Click(Sender: TObject);

var

  iFileHandle: Integer;

  iFileLength: Integer;

  iBytesRead: Integer;

  Buffer: PChar;

  i: Integer

begin

  if OpenDialog1.Execute then

  begin

    try

      iFileHandle := FileOpen(OpenDialog1.FileName, fmOpenRead);

      iFileLength := FileSeek(iFileHandle,0,2);

      FileSeek(iFileHandle,0,0);

      Buffer := PChar(AllocMem(iFileLength + 1));

      iBytesRead = FileRead(iFileHandle, Buffer, iFileLength);

      FileClose(iFileHandle);

      for i := 0 to iBytesRead-1 do

      begin

        StringGrid1.RowCount := StringGrid1.RowCount + 1;

        StringGrid1.Cells[1,i+1] := Buffer[i];

        StringGrid1.Cells[2,i+1] := IntToStr(Integer(Buffer[i]));

      end;

    finally

      FreeMem(Buffer);

    end;

  end;

end;


FileSearch, ShowMessage Example

The following example uses an edit control and a button on a form. When the button is clicked, the current directory and the Windows directory are searched for the filename specified in the edit control. A message box indicates whether or not the file is found.

procedure TForm1.Button1Click(Sender: TObject);

var

  buffer: array [0..255] of char;

  FileToFind: string;

begin

  GetWindowsDirectory(buffer, SizeOf(buffer));

  FileToFind := FileSearch(Edit1.Text, GetCurrentDir + ';' + buffer);

  if FileToFind = '' then

    ShowMessage('Couldn''t find ' + Edit1.Text + '.')

  else

    ShowMessage('Found ' + FileToFind + '.');

end;


FillChar Example

var

  S: array[0..79] of char;

begin

  { Set to all spaces }

  FillChar(S, SizeOf(S), Ord(' '));

end;


FindFirst, FindNext, FindClose Example

The following example uses an edit control, a button, a string grid, and seven check boxes. The check boxes correspond to the seven possible file attributes. When the button is clicked, the path specified in the edit control is searched for files matching the checked file attributes. The names and sizes of the matching files are inserted into the string grid.

procedure TForm1.Button1Click(Sender: TObject);

var

  sr: TSearchRec;

  FileAttrs: Integer;

begin

  StringGrid1.RowCount := 1;

  if CheckBox1.Checked then

    FileAttrs := faReadOnly

  else

    FileAttrs := 0;

  if CheckBox2.Checked then

    FileAttrs := FileAttrs + faHidden;

  if CheckBox3.Checked then

    FileAttrs := FileAttrs + faSysFile;

  if CheckBox4.Checked then

    FileAttrs := FileAttrs + faVolumeID;

  if CheckBox5.Checked then

    FileAttrs := FileAttrs + faDirectory;

  if CheckBox6.Checked then

    FileAttrs := FileAttrs + faArchive;

  if CheckBox7.Checked then

    FileAttrs := FileAttrs + faAnyFile;

  if FindFirst(Edit1.Text, FileAttrs, sr) = 0 then

  begin

    with StringGrid1 do

    begin

      if (sr.Attr and FileAttrs) = sr.Attr then

      begin

        Cells[1,RowCount-1] := sr.Name;

        Cells[2,RowCount-1] := IntToStr(sr.Size);

      end;

      while FindNext(sr) = 0 do

      begin

        if (sr.Attr and FileAttrs) = sr.Attr then

        begin

        RowCount := RowCount + 1;

        Cells[1, RowCount-1] := sr.Name;

        Cells[2, RowCount-1] := IntToStr(sr.Size);

        end;

      end;

      FindClose(sr);

    end;

  end;

end;


Flush Example
Append, Flush Example

var

  f: TextFile;

begin

  if OpenDialog1.Execute then

  begin                    { open a text file }

    AssignFile(f, OpenDialog1.FileName);

    Append(f);

    Writeln(f, 'I am appending some stuff to the end of the file.');

    { insert code here that would require a Flush before closing the file }

    Flush(f);  { ensures that the text was actually written to file }

    CloseFile(f);

  end;

end;


ForceDirectories Example

This example uses a label and a button on a form. When the user clicks the button, all the directories along the specified path that don't exist are created. The results are reported in the caption of the label:

procedure TForm1.Button1Click(Sender: TObject);

var

  Dir: string;

begin

  Dir := 'C:\APPS\SALES\LOCAL';

  if DirectoryExists(Dir) then

    Label1.Caption := Dir + ' was created'

end;


FormatDateTime Example

The following example assigns 'The meeting is on Wednesday, February 15, 1995 at 10:30 AM' to the string variable S.

S := FormatDateTime('"The meeting is on " dddd, mmmm d, yyyy, " at " hh:mm AM/PM',

   StrToDateTime('2/15/95 10:30am'));


FormatFloat Example

The following table shows some sample formats and the results produced when the formats are applied to different values:

Format string-	1234	-1234	0.5	0
	1234	-1234	0.5	0
0	1234	-1234	1	0
0.00	1234.00	-1234.00	0.50	0.00
#.##	1234	-1234	.5
#,##0.00	1,234.00	-1,234.00	0.50	0.00
#,##0.00;(#,##0.00)	1,234.00	(1,234.00)	0.50	0.00
#,##0.00;;Zero	1,234.00	-1,234.00	0.50	Zero
0.000E+00	1.234E+03	-1.234E+03	5.000E-01	0.000E+00
#.###E-0	1.234E3	-1.234E3	5E-1	0E0


Frac Example

var

 R: Real;

begin

  R := Frac(123.456);    { 0.456 }

  R := Frac(-123.456);   { -0.456 }

end;


FreeMem Example

The following example opens a file named 'test.txt' and reads the entire file into a dynamically allocated buffer. The buffer and the size of the file are then passed to a routine that processes the text, and finally the dynamically allocated buffer is freed and the file is closed.

var

  F: file;

  Size: Integer;

  Buffer: PChar;

begin

  AssignFile(F, 'test.txt');

  Reset(F, 1);

  try

    Size := FileSize(F);

    GetMem(Buffer, Size);

    try

      BlockRead(F, Buffer^, Size);

      ProcessFile(Buffer, Size);

    finally

      FreeMem(Buffer);

    end;

  finally

    CloseFile(F);

  end;

end;


GetCharsetValues Example

The following uses the GetCharsetValues procedure to fill a string list with the names of all the character set constants provided by Delphi.  This string list can then be used to allow the user to select a character set.

Here is the callback that adds the character sets to the string list:

procedure AddCharacterSet(const S: string);

begin

  CharSetList.Add(S);

end;

Here is the code that creates the string list, fills it, and sorts the character set names.

CharSetList := TStringList.Create;

GetCharSetValues(@AddCharacterSet);

CharSetList.Sort;


GetClass Example

The following example allows users to type the name of a graphics class into an edit control and when a button is pressed, the name default extension for that class is displayed in another edit control.

procedure TForm1.BitBtn1Click(Sender: TObject);

begin

   { make sure the classes are registered so that GetClass will work -- }

   { Usually, this goes in the initialization section where it is only executed once }

  RegisterClasses([TIcon, TBitmap, TJPEGImage, TMetafile]);

  Edit1.Text := GraphicExtension(TGraphicClass(GetClass(Edit2.Text)));

 end;


GetDir Example

var

   s : string;

 begin

   GetDir(0,s); { 0 = Current drive }

   MessageDlg('Current drive and directory: ' + s, mtInformation, [mbOk] , 0);

 end;


GetFieldProperty Example

The following event handler uses GetFieldProperty to obtain a field component that corresponds to a DBEdit control. The AsString property of this field is assigned to a string variable and displayed.

procedure TForm1.Button1Click(Sender: TObject);

var

  F: string;

begin

  F := GetFieldProperty(DBEdit1.DataSource.DataSet, DBEdit1, DBEdit1.DataField).AsString;

  ShowMessage(F);

end;

Note that this does the same thing as

procedure TForm1.Button1Click(Sender: TObject);

var

  F: string;

begin

  F := DBEdit1.Field.AsString;

  ShowMessage(F);

end;


GetMem Example

The following example opens a file named 'test.txt' and reads the entire file into a dynamically allocated buffer. The buffer and the size of the file are then passed to a routine that processes the text, and finally the dynamically allocated buffer is freed and the file is closed.

var

  F: file;

  Size: Integer;

  Buffer: PChar;

begin

  AssignFile(F, 'test.txt');

  Reset(F, 1);

  try

    Size := FileSize(F);

    GetMem(Buffer, Size);

    try

      BlockRead(F, Buffer^, Size);

      ProcessFile(Buffer, Size);

    finally

      FreeMem(Buffer);

    end;

  finally

    CloseFile(F);

  end;

end;


GetShortHint Example

This code assigns a two-part string as to the Hint property of an edit box and then displays the "short" or first part of the string as the text of the edit box:

procedure TForm1.BitBtn1Click(Sender: TObject);

begin

  Edit1.Hint := 'Name|Enter full name';

  Edit1.Text := GetShortHint(Edit1.Hint);

end;


GraphicExtension Example
GraphicExtension, GraphicFilter, DefaultExt, Filter Example

This code displays a Save Picture dialog box with the TBitmap default extension that is added automatically to files that are given no extension:

SavePictureDialog1.DefaultExt := GraphicExtension(TBitmap);

SavePictureDialog1.Filter := GraphicFilter(TBitmap);

if SavePictureDialog1.Execute then

  {save the graphic }


Halt Example

begin

   if 1 = 1 then

     begin

       if 2 = 2 then

         begin

           if 3 = 3 then

             begin

               Halt(1); { Halt right here! }

             end;

         end;

     end;

   Canvas.TextOut(10, 10, 'This will not be executed');

 end;


Hi Example

var B: Byte;

begin

  B := Hi($1234);   { $12 }

end;


Inc Example

var

  IntVar: Integer;

  LongintVar: Longint;

begin

  Inc(IntVar);	{ IntVar := IntVar + 1 }

  Inc(LongintVar, 5);	{ LongintVar := LongintVar + 5 }

end;


InputBox Example

This example displays an input dialog box when the user clicks a button on the form. The input dialog box includes a prompt string and a default string. The string the user enters in the dialog box is stored in the InputString variable.

uses Dialogs;

procedure TForm1.Button1Click(Sender: TObject);

var

  InputString: string;

begin

  InputString:= InputBox('Input Box', 'Prompt', 'Default string');

end;


InputQuery Example

This example uses a button and a label on the form. When the user clicks the button, the input box displays. If the user chooses OK, the string that appears in the edit box of the dialog box displays as the caption of the label on the form. If the user chooses Cancel, the dialog box closes and the caption of the label remains unchanged.

procedure TForm1.Button1Click(Sender: TObject);

var

  NewString: string;

  ClickedOK: Boolean;

begin

  NewString := 'Default String';

  Label1.Caption := NewString;

  ClickedOK := InputQuery('Input Box', 'Prompt', NewString);

  if ClickedOK then                 { NewString contains new input string }

    Label1.Caption := 'The new string is ''' + NewString + '''';

end;


Insert Example

var

  S: string;

begin

  S := 'Honest Lincoln';

  Insert('Abe ', S, 8);                    { 'Honest Abe Lincoln' }

end;


Int Example

var

  R: Real;

begin

  R := Int(123.456);    { 123.0 }

  R := Int(-123.456);   { -123.0 }

end;


Length, IntToHex Example

The following example uses an edit control, a button, and a label on a form. When the button is clicked, the hexadecimal value of each character in the edit control is displayed in the label.

procedure TForm1.Button1Click(Sender: TObject);

var

  i: Integer;

begin

  Label1.Caption := '';

  for i := 1 to Length(Edit1.Text) do

  begin

    try

      Label1.Caption := Label1.Caption + IntToHex(Edit1.Text[i],4) + ' ';

    except

      Beep;

    end;

  end;

end;


IntToStr Example

The following example uses two edit controls, a button, and a label on a form. When the button is clicked, the integers in the edit controls are multiplied together and the result is displayed in the label.

procedure TForm1.Button1Click(Sender: TObject);

begin

  try

    Label1.Caption := IntToStr(StrToInt(Edit1.Text) * StrToInt(Edit2.Text));

  except

    ShowMessage('You must specify integer values. Please try again.');

  end;

end;


IOResult Example

var

  F: file of Byte;

begin

  if OpenDialog1.Execute then begin

    AssignFile(F, OpenDialog1.FileName);

    {$I-}

    Reset(F);

    {$I+}

    if IOResult = 0 then

      MessageDlg('File size in bytes: ' + IntToStr(FileSize(F)),

        mtInformation, [mbOk], 0)

    else

      MessageDlg('File access error', mtWarning, [mbOk], 0);

  end;

end;


IsLeapYear Example

The following function indicates whether the current year is a leap year.

function IsThisLeapYear: Boolean;

var

Yr, Mnth, Day: Word;

begin

  DecodeDate(Date, Yr, Mnth, Day);

  Result := IsLeapYear(Yr);

end;


Exp, Ln Example

var

   e : real;

   S : string;

begin

   e := Exp(1.0);

   Str(ln(e):3:2, S);

   S := 'e = ' + FloatToStr(e) + '; ln(e) = ' + S;

   Canvas.TextOut(10, 10, S);

end;


Lo Example

var B: Byte;

begin

  B := Lo($1234);   { $34 }

end;


Low, High Example

function Sum( var X: array of Double): Double;

var

  I: Word;

  S: Real;

begin

  S := 0; { Note that open array index range is always zero-based. }

  for I := 0 to High(X) do S := S + X[I];

  Sum := S;

end;

procedure TForm1.Button1Click(Sender: TObject);

var

  List1: array[0..3] of Double;

  List2: array[5..17] of Double;

  X: Word;

  S, TempStr: string;

begin

  for X := Low(List1) to High(List1) do

      List1[X] := X * 3.4;

  for X := Low(List2) to High(List2) do

      List2[X] := X * 0.0123;

  Str(Sum(List1):4:2, S);

  S := 'Sum of List1: ' + S + #13#10;

  S := S + 'Sum of List2: ';

  Str(Sum(List2):4:2, TempStr);

  S := S + TempStr;

  MessageDlg(S, mtInformation, [mbOk], 0);

end;


LowerCase Example

This example uses an edit control, a label, and a button on a form. When the user clicks the button, the label shows the text of the edit control in lower case.

procedure TForm1.Button1Click(Sender: TObject);

begin

  Label1.Caption := LowerCase(Edit1.Text);

end;


MessageDlg Example

This example uses a button on a form. When the user clicks the button, a message box appears, asking if the user wants to exit the application. If the user chooses Yes, another dialog box appears informing the user the application is about to end. When user chooses OK, the application ends.

procedure TForm1.Button1Click(Sender: TObject);

begin

  if MessageDlg('Welcome to my Object Pascal application.  Exit now?',

    mtConfirmation, [mbYes, mbNo], 0) = mrYes then

  begin

    MessageDlg('Exiting the Object Pascal application.', mtInformation,

      [mbOk], 0);

    Close;

  end;

end;


MessageDlgPos Example

This example uses a button on a form. When the user clicks the button, a message box appears with a Yes, No, and Cancel button on it:

procedure TForm1.Button1Click(Sender: TObject);

begin

  MessageDlgPos('Are you there?',mtConfirmation, mbYesNoCancel, 0, 200, 200);

end;


MkDir Example

uses Dialogs;

begin

  {$I-}

  { Get directory name from TEdit control }

  MkDir(Edit1.Text);

  if IOResult <> 0 then

    MessageDlg('Cannot create directory', mtWarning, [mbOk], 0)

  else

    MessageDlg('New directory created', mtInformation, [mbOk], 0);

end;


Move Example

var

  A: array[1..4] of Char;

  B: Integer;

begin

  Move(A, B, SizeOf(B));  { SizeOf = safety! }

end;


New Example

type

  PListEntry = ^TListEntry;

  TListEntry = record

    Next: PListEntry;

    Text: string;

    Count: Integer;

  end;

var

  List, P: PListEntry;

begin

  ...

  New(P);

  P^.Next := List;

  P^.Text := 'Hello world';

  P^.Count := 1;

  List := P;

  ...

end;


Odd Example

begin

   if Odd(5) then

     Canvas.TextOut(10, 10, '5 is odd.')

   else

     Canvas.TextOut(10, 10, 'Something is odd!');

 end;


Ord Example

uses Dialogs;

type

   Colors = (RED,BLUE,GREEN);

var

  S: string;

 begin

   S := 'BLUE has an ordinal value of ' + IntToStr(Ord(BLUE)) + #13#10;

   S := S + 'The ASCII code for "c" is ' + IntToStr(Ord('c')) +  ' decimal';

   MessageDlg(S, mtInformation, [mbOk], 0);

 end;


ParamStr Example
ParamCount, ParamStr Example

The following example beeps once for each “beep” passed in on the command line. The example terminates the application if  “exit” is passed in on the command line.

procedure TForm1.FormCreate(Sender: TObject);

var

  i: Integer;

  for i := 0 to ParamCount – 1 do

  begin

    if LowerCase(ParamStr(i)) = 'beep' then

      Beep(10000,1000)

    else if (LowerCase(ParamStr(i)) = 'exit' then

      Application.Terminate;

  end;

end;


PasswordDialog Example

procedure TForm1.Button1Click(Sender: TObject);

begin

  with Table1 do

    if PasswordDialog(DBSession) then

      Active := True;

end;


Polygon, Point Example

This example draws a polygon in the specified shape, and fills it with the color teal:

procedure TForm1.FormActivate(Sender: TObject);

begin

  Canvas.Brush.Color := clTeal;

  Canvas.Polygon([Point(10, 10), Point(30, 10),

    Point(130, 30), Point(240, 120)]);

end;


Pos Example

var S: string;

begin

  S := '   123.5';

  { Convert spaces to zeroes }

  while Pos(' ', S) > 0 do

    S[Pos(' ', S)] := '0';

end;


Pred, Succ Example

uses Dialogs;

type

   Colors = (RED,BLUE,GREEN);

 var

   S: string;

 begin

   S := 'The predecessor of 5 is ' + IntToStr(Pred(5)) + #13#10;

   S := S + 'The successor of 10 is ' + IntToStr(Succ(10)) + #13#10;

   if Succ(RED) = BLUE then

     S := S + 'In the type Colors, RED is the predecessor of BLUE.';

   MessageDlg(S, mtInformation, [mbOk], 0);

 end;


Randomize, Random Example

var

   I: Integer;

 begin

   Randomize;

   for I := 1 to 50 do begin

     { Write to window at random locations }

     Canvas.TextOut(Random(Width), Random(Height), 'Boo!');

   end;

 end;


Readln, Writeln Example

{ This example assumes you are compiling as a console application }

var

   s : string;

 begin

   Write('Enter a line of text: ');

   Readln(s);

   Writeln('You typed: ',s);

   Writeln('Hit <Enter> to exit');

   Readln;

 end;


RegisterComponents Example

The following code registers several components, some on the System palette page that already exists, and some on a new palette page that Delphi creates when the components are installed.

procedure Register;

begin

   RegisterComponents('System', [TSystem1, TSystem2]); {add to system page}

   RegisterComponents('MyCustomPage',[TCustom1, TCustom2]); { new page}

end;


Rename Example

uses Dialogs;

var

   f : file;

 begin

   OpenDialog1.Title := 'Choose a file... ';

   if OpenDialog1.Execute then begin

     SaveDialog1.Title := 'Rename to...';

     if SaveDialog1.Execute then begin

       AssignFile(f, OpenDialog1.FileName);

       Canvas.TextOut(5, 10, 'Renaming ' + OpenDialog1.FileName + ' to ' +

         SaveDialog1.FileName);

       Rename(f, SaveDialog1.FileName);

     end;

   end;

 end;


Reset Example

function FileExists(FileName: string): Boolean;

{ Boolean function that returns True if the file exists; otherwise,

  it returns False. Closes the file if it exists. }

 var

  F: file;

begin

  {$I-}

  AssignFile(F, FileName);

  FileMode := 0;  {Set file access to read only }

  Reset(F);

  CloseFile(F);

  {$I+}

  FileExists := (IOResult = 0) and (FileName <> '');

end;  { FileExists }

begin

  if FileExists(ParamStr(1)) then {Get file name from command line}

    Canvas.TextOut(10, 10, 'File exists')

  else

    Canvas.TextOut(10, 10, 'File not found');

end;


Rewrite Example

var F: TextFile;

begin

  AssignFile(F, 'NEWFILE.$$$');

  Rewrite(F);

  Writeln(F, 'Just created file with this text in it...');

  CloseFile(F);

end;


RmDir Example

uses Dialogs;

begin

   {$I-}

   { Get directory name from TEdit control }

   RmDir(Edit1.Text);

   if IOResult <> 0 then

     MessageDlg('Cannot remove directory', mtWarning, [mbOk], 0)

   else

     MessageDlg('Directory removed', mtInformation, [mbOk], 0);

 end;


Round Example

var

   S, T: string;

begin

   Str(1.4:2:1, T);

   S := T + ' rounds to ' + IntToStr(Round(1.4)) + #13#10;

   Str(1.5:2:1, T);

   S := S + T + ' rounds to ' + IntToStr(Round(1.5)) + #13#10;

   Str(-1.4:2:1, T);

   S := S + T + ' rounds to ' + IntToStr(Round(-1.4)) + #13#10;

   Str(-1.5:2:1, T);

   S := S + T + ' rounds to ' + IntToStr(Round(-1.5));

   MessageDlg(S, mtInformation, [mbOk], 0);

end;


RunError Example

begin

{$IFDEF Debug}

  if P = nil then

    RunError(204);

{$ENDIF}

end;


SeekEof Example
SeekEoln, SeekEof Example

var

   f : System.TextFile;

   i, j, Y : Integer;

 begin

   AssignFile(f,'TEST.TXT');

   Rewrite(f);

   { Create a file with 8 numbers and some

     whitespace at the ends of the lines }

   Writeln(f,'1 2 3 4 ');

   Writeln(f,'5 6 7 8 ');

   Reset(f);

   { Read the numbers back. SeekEoln returns TRUE if there are no more

     numbers on the current line; SeekEof returns TRUE if there is no

     more text (other than whitespace) in the file. }

   Y := 5;

   while not SeekEof(f) do

   begin

     if SeekEoln(f) then

       Readln; { Go to next line }

     Read(f,j);

     Canvas.TextOut(5, Y, IntToStr(j));

     Y := Y + Canvas.TextHeight(IntToStr(j)) + 5;

   end;

 end;


SelectDirectory Example

This example uses a button and a label on a form. When the user clicks the button, a Select Directory dialog box appears. The current directory displayed in the dialog box is C:\MYDIR. The user can select a directory from the directory list, or enter a new directory in the edit box. If the user enters a new directory, a message box asks the user if the directory should be created. If the user chooses Yes, the directory is created. If the user chooses No, the message box goes away without creating the directory. The name of the directory the user selects appears as the caption of the label:

uses FileCtrl;

const

  SELDIRHELP = 1000;

procedure TForm1.Button1Click(Sender: TObject);

var

  Dir: string;

begin

  Dir := 'C:\MYDIR';

  if SelectDirectory(Dir, [sdAllowCreate, sdPerformCreate, sdPrompt],SELDIRHELP) then

    Label1.Caption := Dir;

end;


Set8087CW Example

procedure NumericExample;

var

  Saved8087CW: Word;

begin

  Saved8087CW := Default8087CW;

  Set8087CW($133f); { Disable all fpu exceptions }

  ThirdPartyRoutine;

  Set8087CW(Saved8087CW);

end;


SetMemoryManager Example
GetMemoryManager, SetMemoryManager Example

The following example implements a memory manager that counts the number of times the GetMem, FreeMem, and ReallocMem entry points are called. You must call the SetNewMemMgr routine to install the new memory manager. The new memory manager routines simply pass on the requests to the previous memory manager after incrementing the appropriate counter.

var

  GetMemCount: Integer;

  FreeMemCount: Integer;

  ReallocMemCount: Integer;

  OldMemMgr: TMemoryManager;

function NewGetMem(Size: Integer): Pointer;

begin

  Inc(GetMemCount);

  Result := OldMemMgr.GetMem(Size);

end;

function NewFreeMem(P: Pointer): Integer;

begin

  Inc(FreeMemCount);

  Result := OldMemMgr.FreeMem(P);

end;

function NewReallocMem(P: Pointer; Size: Integer): Pointer;

begin

  Inc(ReallocMemCount);

  Result := OldMemMgr.ReallocMem(P, Size);

end;

const

  NewMemMgr: TMemoryManager = (

  GetMem: NewGetMem;

  FreeMem: NewFreeMem;

  ReallocMem: NewReallocMem);

procedure SetNewMemMgr;

begin

  GetMemoryManager(OldMemMgr);

  SetMemoryManager(NewMemMgr);

end;


SetTextBuf Example

uses Dialogs;

var

  F, FTwo: System.TextFile;

  Ch: Char;

  Buf: array[1..4096] of Char;  { 4K buffer }

begin

  if OpenDialog1.Execute then begin

    AssignFile(F, OpenDialog1.FileName);

    { Larger buffer for faster reads }

    System.SetTextBuf(F, Buf);

    Reset(F);

    { Dump text file into another file }

    AssignFile(FTwo, 'WOOF.DOG');

    Rewrite(FTwo);

    while not Eof(f) do

    begin

      Read(F, Ch);

      Write(FTwo, Ch);

    end;

    System.CloseFile(F);

    System.CloseFile(FTwo);

  end;

end;


ShortCut Example

This line creates a shortcut, Ctrl+O, at run time and assigns it to the Open command on a File menu.

OpenCommand.ShortCut := ShortCut(Word('O'), [ssCtrl]);


ShortCutToKey Example

The following code redefines the ShortCut of CloseCommand if the original short cut used the [ssCtrl] shift state.

var

  TheKey: Word;

  TheShiftState: TShiftState;

begin

  ShortCutToKey(CloseCommand.ShortCut, TheKey, TheShiftState);

  if TheShiftState = [ssCtrl] then

   CloseCommand.ShortCut := ShortCut(Word('C'), [ssShift]);

end;


ShortCutToText Example

This line converts the menu shortcut assigned to the OpenCommand to a string and displays it in an edit box:

Edit1.Text := ShortCutToText(OpenCommand.ShortCut);


Sin Example

var

  R: Extended;

  S: string;

begin

  R := Sin(Pi);

  Str(R:5:3, S);

  Canvas.TextOut(10, 10, 'The Sin of Pi is ' + S);

end;


SizeOf Example

type

  CustRec = record

    Name: string[30];

    Phone: string[14];

  end;

 var

  P: ^CustRec;

begin

  GetMem(P, SizeOf(CustRec));

  Canvas.TextOut(10, 10, 'The size of the record is ' + IntToStr(SizeOf(CustRec)));

  FreeMem (P, SizeOf(CustRec));

end;


Sqr Example
Sqr, Sqrt Example

var

  S, Temp: string;

begin

   Str(Sqr(5.0):3:1, Temp);

   S := '5 squared is ' + Temp + #13#10;

   Str(Sqrt(2.0):5:4, Temp);

   S := S + 'The square root of 2 is ' + Temp;

   MessageDlg(S, mtInformation, [mbOk], 0);

end;


Str Example

function MakeItAString(I: Longint): string;

{ Convert any integer type to a string }

var

  S: string[11];

begin

  Str(I, S);

  Result:= S;

end;

begin

  Canvas.TextOut(10, 10, MakeItAString(-5322));

end;


StrComp Example

The following example uses two edit controls and a button on a form. When the button is clicked, the text in the edit controls is compared.

uses SysUtils;

procedure TForm1.Button1Click(Sender: TObject);

var

  Msg: string;

  CompResult: Integer;

begin

  Msg := Edit1.Text;

  CompResult := StrComp(PChar(Edit1.Text), PChar(Edit2.Text));

  if CompResult < 0 then

    Msg := Msg + ' is less than '

  else if CompResult > 0 then

    Msg := Msg + ' is greater than '

  else

    Msg := Msg + ' is equal to '

  Msg := Msg + Edit2.Text;

  ShowMessage(Msg);

end;


StrCopy, StrCat Example

The following example uses an edit control, a label, and a button on a form. When the button is clicked, the label’s caption and the edit control’s text are combined in a buffer. Then the buffer is displayed in the label’s caption.

procedure TForm1.Button1Click(Sender: TObject);

var

  Buffer: PChar;

begin

  GetMem(Buffer,Length(Label1.Caption) + Length(Edit1.Text) + 1);

  StrCopy(Buffer, PChar(Label1.Caption));

  StrCat(Buffer, PChar(Edit1.Text));

  Label1.Caption := Buffer;

  Edit1.Clear;

  FreeMem(Buffer);

end;


StrECopy Example

uses SysUtils;

const

  Turbo: PChar = 'Object';

  Pascal: PChar = 'Pascal';

 var

  S: array[0..15] of Char;

begin

  StrECopy(StrECopy(StrECopy(S, Turbo), ' '), Pascal);

  Canvas.TextOut(10, 10, string(S));

end;


StrEnd Example

The following example uses an edit control, a label, and a button on a form. When the button is clicked, the edit control’s text is copied into a buffer. Then the buffer is displayed backwards in the label.

procedure TForm1.Button1Click(Sender: TObject);

var

  TextBuffer: PChar;

  Ptr: PChar;

begin

  GetMem(TextBuffer, Length(Edit1.Text)+1);

  StrCopy(TextBuffer, PChar(Edit1.Text));

  Ptr := StrEnd(TextBuffer);

  Label1.Caption := '';

  while Ptr >= TextBuffer do

  begin

    Ptr := Ptr – 1;

    Label1.Caption := Label1.Caption + Ptr^;

  end;

  FreeMem(TextBuffer);

end;


StrlComp Example

The following example uses two edit controls and a button on a form. When the button is clicked, the text in the edit controls are compared case-insensitively.

uses SysUtils;

procedure TForm1.Button1Click(Sender: TObject);

var

  Msg: string;

  CompResult: Integer;

begin

  Msg := Edit1.Text;

  CompResult := StrIComp(PChar(Edit1.Text), PChar(Edit2.Text));

  if CompResult < 0 then

    Msg := Msg + ' is less than '

  else if CompResult > 0 then

    Msg := Msg + ' is greater than '

  else

    Msg := Msg + ' is equal to '

  Msg := Msg + Edit2.Text;

  ShowMessage(Msg);

end;


StrLen, StrLCat Example

The following example uses an edit control and a button on a form. When the button is clicked, the edit control’s text is split in halves that are copied into separate buffers. Then the contents of the buffers are displayed in a message box.

procedure TForm1.Button1Click(Sender: TObject);

var

  FirstHalf: PChar;

  SecondHalf: PChar;

  HalfLen: Integer;

begin

  HalfLen := StrLen(PChar(Edit1.Text)) div 2;

  GetMem(FirstHalf,HalfLen+2);

  GetMem(SecondHalf,HalfLen+2);

  FirstHalf^ := Chr(0);

  SecondHalf^ := Chr(0);

  StrLCat(FirstHalf, PChar(Edit1.Text), HalfLen);

  StrCat(SecondHalf, PChar(Edit1.Text) + HalfLen);

  Application.MessageBox(FirstHalf, 'First Half', MB_OK);

  Application.MessageBox(SecondHalf, 'Second Half', MB_OK);

  FreeMem(FirstHalf);

  FreeMem(SecondHalf);

end;


StrLComp Example

uses SysUtils;

const

  S1: PChar = 'Enterprise'

  S2: PChar = 'Enter'

var

  ComStr: string;

begin

  if StrLComp(S1, S2, 5) = 0 then

    ComStr := 'equal'

  else

    ComStr := 'different';

  Canvas.TextOut(10, 10, 'The first five characters are ' + ComStr);

end;


StrLCopy Example

The following example uses an edit control and a button on a form. When the button is clicked, the first X bytes of the edit control are copied into a buffer, where X is a predefined number.

uses SysUtils;

const MAX_BUFFER = 10;

procedure TForm1.Button1Click(Sender TObject);

var

  Buffer: array [0..MAX_BUFFER] of char;

begin

  StrLCopy(Buffer, PChar(Edit1.Text), MAX_BUFFER);

  Application.MessageBox(Buffer, 'StrLCopy Example', MB_OK);

end;


StrLIComp Example

uses SysUtils;

const

  S1: PChar = 'Enterprise'

  S2: PChar = 'Enter'

var

  ComStr: string;

begin

  if StrLIComp(S1, S2, 5) = 0 then

    ComStr := 'equal'

  else

    ComStr := 'different';

  Canvas.TextOut(10, 10, 'The first five characters are ' + ComStr);

end;


StrLower Example

uses SysUtils;

const

  S: PChar = 'A fUnNy StRiNg'

begin

  Canvas.TextOut(5, 10, string(StrLower(S)) + ' ' + string(StrUpper(S)));

end;


StrMove Example

This example shows two functions that do the same thing as StrNew and StrDispose.

uses SysUtils;

function AHeapaString(S: PChar): PChar;

{ Allocate string on heap }

 var

  L: Cardinal;

  P: PChar;

begin

 StrNew := nil;

 if (S <> nil) and (S[0] <> #0) then

  begin

    L := StrLen(S) + 1;

    GetMem(P, L);

    StrNew := StrMove(P, S, L);

  end;

end;

procedure DisposeDaString(S: PChar);

{ Dispose string on heap }

begin

  if S <> nil then FreeMem(S, StrLen(S) + 1);

end;

var

  S: PChar;

begin

  AHeapaString(S);

  DisposeDaString(S);

end;


StrNew Example
 StrNew, StrDispose Example

This example uses an edit control and a button on a form. When the button is clicked, memory is allocated for a copy of the text in the edit control, the text is displayed in a message box, and then the memory is deallocated.

uses Sysutils;

procedure TForm1.Button1Click(Sender: TObject);

var

  Temp: PChar;

begin

  // Allocate memory.

  Temp := StrNew(PChar(Edit1.Text));

  Application.MessageBox(Temp, 'StrNew, StrDispose Example', MB_OK);

  // Deallocate memory.

  StrDispose(Temp);

end;


StrPCopy Example

uses SysUtils;

var

  A: array[0..79] of Char;

  S: String;

begin

  S := 'Honk if you know Blaise.';

  StrPCopy(A, S);

  Canvas.TextOut(10, 10, string(A));

end;


StrPos Example

The following example uses two edit controls and a button on a form. When the button is clicked, the text in the first edit control is searched for the text in the second edit control.

uses SysUtils;

procedure TForm1.Button1Click(Sender TObject);

var

  Location: PChar;

begin

  if StrPos(PChar(Edit1.Text), PChar(Edit2.Text)) <> nil then

    ShowMessage('Substring found')

  else

    ShowMessage('Substring not found');

end;


StrRScan Example

{ This function behaves much like ExtractFileName }

{ except that it uses null-terminated strings and }

{ it will not work with multi-byte character sets (MBCS). }

uses SysUtils;

function NamePart(FileName: PChar): PChar;

 var

  P: PChar;

begin

  P := StrRScan(FileName, '\');

  if P = nil then

  begin

    P := StrRScan(FileName, ':');

    if P = nil then P := FileName;

  end;

  NamePart := P;

end;

var

  S : string;

begin

  S := string(NamePart('C:\Test.fil'));

  Canvas.TextOut(10, 10, S);

end;


StrScan Example

uses SysUtils;

function HasWildcards(FileName: PChar): Boolean;

{ Return true if file name has wildcards in it }

begin

  HasWildcards := (StrScan(FileName, '*') <> nil) or

    (StrScan(FileName, '?') <> nil);

end;

const

  P: PChar = 'C:\Test.* ';

begin

  if HasWildcards(P) then

    ShowMessage('The string has wildcards')

  else

    ShowMessage('The string doesn't have wildcards');

end;


StrToDate, DayOfWeek Example

This example uses an edit box and a button on a form. When the user enters a date in the edit box in the MM/DD/YY format, the string entered is converted to a TDateTime value. This value is used to indicate the day of the week the date represents.

procedure TForm1.Button1Click(Sender: TObject);

var

  ADate: TDateTime;

  days: array[1..7] of string;

begin

  days[1] := 'Sunday';

  days[2] := 'Monday';

  days[3] := 'Tuesday';

  days[4] := 'Wednesday';

  days[5] := 'Thursday';

  days[6] := 'Friday';

  days[7] := 'Saturday';

  ADate := StrToDate(Edit1.Text);

  ShowMessage(Edit1.Text + ' is a ' + days[DayOfWeek(ADate)];

end;


StrToDateTime Example

This example sets the value of a date-time field based on the value typed by the user into an edit control.

procedure TForm1.Button1Click(Sender: TObject);

var

  ADateAndTime: TDateTime;

begin

  ADateAndTime := StrToDateTime(Edit1.Text);

  Table1.FieldByName('TimeStamp').AsDateTime := ADateAndTime;

end;


StrToInt Example

This example uses two edit boxes and a button on a form. When the user clicks the button, the code converts the values in the edit boxes to numbers, adds them, and displays a message indicating the sum:

procedure TForm1.Button1Click(Sender: TObject);

var

  I: Integer;

  J: Integer;

begin

  I := StrToInt(Edit1.Text);

  J := StrToInt(Edit2.Text);

  ShowMessage(IntToStr(I + J));

end;


StrToIntDef Example

This example uses two edit boxes and a button on a form. The user enters a number in the first edit box and clicks the button. If the number entered was a valid integer, the same value appears in the second edit box. If the number was not a valid integer, the default value of 1000 appears in the second edit box:

procedure TForm1.Button1Click(Sender: TObject);

var

  Number: Integer;

begin

  Number := StrToIntDef(Edit1.Text, 1000);

  Edit2.Text := IntToStr(Number);

end;


StrToTime Example

This example uses an edit box and a button on a form. When the user enters a time in the edit box in the HH:MM:SS format, the string entered is converted to a TDateTime value. A message then appears that says “Good Morning” or “Good Afternoon”, depending on whether the time entered was in the morning or afternoon.

procedure TForm1.Button1Click(Sender: TObject);

var

  ATime: TDateTime;

begin

  ATime := StrToTime(Edit1.Text);

  if ATime < 0.50 then

    ShowMessage('Good Morning')

  else

    ShowMessage('Good Afternoon');

end;


StrUpper Example

uses SysUtils;

const

  S: PChar = 'A fUnNy StRiNg'

begin

  Canvas.TextOut(5, 10, string(StrLower(S)) + ' ' +   string(StrUpper(S)));

end;


SystemTimeToDateTime Example

The following code retrieves the current date and time using the Windows GetLocalTime API call, and converts this value to a TDateTime value.

function GetCurrentDateTime: TDateTime;

var

  SystemTime: TSystemTime;

begin

  GetLocalTime(SystemTime);

  Result := SystemTimeToDateTime(SystemTime);

end;


Time Example
Time, TimeToStr Example

This procedure displays the current time in the form's caption every time the Timer's OnClick event fires, based upon the Interval Property (default: 1000 = 1 sec)

procedure TForm1.Timer1Timer(Sender: TObject);

var

  DateTime : TDateTime;

  str : string;

begin

  DateTime := Time;  // store the current date and time

  str := TimeToStr(DateTime); // convert the time into a string

  Caption := str;  // display the time on the form's caption

  { Note This could have been done with the following line of code:

    Caption := TimeToStr(Time); }

end;


Trunc Example

var

   S, T: string;

begin

   Str(1.4:2:1, T);

   S := T + ' Truncs to ' + IntToStr(Trunc(1.4)) + #13#10;

   Str(1.5:2:1, T);

   S := S + T + ' Truncs to ' + IntToStr(Trunc(1.5)) + #13#10;

   Str(-1.4:2:1, T);

   S := S + T + ' Truncs to ' + IntToStr(Trunc(-1.4)) + #13#10;

   Str(-1.5:2:1, T);

   S := S + T + ' Truncs to ' + IntToStr(Trunc(-1.5));

   MessageDlg(S, mtInformation, [mbOk], 0);

end;


Truncate Example

var

   f: file of Integer;

   i,j: Integer;

 begin

   AssignFile(f,'TEST.INT');

   Rewrite(f);

   for i := 1 to 6 do

     Write(f,i);

   Writeln('File before truncation:');

   Reset(f);

   while not Eof(f) do

   begin

     Read(f,i);

     Writeln(i);

   end;

   Reset(f);

   for i := 1 to 3 do

     Read(f,j); { Read ahead 3 records }

   Truncate(f); { Cut file off here }

   Writeln;

   Writeln('File after truncation:');

   Reset(f);

   while not Eof(f) do

   begin

     Read(f,i);

     Writeln(i);

   end;

   CloseFile(f);

   Erase(f);

 end;


UpCase Example

The following code uppercases every other character in the text of an edit control when the user clicks the button.

var

  s : string;

  i : Integer;

begin

  { Get string from TEdit control }

  s := Edit1.Text;

  for i := 1 to Length(s) do

    if i mod 2 = 0 then s[i] := UpCase(s[i]);

  Edit1.Text := s;

end;


UpperCase Example

This example uses a list box and a button on a form. Use the Items property editor in the Object Inspector to enter a list of strings in the list box. When the application runs and the button is clicked, the strings in the list box become uppercase.

procedure TForm1.Button1Click(Sender: TObject);

var

  I: Integer;

begin

  for I := 0 to ListBox1.Items.Count -1 do

    ListBox1.Items[I] := UpperCase(ListBox1.Items[I]);

end;


Val Example

uses Dialogs;

var

  I, Code: Integer;

begin

  { Get text from TEdit control }

  Val(Edit1.Text, I, Code);

  { Error during conversion to integer? }

  if Code <> 0 then

    MessageDlg('Error at position: ' + IntToStr(Code), mtWarning, [mbOk], 0);

  else

    Canvas.TextOut(10, 10, 'Value = ' + IntToStr(I));

end;


VarArrayCreate, VarArrayOf Example

The following example creates a one-dimensional variant array with five elements. Each of the elements are of type Variant, and can therefore contain values of varying types, as is illustrated by the example. Notice in particular how the value of the last element of the array is itself a variant array.

var

  A: Variant;

begin

  A := VarArrayCreate([0, 4], varVariant);

  A[0] := 1;

  A[1] := 1234.5678;

  A[2] := 'Hello world';

  A[3] := True;

  A[4] := VarArrayOf([1, 10, 100, 1000]);

  WriteLn(A[2]);	{ Hello world }

  WriteLn(A[4][2]);	{ 100 }

end;


VarArrayLock, VarArrayUnlock Example

type

  PArrayData = ^TArrayData;

  TArrayData = array[0..9, 1..3] of Integer;

var

  A: Variant;

  P: PArrayData;

  I, J: Integer;

begin

  A := VarArrayCreate([1, 3, 0, 9], varInteger);

  P := VarArrayLock(A);

  try

  for I := 0 to 9 do

    for J := 1 to 3 do

      P^[I, J] := J * 10 + I;

  finally

    VarArrayUnlock(A);

  end;

  WriteLn(A[1, 9]);	{ 19 }

  WriteLn(A[3, 4]);	{ 34 }

end;


Application Example

This code displays the name of your project in an edit box:

procedure TForm1.Button1Click(Sender: TObject);

begin

  Edit1.Text := Application.Title;

end;


Currency and date/time formatting Example

This example uses a label and a button on a form. When the user clicks the button, the current date displays in the caption of the label. Because some of the date variables are assigned new values, the format of the date in the label changes. For example, if the date is 9/15/94, the date displays as 9-15-1994.

procedure TForm1.Button1Click(Sender: TObject);

begin

  DateSeparator := '-';

  DateFullYear := True;

  DateLeadZero := True;

  Label1.Caption := DateToStr(Date);

end;


ErrorProc Example

procedure MyErrorHandler(ErrorCode: Integer; ErrorAddr: Pointer);

ErrorProc := MyErrorHandler


Screen Example

The following code sets the width of a form called Form1 to half the width of the screen:

Form1.Width := Screen.Width div 2;


TDragState Example

This code is an OnDragOver event handler that won't allow a label control to be dropped on a panel control and stops the dragging of the label as soon as the user drags the label onto the panel:

procedure TForm1.Panel1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);

begin

  Accept := False;

  if (Source is TLabel) and (State = dsDragEnter) then

    (Source as TLabel).EndDrag(False);

end;


TVarData Example

This example shows how to use the TVarData type in typecasts of Variant variables to access the internals of a variable.

var

  V: Variant;

begin

  ...

  if TVarData(V).VType = varEmpty then ...;

  ...

  VarClear(V);

  TVarData(V).VType := varInteger;

  TVarData(V).VInteger := 1234567;

  ...

end;


Unassigned Example

In the code fragment shown below, the statement that assigns Unassigned to the MSWord variable causes the OLE Automation Object that was created to interface with Word to be released.

var

  MSWord: Variant;

begin

  ...

  MSWord := CreateOleObject('Word.Basic');

  ...

  MSWord := Unassigned;

  ...

end;


TResourceStream

Hierarchy	Properties	Methods	See also

TResourceStream is a memory stream that provides access to the compiled resources in a Windows application.

Unit

classes

Description

Use TResourceStream to read the resources of a Windows application. An instance of TResourceStream holds the value of a single resource in a memory buffer where it is accessible to the application.

The global ReadComponentRes function uses TResourceStream to access the compiled resources used by the application.


TResourceStream properties

TResourceStream	Alphabetically	Legend

Derived from TCustomMemoryStream

Memory

Derived from TStream

Position

Size


TResourceStream properties

TResourceStream	By object	Legend

Memory

Position

Size


TResourceStream methods

TResourceStream	Alphabetically

In TResourceStream

Create

CreateFromID

Destroy

Write

Derived from TCustomMemoryStream

Read

SaveToFile

SaveToStream

Seek

Derived from TStream

CopyFrom

FixupResourceHeader

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TResourceStream methods

TResourceStream	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

CopyFrom

Create

CreateFromID

DefaultHandler

Destroy

Dispatch

FieldAddress

FixupResourceHeader

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Read

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

SafeCallException

SaveToFile

SaveToStream

Write

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader


TResourceStream.Create

TResourceStream	See also

Creates an instance of TResourceStream associated with a particular resource name and type.

constructor Create(Instance: THandle; const ResName: string; ResType: PChar);

Description

Call Create to instantiate a TResourceStream, passing in parameters that identify the resource in a specified instance. TResourceStream finds the resource data and loads it into the Memory buffer for the TResourceStream.

The Instance parameter is the Windows instance handle associated with the executable or DLL that contains the resource.

In the first constructor syntax, the ResName is the string associated with the resource in the .RC file that was compiled with the application. If the resource is associated with an integer ID rather than a string, use the string representation of the integer after a pound sign (#). Thus, for example, a resource with an integer identifier of 128 be identified by a ResName of #128.

Note:	Specifying resources by ID requires less memory than specifying resources by name.

The ResType is a string identifying the type of the resource. Applications can define their own resource types and identify them by name in the .RC file. In addition, Windows provides a number of predefined resource types. To identify a resource that is one of the predefined Windows resource types, set ResType to the appropriate value from the following table.

ResType	Type of resource

RT_ACCELERATOR	Accelerator table

RT_BITMAP	Bitmap resource

RT_DIALOG	Dialog box

RT_FONT	Font resource

RT_FONTDIR	Font directory resource

RT_MENU	Menu resource

RT_RCDATA	Application-defined resource (raw data)

RT_STRING	String-table entry

RT_MESSAGETABLE	Message-table entry

RT_CURSOR	Hardware-dependent cursor resource

RT_GROUP_CURSOR	Hardware-independent cursor resource

RT_ICON	Hardware-dependent icon resource

RT_GROUP_ICON	Hardware-independent icon resource

RT_VERSION	Version resource


TResourceStream.CreateFromID

TResourceStream	See also

Creates an instance of TResourceStream associated with a particular resource ID and type.

constructor CreateFromID(Instance: THandle; ResID: Integer; ResType: PChar);

Description

Call CreateFromID to instantiate a TResourceStream for a resource in the indicated instance that can be identified by an integer ID. Create finds the resource data and loads it into the Memory buffer for the TResourceStream.

The Instance parameter is the Windows instance handle associated with the executable or DLL that contains the resource.

The ResID is the integer ID associated with the resource in the .RC file that was compiled with the application. If the Resource was identified by a string rather than an ID number, use the Create method instead.

The ResType is a string identifying the type of the resource. Applications can define their own resource types and identify them by name in the .RC file. In addition, Windows provides a number of predefined resource types. To identify a resource that is one of the predefined Windows resource types, set ResType to the appropriate value from the following table.

ResType	Type of resource

RT_ACCELERATOR	Accelerator table

RT_BITMAP	Bitmap resource

RT_DIALOG	Dialog box

RT_FONT	Font resource

RT_FONTDIR	Font directory resource

RT_MENU	Menu resource

RT_RCDATA	Application-defined resource (raw data)

RT_STRING	String-table entry

RT_MESSAGETABLE	Message-table entry

RT_CURSOR	Hardware-dependent cursor resource

RT_GROUP_CURSOR	Hardware-independent cursor resource

RT_ICON	Hardware-dependent icon resource

RT_GROUP_ICON	Hardware-independent icon resource

RT_VERSION	Version resource

Note:	Specifying resources by ID requires less memory than specifying resources by name.


TResourceStream.Destroy

TResourceStream	See also

Destroys an instance of TResourceStream.

destructor Destroy; override;

Description

Do not call Destroy directly in an application to destroy an instance of TResourceStream. Instead, call Free. Free verifies that the TResourceStream reference is not nil, and only then calls Destroy.

Destroy frees the memory buffer that stores the resource before calling the inherited destructor.


TResourceStream.Write

TResourceStream	See also

Overrides the inherited method to raise an exception when an attempt is made to write the resource back to the application.

function Write(const Buffer; Count: Longint): Longint; override;

Description

Applications should not use a TResourceStream to write the resources of the running application. Write overrides the inherited method to raise an EStreamError exception when an application tries to write to the application’s resources.

As all other data-writing methods of TResourceStream (WriteBuffer, WriteComponent) call Write to do the actual writing, calling any of the data-writing methods of TResourceStream will raise an exception.


Accessibility

Read-only


Hierarchy

TObject

TStream

TCustomMemoryStream


CreateAction function

See also

Creates an action, of the specified type, which is displayed in the action list editor.

Unit

ActnList

Category

action support

function CreateAction(AOwner: TComponent; ActionClass: TBasicActionClass): TBasicAction;

Description

CreateAction creates an action of type ActionClass that is displayed in the action list editor at design time. The AOwner is typically the form. CreateAction is called automatically when you add an action to the action list. Calling this function does the same thing as

ActionClass.Create(AOwner);

except that CreateAction uses the Resource parameter of the RegisterActions procedure to initialize the values of the action object based upon the Resource.


EnumRegisteredActions procedure

See also

Iterates through the list of registered actions passing them to a user-defined callback.

Unit

ActnList

Category

action support

TEnumActionProc = procedure (const Category: string; ActionClass: TBasicActionClass; Info: Pointer) of object;

procedure EnumRegisteredActions(Proc: TEnumActionProc; Info: Pointer);

Description

EnumRegisteredActions iterates the list of registered actions passing them to the user-defined callback, Proc.

Category is the category of the action. For TContainedAction descendants, this is the Category property; for ancestor classes you can pass in an empty string. The ActionClass parameter describes the class type of the action object. The Info parameter of the callback is the same as the Info parameter passed to EnumRegisteredActions. It allows the user to pass custom information to the callback.


RegisterActions procedure

See also

Registers action classes so that they appear as a selection option in the action list editor.

Unit

ActnList

Category

action support

procedure RegisterActions(const CategoryName: string; const AClasses: array of TBasicActionClass; Resource: TComponentClass);

Description

RegisterActions enables a class to appear in the action list editor as a selection when you choose New Action. At design-time the StdReg unit calls RegisterActions. To install your own actions so that they can be used with the action list editor, call RegisterActions to register them.

The CategoryName parameter specifies the value of the actions’ Category property. The AClasses parameter is an array of custom action class names.

The Resource parameter lets you assign default values to the properties of the actions being registered. Resource is the class of a TDataModule descendant that contains instances of the action classes listed by AClasses, where the properties of those instances are set to the default values. This parameter can be set to nil if there is no need to assign default values.


UnRegisterActions procedure

See also

Unregisters a set of actions.

Unit

ActnList

Category

action support

procedure UnRegisterActions(const AClasses: array of TBasicActionClass);

Description

UnregisterActions unregisters a set of actions that were registered with the RegisterActions procedure. The AClasses parameter is a list of registered action classes (descendants of TBasicAction) that are to be unregistered.


Bounds function

See also

Returns the TRect for a rectangle of given dimensions.

Unit

Classes

Category

type conversion routines

function Bounds(ALeft, ATop, AWidth, AHeight: Integer): TRect;

Description

Call Bounds to obtain a TRect for a rectangle with upper left corner at the point (ALeft, ATop) with width AWidth and height AHeight.


CurrentGroup variable

See also

Keeps track of which objects are associated with which packages.

Unit

Classes

Category

package support routines

var CurrentGroup: Integer;

Description

When a design-time package registers a property editor class, the registration list has to keep track of what package that property editor class is associated with.  Tracking this association ensures that if the package needs to be unloaded at design time (to recompile the package), the registration list knows which property classes to delete from its list. CurrentGroup is used to obtain an indicator that represents this association. It gets incremented every time a package is loaded at design time.

CurrentGroup is used to write design-time tools that keep track of things stored in other packages.


CollectionsEqual function

See also

Compares the contents of two collections.

Unit

Classes

Category

miscellaneous routines

function CollectionsEqual(C1, C2: TCollection): Boolean;

Description

Call CollectionsEqual to determine whether two collections contain identical information. CollectionsEqual returns True if all the items in each collection have the same settings, and the items appear in the same order. CollectionsEqual returns False if the collections differ in number or order of items, or if any of the items in the collections differ.


FindClass function

See also

Finds and returns a class that is derived from TPersistent.

Unit

Classes

Category:

streaming utilities

function FindClass(const ClassName: string): TPersistentClass;

Description

Call FindClass to locate a class type by name.  FindClass searches the classes that the streaming system knows about.  Form classes and component classes that are referenced in a form declaration (instance variables) are automatically registered with the streaming system.  Other classes can be registered (with a call to RegisterClasses) so that the streaming system will recognize that class in a stream and know how to construct it.

If the requested class name cannot be found, FindClass raises an exception.


FindGlobalComponent variable

See also

Returns a top-level container component.

Unit

Classes

Category

streaming utilities

type TFindGlobalComponent = function(const Name: string): TComponent;

var FindGlobalComponent: TFindGlobalComponent;

Description

FindGlobalComponent is a procedure pointer used by the VCL streaming system to implement form linking. When a component property refers to a component on another form, data module, or other top-level container component, the streaming system calls FindGlobalComponent to locate the root object in the form linking reference (e.g. Form1 in "Form1.Edit1"). If the object cannot be found, FindGlobalComponent returns nil.


GetClass function

See also	Example

Returns a registered persistent class given its name.

Unit

Classes

Category

streaming utilities

function GetClass(const ClassName: string): TPersistentClass;

Description

Call GetClass to obtain a class from a class name. This class can be used as a parameter to routines that require a class.

The Class must be registered before GetClass can find it.  Form classes and component classes that are referenced in a form declaration (instance variables) are automatically registered when the form is loaded.  Other classes can be registered by calling RegisterClass or RegisterClasses.


LineStart function

Finds the end of the last whole line in a buffer.

Unit

Classes

Category

string handling routines (null-terminated)

function LineStart(Buffer, BufPos: PChar): PChar;

Description

Use LineStart to find the start of the last partial line in the buffer. LineStart starts at BufPos and scans backwards for a line-feed character (\n).  It returns a pointer to that character.  If no line-feed char is found, it returns the Buffer pointer.  Buffer should point to the begining of a block of memory and BufPos to the end of the block you want to scan.

Note:	The undocumented TParser class uses LineStart to locate line-endings in chunks of text read into a fixed-sized buffer.  When the last full line of text is parsed, the parser moves the last partial line of text from the end of the buffer to the front and fills the rest of the buffer with new data from disk.


ObjectBinaryToText procedure

See also	Example

Converts the binary representation of an object into more readily understandable text.

Unit

Classes

Category

streaming utilities

procedure ObjectBinaryToText(Input, Output: TStream); overload;

procedure ObjectBinaryToText(Input, Output: TStream; var OriginalFormat: TStreamOriginalFormat); overload;

Description

Call ObjectBinaryToText to convert the representation of an object as it is saved in files and memory streams into a text version that human readers can understand. ObjectBinaryToText creates a TReader object for the Input stream, and uses this to read the saved representation of the object. A symbolic text representation is then written to the Output stream. OriginalFormat indicates the format in which the object was saved.

Use the WriteComponent method of the Input stream to write a binary representation before calling ObjectBinaryToText.


ObjectResourceToText procedure

See also

Converts the binary representation of an object resource into more readily understandable text.

Unit

Classes

Category

streaming utilities

procedure ObjectResourceToText(Input, Output: TStream); overload;

procedure ObjectResourceToText(Input, Output: TStream; var OriginalFormat: TStreamOriginalFormat); overload;

Description

Call ObjectResourceToText to convert the representation of an object as it is saved in module resource files into a text version that that human readers can understand. ObjectResourceToText is the same as ObjectBinaryToText, except that it reads from a stream that includes a resource header.

ObjectResourceToText converts the binary version of a form, as stored in a .dfm file, into the text version that can be seen by right clicking the form and choosing View As Text.

Use the WriteComponentRes method of the Input stream to write the binary representation before calling ObjectResourceToText.


ObjectTextToBinary procedure

See also	Example

Converts a symbolic text representation of an object into the binary version that is used to save the object to files or memory streams.

Unit

Classes

Category

streaming utilities

procedure ObjectTextToBinary(Input, Output: TStream); overload;

procedure ObjectTextToBinary(Input, Output: TStream; var OriginalFormat: TStreamOriginalFormat); overload;

Description

Call ObjectTextToBinary to create the internal representation of a VCL object from a symbolic text representation. ObjectTextToBinary creates a TWriter object for the Output stream, and uses this to write the form file representation of the object from the symbolic representation that is read from the Input stream. OriginalFormat indicates whether the output stream stores the object in binary or text format.

Use the ReadComponent method of the output stream to obtain the actual object.


ObjectTextToResource procedure

See also

Converts a symbolic text representation of an object into an internal binary representation.

Unit

Classes

Category

streaming utilities

procedure ObjectTextToResource(Input, Output: TStream); overload;

procedure ObjectTextToResource(Input, Output: TStream; var OriginalFormat: TStreamOriginalFormat); overload;

Description

Call ObjectTextToResource to create a VCL object from the representation of an object as it is saved in module resource files. ObjectTextToResource is the same as ObjectTextToBinary, except that it skips over any object headers and includes a resource header instead. Use the ReadComponentRes method of the output stream to obtain the actual object.

ObjectTextToResource converts the text version of a form that can be seen by right clicking the form and choosing View As Text into the binary version which is stored in a .dfm file.


Point function

See also	Example

Creates a TPoint structure from a pair of coordinates.

Unit

Classes

Category

type conversion routines

function Point(AX, AY: Integer): TPoint;

Description

Call Point to create a TPoint that represents the specified coordinates. Use Point to construct parameters for functions that require a point, rather than setting up local variables for each parameter.


ReadComponentRes function

See also

Reads components and their properties from a specified Windows resource.

Unit

Classes

Category

streaming utilities

function ReadComponentRes(const ResName: string; Instance: TComponent): TComponent;

Description

Call ReadComponentRes to create a component from its representation in a Windows resource header. The ResName parameter is the name assigned to the resource for the component. The Instance parameter is an instance of the component that should be filled in with the attributes of the saved resource. Instance must be an object of the same class as the saved resource, or one of its descendants.  Create an instance of the appropriate type of object, and then call ReadComponentRes to read in its property settings. If Instance is NULL, the object class is read from the resource.

ReadComponentRes returns an instance of the component that was read from the resource.


ReadComponentResEx function

See also

Reads a component from a resource.

Unit

Classes

Category

streaming utilities

function ReadComponentResEx(HInstance: THandle; const ResName: string): TComponent;

Description

Use ReadComponentResEx to load a component from a resource stored in a particular module (as opposed to ReadComponentRes, which assumes the current module).

The HInstance parameter is the instance handle for the module that stores the component as a resource.  The ResName parameter is the name assigned to the resource for the component.

ReadComponentResEx returns an instance of the component that was read from the resource.


ReadComponentResFile function

See also

Reads components and their properties from a specified Windows resource file.

Unit

Classes

Category

streaming utilities

function ReadComponentResFile(const FileName: string; Instance: TComponent): TComponent;

Description

Call ReadComponentResFile to create a component and its children from their representation in a Windows resource file. The FileName parameter is the name of the compiled resource file that contains the component resource. The Instance parameter is an instance of the type of component that should be read. Create an instance of the appropriate type of object, and then call ReadComponentResFile to read in its property settings. If Instance is NULL, the object class is read from the resource.

ReadComponentResFile returns an instance of the component that was read from the resource file.


Rect function

See also	Example

Creates a TRect structure from a set of coordinates.

Unit

Classes

Category

type conversion routines

function Rect(ALeft, ATop, ARight, ABottom: Integer): TRect;

Description

Call Rect to create a TRect that represents the rectangle with the specified coordinates. Use Rect to construct parameters for functions that require TRect, rather than setting up local variables for each parameter.


RegisterClass procedure

See also

Registers a class of persistent object so that it’s class type can be retrieved.

Unit

Classes

Category

streaming utilities

procedure RegisterClass(AClass: TPersistentClass);

Description

Call RegisterClass to register a class with the streaming system. Form classes and component classes that are referenced in a form declaration (instance variables) are automatically registered.  Any other classes used by an application must be explicitly registered by calling RegisterClass if instances are to be saved.

Once classes are registered, they can be loaded or saved by the VCL streaming system. GetClass returns nil when passed the class name of an unregistered class, and FindClass raises an exception for unregistered classes.

The AClass parameter is the class that is descended from TPersistent. Put the call to RegisterClass in a Register procedure or in the initialization section of the unit in which the class is defined.

If the class is already registered, RegisterClass does nothing. If a different class with the same name is already registered, RegisterClass raises an EFilerError exception.

Note:	Registering a component using the RegisterNoIcon or RegisterComponents method does not automatically register the class. It is still necessary to call RegisterClass for components.


RegisterClassAlias procedure

See also

Registers a class that is identical to another class except for the name.

Unit

Classes

Category

streaming utilities

procedure RegisterClassAlias(AClass: TPersistentClass; const Alias: string);

Description

Component writers call RegisterClassAlias to register custom classes that are identical to another persistent class except for the name. Registering a class allows it to be loaded and saved by the VCL streaming system.

The AClass parameter identifies the previously registered persistent class to which the new class is identical. The Alias parameter specifies the class name of the new class.


RegisterClasses procedure

See also

Registers a set of classes.

Unit

Classes

Category

streaming utilities

procedure RegisterClasses(AClasses: array of TPersistentClass);

Description

Call RegisterClasses to register a set of custom classes in a single line. Each class is registered by calling RegisterClass. Unregistered classes can’t be loaded or saved by the VCL streaming system.


RegisterComponents procedure

See also 	Example

Registers a set of components so that they all appear on the same page of the component palette.

Unit

Classes

Category

component registration routines

procedure RegisterComponents(const Page: string; ComponentClasses: array of TComponentClass);

Description

Call RegisterComponents to install a set of components in the IDE. Once a component is registered, it appears on the component palette, where it can be selected and placed on forms or data modules. Registered components can communicate with the Object Inspector to allow the user to get and set properties and events.

Set the Page parameter to the name of the page on the component palette where the components should appear. If the named page already exists, the components are added to that page. If the named page does not exist, a new palette page with that name is created.

Pass the components to be registered in the ComponentClasses parameter.

Call RegisterComponents from the implementation of the Register procedure in one of the units that defines the custom components. The units that define the components must then be compiled into a package and the package must be installed before the custom components appear in the component palette.

Note:	After components are registered, users can move them to different palette pages. Once this happens, the component always appears on the new page. Calling RegisterComponents a second time does not influence the page on which the component appears.


RegisterIntegerConsts procedure

See also

Registers conversion functions for string identifiers that represent type values.

Unit

Classes

Category

streaming utilities

procedure RegisterIntegerConsts(IntegerType: Pointer; IdentToInt: TIdentToInt; IntToIdent: TIntToIdent);

Description

RegisterIntegerConsts registers conversion functions for type identifiers in the unit that defines the base type. Use the TypeInfo function to obtain a Pointer to the type information for the base type.  This type information pointer is then passed as the IntegerType parameter. Once the conversion functions are registered, string identifiers can represent type values and the conversion functions are used to convert the string identifiers into the underlying integer values.  For example, the TColor type uses this system to convert between the type constants in the Graphics unit and numeric TColor values.


RegisterNoIcon procedure

See also

Registers a set of components but does not add them to the component palette.

Unit

Classes

Category

component registration routines

procedure RegisterNoIcon(ComponentClasses: array of TComponentClass);

Description

Call RegisterNoIcon to register a set of custom components so that objects from that class can use the Object Inspector. Because the components are not added to the component palette, instances of components registered using RegisterNoIcon must be explicitly created by calling the constructor, usually from another component.

The ComponentClasses parameter is an array of custom classes that are descended from TComponent.

Put the call to RegisterNoIcon in the Register procedure.

To add the components to the component palette, use RegisterComponents instead.


RegisterNonActiveX procedure

See also

Prevents a set of components from being made available to the ActiveX wizard.

Unit

Classes

Category

component registration routines

procedure RegisterNonActiveX(ComponentClasses: array of TComponentClass; AxRegType: TActiveXRegType);

Description

Call RegisterNonActiveX to prevent a registered set of custom components from being converted into ActiveX controls using the ActiveX wizard. The components must still be registered using RegisterComponents or RegisterNoIcon if they are to work with the Object Inspector.

The ComponentClasses parameter is an array of custom classes that are descended from TComponent.  The AxRegType parameter indicates whether only the components in the ComponentClasses array should be blocked from the ActiveX wizard (AxRegType = axrComponentOnly), or whether their descendants should be prohibited from becoming ActiveX controls as well (AxRegType = axrIncludeDescendants).

Put the call to RegisterNonActiveX in the Register procedure.


UnregisterClass procedure

See also

Unregisters an object class.

Unit

Classes

Category

streaming utilities

procedure UnRegisterClass(AClass: TPersistentClass);

Description

Call UnregisterClass to unregister an object class. When a class is unregistered, it can’t be loaded or saved by the VCL streaming system.

After unregistering a class, its name can be reused to register another object class.


UnregisterClasses procedure

See also

Unregisters a set of classes.

Unit

Classes

Category

streaming utilities

procedure UnRegisterClasses(AClasses: array of TPersistentClass);

Description

Call UnregisterClasses to unregister several persistent object classes in a single line. When a class is unregistered, it can’t be loaded or saved by the VCL streaming system.

The AClasses parameter specifies the classes (descendants of TPersistent) to unregister.

After unregistering a class, its name can be reused to register another object class.


UnregisterModuleClasses procedure

See also

Unregisters all classes defined in a specified module.

Unit

Classes

Category

streaming utilities

procedure UnRegisterModuleClasses(Module: HMODULE);

Description

Call UnregisterModuleClasses to unregister all object classes that were registered by the module with the handle specified by the Module parameter. When a class is unregistered, it can’t be loaded or saved by the VCL streaming system.

After unregistering a class, its name can be reused to register another object class.


WriteComponentResFile procedure

See also

Writes components and their properties to a file using a Windows resource file format.

Unit

Classes

Category

streaming utilities

procedure WriteComponentResFile(const FileName: string; Instance: TComponent);

Description

Use WriteComponentResFile to save the component specified by the Instance parameter to the specified file, storing it in a Windows resource-file format.

To read a component written with WriteComponentResFile, call ReadComponentResFile.


Clipboard function

See also

Returns an instance of TClipboard.

Unit

Clipbrd

Category

clipboard routines

function Clipboard: TClipboard;

Description

Delphi maintains a single instance of TClipboard for use whenever the application needs to access the clipboard directly. If the application has never used the Windows clipboard, calling Clipboard creates a new instance of TClipboard. If the clipboard has already been used, Clipboard returns the previously created TClipboard object.

To use Clipboard and the TClipboard object, add Clipbrd to the uses clause.


SetClipboard function

See also

Replaces the single global clipboard instance with another clipboard object.

Unit

Clipbrd

Category

clipboard routines

function SetClipboard(NewClipboard: TClipboard): TClipboard;

Description

Use SetClipboard to replace the global clipboard instance with a customized descendant of TClipboard.  SetClipboard returns the currently instantiated clipboard, if any.  After replacing the global clipboard instance using SetClipboard, an application must free the old clipboard that is returned.


CancelDrag procedure

Cancels a drag-and-drop or drag-and-dock operation that is in progress.

Unit

Controls

Category

drag and drop routines

procedure CancelDrag;

Description

Call CancelDrag to terminate the current drag-and-drop or drag-and-dock operation without dropping or docking the dragged object.


CursorToIdent function

See also

Returns the name of the predefined constant that corresponds to a cursor.

Unit

Controls

Category

cursor management routines

function CursorToIdent(Cursor: Longint; var Ident: string): Boolean;

Description

Use CursorToIdent to convert the cursor used by a control or one of the cursors made available by the global screen variable into the name of the corresponding constant.  Pass the cursor value as the Cursor parameter.  CursorToIdent returns the constant name as the Ident parameter.  If the cursor does not have an associated constant (for example, a custom cursor), CursorToIdent returns False.

To obtain a string representation of the cursor, even if there is no built-in cursor constant for it, use the CursorToString function.

CursorToIdent can be used to identify the current cursor in a list of possible cursor constants that is built using GetCursorValues.


CursorToString function

See also

Returns the AnsiString representation of a cursor.

Unit

Controls

Category

cursor management routines

function CursorToString(Cursor: TCursor): string;

Description

Use CursorToString to convert the cursor used by a control or one of the cursors made available by the global screen variable into a string that can be displayed to the user.  Pass the cursor value as the Cursor parameter.  If there is a predefined constant for the cursor, CursorToString returns the constant name.  If the cursor does not have an associated constant (for example, a custom cursor), CursorToString returns a string representation of the cursor’s numeric value.

To obtain a string representation of the cursor only if there is a built-in cursor constant, use CursorToIdent.


FindControl function

See also

Returns the windowed control whose window is identified by the specified window handle.

Unit

Controls

Category

Windows controls utilities

function FindControl(Handle: HWnd): TWinControl;

Description

Call FindControl to access the windowed control whose window is identified by the Handle parameter. If Handle is not the handle of the window of a windowed control, FindControl returns nil.


FindDragTarget function

See also

Returns the control at a specified screen coordinate.

Unit

Controls

Category

drag and drop routines

function FindDragTarget(const Pos: TPoint; AllowDisabled: Boolean): TControl;

Description

Call FindDragTarget to determine the potential drag-and-drop or drag-and-dock target currently under the mouse. FindDragTarget returns the control at the position specified by the Pos parameter. If there is not control at the specified position, FindDragTarget returns nil. The AllowDisabled parameter determines whether the search includes disabled controls.

If FindDragTarget returns a control, this does not mean that the control will necessarily accept the dragged object. The control will only accept the dragged object if it has an OnDragOver or OnDockOver event handler that accepts the object or if its DockSite property is True.


FindVCLWindow function

See also

Returns the windowed control, if any, at the specified location.

Unit

Controls

Category

mouse handling utilities

function FindVCLWindow(const Pos: TPoint): TWinControl;

Description

Call FindVCLWindow to locate the windowed control under a certain point.  For example, use FindVCLWindow to identify the windowed control that is under the mouse from another control that has captured the mouse.  The Pos parameter specifies the location that must be over the returned windowed control.  If there is no windowed control under the Pos parameter, FindVCLWindow returns nil.


GetCaptureControl function

See also

Returns the control, if any, that currently receives all mouse messages.

Unit

Controls

Category

mouse handling utilities

function GetCaptureControl: TControl;

Description

Call GetCaptureControl to determine which control is currently processing mouse messages.  When a control has captured the mouse, it receives all mouse messages, even if the mouse is not over the control.


GetCursorValues procedure

See also

Passes the name of every predefined cursor constant to a callback.

Unit

Controls

Category

cursor management routines

procedure GetCursorValues(Proc: TGetStrProc);

Description

Call GetCursorValues to execute a callback for every built-in cursor constant in the VCL.  The Proc parameter is the callback function that is called for every cursor constant name.

Note:	To convert the strings that are passed to the callback into actual cursors, use IdentToCursor.  To convert a cursor into a constant name that can be compared with the string passed to the callback, use CursorToIdent.


GetLongHint function

See also	Example

Returns the second part of a two-part hint string.

Unit

Controls

Category

Help Hint routines

function GetLongHint(const Hint: string): string;

Description

Call GetLongHint to obtain the long version of the hint specified as the value of a Hint property. The second part of the hint is the text following the | character. If the Hint string value is not separated into two parts, GetLongHint returns the entire string.


GetShortHint function

See also	Example

Returns the first part of a two-part hint string.

Unit

Controls

Category

Help Hint routines

function GetShortHint(const Hint: string): string;

Description

Call GetShortHint to obtain the short version of the hint specified as the value of a Hint property. The first part of the hint is the text preceding the | character. If the Hint string value is not separated into two parts, GetShortHint returns the entire string.


IdentToCursor function

See also

Translates a predefined cursor constant into a cursor.

Unit

Controls

Category

cursor management routines

function IdentToCursor(const Ident: string; var Cursor: Longint): Boolean;

Description

Call IdentToCursor to reverse the translation performed by the CursorToIdent function. This method is useful for converting the strings generated by GetCursorValues into useable cursors.  IdentToCursor returns True if the Ident parameter is successfully converted into a cursor.  IdentToCursor returns False if the Ident parameter is not the name of one of the built-in cursor constants.

Note:	If the string identifier for a cursor may represent either a numeric value or a cursor constant, use the StringToCursor function instead.


IsDragObject function

See also

Indicates whether a specified object is a TDragObject descendant.

Unit

Controls

Category

drag and drop routines

function IsDragObject(Sender: TObject): Boolean;

Description

Use IsDragObject to determine whether the object being dragged in a drag-and-drop or drag-and-dock operation is a specialized TDragObject that represents the dragged control’s data rather then the control itself.  Use IsDragObject on the Source parameter in an OnDragOver or OnDockOver event handler to determine the type of object being dragged and whether it should be accepted.  Use IsDragObject on the Source parameter of an OnDragDrop or OnDockDrop event handler to determine how to interpret the dragged object’s data.


Mouse variable

Contains information about the system’s mouse.

Unit

Controls

Category

mouse handling utilities

var Mouse: TMouse;

Description

Use Mouse to get information about the system’s mouse, including which window (if any) has captured the mouse, the position of the mouse, and mouse settings from the Control panel.


MoveWindowOrg procedure

See also

Changes the location of the point (0,0) within a device context.

Unit

Controls

Category

graphics utilities

procedure MoveWindowOrg(DC: HDC; DX, DY: Integer);

Description

Call MoveWindowOrg to change the location of where items are drawn on the canvas of an object.  When drawing to a canvas, objects specify the location of the image they draw as a set of coordinates, which are offsets from the upper left corner.  MoveWindowOrg allows the same drawing code to draw its image in a different location.  The DC parameter is a handle to the device context of the canvas, printer, or window where the image is to be drawn.  The DX and DY parameters specify the number of pixels to move the location of the (0,0) point on that drawing surface.

MoveWindowOrg is especially useful when playing metafiles, which draw to a particular position on a canvas, because it provides the ability to play the metafile to a different location on the canvas.


SetCaptureControl procedure

See also

Causes the specified control to receive all mouse messages.

Unit

Controls

Category

mouse handling utilities

procedure SetCaptureControl(Control: TControl);

Description

Call SetCaptureControl to allow a control to capture the mouse.  When the control has the mouse captured, it receives all mouse messages until another control captures the mouse by a subsequent call to SetCaptureControl or until the application calls the Windows API function ReleaseCapture.

Note:	Many VCL controls call SetCapture internally in response to mouse events.  Applications should be careful when using this routine.


StringToCursor function

See also

Returns a TCursor value given its string representation.

Unit

Controls

Category

cursor management routines

function StringToCursor(const S: string): TCursor;

Description

Call StringToCursor to reverse the translation performed by CursorToString. This method is useful for converting the strings entered by the user into useable TCursor values.

The S parameter can be either the name of a built-in cursor constant such as 'crHelp', or the string representation of a valid TCursor value such as '10'.  StringToCursor returns the TCursor value that corresponds to the S parameter.

Note:	The value returned by StringToCursor is not guaranteed to be a valid cursor.  If the Cursors property of the global Screen variable does not include a corresponding entry, the value returned by StringToCursor can not be used to set the Cursor property of a control.


Application variable (for control panel applets)

See also

Represents the application for a control panel applet project.

Unit

Ctlpanel

Category

control panel applications

var Application: TAppletApplication;

Description

When a new control panel project is created, Delphi constructs an application object and assigns it to Application. If the project represents a control panel applet, Application is initialized to a TAppletApplication object.


BCDToCurr function

See also

Converts a binary coded decimal value (BCD) to the corresponding Currency value.

Unit

Db

Category

type conversion routines

function BCDToCurr(const BCD: TBcd; var Curr: Currency): Boolean;

Description

Use BCDToCurr to convert a binary coded decimal value, such as is stored in a physical BCD database field, into a Currency object, which is the representation used by TBCDField objects. BCDToCurr returns True if the BCD value passed as the BCD parameter is successfully converted into a Currency object which is passed out as the Curr parameter.


CurrToBCD function

See also

Converts a Currency value to the corresponding binary coded decimal (BCD) value.

Unit

Dbcommon

Category

type conversion routines

function CurrToBCD(Curr: Currency; var BCD: FMTBcd; Precision: Integer=32; Decimals: Integer=4): Boolean;

Description

Use CurrToFMTBCD to convert a Currency value, such as is used by TBCDField objects, into a binary coded decimal value, such as is stored in a physical BCD database field. CurrToBCD returns True if the Currency object passed as the Curr parameter is successfully converted into a BCD value and passed out as the BCD parameter. The Precision parameter specifies the number of digits represented in the BCD value, and the Decimals parameter specifies the number of those digits that are after the decimal point.


DatabaseError procedure

See also

Creates and raises an EDatabaseError exception.

Unit

Db

Category

exception handling routines

procedure DatabaseError(const Message: string; Component: TComponent = nil);

Description

Call DatabaseError to raise an EDatabaseError exception, using Message as the text for the exception. If a component is provided as the second parameter, the message is prefixed by the name of the component to help in interpreting the error message.

Calling DatabaseError rather than creating and raising the exception directly in code reduces the overall code size of the application.


DatabaseErrorFmt procedure

See also

Creates and raises an EDatabaseError exception with a formatted error message.

Unit

Db

Category

exception handling routines

procedure DatabaseErrorFmt(const Message: string; const Args: array of const; Component: TComponent = nil);

Description

Call DatabaseError to throw an EDatabaseError exception. The error message for the exception is assembled from the format string specified by the Message parameter and applying the Args parameter.If a component is provided as the final parameter, the message is prefixed by the name of the component to help in interpreting the error message.

Call DatabaseErrorFmt rather than creating and raising the exception directly in code to reduce the overall code size of the application.


GetFieldProperty function

See also	Example

Returns a TField object for a dataset and data control.

Unit

Db

Category

BDE support routines

function GetFieldProperty(DataSet: TDataSet; Control: TComponent; const FieldName: String): TField;

Description

GetFieldProperty returns a reference to a field given the dataset component that accesses the table, the data-aware control that accesses the field, and the field name. GetFieldProperty returns a value of type TField.

DataSet is the dataset component used to access the table containing the field.

Control is the data-aware control used to access the field.

FieldName is the name of the field for which to create the TField return value.


RegisterFields procedure

See also

Registers a set of field components so that they appear in the Dataset designer.

Unit

Db

Category

component registration routines

procedure RegisterFields(const FieldClasses: array of TFieldClass);

Description

Call RegisterFields to allow custom descendants of TField to appear in the field type drop down of the new field dialog box.

The FieldClasses parameter is an array of TField descendants.


VarTypeToDataType function

See also

Returns the field type value that most closely corresponds to a Variant type.

Unit

Db

Category

Variant support routines

function VarTypeToDataType(VarType: Integer): TFieldType;

Description

Call VarTypeToDataType to infer the type of field component that should hold a value, given its Variant type. Use the VarType function to obtain a Variant type from a Variant.


DBUseRightToLeftAlignment function

See also

Indicates whether a data-aware control’s alignment is reversed to a right-to-left mode.

Unit

Dbctrls

Category

BiDiMode support routines

function DBUseRightToLeftAlignment(AControl: TControl; AField: TField): Boolean;

Description

Call DBUseRightToLeftAlignment to determine whether a control’s alignment has been reversed to a right-to-left mode. This information can be used when painting the control or when responding to mouse events.

DBUseRightToLeftAlignment returns True for middle east locales if the BiDiMode property is bdRightToLeft. Otherwise, it returns False.

AControl is the data-aware control to check.

AField is the field associated with the control specified in AControl. The AField parameter is necessary so that DBUseRightToLeftAlignment can be used with controls such as TDBLookupComboBox, which uses the list field and not the target field for determining alignment.


LoginDialog function

See also

Brings up the database Login dialog to allow the user to connect to a database server.

Unit

Dblogdlg

Category

dialog and message routines

function LoginDialog(const ADatabaseName: string; var AUserName, APassword: string): Boolean;

Description

Call LoginDialog to bring up the standard Login dialog box to prompt the user for a valid user name and password. The ADatabaseName parameter specifies the database for which access is being requested. It corresponds to the DatabaseName property of the TDatabase object. The dialog returns the user name and password as the AUserName and APassword parameters.

LoginDialog returns False if the user cancels out of the dialog. If LoginDialog returns True, the application can attempt to connect to the database server using the supplied user name and password.

Note:	If the user should not be permitted to change the user name from within the login dialog, use the LoginDialogEx function.


LoginDialogEx function

See also

Brings up the database Login dialog to allow the user to connect to a database server.

Unit

Dblogdlg

Category

dialog and message routines

function LoginDialogEx(const ADatabaseName: string; var AUserName, APassword: string; NameReadOnly: Boolean): Boolean;

Description

Call LoginDialog to bring up the standard Login dialog box to prompt the user for a valid user name and password. The ADatabaseName parameter specifies the database for which access is being requested. It corresponds to the DatabaseName property of the TDatabase object. The NameReadOnly parameter specifies whether the user can change the user name from within the dialog.

The dialog returns the user name and password as the AUserName and APassword parameters.

LoginDialog returns False if the user cancels out of the dialog. If LoginDialog returns True, the application can attempt to connect to the database server using the supplied user name and password.


PasswordDialog function

Example

Displays a dialog box that prompts the user for the password of a local password-protected table.

Unit

Dbpwdlg

Category

BDE support routines

function PasswordDialog(ASession: TComponent): Boolean;

Description

Use PasswordDialog to allow the user to enter a password for a password-protected Paradox or dBase table.

ASession is the name of the session instance to which the password is passed. If the user clicks OK in the dialog box, PasswordDialog returns True. Otherwise it returns False.

Note:	When an application opens a Paradox or dBase table that requires a password, the user is prompted to enter a password unless the Session component already has a valid password for that table.


AnsiToNative function

See also

Converts a string from the ANSI character set to the character set associated with a given locale.

Unit

Dbtables

Category

BDE support routines

function AnsiToNative(Locale: TLocale; const AnsiStr: string; NativeStr: PChar; MaxLen: Integer): PChar;

Description

Call AnsiToNative to convert a string represented in the ANSI character set (used internally by Windows) to the character set associated with the database locale specified by the Locale parameter. The resulting string is copied into the buffer pointed to by the NativeStr parameter. Use the MaxLen parameter to specify the size of this buffer. If the buffer is too small to contain all characters in the converted version of AnsiStr, the returned value is truncated. AnsiToNative returns a pointer to NativeStr.

Use AnsiToNative to convert strings typed by the user into the character set used by a database table.


AnsiToNativeBuf procedure

See also

Converts a string from the ANSI character set to the character set associated with a given locale.

Unit

Dbtables

Category

BDE support routines

procedure AnsiToNativeBuf(Locale: TLocale; Source, Dest: PChar; Len: Integer);

Description

Call AnsiToNativeBuf to convert a null-terminated string in the ANSI character set (used internally by Windows) to the character set associated with the database locale specified by the Locale parameter. The resulting string is copied into the buffer pointed to by the Dest parameter. Use the Len parameter to specify the size of this buffer.

Use AnsiToNativeBuf to convert strings typed by the user into the character set used by a database table.


Check procedure

See also

Determines whether a value returned from the Borland Database Engine (BDE) represents an error condition.

Unit

Dbtables

Category

BDE support routines

procedure Check(Status: DBIResult);

Description

Pass the return code from a direct BDE API call as the Status parameter when calling Check. Check determines whether Status indicates an error condition, and if so, calls DbiError to raise an exception.


DBIError procedure

See also

Creates and raises an EDBEngineError exception for an error code returned by the Borland Database Engine (BDE).

Unit

Dbtables

Category

BDE support routines

procedure DBIError(ErrorCode: DBIResult);

Description

Call DBIError to raise an EDBEngineError for the error code passed as the ErrorCode parameter. DBIError obtains the error string from the BDE for the error and raises an EDBEngineError exception.


NativeCompareStr function

See also

Compares strings based on a database locale case sensitively.

Unit

Dbtables

Category

BDE support routines

function NativeCompareStr(Locale: TLocale; const S1, S2: string; Len: Integer): Integer;

Description

NativeCompareStr compares S1 to S2, up to a length of Len characters.  If the Len parameter is 0, NativeCompareStr compares the strings up to their entire length. The comparison is performed with case sensitivity. The compare operation is controlled by the database locale specified as the Locale parameter. The return value is:

Condition	Return Value

S1 > S2	> 0

S1 < S2	< 0

S1 = S2	= 0


NativeCompareStrBuf function

See also

Compares null-terminated strings based on a database locale case sensitively.

Unit

Dbtables

Category

BDE support routines

function NativeCompareStrBuf(Locale: TLocale; const S1, S2: PChar; Len: Integer): Integer;

Description

NativeCompareStrBuf compares up to the first Len characters of S1 to those of S2, with case sensitivity. If the Len parameter is 0, NativeCompareStrBuf compares the strings up to their entire length. The compare operation is controlled by the database locale specified as the Locale parameter. The return value is:

Condition	Return Value

S1 > S2	> 0

S1 < S2	< 0

S1 = S2	= 0


NativeCompareText function

See also

Compares strings based on a database locale without case sensitivity.

Unit

Dbtables

Category

BDE support routines

function NativeCompareText(Locale: TLocale; const S1, S2: string; Len: Integer): Integer;

Description

NativeCompareText compares up to the first Len characters of S1 to those of S2, without case sensitivity. If the Len parameter is 0, NativeCompareText compares the strings up to their entire length. The compare operation is controlled by the database locale specified as the Locale parameter. NativeCompareText returns a value less than 0 if S1 < S2, a value greater than 0 if S1 > S2, and returns 0 if S1 = S2.


NativeCompareTextBuf function

See also

Compares null-terminated strings based on a database locale and is not case sensitive.

Unit

Dbtables

Category

BDE support routines

function NativeCompareTextBuf(Locale: TLocale; const S1, S2: PChar; Len: Integer): Integer;

Description

NativeCompareTextBuf compares up to the first Len characters of S1 to those of S2, without case sensitivity. If the Len parameter is 0, NativeCompareTextBuf compares the strings up to their entire length. The compare operation is controlled by the database locale specified as the Locale parameter. NativeCompareTextBuf returns a value less than 0 if S1 < S2, a value greater than 0 if S1 > S2, and returns 0 if S1 = S2.


NativeToAnsi function

See also

Converts a string from the character set of the given locale to the ANSI character set.

Unit

Dbtables

Category

BDE support routines

procedure NativeToAnsi(Locale: TLocale; NativeStr: PChar; var AnsiStr: string);

Description

Call NativeToAnsi to convert a string represented in the character set of the Locale parameter to the ANSI character set (used internally by the VCL). The resulting string is returned as the AnsiStr parameter.

Use NativeToAnsi to convert strings retrieved from a database table into strings that can be displayed in the user interface.


NativeToAnsiBuf procedure

See also

Converts a string from the character set of a specified locale into the ANSI character set.

Unit

Dbtables

Category

BDE support routines

procedure NativeToAnsiBuf(Locale: TLocale; Source, Dest: PChar; Len: Integer);

Description

Call NativeToAnsiBuf to convert a null-terminated string in the character set of the Locale parameter to the ANSI character set (used internally by the VCL). The resulting string is copied into the buffer pointed to by the Dest parameter. Use the Len parameter to specify the size of this buffer.

Use NativeToAnsiBuf to convert strings from a database table into the ANSI character set so that they can be displayed in the user interface.


Session variable

See also

Maintains database components used by an application.

Unit

Dbtables

Category

BDE support routines

var Session: TSession;

Description

Session is responsible for maintaining all of the database components used by an application. It is created automatically as part of an application's initialization and destroyed as part of the application's termination. The Session variable must remain active at all times; it can not be destroyed and recreated.


Sessions variable

See also 	Example

Provides access to TSessionList methods and properties.

Unit

Dbtables

Category

BDE support routines

var
  Sessions: TSessionList;

Description

Sessions is a way to access TSessionList methods and properties for manipulating sessions. The DB unit automatically creates and destroys Sessions for you; you don't need to do anything but use it.

The Session variable, on the other hand, is responsible for maintaining all of the database components used by your application. It is created automatically as part of your application's initialization and destroyed as part of your application's termination. The Session variable must remain active at all times; it can not be destroyed and recreated.


CreateMessageDialog function

See also

Creates a specified message dialog.

Unit

dialogs

Category

dialog and message routines

function CreateMessageDialog(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons): TForm;

Description

Call CreateMessageDialog to create a message dialog that will be used several times in an application. CreateMessageDialog returns a dialog of the type specified by the DlgType parameter and with the buttons indicated by the Buttons parameter.

Note:	CreateMessageDialog does not display the dialog form.  The application must display this form when it is needed.


ForceCurrentDirectory variable

See also

Indicates whether open and save dialogs should display the current directory if no initial directory is assigned.

Unit

dialogs

Category

dialog and message routines

var ForceCurrentDirectory: Boolean = False;

Description

ForceCurrentDirectory indicates how open and save dialogs should initialize the directory if the InitialDir property is not set to a valid directory. When ForceCurrentDirectory is True, the dialog opens with the current directory assigned. When ForceCurrentDirectory is False, the initial directory is either the current directory or the My Documents directory, depending on the version of Windows.


InputBox function

See also 	Example

Displays an input dialog box that enables the user to enter a string.

Unit

Dialogs

Category

dialog and message routines

function InputBox(const ACaption, APrompt, ADefault: string): string;

Description

Call InputBox to bring up an input dialog box ready for the user to enter a string in its edit box. The ACaption parameter is the caption of the dialog box, the APrompt parameter is the text that prompts the user to enter input in the edit box, and the ADefault parameter is the string that appears in the edit box when the dialog box first appears.

If the user chooses the Cancel button, InputBox returns the default string. If the user chooses the OK button, InputBox returns the string in the edit box.

Use the InputBox function when there is a default value that should be used when the user chooses the Cancel button (or presses Esc) to exit the dialog. If the application needs to know whether the user chooses OK or Cancel, use the InputQuery function instead.


InputQuery function

See also 	Example

Displays an input dialog that enables the user to enter a string.

Unit

Dialogs

Category

dialog and message routines

function InputQuery(const ACaption, APrompt: string; var Value: string): Boolean;

Description

Call InputQuery to bring up an input dialog box ready for the user to enter a string in its edit box. The ACaption parameter is the caption of the dialog box, the APrompt parameter is the text that prompts the user to enter input in the edit box, and the Value parameter is the string that appears in the edit box when the dialog box first appears.

If the user enters a string in the edit box and chooses OK, the Value parameter changes to the new value.

InputQuery returns True if the user chooses OK, and False if the user chooses Cancel or presses the Esc key.

If the default value should be used when the user cancels out of the dialog, use InputBox.


MessageDlg function

See also 	Example

Displays a message dialog box in the center of the screen.

Unit

Dialogs

Category

dialog and message routines

function MessageDlg(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint): Word;

Description

Call MessageDlg to bring up a message box and obtain the user's response. The message box displays the value of the Msg parameter.  Use the DlgType parameter to indicate the purpose of the dialog.  Use the Buttons parameter to indicate what buttons should appear in the message box.  Use the HelpCtx parameter to specify the context ID for the help topic that should appear when the user clicks the help button or presses F1 while the dialog is displayed.

MessageDlg returns the value of the button the user selected. These are the possible return values:

Return values

mrNone	mrAbort	mrYes

mrOk	mrRetry	mrNo

mrCancel	mrIgnore	mrAll


MessageDlgPos function

See also 	Example

Displays a message dialog box at the specified screen coordinates.

Unit

Dialogs

Category

dialog and message routines

function MessageDlgPos(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y: Integer): Word;

Description

Call MessageDlgPos to bring up a message box at a particular location. The message box displays the value of the Msg parameter.  Use the DlgType parameter to indicate the purpose of the dialog.  Use the Buttons parameter to indicate what buttons should appear in the message box.  Use the HelpCtx parameter to specify the context ID for the help topic that should appear when the user clicks the help button or presses F1 while the dialog is displayed.  Use the X and Y parameters to specify the screen coordinates where the dialog should appear.

MessageDlgPos returns the value of the button the user selected. These are the possible return values:

Return values

mrNone	mrAbort	mrYes

mrOk	mrRetry	mrNo

mrCancel	mrIgnore	mrAll


MessageDlgPosHelp function

See also

Displays a message dialog box whose help is supplied in a named help file.

Unit

Dialogs

Category

dialog and message routines

function MessageDlgPosHelp(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y: Integer; const HelpFileName: string): Word;

Description

Call MessageDlgPosHelp to bring up a message box when the associated help comes from a help file other than the default help file. The message box displays the value of the Msg parameter.  Use the DlgType parameter to indicate the purpose of the dialog.  Use the Buttons parameter to indicate what buttons should appear in the message box.  Use the HelpCtx parameter to specify the context ID for a help topic in the file specified by the HelpFileName parameter.  This help topic appears when the user clicks the help button or presses F1 while the dialog is displayed.  Use the X and Y parameters to specify the screen coordinates where the dialog should appear.

MessageDlgPosHelp returns the value of the button the user selected. These are the possible return values:

Return values

mrNone	mrAbort	mrYes

mrOk	mrRetry	mrNo

mrCancel	mrIgnore	mrAll


ShowMessage procedure

See also 	Example

Displays a message box with an OK button.

Unit

Dialogs

Category

dialog and message routines

procedure ShowMessage(const Msg: string);

Description

Call ShowMessage to display a simple message box with an OK button. The Msg parameter is the message string that appears in the message box. The name of the application's executable file appears as the caption of the message box.

To display a message in a message box with other buttons, or with an icon, use the MessageDlg function.


ShowMessageFmt procedure

See also

Displays a message box with a formatted message.

Unit

Dialogs

Category

dialog and message routines

procedure ShowMessageFmt(const Msg: string; Params: array of const);

Description

Call ShowMessageFmt to display a simple message box with an OK button. The name of the application's executable file appears as the caption of the message box.

The Msg parameter is a format string for the message that appears in the message box. The Params parameter provides the parameters that are assembled into the message.

For more information about how messages are formatted, see Format Strings.

To display a message in a message box with other buttons, or with an icon, use the MessageDlg function.


AssociateAttr procedure

See also

Sets up an association between an attribute ID and a field ID.

Unit

Drintf

Category

Data Dictionary routines

procedure AssociateAttr(const AttrID: TAttrID; const FieldID: TFieldID);

Description

Call AssociateAttr to associate an attribute set in the Data Dictionary with a field in the field dictionary.


CreateField function

See also

Creates a new field from information stored in the Data Dictionary.

Unit

Drintf

Category

Data Dictionary routines

function CreateField(Owner: TComponent; Dataset: TDataset); const FullName, Origin: string; const FieldID: TFieldID; const AttrID: TAttrID): TField;

Description

Call CreateField to create a field component based on the information in the Data Dictionary.

The Owner parameter specifies the component responsible for freeing the field.

The Dataset parameter specifies the dataset that includes the field component.

The FullName and Origin parameters specify the values of the field component’s properties of the same names. Origin can be left blank (‘‘);

The FieldID and AttrID parameters specify the field in the field dictionary and an attribute set to use when creating the field. Both can be 0. If FieldID is specified and AttrID is not, the attribute set associated with FieldID is used.


DictionaryActive function

See also

Indicates whether there is an active Data Dictionary.

Unit

Drintf

Category

Data Dictionary routines

function DictionaryActive: Boolean;

Description

Call DictionaryActive to check whether the Data Dictionary is active. If the dictionary is not active, applications can’t store or retrieve attribute sets.

DictionaryActive returns True if the dictionary is active, False otherwise.


DictionaryDeactivate procedure

See also

Deactivates the Data Dictionary.

Unit

Drintf

Category

Data Dictionary routines

procedure DictionaryDeactivate;

Description

Call DictionaryDeactivate to disable the Data Dictionary.


FindAttrID function

See also

Returns the ID of a specified attribute set.

Unit

Drintf

Category

Data Dictionary routines

function FindAttrID(const AttrName: string): TAttrID;

Description

Call FindAttrID to get the attribute ID for an attribute set that is stored in the Data Dictionary. AttrName is the name of the attribute set. If the Data Dictionary does not contain an attribute set with the specified name, FindAttrID returns a null ID.


FindDatabaseID function

See also

Returns the ID of a specified database.

Unit

Drintf

Category

Data Dictionary routines

function FindDatabaseID(const Database: string): TDatabaseID;

Description

Call FindDatabaseID to get the database ID for the database specified by the Database parameter. This ID can be used for locating the database’s tables in the Data Dictionary.

If the named database is not in the Data Dictionary, FindDatabaseID returns a null ID.


FindFieldID function

See also

Returns the ID of a specified field.

Unit

Drintf

Category

Data Dictionary routines

function FindFieldID(const Table: TTableID; const Field: string): TFieldID;

Description

Call FindFieldID to get the ID for a field that is stored in the field dictionary. Use this field ID to get or set an associated attribute set or to use as a basis when creating a new field component.

The Table parameter specifies the ID of the table that contains the field. The Field parameter specifies the name of the field.

If the Data Dictionary does not contain an entry for the specified field, FindFieldID returns a null ID.


FindTableID function

See also

Returns the ID of a specified table.

Unit

Drintf

Category

Data Dictionary routines

function FindTableID(const Database: TDatabaseID; const Table: string): TTableID;

Description

Call FindTableID to get the ID for a table in the database specified by the Database parameter. This ID can be used for locating the database’s fields in the Data Dictionary.

The Database parameter specifies the database in which to locate the table. This ID can be obtained by calling FindDatabaseID.

The Table parameter is the name of table.

If the database ID is invalid or the named table is not in the Data Dictionary, FindTableID returns a null ID.


GetAttrID function

See also

Returns the ID of the attribute set associated with a field.

Unit

Drintf

Category

Data Dictionary routines

function GetAttrID(const FieldID: TFieldID): TAttrID;

Description

Call GetAttrID to get the ID for the attribute set associated with a field. The FieldID parameter is the Data Dictionary ID for the field whose attribute set is desired.

If the FieldID is not valid or the field does not have an associated attribute set, GetAttrID returns a null ID.


GetAttrName function

See also

Returns the name of an attribute set given its ID.

Unit

Drintf

Category

Data Dictionary routines

function GetAttrName(const AttrID: TAttrID): string;

Description

Call GetAttrName to get the name of an attribute set from its ID.


GetAttrNames procedure

See also

Executes a callback for every attribute set name.

Unit

Drintf

Category

Data Dictionary routines

procedure GetAttrNames(Proc: TGetStrProc): string;

Description

Call GetAttrNames to perform a callback for every attribute set in the Data Dictionary. The Proc parameter is called for every attribute set with its parameter set to the name of the attribute set.

The callback can obtain an attribute ID from the attribute set’s name by calling FindAttrID.


GetControlClass function

See also

Returns the class associated with an attribute set.

Unit

Drintf

Category

Data Dictionary routines

function GetControlClass(const AttrID: TAttrID): string;

Description

Call GetControlClass to get name of the control class (a TField descendant) associated with an attribute set. If no class is associated with the attribute set, GetControlClass returns an empty string.

Note:	 To obtain a class reference from the class name, use the GetClass function.


HasConstraints function

See also

Indicates whether there are any data constraints for a dataset stored in the Data Dictionary.

Unit

Drintf

Category

Data Dictionary routines

function HasConstraints(Dataset: TDBDataset): Boolean;

Description

Call HasConstraints to determine whether the Data Dictionary has any constraints recorded for the specified dataset.


IsNullID function

See also

Indicates whether a Data Dictionary Identifier is null.

Unit

Drintf

Category

Data Dictionary routines

function IsNullID(const ID): Boolean;

Description

Call IsNullID to determine whether the ID for an entity in the Data Dictionary is null. IsNullID returns True if the ID is null, False otherwise.

Use IsNullID to test the return value of functions that look up items in the Data Dictionary.


NewAttr function

See also

Creates an attribute set based on the properties of a field component.

Unit

Drintf

Category

Data Dictionary routines

function NewAttr(Field: TField; const FieldID: TFieldID; const AttrName: string; const Parent: TAttrID): TAttrID;

Description

Call NewAttr create an attribute set in the data dictionary.

The attributes in the attribute set reflect the current properties of the field component specified by the Field parameter.

If a FieldID is provided, the attribute set is associated with Field ID. To create an attribute set without associating it with a field in the Data Dictionary, set the FieldID parameter to NullFieldID.

The AttrName parameter specifies the name under which the attribute set is stored.

The Parent parameter specifies a parent attribute set from which the new attribute set inherits values. Only field properties that differ from the values in the parent attribute set are saved with the new attribute set. If Parent is NullAttrID, all field properties are saved in the new attribute set.

NewAttr returns the attribute ID for the new attribute set.


QualifyTableName function

See also

Returns the fully qualified name of a table in the Data Dictionary.

Unit

Drintf

Category

Data Dictionary routines

function QualifyTableName(Database: TDatabase; const TableName: string): string;

Description

Call QualifyTableName to add user name information to a database table name.  Specify the database that contains the table using the Database parameter. Specify the name of a table within that database using the TableName parameter. QualifyTableName returns the fully qualified name of the database table if the table is stored in the Data Dictionary qualified by user name.


QualifyTableNameByName function

See also

Returns the fully qualified name of a table in the Data Dictionary.

Unit

Drintf

Category

Data Dictionary routines

function QualifyTableNameByName(const SessionName, DatabaseName, TableName: string): string;

Description

Call QualifyTableNameByName to add user name information to a database table name.  Specify the BDE session that manages the database connection with the Session Name parameter. Specify the database that contains the table using the Database parameter. Specify the name of a table within that database using the TableName parameter. QualifyTableNameByName returns the fully qualified name of the database table if the table is stored in the Data Dictionary qualified by user name.


UnassociateAttr procedure

See also

Removes the association between an attribute ID and a field ID.

Unit

Drintf

Category

Data Dictionary routines

procedure UnassociateAttr(const FieldID: TFieldID);

Description

Call UnassociateAttr to end the association between the field specified by FieldID and its current attribute set in the Data Dictionary.


UpdateAttr procedure

See also

Updates an attribute set to match the properties of a field component.

Unit

Drintf

Category

Data Dictionary routines

procedure UpdateAttr(Field: TField; const FieldID: TFieldID; const AttrID: TAttrID);

Description

Call UpdateAttr to update an attribute set so that it matches the properties of the field component specified by the Field parameter. If the field is in the field dictionary, only those attributes that differ from the field identified by FieldID are saved in the attribute set.

The AttrID parameter identifies the attribute set to update. If AttrID is NULL, the attribute set associated with the FieldID parameter is updated.


UpdateConstraints procedure

See also

Replaces all imported constraints for a dataset with the current constraints in the Data Dictionary.

Unit

Drintf

Category

Data Dictionary routines

procedure UpdateConstraints(DataSet: TDBDataset; Constraints: TCheckConstraints);

Description

Call UpdateConstraints to ensure that the constraints for a dataset match the current values stored in the Data Dictionary. Specify the dataset to which the constraints apply as the DataSet parameter. Specify the TCheckConstraints object that represents that dataset’s constraints as the Constraints parameter.

UpdateConstraints removes all constraints with a non-empty ImportedConstraint property and replaces them with new constraints that match the values in the Data Dictionary.

UpdateConstraints is equivalent to calling “Read From Dictionary” in the Constraints property editor.


UpdateDataset procedure

See also

Updates a dataset and all its field components to match the Data Dictionary.

Unit

Drintf

Category

Data Dictionary routines

procedure UpdateDataset(Dataset: TDBDataset);

Description

Call UpdateDataset to ensure that a dataset reflects the current settings in the data dictionary. Specify the dataset to update as the Dataset parameter.

If Dataset is a TTable, UpdateDataset updates the Constraints property so that all imported constraints match the Data Dictionary and updates all the field components to match the associated attribute sets.

If Dataset is a TQuery or TStoredProc, UpdateDataset updates the field components to match the associated attribute sets and parses the query to obtain any field constraints included in the constituent tables.

Calling UpdateDataset is equivalent to using “Retrieve attributes” for all fields in the fields editor followed by “Read From Dictionary” in the Constraints property editor.


UpdateField procedure

See also

Updates a field component to match the associated attribute set in the Data Dictionary.

Unit

Drintf

Category

Data Dictionary routines

procedure UpdateField(Field: TField; const FieldID: TFieldID; const AttrID: TAttrID);

Description

Call UpdateField to change the properties of a field component so that they match the associated attribute set in the Data Dictionary.

Specify the field to update as the Field parameter.

Specify the ID of the corresponding field in the Data Dictionary using the FieldID parameter. This value can be obtained using FindFieldID.

Specify the attribute set that acts as a source using the AttrID parameter. If AttrID is NullAttrID, the attribute set associated with FieldID is used.


RegisterComponentEditor procedure

See also

Registers an editor so that it is available at design time.

Unit

DsgnIntf

Category

design tool registration routines

procedure RegisterComponentEditor(ComponentClass: TComponentClass; ComponentEditor: TComponentEditorClass);

Description

Call RegisterComponentEditor to allow objects instantiated from the specified ComponentClass or one of its descendants use the editor at design time. A registered component editor (identified by ComponentEditor) is created for each component of ComponentClass that is selected in the form designer.  When the component is double-clicked the Edit method of the component editor is called.  When the user right-clicks the component, the GetVerbCount and GetVerb methods of the editor are called to build context menu.

ComponentClass must identify a descendant of TComponent. ComponentEditor must identify a descendant of TComponentEditor.

If no component editor is registered, the component uses the default component editor. The default component editor (TDefaultEditor) implements Edit to search the events of the component and bring up the code editor for the first event it finds.


RegisterPropertyEditor procedure

See also

Allows a component to bring up a custom property editor from the Object Inspector.

Unit

DsgnIntf

Category

design tool registration routines

procedure RegisterPropertyEditor(PropertyType: PTypeInfo; ComponentClass: TClass; const PropertyName: string; EditorClass: TPropertyEditorClass);

Description

Call RegisterPropertyEditor to associate the property editor class specified by the EditorClass parameter with the property type specified by the PropertyType parameter.

When a component is selected, the Object Inspector creates a property editor for each of the component's properties, based on the type of the property.  For example, if the property type is an Integer, the property editor for Integer will be created (by default that would be TIntegerProperty). Most properties do not need specialized property editors.  For example, if the property is an ordinal type the default property editor will restrict the range to the subtype range.

When a property type can not be properly edited using the default property editor or one of the existing property editors, use RegisterPropertyEditor to associate a custom property editor with the property type. This is typically because the property is an object.

When registering a property editor, set PropertyType to the type information pointer returned by the TypeInfo function. For example, TypeInfo(TPropertyObject). Set the ComponentClass parameter to restrict the property editor to a component class and its descendants. Setting ComponentClass to nil associates the property editor with the property type for any component. Set the PropertyName parameter to restrict the property editor to properties with a specific name as well as the specified property type. Setting PropertyName to an empty string associates the property editor with any property of the specified type. Set the EditorClass parameter to the class of the property editor that should be displayed when the property is selected in the Object Inspector.


RegisterPropertyInCategory function

See also

Registers a single property in a specific property category.

Unit

DsgnIntf

Category

Property category routines

TPropertyCategoryClass = class of TPropertyCategory;

function RegisterPropertyInCategory(ACategoryClass: TPropertyCategoryClass; const APropertyName: String): TPropertyFilter; overload;

function RegisterPropertyInCategory(ACategoryClass: TPropertyCategoryClass; AComponentClass: TClass; const APropertyName: String): TPropertyFilter; overload;

function RegisterPropertyInCategory(ACategoryClass: TPropertyCategoryClass; APropertyType: PTypeInfo; const APropertyName: String): TPropertyFilter; overload;

function RegisterPropertyInCategory(ACategoryClass: TPropertyCategoryClass; APropertyType: PTypeInfo): TPropertyFilter; overload;

Description

Call RegisterPropertyInCategory to associate a property with a specific category. Then, when the Object Inspector displays properties by category, the property appears under the associated category.

Properties can be identified by name (for example, all “Font” properties), by type (for example, all properties that are of type TComponentName), or by a combination of one of these and a component type (for example, all Integer properties belonging to a TField descendant).

ACategoryClass is the class of a TPropertyCategory object that defines the category.

APropertyName is the name of the property.

AComponentClass is the type of component whose properties fall in the specified category.

APropertyType is a property information record that identifies the property type.

RegisterPropertyInCategory returns a TPropertyFilter object that the Object Inspector uses to determine which properties fall into which categories.


RegisterPropertiesInCategory function

See also

Registers multiple properties in a specific property category.

Unit

DsgnIntf

Category

Property category routines

TPropertyCategoryClass = class of TPropertyCategory;

function RegisterPropertiesInCategory(ACategoryClass: TPropertyCategoryClass; const AFilters: array of const): TPropertyCategory; overload;

function RegisterPropertiesInCategory(ACategoryClass: TPropertyCategoryClass; AComponentClass: TClass; const AFilters: array of String): TPropertyCategory; overload;

function RegisterPropertiesInCategory(ACategoryClass: TPropertyCategoryClass; APropertyType: PTypeInfo; const AFilters: array of String): TPropertyCategory; overload;

Description

Call RegisterPropertiesInCategory to associate several properties at once with a specific category. Then, when the Object Inspector displays properties by category, those properties appear under the associated category.

RegisterPropertiesInCategory comes in three overloaded variations, each providing a different set of criteria for identifying the property to be associated with property categories.

ACategoryClass is the class of a TPropertyCategory object that defines the category.

AComponentClass is the class of a component whose properties are to be associated with the category.

AFilters is a set of property names or types that identify properties to be associated with the category. If AFilters is an array of strings, it lists only property names. If it is an array of const, it can include types as well.

APropertyType is a property information record that identifies the property type.

RegisterPropertiesInCategory returns a TPropertyCategory instance for the property category.


IsPropertyInCategory function

See also

Indicates whether a property is in a specific property category.

Unit

DsgnIntf

Category

Property category routines

TPropertyCategoryClass = class of TPropertyCategory;

function IsPropertyInCategory(ACategoryClass: TPropertyCategoryClass; AComponentClass: TClass; const APropertyName: String): Boolean; overload;

function IsPropertyInCategory(ACategoryClass: TPropertyCategoryClass; const AClassName: String; const APropertyName: String): Boolean; overload;

Description

Call IsPropertyInCategory to determine whether a specified property falls into an identified property category.

ACategoryClass is the class of a TPropertyCategory object that defines the category.

AComponentClass is the type of the component about whose property you want to know the category.

APropertyName is the name of the property for which you want to know if it falls in the category.

AClassName is the class name for the component whose property you want to know the category.

IsPropertyInCategory returns a Boolean value indicating whether the property is in the property category specified by ACategoryClass.


PropertyCategoryList function

See also

Returns a reference to a TPropertyCategoryList.

Unit

DsgnIntf

Category

Property category routines

function PropertyCategoryList: TPropertyCategoryList;

Description

Call PropertyCategoryList to obtain a list of all registered property categories.


RegisterLibraryExpert procedure

Registers an expert so that it is installed when a package is installed.

Unit

ExptIntf

Category

design tool registration routines

procedure RegisterLibraryExpert(Expert: TIExpert);

Description

Call RegisterLibrary to register an expert for a package so that it appears in the New Items dialog. If the package already has a registered expert, RegisterLibraryExpert does nothing.


Frame3D procedure

See also

Draws a three dimensional frame on a canvas.

Unit

Extctrls

Category

graphics utilities

procedure Frame3D(Canvas: TCanvas; var Rect: TRect; TopColor, BottomColor: TColor; Width: Integer);

Description

Use Frame3D to create three-dimensional effects when drawing directly on a canvas.  The Canvas parameter is the canvas to draw on.  The Rect parameter specifies the position on the canvas where the three-dimensional rectangle should appear.  The TopColor and BottomColor parameters indicate the colors that appear on the left and top or the right and bottom of the rectangle respectively.  The Width parameter specifies the width of the frame.

To create a raised effect, the TopColor should be a light color and the BottomColor should be a shadow color.  To create a depressed effect, the TopColor should be the shadow color and the BottomColor should be the light color.  To create a beveled effect, draw a frame immediately inside another frame with the colors reversed.


DirectoryExists function

See also	Example

Determines whether a specified directory exists.

Unit

FileCtrl

Category

file management routines

function DirectoryExists(Name: string): Boolean;

Description

Call DirectoryExists to determine whether the directory specified by the Name parameter exists. If the directory exists, the function returns True. If the directory does not exist, the function returns False.

If a full path name is entered, DirectoryExists searches for the directory along the designated path. Otherwise, the Name parameter is interpreted as a relative path name from the current directory.


ForceDirectories function

See also	Example

Creates all the directories along a directory path if they do not already exist.

Unit

FileCtrl

Category

file management routines

function ForceDirectories(Dir: string): Boolean;

Description

DOS and Windows only allow directories to be created one at a time. For example, to create the C:\APPS\SALES\LOCAL directory, the APPS and SALES directories must exist before the LOCAL directory can be created. Use ForceDirectories to create a directory and all parent directories that do not already exist.

ForceDirectories returns True if it successfully creates all necessary directories, False if it could not create a needed directory.

Note:	Do not call ForceDirectories with an empty string. Doing so causes ForceDirectories to raise an exception.


ProcessPath procedure

See also

Parses a file name into its constituent parts.

Unit

FileCtrl

Category

file name utilities

procedure ProcessPath (const EditText: string; var Drive: Char; var DirPart: string; var FilePart: string);

Description

Call ProcessPath to parse a file name into its drive, path, and file name.  Pass the full file name that should be parsed as the EditText parameter.  ProcessPath returns the indicated drive, directory, and file name as the Drive, DirPart, and FilePart parameters.


SelectDirectory function

See also 	Example

Brings up a dialog to allow the user to enter a directory name.

Unit

FileCtrl

Category

dialog and message routines

function SelectDirectory(const Caption: string; const Root: WideString; out Directory: string): Boolean; overload;

function SelectDirectory(var Directory: string; Options: TSelectDirOpts; HelpCtx: Longint): Boolean; overload;

Description

Call SelectDirectory to let the user enter a directory name.

Use the first syntax to display the Windows directory browser. The Caption parameter specifies a caption for the dialog. The Root parameter specifies the root directory from which to browse. The selected directory is returned as the Directory parameter.

Use the second syntax to call the Select Directory dialog box. The directory passed to the function with the Directory parameter appears as the currently selected directory when the dialog box appears. The name of the directory the user selects becomes the value of Directory when the function returns. The dialog does not change the value of the current directory.

The HelpCtx parameter is the help context ID number.

The Options parameter is a set of values. If Options is the empty set, the user can only select a directory that already exists. No edit box is provided for the user to enter a new directory name. If Options is not empty, the included values determine how the dialog responds when the user types a nonexistent directory name.

With either syntax, SelectDirectory returns True if the user selected a directory and chose OK, and False if the user chose Cancel or closed the dialog box without selecting a directory.


Application variable

There are several versions of the Application variable:

One for standard applications (declared in the Forms unit).

One for Web server applications (Declared in the HTTPApp unit). The Web server Application variable is initialized as either an ISAPI application (in the ISAPIApp unit) or a CGI application (in the CGIApp unit). A single project should include only one of these.

One for service applications (Declared in the SvcMgr unit).

One for Control panel applets (Declared in the Ctlpanel unit).

Do not add more than one of these units (Forms, CGIApp, ISAPIApp, SvcMgr, or Ctlpanel) to the uses list of a project. When a program starts running, Delphi instantiates the Application variable as declared in the unit that is included in the project, and calls its Initialize method, its CreateForm method, and then its Run method. The behavior of the application depends on the implementation of these methods in the class of Application object that gets created.


Application variable (for standard applications)

See also 	Example

Represents application-level information.

Unit

Forms

Category

application-level information

var Application: TApplication;

Description

By default, when a new project is created, Delphi constructs an application object and assigns it to the Application variable in the Forms unit. Application has several properties that can be used to get information about an application while it runs.


GetParentForm function

See also

Returns the form or property page that contains a specified control.

Unit

Forms

Category

Windows controls utilities

function GetParentForm(Control: TControl): TCustomForm;

Description

Call GetParentForm to obtain the descendant of TCustomForm that contains the control specified by the Control parameter. If the control is not contained in a VCL form (for example, an ActiveX control embedded in another type of window), GetParentFrom returns nil.


HintWindowClass variable

See also

Specifies the class for the window used to display help hints.

Unit

Forms

Category

application-level information

var HintWindowClass: THintWindowClass = THintWindow;

Description

When the application displays a Help Hint, it creates an instance of HintWindowClass to represent the window used for displaying the hint. Applications can customize this window by creating a descendant of THintWindow and assigning it to the HintWindowClass variable at application startup.


IsAccel function

See also

Indicates whether a particular character is an accelerator character (or hot key) within a given menu caption or other text string.

Unit

Forms

Category

miscellaneous routines

function IsAccel(VK: Word; const Str: string): Boolean;

Description

Call IsAccel to determine whether the character represented by the VK (virtual key) parameter appears as an accelerator in the string specified by the Str parameter.  IsAccel only looks for accelerators that are identified by a preceding ampersand (&).  Such accelerators appear underlined in the string when displayed as a control’s caption.

Use IsAccel when processing key events to determine whether a key matches an accelerator character in a control’s caption.

Note:	IsAccel does not recognize hot key combinations in menu items that are identified by the HotKey property.


Screen variable

See also 	Example

Represents a screen device.

Unit

Forms

Category

application-level information

var Screen: TScreen;

Description

The Screen variable is a TScreen component that represents the screen of the system on which the Delphi application runs. By default, applications create a screen component based on information from Windows about the current screen device and assign it to Screen.


ValidParentForm function
ValidParentForm

See also

Returns the form or property page that contains a specified control.

Unit

Forms

Category

miscellaneous routines

function ValidParentForm(Control: TControl): TCustomForm;

Description

Call ValidParentForm to obtain the descendant of TCustomForm that contains the control specified by the Control parameter. If the control is not contained in a VCL form (for example, an ActiveX control embedded in another type of window), ValidParentForm raises an EInvalidOperation exception.


CharsetToIdent function

See also

Obtains the name of a character set.

Unit

Graphics

Category

graphics utilities

function CharsetToIdent(Charset: Longint; var Ident: string): Boolean;

Description

Call CharsetToIdent to obtain the symbolic name for the character set of a font. CharsetToIdent returns true if the Ident parameter is successfully given an identifying name for the character set.

Note:	The return value of CharsetToIdent does not indicate whether the Charset parameter is valid for a given font. Many fonts support only a limited number of character sets. Some fonts may support less common character sets that can't be mapped to identifiers by CharsetToIdent.


ColorToIdent function

See also

Provides the symbolic name of a TColor value.

Unit

Graphics

Category

graphics utilities

function ColorToIdent(Color: Longint; var Ident: string): Boolean;

Description

Call ColorToIdent to obtain the name of the symbolic constant that represents a TColor value, such as clBlack or clWindow. The Ident parameter is set to the symbolic name. If there is no symbolic constant defined for the color, ColorToIdent returns False.


ColorToRGB function

See also 	Example

Converts a TColor value into an RGB representation of the color.

Unit

Graphics

Category

graphics utilities

function ColorToRGB(Color: TColor): Longint;

Description

Call ColorToRGB to obtain an RGB representation of a color for using with Windows API calls. ColorToRGB strips away the information that is stored in the highest order bits about which palette to use for colors that are not always available.


ColorToString function

See also

Returns a string that represents the name of a TColor value.

Unit

Graphics

Category

graphics utilities

function ColorToString(Color: TColor): string;

Description

Call ColorToString to obtain a string that represents a TColor value. If there is a symbolic constant defined for the color (such as clBlack or clWindow), ColorToString returns the name of the constant. Otherwise, ColorToString returns the hex value of the color, formatted as a string.


CopyPalette function
CopyPalette

Creates a new palette object that matches an existing palette.

Unit

Graphics

Category

graphics utilities

function CopyPalette(Category: HPALETTE): HPALETTE;

Description

Call CopyPalette to create a new Windows palette object that exactly matches an existing palette. If the Palette parameter does not refer to a valid Windows palette, or if a problem occurs while copying the palette, CopyPalette returns 0.


CreateGrayMappedBmp function

See also

Remaps the standard gray colors in a bitmap with the system grays.

Unit

Graphics

Category

graphics utilities

function CreateGrayMappedBmp(Handle: HBITMAP): HBITMAP;

Description

Call CreateGrayMappedBmp to create a bitmap that uses the system gray colors (clBtnHightLight, clBtnFace, clBtnShadow and clBtnText) from a bitmap that uses standard gray scale colors (clWhite, clSilver, clGray, and clBlack). This allows an application to dynamically create images that match the user’s control panel settings, given a base image.

CreateGrayMappedBmp creates a new bitmap.  It does not alter the original bitmap, which has the handle specified by the Handle parameter.

Note:	CreateGrayMappedBmp does not work with bitmaps that have more than 256 colors. For bitmap's with more than 256 colors (8bpp), this function returns the original bitmap.


CreateGrayMappedRes function
CreateGreyMappedRes function

See also

Remaps the standard gray colors in a bitmap resource with the system grays.

Unit

Graphics

Category

graphics utilities

type THandle = Integer;

function CreateGrayMappedRes(Instance: THandle; ResName: PChar): HBITMAP;

Description

Call CreateGrayMappedRes to create a bitmap that uses the system gray colors (clBtnHightLight, clBtnFace, clBtnShadow and clBtnText) from a resourced bitmap that uses standard gray scale colors (clWhite, clSilver, clGray, and clBlack). This allows an application to dynamically create images that match the user’s control panel settings, by creating a base image as a bitmap resource.

Use the Instance and ResName parameters to identify the bitmap resource whose color table should be changed

Note:	CreateMappedRes does not work with bitmaps that have more than 256 colors. For bitmap's with more than 256 colors (8bpp), this function returns an instance of the original bitmap without color modifications.


CreateMappedBmp function

See also

Changes the color table in a bitmap.

Unit

Graphics

Category

graphics utilities

function CreateMappedBmp(Handle: HBITMAP; const OldColors, NewColors: array of TColor): HBITMAP;

Description

Call CreateMappedBmp to make selective changes to the color map of a bitmap. This function replaces the colors specified by the OldColors parameter with the colors specified by the NewColors parameter and returns the handle for a new device dependent bitmap (DDB) that uses the new color table. Handle is the handle to the bitmap whose color table should be changed. The OldColors and NewColors arrays should contain the same number of elements.

CreateMappedBmp creates a new bitmap.  It does not alter the original bitmap, which has the handle specified by the Handle parameter.

Note:	CreateMappedBmp does not work with bitmaps that have more than 256 colors. For bitmap's with more than 256 colors (8bpp), this function returns the original bitmap.


CreateMappedRes function

See also

Changes the color table in a bitmap resource.

Unit

Graphics

Category

graphics utilities

function CreateMappedRes(Instance: THandle; ResName: PChar; const OldColors, NewColors: array of TColor): HBITMAP;

Description

Call CreateMappedRes to make selective changes to the color map of a resourced bitmap. This function replaces the colors specified by the OldColors parameter with the colors specified by the NewColors parameter and returns the handle for a new device dependent bitmap (DDB) that uses the new color table. Use the Instance and ResName parameters to identify the bitmap resource whose color table should be changed. The OldColors and NewColors arrays should contain the same number of elements.

Note:	CreateMappedRes does not work with bitmaps that have more than 256 colors. For bitmap's with more than 256 colors (8bpp), this function returns an instance of the original bitmap without color modifications.


DDBsOnly variable

See also

Determines whether bitmap handles are created as device-dependent bitmaps (DDB).

Unit

Graphics

Category

graphics utilities

var DDBsOnly: Boolean = False;

Description

Set DDBsOnly to force all bitmap handles to be created as device-dependent bitmaps (DDB). The default VCL bitmap handle format is DIB (device-independent bitmap).

Setting DDBsOnly to True undercuts much of the VCL graphics architecture; it should not be used unless it is absolutely required. Examples of when to set it to True are:

A graphics-intensive application does bitmap operations that Windows does not support with DIBs; you can either set each bitmap object to DDB before you access its handle property, or you can set this global variable to True.

An application uses hundreds of very small bitmaps. Each DIB consumes a separate 4k memory page. DIBs are less efficient for storing many small images than DDBs.  Before resorting to changing the DDBsOnly flag to address this, however, consider switching your code to use image lists instead of individual tiny bitmaps.  Image lists are more efficient than DIBs and DDBs for storing many same-size small images.

Note:	Setting DDBsOnly to True reintroduces the Delphi 2/Delphi 1 issue of image alteration.  When a BMP file or resource is loaded into a DDB, the color information in the original image is changed to fit the pixel format of the current video device and mode.  If you read an image, touch its handle, and write it out, you will not get the same file you read in.  DIBs solve this problem. Do not change DDBsOnly unless you have a specific need for device-dependent bitmaps and are willing to accept the image-altering DDB side effects.


GetCharSetValues procedure

See also 	Example

Passes the name of every predefined character set string to a callback function.

Unit

Graphics

Category

graphics utilities

procedure GetCharsetValues(Proc: TGetStrProc);

Description

Call GetCharsetValues to execute a callback for every character set name that has a corresponding constant in the VCL. The Proc parameter is the callback function that is called for every character set constant name.

Note:	To convert the strings that are passed to the callback into the TFontCharset type, use the IdentToCharset function.


GetColorValues procedure

See also

Passes the name of every predefined color constant to a callback function.

Unit

Graphics

Category

graphics utilities

procedure GetColorValues(Proc: TGetStrProc);

Description

Call GetColorValues to execute a callback for every TColor constant in the VCL.  The Proc parameter is the callback function that is called for every color constant name.

Note:	To convert the strings that are passed to the callback into the TColor type, use the IdentToColor function.


GetDefFontCharset function

See also

Returns the character set of the default system font.

Unit

Graphics

Category

graphics utilities

function GetDefFontCharSet: TFontCharset;

Description

Call GetDefFontCharset to determine the character set that is used when a font is not explicitly assigned to a control.  This character set can be used to initialize a font that is specified by font name only, to best match the characters for the locale of the machine on which the application is running.


GetDIB function

See also

Returns the info header and image for a device independent bitmap.

Unit

Graphics

Category

graphics utilities

function GetDIB(Bitmap: HBITMAP; Palette: HPALETTE; var BitmapInfo; var Bits): Boolean;

Description

Call GetDIB to convert a device dependent bitmap into a device independent bitmap (DIB).  Pass the handle to a device dependent bitmap and a handle to its palette as the Bitmap and Palette parameters.  GetDIB fills in the BitmapInfo and Bits parameters with the info header and image of the corresponding DIB.  GetDIB returns True if the bitmap was successfully converted into a DIB, False otherwise.

Before calling GetDIB, the memory for the info header and image must be allocated.  Call GetDIBSizes to determine the amount of memory that must be allocated for the info header and image.


GetDIBSizes procedure

See also

Returns the size of the info header and of the image for a device independent bitmap.

Unit

Graphics

Category

graphics utilities

procedure GetDIBSizes(Bitmap: HBITMAP; var InfoHeaderSize: DWord; var ImageSize: DWORD);

Description

Call GetDIBSizes to determine the amount of memory needed to convert a device dependent bitmap into a device independent bitmap (DIB).  Pass the handle to a device dependent bitmap as the Bitmap parameter.  GetDIBSizes returns the sizes of the info header and image of the corresponding DIB as the InfoHeaderSize parameter and the ImageSize parameter, respectively.

Call GetDIBSizes to determine the amount of memory that must be allocated before calling GetDIB to convert a device dependent bitmap into a device independent bitmap.


GraphicExtension function

See also	Example

Returns the default file-name extension of a graphics object.

Unit

Graphics

Category

graphics utilities

function GraphicExtension(GraphicClass: TGraphicClass): string;

Description

Call GraphicExtension to obtain a default extension value for the DefaultExt property of a Save Picture dialog. GraphicExtension returns the default extension for the type of graphics object specified by the GraphicClass parameter. The TGraphicClass type is the class type for descendants TGraphic.

These are the file extensions returned for each built-in graphics class:

Graphic class	File extension returned

TBitmap	bmp

TIcon	ico

TMetafile	emf

If custom graphics classes register a file extension, GraphicExtension will return that extension when passed the custom graphics class as an argument.


GraphicFileMask function

See also

Returns a file mask that specifies the valid extensions for a graphic class.

Unit

Graphics

Category

graphics utilities

function GraphicFileMask(GraphicClass: TGraphicClass): string;

Description

Call GraphicFileMask to obtain a mask to determine the file extensions associated with a graphic class. The GraphicClass parameter can specify one of these values: TBitmap, TGraphic, TIcon, TMetafile, or a user-defined descendant of TGraphic. These are the strings that are returned for each built-in graphics class:

Graphic class	Filter string returned

TBitmap	 *.bmp

TIcon	 *.ico

TMetafile	 *.emf;*.wmf

TGraphic	*.bmp;*.ico;*.emf;*.wmf


GraphicFilter function

See also	Example

Returns a file filter compatible with the Filter property of an Open or Save dialog.

Unit

Graphics

Category

graphics utilities

Description

Call GraphicFilter to obtain a value for the Filter property of an Open Picture or Save Picture dialog box. The GraphicClass parameter can specify one of these values: TBitmap, TGraphic, TIcon, TMetafile, or a user-defined descendant of TGraphic. These are the strings that are returned for each built-in graphics class:

Graphic class	Filter string returned

TBitmap	Bitmaps (*.bmp)|*.bmp

TIcon	Icons (*.ico)|*.ico

TMetafile	All (*.emf;*.wmf)|*.emf;*.wmf|Enhanced Metafiles (*.emf)|*.emf|Metafiles(*.wmf)|*.wmf

TGraphic	All (*.bmp;*.ico;*.emf;*.wmf)|*.bmp;*.ico;*.emf; *.wmf|Bitmaps (*.bmp)|*.bmp|Icons (*.ico)|*.ico|Enhanced Metafiles (*.emf)|*.emf|Metafiles(*.wmf)|*.wmf


IdentToCharset function

See also

Translates the name of a character set constant to the corresponding character set.

Unit

Graphics

Category

graphics utilities

function IdentToCharset(const Ident: string; var Charset: Longint): Boolean;

Description

Call IdentToCharset to reverse the translation performed by CharsetToIdent. This method is useful for converting the strings generated by GetCharsetValues into useable character sets. IdentToCharset returns True if the Ident parameter is successfully converted into a character set that is returned by the Charset parameter. IdentToCharset returns False if the Ident parameter is not the name of one of the TFontCharset constants.


IdentToColor function

See also

Translates the name of a color constant to the corresponding TColor value.

Unit

Graphics

Category

graphics utilities

function IdentToColor(const Ident: string; var Color: Longint): Boolean;

Description

Call IdentToColor to reverse the translation performed by ColorToIdent. This method is useful for converting the strings generated by GetColorValues into useable TColor values. IdentToColor returns True if the Ident parameter is successfully converted into a color that is returned by the Color parameter.  IdentToColor returns False if the Ident parameter is not the name of one of the TColor constants.

Note:	If the string identifier for a color may represent either a hex value or a color constant, use the StringToColor function instead.


StringToColor function

See also

Translates a string representation of a color to the corresponding TColor value.

Unit

Graphics

Category

graphics utilities

function StringToColor(const S: string): TColor;

Description

Call StringToColor to reverse the translation performed by ColorToString. This method is useful for converting the strings entered by the user into useable TColor values.

The S parameter can be either the name of a built-in color constant such as 'clBtnFace', or the string representation of a valid TColor value such as '$02FF8800'.  StringToColor returns the TColor value that corresponds to the S parameter.

Note:	If the string identifier can only be the name of a color constant, use IdentToColor instead.


SystemPalette16 variable

See also

Contains the 16 VGA system colors.

Unit

Graphics

Category

graphics utilities

var SystemPalette16: HPalette;

Description

SystemPalette16 holds a palette handle that contains the 16 VGA system colors. This palette is built at runtime from the system colors defined by the current video card and driver.  The actual color values of the stock VGA palette can vary from one video card vendor to the next. Therefore it is not safe to assume, for example, that clGray will be RGB(128,128,128) on all systems.

This handle is available as a convenience.  This is the palette that VCL forces on all 16 color bitmaps that are loaded from files or resources.

Note:	Using custom 16-color palettes does not work on 16-color video systems. It is problematic on many 256 color drivers because the variation in colors interferes with transparency operations.


FormatMaskText function

See also

Returns a string formatted using an edit mask.

Unit

Mask

Category

miscellaneous routines

function FormatMaskText(const EditMask: string; const Value: string): string;

Description

Call FormatMaskText to apply the mask specifed by the EditMask parameter to the text string specified by the Value parameter. The edit mask string consists of three fields with semicolons separating them. The first part of the mask is the mask itself. The second part is the character that determines whether the literal characters of the mask are matched to characters in the Value parameter or are inserted into the Value string. The third part of the mask is the character used to represent missing characters in the mask.

These are the special characters used in the first field of the mask:

Character	Meaning in mask

!	If a ! character appears in the mask, optional characters are represented in the returned string as leading blanks. If a ! character is not present, optional characters are represented in the returned string as trailing blanks.

>	If a > character appears in the mask, all characters that follow are in uppercase until the end of the mask or until a < character is encountered.

<	If a < character appears in the mask, all characters that follow are in lowercase until the end of the mask or until a > character is encountered.

<>	If these two characters appear together in a mask, no case checking is done and the data is formatted with the case present in the Value parameter.

\	The character that follows a \ character is a literal character. Use this character to use any of the mask special characters as a literal.

L	The L character requires an alphabetic character only in this position. For the US, this is A-Z, a-z.

l	The l character permits only an alphabetic character in this position, but doesn't require it.

A	The A character requires an alphanumeric character only in this position. For the US, this is A-Z, a-z, 0-9.

a	The a character permits an alphanumeric character in this position, but doesn't require it.

C	The C character requires an arbitrary character in this position.

c	The c character permits an arbitrary character in this position, but doesn't require it.

0	The 0 character requires a numeric character only in this position.

9	The 9 character permits a numeric character in this position, but doesn't require it.

#	The # character permits a numeric character or a plus or minus sign in this position, but doesn't require it.

:	The : character is used to separate hours, minutes, and seconds in times. If the character that separates hours, minutes, and seconds is different in the regional settings of the Control Panel, that character is substituted in the returned string.

/	The / character is used to separate months, days, and years in dates. If the character that separates months, days, and years is different in the regional settings of the Control Panel, that character is substituted in the returned string.

;	The ; character is used to separate the three fields of the mask.

_	The _ character automatically inserts spaces into the returned string.

Any character that does not appear in the preceding table can appear in the first part of the mask as a literal character. Literal characters are inserted automatically if the second field of the mask is 0, or matched to characters in the Value parameter if the second field is any other value. The special mask characters can also appear as literal characters if preceded by a backslash character (\).

The second field of the mask is a single character that indicates whether literal characters from the mask are included in the Value parameter. For example, the mask for a telephone number with area code could be the following string:

(000)_000-0000;0;*

The 0 in the second field indicates that the Value parameter should consist of the 10 digits of the phone number, rather than the 14 characters that make up the final formatted string.

A 0 in the second field indicates that literals are inserted into the Value string, any other character indicates that they should be included. The character to indicate whether literals should be included can be changed by changing the MaskNoSave typed constant that is declared in the Mask unit.

The third field of the mask is the character that appears in the returned string for blanks (characters that do not appear in Value). By default, this is the same as the character that stands for literal spaces. The two characters appear the same in the returned string.

Note:	When working with multibyte character sets, such as Japanese shift-JIS, each special mask character represents a single byte. To specify double-byte characters using the L,l,A,a,C, or c specifiers, the mask characters must be doubled as well. For example, LL would represent two single-byte alphabetic characters or a one double-byte character. Only single-byte literal characters are supported.


ArcCos function

Calculates the inverse cosine of a given number.

Unit

Math

Category

Trigonometry routines

function ArcCos(X: Extended): Extended;

Description

ArcCos returns the inverse cosine of X. X must be between -1 and 1. The return value will be in the range [0..Pi], in radians.


ArcCosh function

See also

Calculates the inverse hyperbolic cosine of a given number.

Unit

Math

Category

Trigonometry routines

function ArcCosh(X: Extended): Extended;

Description

ArcCosh returns the inverse hyperbolic cosine of X.  The value of X must be greater than or equal to 1.


ArcSin function

Calculates the inverse sine of a given number.

Unit

Math

Category

Trigonometry routines

function ArcSin(X: Extended): Extended;

Description

ArcSin returns the inverse sine of X. X must be between -1 and 1. The return value will be in the range [-Pi/2..Pi/2], in radians.


ArcSinh function

See also

Calculates the inverse hyperbolic sine of a given number.

Unit

Math

Category

Trigonometry routines

function ArcSinh(X: Extended): Extended;

Description

ArcSinh returns the inverse hyperbolic sine of X.


ArcTanh function

See also

Calculates the inverse hyperbolic tangent of a given number.

Unit

Math

Category

Trigonometry routines

function ArcTanh(X: Extended): Extended;

Description

ArcTanh returns the inverse hyperbolic tangent of X.  The value of X must be between -1 and 1 (inclusive).


ArcTan2 function

Calculates the arctangent angle and quadrant of a given number.

Unit

Math

Category

Trigonometry routines

function ArcTan2(Y, X: Extended): Extended;

Description

ArcTan2 calculates ArcTan(Y/X), and returns an angle in the correct quadrant.  The values of X and Y must be between –2^64 and 2^64.  In addition, the value of X can’t be 0.  The return value will fall in the range from -Pi to Pi radians.


Ceil function

Rounds variables up toward positive infinity.

Unit

Math

Category

Arithmetic routines

function Ceil(X: Extended):Integer;

Description

Call Ceil to obtain the lowest integer greater than or equal to X. The absolute value of X must be less than MaxInt.  For example:

Ceil(-2.8) = -2

Ceil(2.8) = 3

Ceil(-1.0) = -1


Cosh function

See also

Calculates the hyperbolic cosine of an angle.

Unit

Math

Category

Trigonometry routines

function Cosh(X: Extended): Extended;

Description

Use the Cosh to calculate the hyperbolic cosine of X.


Cotan function

See also

Calculates the cotangent of an angle.

Unit

Math

Category

Trigonometry routines

function Cotan(X: Extended): Extended;

Description

Call Cotan to obtain the cotangent of X. The cotangent is calculated using the formula

1 / Tan(X)

Note:	Do not call Cotan with X = 0.


CycleToRad function

See also

Converts an angle measurement from cycles to radians.

Unit

Math

Category

Measurement conversion routines

function CycleToRad(Cycles: Extended): Extended;

Description

CycleToRad converts angles measured in cycles into radians, where

radians = 2pi * cycles.


DegToRad function

See also

Returns the value of a degree measurement expressed in radians.

Unit

Math

Category

Measurement conversion routines

function DegToRad(Degrees: Extended): Extended;

Description

Use DegToRad to convert angles expressed in degrees to the corresponding value in radians, where

radians = degrees(pi/180).


DoubleDecliningBalance function

Calculates the depreciation of an asset using the double-declining balance method.

Unit

Math

Category

Business and finance routines

function DoubleDecliningBalance(Cost, Salvage: Extended; Life, Period: Integer): Extended;

Description

DoubleDecliningBalance determines accelerated depreciation values for an asset, given the initial cost, life expectancy, end value, and depreciation period.


Floor function

Rounds variables toward negative infinity.

Unit

Math

Category

Arithmetic routines

function Floor(X: Extended): Integer;

Description

Call Floor to obtain the highest integer less than or equal to X. For example:

Floor(-2.8) = -3

Floor(2.8) = 2

Floor(-1.0) = -1

Note:	The absolute value of X must be less than MaxInt.


Frexp procedure

Separates the Mantissa and Exponent of X

Unit

Math

Category

Arithmetic routines

procedure Frexp(X: Extended; var Mantissa: Extended; var Exponent: Integer) register;

Description

Frexp returns the mantissa of X as Mantissa and the exponent as Exponent.


FutureValue function

See also

Calculates the future value of an investment.

Unit

Math

Category

Business and finance routines

function FutureValue(Rate: Extended; NPeriods: Integer; Payment, PresentValue: Extended; PaymentTime: TPaymentTime): Extended;

Description

FutureValue returns the future value of an investment of PresentValue where Payment is invested for NPeriods at the rate of Rate per period. The PaymentTime parameter indicates whether the investment is an ordinary annuity or an annuity due (enter ptEndOfPeriod if payments are at the end of each period, ptStartOfPeriod if they are at the beginning).


GradToRad function

See also

Converts grad measurements to radians.

Unit

Math

Category

Measurement conversion routines

function GradToRad(Grads: Extended): Extended;

Description

GradToRad converts angles measured in grads into radians, where

radians = grads(pi/200).


Hypot function

Calculates the length of the hypotenuse.

Unit

Math

Category

Trigonometry routines

function Hypot(X, Y: Extended): Extended;

Description

Hypot returns the length of the hypotenuse of a triangle. Specify the lengths of the sides adjacent to the right angle in X and Y.  Hypot uses the formula

Sqrt(X**2 + Y**2)


InterestPayment function

See also

Calculates the interest portion of a loan payment.

Unit

Math

Category

Business and finance routines

function InterestPayment(Rate: Extended; Period, NPeriods: Integer; PresentValue, FutureValue: Extended; PaymentTime: TPaymentTime): Extended;

Description

Call InterestPayment to calculate the portion of a loan payment that reflects the interest.

Rate represents the fixed periodic interest rate.

Period identifies the payment period.

NPeriods is the number of periods of the loan.

PresentValue represents the amount borrowed (the principal).

FutureValue is the future value of the investment.

PaymentTime indicates whether the cash flows occur at the beginning or end of the period.


InterestRate function

See also

Returns the interest rate required to increase PresentValue to FutureValue.

Unit

Math

Category

Business and finance routines

function InterestRate(NPeriods: Integer; Payment, PresentValue, FutureValue: Extended; PaymentTime: TPaymentTime): Extended;

Description

InterestRate calculates the interest rate required in order for an investment of PresentValue, with periodic payments of Payment, to be worth FutureValue within NPeriods compounding periods. If NPeriods represents years, an annual interest rate results; if NPeriods represents months, a monthly interest rate results, and so on. The PaymentTime parameter indicates whether the cash flows occur at the beginning or end of the period.


InternalRateOfReturn function

See also

Calculates the internal rate of return for an investment.

Unit

Math

Category

Business and finance routines

function InternalRateOfReturn(Guess: Extended; const CashFlows: array of Double): Extended;

Description

InternalRateOfReturn determines the internal rate of return on an investment. It references an array that contains cash flow information and uses the supplied internal rate of return estimate to calculate results.

Before using this function, define an array containing expected cash flow amounts over a period of time. It is assumed that the amounts are received at regular intervals. Negative amounts are interpreted as cash outflows, and positive amounts as inflows. The first amount must be a negative number, to reflect the initial investment. The following amounts can all be the same for each time period, or they can be different (including a mixture of negatives, positives, or zeros).

Specify the estimated rate of return as the Guess parameter. Pass the array of expected cash flow amounts as the CashFlows parameter.


IntPower function

Calculates the integral power of a base value.

Unit

Math

Category

Arithmetic routines

function IntPower(Base: Extended; Exponent: Integer): Extended register;

Description

IntPower raises Base to the power specified by Exponent.


Ldexp function

Calculates X * (2**P)

Unit

Math

Category

Arithmetic routines

function Ldexp(X: Extended; P: Integer): Extended register;

Description

Ldexp returns X times (2 to the power of P).


LnXP1 function

Returns the natural log of (X+1)

Unit

Math

Category

Arithmetic routines

function LnXP1(X: Extended): Extended;

Description

LnXP1 returns the natural logarithm of (X+1).  Use LnXP1 when X is a value near 0.


Log2 function

See also

Calculates log base 2.

Unit

Math

Category

Arithmetic routines

function Log2(X: Extended): Extended;

Description

Log2 returns the log base 2 of X.


Log10 function

See also

Calculates log base 10.

Unit

Math

Category

Arithmetic routines

function Log10(X: Extended): Extended;

Description

Log10 returns the log base 10 of X.


LogN function

See also

Calculates log base N.

Unit

Math

Category

Arithmetic routines

function LogN(N, X: Extended): Extended;

Description

LogN returns the log base N of X.


Max function

See also

Returns the greater of two numeric values.

Unit

Math

Category

Arithmetic routines

function Max(A,B: Integer): Integer; overload;

function Max(A,B: Int64): Int64; overload;

function Max(A,B: Single): Single; overload;

function Max(A,B: Double): Double; overload;

function Max(A,B: Extended): Extended; overload;

Description

Call Max to compare two numeric values. Max returns the greater value of the two.


MaxIntValue function

See also

Returns the largest signed value in an integer array.

Unit

Math

Category

Statistical routines

function MaxIntValue(const Data: array of Integer): Integer;

Description

Call MaxIntValue to obtain the largest integer from the Data array.


MaxValue function

See also

Returns the largest signed value in an array.

Unit

Math

Category

Statistical routines

function MaxValue(const Data: array of Double): Double;

Description

MaxValue returns the largest signed value in the Data array.


Mean function

See also

Returns the average of all values in an array.

Unit

Math

Category

Statistical routines

function Mean(const Data: array of Double): Extended;

Description

Mean calculates the arithmetic average of all the values in the Data array parameter.


MeanAndStdDev procedure

See also

Calculates the mean and standard deviation of array elements.

Unit

Math

Category

Statistical routines

procedure MeanAndStdDev(const Data: array of Double; var Mean, StdDev: Extended);

Description

MeanAndStdDev calculates Mean and standard deviation in one pass. Using this is twice as fast as calculating them separately. Precision may be lost when the Mean is very large (> 10e7) or the variance is very small.

Data specifies the data to be summarized. The mean is returned as Mean and the standard deviation is returned as StdDev.


Min function

See also

Returns the lesser of two numeric values.

Unit

Math

Category

Arithmetic routines

function Min(A,B: Integer): Integer; overload;

function Min(A,B: Int64): Int64; overload;

function Min(A,B: Single): Single; overload;

function Min(A,B: Double): Double; overload;

function Min(A,B: Extended): Extended; overload;

Description

Call Min to compare two numeric values. Min returns the smaller value of the two.


MinIntValue function

See also

Returns the smallest signed value in an integer array.

Unit

Math

Category

Statistical routines

function MinIntValue(const Data: array of Integer): Integer;

Description

Call MinIntValue to obtain the smallest integer in the Data array.


MinValue function

See also

Returns smallest signed value in an array.

Unit

Math

Category

Statistical routines

function MinValue(const Data: array of Double): Double;

Description

MinValue returns the smallest signed value in the Data array.


MomentSkewKurtosis procedure

Calculates the mean, variance, skew, and kurtosis.

Unit

Math

Category

Statistical routines

procedure MomentSkewKurtosis(const Data: array of Double; var M1, M2, M3, M4, Skew, Kurtosis: Extended);

Description

MomentSkewKurtosis calculates the core factors of statistical analysis: the first four moments plus the coefficients of skew and kurtosis.

Data specifies the data to be analyzed. M1, M2, M3 and M4 return the first four moments (M1 is the mean, M2 is the variance, and so on). Skew reflects symmetry of distribution. Kurtosis reflects flatness of distribution.


NetPresentValue function

See also

Calculates the current value from an array of estimated cash flow values.

Unit

Math

Category

Business and finance routines

function NetPresentValue(Rate: Extended; const CashFlows: array of Double; PaymentTime: TPaymentTime): Extended;

Description

NetPresentValue calculates the current value of an array of estimated cash flow values, discounted at the given interest rate of Rate.

CashFlows is the array of estimated cash flow values.

PaymentTime indicates whether the cash flows occur at the beginning or end of the period.

NetPresentValue helps determine how much an investment is currently worth, based on expected earnings, although its accuracy depends on the accuracy of the cash flows in the array.


Norm function

See also

Returns the Euclidean 'L-2' norm.

Unit

Math

Category

Statistical routines

function Norm(const Data: array of Double): Extended;

Description

Norm returns the Euclidean 'L-2' norm for the values in the Data array. The 'L-2' norm is the square root of the sum of squares.


NumberOfPeriods function

See also

Returns the number of payment periods for an investment.

Unit

Math

Category

Business and finance routines

function NumberOfPeriods(Rate, Payment, PresentValue, FutureValue: Extended; PaymentTime: TPaymentTime): Extended;

Description

NumberOfPeriods computes the number of payment periods required for an investment of PresentValue to reach a value of FutureValue, while making regular payments of Payment and accruing interest at the rate of Rate per compounding period. PaymentTime indicates whether the cash flows occur at the beginning or end of the period.


Payment function

See also

Calculates a fully amortized payment.

Unit

Math

Category

Business and finance routines

function Payment(Rate: Extended; NPeriods: Integer; PresentValue, FutureValue: Extended; PaymentTime: TPaymentTime): Extended;

Description

Payment calculates the fully amortized payment of borrowing PresentValue at Rate percent per period over NPeriods. It assumes that interest is paid at the end of each period.

FutureValue is the value that the investment will reach at some point. PaymentTime indicates whether the cash flows occur at the beginning or end of the period.


PeriodPayment function

See also

Returns the principal amount from a full payment.

Unit

Math

Category

Business and finance routines

function PeriodPayment(Rate: Extended; Period, NPeriods: Integer; PresentValue, FutureValue: Extended; PaymentTime: TPaymentTime): Extended;

Description

PeriodPayment gives the part of the payment that is principal. The InterestPayment function gives the part of the payment that is interest.

The Rate parameter is the interest rate. Period is the number of periods into the loan for which the principal is desired, and NPeriods is the number of periods of the loan. FutureValue is the value the investment will reach at some point. PaymentTime indicates whether the cash flows occur at the beginning or end of the period.


Poly function

Evaluates a uniform polynomial of one variable at the value X.

Unit

Math

Category

Arithmetic routines

function Poly(X: Extended; const Coefficients: array of Double): Extended;

Description

Call Poly to evaluate the polynomial represented by the Coefficients parameter at the point where the variable equals the value of the X parameter. The coefficients are ordered in increasing powers of X:

    Coefficients[0] + Coefficients[1]*X + ... + Coefficients[N]*(X**N)


PopnStdDev function

See also

Calculates the population standard deviation.

Unit

Math

Category

Statistical routines

function PopnStdDev(const Data: array of Double): Extended;

Description

PopnStdDev calculates the population standard deviation (the square root of the population variance) of all values in the Data array parameter. This function is used in some business and financial calculations.


PopnVariance function

See also

Calculates the population variance.

Unit

Math

Category

Statistical routines

function PopnVariance(const Data: array of Double): Extended;

Description

PopnVariance calculates the population variance of all values in the Data array parameter, using the n method (biased): TotalVariance / n.


Power function

See also

Raises Base to any power.

Unit

Math

Category

Arithmetic routines

function Power(Base, Exponent: Extended): Extended;

Description

Power raises Base to any power. For fractional exponents or exponents greater than MaxInt, Base must be greater than 0.


PresentValue function

See also

Calculates the present value of an investment.

Unit

Math

Category

Business and finance routines

function PresentValue(Rate: Extended; NPeriods: Integer; Payment, FutureValue: Extended; PaymentTime: TPaymentTime): Extended;

Description

PresentValue calculates the present value of an investment where Payment is received for NPeriods and is discounted at the rate of Rate per period. FutureValue is the value the investment may reach at some point. PaymentTime indicates whether the cash flows occur at the beginning or end of the period.


RadToCycle function

See also

Converts radians to cycles.

Unit

Math

Category

Measurement conversion routines

function RadToCycle(Radians: Extended): Extended;

Description

Use RadToCycle to convert angles measured in radians into cycles, where

cycles = radians/(2pi).


RadToDeg function

See also

Converts radians to degrees.

Unit

Math

Category

Measurement conversion routines

function RadToDeg(Radians: Extended): Extended;

Description

Use RadToDeg to convert angles measured in radians to degrees, where

degrees = radians(180/pi).


RadToGrad function

See also

Converts radians to grads.

Unit

Math

Category

Measurement conversion routines

function RadToGrad(Radians: Extended): Extended;

Description

Use RadToGrad to convert angles measured in radians to grads, where

grads = radians(200/pi).


RandG function

Generates random numbers with Gaussian distribution.

Unit

Math

Category

random number routines

function RandG(Mean, StdDev: Extended): Extended;

Description

RandG produces random numbers with Gaussian distribution about the Mean. This is useful for simulating data with sampling errors and expected deviations from the Mean.


SinCos procedure

Returns sine and cosine of an angle.

Unit

Math

Category

Trigonometry routines

procedure SinCos(Theta: Extended; var Sin, Cos: Extended); register;

Description

Call SinCos to obtain the sine and cosine of an angle expressed in radians. Theta specifies the angle. The sine and cosine are returned by the Sin and Cos parameters, respectively.

SinCos is twice as fast as calling Sin and Cos separately for the same angle.


Sinh function

Returns the hyperbolic sine of an angle.

Unit

Math

Category

Trigonometry routines

function Sinh(X: Extended): Extended;

Description

Sinh calculates the hyperbolic sine of X.


SLNDepreciation function

See also

Returns the straight-line depreciation allowance of an asset.

Unit

Math

Category

Business and finance routines

function SLNDepreciation(Cost, Salvage: Extended; Life: Integer): Extended;

Description

SLNDepreciation calculates the straight-line depreciation allowance for an asset over one period of its life. The function divides the Cost minus the Salvage by the number of years of useful Life of the asset. Cost is the amount initially paid for the asset. Salvage is the value of the asset at the end of its useful life.

To compute accelerated depreciation (allowing higher depreciation values in the first years of the assets life), use the SYDDepreciation function.


StdDev function

See also

Returns the sample standard deviation for elements in an array.

Unit

Math

Category

Statistical routines

function StdDev(const Data: array of Double): Extended;

Description

StdDev calculates the sample standard deviation (the square root of the sample variance) of all values in the Data array parameter.


Sum function

See also

Returns the sum of the elements in an array.

Unit

Math

Category

Statistical routines

function Sum(const Data: array of Double): Extended; register;

Description

Sum returns the sum of all the values in the Data array parameter.


SumInt function

See also

Returns the sum of the elements in an integer array.

Unit

Math

Category

Statistical routines

function SumInt(const Data: array of Integer): Integer register;

Description

Sum returns the sum of all the values in the Data array parameter.


SumOfSquares function

See also

Returns the sum of the squared values from a data array.

Unit

Math

Category

Statistical routines

function SumOfSquares(const Data: array of Double): Extended;

Description

SumOfSquares returns the sum of the squares of the Data values: Data[0]^2 + Data[1]^2 + Data[2]^2...


SumsAndSquares procedure

See also

Returns the sum of the values and the sum of the squared values in an array.

Unit

Math

Category

Statistical routines

procedure SumsAndSquares(const Data: array of Double; var Sum, SumOfSquares: Extended) register;

Description

SumsAndSquares returns the sum of the Data values in Sum and the sum of the squares in SumOfSquares. The data to sum is specified in the Data array parameter.

This function is faster than calculating the sums separately.


SYDDepreciation function

See also

Calculates depreciation for an asset.

Unit

Math

Category

Business and finance routines

function SYDDepreciation(Cost, Salvage: Extended; Life, Period: Integer): Extended;

Description

SYDDepreciation (for "sum-of-years-digits depreciation") calculates depreciation amounts for an asset using an accelerated depreciation method. This allows for higher depreciation in the earlier years of an asset's life.

Cost is the initial cost of the asset. Salvage is the value of the asset at the end of its life expectancy. Life is the length of the asset's life expectancy. Period is the period for which to calculate the depreciation.


Tan function

See also

Returns the tangent of X.

Unit

Math

Category

Trigonometry routines

function Tan(X: Extended): Extended;

Description

Tan returns the tangent of X. Tan(X) = Sin(X) / Cos(X).


Tanh function

See also

Returns the hyperbolic tangent of X.

Unit

Math

Category

Trigonometry routines

function Tanh(X: Extended): Extended;

Description

Tanh calculates the hyperbolic tangent of X.


TotalVariance function

See also

Returns the statistical variance from an array of values.

Unit

Math

Category

Statistical routines

function TotalVariance(const Data: array of Double): Extended;

Description

TotalVariance returns the sum of the squares of the difference between each Data value and the mean of the data values.

Total Variance: SUM(i=1,N)[(X(i) - Mean)**2]


Variance function

See also

Calculates statistical sample variance from an array of data.

Unit

Math

Category

Statistical routines

function Variance(const Data: array of Double): Extended;

Description

Variance calculates the sample variance of all values in the Data array parameter, using the n-1 method (unbiased).


AnsiSameCaption function

See also

Indicates whether two strings are the same based on the current Windows locale, ignoring case information and accelerator characters.

Unit

Menus

Category

menu support routines

function AnsiSameCaption(const Text1, Text2: string): Boolean;

Description

AnsiSameCaption compares Text1 to Text2, without case sensitivity and ignoring any ampersands (&) that are included to create accelerator characters. The compare operation is controlled by the current Windows locale. The return value is True if the two strings have the same value, False otherwise.


NewItem function

See also	Example

Creates and initializes a menu item.

Unit

Menus

Category

menu support routines

function NewItem(const ACaption: string; AShortCut: TShortCut; AChecked, AEnabled: Boolean; AOnClick: TNotifyEvent; hCtx: Word; const AName: string): TMenuItem;

Description

Call NewItem to create and initialize a menu item when constructing a menu programmatically.

The ACaption parameter specifies the string that should appear for the menu item.

The AShortCut parameter specifies any associated shortcut.

The AChecked parameter indicates whether the menu item appears with a check mark.

The AEnabled parameter specifies whether the menu item is enabled or grayed.

The AOnClick parameter specifies an event handler that executes when the user clicks the menu item.

The hCtx parameter specifies the help context ID for the menu item.

The AName parameter specifies the name of the menu item, which can be used to refer to the menu item in code.

The menu item returned by NewItem can be added to a menu using the target parent’s Add method. If the entire menu is being created dynamically at runtime, the new menu item can be added to an array that is passed as a parameter to the NewMenu, NewPopupMenu, or NewSubMenu function.

Warning:	The item returned by NewItem does not have an owner. You are responsible for freeing its memory when it is no longer needed. The Delete and Remove methods of TMenuItem do not free memory.


NewLine function

See also

Creates a menu item for a separator.

Unit

Menus

Category

menu support routines

function NewLine: TMenuItem;

Description

Call NewLine to create a separator that divides the items in a menu into logical groups. Once the menu item for the separator has been created using NewLine, it can be added to a menu using the target parent’s Add method. If the entire menu is being created dynamically at runtime, the new menu item can be added to an array that is passed as a parameter to the NewMenu, NewPopupMenu, or NewSubMenu function.

Warning:	The item returned by NewLine does not have an owner. You are responsible for freeing its memory when it is no longer needed. The Delete and Remove methods of TMenuItem do not free memory.


NewMenu function

See also	Example

Creates and initializes a main menu.

Unit

Menus

Category

menu support routines

function NewMenu(Owner: TComponent; const AName: string; Items: array of TMenuItem): TMainMenu;

Description

Call NewMenu to create and initialize a main menu programmatically. NewMenu returns the TMainMenu component that represents the menu.

The Owner parameter specifies the component that is responsible for freeing the menu (typically the form).

The AName parameter specifies the name of the menu, which is used to refer to it in code.

The Items parameter is an array of menu items that make up the top level menu items. To create the menu items for the Items parameter, use the NewItem function.


NewPopupMenu function

See also

Creates and initializes a popup menu.

Unit

Menus

Category

menu support routines

function NewPopupMenu(Owner: TComponent; const AName: string; Alignment: TPopupAlignment; AutoPopup: Boolean; Items: array of TMenuItem): TPopupMenu;

Description

Call NewPopupMenu to create and initialize a popup menu programmatically. NewPopupMenu returns the TPopupMenu component that represents the popup menu, but does not associate that popup menu with any control.

The Owner parameter specifies the component that is responsible for freeing the menu.

The AName parameter specifies the name of the popup menu, which is used to refer to it in code.

The Alignment parameter determines where the menu appears relative to the mouse when the user right clicks on the control that uses the menu.

The AutoPopup parameter specifies whether the menu should appear automatically when the user right clicks the associated control.

The Items parameter is an array of menu items that make up the top level menu items. To create the menu items for the Items parameter, use the NewItem function.


NewSubMenu function

See also

Creates and initializes a menu item that represents a submenu.

Unit

Menus

Category

menu support routines

function NewSubMenu(const ACaption: string; hCtx: Word; const AName: string; Items: array of TMenuItem; AEnabled: Boolean): TMenuItem;

Description

Call NewSubMenu to create a menu item that represents a submenu when constructing a menu programmatically at runtime.

The ACaption parameter indicates the string that appears in the parent menu for the submenu.

The hCtx parameter specifies the help context ID for the menu item.

The AName parameter specifies the name of the menu item, which can be used to refer to the menu item in code.

The Items parameter specifies an array of menu items that make up the submenu and that appear when the user clicks the submenu item in the parent menu.

Once a submenu has been created using NewSubMenu, it can be added to a menu using the target parent’s Add method. If the entire menu is being created dynamically at runtime, the new menu item can be added to an array that is passed as a parameter to the NewMenu, NewPopupMenu, or NewSubMenu function.

Warning:	The item returned by NewSubMenu does not have an owner. You are responsible for freeing its memory when it is no longer needed. The Delete and Remove methods of TMenuItem do not free memory.


PopupList variable

See also

Provides centralized handling of Windows messages directed at popup menus.

Unit

Menus

Category

application-level information

var  PopupList: TPopupList;

Description

Use PopupList to access all the popup menus in the application or access the window handle of the window that responds to popup menu messages. PopupList maintains a list of all the popup menu components created in an application. It holds the handle of a hidden window that centralizes the processing of Windows messages directed at these popup menus.


ShortCut function

See also 	Example

Creates a menu shortcut for a specified key combination.

Unit

Menus

Category

menu support routines

function ShortCut(Key: Word; Shift: TShiftState): TShortCut;

Description

Call ShortCut to create a menu shortcut at runtime.

Specify a Key value using a virtual key code.

Specify the values for the Shift, Control, and Alt keys by using a set of type TShiftState. For example, to specify the Shift key, use the set [ssShift]. To specify a Shift and Ctrl key combination, use the set [ssShift, ssCtrl].

Assign the value returned by ShortCut as the value of the ShortCut property of a menu item.

Note:	TextToShortCut can also create a shortcut. TextToShortCut converts a string to a shortcut, so it can be used to let the user specify the shortcut. However, TextToShortCut executes much more slowly than ShortCut. Use ShortCut whenever possible.


ShortCutToKey procedure

See also 	Example

Returns the virtual key code and shift state of a menu shortcut.

Unit

Menus

Category

menu support routines

procedure ShortCutToKey(ShortCut: TShortCut; var Key: Word; var Shift: TShiftState;

Description

Call ShortCutToKey to parse a menu shortcut into its virtual key code and shift state parts.


ShortCutToText function

See also 	Example

Converts a menu shortcut into a string that describes the shortcut.

Unit

Menus

Category

menu support routines

function ShortCutToText(ShortCut: TShortCut): string;

Description

Call ShortCutToText to obtain a text description of the shortcut associated with a menu item. Use this function when the application needs to display a description of a shortcut to the user.


StripHotKey function

See also

Removes the accelerator character marker from a string.

Unit

Menus

Category

menu support routines

function StripHotKey (const Text: string): string;

Description

StripHotKey removes the & escape char that marks the accelerator characters in the string Text.  When the current locale is Asian, this function also looks for and removes any parentheses around the accelerator, which are common in Asian locales.


TextToShortCut function

See also 	Example

Creates a menu shortcut from a text AnsiString.

Unit

Menus

Category

menu support routines

function TextToShortCut(Text: string): TShortCut;

Description

Call TextToShortCut to create a menu shortcut from a descriptive string. For example, an application can allow users to specify the value of a shortcut in an edit box control, and then call TextToShortCut to create a menu shortcut for the value entered by the user.

Note:	TextToShortCut executes slowly. When possible, use the ShortCut function to create a menu shortcut instead.


ValidHotkeys variable

See also

Determines what accelerator keys can be automatically assigned to a menu item caption.

Unit

Menus

Category

menu support routines

var ValidHotkeys: string = '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ';

Description

ValidHotkeys is used to limit the characters that Delphi considers when automatically assigning accelerator keys to menu items. This variable is used at runtime when the AutoHotkeys property is True or when an application calls RethinkHotkeys.

By default, ValidHotkeys limits accelerator keys to alphanumeric values (digits and letters). Change this variable to redefine the keys that Delphi considers when assigning accelerator keys automatically.


FontToOleFont function

See also

Returns a Variant containing an IFontDispatch interface that represents a TFont object.

Unit

OleCtrls

Category

COM utilities

function FontToOleFont(Font: TFont): Variant;

Description

Use FontToOleFont to convert a font from TFont to IFontDispatch format. The interface uses the TFont object to implement the methods of the interface.


OleFontToFont procedure

See also

Fills in a TFont structure to represent an IFontDispatch.

Unit

OleCtrls

Category

COM utilities

procedure OleFontToFont(const OleFont: Variant; Font: TFont);

Description

Use OleFontToFont to convert a font from COM (IFontDispatch) to TFont format.


DestroyMetaPict procedure

See also

Frees a metafile resource given its handle.

Unit

OleCtnrs

Category

Windows controls utilities

procedure DestroyMetaPict(MetaPict: HGlobal);

Description

Call DestroyMetaPict to free a metafile obtained using the GetIconMetaPict method of TOleContainer.

You do not need to use DestroyMetaPict to free metafiles represented using TMetafile. These are freed automatically when the TMetafile instance is destroyed.  However, if you assign a new value to the Handle property of TMetafile, thereby replacing its old metafile, you must free the old metafile by calling DestroyMetaPict.


AssignPrn procedure

See also 	Example

Assigns a text-file variable to the printer.

Unit

Printers

Category

text file routines

procedure AssignPrn(var F: Text);

Description

Call AssignPrn to cause all information written to the text file variable F to be directed to the printer. After the variable is assigned, the application must call the Rewrite procedure.


Printer function

Example

Returns a global instance of TPrinter to manage interaction with the printer.

Unit

Printers

Category

miscellaneous routines

function Printer: TPrinter;

Description

Printer creates an instance of a global TPrinter object the first time it is called. Use the Printer function to print using the TPrinter object.

Printer is declared in the Printers unit. To use the Printer function and the TPrinter object, add Printers to the uses clause of your unit.


Global Routines
Routines

Please see the VCL Help table of contents for a complete categorical listing of VCL routines and functions.


Abs function

Example

Returns an absolute value.

Unit

System

Category

arithmetic routines

function Abs(X);

Description

Abs returns the absolute value of the argument, X.

X is an integer-type or real-type expression.


Addr function

See also	Example

Returns a pointer to a specified object.

Unit

System

Category

pointer and address routines

function Addr(X): Pointer;

Description

The Addr function returns the address of a specified object. X is any variable, procedure or function identifier. The result is a pointer to X.

The result of Addr is of the predefined type Pointer, which means that it is assignment-compatible with all pointer types but can't be dereferenced directly without a typecast.

Note:	Addr is equivalent to the @ operator.


AllocMemCount variable

See also

Represents the total number of allocated memory blocks in an application.

Unit

System

Category

memory management routines

var AllocMemCount: Integer;

AllocMemCount contains the number of currently allocated blocks of memory that were requested by the user. AllocMemCount is incremented each time a block of memory is allocated and is decremented each time a block of memory is freed. Use AllocMemCount to find out how many unfreed blocks of memory remain.

Caution:	Because AllocMemCount is a global variable declared in the System unit, it is not always safe to access it directly. In situations where modules are statically linked to the RTL, each module will have a different instance of AllocMemCount. The following table is a summary. Note that applications that use runtime packages are dynamically linked to the RTL, whereas applications that do not are statically linked.

Application type	Accessibility of AllocMemCount

EXE	Applications that do not use packages or Delphi DLLs can safely access this global variable directly because there is only one instance of it.
EXE with packages and no Delphi DLLs	Applications that use runtime packages and do not use any statically linked DLLs can safely access AllocMemCount directly. In this situation all modules are dynamically linked to the RTL and there is only one instance of the variable. Unlike standard DLLs, packages allow access to global variables.
EXE with statically linked DLLs	If an application is statically linked to the RTL and if that application is also using DLLs that are statically linked to the RTL then the AllocMemCount variable should never be accessed directly, since the EXE and each DLL will have its own instance of it. Instead use the GetAllocMemCount function, implemented in BorlandMM, which returns the instance of the AllocMemCount global variable in the BorlandMM DLL. This DLL manages the memory allocation for all modules that include the ShareMem unit as the first unit in the application or library’s uses clause. It is, therefore, this instance of the variable that contains the correct value. A function is used to access AllocMemCount in this situation because global variables in a DLL are private to the DLL.
EXE with packages and statically linked DLLS	It is not advisable to create applications that mix runtime packages with statically linked DLLs. In this circumstance use caution when allocating, freeing, and accessing memory. Be aware that each version of the RTL contains an instance of AllocMemCount that references memory that is allocated and freed only by that particular module.


AllocMemSize variable

See also

Represents the total size of allocated memory blocks.

Unit

System

Category

memory management routines

var AllocMemSize: Integer;

AllocMemSize contains the total size, in bytes, of all currently allocated blocks of memory in use by an application. Use AllocMemSize to find out how many bytes of memory an application is currently using.

Caution:	Because AllocMemSize is a global variable declared in the System unit, it is not always safe to access it directly. In situations where modules are statically linked to the RTL, each module will have a different instance of AllocMemSize. The following table is a summary. Note that applications that use runtime packages are dynamically linked to the RTL, whereas applications that do not are statically linked.

Application type	Accessibilty of AllocMemSize

EXE	Applications that do not use packages or Delphi DLLs can safely access this global variable directly because there is only one instance of it.
EXE with packages and no Delphi DLLs	Applications that use runtime packages and do not use any statically linked DLLs can safely access AllocMemSize directly. In this situation all modules are dynamically linked to the RTL and there is only one instance of the variable. Unlike standard DLLs, packages allow access to global variables.
EXE with statically linked DLLs	If an application is statically linked to the RTL and if that application is also using DLLs that are statically linked to the RTL then the AllocMemSize variable should never be accessed directly, since the EXE and each DLL will have its own instance of it. Instead use the GetAllocMemSize function, implemented in BorlandMM, which returns the instance of the AllocMemSize global variable in the BorlandMM DLL. This DLL manages the memory allocation for all modules that include the ShareMem unit as the first unit in the application or library’s uses clause. It is, therefore, this instance of the variable that contains the correct value. A function is used to access AllocMemSize in this situation because global variables in a DLL are private to the DLL.
EXE with packages and statically linked DLLS	It is not advisable to create applications that mix runtime packages with statically linked DLLs. In this circumstance use caution when allocating, freeing, and accessing memory. Be aware that each version of the RTL contains an instance of AllocMemSize that references memory that is allocated and freed only by that particular module.


Append procedure

See also	Example

Prepares an existing file for adding text to the end.

Unit

System

Category

I/O routines

procedure Append(var F: Text);

Description

Call Append to ensure that a file is opened with write-only access with the file pointer positioned at the end of the file. F is a text file variable and must be associated with an external file using AssignFile. If no external file of the given name exists, an error occurs. If F is already open, it is closed, then reopened. The current file position is set to the end of the file.

If a Ctrl+Z (ASCII 26) is present in the last 128-byte block of the file, the current file position is set so that the next character added to the file overwrites the first Ctrl+Z in the block. In this way, text can be appended to a file that terminates with a Ctrl+Z.

If F was not assigned a name, then, after the call to Append, F refers to the standard output file.


ArcTan function

See also 	Example

Calculates the arctangent of a given number.

Unit

System

Category

trigonometry routines

function ArcTan(X: Extended): Extended;

Description

Calculate other trigonometric functions using Sin, Cos, and ArcTan in the following expressions:

Tan(x) = Sin(x) / Cos(x)

ArcSin(x) = ArcTan (x/sqrt (1-sqr (x)))

ArcCos(x) = ArcTan (sqrt (1-sqr (x)) /x)


Assert procedure

See also 	Example

Tests whether a boolean expression is successful.

Unit

System

Category

miscellaneous routines

procedure Assert(expr : Boolean [; const msg: string]);

Description

Use Assert as a debugging tool to test that conditions assumed to be true are never violated. Assert provides an opportunity to intercept an unexpected condition and halt a program rather than allow execution to continue under unanticipated conditions.

Assert takes a boolean expression and an optional message string as parameters. If the boolean test fails, Assert raises an EAssertionFailed exception. If a message string was passed to Assert, the exception object is created with that string. Otherwise it is created with a default string indicating that the assertion failed. The message is displayed along with the complete path, filename, and the line number on which Assert failed.

The component library catches all exceptions. If, however, an EAssertionFailed exception occurs where no user code catches it, such as in a console application, then the RTL will issue runtime error 227 and halt the program.

Because assertions are not usually used at run-time in shipping versions of a product, compiler directives are provided to disable the generation of assertion code. They are as follows:

$ASSERTIONS ON/OFF	(long form)

$C +/-	(short form)

These are global switches that take effect for the whole source file that contains the switches, regardless of their position in the file.  It is not possible to enable and disable assertions for something smaller than a source file. Assertions are off by default.


Assigned function

See also	Example

Tests for a nil (unassigned) pointer or procedural variable.

Unit

System

Category

miscellaneous routines

function Assigned(var P): Boolean;

Description

Use Assigned to determine whether the pointer or procedure referenced by P is nil. P must be a variable reference of a pointer or procedural type. Assigned(P) corresponds to the test P<> nil for a pointer variable, and @P <> nil for a procedural variable.

Assigned returns False if P is nil, True otherwise.

Note:	Assigned can't detect a dangling pointer--that is, one that isn't nil but no longer points to valid data. For example, in the code example for Assigned, Assigned won't detect the fact that P isn't valid.


AssignFile procedure

See also 	Example

Associates the name of an external file with a file variable.

Unit

System

Category

file management routines

procedure AssignFile(var F; FileName: string);

Description

Call AssignFile to initialize a file variable. F is a file variable of any file type. FileName is a string-type expression or an expression of type PChar if extended syntax is enabled.

After calling AssignFile, F is associated with the external file until F is closed.  All further operations on the file variable F operate on the external file named by FileName.

When the FileName parameter is empty, AssignFile associates F with the standard input or standard output file. If assigned an empty name, after a call to Reset (F), F refers to the standard input file, and after a call to Rewrite (F), F refers to the standard output file.

Do not use AssignFile on a file variable that is already open.

Note:	To avoid scope conflicts, AssignFile replaces the Assign procedure that was available in previous versions of Delphi. However, for backward compatibility Assign is still available.


BlockRead procedure

See also 	Example

Reads one or more records from an open file into a variable.

Unit

System

Category

I/O routines

procedure BlockRead(var F: File; var Buf; Count: Integer [; var AmtTransferred: Integer]);

Description

F is an untyped file variable, Buf is any variable, Count is an expression of type Integer, and AmtTransferred is an optional variable of type Integer.

BlockRead reads Count or fewer records from the file F into memory, starting at the first byte occupied by Buf. The actual number of complete records read (less than or equal to Count) is returned in AmtTransferred.

The entire transferred block occupies at most Count * RecSize bytes. RecSize is the record size specified when the file was opened (or 128 if the record size was not specified).

If the entire block was transferred, AmtTransferred is equal to Count.

If AmtTransferred is less than Count, ReadBlock reached the end of the file before the transfer was complete. If the file's record size is greater than 1, AmtTransferred returns the number of complete records read.

If AmtTransferred isn't specified, an I/O error occurs if the number of records read isn't equal to Count. If the $I+ compiler directive is in effect, errors raise an EInOutError exception.


BlockWrite procedure

See also 	Example

Writes one or more records from a variable to an open file.

Unit

System

Category

I/O routines

procedure BlockWrite(var f: File; var Buf; Count: Integer [; var AmtTransferred: Integer]);

Description

F is an untyped file variable, Buf is any variable, Count is an expression of type Integer, and AmtTransferred is an optional variable of type Integer.

BlockWrite writes Count or fewer records to the file F from memory, starting at the first byte occupied by Buf. The actual number of complete records written (less than or equal to Count) is returned in AmtTransferred.

The entire block transferred occupies at most Count * RecSize bytes. RecSize is the record size specified when the file was opened (or 128 if the record size was unspecified).

If the entire block is transferred, AmtTransferred is equal to Count on return.

If AmtTransferred is less than Count, the disk became full before the transfer was complete. In this case, if the file's record size is greater than 1, AmtTransferred returns the number of complete records written.

BlockWrite advances the current file position by AmtTransferred records.

If AmtTransferred isn't specified, an I/O error occurs if the number written isn't equal to Count. If the $I+ compiler directive is in effect, errors raise an EInOutError exception.


Break procedure

See also 	Example

Causes the flow of control to exit a for, while, or repeat statement.

Unit

System

Category

flow control routines

procedure Break;

Description

The Break procedure causes the flow of control to exit a for, while, or repeat statement and continue at the next statement following the loop statement.

A call to Break must be contained in a for, while, or repeat statement, or the compiler reports an error.

Note:	Break will not violate the flow of control dictated by a try..finally construct. If a break occurs inside a try..finally, the finally clause will be entered.


ChDir procedure

See also 	Example

Changes the current directory.

Unit

System

Category

file management routines

procedure ChDir(S: string);

Description

ChDir changes the current directory to the path specified by S. If S includes a drive letter, the current drive is also changed.


Chr function

See also 	Example

Returns the character for a specified ASCII value.

Unit

System

Category

miscellaneous routines

function Chr(X: Byte): Char;

Description

Chr returns the character with the ordinal value (ASCII value) of the byte-type expression, X.


Close procedure

See also

Terminates the association between a file variable and an external file (Pascal).

Unit

System

Category

backward compatibility routines

procedure Close(var F);

Description

Close provides compatibility with existing Borland Pascal code. When writing applications for Delphi, use CloseFile instead.

F is a file variable of any file type opened using Reset, Rewrite, or Append. The external file associated with F is completely updated and then closed, freeing the file handle for reuse.


CloseFile procedure

See also	Example

Terminates the association between file variable and an external disk file (Delphi).

Unit

System

Category

file management routines

procedure CloseFile(var F);

Description

Due to naming conflicts, the CloseFile procedure replaces the Borland Pascal Close procedure. Use the CloseFile procedure instead of Close to terminate the association between a file variable and an external disk file.

F is a file variable of any file type opened using Reset, Rewrite, or Append. The external file associated with F is completely updated and then closed, freeing the file handle for reuse.

Note:	{$I+} handles run-time errors using exceptions. When using {$I-}, use IOResult to check for I/O errors.


CmdLine variable

See also

CmdLine is a pointer to the command-line arguments specified when the application is invoked.

Unit

System

Category

command line utilities

var CmdLine: PChar;

Description

In a program, the CmdLine variable contains a pointer to a null-terminated string that contains the command-line arguments specified when the application was started. Use ParamStr to access individual arguments.

In a library (DLL), CmdLine is nil.


CmdShow variable

CmdShow is passed to the Windows ShowWindow WinAPI routine.

Unit

System

Category

application-level information

var CmdShow: Integer;

Description

In a program, the CmdShow variable contains the parameter value that Windows expects to be passed to ShowWindow when the application creates its main window.

In a library (DLL), CmdShow is always zero.


CompToCurrency function

See also

Converts a Comp value to a Currency value.

Unit

System

Category

type conversion routines

function CompToCurrency(acomp: Comp): Currency; cdecl;

Description

CompToCurrency converts a Comp value into a Currency value containing the decimal representation of that number.


CompToDouble function

See also

Converts a Comp value to a Double value.

Unit

System

Category

type conversion routines

function CompToDouble(acomp: Comp): Double; cdecl;

Description

CompToDouble converts a Comp value into a Double value containing the decimal representation of that number.


Concat function

See also	Example

Concatenates two or more strings into one.

Unit

System

Category

string handling routines

function Concat(s1 [, s2,..., sn]: string): string;

Description

Use Concat to concatenate an arbitrary number of strings. Each parameter is a string-type expression. The result is the concatenation of all the string parameters.

Using the plus (+) operator has the same effect on two strings as using the Concat function:

S := 'ABC' + 'DEF';

Tip:	The plus operator is faster than Concat.


Continue procedure

See also	Example

Allows the flow of control to proceed to the next iteration of for, while, or repeat statements.

Unit

System

Category

flow control routines

procedure Continue;

Description

The Continue procedure causes the flow of control to proceed to the next iteration of the enclosing for, while, or repeat statement.

The compiler reports an error if a call to Continue isn't enclosed by a for, while, or repeat statement.

Note:	See the Break procedure for information about exiting loops and finally blocks.


Copy function

See also	Example

Returns a substring of a string or a segment of a dynamic array.

Unit

System

Category

string handling routines

function Copy(S; Index, Count: Integer): string;

function Copy(S; Index, Count: Integer): array;

Description

S is an expression of a string or dynamic-array type. Index and Count are integer-type expressions. Copy returns a substring or sub array containing Count characters or elements starting at S[Index].

If Index is larger than the length of S, Copy returns an empty string or array.

If Count specifies more characters or array elements than are available, only the characters or elements from S[Index] to the end of S are returned.

Note:	When S is a dynamic array, Copy can only be used as a parameter in a call to a procedure or function that expects an array parameter. That is, it acts like the Slice function when working with dynamic arrays.


Cos function

See also	Example

Calculates the cosine of an angle.

Unit

System

Category

trigonometry routines

function Cos(X: Extended): Extended;

Description

Cos returns the cosine of the angle X, in radians.


CurrencyToComp procedure

See also

Converts a Currency value to a Comp value.

Unit

System

Category

type conversion routines

procedure CurrencyToComp(acurrency: Currency; var result: Comp); cdecl;

Description

CurrencyToComp converts a Currency value into a Comp.


Dec procedure

See also	Example

Decrements a variable by 1 or N.

Unit

System

Category

ordinal routines

procedure Dec(var X[ ; N: Longint]);

Description

The Dec procedure subtracts one or N from a variable.

X is a variable of an ordinal type (including Int64), or a pointer type if the extended syntax is enabled.

N is an integer-type expression.

X decrements by 1, or by N if N is specified; that is, Dec(X) corresponds to the statement X := X - 1, and Dec(X, N) corresponds to the statement X := X - N. However, Dec generates optimized code and is especially useful in tight loops.

Note:	If X is a pointer type, it decrements X by N times the size of the type pointed to. Thus, given

type

  PMytype = ^TMyType;

and

var

  P: PMyType;

the statement

Dec(P);

decrements P by SizeOf(TMyType).

Warning:	Do not use Dec on ordinal-type properties if the property uses a write procedure.


Default8087CW variable

See also

Specifies the Default 8087 control word.

Unit

System

Category

miscellaneous routines

var Default8087CW: Word;

Description

Default8087CW is the value to which the Floating Point Unit (FPU) control register is set. The FPU control word includes bits that control the FPU's precision, rounding mode, and whether exceptions generate signals if they occur. See Intel's processor documentation for details.

The Set8087CW procedure allows the programmer to have direct access to the Default8087CW. Setting the floating-point precision and rounding mechanism can be useful if you are reusing old code that is sensitive to the floating-point precision standard used. However, be aware that using this procedure to change the value of the 8087CW will change the behavior of the program’s FP calculations. It is the programmer’s responsibility to reset it.


Delete procedure

See also	Example

Removes a substring from a s string.

Unit

System

Category

string handling routines

procedure Delete(var S: string; Index, Count:Integer);

Description

Delete removes a substring of Count characters from string S starting with S[Index]. S is a string-type variable. Index and Count are integer-type expressions.

If Index is larger than the length of S, no characters are deleted. If Count specifies more characters than remain starting at the S[Index], Delete removes the rest of the string.


Dispose procedure

See also	Example

Releases memory allocated for a dynamic variable.

Unit

System

Category

dynamic allocation routines

procedure Dispose(var P: Pointer);

Description

After a call to Dispose, the value of P is undefined and it is an error to reference P.

Note:	If compiling with {$I+}, use exceptions to handle this error. When an invalid pointer is passed to Dispose it raises an EInvalidPointer exception.


DLLProc variable

Points to a procedure invoked by a DLL entry point.

Unit

System

Category

miscellaneous routines

var DLLProc: Pointer;

Description

DLLProc is used to specify a procedure that is invoked every time a DLL's entry point is called. A procedure assigned to DLLProc must take one parameter of type Integer. For example,

procedure LibraryProc(Reason: Integer);

When the procedure is invoked, this single parameter contains a value between 0 and 3 as defined by the following group of constants in the Windows unit.

const

  DLL_PROCESS_DETACH = 0;

  DLL_PROCESS_ATTACH = 1;

  DLL_THREAD_ATTACH  = 2;

  DLL_THREAD_DETACH  = 3;

For further details on the meaning of these constants, refer to the description of the DllEntryPoint function in the Win32 API online help.

Note:	DLL_PROCESS_ATTACH is passed to the procedure only if the DLL’s initialization code calls the procedure and specifies DLL_PROCESS_ATTACH as a parameter.


DoubleToComp function

See also

Converts a Double value to a Comp.

Unit

System

Category

numeric formatting routines

function DoubleToComp(adouble: Double; var result: Comp); cdecl;

Description

DoubleToComp converts a Double value into a Comp.


EmptyParam variable

Specifies that an optional parameter on a dual interface is not used.

Unit

System

Category

COM utilities

var EmptyParam: OleVariant;

Description

When marshaling interface calls that include optional parameters, COM still requires a value for those parameters even when they are not used. Pass EmptyParam as that value to indicate that the parameter is not used.


EnumModules procedure

See also

Executes a callback for all the modules in an application.

Unit

System

Category

package support routines

procedure EnumModules(Func: TEnumModuleFunc; Data: Pointer); overload;

procedure EnumModules(Func: TEnumModuleFuncLW; Data: Pointer); overload;

Description

EnumModules enumerates the EXE and all packages in an application by passing the handle of the EXE and then of each package, in turn, to a user-defined callback function. EnumModules continues until the last module in the application is enumerated, or until the callback function returns False. The parameters to EnumModules areas follows:

Parameter	Meaning

Func	The procedure-instance address of the callback function.

Data	A 32-bit user-defined value that is passed to the callback function.


EnumResourceModules procedure

See also

Executes a callback for all resource modules in an application.

Unit

System

Category

package support routines

procedure EnumResourceModules(Func: TEnumModuleFunc; Data: Pointer);

procedure EnumResourceModules(Func: TEnumModuleFuncLW; Data: Pointer);

Description

EnumResourceModules executes the callback specified by the Func parameter for all of the instance handles associated with resources of the current program. The instance handle (HINSTANCE) of each resource is passed to Func. EnumResourceModules continues until the last resource module in the application is enumerated, or until the callback returns false. The parameters to EnumResourceModules are as follows:

Parameter	Meaning

Func	The procedure-instance address of the callback function.

Data	A 32-bit user-defined value that is passed to the callback function.


Eof function

See also	Example

Tests whether the file position is at the end of a file.

Unit

System

Category

I/O routines

Typed or untyped files:

function Eof(var F): Boolean;

Text files:

function Eof [ (var F: Text) ]: Boolean;

Description

Eof tests whether the current file position is the end-of-file. F is a file variable. If F is omitted, the standard file variable Input is assumed.

Eof(F) returns True if the current file position is beyond the last character of the file or if the file is empty; otherwise, Eof(F) returns False.


Eoln function

See also	Example

Tests whether the file pointer is at the end of a line.

Unit

System

Category

text file routines

function Eoln [(var F: Text) ]: Boolean;

Description

Eoln tests whether the current file position is the end-of-line of a text file. F, if specified, is a text file variable. If F is omitted, the standard file variable Input is assumed.

Eoln(F) returns True if the current file position is at an end-of-line or if Eof(F) is True; otherwise, Eoln(F) returns False.


Erase procedure

See also	Example

Deletes an external file.

Unit

System

Category

text file routines

procedure Erase(var F);

Description

Erase deletes the external file associated with F. F is a file variable of any file type.

Always close a file before erasing it.


ErrorAddr variable

See also

Contains the address of a statement causing a runtime error.

Unit

System

Category

exception handling routines

var ErrorAddr: Pointer;

Description

If a program terminates normally or stops due to a call to Halt, ErrorAddr is nil. If a program ends because of a run-time error, ErrorAddr contains the address of the statement in error.


ErrorProc variable

See also 	Example

Points to the RTL run-time error handler.

Unit

System

Category

exception handling routines

var ErrorProc: Pointer;

Description

ErrorProc is a procedure variable pointing to the RTL run-time error handler. The standard RTL ErrorProc reports the run-time error and terminates the program.

The ErrorProc variable is retained primarily for compatibility with older Pascal code.  Delphi applications should not specify an alternate runtime error procedure using ErrorProc as Delphi SysUtils uses this variable to convert run time errors into exceptions. Unlike run time errors, exceptions may be processed by Delphi applications.

If you use SysUtils in your program, it will force ErrorProc to its own routine and convert the run-time error into an exception. When a run-time library error occurs, the ErrorProc is called.  The ErrorCode parameter contains the run-time error number and the ErrorAddr parameter contains the machine code address that caused the run time error.


ExceptProc variable

See also

Points to the lowest-level RTL exception handler.

Unit

System

Category

exception handling routines

var ExceptProc: Pointer;

Description

ExceptProc handles unhandled exceptions. You can hook into ExceptProc to change how unhandled exceptions are reported, much like hooking into ExitProc.


Exclude procedure

See also

Removes an element from a set.

Unit

System

Category

set handling routines

procedure Exclude(var S: set of T;I:T);

Description

The Exclude procedure removes element I from set S.

S is a set type variable, and I is an expression of a type compatible with the base type of S.

The construct Exclude (S, I) corresponds to S := S - (I) but the Exclude procedure generates more efficient code.


Exit procedure

See also	Example

Exits from the current procedure.

Unit

System

Category

flow control routines

procedure Exit;

Description

The Exit procedure immediately passes control away from the current procedure. If the current procedure is the main program, Exit causes the program to terminate.

Exit will cause the calling procedure to continue with the statement after the point at which the procedure was called.

Note:	Exit is not constrained by blocks but by procedures.


ExitCode variable

See also

Contains the application's exit code.  (provided for backward compatibility)

Unit

System

Category

backward compatibility routines

var ExitCode: Integer;

Description

ExitCode is provided for backwards compatibility only. Use a finalization section instead.

Note

The description of how ExitCode was used follows:

The ExitCode variable contains the application's exit code.  An exit procedure can learn the cause of termination by examining ExitCode.  If the program terminates normally, ExitCode is zero.  If the program terminates due to a call to Halt, ExitCode contains the value passed to Halt.  If the program terminates due to a run-time error, ExitCode contains the error code.


ExitProc variable

See also

Points to a program's exit procedure.

Unit

System

Category

termination procedure support

var ExitProc: Pointer;

Description

The ExitProc pointer variable enables you to install an exit procedure. The exit procedure always gets called as part of a program's termination. ExitProc should only be used when generating .EXE files. Do not use ExitProc within a dynamically loaded package.

An exit procedure takes no parameters and must be compiled with a far procedure directive to force it to use the far call model.

When implemented properly, an exit procedure actually becomes part of a chain of exit procedures. The procedures on the exit chain get executed in reverse order of installation. All ExitProc calls belong in the finalization section.

To keep the exit chain intact, you need to save the current contents of ExitProc before changing it to the address of your own exit procedure.

The first statement in your exit procedure must reinstall the saved value of ExitProc.


Exp function

See also	Example

Returns the exponential of X.

Unit

System

Category

arithmetic routines

function Exp(X: Real): Real;

Description

Exp returns the value of e raised to the power of X, where e is the base of the natural logarithms.


FileMode variable

See also

Indicates the access mode on typed and untyped files opened by the Reset class.

Unit

System

Category

I/O routines

var FileMode: Byte;

Description

The FileMode variable determines the access mode to use when typed and untyped files (not text files) are opened using the Reset procedure.

The default FileMode is 2. Assigning another value to FileMode causes all subsequent Resets to use that mode.

Valid FileMode values are:

0	Read only
1	Write only
2	Read/Write
Warning:	FileMode is declared as a variable, not as a threadvar. Therefore this variable is not thread-safe.


FilePos function

See also	Example

Returns the current file position.

Unit

System

Category

I/O routines

function FilePos(var F): Longint;

Description

Use FilePos on the file variable of an open file to determine the current position in the file. If the current position in the file is at the very beginning, FilePos returns 0. Otherwise, FilePos returns the byte offset from the beginning of the current position.

FilePos will not work on a file that is not open or on a text file.

Note:	{$I+} handles run-time errors using exceptions. When using {$I-}, use IOResult to check for I/O errors.


FileSize function

See also	Example

Returns the size of a file in bytes or the number of records in a record file.

Unit

System

Category

I/O routines

function FileSize(var F): Integer;

Description

Call FileSize to determine the size of the file specified by the file variable F. To use FileSize, the file must be open. If the file is empty, FileSize(F) returns 0.

Note:	FileSize can't be used on a text file.


FillChar procedure

See also	Example

Fills contiguous bytes with a specified value.

Unit

System

Category

miscellaneous routines

procedure FillChar(var X; Count: Integer; Value: Byte);

Description

FillChar fills Count contiguous bytes (referenced by X) with the value specified by Value (Value can be type Byte or Char).

Warning:	This function does not perform any range checking.


Finalize procedure

See also

Uninitializes a dynamically allocated variable.

Unit

System

Category

dynamic allocation routines

procedure Finalize( var V [; Count: Integer] );

Description

Finalize should be used only in situations where a dynamically allocated variable is deallocated by other means than the Dispose procedure.

For global variables, local variables, objects, and dynamic variables deallocated using Dispose, the compiler generates code that finalizes all long strings, Variants, and interfaces contained by the variable when the instance is destroyed.

If a dynamic variable meets the following to conditions

It is deallocated by other means than the Dispose standard procedure (for example using FreeMem).

It contains long strings, Variants, or interfaces, not all of which are empty or Unassigned.

a call to Finalize is required to finalize the variable before it can be deallocated. Finalize simply sets all long strings to empty and all Variants and interfaces to Unassigned, thus properly releasing any memory that was referenced by the long strings and Variants.

In cases where several variables are deallocated in a contiguous memory block such as a dynamically allocated array of strings, the additional Count parameter can be specified to finalize all variables in one operation.

If the variable specified in a call to Finalize contains no long strings and Variants, the compiler eliminates the call and generates no code for it.


FindClassHInstance function

See also

Returns the instance handle for the module in which a class type is defined.

Unit

System

Category:

streaming utilities

function FindClassHInstance(ClassType: TClass): LongWord;

Description

FindClassInstance finds the HINSTANCE of the EXE or DLL that “owns”, or contains, the runtime type information (RTTI) and the Virtual Method Table (VMT) for the specified class passed in as the Class Type parameter. When reading a component (which is a type), this information is needed in order to be able to load the .dfm file (resources) associated with that component. The VCL streaming system uses FindClassHInstance for this purpose.

FindClassInstance returns 0 if the instance is not found. Otherwise it returns the class owner’s HINSTANCE.


FindHInstance function

See also

Returns the instance handle of the module that contains a specified address.

Unit

System

Category:

streaming utilities

function FindHInstance(Address: Pointer): LongWord;

Description

Use FindHInstance to obtain the HINSTANCE of the module that “owns”, or contains, the address specified by the Address parameter. If no HINSTANCE is found for that address, FindHInstance returns 0.


FindResourceHInstance function

See also

Returns the instance handle of the resource module associated with a specified HINSTANCE.

Unit

System

Category:

streaming utilities

function FindResourceHInstance(Instance: LongWord): LongWord;

Description

When an application that uses the VCL starts up, it checks the locale of the local system. If it finds any resource modules with the same name as the .EXE, .DLL, or .DPL files it is using, it checks the extension on those modules. If the extension of the resource module matches the language and country of the system locale, the application uses the resources in that resource module instead of the resources in the executable, DLL, or package.

FindResourceHInstance finds and returns the HINSTANCE of the resource module associated with the executable, DLL, or package identified by the Instance parameter.

FindResourceHInstance returns 0 upon failure.

Note:	The Instance parameter must be a valid HINSTANCE.


Flush procedure

See also	Example

Empties the buffer of a text file opened for output.

Unit

System

Category

Text file routines

procedure Flush(var F: Text);

Description

F is a text file variable.

When a text file is opened for output using Rewrite or Append, Flush empties the file's buffer. This guarantees that all characters written to the file at that time have actually been written to the external file. Flush has no effect on files opened for input.

Note:	{$I+} handles run-time errors using exceptions. When using {$I-}, use IOResult to check for I/O errors.


Frac function

See also	Example

Returns the fractional part of a real number.

Unit

System

Category

arithmetic routines

function Frac(X: Extended): Extended;

Description

The Frac function returns the fractional part of the argument X.

X is a real-type expression. The result is the fractional part of X; that is, Frac(X) = X - Int(X).


FreeMem procedure

See also	Example

Disposes of a dynamic variable of a given size.

Unit

System

Category

dynamic allocation routines

procedure FreeMem(var P: Pointer[; Size: Integer]);

Description

FreeMem destroys the variable referenced by P and returns its memory to the heap. If P does not point to memory in the heap, a run-time error occurs. If P points to a structure that includes long strings, Variants, dynamic arrays, or interfaces, call Finalize before calling Freemem.

P is a variable of any pointer type previously assigned by the GetMem procedure.

Size specifies the size in bytes of the dynamic variable to dispose of; if specified, it must be exactly the number of bytes previously allocated to that variable by GetMem.

After calling FreeMem, the value of P is undefined. Because subsequent calls to P^ are not caught as errors, it is advisable to call FreeAndNil instead.


GetDir procedure

See also	Example

Returns the current directory for a specified drive.

Unit

System

Category

file management routines

procedure GetDir(D: Byte; var S: string);

Description

Use GetDir to determine the current directory on the drive specified by the D parameters.  D can be set to any of the following values:

Value	Drive

0	Default

1	A

2	B

3	C

Note:	GetDir performs no error checking. For example, if the invalid value 5 (J) were specified, S would return J:\ as if it were the root directory of the invalid drive.


GetHeapStatus function

Returns the current status of the memory manager.

Unit

System or ShareMem

Category

memory management routines

type

  THeapStatus = record

    TotalAddrSpace: Cardinal;s

    TotalUncommitted: Cardinal;

    TotalCommitted: Cardinal;

    TotalAllocated: Cardinal;

    TotalFree: Cardinal;

    FreeSmall: Cardinal;

    FreeBig: Cardinal;

    Unused: Cardinal;

    Overhead: Cardinal;

    HeapErrorCode: Cardinal;

  end;

function GetHeapStatus: THeapStatus;

Description

GetHeapStatus returns the current status of the memory manager in a THeapStatus record. If the ShareMem unit not included, GetHeapStatus returns information about the global heap. If the ShareMem unit is included, GetHeapStatus returns information about memory that can be shared between different processes.

Warning:	When using the ShareMem unit, it must be the first unit included in the project file so that there is no possible mixing of memory management.

These are the meanings of the values in the THeapStatus record:.

Field	Meaning

TotalAddrSpace	The (current) total address space available to your program, in bytes. This will grow as your program's dynamic memory usage grows.

TotalUncommitted	The total number of bytes (of TotalAddrSpace) for which space has not been allocated in the swap file.

TotalCommitted	The total number of bytes (of TotalAddrSpace) for which space has been allocated in the swap file. Note: TotalUncommitted + TotalCommitted = TotalAddrSpace

TotalAllocated	The total number of bytes dynamically allocated by your program.

TotalFree	The total number of free bytes available in the (current) address space for allocation by your program. If this number is exceeded, and enough virtual memory is available, more address space will be allocated from the OS; TotalAddrSpace will be incremented accordingly.

FreeSmall	Total bytes of small memory blocks which are not currently allocated by your program.

FreeBig	Total bytes of big memory blocks which are not currently allocated by your program. Large free blocks can be created by coalescing smaller, contiguous, free blocks or by freeing a large dynamic allocation.  (The exact size of the blocks is immaterial)

Unused	Total bytes which have never been allocated by your program. Note: Unused + FreeBig + FreeSmall = TotalFree These three fields (Unused, FreeBig, and FreeSmall) refer to dynamic allocation by the user program.

Overhead	The total number of bytes required by the heap manager to manage all the blocks dynamically allocated by your program.

HeapErrorCode	Indicates the current status of the heap, as internally determined.

Note:	TotalAddrSpace, TotalUncommitted and TotalCommitted refer to OS memory used by the program, where as TotalAllocated and TotalFree refer to the heap memory used within the program by dynamic allocations. Therefore, to monitor dynamic memory used in your program use TotalAllocated and TotalFree.


GetMem procedure

See also	Example

Creates a dynamic variable and a pointer to the address of the block.

Unit

System

Category

dynamic allocation routines

procedure GetMem(var P: Pointer; Size: Integer);

Description

P is a variable of any pointer type. Size is an expression specifying the size in bytes of the dynamic variable to allocate. Reference the newly created variable as P^.

If there isn't enough memory available to allocate the dynamic variable, an EOutOfMemory exception is raised. For more information on handling run-time library exceptions, see Handling RTL Exceptions.


GetMemoryManager procedure

See also 	Example

Returns the entry points of the currently installed memory manager.

Unit

System

Category

memory management routines

procedure GetMemoryManager(var MemMgr: TMemoryManager);

Description

GetMemoryManager returns the entry points of the currently installed memory manager in a TMemoryManager record.


Halt procedure

See also	Example

Initiates abnormal termination of a program.

Unit

System

Category

flow control routines

procedure Halt [ ( Exitcode: Integer) ];

Description

Halt performs an abnormal termination of a program and returns to the operating system. To perform a normal termination of Delphi VCL non-console application, call Application.Terminate. Exitcode is an optional expression that specifies an exit code for the program.


HeapAllocFlags variable

See also

Flags that indicate how the memory manager obtains memory from the operating system.

Unit

System

Category

memory management routines

var HeapAllocFlags: Word = 2;

Description

Use HeapAllocFlags to customize the flags that the system memory manager uses when requesting blocks of memory from the operating system. By default, the value is GMEM_MOVEABLE.

HeapAllocFlags can be a combination of the following values:

Value	Meaning
GMEM_FIXED	Allocates fixed memory. The operating system can’t move blocks, so there is no need to lock memory when obtaining a pointer. (can’t be combined with GMEM_MOVEABLE).
GMEM_MOVEABLE	Allocates movable memory. In Win32, memory blocks are never moved in physical memory, but they can be moved within the default heap.
GMEM_ZEROINIT	Initializes memory contents to zero.
GMEM_MODIFY	Used to modify the attributes of an already-allocated block of memory.
GMEM_DDESHARE GMEM_SHARE	This flag is primarily for compatibility with 16-bit Window, but. can be used to enhance the performance of DDE operations. It should only be specified if the memory is to be used for DDE.
GPTR	Combines the GMEM_FIXED and GMEM_ZEROINIT flags.
GHND	Combines the GMEM_MOVEABLE and GMEM_ZEROINIT flags.


Hi function

See also 	Example

Returns the high-order byte of X as an unsigned value.

Unit

System

Category

miscellaneous routines

function Hi(X): Byte;

Description

Use Hi to obtain the high-order byte of an expression of type Word or Integer.

Note:	Hi treats Integer as a 16-bit value, even if it is 32-bit.


High function

See also 	Example

Returns the highest value in the range of an argument.

Unit

System

Category

miscellaneous routines

function High(X);

Description

Call High to obtain the upper limit of an Ordinal, Array, or string value. The result type is X, or the index type of X.

X is either a type identifier or a variable reference. The type denoted by X, or the type of the variable denoted by X, must be one of the following:

For this type	High returns

Ordinal type (includes Int64)	The highest value in the range of the type

Array type	The highest value within the range of the index type of the array

String type	The declared size of the string

Open array 	The value, of type Integer, giving the number of elements in the actual parameter minus one

String parameter	The value, of type Integer, giving the number of elements in the actual parameter minus one


HInstance variable

See also

Indicates the handle provided by Windows for an application or library.

Unit

SysInit

Category

application-level information

var HInstance: LongWord;

Description

HInstance contains the instance handle of the application or library as provided by the Windows environment.


Inc procedure

See also 	Example

Increments an ordinal value by one or N.

Unit

System

Category

ordinal routines

procedure Inc(var X [ ; N: Longint ] );

Description

Inc adds one or N to the variable X.

X is a variable of an ordinal type (including Int64), or a pointer type if the extended syntax is enabled.

N is an integer-type expression.

X increments by 1, or by N if N is specified; that is, Inc(X) corresponds to the statement X := X + 1, and Inc(X, N) corresponds to the statement X := X + N. However, Inc generates optimized code and is especially useful in tight loops.

Note:	If X is a pointer type, it increments X by N times the size of the type pointed to. Thus, given

type

  PMytype = ^TMyType;

and

var

  P: PMyType;

the statement

Inc(P);

increments P by SizeOf(TMyType).

Warning:	Do not use Inc on ordinal-type properties if the property uses a write procedure.

Note:	Inc(S, I) where S is a ShortInt and I is a number greater than 127 will cause an EIntOverFlow exception to be raised if range and overflow checking are on. Under Delphi 1.0 this did not raise an exception.


Include procedure

See also

Adds an element to a set.

Unit

System

Category

set handling routines

procedure Include(var S: set of T; I:T);

Description

Include adds the element I to the set S. The expression Include(S,I) corresponds to S := S + [I] but the Include procedure generates more efficient code.

S is a set type variable, and I is an expression of a type compatible with the base type of S.


Initialize procedure

See also

Initializes a dynamically allocated variable.

Unit

System

Category

dynamic allocation routines

procedure Initialize(var V [ ; Count: Integer ] );

Description

Initialize should be used only in situations where a variable is dynamically allocated by other means than the New standard procedure.

For global variables, local variables, objects, and dynamic variables allocated using New, the compiler generates code that initializes all long strings and Variants contained by a variable upon creation of the variable. A call to Initialize is required to initialize a variable before it can be used if

The  dynamic variable is created by other means than the New standard function (for example using GetMem or ReallocMem).

The variable contains long strings, Variants, or interfaces.

The memory allocated for the variable is not initialized to zeros.

Initialize simply zeros out the memory occupied by long strings, Variants, and interfaces, causing long strings to be empty and Variants and interfaces to be Unassigned.

In cases where several variables are allocated in a contiguous memory block, the additional Count parameter can be specified to initialize all variables in one operation.

If the variable specified in a call to Initialize contains no long strings, Variants, or interfaces, the compiler eliminates the call and generates no code for it.


Input variable

See also

Specifies a read-only file associated with an operating system's standard input device.

Unit

System

Category

I/O routines

var Input: Text;

Description

The Input variable is a read-only file associated with the operating system's standard input device, which is usually the keyboard.

In many of Delphi's standard file-handling routines, the file variable parameter can be omitted. Instead the routine operates on the Input or Output file variable. The following standard file-handling routines operate on the Input file when no file parameter is specified:

Eof

Eoln

Read

Readln

SeekEof

SeekEoln

When an application is compiled as a console application (using the Generate console application checkbox on the Linker page of the Project|Options dialog, or a -cc command line switch with the command-line compiler), Delphi automatically associates the Input and Output files with the application's console window. For non-console applications, any attempt to read from Input or write to Output will generate an I/O error.


Insert procedure

See also 	Example

Inserts a substring into a string beginning at a specified point.

Unit

System

Category

String handling routines

procedure Insert(Source: string; var S: string; Index: Integer);

Description

Insert merges Source into S at the position S[index].

Source is a string-type expression. S is a string-type variable of any length. Index is an integer-type expression. It is a character index and not a byte index.


Int function

See also 	Example

Returns the integer part of a real number.

Unit

System

Category

arithmetic routines

function Int(X: Extended): Extended;

Description

Int returns the integer part of X; that is, X rounded toward zero. X is a real-type expression.


IOResult function

Example

Returns the status of the last I/O operation performed.

Unit

System

Category

I/O routines

function IOResult: Integer;

Description

I/O-checking must be off--{$I-}--to trap I/O errors using IOResult.

If an I/O error occurs and I/O-checking is off, all subsequent I/O operations are ignored until a call is made to IOResult. Calling IOResult clears the internal error flag.

An alternative way to handle I/O errors is to use exception handling.


IsConsole variable

See also

Indicates whether the module was compiled as a console application.

Unit

System

Category

application-level information

var IsConsole: Boolean;

Description

The IsConsole variable is True if the module was compiled as a console application. This will be True in both an EXE and in a DLL.


IsLibrary variable

See also

Indicates whether the module is a DLL.

Unit

System

Category

application-level information

var IsLibrary: Boolean;

Description

The IsLibrary variable is True if the module is a DLL.


IsMemoryManagerSet function

See also

Indicates whether the memory manager has been overridden using the SetMemoryManager procedure.

Unit

System

Category

memory management routines

function IsMemoryManagerSet:Boolean);

Description

Call IsMemoryManagerSet to determine whether the default system memory management has been changed by a call to SetMemoryManager. IsMemoryManagerSet returns False if the default system memory management is in place, True otherwise.


IsMultiThread variable

See also

Indicates whether the application spawned additional threads using BeginThread or TThread objects.

Unit

System

Category

thread management routines

var IsMultiThread: Boolean;

Description

IsMultiThread is set to True by BeginThread in order to allow the memory manager to execute safely if a VCL application has more than one thread. If a second thread attempts to allocate memory, it is blocked until the first thread exits the memory manager.


JITEnable variable

Controls when the just-in-time debugger is called.

Unit

System

Category

application-level information

var JITEnable: Byte = 0;

Description

Use JITEnable to indicate what types of exceptions trigger the just-in-time debugger.

When JITEnable is 0 (the default), all exceptions are handled using the application’s exception handling mechanism. The just-in-time debugger is only called if the application provides no mechanism to catch exceptions. Note that any application that includes the forms unit provides exception handling and does not trigger the just-in-time debugger.

When JITEnable is 1, any non-native exceptions (Exceptions not raised by Delphi-compiled code) trigger the just-in-time debugger. Native exceptions are handled by the application’s exception handling mechanism.

When JITEnable is greater than 0, all exceptions trigger the just-in-time debugger.


Length function

See also 	Example

Returns the number of characters in a string or elements in an array.

Unit

System

Category

string handling routines

function Length(S): Integer;

Description

Length returns the number of characters actually used in the string or the number of elements in the array.

For single-byte (AnsiString) and multibyte strings, Length returns the number of bytes used by the string. For Unicode (WideString) strings, Length returns the number of bytes divided by two.

S is a string- or array-valued expression.


LibModuleList variable

See also

Lists module records for enumeration procedures.

Unit

System

Category

package support routines

type

  PLibModule = ^TLibModule;

  TLibModule = record

    Next: PLibModule;

    Instance: LongWord;

    ResInstance: LongWord;

    Reserved: Integer;

  end;

var LibModuleList: PLibModule = nil;

Description

LibModuleList implements a linked list of records for EXEs and packages in an application. The HINSTANCE fields represent the instance handle of the EXE or package, and the instance handle of the resource associated with that executable instance. LibModuleList is used by the EnumModules and the EnumResourceModules procedures.


Ln function

See also 	Example

Returns the natural log of a real expression.

Unit

System

Category

arithmetic routines

function Ln(X: Real): Real;

Description

Ln returns the natural logarithm (Ln(e) = 1) of the real-type expression X.


Lo function

See also 	Example

Returns the low order Byte of argument X.

Unit

System

Category

miscellaneous routines

function Lo(X): Byte;

Description

Lo returns the low-order Byte of the argument X as an unsigned value. X is an expression of type Integer.


Low function

See also 	Example

Returns the lowest value in a range.

Unit

System

Category

miscellaneous routines

function Low(X);

Call Low to obtain the lowest value or first element of an Ordinal, Array or string. Result type is X, or the index type of X where X is either a type identifier or a variable reference.

Type	Low returns

Ordinal type (includes Int64)	The lowest value in the range of the type

Array type	The lowest value within the range of the index type of the array

String type	Returns 0 only on shortstrings

Open array	Returns 0

String parameter	Returns 0


MainInstance variable

See also

The Instance handle for the main executable.

Unit

System

Category

application-level information

var MainInstance: LongWord;

Description

Use MainInstance to obtain the Windows instance handle for the main executable (.EXE) of an application. This is useful in applications that use packages or DLLs, when you need the handle for the EXE rather than for the package or DLL.

Note:	Do not use MainInstance when running a Delphi DLL from a non-Delphi executable.


MainThreadID variable

See also

The Instance handle for the current modules main thread of execution.

Unit

System

Category

application-level information

var MainThreadID: LongWord;

Description

Use MainThreadID to obtain the thread ID for the main execution thread (the current thread when the module was initialized). This ID can be used to identify the thread in Windows API calls.

During debugging, this ID appears in the thread status box for the main thread.


MaxInt constant

See also

The maximum value of the Integer data type.

Unit

System

Category

miscellaneous routines

const MaxInt = High(Integer);

Description

MaxInt represents the highest value in the range of the Integer data type (2147483647).


MaxLongint constant

See also

The maximum value of the Longint data type.

Unit

System

Category

miscellaneous routines

const MaxLongint = High(Longint);

Description

MaxLongint represents the highest value in the range of the Longint data type (2147483647).


MkDir procedure

See also 	Example

Creates a new subdirectory.

Unit

System

Category

I/O routines

procedure MkDir(S: string);

Description

MkDir creates a new subdirectory with the path specified by string S. The last item in the path cannot be an existing file name.

Note:	{$I+} handles run-time errors using exceptions. When using {$I-}, use IOResult to check for an I/O error.


Move procedure

Example

Copies bytes from a source to a destination.

Unit

System

Category

miscellaneous routines

procedure Move(const Source; var Dest; Count: Integer);

Description

Move copies Count bytes from Source to Dest. No range checking is performed. Move compensates for overlaps between the source and destination blocks.

Whenever possible, use SizeOf to determine the count.


New procedure

See also 	Example

Creates a new dynamic variable and sets P to point to it.

Unit

System

Category

dynamic allocation routines

procedure New(var P: Pointer);

Description

The New procedure creates a new dynamic variable and sets a pointer variable to point to it. P is a variable of any pointer type. The size of the allocated memory block corresponds to the size of the type that P points to. The newly created variable can be referenced as P^. If there isn't enough memory available to allocate the dynamic variable, an EOutOfMemory exception is raised.

When an application is finished using a dynamic variable created with New, it should dispose of the memory allocated for the variable using the Dispose standard procedure.


NoErrMsg variable

Controls whether the application displays an error message when a runtime error occurs.

Unit

System

Category

application-level information

var NoErrMsg: Boolean=False;

Description

Set NoErrMsg to control whether a message appears to indicate that a runtime error has occurred. When NoErrMsg is False (the default), runtime errors cause the application to display a message box indicating the type of error that occurred. When NoErrMsg is True, these messages are suppressed.


Null variable

See also

Null represents the null Variant.

Unit

System

Category

variant support routines

var Null: Variant;

Description

Use Null to indicate unknown or missing data. Null can be assigned to variables in an application that must contain a null value. Assigning Null to a Variant variable does not cause an error, and Null can be returned from any function with a Variant return value.

Assigning Null to a variable of any type other than Variant causes either a compile-time error or raises an EVariantError exception. For example, in the following code the assignment of v, the Null Variant, to Variant q is successful; whereas the conversion of Variant v, which is now Null, to the integer return type of the Test function, raises an exception.

function Test(v: Variant): Integer;

var

  q: Variant;

  msg: string;

begin

  q := v; { this is ok, since q is a variant }

  if VarIsNull(q) then

    msg := 'q is a null variant'

  else

    msg := 'q is not a null variant';

  ShowMessage(msg);

  Result := v; { this raises an exception!!!}

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

  Test(Null);

end;

Expressions involving Null always result in Null. Thus, Null is said to “propagate” through intrinsic functions that return Variant data types. If any part of the expression evaluates to Null, the entire expression evaluates to Null.


Odd function

Example

Returns True if argument is an odd number.

Unit

System

Category

ordinal routines

function Odd(X: Longint): Boolean;

Description

Odd tests if the argument is an odd number. It returns True if X is an odd number, False if X is even.


OleStrToString function

See also

Copies data received from a COM interface to a string.

Unit

System

Category

COM utilities

function OleStrToString(Source: PWideChar): string;

Description

OleStrToString copies data from the format used by COM into a Pascal string.


OleStrToStrVar procedure

See also

Copies a string from its COM representation to an existing Pascal string.

Unit

System

Category

COM utilities

procedure OleStrToStrVar(Source: PWideChar; var Dest: string);

Description

OleStrToStrVar converts a wide string (the format used by COM interfaces) into an existing string variable.


Ord function

See also 	Example

Returns the ordinal value of an ordinal-type expression.

Unit

System

Category

ordinal routines

function Ord(X): Longint;

Description

X is an ordinal-type or character-type expression. The result is of type Longint, and its value is the ordinal position of X.

Ord cannot operate on Int64 values.


Output variable

See also

Specifies a write-only file associated with standard output, usually the display.

Unit

System

Category

I/O routines

var Output: Text;

Description

The Output variable is a write-only file associated with the operating system's standard output file, which is usually the display.

In many of Delphi's standard file-handling routines, the file variable parameter can be omitted. Instead the routine operates on the Input or Output file variable. The following standard file-handling routines operate on the Output file when no file parameter is specified:

Write

Writeln

When an application is compiled as a console application (using the Generate console application checkbox on the Linker page of the Project|Options dialog, or a -cc command line switch with the command-line compiler), Delphi automatically associates the Input and Output files with the application's console window. For non-console applications, any attempt to read from Input or write to Output will generate an I/O error.


ParamCount function

See also 	Example

Returns the number of parameters passed on the command line.

Unit

System

Category

command line utilities

function ParamCount: Integer;

Description

ParamCount returns the number of parameters passed to the program on the command line. Separate parameters with spaces or tabs. Use double quotes to wrap multiple words as one parameter (such as long file names containing spaces).


ParamStr function

See also 	Example

Returns a specified parameter from the command-line.

Unit

System

Category

command line utilities

function ParamStr(Index: Integer): string;

Description

ParamStr returns the parameter from the command line that corresponds to Index, or an empty string if Index is greater than ParamCount. For example, an Index value of 2 returns the second command-line parameter.

ParamStr(0) returns the path and file name of the executing program (for example, C:\TEST\MYPROG.EXE).

Note:	Use double quotes to wrap multiple words as one parameter (such as long file names containing spaces)


Pi function

Returns 3.1415926535897932385.

Unit

System

Category

arithmetic routines

function Pi: Extended;

Description

Use Pi in mathematical calculations that require pi, the ratio of a circle's circumference to its diameter. Pi is approximated as 3.1415926535897932385.


Pos function

See also 	Example

Returns the index value of the first character in a specified substring that occurs in a given string.

Unit

System

Category

string handling routines

function Pos(Substr: string; S: string): Integer;

Description

Pos searches for a substring, Substr, in a string, S. Substr and S are string-type expressions.

Pos searches for Substr within S and returns an integer value that is the index of the first character of Substr within S. Pos is case-sensitive. If Substr is not found, Pos returns zero.


Pred function

See also 	Example

Returns the predecessor of the argument.

Unit

System

Category

ordinal routines

function Pred(X);

Description

X is an expression of an ordinal type (including Int64). The result, of the same type as X, is the predecessor of X. Do not use Pred on ordinal-type properties if the property uses a write procedure.


Ptr function

See also

Converts a specified address to a pointer.

Unit

System

Category

pointer and address routines

function Ptr(Address: Integer): Pointer;

Ptr converts the given address to a pointer. A call to this function generates no code, but simply treats the 32-bit value given by Address as a pointer. Like nil, the result of Ptr is assignment compatible with all pointer types.


Random function

See also 	Example

Generates random numbers within a specified range.

Unit

System

Category

random number routines

function Random [ ( Range: Integer) ];

Description

Random returns a random number within the range 0 <= X < Range. If Range is not specified, the result is a real-type random number within the range

0 <= X < 1.

To initialize the random number generator, add a single call Randomize or assign a value to the RandSeed variable before making any calls to Random.

Note:	Because the implementation of the Random function may change between compiler versions, we do not recommend using Random for encryption or other purposes that require reproducible sequences of pseudo-random numbers.


Randomize procedure

See also	Example

Initializes the random number generator with a random value.

Unit

System

Category

random number routines

procedure Randomize;

Description

Randomize initializes the built-in random number generator with a random value (obtained from the system clock). The random number generator should be initialized by making a call to Randomize, or by assigning a value to RandSeed.

Do not combine the call to Randomize in a loop with calls to the Random function. Typically, Randomize is called only once, before all calls to Random.


RandSeed variable

See also

RandSeed stores the built-in random number generator's seed.

Unit

System

Category

random number routines

var RandSeed: LongInt;

Description

By assigning a specific value to RandSeed, the Random function can repetitively generate a specific sequence of random numbers. This is useful for applications that deal with data statistics and simulations. For applications that deal with encryption see the note under the Random function.


Read procedure

See also 	Example

Read reads data from a file.

Unit

System

Category

text file routines

Typed files:

procedure Read(F , V1 [, V2,...,Vn ] );

Text files:

procedure Read( [ var F: Text; ] V1 [, V2,...,Vn ] );

Description

The Read procedure can be used in the following ways.

For typed files, it reads a file component into a variable.

For text files, it reads one or more values into one or more variables.

With a type string variable:

Read reads all characters up to, but not including, the next end-of-line marker or until Eof(F) becomes True; it does not skip to the next line after reading. If the resulting string is longer than the maximum length of the string variable, it is truncated.

After the first Read, each subsequent Read sees the end-of-line marker and returns a zero-length string.

Use multiple Readln calls to read successive string values.

When the extended syntax is enabled, Read can read null-terminated strings into zero-based character arrays.

With a type character variable:

Read reads one character from the file and assigns it to the variable. If Eof(F) was True before Read was executed, the value Chr(26) (a Ctrl-Z character) is assigned to the variable.

With type integer or type real variables:

Read skips any blanks, tabs, or end-of-line markers preceding the numeric string.

If the numeric string does not conform to the expected format, an I/O error occurs; otherwise, the value is assigned to the variable.

The next Read starts with the blank, tab, or end-of-line marker that terminated the numeric string.


Readln procedure

See also 	Example

Reads a line of text from a file.

Unit

System

Category

text file routines

procedure Readln([ var F: Text; ] V1 [, V2, ...,Vn ]);

Description

The Readln procedure reads a line of text and then skips to the next line of the file.

Readln(F) with no parameters causes the current file position to advance to the beginning of the next line if there is one; otherwise, it goes to the end of the file.

When an application is compiled as a console application (using the Generate console application checkbox on the Linker page of the Project|Options dialog, or a -cc command line switch with the command-line compiler), Delphi automatically associates the Input and Output files with the application's console window. For non-console applications, any attempt to read from Input or write to Output will generate an I/O error.

Note:	{$I+} handles run-time errors using exceptions.  When using {$I-}, use IOResult to check for I/O errors.


ReallocMem procedure

See also

Reallocates a dynamic variable.

Unit

System

Category

memory management routines

procedure ReallocMem(var P: Pointer; Size: Integer);

Description

On entry, P must be nil or point to a dynamic variable that was previously allocated with GetMem, AllocMem, or ReallocMem.

If P is nil and Size is zero, ReallocMem does nothing.

If P is nil and Size is not zero, ReallocMem allocates a new block of the given size and sets P to point to the block. This corresponds to a call to GetMem.

If P is not nil and Size is zero, ReallocMem disposes the block referenced by P and sets P to nil. This corresponds to a call to FreeMem, except that FreeMem doesn't clear the pointer.

If P is not nil and Size is not zero, ReallocMem reallocates the block referenced by P to the size given by Size. Existing data in the block is not affected by the reallocation, but if the block is made larger, the contents of the newly allocated portion of the block are undefined. If the block cannot be reallocated in place, it is moved to a new location in the heap, and P is updated accordingly.


Rename procedure

See also 	Example

Changes the name of an external file.

Unit

System

Category

I/O routines

procedure Rename(var F; Newname:string);

procedure Rename(var F; Newname:PChar);

Description

The external file associated with F is renamed Newname. Further operations on F operate on the external file with the new name.

F is a variable of any file type. Newname is a string-type expression or an expression of type PChar if the extended syntax is enabled.

Note:	{$I+} handles run-time errors using exceptions.  When using {$I-}, use IOResult to check for I/O errors.


Reset procedure

See also 	Example

Opens an existing file.

Unit

System

Category

I/O routines

procedure Reset(var F [: File; RecSize: Word ] );

Description

Reset opens the existing external file with the name assigned to F. An error results if no existing external file of the given name exists. If F is already open, it is first closed and then reopened. The current file position is set to the beginning of the file.

F is a variable of any file type associated with an external file using AssignFile. RecSize is an optional expression, which can be specified only if F is an untyped file. If F is an untyped file, RecSize specifies the record size to be used in data transfers. If RecSize is omitted, a default record size of 128 bytes is assumed.

If F is assigned an empty name, such as AssignFile(F, ''), then after the call to Reset, F refers to the standard input file.

If F is a text file, F becomes read-only.

After a call to Reset, Eof(F) is True if the file is empty; otherwise, Eof(F) is False.

Note:	{$I+} handles run-time errors using exceptions. When using {$I-}, use IOResult to check for I/O errors.


Rewrite procedure

See also	Example

Creates a new file and opens it.

Unit

System

Category

I/O routines

procedure Rewrite(var F: File [; Recsize: Word ] );

Description

Rewrite creates a new external file with the name assigned to F.

F is a variable of any file type associated with an external file using AssignFile. RecSize is an optional expression, which can be specified only if F is an untyped file. If F is an untyped file, RecSize specifies the record size to be used in data transfers. If RecSize is omitted, a default record size of 128 bytes is assumed.

If an external file with the same name already exists, it is deleted and a new empty file is created in its place.

If F is already open, it is first closed and then re-created. The current file position is set to the beginning of the empty file.

If F was assigned an empty name, such as AssignFile(F,''), then after the call to Rewrite, F refers to the standard output file.

If F is a text file, F becomes write-only.

After calling Rewrite, Eof(F) is always True.

Note:	{$I+} handles run-time errors using exceptions. When using {$I-}, use IOResult to check for I/O errors.


RmDir procedure

See also 	Example

Deletes an empty subdirectory.

Unit

System

Category

I/O routines

procedure RmDir(S: string);

Description

RmDir removes the subdirectory with the path specified by S. If the path does not exist, is non-empty, or is the currently logged directory, an I/O error occurs.

Note:	{$I+} handles run-time errors using exceptions. When using {$I-}, use IOResult to check for I/O errors.


Round function

See also 	Example

Returns the value of X rounded to the nearest whole number.

Unit

System

Category

arithmetic routines

function Round(X: Extended): Int64;

Description

The Round function rounds a real-type value to an integer-type value.

X is a real-type expression. Round returns an Int64 value that is the value of X rounded to the nearest whole number. If X is exactly halfway between two whole numbers, the result is always the even number.

If the rounded value of X is not within the Int64 range, a run-time error is generated, which can be handled using the EInvalidOp exception.


RunError procedure

See also 	Example

Stops execution and generates a run-time error.

Unit

System

Category

flow control routines

procedure RunError [ ( Errorcode: Byte ) ];

Description

The RunError procedure stops program execution by generating a run-time error with the given number at the current statement. Errorcode is the run-time error number (0 if omitted).


Seek procedure

See also 	Example

Moves the current position of a file to a specified component.

Unit

System

Category

I/O routines

procedure Seek(var F; N: Longint);

Description

Use Seek to move to a specified position in open typed or untyped files. The current file position of F moves to component number N. The number of the first component of a file is 0.

In the above syntax, F is a typed or untyped file variable. The file specified by F must be open. N is an expression of type Longint

To expand a file, seek one component beyond the last component; that is, the statement Seek(F, FileSize(F)) moves the current file position to the end of the file.

Note:	{$I+} handles run-time errors using exceptions. When using {$I-}, use IOResult to check for I/O errors.


SeekEof function

See also 	Example

Returns the end-of-file status of a file.

Unit

System

Category

text file routines

function SeekEof [ (var F: Text) ]: Boolean;

Description

Call SeekEof to determine whether the file pointer is currently at the end of a file. SeekEof can only be used on open text files.

Note:	{$I+} handles run-time errors using exceptions. When using {$I-}, use IOResult to check for I/O errors.


SeekEoln function

See also 	Example

Returns the end-of-line status of a file.

Unit

System

Category

text file routines

function SeekEoln [ (var F: Text) ]: Boolean;

Description

Call SeekEoln to determine whether the file pointer is currently at the end of a line. SeekEoln can be used only on open text files.

Note:	{$I+} handles run-time errors using exceptions. When using {$I-}, use IOResult to check for I/O errors.


Set8087CW procedure

See also	Example

Sets both the control word in the floating point unit and the variable NoErrMsg declared in the system unit.

Unit

System

Category

miscellaneous routines

procedure Set8087CW(NewCW: Word);

Description

The floating point unit control word controls the precision of floating point calculations, the rounding mode, and whether certain floating point operations trigger exceptions. See Intel's processor documentation for details.

This routine allows the programmer to have direct access to the CW. Be aware that using this routine to change the value of the 8087CW will change the behavior of the program’s FP calculations. It is the programmer’s responsibility to reset it.

It is recommended that you disable all floating point exceptions when using OpenGL to render 3D graphics. To do this, call Set8087CW(0x133f) in your main form’s OnCreate event before calling any OpenGL functions.


SetLength procedure

See also

Sets the length of a string or dynamic-array variable.

Unit

System

Category

string handling routines

procedure SetLength(var S; NewLength: Integer);

Description

S is a string or dynamic-array variable.

For a short-string variable, SetLength simply sets the length-indicator character (the character at S[0]) to the given value. In this case, NewLength must be a value between 0 and 255.

For a long-string or dynamic-array variable, SetLength reallocates the string or array referenced by S to the given length. Existing characters in the string or elements in the array are preserved, but the content of newly allocated space is undefined. If there is not enough memory available to reallocate the variable, an EOutOfMemory exception is raised. Following a call to SetLength, S is guaranteed to reference a unique string or array—that is a string or array with a reference count of one.


SetMemoryManager procedure

See also 	Example

Sets entry points of the memory manager.

Unit

System

Category

memory management routines

procedure SetMemoryManager(const MemMgr: TMemoryManager);

Description

SetMemoryManager sets the entry points of the memory manager to the three functions encapsulated by the MemMgr parameter. Use SetMemoryManager to change the memory allocation routines that are used for:

The GetMem, ReallocMem, and FreeMem standard procedures.

The New and Dispose standard procedures.

Allocation and deallocation of objects through constructors and destructors.

Allocation and deallocation of dynamic strings and dynamic arrays.


SetString procedure

See also

Sets the contents and length of the given string.

Unit

System

Category

string handling routines

procedure SetString(var s: string; buffer: PChar; len: Integer);

Description

The SetString standard procedure sets the contents and length of the given string variable to the block of characters given by the Buffer and Len parameters.

For a short string variable, SetString sets the length indicator character (the character at S[0]) to the value given by Len and then, if the Buffer parameter is not nil, copies Len characters from Buffer into the string starting at S[1]. For a short string variable, the Len parameter must be a value between 0 and 255.

For a long string variable, SetString sets S to reference a newly allocated string of the given length. If the Buffer parameter is not nil, SetString then copies Len characters from Buffer into the string; otherwise, the contents of the new string is left uninitialized. If there is not enough memory available to create the string, an EOutOfMemory exception is raised. Following a call to SetString, S is guaranteed to reference a unique string, that is a string with a reference count of one.


SetTextBuf procedure

See also 	Example

Assigns an I/O buffer to a text file.

Unit

System

Category

text file routines

procedure SetTextBuf(var F: Text; var Buf [ ; Size: Integer] );

Description

SetTextBuf changes the text file F to use the buffer specified by Buf instead of F's internal buffer. F is a text file variable, Buf is any variable, and Size is a optional expression.

Each Text file variable has an internal 128-byte buffer that buffers Read and Write operations. This buffer is adequate for most operations. However, heavily I/O-bound programs benefit from a larger buffer to reduce disk head movement and file system overhead.

Size specifies the size of the buffer in bytes. If Size is omitted, SizeOf(Buf) is assumed. The new buffer remains in effect until F is next passed to AssignFile.

SetTextBuf can be called immediately after Reset, Rewrite, and Append, but never apply it to an open file.

When SetTextBuf is called on an open file once I/O operations have taken place, data could be lost because of the change of buffer.

Delphi does not ensure that the buffer exists for the entire duration of I/O operations on the file. A common error is to install a local variable as a buffer, then use the file outside the procedure that declared the buffer.


Sin function

See also 	Example

Returns the sine of the angle in radians.

Unit

System

Category

trigonometry routines

function Sin(X: Extended): Extended;

Description

The Sin function returns the sine of the argument.

X is a real-type expression. Sin returns the sine of the angle X in radians.


SizeOf function

See also 	Example

Returns the number of bytes occupied by a variable or type.

Unit

System

Category

miscellaneous routines

function SizeOf(X): Integer;

Description

Pass a variable reference to SizeOf to determine the number of bytes used to represent the variable.  Pass a type identifier to SizeOf to determine the number of bytes used to represent instances of that type.  SizeOf is useful for determining the amount of memory to specify for the FillChar, Move, or GetMem procedures.


Slice function

See also

Returns a sub-section of an array.

Unit

System

Category

miscellaneous routines

function Slice(var A: array; Count: Integer): array;

Description

Use Slice to select a sub-section (slice) of an array to be passed as an open array parameter. Slice is only allowed as a parameter in a call to a procedure or function that expects an open array parameter. Slice selects the first Count elements of the array given by A to be passed as an open array parameter. A can itself be an open array parameter, alllowing dynamically allocated arrays to be passed to open array parameters.


Sqr function

See also 	Example

Returns the square of a number.

Unit

System

Category

arithmetic routines

function Sqr(X: Extended): Extended;

Description

The Sqr function returns the square of the argument.

X is a floating-point expression. The result, of the same type as X, is the square of X, or X*X.


Sqrt function

See also 	Example

Returns the square root of X.

Unit

System

Category

arithmetic routines

function Sqrt(X: Extended): Extended;

Description

X is a floating-point expression. The result is the square root of X.


Str procedure

See also 	Example

Formats a string and returns it to a variable.

Unit

System

Category

string handling routines

procedure Str(X [: Width [: Decimals ]]; var S);

Description

Str procedure X to a string representation according to the Width and Decimals formatting parameters. The effect is like a call to Write except the resulting string is stored in S instead of being written to a text file.

X is an integer-type or real-type expression. Width and Decimals are integer-type expressions. S is a string-type variable or a zero-based character array variable if extended syntax is enabled.


StringOfChar function

See also

Returns a string with a specified number of repeating characters.

Unit

System

Category

string handling routines

function StringOfChar(Ch: Char; Count: Integer): string;

Description

StringOfChar returns a string containing Count characters with the character value given by Ch. For example,

S := StringOfChar('A', 10);

sets S to the string 'AAAAAAAAAA'.


StringToOleStr function

See also

Allocates memory and copies a string to the OLE format.

Unit

System

Category

COM utilities

function StringToOleStr(const Source: string): PWideChar;

Description

StringToOleStr allocates memory and copies string data from a native Pascal string into a format that can be passed to OLE functions.


StringToWideChar function

See also

Returns a UNICODE string from a Pascal string.

Unit

System

Category

wide character routines

function StringToWideChar(const Source: string; Dest: PWideChar; DestSize: Integer): PWideChar;

Description

StringToWideChar converts the string given by Source from ANSI to UNICODE and stores the result in the buffer given by Dest and DestSize. Following the call, the Dest buffer contains at most DestSize - 1 characters from the source string, terminated by a NULL wide character. The function returns a pointer to Dest.


Succ function

See also 	Example

Returns the successor of an argument.

Unit

System

Category

ordinal routines

function Succ(X);

Description

Succ returns the successor of the argument, X.

X is an expression of an ordinal type (including Int64). The result, of the same type as X, is the successor of X. Do not use Succ on properties if the property uses a write procedure.


Swap function

See also

Exchanges high order byte with the low order byte of an integer or word.

Unit

System

Category

backward compatibility routines

function Swap(X);

Description

Swap exchanges the high-order bytes with the low-order bytes of the argument. X is an expression of type SmallInt, as a 16-bit value, or Word. This is provided for backwards compatibility only.


SysFreeMem function

See also

Frees the memory pointed to by a specified pointer.

Unit

System or ShareMem

Category

memory management routines

function SysFreeMem(P: Pointer): Integer;

Description

When implementing a custom memory manager, use SysFreeMem to free the memory pointed to by the P parameter. Do not include the ShareMem unit if the memory was allocated from the global heap. Including the ShareMem unit “overrides” the heap version for when memory is shared with other processes.

Warning:	When using the ShareMem unit, it must be the first unit included in the project file so that there is no possible mixing of memory management.


SysGetMem function

See also

Allocates a specified number of bytes and returns a pointer to them.

Unit

System or ShareMem

Category

memory management routines

function SysGetMem(Size: Integer): Pointer;

Description

When implementing a custom memory manager, use SysGetMem to dynamically allocate Size bytes of memory. Unless the ShareMem unit is included, the memory is allocated from the Global heap. If the ShareMem unit is included, the memory is reference counted memory that can be shared with other processes.

Warning:	When using the ShareMem unit, it must be the first unit included in the project file so that there is no possible mixing of memory management.


SysReallocMem function

See also

Returns a pointer to a specified number of bytes, preserving the values pointed to by the Pointer parameter.

Unit

System or ShareMem

Category

memory management routines

function SysReallocMem(P: Pointer; Size: Integer): Pointer;

Description

When implementing a custom memory manager, use SysReallocMem to change the size of a dynamically allocated chunk of memory. If SysReallocMem can’t expand the memory block point to by P, it frees the referenced memory and copies the values to the newly allocated memory that is returned. If Size is less than the number of bytes pointed to by P, only the first Size bytes are preserved. Otherwise, the entire value of the memory pointed to by P is preserved in the newly allocated memory.

Unless the ShareMem unit is included, both the return value and P must point to memory from the global heap. If the ShareMem unit is included, P and the return value point to memory that can be shared with other processes.

Warning:	When using the ShareMem unit, it must be the first unit included in the project file so that there is no possible mixing of memory management.


Trunc function

See also 	Example

Truncates a real number to an integer.

Unit

System

Category

arithmetic routines

function Trunc(X: Extended): Int64;

Description

The Trunc function truncates a real-type value to an integer-type value. X is a real-type expression. Trunc returns an Int64 value that is the value of X rounded toward zero.

If the truncated value of X is not within the Int64 range, an EInvalidOp exception is raised.


Truncate procedure

See also 	Example

Deletes all the records after the current file position.

Unit

System

Category

I/O routines

procedure Truncate(var F);

Description

Call Truncate to cause the current file position to become end-of-file (Eof(F) is True).

F is a file variable of any type except a text file. Truncate does not work on text files. F must be open.


TypeInfo function

Returns a pointer to compiler generated run-time type information for a type identifier.

Unit

System

Category

streaming utilities

function TypeInfo(TypeIdent): Pointer;

Description

Certain low-level VCL procedures and functions require run-time type information pointers as parameters. The actual format of the run-time type information is internal to the compiler and may change between releases.


Unassigned constant

See also 	Example

Used for a Variant variable not yet assigned a value.

Unit

System

Category

variant support routines

const Unassigned: Variant;

Description

The Unassigned constant is used to indicate that a Variant variable has not yet been assigned a value. The initial value of any Variant variable is Unassigned. The Unassigned value disappears as soon as a Variant variable is assigned any other value, including the value 0, a zero-length string, and the Null value.

Using an Unassigned Variant in an expression causes an EVariantError exception to be raised. Likewise, if you attempt to convert an Unassigned Variant to another type (using VarAsType or VarCast), an EVariantError exception is raised.

You can make a Variant variable unassigned by assigning the Unassigned constant to it. This is particularly useful in situations where a Variant contains a reference to an OLE Automation Object, thus keeping the object "alive" until another value is assigned to the Variant.

Do not use Unassigned to test whether a Variant value is Unassigned. Instead, use the VarIsEmpty standard function. When used on an unassigned Variant, the VarType standard function returns varEmpty.


UniqueString procedure

See also

Ensures that a given string has a reference count of one.

Unit

System

Category

miscellaneous routines

procedure UniqueString(var S: string);

Description

Following a call to SetString, S is guaranteed to reference a unique string; that is, a string with a reference count of one. For normal string handling, there is no need to ever call UniqueString. Only in cases where an application casts a string to a PChar and then modifies the contents of the string must UniqueString be used.


UpCase function

See also 	Example

Converts a character to uppercase.

Unit

System

Category

miscellaneous routines

function UpCase(Ch: Char): Char;

Description

UpCase converts a character to uppercase. Ch is an expression of type Char. Character values not in the range a..z are unaffected.


Val procedure

See also 	Example

Converts a string to a numeric representation.

Unit

System

Category

string handling routines

procedure Val(S; var V; var Code: Integer);

Description

Val converts the string value S to its numeric representation, as if it were read from a text file with Read.

S is a string-type expression; it must be a sequence of characters that form a signed real number.

V is an integer-type or real-type variable. If V is an integer-type variable, S must form a whole number.

Code is a variable of type Integer.

If the string is invalid, the index of the offending character is stored in Code; otherwise, Code is set to zero. For a null-terminated string, the error position returned in Code is one larger than the actual zero-based index of the character in error.

Val performs range checking differently depending upon the setting of the $R compiler directive and the type of the parameter V.

Setting	Result

{$R+}	An out-of-range value always generates a run-time error.

{$R-}	The values for out-of-range vary depending upon the data type of V.


VarArrayCreate function

See also 	Example

Creates a Variant array.

Unit

System

Category

Variant support routines

function VarArrayCreate(const Bounds: array of Integer; VarType: Integer): Variant;

Description

VarArrayCreate creates a Variant array with the bounds given by Bounds and the element type given by VarType.

The Bounds parameter must contain an even number of values, where each pair of values specifies the upper and lower bounds of one dimension of the array.

The element type of the array, given by the VarType parameter, must be one of the TVarData type codes, and cannot include the varArray or varByRef bits. The element type cannot be varString. To create a Variant array of strings use the varOleStr type code. If the element type is varVariant, the elements of the array are themselves Variants and can in turn contain Variant arrays.

Note:	Variant arrays with an element type of varByte are the preferred method of passing binary data between OLE Automation controllers and servers. Such arrays are subject to no translation of their data, and can be efficiently accessed using the VarArrayLock and VarArrayUnlock routines.


VarArrayDimCount function

See also

Returns number of dimensions of a Variant array.

Unit

System

Category

Variant support routines

function VarArrayDimCount(const A: Variant): Integer;

Description

VarArrayDimCount returns the number of dimensions of the given Variant. The resulting value is zero if the given Variant is not a Variant array.


VarArrayHighBound function

See also

Returns high bound for a dimension in a Variant array.

Unit

System

Category

Variant support routines

function VarArrayHighBound(const A: Variant; Dim: Integer): Integer;

Description

VarArrayHighBound returns the high bound of the given dimension in the given Variant array. The Dim parameter should be 1 for the leftmost dimension, 2 for the second leftmost dimension, and so on. An EVariantError exception is raised if the Variant given by A is not an array, or if the dimension specified by Dim does not exist.


VarArrayLock function

See also 	Example

Locks a Variant array and returns a pointer to the data.

Unit

System

Category

Variant support routines

function VarArrayLock(var A: Variant): Pointer;

Description

VarArrayLock locks the given Variant array and returns a pointer to the data stored in the array. While locked, a Variant array can not be resized and any calls to VarArrayRedim will fail. Once locked, a Variant array must later be unlocked using VarArrayUnlock. An EVariantError exception is raised if the Variant given by A is not an array.

The pointer returned by VarArrayLock points to an array of elements in which the leftmost dimension increases first. In other words, the dimensions of the returned array pointer are reversed from the dimensions of the Variant array.

Once it is verified that a Variant array has the correct bounds and dimensions, VarArrayLock can be used to gain direct access to the array data, which results in improved performance.


VarArrayLowBound function

See also

Returns the low bound of a dimension in a Variant array.

Unit

System

Category

Variant support routines

function VarArrayLowBound(const A: Variant; Dim: Integer): Integer;

Description

VarArrayLowBound returns the low bound of the given dimension in the given Variant array. The Dim parameter should be 1 for the leftmost dimension, 2 for the second leftmost dimension, and so on. An EVariantError exception is raised if the Variant given by A is not an array, or if the dimension specified by Dim does not exist.


VarArrayOf function

See also	Example

Creates and fills a one-dimensional Variant array.

Unit

System

Category

Variant support routines

Description

VarArrayOf returns a one-dimensional Variant array with the elements given by the Values parameter.

The low bound of the returned array is zero, the high bound is the number of values given by the Values parameter less one, and the element type is Variant.


VarArrayRedim procedure

See also

VarArrayRedim resizes a Variant array.

Unit

System

Category

Variant support routines

procedure VarArrayRedim(var A: Variant; HighBound: Integer);

Description

VarArrayRedim resizes the given Variant array by changing the high bound of the rightmost dimension to the given value. The A parameter can be a Variant or an OleVariant, and it must be possible to assign a value to A (A must be an lvalue).

Existing elements of the array are preserved, and new elements are set to zero or empty. An EVariantError exception is raised if the Variant given by A is not an array, or if there is not enough memory to resize the array.

Note:	A Variant array can’t be resized while it is locked.


VarArrayRef function

See also

Returns a reference to the specified Variant array.

Unit

System

Category

Variant support routines

function VarArrayRef(const A: Variant): Variant;

Description

Use VarArrayRef to reference a Variant array when a referenced Variant array is expected in an API call. VarArrayRef creates a new Variant array of the same type as A, but with an extra level of indirection if A does not include the varByRef type bit. The returned Variant includes the varByRef type bit.

If A is not an array, VarArrayRef raises an EVariantError exception.


VarArrayUnlock procedure

See also	Example

Unlocks a Variant array.

Unit

System

Category

Variant support routines

procedure VarArrayUnlock(var A: Variant);

Description

VarArrayUnlock unlocks a Variant array that was previously locked by VarArrayLock. An EVariantError exception is raised if the Variant given by A is not an array.


VarAsType function

See also

Converts a Variant to specified type.

Unit

System

Category

Variant support routines

function VarAsType(const V: Variant; VarType: Integer): Variant;

Description

VarAsType converts the Variant given by V to the type given by VarType. The resulting value is a Variant of the type given by VarType. The VarType parameter must be one of the TVarData type codes, and cannot include the varArray or varByRef bits. An EVariantError exception is raised if the Variant cannot be converted to the given type.

VarCast provides the same functionality as VarAsType.


VarCast procedure

See also

Converts a Variant to a specified type, storing the result in a variable.

Unit

System

Category

Variant support routines

procedure VarCast(var Dest: Variant; const Source: Variant; VarType: Integer);

Description

VarCast converts the Variant given by Source to the type given by VarType and stores the resulting Variant in Dest. Dest can be a Variant or an OleVariant, and it must be possible to assign a value to Dest (it must be an lvalue). Source is defined as a Variant, but an OleVariant is also allowed because it is a compatible type. The VarType parameter must be one of the TVarData type codes, and cannot include the varArray or varByRef bits. An EVariantError exception is raised if the Variant cannot be converted to the given type.

The following table lists the expected behavior when using Variant and OleVariant types as parameters:

Dest 	Source	Behavior

Variant	OleVariant	Fine as is.

Variant	Variant	Fine as is.

OleVariant	OleVariant	OleVariants use WideStrings rather than Pascal strings.

OleVariant	Variant	OleVariants use WideStrings rather than Pascal strings.

The VarAsType function provides the same functionality as VarCast.


VarClear procedure

See also

Empties a Variant, so that it is unassigned.

Unit

System

Category

Variant support routines

procedure VarClear(var V : Variant);

Description

Calling VarClear is equivalent to assigning the Unassigned constant to the Variant. V can be either a Variant or an OleVariant, but it must be possible to assign a value to it (it must be an lvalue).

After calling VarClear, the VarIsEmpty function returns True, and the VarType function returns varEmpty. Using an unassigned variant in an expression causes an EVariantError exception to be raised. Likewise, if you attempt to convert an unassigned Variant to another type (using VarAsType or VarCast), an EVariantError exception is raised.

Note:	Do not confuse clearing a Variant, which leaves it unassigned, with assigning a Null value. A Null Variant is still assigned, but has the value Null. Unlike unassigned Variants, Null Variants can be used in expressions and can be converted to other types of Variants.


VarCopy procedure

Copies a Variant.

Unit

System

Category

Variant support routines

procedure VarCopy(var Dest: Variant; const Source: Variant);

Description

VarCopy copies the Variant given by Source into the Variant given by Dest. The call VarCopy(Dest, Source) is the same as writing Dest := Source.

Dest can be a Variant or an OleVariant, and it must be possible to assign a value to it (it must be an lvalue).

Source is defined as a Variant, but an OleVariant is also allowed because it is a compatible type.

The following table lists the expected behavior when using Variant and OleVariant types as parameters:

Dest 	Source	Behavior

Variant	OleVariant	Fine as is.

Variant	Variant	Fine as is.

OleVariant	OleVariant	Fine as is.

OleVariant	Variant	Source should be implicitly cast to an OleVariant.

Note:	Casts such as Variant(Integer) should fail. Casts of the form PVariant(@somevariable)^ will work.


VarFromDateTime function

See also

Returns a Variant containing a specified data and time.

Unit

System

Category

Variant support routines

function VarFromDateTime(DateTime: TDateTime): Variant;

Description

VarFromDateTime returns a Variant that represents the date and time of the given TDateTime value, DateTime. The type code of the resulting Variant is varDate.


VarIsArray function

See also

Indicates whether the specified Variant is an array.

Unit

System

Category

Variant support routines

function VarIsArray(const V: Variant): Boolean;

Description

VarIsArray returns True if the given Variant is an array. Otherwise, the function result is False.


VarIsEmpty function

See also

Indicates whether the specified Variant is unassigned.

Unit

System

Category

Variant support routines

function VarIsEmpty(const V: Variant): Boolean;

Description

VarIsEmpty returns True if the given Variant contains the value Unassigned. If the Variant contains any other value, the function result is False.

Note:	Do not confuse an unassigned Variant with a Null Variant. A Null Variant is still assigned, but has the value Null. Unlike unassigned Variants, Null Variants can be used in expressions and can be converted to other types of Variants.


VarIsNull function

See also

Indicates whether the specified Variant is Null.

Unit

System

Category

Variant support routines

function VarIsNull(const V: Variant): Boolean;

Description

VarIsNull returns True if the given Variant contains the value Null. If the Variant contains any other value, the function result is False.

Note:	Do not confuse a Null Variant with an unassigned Variant. A Null Variant is still assigned, but has the value Null. Unlike unassigned Variants, Null Variants can be used in expressions and can be converted to other types of Variants.


VarToDateTime function

See also

Converts a specified Variant to a TDateTime value.

Unit

System

Category

Variant support routines

function VarToDateTime(const V: Variant): TDateTime);

Description

VarToDateTime converts the given Variant to a TDateTime value. An EVariantError exception is raised if the conversion fails.


VarToStr function

Converts a Variant to a string.

Unit

System

Category

Variant support routines

function VarToStr(const V: Variant): string;

Description

VarToStr converts the data in the Variant V to a string.


VarType function

See also

Returns the type code of a specified Variant.

Unit

System

Category

Variant support routines

function VarType(const V: Variant): Integer;

Description

VarType returns the type code of the given Variant. The resulting value is constructed from the following constants declared in the System unit.

const

  varEmpty    = $0000;

  varNull     = $0001;

  varSmallint = $0002;

  varInteger  = $0003;

  varSingle   = $0004;

  varDouble   = $0005;

  varCurrency = $0006;

  varDate     = $0007;

  varOleStr   = $0008;

  varDispatch = $0009;

  varError    = $000A;

  varBoolean  = $000B;

  varVariant  = $000C;

  varUnknown  = $000D;

  varByte     = $0011;

  varStrArg   = $0048;

  varString   = $0100;

  varAny      = $0101;

  varTypeMask = $0FFF;

  varArray    = $2000;

  varByRef    = $4000;

The lower twelve bits of a Variant type code (the bits defined by the varTypeMask bit mask) define the type of the Variant. The varArray bit is set if the Variant is an array of the given type. The varByRef bit is set if the Variant is a reference to a value of the given type as opposed to an actual value.

The following table describes the meaning of each of the Variant type codes.

VarType	Contents of Variant

varEmpty	The Variant is Unassigned.

varNull	The Variant is Null.

varSmallint	16-bit signed integer (type Smallint).

varInteger	32-bit signed integer (type Integer).

varSingle	Single-precision floating-point value (type Single).

varDouble	Double-precision floating-point value (type Double).

varCurrency	Currency floating-point value (type Currency).

varDate	Date and time value (type TDateTime).

varOleStr	Reference to a dynamically allocated UNICODE string.

varDispatch	Reference to an Automation object (an IDispatch interface pointer).

varError	Operating system error code.

varBoolean	16-bit boolean (type WordBool).

varVariant	A Variant.

varUnknown	Reference to an unknown OLE object (an IUnknown interface pointer).

varByte	A Byte

varStrArg	COM-compatible string.

varString	Reference to a dynamically allocated string. (not COM compatible)

varAny	A CORBA Any value.

The value returned by VarType corresponds to the VType field of a TVarData record.

The type of a Variant can be changed using VarAsType or VarCast.


WideCharLenToString function

See also

Converts Unicode characters to single or multi byte character data.

Unit

System

Category

wide character routines

function WideCharLenToString(Source: PWideChar; SourceLen: Integer): string;

Description

WideCharLenToString converts SourceLen Unicode characters from the buffer given by Source to a string made up of single or multi byte characters. The function uses the WideCharToMultiByte Win32 API to perform the actual conversion.


WideCharLenToStrVar procedure

See also

WideCharLenToStrVar converts Unicode characters to single or multi byte character data.

Unit

System

Category

wide character routines

procedure WideCharLenToStrVar(Source: PWideChar; SourceLen: Integer; var Dest: string);

Description

The WideCharToStrVar procedure converts SourceLen WideChar (Unicode) characters from Source into single or multi byte character data, and copies the result into Dest.


WideCharToString function

See also

Converts null-terminated Unicode string to single or multi byte character data.

Unit

System

Category

wide character routines

function WideCharToString(Source: PWideChar): string;

Description

WideCharToString converts the given null-terminated Unicode string to a string made up of single or multi byte characters. The function uses the WideCharToMultiByte Win32 API to perform the actual conversion.


WideCharToStrVar procedure

See also

Converts Unicode string to a single or multi byte character data.

Unit

System

Category

wide character routines

procedure WideCharToStrVar(Source: PWideChar; var Dest: string);

Description

WideCharToStrVar converts UNICODE string Source into single or multi byte character data, and copies the result into Dest. The source must be null-terminated.


Write procedure

There are two versions of the standard procedure Write, one for text files, the other for typed files.

Write procedure for text files

Write procedure for typed files


Write procedure (for text files)

See also 	Example

Writes to a text file.

Unit

System

Category

text file routines

procedure Write( [var F: Text; ] P1 [ , P2,..., Pn] );

Description

Write writes one or more values to a text file. F, if specified, is a text file variable. If F is omitted, the standard file variable Output is assumed. Each P is a write parameter. Each write parameter includes an output expression whose value is to be written to the file. A write parameter can also contain the specifications of a field width and a number of decimal places. Each output expression must be of a type Char, one of the Integer types (Byte, Shortint, Word, Longint, Cardinal), one of the floating-point types (Single, Real, Double, Extended, Currency), one of the string types (PChar, AnsiString, ShortString), a packed string, or one of the Boolean types (Boolean, Bool).

A write parameter has the form

OutExpr [: MinWidth [: DecPlaces ] ]

where OutExpr is an output expression. MinWidth and DecPlaces are type integer expressions.

MinWidth specifies the minimum field width, which must be greater than 0. Exactly MinWidth characters are written (using leading blanks if necessary) except when OutExpr has a value that must be represented in more than MinWidth characters. In that case, enough characters are written to represent the value of OutExpr. Likewise, if MinWidth is omitted, then the necessary number of characters are written to represent the value of OutExpr.

DecPlaces specifies the number of decimal places in a fixed-point representation of one of the Real types. It can be specified only if OutExpr is one of the Real types, and if MinWidth is also specified. When MinWidth is specified, it must be greater than or equal to 0.

Write with a character-type value:

If MinWidth is omitted, the character value of OutExpr is written to the file. Otherwise, MinWidth - 1 blanks followed by the character value of OutExpr is written.

Write with one of the integer type values:

If MinWidth is omitted, the decimal representation of OutExpr is written to the file with no preceding blanks. If MinWidth is specified and its value is larger than the length of the decimal string, enough blanks are written before the decimal string to make the field width MinWidth.

Write with one of the real type values:

If OutExpr has one of the real type values, its decimal representation is written to the file. The format of the representation depends on the presence or absence of DecPlaces.

If DecPlaces is omitted (or if it's present but has a negative value), a floating-point decimal string is written. If MinWidth is also omitted, a default MinWidth of 17 is assumed; otherwise, if MinWidth is less than 8, it's assumed to be 8. The format of the floating-point string is

[   | - ] <digit> . <decimals> E [ + | - ] <exponent>

The following table lists the components of the output string.

Component	Meaning

 [  | - ]	" " or "-", according to the sign of OutExpr

<digit> 	Single digit, "0" only if OutExpr is 0

<decimals> 	Digit string of MinWidth-7 (but at most 10) digits

E 	Uppercase [E] character

[ + | - ] 	According to sign of exponent

<exponent> 	Two-digit decimal exponent

If DecPlaces is present, a fixed-point decimal string is written. If DecPlaces is larger than 11, it's assumed to be 11. The format of the fixed-point string follows:

[ <blanks> ] [ - ] <digits> [ . <decimals> ]

The following table lists the components of the fixed-point string.

Component	Meaning

[ <blanks> ] 	Blanks to satisfy MinWidth

[ - ]	If OutExpr is negative

 <digits> 	At least one digit, but no leading zeros

[ . <decimals> ]	Decimals if DecPlaces > 0

Write with one of the string-type values:

If MinWidth is omitted, the string value of OutExpr is written to the file with no leading blanks. If MinWidth is specified, and its value is larger than the length of OutExpr, enough blanks are written before the decimal string to make the field width MinWidth.

Write with a packed string-type value:

If OutExpr is of packed string type, the effect is the same as writing a string whose length is the number of elements in the packed string type.

Write with one of the Boolean type values:

If OutExpr is of type Boolean, the effect is the same as writing the strings True or False, depending on the value of OutExpr.

Note:	When using Write the file must be open for output.


Write procedure (for typed files)

See also

Writes to a typed file.

Unit

System

Category

I/O routines

procedure Write(F, V1,...,Vn);

Description

Write writes a file to a file component. F is a file variable, and each V is a variable of the same type as the component type of F. For each variable written, the current file position is advanced to the next component. If the current file position is at the end of the file (that is, if Eof(F) is True), the file is expanded.


Writeln procedure

See also	Example

Writes an end-of-line marker to a text file.

Unit

System

Category

text file routines

procedure Writeln([ var F: Text; ] P1 [, P2, ...,Pn ] );

Description

Writeln is an extension to the Write procedure, as it is defined for text files.

After executing Write, Writeln writes an end-of-line marker (carriage-return/linefeed) to the file. Writeln(F) with no parameters writes an end-of-line marker to the file. (Writeln with no parameter list corresponds to Writeln(Output).)

The file must be open for output.

Note:	When an application is compiled as a console application (using the Generate console application checkbox on the Linker page of the Project|Options dialog, or a -cc command line switch with the command-line compiler), Delphi automatically associates the Input and Output files with the application's console window. For non-console applications, any attempt to read from Input or write to Output will generate an I/O error.


Abort procedure

See also	Example

Ends the current process without reporting an error.

Unit

Sysutils

Category

flow control routines

procedure Abort;

Description

Use Abort to escape from an execution path without reporting an error.

Abort raises a special "silent exception" (EAbort), which operates like any other exception, but does not display an error message to the end user.  Abort redirects execution to the end of the last try .. finally block.


AddExitProc procedure

Provided for backward compatibility only.

Unit

Sysutils

Category

backward compatibility routines

procedure AddExitProc(Proc: TProcedure);

Description

AddExitProc should not be used in current veresions of Delphi. Instead, use the finalization section of a unit. AddExitProc is not compatible with packages.

Note:	In previous versions of Delphi, AddExitProc was used to add the given procedure, Proc, to the run-time library's exit procedure list. When an application terminated, the last procedure passed to AddExitProc became the first one to get executed upon termination.


AddTerminateProc procedure

See also

Adds a terminate procedure to the system list of termination procedures.

Unit

Sysutils

Category

termination procedure support

procedure AddTerminateProc(TermProc: TTerminateProc);

Description

Call AddTerminateProc to add a procedure that should be called when the application is about to terminate. Delphi calls all of the termination procedures before the application can terminate.  The supplied termination procedure (TermProc) should return True if the application can safely terminate or False if the application cannot safely terminate. If any of the functions in the termination procedure list returns False, the application will not terminate.


AdjustLineBreaks function

See also

Standardizes line break characters to CR/LF.

Unit

Sysutils

Category

string handling routines

function AdjustLineBreaks(const S: string): string;

Description

AdjustLineBreaks adjusts all line breaks in the given string S to be true CR/LF sequences. The function changes any CR characters not followed by a LF and any LF characters not preceded by a CR into CR/LF pairs. It also converts LF/CR pairs to CR/LF pairs. The LF/CR pair is common in Unix text files.


AllocMem function

See also

Allocates a memory block and initializes each byte to zero.

Unit

Sysutils

Category

memory management routines

function AllocMem(Size: Cardinal): Pointer;

Description

AllocMem allocates a block of the given size on the heap. Each byte in the allocated buffer is set to zero. To dispose the buffer, use FreeMem.


AnsiCompareFileName function

See also

Compares file names based on the current locale.

Unit

Sysutils

Category

MBCS utilities

function AnsiCompareFileName(const S1, S2: string): Integer;

Description

AnsiCompareFileName compares S1 to S2, without case sensitivity. The currently installed language driver controls the compare operation. The return value is:

Condition	Return Value

S1 > S2	> 0

S1 < S2	< 0

S1 = S2	= 0

Note:	AnsiCompareFileName supports DOS file name comparison idiosyncrasies in Asian locales (Zenkaku).  When working with locales that do not use a multi byte character system (MBCS), AnsiCompareFileName is identical to AnsiCompareText.  For general-purpose file name comparisons, use this function instead of AnsiCompareText.


AnsiCompareStr function

See also

Compares strings based on the current Windows locale with case sensitivity.

Unit

Sysutils

Category

string handling routines

function AnsiCompareStr(const S1, S2: string): Integer;

Description

AnsiCompareStr compares S1 to S2, with case sensitivity. The compare operation is controlled by the current Windows locale. The return value is:

Condition	Return Value
S1 > S2	> 0
S1 < S2	< 0
S1 = S2	= 0
Note:	Most Windows locales consider lowercase characters to be less than the corresponding uppercase characters.  This is in contrast to ASCII order, in which lowercase characters are greater than uppercase characters.  Thus,

AnsiCompareStr('a','A')

returns a value less than zero, while

CompareStr('a','A')

returns a value greater than zero.


AnsiCompareText function

See also

Compares strings based on the current Windows locale without case sensitivity.

Unit

Sysutils

Category

string handling routines

function AnsiCompareText(const S1, S2: string): Integer;

Description

AnsiCompareText compares S1 to S2, without case sensitivity. The compare operation is controlled by the current Windows locale. AnsiCompareText returns a value less than 0 if S1 < S2, a value greater than 0 if S1 > S2, and returns 0 if S1 = S2.


AnsiExtractQuotedStr function

See also

Converts a quoted string into an unquoted string.

Unit

Sysutils

Category

string handling routines

function AnsiExtractQuotedStr(var Src: PChar; Quote: Char): string;

Description

AnsiExtractQuotedStr removes the quote characters from the beginning and end of a quoted string, and reduces pairs of quote characters within the string to a single quote character. The Quote parameter defines what character to use as a quote character. If the first character in Src is not the value of the Quote parameter, AnsiExtractQuotedStr returns an empty string.

The function copies characters from Src to the result string until the second solitary quote character or the first null character in Src. The Src parameter is updated to point to the first character following the quoted string.  If Src does not contain a matching end quote character, the Src parameter is updated to point to the terminating null character.

Note:	This function supports multi-byte character sets (MBCS).


AnsiLastChar function

See also

Returns a pointer to the last character in a string.

Unit

Sysutils

Category

MBCS utilities

function AnsiLastChar(const S: string): PChar;

Description

Call AnsiLastChar to obtain locate the last character in a string. This function supports multi-byte character sets (MBCS).


AnsiLowerCase function

See also

Returns a string that is a copy of the given string converted to lower case.

Unit

Sysutils

Category

string handling routines

function AnsiLowerCase(const S: string): string;

Description

AnsiLowerCase returns a string that is a copy of the given string converted to lower case. The conversion uses the current Windows locale. This function supports multi-byte character sets (MBCS).


AnsiLowerCaseFileName function

See also

Converts a file name to lower case.

Unit

Sysutils

Category

MBCS utilities

function AnsiLowerCaseFileName(const S: string): string;

Description

AnsiLowerCaseFileName returns a string that is a copy of S converted to lower case. The conversion uses the currently installed language driver.

AnsiLowerCaseFileName supports lowercase conversion idiosyncrasies of DOS file names in Asian locales (Zenkaku).  In locales that do not use multi byte character systems (MBCS), AnsiLowerCaseFileName is identical to AnsiLowerCase.


AnsiPos function

See also

Locates the position of a sub-string within a string.

Unit

Sysutils

Category

string handling routines

function AnsiPos(const Substr, S: string): Integer;

Description

Call AnsiPos to obtain the byte offset of the Substr parameter, as it appears in the string S. For example, if Substr is the string 'AB', and S is the string 'ABCDE', AnsiPos returns 1. If Substr does not appear in S, AnsiPos returns 0.

Note:	This function supports multi-byte character sets (MBCS).


AnsiQuotedStr function

See also

Returns the quoted version of a string.

Unit

Sysutils

Category

string handling routines

function AnsiQuotedStr(const S: string; Quote: Char): string;

Description

Use AnsiQuotedStr to convert a string (S) to a quoted string, using the provided Quote character.  A Quote character is inserted at the beginning and end of S, and each Quote character in the string is doubled.

Note:	This function supports multi-byte character sets (MBCS).


AnsiSameStr function

See also

Compares strings based on the current Windows locale with case sensitivity.

Unit

Sysutils

Category

string handling routines

function AnsiSameStr(const S1, S2: string): Boolean;

Description

AnsiSameStr compares S1 to S2, with case sensitivity. The compare operation is controlled by the current Windows locale. The return value is True if the two strings have the same value, False otherwise.


AnsiSameText function

See also

Compares strings based on the current Windows locale without case sensitivity.

Unit

Sysutils

Category

string handling routines

function AnsiSameText(const S1, S2: string): Boolean;

Description

AnsiSameText compares S1 to S2, without case sensitivity. The compare operation is controlled by the current Windows locale. The return value is True if the two strings have the same value, False otherwise.


AnsiStrComp function

See also

Compares null-terminated character strings case sensitively.

Unit

Sysutils

Category

string handling routines (null-terminated)

function AnsiStrComp(S1, S2: PChar): Integer;

Description

AnsiStrComp compares S1 to S2, with case sensitivity. The compare operation is controlled by the current Windows locale. The return value is:

Condition	Return Value

S1 > S2	> 0

S1 < S2	< 0

S1 = S2	= 0

Note:	Most Windows locales consider lowercase characters to be less than the corresponding uppercase characters.  This is in contrast to ASCII order, in which lowercase characters are greater than uppercase characters.

Note:	This function supports multi-byte character sets (MBCS).


AnsiStrIComp function

See also

Compares null terminated character strings case insensitively.

Unit

Sysutils

Category

string handling routines (null-terminated)

function AnsiStrIComp(S1, S2: PChar): Integer;

Description

AnsiStrIComp compares S1 to S2, without case sensitivity. The compare operation is controlled by the current Windows locale. The return value is the same as for CompareStr.

Note:	This function supports multi-byte character sets (MBCS).


AnsiStrLastChar function

See also

Returns a pointer to the last character in a null-terminated string.

Unit

Sysutils

Category

MBCS utilities

function AnsiStrLastChar(P: PChar): PChar;

Description

Call AnsiStrLastChar to obtain a pointer to the last full character in a null-terminated sequence. When working with multi-byte character sets (MBCS), the last character will not be the same as the last Char if the last two bytes (Chars) represent a single double byte character.


AnsiStrLComp function

See also

Compares the first MaxLen bytes of two null-terminated strings, case-sensitively.

Unit

Sysutils

Category

string handling routines (null-terminated)

function AnsiStrLComp(S1, S2: PChar; MaxLen: Cardinal): Integer;

Description

AnsiStrLComp compares S1 to S2, with case sensitivity. If S1 or S2 is longer than MaxLen bytes, AnsiStrLComp only compares the first MaxLen bytes. The compare operation is controlled by the current Windows locale. The return value is:

Condition	Return Value

S1 > S2	> 0

S1 < S2	< 0

S1 = S2 (up to MaxLen characters)	= 0

Note:	This function supports multi-byte character sets (MBCS).

Note:	AnsiStrLComp can continue the comparison beyond a null terminating character if S1 and S2 are equal up to a null character and the null character occurs before MaxLen bytes.

Note:	Most Windows locales consider lowercase characters to be less than the corresponding uppercase characters.  This is in contrast to ASCII order, in which lowercase characters are greater than uppercase characters.


AnsiStrLIComp function

See also

Compares two strings, case-insensitively, up to the first MaxLen bytes.

Unit

Sysutils

Category

string handling routines (null-terminated)

function AnsiStrLIComp(S1, S2: PChar; MaxLen: Cardinal): Integer;

Description

AnsiStrLIComp compares S1 to S2, without case sensitivity. If S1 or S2 is longer than MaxLen characters, AnsiStrLIComp only compares up to the first MaxLen characters. The compare operation is controlled by the current Windows locale. The return value is:

Condition	Return Value

S1 > S2	> 0

S1 < S2	< 0

S1 = S2 (up to MaxLen characters)	= 0

Note:	This function supports multi-byte character sets (MBCS).

Note:	AnsiStrLIComp can continue the comparison beyond a null terminating character if S1 and S2 are equal up to a null character and the null character occurs before MaxLen bytes.


AnsiStrLower function

See also

Converts all characters in a null-terminated string to lower case.

Unit

Sysutils

Category

string handling routines (null-terminated)

function AnsiStrLower(Str: PChar): PChar;

Description

AnsiStrLower returns a null-terminated character sequence where all characters are lower case. The conversion uses the current Windows locale.

Note:	This function supports multi-byte character sets (MBCS).


AnsiStrPos function

See also

Returns a pointer to the first occurrence of SubStr in Str.

Unit

Sysutils

Category

string handling routines (null-terminated)

function AnsiStrPos(Str, SubStr: PChar): PChar;

Description

Call AnsiStrPos to locate the first occurrence of SubStr in Str. If SubStr does not occur in Str, AnsiStrPos returns nil.

Unlike the StrPos function, AnsiStrPos works with multi-byte characters sets (MBCS).


AnsiStrRScan function

See also

Returns a pointer to the last occurrence of a specified character in a specified string.

Unit

Sysutils

Category

string handling routines (null-terminated)

function AnsiStrRScan(Str: PChar; Chr: Char): PChar;

Description

Call AnsiStrRScan to obtain a pointer to the last occurrence of Chr in Str. If Chr does not occur in Str, AnsiStrRScan returns nil. The null terminator is considered to be part of the string.

Unlike the StrRScan function, AnsiStrRScan works with multi-byte character systems (MBCS).


AnsiStrScan function

See also

Returns a pointer to first occurrence of a character in a string.

Unit

Sysutils

Category

string handling routines (null-terminated)

function AnsiStrScan(Str: PChar; Chr: Char): PChar;

Description

Call AnsiStrScan to obtain a pointer to the first occurrence of Chr in Str. If Chr does not occur in Str, AnsiStrScan returns nil. The null terminator is considered to be part of the string.

Unlike the StrScan function, AnsiStrScan works with multi-byte character systems (MBCS).


AnsiStrUpper function

See also

Converts all characters in a null-terminated string to upper case.

Unit

Sysutils

Category

string handling routines (null-terminated)

function AnsiStrUpper(Str: PChar): PChar;

Description

AnsiStrUpper returns a null-terminated string where all characters are upper case. The conversion uses the current Windows locale.

Note:	This function supports multi-byte character sets (MBCS).


AnsiUpperCase function

See also

Converts a string to upper case.

Unit

Sysutils

Category

string handling routines

function AnsiUpperCase(const S: string): string;

Description

AnsiUpperCase returns a string that is a copy of S, converted to upper case. The conversion uses the current Windows locale.

Note:	This function supports multi-byte character sets (MBCS).


AnsiUpperCaseFileName function

See also

Converts a file name to upper case.

Unit

Sysutils

Category

MBCS utilities

function AnsiUpperCaseFileName(const S: string): string;

Description

AnsiUpperCaseFileName returns a string that is a copy of S converted to upper case. The conversion uses the currently installed language driver.

AnsiUpperCaseFileName supports uppercase conversion idiosyncrasies of DOS file names in Asian locales (Zenkaku).  In locales that do not use multi byte character systems (MBCS), AnsiUpperCaseFileName is identical to AnsiUpperCase.


AppendStr procedure

Appends a dynamically allocated string to an existing string.

Unit

Sysutils

Category

backward compatibility routines

procedure AppendStr(var Dest: string; const S: string);

Description

AppendStr appends S to the end of Dest. It is provided for backwards compatibility only. Use

Dest := Dest + S;

instead.


AssignStr procedure

See also

Assigns a new dynamically allocated string to a specified pointer.

Unit

Sysutils

Category

backward compatibility routines

procedure AssignStr(var P: PString; const S: string);

Description

Do not use AssignStr in new applications.  It is provided for backward compatibility only.


Beep procedure

Generates a standard beep using the computer speaker.

Unit

Sysutils

Category

miscellaneous routines

procedure Beep;

Description

Beep calls the Windows API MessageBeep.


BeginThread function

See also

Spawns a separate thread of execution.

Unit

Sysutils

Category

thread management routines

function BeginThread(SecurityAttributes: Pointer; StackSize: LongWord; ThreadFunc: TThreadFunc; Parameter: Pointer; CreationFlags: LongWord; var ThreadId: LongWord): Integer;

Description

Use this routine or a TThread object to spawn separate threads of execution instead of calling the CreateThread Win32API directly. BeginThread encapsulates the Win32 CreateThread API call, but unlike CreateThread, it sets the global IsMultiThread variable, thereby making the heap thread-safe.

BeginThread takes a normal Pascal function as the thread function. Thread functions should handle all of their own exceptions. BeginThread sets up an exception frame that allows the system's default exception handler to catch any of the thread's exceptions that have not been handled.

Note:	The application is terminated if there are any unhandled exceptions in the thread function.


ByteToCharIndex function

See also

Returns the position of the character that contains a specified byte in a string.

Unit

Sysutils

Category

MBCS utilities

function ByteToCharIndex(const S: string; Index: Integer): Integer;

Description

Call ByteToCharIndex to determine which character contains a particular byte in a string, where 1 specifies the first byte, 2 specifies the second byte, and so on. If the Index parameter specifies a byte that is not in the AnsiString (Index < 0 or Index > Length(S)), ByteToCharIndex returns 0.

If the system does not use a multi-byte character system (MBCS), ByteToCharIndex simply returns the value of Index, because there is a 1:1 correspondence between bytes and characters. Otherwise, ByteToCharIndex returns the position of the character, where 1 specifies the first character, 2 specifies the second character, and so on.

For example, if an AnsiString contains two characters, a single-byte character followed by a double byte character, then ByteToCharIndex returns 1 when Index is 1, it returns 2 when Index is 2 or 3, and it returns 0 for any other value of Index.


ByteToCharLen function

See also

Returns the number of characters fully contained in the first MaxLen bytes of a string.

Unit

Sysutils

Category

MBCS utilities

function ByteToCharLen(const S: string; MaxLen: Integer): Integer;

Description

Call ByteToCharLen to determine the number of characters represented by a portion of a string. ByteToCharLen counts characters until it reaches MaxLen bytes or the end of the string, whichever comes first.

When working with multi-byte character systems (MBCS), the value returned by ByteToCharLen may be less than MaxLen or the length of the string.

Note:	ByteToCharLen will count a partial character if it appears as the last of the first MaxLen bytes.


ByteType function

See also

Indicates whether a byte in a string is a single byte character, the first byte of a double byte character, or the second byte of a double byte character.

Unit

Sysutils

Category

MBCS utilities

function ByteType(const S: string; Index: Integer): TMbcsByteType;

Description

Call ByteType to determine the type of the byte specified by the Index parameter, where 0 specifies the first byte in S, 1 specifies the second byte, and so on.

If the system is not using a multi-byte character system (MBCS), ByteType always returns mbSingleByte. Otherwise, ByteType returns mbSingleByte if the indicated byte represents a complete character in S, mbLeadByte if it represents the first byte of a double byte character, and mbTrailByte if it represents the second byte of a double byte character.

Note:	No checking is done to ensure that Index is less than the length of S. It is the caller's responsibility to ensure that Index is not out of bounds.


CallTerminateProcs function

See also

Calls all of the functions in the termination procedure list.

Unit

Sysutils

Category

termination procedure support

function CallTerminateProcs: Boolean;

Description

CallTerminateProcs is called internally when an application is about to terminate.  It returns True only if all of the functions in the application's terminate procedure list return True.  This function is intended only to be called by Delphi. Do not call it directly.


ChangeFileExt function

See also 	Example

Changes the extension of a file name.

Unit

Sysutils

Category

file name utilities

function ChangeFileExt(const FileName, Extension: string): string;

Description

ChangeFileExt takes the file name passed in FileName and changes the extension of the file name to the extension passed in Extension.  ChangeFileExt does not rename the actual file, it just creates a new file name string.

Note:	This function works with multi-byte character sets (MBCS).


CharToByteIndex function

See also

Returns the 1-based index of the first byte of a specified character in a string.

Unit

Sysutils

Category

MBCS utilities

function CharToByteIndex(const S: string; Index: Integer): Integer;

Description

Call CharToByteIndex to obtain the byte offset for the character at a specified position in the string S, where 1 specifies the first character, 2 specifies the second character, and so on. CharToByteIndex returns zero if Index is out of range (Index <= 0 or S contains fewer than Index characters). If the Index parameter indicates a double-byte character, CharToByteIndex returns the offset of the first byte.

If the system is not using a multi-byte character system (MBCS), CharToByteIndex returns the value of Index, because there is a 1:1 correspondence between bytes and characters.


CharToByteLen function

See also

Returns the length, in bytes, of the first MaxLen characters of a string.

Unit

Sysutils

Category

MBCS utilities

function CharToByteLen(const S: string; MaxLen: Integer): Integer;

Description

Call CharToByteLen to convert the length of a string in characters to the corresponding length in bytes. CharToByteLen returns the number of bytes required by the first MaxLen characters of S. If S contains fewer than MaxLen characters, CharToByteLen returns the byte length of S.

If the system is not using a multi-byte character system (MBCS), CharToByteLen returns the length of S or MaxLen, whichever is smaller.


CompareMem function

See also

Performs a binary comparison of two memory images.

Unit

Sysutils

Category

miscellaneous routines

function CompareMem(P1, P2: Pointer; Length: Integer): Boolean; assembler;

Description

CompareMem performs a binary compare of Length bytes of memory referenced by P1 to that of P2.  CompareMem returns True if the memory referenced by P1 is identical to that of P2.


CompareStr function

See also 	Example

Compares two strings case sensitively.

Unit

Sysutils

Category

string handling routines

function CompareStr(const S1, S2: string): Integer;

Description

CompareStr compares S1 to S2, with case-sensitivity. The return value is less than 0 if S1 is less than S2, 0 if S1 equals S2, or greater than 0 if S1 is greater than S2. The compare operation is based on the 8-bit ordinal value of each character and is not affected by the current Windows locale.


CompareText function

See also	Example

Compares two strings by ordinal value without case sensitivity.

Unit

Sysutils

Category

string handling routines

function CompareText(const S1, S2: string): Integer;

Description

CompareText compares S1 and S2 and returns 0 if they are equal. If S1 is greater than S2, CompareText returns an integer greater than 0. If S1 is less than S2, CompareText returns an integer less than 0. CompareText is not case sensitive and is not affected by the current Windows locale.

Thus for example, CompareText will indicate that the string

ABC

is less than

aaa

because A is less than a in ascii order. This is in contrast to a case-insensitive comparison, where the B would make the first string larger, or a locale-based comparison (most locales consider capital letters larger than small).


CreateDir function

See also	Example

Creates a new directory.

Unit

Sysutils

Category

file management routines

function CreateDir(const Dir: string): Boolean;

Description

CreateDir creates a new directory. The return value is True if a new directory was successfully created, or False if an error occurred.


Currency and date/time formatting variables

See also 	Example

Influence the way numeric or date/time values are formatted.

Unit

Sysutils

The following are a set of variables used to define the format for numeric or date/time strings:

var CurrencyString: string;

var CurrencyFormat: Byte;

var NegCurrFormat: Byte;

var ThousandSeparator: Char;

var DecimalSeparator: Char;

var CurrencyDecimals: Byte;

var DateSeparator: Char;

var ShortDateFormat: string;

var LongDateFormat: string;

var TimeSeparator: Char;

var TimeAMString: string;

var TimePMString: string;

var ShortTimeFormat: string;

var LongTimeFormat: string;

var ShortMonthNames: array[1..12] of string;

var LongMonthNames: array[1..12] of string;

var ShortDayNames: array[1..7] of string;

var LongDayNames: array[1..7] of string;

var SysLocale: TSysLocale;

var EraNames: array[1..7] of string;

var EraYearOffsets: array[1..7] of Integer;

var TwoDigitYearCenturyWindow: Word = 50;

var TListSeparator: Char;

Description

The Sysutils unit includes a number of variables that are used by various formatting routines. Values are assigned to these variables to define the formats of numeric and date/time strings. The initial values of these variables are fetched from the system registry using the GetLocaleInfo function in the Win32 API. VCL (non-console) applications automatically update these formatting variables in response to WM_WININICHANGE messages. The Application variable’s UpdateFormatSettings method either allows or disallows changes in system settings. The default is True. Set this property to False to prevent the system settings from changing.

The description of each variable specifies the LOCALE_XXXX constant used to fetch the initial value using the GetLocaleInfo Win32 API.

Typed constant	Defines

CurrencyString	CurrencyString defines the currency symbol (or characters) used in floating-point to decimal conversions. The initial value is fetched from LOCALE_SCURRENCY.

CurrencyFormat	CurrencyFormat defines the currency symbol placement and separation used in floating-point–to–decimal conversions. Possible values are:
0 = $1
1 = 1$
2 = $ 1
3 = 1 $
The initial value is fetched from LOCALE_ICURRENCY.

NegCurrFormat	NegCurrFormat defines the currency format used in floating-point to decimal conversions of negative numbers. Possible values are:
0 = ($1)    4 = (1$)    8 = -1 $     12 = $ -1
1 = -$1     5 = -1$     9 = -$ 1     13 = 1- $
2 = $-1     6 = 1-$    10 = 1 $-    14 = ($ 1)
3 = $1-     7 = 1$-    11 = $ 1-    15 = (1 $)
The initial value is fetched from LOCALE_INEGCURR.

ThousandSeparator	ThousandSeparator is the character used to separate thousands in numbers with more than three digits to the left of the decimal separator. The initial value is fetched from LOCALE_STHOUSAND.

DecimalSeparator	DecimalSeparator is the character used to separate the integer part from the fractional part of a number. The initial value is fetched from LOCALE_SDECIMAL.

CurrencyDecimals	CurrencyDecimals is the number of digits to the right of the decimal point in a currency amount. The initial value is fetched from LOCALE_ICURRDIGITS.

DateSeparator	DateSeparator is the character used to separate the year, month, and day parts of a date value. The initial value is fetched from LOCATE_SDATE.

ShortDateFormat	ShortDateFormat is the format string used to convert a date value to a short string suitable for editing. For a complete description of date and time format strings, see the documentation for the FormatDateTime function. The short date format should only use the date separator character and the  m, mm, d, dd, yy, and yyyy format specifiers. The initial value is fetched from LOCALE_SSHORTDATE..

LongDateFormat	LongDateFormat is the format string used to convert a date value to a long string suitable for display but not for editing. For a complete description of date and time format strings, see the documentation for the FormatDateTime function. The initial value is fetched from LOCALE_SLONGDATE.

TimeSeparator	TimeSeparator is the character used to separate the hour, minute, and second parts of a time value. The initial value is fetched from LOCALE_STIME.

TimeAMString	TimeAMString is the suffix string used for time values between 00:00 and 11:59 in 12-hour clock format. The initial value is fetched from LOCALE_S1159.

TimePMString	TimePMString is the suffix string used for time values between 12:00 and 23:59 in 12-hour clock format. The initial value is fetched from LOCALE_S2359.

ShortTimeFormat	ShortTimeFormat is the format string used to convert a time value to a short string with only hours and minutes. The default value is computed from LOCALE_ITIME and LOCALE_ITLZERO.

LongTimeFormat	LongTimeFormat is the format string used to convert a time value to a long string with hours, minutes, and seconds. The default value is computed from LOCALE_ITIME and LOCALE_ITLZERO.

ShortMonthNames	ShortMonthNames is the array of strings containing short month names. The mmm format specifier in a format string passed to FormatDateTime causes a short month name to be substituted. The default values are fetched from the LOCALE_SABBREVMONTHNAME system locale entries.

LongMonthNames	LongMonthNames is the array of strings containing long month names. The mmmm format specifier in a format string passed to FormatDateTime causes a long month name to be substituted. The default values are fetched from the LOCALE_SMONTHNAME system locale entries.

ShortDayNames	ShortDayNames is the array of strings containing short day names. The ddd format specifier in a format string passed to FormatDateTime causes a short day name to be substituted. The default values are fetched from the LOCALE_SABBREVDAYNAME system locale entries.

LongDayNames	LongDayNames is the array of strings containing long day names. The dddd format specifier in a format string passed to FormatDateTime causes a long day name to be substituted. The default values are fetched from the LOCALE_SDAYNAME system locale entries.

SysLocale	Indicates the locale used by FormatDateTime to interpret dates.

EraName	Controls the DateTimeToStr function (for East Asian locales).

EraYearOffsets	Controls the DateTimeToStr function (for East Asian locales).

TwoDigitYearCenturyWindow	Determines what century is added to two-digit years when string dates are converted to numeric dates with StrToDate or StrToDateTime. The value of TwoDigitYearCenturyWindow, if it is nonzero, is subtracted from the current year to calculate the floating “pivot” prior to which two-digit years are interpreted as falling in the next century. The default value is 50. You can use TwoDigitYearCenturyWindow to extend the life of legacy applications that are tied to two-digit-year data entry; but the best solution is to require four-digit input for years.

ListSeparator	The character used to separate items in a list. The default value is fetched from LOCALE_SLIST.


CurrToStr function

See also

Formats a Currency value as a string.

Unit

Sysutils

Category

numeric formatting routines

function CurrToStr(Value: Currency): string;

Description

CurrToStr converts the Currency value given by Value to its string representation. The conversion uses the ffGeneral floating point conversion rules.


CurrToStrF function

See also

Converts a Currency value to a string, using a specified format.

Unit

Sysutils

Category

numeric formatting routines

function CurrToStrF(Value: Currency; Format: TFloatFormat; Digits: Integer): string;

Description

CurrToStrF converts the Currency value given by Value to its string representation using the indicated float format convention. A call to CurrToStrF corresponds to a call to FloatToStrF with an implied precision of 19 digits.


Date function

See also	Example

Returns the current date.

Unit

Sysutils

Category

date/time routines

function Date: TDateTime;

Description

Use Date to obtain the current date as a TDateTime value.


DateDelta constant

See also

Specifies the correction factor when computing the difference between two date and time types that do not begin in the same year.

Unit

Sysutils

Category

date/time routines

const DateDelta = 693594;

Description

DateDelta is number of days between 1/1/0001 and 12/31/1899. It is used to allow arithmetic comparisons of date and time types that do not begin in the same year.

TDateTime begins with 12/31/1899, whereas TTimeStamp begins with 1/1/0001. Thus, DateDelta is the correction is for the number of days that have already passed.


DateTimeToFileDate function

See also

Converts a TDateTime object to a DOS date-and-time value.

Unit

Sysutils

Category

date/time routines

function DateTimeToFileDate(DateTime: TDateTime): Integer;

Description

Use DateTimeToFileDate to convert a TDateTime value, which is the representation of date-and-time values used by the VCL, to a DOS date-and-time value.

For example, use DateTimeToFileDate to convert a TDateTime value to a format that can be used as the Age parameter of FileSetDate. You may also need to use DateTimeToFileDate to convert a TDateTime so that it is compatible with the Time field of the TSearchRec record used by the FindFirst and FindNext functions.


DateTimeToStr function

See also	Example

Converts a TDateTime value to a string.

Unit

Sysutils

Category

date/time routines

function DateTimeToStr(DateTime: TDateTime): string;

Description

DateTimeToString converts the TDateTime value given by DateTime using the format given by the ShortDateFormat global variable, followed by the time using the format given by the LongTimeFormat global variable. The time is not displayed if the fractional part of the DateTime value is zero.

To change how the string is formatted, change ShortDateFormat and LongTimeFormat global date time formatting variables.


DateTimeToString procedure

See also

Converts a TDateTime value to a string using a specified Format.

Unit

Sysutils

Category

date/time routines

procedure DateTimeToString(var Result: string; const Format: string; DateTime: TDateTime);

Description

DateTimeToString converts the TDateTime value given by DateTime using the format string given by Format into the string variable given by Result. For Formats supported, refer to FormatDateTime.


DateTimeToSystemTime procedure

See also

Converts a TDateTime value into the Win32 API's TSystemTime type.

Unit

Sysutils

Category

date/time routines

procedure DateTimeToSystemTime(DateTime: TDateTime; var SystemTime: TSystemTime);

Description

Use DateTimeToSystemTime to convert a TDateTime value into a TSystemTime value to use with a Windows 32 API call.


DateTimeToTimeStamp function

See also

Converts a TDateTime value into the corresponding TTimeStamp value.

Unit

Sysutils

Category

date/time routines

function DateTimeToTimeStamp(DateTime: TDateTime): TTimeStamp;

Description

Call DateTimeToTimeStamp to convert a TDateTime value into a TTimeStamp value. TDateTime represents time as the number of days (including fractional days) that have elapsed since 12:00 AM on December 30, 1899. TTimeStamp represents time as separate date and time values, where the date is the number of calendar days since the start of the current calendar (that is, January 1, 0001 would have a value of 1), and time is the number of milliseconds since midnight.


DateToStr function

See also	Example

Converts a TDateTime value to a string.

Unit

Sysutils

Category

date/time routines

function DateToStr(Date: TDateTime): string;

Description

Use DateToStr to obtain a string representation of a date value that can be used for display purposes. The conversion uses the format specified by the ShortDateFormat global variable.


DayOfWeek function

See also	Example

Returns the day of the week for a specified date.

Unit

Sysutils

Category

date/time routines

function DayOfWeek(Date: TDateTime): Integer;

Description

DayOfWeek returns the day of the week of the specified date as an integer between 1 and 7, where Sunday is the first day of the week and Saturday is the seventh.


DecodeDate procedure

See also	Example

Returns Year, Month, and Day values for a TDateTime value.

Unit

Sysutils

Category

date/time routines

procedure DecodeDate(Date: TDateTime; var Year, Month, Day: Word);

Description

The DecodeDate procedure breaks the value specified as the Date parameter into Year, Month, and Day values. If the given TDateTime value is less than or equal to zero, the year, month, and day return parameters are all set to zero.


DecodeTime procedure

See also	Example

Breaks a TDateTime value into hours, minutes, seconds, and milliseconds.

Unit

Sysutils

Category

date/time routines

procedure DecodeTime(Time: TDateTime; var Hour, Min, Sec, MSec: Word);

Description

DecodeTime breaks the object specified as the Time parameter into hours, minutes, seconds, and milliseconds.


DeleteFile function

Example

Deletes a file from disk.

Unit

Sysutils

Category

file management routines

function DeleteFile(const FileName: string): Boolean;

Description

DeleteFile erases the file named by FileName from the disk. If the file cannot be deleted or does not exist, the function returns False.


DiskFree function

See also	Example

Returns the number of free bytes on a specified drive.

Unit

Sysutils

Category

file management routines

function DiskFree(Drive: Byte): Int64;

Description

DiskFree returns the number of free bytes on the specified drive, where 0 = Current, 1 = A, 2 = B, and so on.

DiskFree returns -1 if the drive number is invalid.


DiskSize function

See also	Example

Returns the size, in bytes, of a specified drive.

Unit

Sysutils

Category

file management routines

function DiskSize(Drive: Byte): Int64;

Description

DiskSize returns the size in bytes of the specified drive, where 0 = Current, 1 = A, 2 = B, etc. DiskSize returns -1 if the drive number is invalid.


DisposeStr procedure

See also

Disposes of a string pointer that was allocated using NewStr.

Unit

Sysutils

Category

backward compatibility routines

procedure DisposeStr(P: PString);

Description

DisposeStr is only provided for backward compatibility with existing code that allocated a string using NewStr. Both DisposeStr and NewStr are obsolete.


EncodeDate function

See also	Example

Returns a TDateTime value that represents a specified Year, Month, and Day.

Unit

Sysutils

Category

date/time routines

function EncodeDate(Year, Month, Day: Word): TDateTime;

Description

EncodeDate returns a TDateTime value from the values specified as the Year, Month, and Day parameters.

The year must be between 1 and 9999.

Valid Month values are 1 through 12.

Valid Day values are 1 through 28, 29, 30, or 31, depending on the Month value. For example, the possible Day values for month 2 (February) are 1 through 28 or 1 through 29, depending on whether or not the Year value specifies a leap year.

If the specified values are not within range, EncodeDate raises an EConvertError exception.


EncodeTime function

See also	Example

Returns a TDateTime value for a specified Hour, Min, Sec, and MSec.

Unit

Sysutils

Category

date/time routines

function EncodeTime(Hour, Min, Sec, MSec: Word): TDateTime;

Description

EncodeTime encodes the given hour, minute, second, and millisecond into a TDateTime value. Valid Hour values are 0 through 23. Valid Min and Sec values are 0 through 59. Valid MSec values are 0 through 999. If the specified values are not within range, an EConvertError exception is raised.

The resulting value is a number between 0 (inclusive) and 1 (not inclusive) that indicates the fractional part of a day given by the specified time. The value 0 corresponds to midnight, 0.5 corresponds to noon, 0.75 corresponds to 6:00 pm, and so on.


EndThread function

See also

Terminates the execution of a thread.

Unit

Sysutils

Category

thread management routines

function EndThread(ExitCode: Integer);

Description

EndThread calls the ExitThread WinAPI with the specified ExitCode.


ExceptAddr function

See also

Returns the address at which the current exception was raised.

Unit

Sysutils

Category

exception handling routines

function ExceptAddr: Pointer;

Description

Use ExceptAddr to obtain the address at which an exception was raised. If there is no current exception, ExceptAddr returns nil.


ExceptionErrorMessage function

See also

Formats a standard error message.

Unit

Sysutils

Category

exception handling routines

function ExceptionErrorMessage(ExceptObject: TObject; ExceptAddr: Pointer; Buffer: PChar; Size: Integer): Integer;

Description

Call ExceptionErrorMessage to assemble an error message that indicates the object associated with the current exception and the location at which the exception was raised. The assembled message is written into the buffer provided by the Buffer parameter. Specify the size of this buffer using the Size parameter.

ExceptionErrorMessage returns the number of bytes in the assembled error message.


ExceptObject function

See also

Returns a reference to the object associated with the current exception.

Unit

Sysutils

Category

exception handling routines

function ExceptObject: TObject;

Description

ExceptObject returns a reference to the current exception object – typically a descendant of Exception – that is associated with the current exception. If there is no current exception, ExceptObject returns nil.

In most cases, do not call ExceptObject explicitly; instead, use the language construct

on E: ExceptionType do

This maps the identifier E to the object instance of the current exception statement that follows if the current exception is of ExceptionType. However, when a default exception handler is created using an else in the exception block, the only way to access the current exception object is by calling ExceptObject.


ExcludeTrailingBackslash function

See also

Returns a path name after removing any '\' at the end.

Unit

Sysutils

Category

file name utilities

function ExcludeTrailingBackslash(const S: string): string;

Description

Use ExcludeTrailingBackslash to modify a path name (specified by the S parameter) so that it does not end with a backslash character. If S does not end in a backslash character, ExcludeTrailingBackslash returns a copy of S.

Note:	ExcludeTrailingBackslash works with multibyte character sets.


ExpandFileName function

See also	Example

Returns the full path name for a relative file name.

Unit

Sysutils

Category

file name utilities

function ExpandFileName(const FileName: string): string;

Description

ExpandFileName converts the relative file name into a fully qualified path name by merging in the current drive and directory. A fully qualified path name includes the drive letter and any directory and subdirectories in addition to the file name and extension. ExpandFileName does not verify that the resulting fully qualified path name refers to an existing file, or even that the resulting path exists.

Note:	ExpandFileName does not support UNC format. To expand to a UNC file name, use ExpandUNCFileName.


ExpandUNCFileName function

See also

Returns the full path of a file name with the network drive portion in UNC format.

Unit

Sysutils

Category

file name utilities

function ExpandUNCFileName(const FileName: string): string;

Description

ExpandUNCFileName returns a string containing a fully qualified path name for the file passed in as FileName. A fully qualified path name includes the drive portion of the filename in the UNC format '\\<servername>\<sharename>' if the drive letter is mapped to a network resource instead of a local drive with any directory and subdirectories in addition to the file name and extension.

Use this function to store filenames that are independent of a particular user's drive letter mappings.


ExtractFileDir function

See also

Extracts the drive and directory parts from FileName.

Unit

Sysutils

Category

file name utilities

function ExtractFileDir(const FileName: string): string;

Description

The resulting string is a directory name suitable for passing to the CreateDir, GetCurrentDir, RemoveDir, and SetCurrentDir functions. This string is empty if FileName contains no drive and directory parts.

Note:	This function works for multi-byte character systems (MBCS).


ExtractFileDrive function

See also

Returns the drive portion of a file name.

Unit

Sysutils

Category

file name utilities

function ExtractFileDrive(const FileName: string): string;

Description

ExtractFileDrive returns a string containing the drive portion of a fully qualified path name for the file passed in the FileName. For file names with drive letters, the result is in the form '<drive>'. For file names with a UNC path the result is in the form '\\<servername>\<sharename>'. If the given path contains neither style of path prefix, the result is an empty string.


ExtractFileExt function

See also

Returns the extension portions of a file name.

Unit

Sysutils

Category

file name utilities

function ExtractFileExt(const FileName: string): string;

Description

Use ExtractFileExt to obtain the extension from a file name. For example, the following code returns the extension of the file name specified by a variable named MyFileName:

MyFilesExtension := ExtractFileExt(MyFileName);

The resulting string includes the period character that separates the name and extension parts. This string is empty if the given file name has no extension.

Note:	This function works for multi-byte character systems (MBCS).


ExtractFileName function

See also	Example

Extracts the name and extension parts of a file name.

Unit

Sysutils

Category

file name utilities

function ExtractFileName(const FileName: string): string;

Description

The resulting string is the leftmost characters of FileName, starting with the first character after the colon or backslash that separates the path information from the name and extension. The resulting string is equal to FileName if FileName contains no drive and directory parts.

Note:	This function works for multi-byte character systems (MBCS).


ExtractFilePath function

See also	Example

Returns the drive and directory portions of a file name.

Unit

Sysutils

Category

file name utilities

function ExtractFilePath(const FileName: string): string;

Description

The resulting string is the rightmost characters of FileName, up to and including the colon or backslash that separates the path information from the name and extension. The resulting string is empty if FileName contains no drive and directory parts.

Note:	This function works for multi-byte character systems (MBCS).


ExtractRelativePath function

See also

Returns a relative path name, relative to a specific base directory.

Unit

Sysutils

Category

file name utilities

function ExtractRelativePath(const BaseName, DestName: string): string;

Description

Call ExtractRelativePath to convert a fully qualified path name into a relative path name.  The DestName parameter specifies file name (including path) to be converted.  BaseName is the fully qualified name of the base directory to which the returned path name should be relative.

ExtractRelativePath strips out common path directories and inserts '..\' for each level up from the BaseName.


ExtractShortPathName function

See also

Converts a file name to the short 8.3 form.

Unit

Sysutils

Category

file name utilities

function ExtractShortPathName(const FileName: string): string;

Description

ExtractShortPathName converts the file name, FileName, to the short 8.3 form. ExtractShortPathName returns an empty string if the file or directory does not exist.

The first parameter, FileName, can be a full path name. For example, ExtractShortPathName would convert the full path name:

C:\Program Files\Borland\Delphi\Bin\Delphi32.exe

to the short form:

C:\Progra~1\Borland\Delphi\Bin\Delphi32.exe


FileAge function

See also

Returns the date-and-time stamp of a specified file.

Unit

Sysutils

Category

file management routines

function FileAge(const FileName: string): Integer;

Description

Call FileAge to obtain the timestamp of the file specified by FileName. The return value can be converted to a TDateTime object using the FileDateToDateTime function. The return value is -1 if the file does not exist.


FileClose procedure

See also	Example

Closes a specified file.

Unit

Sysutils

Category

file management routines

procedure FileClose(Handle: Integer);

Description

FileClose closes a file given its handle. The handle is obtained when the file is opened using FileOpen or FileCreate.

Note:	 When working with Pascal file variables, use the CloseFile procedure instead.


FileCreate function

See also	Example

Creates a new file.

Unit

Sysutils

Category

file management routines

function FileCreate(const FileName: string): Integer;

Description

FileCreate creates a new file with the specified name. If the return value is positive, the function was successful and the value is the file handle of the new file. A return value of -1 indicates that an error occurred.

Note:	Use of the non-native Pascal file handlers such as FileCreate is not encouraged. These routines map to the Windows API functions and return file handles, not normal Pascal file variables. These are low-level file access routines. For normal file operations use AssignFile, Rewrite, and Reset instead.


FileDateToDateTime function

See also

Converts a DOS date-time value to TDateTime value.

Unit

Sysutils

Category

file management routines

function FileDateToDateTime(FileDate: Integer): TDateTime;

Description

Use FileDateToDateTime to convert a DOS date-and-time value to a TDateTime value, which is the representation of date-and-time values used by the VCL.

For example, use FileDateToDateTime to convert the file timestamp returned by FileGetDate or FileAge to a value that can be used with other VCL routines and properties. You may also need to use FileDateToDateTime to convert the Time field of the TSearchRec record used by the FindFirst and FindNext functions.


FileExists function

See also	Example

Tests if a specified file exists.

Unit

Sysutils

Category

file management routines

function FileExists(const FileName: string): Boolean;

Description

FileExists returns True if the file specified by FileName exists. If the file does not exist, FileExists returns False.


FileGetAttr function

See also

Returns the file attributes of FileName.

Unit

Sysutils

Category

file management routines

function FileGetAttr(const FileName: string): Integer;

Description

FileGetAttr returns the attributes of the file as a string of bits. This value is the same as the Attr field of a TSearchRec record. Check for individual attributes with code such as the following:

Attrs := FileGetAttr('MyFile.sys');

if Attrs and faHidden <> 0 then

  FileSetAttr('MyFile.sys', Attrs – faHidden);

A return value of -1 indicates that an error occurred.

Note:	See TSearchRec for a description of the individual attribute constants.


FileGetDate function

See also

Returns a DOS date-time stamp for a specified file.

Unit

Sysutils

Category

file management routines

function FileGetDate(Handle: Integer): Integer;

Description

Use FileGetDate to determine the timestamp of a file given its handle. The return value is -1 if the handle is invalid. The FileDateToDateTime function can be used to convert the returned value to a TDateTime value.

Note:	FileGetDate uses a file handle rather than a native Pascal file variable. To obtain the timestamp of a file that has not been opened using the FileOpen or FileCreate method, use the FileAge function instead.


File mode constants

See also

File mode constants are used to open and close disk files.

Unit

Sysutils

Category

file management routines

const fmClosed = $D7B0;

const fmInput  = $D7B1;

const fmOutput = $D7B2;

const fmInOut  = $D7B3;

Description

Use the file mode constants when opening and closing disk files. The Mode field of TFileRec and TTextRec will contain one of these values.


File open mode constants

File open mode constants are used to control the access mode to a file or stream.

Unit

Sysutils

Category

file management routines

const fmOpenRead       = $0000;

const fmOpenWrite      = $0001;

const fmOpenReadWrite  = $0002;

const fmShareCompat    = $0000;

const fmShareExclusive = $0010;

const fmShareDenyWrite = $0020;

const fmShareDenyRead  = $0030;

const fmShareDenyNone  = $0040;

Description

The file open mode constants are used when a file or stream is opened to control how it can be shared.

The TFileStream constructor has a Mode parameter that you can set to one of these constants:

Constant	Definition

fmOpenRead	Open for read access only.

fmOpenWrite	Open for write access only.

fmOpenReadWrite	Open for read and write access.

fmShareCompat	Compatible with the way FCBs are opened.

fmShareExclusive	Read and write access is denied.

fmShareDenyWrite	Write access is denied.

fmShareDenyRead	Read access is denied.

fmShareDenyNone	Allows full access for others.


FileOpen function

See also	Example

Opens a specified file using a specified access mode.

Unit

Sysutils

Category

file management routines

function FileOpen(const FileName: string; Mode: LongWord): Integer;

Description

Use FileOpen to open a file and obtain its Windows file handle. The access mode value is constructed by OR-ing one of the fmOpen constants with one of the fmShare constants defined in File open mode constants. If the return value is positive, the function was successful and the value is the file handle of the opened file. A return value of -1 indicates that an error occurred.

Note:	Use of the non-native Pascal file handlers such as FileOpen is not encouraged. These routines map to the Windows API functions and return file handles, not normal Pascal file variables. These are low-level file access routines. For normal file operations use AssignFile, Rewrite, and Reset instead.


FileRead function

See also	Example

Reads a specified number of bytes from a file.

Unit

Sysutils

Category

file management routines

function FileRead(Handle: Integer; var Buffer; Count: Integer): Integer;

Description

FileRead reads Count bytes from the file specified by Handle into the buffer. The Count parameter indicates the size, in bytes, of the buffer. The function result is the actual number of bytes read, which may be less than Count. The Handle that is passed to FileRead must be opened with FileOpen or FileCreate.

Note:	Do not mix routines that take or return file handles with those that use Pascal file variables (typically seen as var F). To read from a file specified by a Pascal file variable, use the BlockRead procedure or the Read procedure instead.


FileSearch function

See also	Example

Searches a specified DOS path for a file.

Unit

Sysutils

Category

file management routines

function FileSearch(const Name, DirList: string): string;

Description

FileSearch searches through the directories passed in DirList for a file named Name. DirList is a semicolon delimited set of DOS path names. If FileSearch locates a file matching Name, it returns a string specifying a fully-qualified path name for that file. If no matching file exists, FileSearch returns an empty string.


FileSeek function

See also	Example

Positions the current file pointer in a previously opened file.

Unit

Sysutils

Category

file management routines

function FileSeek(Handle, Offset, Origin: Integer): Integer; overload;

function FileSeek(Handle: Integer; const Offset: Int64; Origin: Integer): Int64; overload;

Description

Use FileSeek to position the file pointer in a file that was opened with FileOpen or FileCreate. Handle contains the file handle that was returned by FileOpen or FileCreate.

Offset specifies the number of bytes from Origin where the file pointer should be positioned. Origin is a code with three possible values, denoting the beginning of the file, the end of the file, and the current position of the file pointer.

Origin	Action

0	The file pointer is positioned Offset bytes from the beginning of the file.

1	The file pointer is positioned Offset bytes from its current position.

2	The file pointer is positioned Offset bytes from the end of the file.

If FileSeek is successful, it returns the new position of the file pointer; otherwise, it returns -1.

Note:	Do not mix routines that take or return file handles with those that use Pascal file variables (typically seen as var F). To move the file pointer in a file specified by a Pascal file variable, use the Seek procedure instead.


FileSetAttr function

See also

Sets the file attributes of a specified file.

Unit

Sysutils

Category

file management routines

function FileSetAttr(const FileName: string; Attr: Integer): Integer;

Description

FileSetAttr sets the file attributes of the file given by FileName to the value given by Attr. The value of Attr is formed by combining the appropriate file attribute constants, as in the following:

FileSetAttr('MyFile.sys', faReadOnly or faSysFile);

FileSetAttr returns zero if the function was successful. Otherwise the return value is a Windows error code.

Note:	See TSearchRec for a description of the file attribute constants.


FileSetDate function

See also

Sets the DOS time stamp for a specified file.

Unit

Sysutils

Category

file management routines

function FileSetDate(Handle: Integer; Age: Integer): Integer;

Description

FileSetDate sets the DOS date-time stamp of the file given by Handle to the value given by Age. The DateTimeToFileDate function can be used to convert a TDateTime value to a DOS date-time stamp.

The return value is zero if the function was successful. Otherwise the return value is a Windows error code.


FileWrite function

See also	Example

Writes the contents of a buffer to the current position in a file.

Unit

Sysutils

Category

file management routines

function FileWrite(Handle: Integer; const Buffer; Count: Integer): Integer;

Description

FileWrite writes Count bytes to the file given by Handle from the buffer specified by Buffer. Handle is a file handle returned by the FileOpen or FileCreate method.

The return value is the number of bytes actually written, or -1 if an error occurred.

Note:	Do not mix routines that take or return file handles with those that use Pascal file variables (typically seen as var F). To write to a file specified by a Pascal file variable, use Write, Writeln, or BlockWrite instead.


FinalizePackage procedure

See also

Finalizes the specified package .BPL.

Unit

Sysutils

Category

package support routines

procedure FinalizePackage(Module: HMODULE);

Description

Most applications do not need to call FinalizePackage, because UnloadPackage calls FinalizePackage internally. FinalizePackage executes any finalization code in the specified package.


FindClose procedure

See also 	Example

Releases memory allocated by FindFirst.

Unit

Sysutils

Category:

file management routines

procedure FindClose(var F: TSearchRec);

Description

FindClose terminates a FindFirst/FindNext sequence.


FindCmdLineSwitch function

See also

Determines whether a string was passed as a command line argument to the application.

Unit

Sysutils

Category

command line utilities

function FindCmdLineSwitch(const Switch: string; SwitchChars: TSysCharSet; IgnoreCase: Boolean): Boolean;

Description

FindCmdLineSwitch determines whether the string specified by the Switch parameter was passed as a command line argument to the application. SwitchChars identifies valid argument-delimiter characters (e.g., "-" and "/" are common delimiters). The IgnoreCase parameter controls whether a case-sensitive or case-insensitive search is performed.


FindFirst function

See also	Example

Searches for the first instance of a file name with a given set of attributes in a specified directory.

Unit

Sysutils

Category

file management routines

function FindFirst(const Path: string; Attr: Integer; var F: TSearchRec): Integer;

Description

FindFirst searches the directory specified by Path for the first file that matches the file name implied by Path and the attributes specified by the Attr parameter. The result is returned in the F parameter. Use the fields of this search record to extract the information needed. FindFirst returns 0 if a file was successfully located, otherwise, it returns a Windows error code.

The Path constant parameter is the directory and file name mask, including wildcard characters. For example, 'c:\test\*.*' specifies all files in the C:\TEST directory).

The Attr parameter specifies the special files to include in addition to all normal files. Choose from these file attribute constants when specifying the Attr parameter:

Constant	Value	Description

faReadOnly	$00000001	Read-only files

faHidden	$00000002	Hidden files

faSysFile	$00000004	System files

faVolumeID	$00000008	Volume ID files

faDirectory	$00000010	Directory files

faArchive	$00000020	Archive files

faAnyFile	$0000003F	Any file

Attributes can be combined by adding their constants or values. For example, to search for read-only and hidden files in addition to normal files, pass (faReadOnly + faHidden) as the Attr parameter.

Note:	FindFirst allocates resources (memory) which must be released by calling FindClose.


FindNext function

See also	Example

Returns the next entry matching the name and attributes specified in a previous call to FindFirst.

Unit

Sysutils

Category

file management routines

function FindNext(var F: TSearchRec): Integer;

Description

FindNext returns the next entry that matches the name and attributes specified in a previous call to FindFirst. The search record must be one that was passed to FindFirst. The return value is zero if the function was successful. Otherwise the return value is a Windows error code.


FloatToDecimal procedure

Converts a floating-point value to a decimal representation.

Unit

Sysutils

Category

floating point conversion routines

procedure FloatToDecimal(var DecVal: TFloatRec; const Value; ValueType: TFloatValue; Precision, Decimals: Integer);

Description

FloatToDecimal converts a floating-point value to a decimal representation that is suited for further formatting.

The Value parameter must be a variable of type Extended or Currency, as indicated by the ValueType parameter.

For values of type Extended, the Precision parameter specifies the requested number of significant digits in the result--the allowed range is 1..18. For values of type Currency, the Precision parameter is ignored, and the implied precision of the conversion is 19 digits.

The Decimals parameter specifies the requested maximum number of digits to the left of the decimal point in the result. Precision and Decimals together control how the result is rounded. To produce a result that always has a given number of significant digits regardless of the magnitude of the number, specify 9999 for the Decimals parameter.


FloatToStr function

See also

Converts a floating point value to a string.

Unit

Sysutils

Category

floating point conversion routines

function FloatToStr(Value: Extended): string;

Description

FloatToStr converts the floating-point value given by Value to its string representation. The conversion uses general number format with 15 significant digits.

For greater control over the formatting of the string, use the FloatToStrF function.


FloatToStrF function

See also

Converts a floating point value to a string, using a specified Format, Precision, and Digits.

Unit

Sysutils

Category

Floating point conversion routines

function FloatToStrF(Value: Extended; Format: TFloatFormat; Precision, Digits: Integer): string;

Description

FloatToStrF converts the floating-point value given by Value to its string representation.

The Value parameter is the value to convert.

The Precision parameter specifies the precision of the given value. It should be 7 or less for values of type Single, 15 or less for values of type Double, and 18 or less for values of type Extended.

The Digits and Format parameters together control how the value is formatted into a string. For details, see the description of TFloatFormat.

For all formats, the actual characters used as decimal and thousand separators are obtained from the DecimalSeparator and ThousandSeparator global variables.

If the given value is a NAN (not-a-number), the resulting string is 'NAN'. If the given value is positive infinity, the resulting string is 'INF'. If the given value is negative infinity, the resulting string is '-INF'.


FloatToText function

See also

Converts a floating-point value to an unterminated character string, using a specified Format, Precision and Digits.

Unit

Sysutils

Category

floating point conversion routines

function FloatToText(Buffer: PChar; const Value; ValueType: TFloatValue; Format: TFloatFormat; Precision, Digits: Integer): Integer;

Description

FloatToText converts the given floating-point value to its decimal representation using the specified format, precision, and digits. The Value parameter must be a variable of type Extended or Currency, as indicated by the ValueType parameter. The resulting string of characters is stored in the given buffer, and the returned value is the number of characters stored. The resulting string is not null-terminated.


FloatToTextFmt function

See also

Converts a floating-point value to to an unterminated character string, using a specified format.

Unit

Sysutils

Category

floating point conversion routines

function FloatToTextFmt(Buffer: PChar; const Value; ValueType: TFloatValue; Format: PChar): Integer;

Description

Use FloatToTextFmt to format a floating-point value using a format string rather than using a predefined format. To use a predefined format, use the FloatToText or FloatToStrF function instead.

The Value parameter must be a variable of type Extended or Currency, as indicated by the ValueType parameter. The resulting string of characters is stored in the given buffer, and the returned value is the number of characters stored. The resulting string is not null-terminated.

Formats supported are described as part of the FormatFloat function.


FmtLoadStr function

See also

Returns formatted output using a resourced format string.

Unit

Sysutils

Category

string formatting routines

function FmtLoadStr(Ident: Integer; const Args: array of const): string;

Description

FmtLoadStr loads a string from a program's resource string table and uses that string, plus the Args array, as a parameter to Format. Ident is the string resource ID of the desired format string.

FmtLoadStr returns the resourced string with the arguments applied. This is the same value that would result from calling Format, using the resourced string and the specified arguments.

For information on the format strings, see Format Strings.


FmtStr procedure

See also

Assembles a formatted string using a format string and an array of arguments.

Unit

Sysutils

Category

string formatting routines

procedure FmtStr(var StrResult: string; const Format: string; const Args: array of const);

Description

This function formats the series of arguments in the open array Args. Formatting is controlled by the format string Format; the results are returned in the parameter StrResult.

For information on the format strings, see Format Strings.


Format function

See also	Example

Returns a formatted string assembled from a format string and an array of arguments.

Unit

Sysutils

Category

string formatting routines

function Format(const Format: string; const Args: array of const): string;

Description

This function formats the series of arguments in the open array Args. Formatting is controlled by the format string Format; the results are returned in the function result as a string.

For information on the format strings, see Format Strings.


Format strings

Format strings specify required formats to formatting routines.

Category

string formatting routines

Description

Format strings passed to the string formatting routines contain two types of objects -- literal characters and format specifiers. Literal characters are copied verbatim to the resulting string. Format specifiers fetch arguments from the argument list and apply formatting to them.

Format specifiers have the following form:

"%" [index ":"] ["-"] [width] ["." prec] type

A format specifier begins with a % character. After the % come the following, in this order:

An optional argument index specifier, [index ":"]

An optional left justification indicator, ["-"]

An optional width specifier, [width]

An optional precision specifier, ["." prec]

The conversion type character, type

The following table summarizes the possible values for type:

d	Decimal. The argument must be an integer value. The value is converted to a string of decimal digits. If the format string contains a precision specifier, it indicates that the resulting string must contain at least the specified number of digits; if the value has less digits, the resulting string is left-padded with zeros.
u	Unsigned decimal. Similar to 'd' but no sign is output.
e	Scientific. The argument must be a floating-point value. The value is converted to a string of the form "-d.ddd...E+ddd". The resulting string starts with a minus sign if the number is negative. One digit always precedes the decimal point. The total number of digits in the resulting string (including the one before the decimal point) is given by the precision specifier in the format string—a default precision of 15 is assumed if no precision specifier is present. The "E" exponent character in the resulting string is always followed by a plus or minus sign and at least three digits.
f	Fixed. The argument must be a floating-point value. The value is converted to a string of the form "-ddd.ddd...". The resulting string starts with a minus sign if the number is negative. The number of digits after the decimal point is given by the precision specifier in the format string—a default of 2 decimal digits is assumed if no precision specifier is present.
g	General. The argument must be a floating-point value. The value is converted to the shortest possible decimal string using fixed or scientific format. The number of significant digits in the resulting string is given by the precision specifier in the format string—a default precision of 15 is assumed if no precision specifier is present. Trailing zeros are removed from the resulting string, and a decimal point appears only if necessary. The resulting string uses fixed point format if the number of digits to the left of the decimal point in the value is less than or equal to the specified precision, and if the value is greater than or equal to 0.00001. Otherwise the resulting string uses scientific format.
n	Number. The argument must be a floating-point value. The value is converted to a string of the form "-d,ddd,ddd.ddd...". The "n" format corresponds to the "f" format, except that the resulting string contains thousand separators.
m	Money. The argument must be a floating-point value. The value is converted to a string that represents a currency amount. The conversion is controlled by the CurrencyString, CurrencyFormat, NegCurrFormat, ThousandSeparator, DecimalSeparator, and CurrencyDecimals global variables, all of which are initialized from the Currency Format in the International section of the Windows Control Panel. If the format string contains a precision specifier, it overrides the value given by the CurrencyDecimals global variable.
p	Pointer. The argument must be a pointer value. The value is converted to an 8 character string that represents the pointers value in hexadecimal.
s	String. The argument must be a character, a string, or a PChar value. The string or character is inserted in place of the format specifier. The precision specifier, if present in the format string, specifies the maximum length of the resulting string. If the argument is a string that is longer than this maximum, the string is truncated.
x	Hexadecimal. The argument must be an integer value. The value is converted to a string of hexadecimal digits. If the format string contains a precision specifier, it indicates that the resulting string must contain at least the specified number of digits; if the value has fewer digits, the resulting string is left-padded with zeros.
Conversion characters may be specified in uppercase as well as in lowercase—both produce the same results.

For all floating-point formats, the actual characters used as decimal and thousand separators are obtained from the DecimalSeparator and ThousandSeparator global variables.

Index, width, and precision specifiers can be specified directly using decimal digit string (for example "%10d"), or indirectly using an asterisk character (for example "%*.*f"). When using an asterisk, the next argument in the argument list (which must be an integer value) becomes the value that is actually used. For example,

Format('%*.*f', [8, 2, 123.456])

is the same as

Format('%8.2f', [123.456]).

A width specifier sets the minimum field width for a conversion. If the resulting string is shorter than the minimum field width, it is padded with blanks to increase the field width. The default is to right-justify the result by adding blanks in front of the value, but if the format specifier contains a left-justification indicator (a "-" character preceding the width specifier), the result is left-justified by adding blanks after the value.

An index specifier sets the current argument list index to the specified value. The index of the first argument in the argument list is 0. Using index specifiers, it is possible to format the same argument multiple times. For example "Format('%d %d %0:d %1:d', [10, 20])" produces the string '10 20 10 20'.

The format strings are used by the following routines:

Format function

FormatBuf function

FmtStr  procedure

StrFmt  function

StrLFmt  function


FormatBuf function

See also

Formats the arguments from an array, placing the result in a buffer.

Unit

Sysutils

Category

string formatting routines

function FormatBuf(var Buffer; BufLen: Cardinal; const Format; FmtLen: Cardinal; const Args: array of const): Cardinal;

Description

This function formats the series of arguments in the open array Args. Formatting is controlled by the format string Format (whose length is given by FmtLen); the results are returned in Buffer (whose length is given by BufLen). The function returns the length, in bytes, of the resulting string.

For information on the format strings, see Format Strings.


FormatCurr function

See also

Formats a Currency object.

Unit

Sysutils

Category

numeric formatting routines

function FormatCurr(const Format: string; Value: Currency): string;

Description

FormatCurr formats the Currency object given by Value using the format string given by Format. Formats supported are described as part of the FormatFloat function.


FormatDateTime function

See also	Example

Formats a TDateTime value.

Unit

Sysutils

Category

date/time routines

function FormatDateTime(const Format: string; DateTime: TDateTime): string;

Description

FormatDateTime formats the TDateTime value given by DateTime using the format given by Format. The following format specifiers are supported:

Specifier	Displays
c	Displays the date using the format given by the ShortDateFormat global variable, followed by the time using the format given by the LongTimeFormat global variable. The time is not displayed if the fractional part of the DateTime value is zero.
d	Displays the day as a number without a leading zero (1-31).
dd	Displays the day as a number with a leading zero (01-31).
ddd	Displays the day as an abbreviation (Sun-Sat) using the strings given by the ShortDayNames global variable.
dddd	Displays the day as a full name (Sunday-Saturday) using the strings given by the LongDayNames global variable.
ddddd	Displays the date using the format given by the ShortDateFormat global variable.
dddddd	Displays the date using the format given by the LongDateFormat global variable.
m	Displays the month as a number without a leading zero (1-12). If the m specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.
mm	Displays the month as a number with a leading zero (01-12). If the mm specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.
mmm	Displays the month as an abbreviation (Jan-Dec) using the strings given by the ShortMonthNames global variable.
mmmm	Displays the month as a full name (January-December) using the strings given by the LongMonthNames global variable.
yy	Displays the year as a two-digit number (00-99).
yyyy	Displays the year as a four-digit number (0000-9999).
h	Displays the hour without a leading zero (0-23).
hh	Displays the hour with a leading zero (00-23).
n	Displays the minute without a leading zero (0-59).
nn	Displays the minute with a leading zero (00-59).
s	Displays the second without a leading zero (0-59).
ss	Displays the second with a leading zero (00-59).
z	Displays the millisecond without a leading zero (0-999).
zzz	Displays the millisecond with a leading zero (000-999).
t	Displays the time using the format given by the ShortTimeFormat global variable.
tt	Displays the time using the format given by the LongTimeFormat global variable.
am/pm	Uses the 12-hour clock for the preceding h or hh specifier, and displays 'am' for any hour before noon, and 'pm' for any hour after noon. The am/pm specifier can use lower, upper, or mixed case, and the result is displayed accordingly.
a/p	Uses the 12-hour clock for the preceding h or hh specifier, and displays 'a' for any hour before noon, and 'p' for any hour after noon. The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly.
ampm	Uses the 12-hour clock for the preceding h or hh specifier, and displays the contents of the TimeAMString global variable for any hour before noon, and the contents of the TimePMString global variable for any hour after noon.
/	Displays the date separator character given by the DateSeparator global variable.
:	Displays the time separator character given by the TimeSeparator global variable.
'xx'/"xx"	Characters enclosed in single or double quotes are displayed as-is, and do not affect formatting.
Format specifiers may be written in upper case as well as in lower case letters--both produce the same result.

If the string specified by the Format parameter is empty, the TDateTime value is formatted as if a 'c' format specifier had been given.


FormatFloat function

See also	Example

Formats a floating point value.

Unit

Sysutils

Category

floating point conversion routines

function FormatFloat(const Format: string; Value: Extended): string;

Description

FormatFloat formats the floating-point value given by Value using the format string given by Format. The following format specifiers are supported in the format string:

Specifier	Represents

0	Digit place holder. If the value being formatted has a digit in the position where the '0' appears in the format string, then that digit is copied to the output string. Otherwise, a '0' is stored in that position in the output string.

#	Digit placeholder. If the value being formatted has a digit in the position where the '#' appears in the format string, then that digit is copied to the output string. Otherwise, nothing is stored in that position in the output string.

.	Decimal point. The first '.' character in the format string determines the location of the decimal separator in the formatted value; any additional '.' characters are ignored. The actual character used as a the decimal separator in the output string is determined by the DecimalSeparator global variable. The default value of DecimalSeparator is specified in the Number Format of the International section in the Windows Control Panel.

,	Thousand separator. If the format string contains one or more ',' characters, the output will have thousand separators inserted between each group of three digits to the left of the decimal point. The placement and number of ',' characters in the format string does not affect the output, except to indicate that thousand separators are wanted. The actual character used as a the thousand separator in the output is determined by the ThousandSeparator global variable. The default value of ThousandSeparator is specified in the Number Format of the International section in the Windows Control Panel.

E+	Scientific notation. If any of the strings 'E+', 'E-', 'e+', or 'e-' are contained in the format string, the number is formatted using scientific notation. A group of up to four '0' characters can immediately follow the 'E+', 'E-', 'e+', or 'e-' to determine the minimum number of digits in the exponent. The 'E+' and 'e+' formats cause a plus sign to be output for positive exponents and a minus sign to be output for negative exponents. The 'E-' and 'e-' formats output a sign character only for negative exponents.

'xx'/"xx"	Characters enclosed in single or double quotes are output as-is, and do not affect formatting.

;	Separates sections for positive, negative, and zero numbers in the format string.

The locations of the leftmost '0' before the decimal point in the format string and the rightmost '0' after the decimal point in the format string determine the range of digits that are always present in the output string.

The number being formatted is always rounded to as many decimal places as there are digit placeholders ('0' or '#') to the right of the decimal point. If the format string contains no decimal point, the value being formatted is rounded to the nearest whole number.

If the number being formatted has more digits to the left of the decimal separator than there are digit placeholders to the left of the '.' character in the format string, the extra digits are output before the first digit placeholder.

To allow different formats for positive, negative, and zero values, the format string can contain between one and three sections separated by semicolons.

One section: The format string applies to all values.

Two sections: The first section applies to positive values and zeros, and the second section applies to negative values.

Three sections: The first section applies to positive values, the second applies to negative values, and the third applies to zeros.

If the section for negative values or the section for zero values is empty, that is if there is nothing between the semicolons that delimit the section, the section for positive values is used instead.

If the section for positive values is empty, or if the entire format string is empty, the value is formatted using general floating-point formatting with 15 significant digits, corresponding to a call to FloatToStrF with the ffGeneral format. General floating-point formatting is also used if the value has more than 18 digits to the left of the decimal point and the format string does not specify scientific notation.


FreeAndNil procedure

See also

Frees an object reference and replaces the reference with nil..

Unit

Sysutils

Category

miscellaneous routines

procedure FreeAndNil(var Obj);

Description

Use FreeAndNil to ensure that a variable is nil after you free the object it references. Pass any variable that represents an object as the Obj parameter.

Warning:	Do not pass a value for Obj if it is not an instance of TObject or one of its descendants.


GetCurrentDir function

See also

Returns the name of the current directory.

Unit

Sysutils

Category

file management routines

function GetCurrentDir: string;

Description

GetCurrentDir returns the fully qualified name of the current directory.


GetFormatSettings procedure

Resets the date and number format parameters to default values.

Unit

Sysutils

Category

string formatting routines

procedure GetFormatSettings;

Description

GetFormatSettings resets all date and number format variables to their default values. GetFormatSettings is called in non-console applications in response to WM_WININICHANGE messages.


GetPackageDescription function

See also

Returns the description resource from a package.

Unit

Sysutils

Category

package support routines

function GetPackageDescription(ModuleName: PChar): string;

Description

Call GetPackageDescription to obtain the description stored with the named package. If the package does not have a description resource, GetPackageDescription returns an empty string.


GetPackageInfo procedure

See also

Enumerates all the units and required packages for a package.

Unit

Sysutils

Category

package support routines

procedure GetPackageInfo(Module: HMODULE; Param: Pointer; var Flags: Integer; InfoProc: TPackageInfoProc);

Description

Call GetPackageInfo to process the information in a package's information table. The InfoProc callback is called for every unit included in the package and for every package required by the package. Module is the module handle for the package. GetPackageInfo passes any application-supplied information passed in the Param parameter to the InfoProc callback. The package's information flags are passed to the InfoProc and returned in the Flags parameter.


IncludeTrailingBackslash function

See also

Returns a path name after adding a '\' to the end if it is not already there.

Unit

Sysutils

Category

file name utilities

function IncludeTrailingBackslash(const S: string): string;

Description

Use IncludeTrailingBackslash to modify a path name (specified by the S parameter) so that it ends with a backslash character. If S already ends in a backslash character, IncludeTrailingBackslash returns a copy of S.

Note:	IncludeTrailingBackslash works with multibyte character sets.


IncMonth function

See also

Returns a date shifted by a specified number of months.

Unit

Sysutils

Category

date/time routines

function IncMonth(const Date: TDateTime; NumberOfMonths: Integer): TDateTime;

Description

IncMonth returns the value of the Date parameter, incremented by NumberOfMonths months.  NumberOfMonths can be negative, to return a date N months previous.

If the input day of month is greater than the last day of the resulting month, the day is set to the last day of the resulting month.  The time of day specified by the Date parameter is copied to the result.


InitializePackage procedure

See also

Validates and initializes a given package.

Unit

Sysutils

Category

package support routines

procedure InitializePackage(Module: HMODULE);

Description

InitializePackage checks for duplicate units in a package and calls the initialization blocks of the contained units.

Note:	InitializePackage is called internally by the LoadPackage function.


IntToHex function

See also 	Example

Returns the hex representation of an integer.

Unit

Sysutils

Category

numeric formatting routines

function IntToHex(Value: Integer; Digits: Integer): string; overload;

function IntToHex(Value: Int64; Digits: Integer): string; overload;

Description

IntToHex converts a number into a string containing the number's hexadecimal (base 16) representation. Value is the number to convert. Digits indicates the minimum number of hexadecimal digits to return.


IntToStr function

See also 	Example

Converts an integer to a string.

Unit

Sysutils

Category

numeric formatting routines

function IntToStr(Value: Integer): string; overload;

function IntToStr(Value: Int64): string; overload;

Description

IntToStr converts an integer into a string containing the decimal representation of that number.


IsDelimiter function

See also

Indicates whether a specified character in a string matches one of a set of delimiters.

Unit

Sysutils

Category

string handling routines

function IsDelimiter(const Delimiters, S: string; Index: Integer): Boolean;

Description

Call IsDelimiter to determine whether the character at byte offset Index in the string S is one of the delimiters in the string Delimiters. Index is the 0-based index of the byte in question, where 0 is the first byte of the string, 1 is the second byte, and so on.

When working with a multi-byte character system (MBCS), IsDelimiter checks to make sure the indicated byte is not part of a double byte character. The delimiters in the Delimeters parameter must all be single byte characters.


IsLeapYear function

See also 	Example

Indicates whether a specified year is a leap year.

Unit

Sysutils

Category

date/time routines

function IsLeapYear(Year: Word): Boolean;

Description

Call IsLeapYear to determine whether the year specified by the Year parameter is a leap year.  Year specifies the calendar year.

Use DecodeDate to obtain the value of Year for IsLeapYear from a TDateTime value.


IsPathDelimiter function

See also

Indicates whether the byte at position Index of a string is the backslash character.

Unit

Sysutils

Category

file name utilities

function IsPathDelimiter(const S: string; Index: Integer): Boolean;

Description

Call IsPathDelimiter to determine whether a position in the string S contains the backslash path delimiter (\). The Index parameter specifies the position of the character in question, where 0 is the first byte, 1 is the second byte, and so on.

When working with a multi-byte character system (MBCS), IsPathDelimiter distinguishes between a true backslash character, and the byte of the same value that can appear as the second byte of a double byte character.

To test for more characters than just the backslash character, use IsDelimiter.


IsValidIdent function

Tests for a valid Pascal identifier.

Unit

Sysutils

Category

miscellaneous routines

function IsValidIdent(const Ident: string): Boolean;

Description

IsValidIdent returns true if the given string is a valid identifier. An identifier is defined as a character from the set ['A'..'Z', 'a'..'z', '_'] followed by zero or more characters from the set ['A'..'Z', 'a'..'z', '0..'9', '_'].


Languages function

See also

Lists the locales for which support is available.

Unit

Sysutils

Category

Application-level information

function Languages: TLanguages;

Description

Use the value returned by Languages to obtain information about the locales that the system supports. This information comes from Windows.


LastDelimiter function

See also

Returns the byte index in S of the last character that matches any character in the Delimiters AnsiString.

Unit

Sysutils

Category

string handling routines

function LastDelimiter(const Delimiters, S: string): Integer;

Description

Call LastDelimiter to locate the last delimiter in S. For example, the line

MyIndex := LastDelimiter('\.:','c:\filename.ext');

sets MyIndex to 12.

When working with multi-byte character sets (MBCS), S may contain double byte characters, but the delimiters listed in the Delimeters parameter must all be single byte non-null characters.


LeadBytes variable

See also

Lists all Char values that can be the first byte of a double byte character on the local system.

Unit

Sysutils

Category

MBCS utilities

var LeadBytes: set of Char = [];

Description

Use LeadBytes to test whether a Char value can represent the lead byte in a double byte character. If an individual Char is in the LeadBytes set, it is not necessarily used as the lead byte of a double byte character.  It may also appear as the second byte of a double byte character.  To determine whether the character is used as a lead byte, use the global ByteType or StrByteType function.

Note:	LeadBytes is always empty when running on a system with a locale that does not use a multi byte character system (MBCS).


LoadPackage function

See also

Loads a specified package.

Unit

Sysutils

Category

package support routines

function LoadPackage(const Name: string): HMODULE;

Description

LoadPackage loads the package specified by the Name parameter, checks for duplicate units, and calls the initialization blocks of all units contained in the package.


LoadStr function

Loads a string from the application's executable file.

Unit

Sysutils

Category

backward compatibility routines

function LoadStr(Ident: Integer): string;

Description

LoadStr loads the string resource given by Ident from the application's executable file. If the string resource does not exist, an empty string is returned.

Moving display strings into string resources makes an application easier to localize without rewriting the program.

Note:	LoadStr is provided primarily for backward compatibility. To isolate string resources, use the resourcestring keyword in new applications.


LowerCase function

See also 	Example

Converts an ASCII string to lowercase.

Unit

Sysutils

Category

String handling routines

function LowerCase(const S: string): string;

Description

LowerCase returns a string with the same text as the string passed in S, but with all letters converted to lowercase. The conversion affects only 7-bit ASCII characters between 'A' and 'Z'. To convert 8-bit international characters, use AnsiLowerCase.


MSecsPerDay constant

See also

Specifies the number of milliseconds per day.

Unit

Sysutils

Category

date/time routines

const

  SecsPerDay = 24 * 60 * 60;

MSecsPerDay = SecsPerDay * 1000;

Description

Use MSecsPerDay in calculations that convert between time measured in days and time measured in milliseconds.


MSecsToTimeStamp function

See also

Converts a specified number of milliseconds into a TTimeStamp value.

Unit

Sysutils

Category

date/time routines

function MSecsToTimeStamp(MSecs: Comp): TTimeStamp;

Description

Call MSecsToTimeStamp to convert MSecs, a number of milliseconds, into the number of days represented, plus the number of milliseconds remaining. The days and milliseconds are expressed as a TTimeStamp value, where the Date field is the number of days and the Time field is the remainder in milliseconds.


NewStr function

Allocates a string on the heap.

Unit

Sysutils

Category

backward compatibility routines

function NewStr(const S: string): PString;

Description

Do not use NewStr in new applications.  This function is provided for backward compatibility only.


Now function

See also 	Example

Returns the current date and time.

Unit

Sysutils

Category

date/time routines

function Now: TDateTime;

Description

Returns the current date and time, corresponding to Date + Time.


NullStr constant

See also

Declares a pointer to EmptyStr.

Unit

Sysutils

Category

string handling routines

const NullStr: PString = @EmptyStr;

Description

NullStr is the return value for many string-handling routines when the string is empty.


OutOfMemoryError procedure

See also

Raises an EOutOfMemory exception.

Unit

Sysutils

Category

exception handling routines

procedure OutOfMemoryError;

Description

Call OutOfMemoryError to raise the EOutOfMemory exception. Calling OutOfMemoryError does not need to allocate a new EOutOfMemory object, which may not be possible if the application is out of memory.


QuotedStr function

See also

Returns the quoted version of a string.

Unit

Sysutils

Category

String handling routines

function QuotedStr(const S: string): string;

Description

Use QuotedStr to convert the string S to a quoted string. A single quote character (') is inserted at the beginning and end of S, and each single quote character in the string is repeated.

Note:	When working with multi-byte character systems (MBCS), use AnsiQuotedStr instead.


RaiseLastWin32Error procedure

See also

Raises an exception for the last occurring Win32 error.

Unit

Sysutils

Category

exception handling routines

procedure RaiseLastWin32Error;

Description

Call RaiseLastWin32Error to raise an EWin32Error exception for the last Windows API call that failed. RaiseLastWin32Error retrieves the code for the last occurring Win32 error, if any. If Windows returns a previously occurring error code, RaiseLastWin32Error raises an EWin32Error exception with the error code and message associated with that error.


RemoveDir function

See also

Deletes an existing empty directory.

Unit

Sysutils

Category

file management routines

function RemoveDir(const Dir: string): Boolean;

Description

Call RemoveDir to remove the directory specified by the Dir parameter. The return value is True if a new directory was successfully deleted, False if an error occurred. The directory must be empty before it can be successfully deleted.


RenameFile function

See also 	Example

Changes a file name.

Unit

Sysutils

Category

file management routines

function RenameFile(const OldName, NewName: string): Boolean;

Description

RenameFile attempts to change the name of the file specified by OldFile to NewFile. If the operation succeeds, RenameFile returns True. If it cannot rename the file (for example, if a file called NewName already exists), it returns False.


ReplaceDate procedure

See also

Replaces the date portion of a TDateTime value with a specified date.

Unit

Sysutils

Category

date/time routines

procedure ReplaceDate(var DateTime: TDateTime; const NewDate: TDateTime);

Description

ReplaceDate changes the value of the DateTime parameter so that it has the same date as the NewDate parameter. The time portion of DateTime remains the same. ReplaceDate makes any necessary adjustments for negative dates (before 1900).


ReplaceTime procedure

See also

Replaces the time portion of a TDateTime value with a specified time.

Unit

Sysutils

Category

date/time routines

procedure ReplaceTime(var DateTime: TDateTime; const NewTime: TDateTime);

Description

ReplaceTime changes the value of the DateTime parameter so that it has the same time as the NewTime parameter. The date portion of DateTime remains the same. ReplaceTime makes any necessary adjustments for negative dates. (before 1900)


SafeLoadLibrary function

Loads a DLL while suppressing error dialogs and preventing the DLL from changing the FPU control word.

Unit

Sysutils

Category

Package support routines

function SafeLoadLibrary(const Filename: string; ErrorMode: UINT = SEM_NOOPENFILEERRORBOX): HMODULE;

Description

SafeLoadLibrary calls LoadLibrary, disabling normal Win32 error message dialogs if the requested file can't be loaded.  SafeLoadLibrary also preserves the current FPU control word (which specifies precision and exception masks) across the LoadLibrary call, in case the DLL you're loading overrides the FPU control word in its initialization, as many Microsoft DLLs do.


SecsPerDay constant

See also

Indicates the number of seconds per day.

Unit

Sysutils

Category

date/time routines

const SecsPerDay = 24 * 60 * 60;

Description

SecsPerDay declares the number of seconds in a 24-hour day.


SetCurrentDir function

See also

Sets the current directory.

Unit

Sysutils

Category

file management routines

function SetCurrentDir(const Dir: string): Boolean;

Description

The SetCurrentDir function sets the current directory. The return value is True if the current directory was successfully changed, or False if an error occurred.


ShowException procedure

See also

Displays an exception message with its physical address

Unit

Sysutils

Category

exception handling routines

procedure ShowException(ExceptObject: TObject; ExceptAddr: Pointer);

Description

ShowException displays the message associated with an exception, together with the exception's physical address. The exception's address can be used with Search | Find Error menu command to find the statement that raised the exception.


StrAlloc function

See also

Allocates a buffer for a null-terminated string and returns a pointer to its first character.

Unit

Sysutils

Category

backward compatibility routines

function StrAlloc(Size: Cardinal): PChar;

Description

StrAlloc allocates a buffer for a null-terminated string with a maximum length of Size - 1 (1 byte must be reserved for the termination character). The result points to the location where the first character of the string is to be stored. A 32-bit number giving the total amount of memory allocated is stored in the four bytes preceding the first character; it is equal to Size + 4. If space for a string is allocated with StrAlloc, it should be deallocated via StrDispose.

Because long strings are implicitly null terminated and dynamically allocated, the use of StrAlloc is in decline.


StrBufSize function

See also

Returns the maximum number of characters that can be stored in a buffer allocated by StrAlloc.

Unit

Sysutils

Category

backward compatibility routines

function StrBufSize(const Str: PChar): Cardinal;

Description

StrBufSize returns the number of bytes in Str, including the byte for the termination character. If Str does not point to a string buffer allocated by StrAlloc or StrNew, no error message is returned, and the result is unpredictable.


StrByteType function

See also

Indicates whether a byte in a string is a single byte character, the first byte of a double byte character, or the second byte of a double byte character.

Unit

Sysutils

Category

MBCS utilities

function StrByteType(Str: PChar; Index: Cardinal): TMbcsByteType;

Description

Call StrByteType to determine the type of the byte specified by the Index parameter, where 0 specifies the first byte in the string Str, 1 specifies the second byte, and so on.

If the system is not using a multi-byte character system (MBCS), StrByteType always returns mbSingleByte. Otherwise, StrByteType returns mbSingleByte if the indicated byte represents a complete character in Str, mbLeadByte if it represents the first byte of a double byte character, and mbTrailByte if it represents the second byte of a double byte character.

Note:	No checking is done to ensure that Index is less than the length of Str. It is the caller's responsibility to ensure that Index is not out of bounds.


StrCat function

See also 	Example

Appends a copy of Source to the end of Dest and returns the concatenated string.

Unit

Sysutils

Category

string handling routines (null-terminated)

function StrCat(Dest: PChar; const Source: PChar): PChar;

Description

Use StrCat to concatenate Source to the end of Dest. StrCat does not perform any length checking. The destination buffer must have room for at least StrLen(Dest)+StrLen(Source)+1 characters.

To check length, use the StrLCat function.


StrComp function

See also 	Example

Compares two strings case sensitively.

Unit

Sysutils

Category

string handling routines (null-terminated)

function StrComp(const Str1, Str2 : PChar): Integer;

Description

Call StrComp to compare two null-terminated strings, with case sensitivity. The return value is indicated in the following table:

Return value	Condition

<0	Str1< Str2

=0	Str1= Str2

>0	Str1 > Str2

Note:	When working with International characters, use AnsiStrComp instead.


StrCopy function

See also 	Example

Copies Source to Dest and returns Dest.

Unit

Sysutils

Category

string handling routines (null-terminated)

function StrCopy(Dest: PChar; const Source: PChar): PChar;

Description

Use StrCopy to copy a null-terminated string. StrCopy does not perform any length checking. The destination buffer must have room for at least StrLen(Source)+1 characters.

For length checking, use the StrLCopy function.


StrDispose procedure

See also

Disposes of a string.

Unit

Sysutils

Category

backward compatibility routines

procedure StrDispose(Str: PChar);

Description

StrDispose is provided for backward compatibility only. StrDispose disposes of a string on a heap that was previously allocated with StrAlloc or StrNew.

If Str is nil, StrDispose does nothing.


StrECopy function

See also 	Example

Copies Source to Dest and returns a pointer to the null character ending the destination string.

Unit

Sysutils

Category

string handling routines (null-terminated)

function StrECopy(Dest: PChar; const Source: PChar): PChar;

Description

StrECopy copies Source to Dest and returns StrEnd(Dest).

StrECopy does not perform any length checking. The destination buffer must have room for at least StrLen(Source)+1 characters.

Nested calls to StrECopy to concatenate a sequence of strings run more efficiently than multiple calls to StrCat.


StrEnd function

See also 	Example

Returns a pointer to the end of a null terminated string.

Unit

Sysutils

Category

string handling routines (null-terminated)

function StrEnd(const Str: PChar): PChar;

Description

StrEnd returns a pointer to the null character at the end of Str.


StrFmt function

See also

Formats entries in an array.

Unit

Sysutils

Category

string formatting routines

function StrFmt(Buffer, Format: PChar; const Args: array of const): PChar;

Description

StrFmt formats the series of arguments in the open array Args. The null-terminated format string Format controls formatting. The results are returned in Buffer. The function returns a pointer to the destination buffer.

For more information about how the result is formatted, see Format Strings.


StrIComp function

See also 	Example

Compares two strings without case sensitivity.

Unit

Sysutils

Category

string handling routines (null-terminated)

function StrIComp(const Str1, Str2:PChar): Integer;

Description

Call StrIComp to compare two strings without case sensitivity. StrIComp returns a value greater than 0 if Str1 > Str2, less than 0 if Str1 < Str2, and returns 0 if the strings are equal except for differences in case.

When working with international characters, use AnsiStrIComp instead.


StringReplace function

Returns a string with occurrences of one substring replaced by another substring.

Unit

Sysutils

Category

string handling routines

type

  TReplaceFlags = set of (rfReplaceAll, rfIgnoreCase);

function StringReplace(const S, OldPattern, NewPattern: string; Flags: TReplaceFlags): string;

Description

StringReplace replaces occurrences of the substring specified by OldPattern with the substring specified by NewPattern. StringReplace assumes that the source string, specified by S, may contain Multibyte characters.

If the Flags parameter does not include rfReplaceAll, StringReplace only replaces the first occurrence of OldPattern in S. Otherwise, all instances of OldPattern are replaced by NewPattern.

If the Flags parameter includes rfIgnoreCase, The comparison operation is case insensitive.


StrLCat function

See also 	Example

Appends up to a specified maximum number of characters to string.

Unit

Sysutils

Category

string handling routines (null-terminated)

function StrLCat(Dest: PChar; const Source: PChar; MaxLen: Cardinal): PChar;

Description

StrLCat appends at most MaxLen - StrLen(Dest) characters from Source to the end of Dest and returns Dest. That is, MaxLen indicates the maximum length that is allowed in the result string.


StrLComp function

See also 	Example

Compares up to a specified maximum number of characters in two strings.

Unit

Sysutils

Category

string handling routines (null-terminated)

function StrLComp(const Str1, Str2: PChar; MaxLen: Cardinal): Integer;

Description

StrLComp compares Str1 to Str2, up to a maximum length of MaxLen characters. The return value is indicated in the following table:

Return value	Condition

<0	Str1< Str2

=0	Str1= Str2

>0	Str1 > Str2

Note:	When working with international characters, use AnsiStrLComp instead.


StrLCopy function

See also 	Example

Copies up to a specified maximum number of characters from Source to Dest.

Unit

Sysutils

Category

string handling routines (null-terminated)

function StrLCopy(Dest: PChar; const Source: PChar; MaxLen: Cardinal): PChar;

Description

StrLCopy copies at most MaxLen characters from Source to Dest and returns Dest. The SizeOf standard function can be used to determine the MaxLen parameter.


StrLen function

See also 	Example

Returns number of characters in a string excluding the null terminator.

Unit

Sysutils

Category

string handling routines (null-terminated)

function StrLen(const Str: PChar): Cardinal;

Description

StrLen returns the number of characters in Str, not counting the null terminator.


StrLFmt function

See also

Formats a series of arguments from a specified open array into a buffer.

Unit

Sysutils

Category

string formatting routines

function StrLFmt(Buffer: PChar; MaxLen: Cardinal; Format: PChar; const Args: array of const): PChar;

Description

StrLFmt formats the series of arguments in the open array Args. The null-terminated format string Format controls formatting. The results are returned in Buffer, whose maximum length is given by MaxLen. The function returns a pointer to the destination buffer.

For information on the format strings, see Format Strings.


StrLIComp function

See also 	Example

Compares strings up to a specified maximum number of characters, without case sensitivity.

Unit

Sysutils

Category

string handling routines (null-terminated)

function StrLIComp(const Str1, Str2: PChar; MaxLen: Cardinals): Integer;

Description

StrLIComp compares Str1 to Str2 , up to a maximum length of MaxLen characters, without case sensitivity. The return value is indicated in the following table:

Return value	Condition

<0	Str1< Str2

=0	Str1= Str2

>0	Str1 > Str2

Note:	When working with international characters, use AnsiStrLIComp instead.


StrLower function

See also 	Example

Converts a string to lowercase.

Unit

Sysutils

Category

string handling routines (null-terminated)

function StrLower(Str: PChar): PChar;

Description

StrLower converts Str to lowercase and returns Str.

Note:	If the source string contains international characters, use AnsiStrLower instead. If the source string is a Pascal string, use LowerCase (or AnsiLowerCase) instead.


StrMove function

See also 	Example

Copies specified number of characters to string.

Unit

Sysutils

Category

string handling routines (null-terminated)

function StrMove(Dest: PChar; const Source: PChar; Count: Cardinal): PChar;

Description

StrMove copies exactly Count characters from Source to Dest and returns Dest. Source and Dest can overlap.


StrNew function

See also 	Example

Allocates space on and copies a string to the heap; returning a pointer to the string.

Unit

Sysutils

Category

backward compatibility routines

function StrNew(const Str: PChar): PChar;

Description

StrNew allocates a copy of Str on the heap.

If Str is nil or points to an empty string, StrNew returns a pointer to a new empty string.

Otherwise, StrNew makes a duplicate of Str, obtaining space with a call to StrAlloc, and returns a pointer to the duplicated string.

The allocated space is the length of Str + 5 bytes.


StrPas function

See also

Converts null-terminated string to a Pascal string.

Unit

Sysutils

Category

backward compatibility routines

function StrPas(const Str: PChar): string;

Description

This function is provided for backwards compatibility only. To convert a null terminated string to a Pascal-type string, use a typecast or an assignment.


StrPCopy function

See also 	Example

Copies a Pascal string to a null-terminated string.

Unit

Sysutils

Category

string handling routines (null-terminated)

function StrPCopy(Dest: PChar; const Source: string): PChar;

Description

StrPCopy copies a Pascal-type string Source into a null-terminated string Dest. It returns a pointer to Dest.

StrPCopy does not perform any length checking.

The destination buffer must have room for at least Length(Source)+1 characters.


StrPLCopy function

Copies characters from a Pascal-style string into a null-terminated string.

Unit

Sysutils

Category

string handling routines (null-terminated)

function StrPLCopy(Dest: PChar; const Source: string; MaxLen: Cardinal): PChar;

Description

StrPLCopy copies up to a maximum of MaxLen characters from the Pascal-style string Source into the null-terminated string Dest. StrPLCopy returns a pointer to Dest.


StrPos function

See also 	Example

Returns a pointer to the first occurrence of STR2 in STR1.

Unit

Sysutils

Category

string handling routines (null-terminated)

function StrPos(const Str1, Str2: PChar): PChar;

Description

StrPos returns a pointer to the first occurrence of Str2 in Str1. If Str2 does not occur in Str1, StrPos returns nil.

Note:	If the source string contains international characters, use AnsiStrPos instead.


StrRScan function

See also 	Example

Returns a pointer to the last occurrence of a specified character in a string.

Unit

Sysutils

Category

string handling routines (null-terminated)

function StrRScan(const Str: PChar; Chr: Char): PChar;

Description

StrRScan returns a pointer to the last occurrence of Chr in Str.

If Chr does not occur in Str, StrRScan returns nil. The null terminator is considered to be part of the string.

Note:	If the source string contains international characters, use AnsiStrRScan instead.


StrScan function

See also 	Example

Returns a pointer to first occurrence of a specified character in a string.

Unit

Sysutils

Category

string handling routines (null-terminated)

function StrScan(const Str: PChar; Chr: Char): PChar;

Description

StrScan returns a pointer to the first occurrence of Chr in Str. If Chr does not occur in Str, StrScan returns nil. The null terminator is considered to be part of the string.

Note:	If the source string contains international characters, use AnsiStrScan instead.


StrToCurr function

See also

Converts a string to a Currency value.

Unit

Sysutils

Category

floating point conversion routines

function StrToCurr(const S: string): Currency;

Description

Call StrToCurr to convert a string that represents a floating-point value to the corresponding Currency value. The source string, S, must consist of an optional sign (+ or -), a string of digits with an optional decimal point, and an optional 'E' or 'e' followed by a signed integer. Leading and trailing blanks are ignored.

The DecimalSeparator global variable defines the character that is used as a decimal point. Thousand separators and currency symbols are not allowed in the string. If the string doesn't contain a valid value, StrToCurr raises an EConvertError exception.


StrToDate function

See also 	Example

Converts a string to a TDateTime value.

Unit

Sysutils

Category

date/time routines

function StrToDate(const S: string): TDateTime;

Description

Call StrToDate to parse a string that specifies a date. If S does not contain a valid date, StrToDate raises an EConvertError exception.

S must consist of two or three numbers, separated by the character defined by the DateSeparator global variable. The order for month, day, and year is determined by the ShortDateFormat global variable--possible combinations are m/d/y, d/m/y, and y/m/d.

If S contains only two numbers, it is interpreted as a date (m/d or d/m) in the current year.

Year values between 0 and 99 are converted using the TwoDigitYearCenturyWindow global variable. If TwoDigitYearCenturyWindow is 0, year values between 0 and 99 are assumed to be in the current century. If TwoDigitYearCenturyWindow is greater than 0, its value is subtracted from the current year to determine the “pivot”; years on or after the pivot are kept in the current century, while years prior to the pivot are moved to the next century. For example:

Current year	TwoDigitYearCenturyWindow	Pivot	date = mm/dd/03	date = mm/dd/50	date = mm/dd/68
1998	0	1900	1903	1950	1968
2002	0	2000	2003	2050	2068
1998	50	1948	2003	1950	1968
2000	50	1950	2003	1950	1968
2002	50	1952	2003	2050	1968
2020	50	1970	2003	2050	2068
2020	10	2010	2103	2050	2068
Note:	The format of the date string varies when the values of date/time formatting variables are changed.


StrToDateTime function

See also 	Example

Converts a string to a TDateTime value.

Unit

Sysutils

Category

date/time routines

function StrToDateTime(const S: string): TDateTime;

Description

Call StrToDate to parse a string that specifies a date and time value. If S does not contain a valid date, StrToDate raises an EConvertError exception.

The S parameter must be in the MM/DD/YY HH:MM:SS format. Specifying AM or PM as part of the time is optional, as are the seconds. Use 24-hour time (7:45 PM is entered as 19:45, for example) if AM or PM is not specified.

Y2K issue:	The conversion of two-digit year values is determined by the TwoDigitYearCenturyWindow variable. For more information, see StrToDate.

Note:	The format of the date and time string varies when the values of date/time formatting variables are changed.


StrToFloat function

See also

Converts a given string to a floating-point value.

Unit

Sysutils

Category

floating point conversion routines

function StrToFloat(const S: string): Extended;

Description

Use StrToFloat to convert a string, S, to a floating-point value. S must consist of an optional sign (+ or -), a string of digits with an optional decimal point, and an optional mantissa. The mantissa consists of 'E' or 'e' followed by an optional sign (+ or -) and a whole number. Leading and trailing blanks are ignored.

The DecimalSeparator global variable defines the character that must be used as a decimal point. Thousand separators and currency symbols are not allowed in the string. If S doesn't contain a valid value, StrToFloat raises an EConvertError exception.


StrToInt function

See also 	Example

Converts a string that represents an integer (decimal or hex notation) to a number.

Unit

Sysutils

Category

type conversion routines

function StrToInt(const S: string): Integer;

Description

StrToInt converts the string S, which represents an integer-type number in either decimal or hexadecimal notation, into a number. If S does not represent a valid number, StrToInt raises an EConvertError exception.


StrToInt64 function

See also

Converts a string that represents an integer (decimal or hex notation) to a number.

Unit

Sysutils

Category

type conversion routines

function StrToInt64(const S: string): Int64;

Description

StrToInt64 converts the string S, which represents an integer-type number in either decimal or hexadecimal notation, into a number. If S does not represent a valid number, StrToInt64 raises an EConvertError exception.


StrToInt64Def function

See also

Converts a string that represents an integer (decimal or hex notation) to a number.

Unit

Sysutils

Category

type conversion routines

function StrToInt64Def(const S: string; Default: Int64): Int64;

Description

StrToInt64Def converts the string S, which represents an integer-type number in either decimal or hexadecimal notation, into a number. If S does not represent a valid number, StrToInt64Def returns the number passed in Default.


StrToIntDef function

See also 	Example

Converts a string that represents an integer (decimal or hex notation) to a number.

Unit

Sysutils

Category

type conversion routines

function StrToIntDef(const S: string; Default: Integer): Integer;

Description

StrToIntDef converts the string S, which represents an integer-type number in either decimal or hexadecimal notation, into a number. If S does not represent a valid number, StrToIntDef returns the number passed in Default.


StrToTime function

See also 	Example

Converts a string to a TDateTime value.

Unit

Sysutils

Category

date/time routines

function StrToTime(const S: string): TDateTime;

Description

Call StrToTime to parse a string that specifies a time value. If S does not contain a valid time, StrToTime raises an EConvertError exception.

The S parameter must consist of two or three numbers, separated by the character defined by the TimeSeparator global variable, optionally followed by an AM or PM indicator. The numbers represent hour, minute, and (optionally) second, in that order. If the time is followed by AM or PM, it is assumed to be in 12-hour clock format. If no AM or PM indicator is included, the time is assumed to be in 24-hour clock format.

Note:	The format of the date and time string varies when the values of date/time formatting variables are changed.


StrUpper function

See also 	Example

Returns a string in upper case.

Unit

Sysutils

Category

string handling routines (null-terminated)

function StrUpper(Str: PChar): PChar;

Description

StrUpper converts Str to uppercase and returns Str.

Note:	If the source string contains international characters, use AnsiStrUpper instead. If the source string is a Pascal string, use UpperCase (or AnsiUpperCase) instead.


Supports function

See also

Indicates whether a given object or IUnknown interface supports a specified interface.

Unit

Sysutils

Category

COM utilities

function Supports(const Instance: IUnknown; const Intf: TGUID; out Inst): Boolean;

function Supports(Instance: TObject; const Intf: TGUID; out Inst): Boolean;

Description

Call Supports to determine whether the object or interface specified by Instance supports the interface identified by the Intf parameter. If Instance supports the interface, Supports returns the interface as the Inst parameter and returns True. Otherwise Supports returns False.

To determine whether Intf is supported, Supports calls the QueryInterface method of the supplied interface (or the interface of the supplied object). However, unlike calling QueryInterface directly, Supports lets you pass a nil value as the instance.


SysErrorMessage function

See also

Converts Win32 API error codes into strings.

Unit

Sysutils

Category

exception handling routines

function SysErrorMessage(ErrorCode: Integer): string;

Description

SysErrorMessage returns an error message string that corresponds to the specified Win32 API error code. This function can be used to convert Windows error codes into strings.


SystemTimeToDateTime function

See also 	Example

Converts a TSystemTime value into a TDateTime value.

Unit

Sysutils

Category

date/time routines

function SystemTimeToDateTime(const SystemTime: TSystemTime): TDateTime;

Description

Call SystemTimeToDateTime to convert a value from Windows 32's TSystemTime API format to a TDateTime value.


TextToFloat function

Returns a floating-point value from a null-terminated string.

Unit

Sysutils

Category

floating point conversion routines

function TextToFloat(Buffer: PChar; var Value; ValueType: TFloatValue): Boolean;

Description

TextToFloat converts the null-terminated string given by Buffer to a floating-point value that is returned in the variable given by Value. The Value parameter must be a variable of type Extended or Currency, as indicated by the ValueType parameter. The return value is True if the conversion was successful, or False if the string is not a valid floating-point value.

Note:	The conversion of the string in Buffer is influenced by formatting variables.


Time function

See also 	Example

Returns the current time.

Unit

Sysutils

Category

date/time routines

function Time: TDateTime;

Description

Time returns the current time as a TDateTime value.


TimeStampToDateTime function

See also

Converts a TTimeStamp value into the corresponding TDateTime value.

Unit

Sysutils

Category

date/time routines

function TimeStampToDateTime(const TimeStamp: TTimeStamp): TDateTime;

Description

Call TimeStampToDateTime to convert a TTimeStamp value into a TDateTime value. TTimeStamp values represent time as separate date and time values, where the date is the number of calendar days since the start of the current calendar (that is, January 1, 0001 would have a value of 1), and time is the number of milliseconds since midnight. TDateTime values represent time as the number of days (including fractional days) that have elapsed since 12:00 am on December 30, 1899.


TimeStampToMSecs function

See also

Converts a TTimeStamp value into an absolute number of milliseconds.

Unit

Sysutils

Category

date/time routines

function TimeStampToMSecs(const TimeStamp: TTimeStamp): Comp;

Description

Call TimeStampToMSecs to convert TimeStamp, a TTimeStamp value, into the total number of milliseconds that comprise the Date field plus the number of milliseconds given in the Time field.


TimeToStr function

See also 	Example

Returns a string that represents a TDateTime value.

Unit

Sysutils

Category

date/time routines

function TimeToStr(Time: TDateTime): string;

Description

TimeToStr converts the Time parameter, a TDateTime value, to a string. The conversion uses the format specified by the LongTimeFormat global variable. Change the format of the string by changing the values of some of the date and time variables.


Trim function

See also

Trims leading and trailing spaces and control characters from a string.

Unit

Sysutils

Category

string handling routines

function Trim(const S: string): string;

Description

Trim removes leading and trailing spaces and control characters from the given string S.


TrimLeft function

See also

Trims leading spaces and control characters from a string.

Unit

Sysutils

Category

string handling routines

function TrimLeft(const S: string): string;

Description

TrimLeft returns a copy of the string S with leading spaces and control characters removed.


TrimRight function

See also

Trims trailing spaces and control characters from a string.

Unit

Sysutils

Category

string handling routines

function TrimRight(const S: string): string;

Description

TrimRight returns a copy of the string S with trailing spaces and control characters removed.


UnloadPackage procedure

See also

Unloads a package.

Unit

Sysutils

Category

package support routines

procedure UnloadPackage(Module: HMODULE);

Description

Call UnloadPackage to unload a package that was loaded using the LoadPackage function. UnloadPackage performs any finalization of units contained in the package and then unloads the package BPL.


UpperCase function

See also 	Example

Returns a copy of a string in uppercase.

Unit

Sysutils

Category

string handling routines

function UpperCase(const S: string): string;

Description

UpperCase returns a copy of the string S, with the same text but with all 7-bit ASCII characters between 'a' and 'z' converted to uppercase. To convert 8-bit international characters, use AnsiUpperCase instead.


Win32Check function

See also

Checks the return value of a Windows API call and raises an appropriate exception when it indicates failure.

Unit

Sysutils

Category

exception handling routines

function Win32Check(RetVal: BOOL): BOOL;

Description

Call Win32Check with the return value of a Windows API call that returns a Boolean to indicate success or failure. If the Windows API returns False (indicating failure), Win32Check calls RaiseLastWin32Error to raise an exception.  If the Windows function returns True, Win32Check returns True.


Win32Platform variable

Specifies the Win32 platform identifier.

Unit

Sysutils

Category

application-level information

var Win32Platform: Integer = 0;

Description

Win32Platform is used to identify the type of Win32 platform the system is running. This will be one of the following values:

Value	Meaning
VER_PLATFORM_WIN32s	System is Win32s.
VER_PLATFORM_WIN32_WINDOWS	System is Windows 95.
VER_PLATFORM_WIN32_NT	System is Windows NT.
See WINDOWS.PAS for their associated numerical values.


WrapText function
WrapText

Splits a string into multiple lines as its length approaches a specified size.

Unit

Sysutils

Category

string handling routines

function WrapText(const Line, BreakStr: string; nBreakChars: TSysCharSet; MaxCol: Integer):string; overload;

function WrapText(const Line, MaxCol: Integer = 45):string; overload;

Description

WrapText scans a string for occurrences of any of the characters specified by nBreakChars and inserts a line-break, specified by BreakStr, at the last occurrence of a character in nBreakChars before MaxCol. Line is the text WrapText scans. MaxCol is the maximum line length.

If the BreakStr and nBreakChars parameters are omitted, WrapText searches for space, hyphen, or tab characters on which to break the line and inserts a carriage return/line feed pair at the break points.

WrapText does not insert a break into an embedded quoted string (both single quotes and double quotes are supported).

For example, the following call wraps the text into two lines at the last space character:

WrapText('The rain in Spain falls mainly on the plain.', #13#10, ['.',' ',#9,'-'], 42);

The result:

The rain in Spain falls mainly on the

plain.


 TSaveDialog

Hierarchy	Properties	Methods	Events	See also

TSaveDialog displays a “Save As” dialog for saving files.

Unit

dialogs

Description

TSaveDialog displays a modal Windows dialog box for selecting file names and saving files. The dialog does not appear at runtime until it is activated by a call to the Execute method. When the user clicks Save, the dialog closes and the selected file name is stored in the FileName property.


TSaveDialog properties

TSaveDialog	Alphabetically	Legend

Derived from TOpenDialog

DefaultExt

FileEditStyle

FileName

Files

Filter

FilterIndex

HistoryList

InitialDir

Options

Title

Derived from TCommonDialog

Ctl3D

Handle

HelpContext

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TSaveDialog properties

TSaveDialog	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Ctl3D

DefaultExt

DesignInfo

FileEditStyle

FileName

Files

Filter

FilterIndex

Handle

HelpContext

HistoryList

InitialDir

Name

Options

Owner

Tag

Title

VCLComObject


TSaveDialog events

TSaveDialog	Alphabetically	Legend

Derived from TOpenDialog

OnCanClose

OnFolderChange

OnIncludeItem

OnSelectionChange

OnTypeChange

Derived from TCommonDialog

OnClose

OnShow


TSaveDialog events

TSaveDialog	By object	Legend

OnCanClose

OnClose

OnFolderChange

OnIncludeItem

OnSelectionChange

OnShow

OnTypeChange


TSaveDialog methods

TSaveDialog	Alphabetically	Legend

In TSaveDialog

Execute

Derived from TOpenDialog

Create

Destroy

Derived from TCommonDialog

DefaultHandler

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSaveDialog methods

TSaveDialog	By object	Legend

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Execute

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TSaveDialog.Execute

Execute displays the Save As dialog box.

function Execute: Boolean; override;

Description

Execute opens the Save As dialog, returning True when the user selects a file name and clicks Save.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog

TOpenDialog

Normal


 TSavePictureDialog

Hierarchy	Properties	Methods	Events	See also

TSavePictureDialog displays a “Save As” dialog for saving graphics files.

Unit

extdlgs

Description

TSavePictureDialog displays a modal Windows dialog box for selecting file names and saving graphics files. This component is just like TSaveDialog, except that it includes a rectangular preview region. If the selected image can be read by TPicture, it is displayed in the preview region; supported file types include bitmap (.BMP), icon (.ICO), Windows metafile (.WMF), and enhanced Windows metafile (.EMF). If the selected image cannot be displayed, “(None)” appears in the preview region.


TSavePictureDialog properties

TSavePictureDialog	Alphabetically	Legend

Derived from TOpenDialog

DefaultExt

FileEditStyle

FileName

Files

Filter

FilterIndex

HistoryList

InitialDir

Options

Title

Derived from TCommonDialog

Ctl3D

Handle

HelpContext

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TSavePictureDialog properties

TSavePictureDialog	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Ctl3D

DefaultExt

DesignInfo

FileEditStyle

FileName

Files

Filter

FilterIndex

Handle

HelpContext

HistoryList

InitialDir

Name

Options

Owner

Tag

Title

VCLComObject


TSavePictureDialog events

TSavePictureDialog	Alphabetically	Legend

Derived from TOpenDialog

OnCanClose

OnFolderChange

OnIncludeItem

OnSelectionChange

OnTypeChange

Derived from TCommonDialog

OnClose

OnShow


TSavePictureDialog events

TSavePictureDialog	By object	Legend

OnCanClose

OnClose

OnFolderChange

OnIncludeItem

OnSelectionChange

OnShow

OnTypeChange


TSavePictureDialog methods

TSavePictureDialog	Alphabetically

In TSavePictureDialog

Execute

Derived from TOpenPictureDialog

Create

Destroy

Derived from TCommonDialog

DefaultHandler

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSavePictureDialog methods

TSavePictureDialog	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Execute

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TSavePictureDialog.Execute

TSavePictureDialog

Execute displays the Save As dialog box.

function Execute: Boolean; override;

Description

Execute opens the Save As dialog, returning True when the user selects a file name and clicks Save.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog

TOpenDialog

TOpenPictureDialog


TScreen

Hierarchy	Properties	Methods	Events	See also

TScreen represents the state of the screen in which an application runs.

Unit

forms

Description

TScreen introduces properties that keep track of

What forms and data modules have been instantiated by the application.

The active form, and the active control within that form.

The size and resolution of the screen.

The cursors and fonts available for the application to use.

There is a global variable, Screen, of type TScreen, which is already instantiated for use by Delphi applications. Use Screen to obtain information about the current state of the screen in an application.


TScreen properties

TScreen	Alphabetically	Legend

In TScreen

ActiveControl

ActiveCustomForm

ActiveForm

Cursor

Cursors

CustomFormCount

CustomForms

DataModuleCount

DataModules

DefaultIme

DefaultKbLayout

DesktopHeight

DesktopLeft

DesktopTop

DesktopWidth

Fonts

FormCount

Forms

Height

HintFont

IconFont

Imes

MenuFont

MonitorCount

Monitors

PixelsPerInch

Width

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TScreen properties

TScreen	By object	Legend

ActiveControl

ActiveCustomForm

ActiveForm

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Cursor

Cursors

CustomFormCount

CustomForms

DataModuleCount

DataModules

DefaultIme

DefaultKbLayout

DesignInfo

DesktopHeight

DesktopLeft

DesktopTop

DesktopWidth

Fonts

FormCount

Forms

Height

HintFont

IconFont

Imes

MenuFont

MonitorCount

Monitors

Name

Owner

PixelsPerInch

Tag

VCLComObject

Width


TScreen.ActiveControl

TScreen	See also

Indicates which control currently has input focus on the screen.

property ActiveControl: TWinControl;

Description

Read ActiveControl to learn which windowed control object in the active form currently receives the input from the keyboard.

ActiveControl is a read-only property. To change the ActiveControl, use the SetFocusedControl method of the form which contains control that should receive focus.

After focus shifts from one control to another, the screen receives an OnActiveControlChange event.


TScreen.ActiveCustomForm

TScreen	See also

Indicates the descendant of TCustomForm that currently has focus.

property ActiveCustomForm: TCustomForm;

Description

Read ActiveForm to learn which form or property page has input focus. If the active custom form is a TForm object, ActiveCustomForm is the same as ActiveForm.


TScreen.ActiveForm

TScreen	See also 	Example

Indicates which form currently has focus.

property ActiveForm: TForm;

Description

Read ActiveForm to learn which form in the application has input focus. If the application is not currently active, ActiveForm is the form that will have focus when the application becomes active again.

ActiveForm is a read-only property. To change the ActiveForm, use the SetFocus method of the form that should receive focus. ActiveForm will also change if the SetFocusedControl method of an inactive form is called to set focus to a control on that inactive form.

After focus shifts from one form to another, the screen receives an OnActiveFormChange event.


TScreen.Cursor

TScreen	See also 	Example

Controls the mouse cursor image on a global level.

property Cursor: TCursor;

Description

Set Cursor to override the cursor image associated with individual control objects. When Cursor is crDefault, the individual objects determine the cursor image. Assigning any other value sets the mouse cursor image for all windows belonging to the application. The global mouse cursor image remains in effect until the screen’s Cursor property is changed back to crDefault.

Cursor can be set to any of the cursor values available in the Cursors property. This can be one of the built-in cursor values, or a custom cursor that has been added to the Cursors property.


TScreen.Cursors

TScreen	See also 	Example

Lists the cursors available to the application.

property Cursors[Index: Integer]: HCursor;

Description

Use Cursor to access a particular cursor for use by the application or by a control within the application. TScreen includes several built-in cursors that are indexed by symbolic cursor constants. The image associated with the built-in cursors constants can be changed by setting the Cursors property.

Custom cursors can be added to the Cursors property for use by the application or any of its controls. To add a custom cursor to an application:

1	Create the cursor resource using a resource editor.

2	Declare a cursor constant with a value that does not conflict with an existing cursor constant.

3	Use the Windows API function LoadCursor to obtain a handle to the new cursor.

4	Set the Cursors property, indexed by the newly declared cursor constant, to the handle obtained from LoadCursor.

Note:	Don’t call the Windows API function DestroyCursor when finished with a custom cursor; Delphi does this automatically.


TScreen.CustomFormCount

TScreen	See also	Example

Indicates the number of forms or property pages displayed on the screen.

property CustomFormCount: Integer;

Description

Read CustomFormCount to learn the number of forms or property pages currently displayed on the screen. These forms can be accessed by the CustomForms property. CustomFormCount can be used with CustomForms to iterate over all the forms and property pages in an application.


TScreen.CustomForms

TScreen	See also 	Example

Lists all the forms and property pages that are currently displayed in the application.

property CustomForms[Index: Integer]: TCustomForm;

Description

Use CustomForms to access a form or property page by index. The value of Index is a number between zero (the first custom form) and CustomFormCount - 1. CustomForms can be used with CustomFormCount when an application needs to iterate over all its forms and property pages.


TScreen.DataModuleCount

TScreen	See also

Indicates the number of data modules that are currently instantiated in the application.

property DataModuleCount: Integer;

Description

Read DataModuleCount to learn the number of data modules in the DataModules property. DataModuleCount can be used with DataModules when an application needs to iterate over all its data modules.


TScreen.DataModules

TScreen	See also

Lists all the data modules that are currently instantiated in the application.

property DataModules[Index: Integer]: TDataModule;

Description

Use DataModules to access an instantiated data module by index. The value of Index is a number between zero (the first data module) and DataModuleCount - 1. DataModules can be used with DataModuleCount when an application needs to iterate over all its data modules.


TScreen.DefaultIme

TScreen	See also

Indicates which input method editor (IME) is active when the TScreen object is created.

property DefaultIme: string;

Description

In applications that support Asian language characters, read DefaultIme to determine the IME that is active when the application starts.

An IME is a front-end input processor for asian language characters. The IME hooks all keyboard input, converts it to asian characters in a conversion window, and sends the converted characters or strings on to the Delphi application. There can be multiple IMEs installed on a single system. They vary in user interface, conversion dictionaries, and input method.

Individual controls can override the default IME. When a control specifies a different IME should be used to enter information into the control, the IME that processes keyboard input changes when the control has focus. When the control loses focus, DefaultIme is restored as the system IME.


TScreen.DefaultKbLayout

TScreen	See also

Indicates the Windows handle to the keyboard layout that was active when the application started running.

property DefaultKbLayout: HKL;

Description

Use DefaultKbLayout for making Windows API calls that require a handle to a keyboard layout. For example, if an application changes the keyboard layout to match the settings for another country, the value of DefaultKbLayout can be used as a parameter to the Windows ActivateKeyboardLayout function in order to restore the original layout.

For asian keyboards, the keyboard layout identifies the input method editor (IME) as well as the default language. Use DefaultKbLayout in Windows API calls that work with the IME. DefaultKbLayout is the keyboard layout handle associated with the IME named by the DefaultIme property.


TScreen.DesktopHeight

TScreen

Specifies the height of the desktop relative to the upper-left corner of the primary monitor.

property DesktopHeight: Integer;

Description

Use DesktopHeight to determine the height of the desktop relative to the upper-left corner of the primary monitor (Monitors[0]).

On a single-monitor system, DesktopHeight corresponds to Height.


TScreen.DesktopLeft

TScreen

Specifies the x-coordinate of the desktop’s left edge relative to the upper-left corner of the primary monitor.

property DesktopLeft: Integer;

Description

Use DesktopLeft to determine the x-coordinate of the desktop’s left edge relative to the upper-left corner of the primary monitor (Monitors[0]).

On a single-monitor system, DesktopLeft corresponds to Left.


TScreen.DesktopTop

TScreen

Specifies the y-coordinate of the desktop’s top edge elative to the upper-left corner of the primary monitor.

property DesktopTop: Integer;

Description

Use DesktopTop to determine the y-coordinate of the desktop’s top edge elative to the upper-left corner of the primary monitor (Monitors[0]).

On a single-monitor system, DesktopTop corresponds to Top.


TScreen.DesktopWidth

TScreen

Specifies the width of the desktop elative to the upper-left corner of the primary monitor.

property DesktopWidth: Integer;

Description

Use DesktopWidth to determine the width of the desktop relative to the upper-left corner of the primary monitor (Monitors[0]).

On a single-monitor system, DesktopWidth corresponds to Width.


TScreen.Fonts

TScreen	See also 	Example

Lists the face names for all fonts supported by the screen.

property Fonts: TStrings;

Description

Read Fonts to learn what screen fonts are currently installed. Applications can use Fonts to ensure that they do not request a font that is not installed on the user’s system. When an application uses a TFont object to request a font that is not installed, Windows substitutes another font, which may not be a font appropriate to the application’s needs.

Note:	Fonts is a list of screen fonts. It does not give any indication of the printer fonts available to the application.


TScreen.FormCount

TScreen	See also 	Example

Indicates the number of forms displayed on the screen.

property FormCount: Integer;

Description

Read FormCount to learn the number of forms currently displayed on the screen. These forms can be accessed by the Forms property. FormCount can be used with Forms to iterate over all the forms in an application.


TScreen.Forms

TScreen	See also 	Example

Lists all the forms currently displayed in the application.

property Forms[Index: Integer]: TForm;

Description

Use Forms to access a form by index. The value of Index is a number between zero (the first form) and FormCount - 1. Forms can be used with FormCount when an application needs to iterate over all its forms, including all dialogs.


TScreen.Height

TScreen	See also 	Example

Indicates the vertical size of the screen in pixels.

property Height: Integer;

Description

Read Height to learn the size of the user’s screen in pixels. The size or position of objects placed on the screen, can then be set to ensure that the objects fit on screen and don’t look crowded.


TScreen.HintFont

TScreen	See also

Specifies the font used to display help hints.

property HintFont: TFont;

Description

HintFont stores the Windows 95 status font setting. This font is used by default for the help hints that appear when the user pauses the mouse over a control or menu item.


TScreen.IconFont

TScreen	See also

Specifies the font used to display the labels on the icons in file selection dialogs.

property IconFont: TFont;

Description

IconFont stores the Windows 95 icon font setting. This font is used to label the icons on the Windows desktop, and icons in the file selection dialogs.


TScreen.Imes

TScreen	See also

Lists all input method editors (IMEs) installed on the system.

property Imes: TStrings;

Description

Read Imes to obtain a list of all IMEs that are listed in the Windows registry. An IME is a front-end input processor for Asian language characters. The IME hooks all keyboard input, converts it to asian characters in a conversion window, and sends the converted characters or strings on to the Delphi application. IMEs vary in user interface, conversion dictionaries, and input method.

Individual controls can require a specific IME to process the keyboard input when they have focus. To specify an IME, the control sets its ImeName property to one of the strings in Imes.

Each IME name in Imes has an associated keyboard layout handle. A keyboard layout handle is a Windows handle that identifies the primary language and IME used to process keyboard input. Use the keyboard layout handle in Windows API calls for programming the IME. To get the keyboard layout handle for a particular IME, a control can use code such as the following:

HKeyboard := Screen.Imes.Objects(Screen.Imes.IndexOf(ImeName));


TScreen.MenuFont

TScreen	See also

Specifies the font used for menu commands.

property MenuFont: TFont;

Description

MenuFont stores the Windows 95 menu font setting. This font is used for menu items in main menus or popup menus that do not draw their own menu items in an OnDrawItem event handler.


TScreen.MonitorCount

TScreen

Specifies the number of monitors used to comprise the desktop.

property MonitorCount: Integer;

Description

Use MonitorCount to determine the number of monitors used to comprise the desktop.


TScreen.Monitors

TScreen

Provides access to an individual monitor used to comprise the desktop.

property Monitors[Index: Integer]: TMonitor;

Description

Use Monitors to access an individual monitor used to comprise the desktop.

The Monitor with the zero index is the primary monitor.


TScreen.PixelsPerInch

TScreen	See also

Indicates the number of screen pixels that make up a logical inch in the vertical direction.

property PixelsPerInch: Integer;

Description

Read PixelsPerInch to convert between measurements in pixels and measurements in logical inches. PixelsPerInch is only accurate for vertical measurements. Most screens have a different scaling factor for horizontal measurements. The value in PixelsPerInch is set from Windows when Delphi loads.


TScreen.Width

TScreen	See also 	Example

Indicates the horizontal size of the screen in pixels.

property Width: Integer;

Description

Read Width to learn the size of the user’s screen in pixels. The size or position of objects placed on the screen, can then be set to ensure that the objects fit on screen and don’t look crowded.


TScreen events

TScreen	Alphabetically

In TScreen

OnActiveControlChange

OnActiveFormChange


TScreen events

TScreen	By object

OnActiveControlChange

OnActiveFormChange


TScreen.OnActiveControlChange

TScreen	See also 	Example

Occurs immediately after input focus changes to a new windowed control.

property OnActiveControlChange: TNotifyEvent;

Description

Write an OnActiveControlChange event handler to take specific action when input focus changes to a new control. The change in focus may be within the active form, or across forms to a new form that then becomes the active form.

When focus moves from one control to another, the following events occur.

1	If the new focused control is in a different form, focus moves to the new form.

2	Focus moves to the new active control.

3	If the active form changed, an OnActiveFormChange event occurs.

4	An OnActiveControlChange event occurs.


TScreen.OnActiveFormChange

TScreen	See also 	Example

Occurs immediately after a new form becomes active in a multi-form application.

property OnActiveFormChange: TNotifyEvent;

Description

Write an OnActiveFormChange event handler to take specific action when a new form becomes active. OnActiveFormChange occurs when the active form for the application changes, not when a form becomes active because the application becomes active.


TScreen methods

TScreen	Alphabetically

In TScreen

Create

Destroy

DisableAlign

EnableAlign

Realign

ResetFonts

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TScreen methods

TScreen	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

EnableAlign

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Realign

RemoveComponent

ResetFonts

SafeCallException

UpdateAction


TScreen.Create

TScreen	See also

Creates an instance of TScreen.

constructor Create(AOwner: TComponent); override;

Description

Do not create separate instances of TScreen. There is a global variable, Screen, of type TScreen, which is already instantiated for use by Delphi applications. The properties of Screen are global to the entire application.

Create allocates memory for the TScreen object and

Fills the Cursors property with the built-in cursors.

Fills the Fonts property with the available screen fonts.

Fills the Imes property will all registered input method editors (IMEs), and sets the DefaultIme and DefaultKbLayout properties.

Sets the PixelsPerInch property for the current screen resolution.

Creates helper objects for the IconFont, Forms and DataModules properties.


TScreen.Destroy

TScreen	See also

Destroys an instance of TScreen.

destructor Destroy; override;

Description

Do not destroy the global object Screen that is automatically instantiated in Delphi applications. Many VCL objects use screen.

Destroy frees the memory associated with the DataModules, Forms, Fonts, IconFont and Imes properties, and releases the cursors used by the Cursors property.


TScreen.DisableAlign

TScreen	See also

Prevents forms from being aligned in the screen.

procedure DisableAlign;

Description

Call DisableAlign to prevent forms from being aligned in the screen. After calling DisableAlign, the Align properties of the screen’s forms are ignored until the call is matched by a call to EnableAlign.


TScreen.EnableAlign

TScreen	See also

Allows forms to be aligned in the screen.

procedure EnableAlign;

Description

Call EnableAlign to allow forms to be aligned in the screen. After calling DisableAlign, the Align properties of the screen’s forms are ignored until that call is matched by a call to EnableAlign.


TScreen.Realign

TScreen	See also

Realigns the screen’s forms according to their Align properties.

procedure Realign;

Description

Call Realign to realign the screen’s forms according to their Align properties.


TScreen.ResetFonts

TScreen	See also

Reinitializes the fonts listed in the Fonts property.

procedure Realign;

Description

Call ResetFonts to ensure that the fonts listed in the Fonts property are up to date. ResetFonts reinitializes the Fonts property so that its value is reread from the operating system the next time it is needed.

TScreen calls ResetFonts internally in response to messages from Windows that the available fonts have changed.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


 TScrollBar

Hierarchy	Properties	Methods	Events	See also	Example

TScrollBar is a Windows scroll bar, which is used to scroll the contents of a window, form, or control.

Unit

stdctrls

Description

Use TScrollBar to add a free-standing scrollbar to a form. Many controls have properties that add scroll bars which are an integral part of the control. TScrollBar allows controls that do not have integrated scroll bars or groupings of controls to be scrolled when the user manipulates the TScrollBar object.

When the bi-directional mode of a scroll bar is changed, its coordinate system is reversed. Position zero in left-to-right mode is the left side, and position zero in right-to-left mode is the right side.


TScrollBar properties

TScrollBar	Alphabetically	Legend

In TScrollBar

Kind

LargeChange

Max

Min

PageSize

Position

SmallChange

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TScrollBar properties

TScrollBar	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

Kind

LargeChange

Left

LRDockWidth

Max

Min

Name

Owner

PageSize

Parent

ParentBiDiMode

ParentCtl3D

ParentShowHint

ParentWindow

PopupMenu

Position

ShowHint

Showing

SmallChange

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TScrollBar.Kind

TScrollBar 	Example

Specifies whether the scroll bar is horizontal or vertical.

type TScrollBarKind = (sbHorizontal, sbVertical);

property Kind: TScrollBarKind;

Description

Set Kind to indicate the orientation of the scrollbar. These are the possible values:

Value	Meaning

sbHorizontal	Scroll bar is horizontal

sbVertical	Scroll bar is vertical


TScrollBar.LargeChange

TScrollBar	See also 	Example

Determines how much Position changes when the user clicks the scroll bar on either side of the thumb tab or presses PgUp or PgDn.

type TScrollBarInc = 1..32767;

property LargeChange: TScrollBarInc;

Description

Set LargeChange to specify how much to change the value of Position when the user clicks on the side of the thumb tab (that is, on the thumb tab track, but not on the thumb tab itself). The Max and Min properties define the total range over which Position can vary.

For example, if Max is 30000 and Min is 0, the scroll box can assume 30,000 positions. If the LargeChange property setting is 10000 and the Position property is 0, the user can click the scroll bar track three times after the thumb tab before it moves all the way to the end of the scroll bar (30000 / 10000 = 3).

LargeChange should correspond to the portion of this range that the user sees in one page or screen, expressed in the logical units used by the Max, Min, and Position properties.


TScrollBar.Max

TScrollBar	See also 	Example

Specifies the maximum position represented by the scrollbar.

property Max: Integer;

Description

Set Max to the maximum value the Position property can take. The Max and Min properties define the total range over which Position can vary.


TScrollBar.Min

TScrollBar	See also 	Example

Specifies the minimum position represented by the scrollbar.

property Min: Integer;

Description

Set Min to the minimum value the Position property can take. The Min and Max properties define the total range over which Position can vary.


TScrollBar.PageSize

TScrollBar	See also

Specifies the distance along the track bar that corresponds to a single view.

property PageSize: Integer;

Description

Set PageSize to the distance along the track bar that corresponds to a single view. The current Position is marked by thumb tab. The PageUp key decrements the value of Position by PageSize, and PageDown key increments the value of Position by PageSize.

For example, the following code sets the thumb tab so that it represents the proportion of the scrolling range that is visible:

var

  TrackHeight: integer; { the size of the scroll bar track }

  MinHeight: integer; { the default size of the thumb tab }

begin

  MinHeight := GetSystemMetrics(SM_CYVTHUMB); { save default size }

  with ScrollBar1 do

  begin

    TrackHeight := ClientHeight - 2 * GetSystemMetrics(SM_CYVSCROLL);

    PageSize := TrackHeight div (Max - Min + 1);

    if PageSize < MinHeight then PageSize := MinHeight;

  end;

end;


TScrollBar.Position

TScrollBar	See also 	Example

Indicates the current position of the scrollbar.

property Position: Integer;

Description

Read Position to determine the current position of the thumb tab. This value can be used to determine how to scroll any components controlled by the scroll bar. When the user scrolls the scroll bar, the value of Position changes. Set Position to programmatically move the thumb tab of the scroll bar.

The number of possible positions on the scroll bar is determined by the difference between the Max property and the Min property. If Position has the same value as Min, the thumb tab appears at the far left of a horizontal scroll bar or the top of a vertical scroll bar. If Position has the same value as Max, the thumb tab appears at the far right of a horizontal scroll bar or the bottom of a vertical scroll bar.


TScrollBar.SmallChange

TScrollBar	See also 	Example

Determines how much Position changes when the user clicks the arrow buttons on the scroll bar or presses the arrow keys on the keyboard.

type TScrollBarInc = 1..32767;

property SmallChange: TScrollBarInc;

Description

Set SmallChange to specify how much to change the value of Position when the user clicks on the arrow buttons. The Max and Min properties define the total range over which Position can vary.

For example, if Max is 100 and Min is 0, the scroll box can assume 100 positions. If the SmallChange property setting is 5 and the Position property is 0, the user can click the down or right arrow button 20 times before the thumb tab is moved all the way to the end of the scroll bar.

SmallChange should correspond to the portion of this range that the user sees as one line or one item, expressed in the logical units used by the Max, Min, and Position properties.


TScrollBar events

TScrollBar	Alphabetically	Legend

In TScrollBar

OnChange

OnScroll

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnStartDrag

OnStartDock


TScrollBar events

TScrollBar	By object	Legend

OnChange

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnScroll

OnStartDock

OnStartDrag


TScrollBar.OnChange

TScrollBar	See also

Occurs immediately after the value of Position changes.

property OnChange: TNotifyEvent;

Description

Write an OnChange event handler to control another object or group of objects using TScrollBar. Adjust the objects controlled by the scrollbar to reflect the new value of Position.

OnChange occurs whether the value of Position is changed by the user or programmatically. If the value of Position is changed by the user, OnChange occurs immediately after the OnScroll event.


TScrollBar.OnScroll

TScrollBar	See also 	Example

Occurs when the user scrolls the scroll bar with the mouse or keyboard.

type

  TScrollCode = (scLineUp, scLineDown, scPageUp, scPageDown, scPosition, scTrack, scTop, scBottom, scEndScroll);

  TScrollEvent = procedure(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer) of object;

property OnScroll: TScrollEvent;

Description

Write an OnScroll to adjust the value of Position when the user scrolls the scroll bar. The ScrollPos parameter contains the new value that is about to be assigned to the Position property as a result of the scroll. Change ScrollPos to alter the result of the scroll.

The ScrollCode parameter indicates the type of user action that just scrolled the scrollbar. The ScrollCode parameter is one of these values:

Value	Meaning

scLineUp	User clicked the top or left scroll arrow or pressed the Up or Left arrow key.

scLineDown	User clicked the bottom or right scroll arrow or pressed the Down or Right arrow key.

scPageUp	User clicked the area to the left of the thumb tab or pressed the PgUp key.

scPageDown	User clicked the area to the right of the thumb tab or pressed the PgDn key.

scPosition	User positioned the thumb tab and released it.

scTrack	User is moving the thumb tab.

scTop	User moved the thumb tab to the top or far left on the scroll bar.

scBottom	User moved the thumb tab to the bottom or far right on the scroll bar.

scEndScroll	User finished moving the thumb tab on the scroll bar.


TScrollBar methods

TScrollBar	Alphabetically

In TScrollBar

Create

SetParams

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

Destroy

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

HasParent

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TScrollBar methods

TScrollBar	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetParams

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TScrollBar.Create

TScrollBar	See also

Creates and initializes an instance of TScrollBar.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create an instance of TScrollBar at runtime. Scroll bars placed on a form at design time are created automatically.

Pass a single Component as a parameter to provide the scroll bar with an Owner that is responsible for freeing it.

Create calls the inherited Create method, then sets the initial values for the scroll bar as follows:

ControlStyle is set to [csFramed, csDoubleClicks]

Height is set to the system horizontal scrollbar height, and Width to 121.

Kind is set to sbHorizontal.

Position is set to 0, Min to 0, and Max to 100.

SmallChange and LargeChange are both set to 1.

TabStop is set to True.


TScrollBar.SetParams

TScrollBar	See also

Sets the Position, Max, and Min property values all at once.

procedure SetParams(APosition, AMin, AMax: Integer);

Description

Use the SetParams method to set the Position, Min, and Max property values all at once, preventing repaints that would occur if each property value were set separately.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


 TScrollBox

Hierarchy	Properties	Methods	Events	See also

TScrollBox represents a scrolling area (a scroll box) in a window.

Unit

forms

Description

Use TScrollBox to create a scroll box in a window.

One use of a scroll box is to prevent areas of a window, such as a toolbar or status bar (TPanel components), from scrolling. To prevent a toolbar and status bar from scrolling, hide the window’s scroll bars, and then position a scroll box in the client area of the window between the toolbar and status bar. The scroll bars associated with the scroll box will appear to belong to the window, but will scroll only the area inside the scroll box.

Another use of scroll boxes is to create multiple scrolling areas (views) in a window. Views are common in commercial word-processor, spreadsheet, and project management applications.

A scroll box can contain objects, such as TButton and TCheckBox objects.


TScrollBox properties

TScrollBox	Alphabetically	Legend

In TScrollBox

BorderStyle

Derived from TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DockSite

DoubleBuffered

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

AutoSize

BiDiMode

Constraints

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TScrollBox properties

TScrollBox	By object	Legend

Action

Align

Anchors

AutoScroll

AutoSize

BiDiMode

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DockSite

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HorzScrollBar

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

VertScrollBar

Visible

VisibleDockClientCount

Width

WindowProc


TScrollBox.BorderStyle

TScrollBox

Specifies whether the scroll box has a border.

property BorderStyle: TBorderStyle;

Description

Use BorderStyle to get or set whether the scroll box has a border. BorderStyle can be one of the following TBorderStyle values:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border


TScrollBox events

TScrollBox	Alphabetically	Legend

Derived from TWinControl

OnDockDrop

OnDockOver

OnEnter

OnExit

OnGetSiteInfo

OnMouseWheel

OnMouseWheelDown

OnMouseWheelUp

OnUnDock

Derived from TControl

OnCanResize

OnClick

OnConstrainedResize

OnContextPopup

OnDblClick

OnDockDrop

OnDockOver

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnGetSiteInfo

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock

OnStartDrag


TScrollBox events

TScrollBox	By object	Legend

OnCanResize

OnClick

OnConstrainedResize

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp

OnMouseWheel

OnMouseWheelDown

OnMouseWheelUp

OnResize

OnStartDock

OnStartDrag

OnUnDock


TScrollBox.OnResize

TScrollBox

Occurs when the scroll box is resized.

property OnResize: TNotifyEvent;

Description

Use OnResize to perform special processing when the scroll box is resized.


TScrollBox methods

TScrollBox	Alphabetically

In TScrollBox

Create

Derived from TScrollingWinControl

Destroy

DisableAutoRange

EnableAutoRange

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TScrollBox methods

TScrollBox	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

DisableAutoRange

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EnableAutoRange

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TScrollBox.Create

TScrollBox	See also

Creates and initializes a new TScrollBox object.

constructor Create(AOwner: TComponent);

Description

Use Create to create and initialize a new TScrollBox object.

AOwner is a TComponent object that encapsulates the parent object for the scroll box.

Create performs the following tasks:

Assigns the Owner property.

Sets the ControlStyle property to csAcceptsControls, csCaptureMouse, csClickEvents, csSetCaption, csDoubleClicks.

Sets the Width property to 185 and the Height property to 41.

Sets the BorderStyle property to bsSingle.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TScrollingWinControl


TScroller

Hierarchy	Properties	Methods	Events	See also

TScroller is a horizontal scrolling control that provides basic horizontal scrolling capabilities.

Unit

tabs

Description

The TTabSet object uses TScroller to scroll its visible tabs. TScroller is provided for backward compatibility only. TScroller is similar to an up-down control (TUpDown) with a horizontal orientation, except that it does not work with a companion control.


TScroller properties

TScroller	Alphabetically	Legend

In TScroller

Change

Max

Min

Position

Derived from TWinControl

Brush

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TScroller properties

TScroller	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

Change

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Max

Min

Name

Owner

Parent

ParentWindow

Position

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TScroller.Change

TScroller	See also

Specifies the number of units to scroll when the user clicks the arrow buttons.

property Change: Integer;

Description

Set Change to indicate the number of units between Min and Max the Position moves whenever the user clicks on one of the arrow buttons. Change represents the mapping between the units used to specify Min, Max, and Position, and the logical units represented by the scroller.

For example, if the values of Min, Max, and Position are given in screen pixels, Change would be the number of pixels to scroll whenever the user clicks the scroll arrow.


TScroller.Max

TScroller	See also

Specifies the maximum value the Position property can take.

property Max: Longint;

Description

Use Max to set the upper limit of the scrolling range. The Max and Min properties define the range of values over which the scroller can scroll.


TScroller.Min

TScroller	See also

Specifies the minimum value the Position property can take.

property Min: Longint;

Description

Use Min to set the lower limit of the scrolling range. The Min and Max properties define the range of values over which the scroller can scroll.


TScroller.Position

TScroller	See also

Position is the current position in the scroll range.

property Position: Longint;

Description

Read Position to determine the current position the scroller represents. Position is a value between Min and Max. Use an OnClick event handler to notify the object being scrolled when the Position changes.


TScroller events

TScroller	Alphabetically	Legend

In TScroller

OnClick


TScroller events

TScroller	By object	Legend

OnClick


TScroller.OnClick

TScroller	See also

OnClick occurs after the Position property has been updated in response to the user clicking one of the arrow buttons.

property OnClick: TNotifyEvent;

Description

Write an OnClick event handler to implement the scrolling action of the object that uses the TScroller to control scrolling. When the user clicks one of the arrow buttons, the Position gets updated by Change (unless the Max or Min value is hit), and then an OnClick event occurs.


TScroller methods

TScroller	Alphabetically

In TScroller

Create

Destroy

Paint

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TScroller methods

TScroller	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

Paint

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TScroller.Destroy

TScroller	See also

Frees the memory associated with the TScroller object.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead, use the Free method, which checks whether the TScroller reference is nil before calling Destroy.


TScroller.Paint

TScroller	See also

Paints the image of the TScroller object into its canvas.

procedure Paint; override;

Description

Paint is called automatically in response to WM_PAINT messages. Paint paints the arrow buttons, graying them out when Position cannot be moved in the associated direction.


TScroller.Create

TScroller	See also

Creates an instance of TScroller.

constructor Create(AOwner: TComponent); override;

Description

Call TScroller to create an instance of TScroller at runtime. TScroller allocates the memory for the TScroller object and initializes

Width to 24 and Height to 13

Min and Max to 0

Position to 0

Change to 1

The AOwner parameter specifies the component (usually the form) that is responsible for freeing the scroller.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TScrollingWinControl

Hierarchy	Properties	Methods	See also

TScrollingWinControl is the base class for windowed controls that support scrolling.

Unit

forms

Description

Use TScrollingWinControl as a base class when defining a custom windowed control that supports scrolling.

Typically, a scrolling windowed control has horizontal and vertical scroll bars and scrolls a child control into view when the child control receives focus.

Examples of scrolling windowed controls include TForm and TScrollBox objects.

The scrolling window’s BiDiMode determines whether the left or right side of the window’s contents are displayed by default. The BiDiMode does not affect the window’s coordinate system. The scroll bars must be adjusted programmatically according to the system locale.


TScrollingWinControl properties

TScrollingWinControl	Alphabetically	Legend

In TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TScrollingWinControl properties

TScrollingWinControl	By object	Legend

Action

Align

Anchors

AutoScroll

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HorzScrollBar

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentWindow

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

VertScrollBar

Visible

VisibleDockClientCount

Width

WindowProc


TScrollingWinControl.AutoScroll

TScrollingWinControl	See also

Indicates whether scroll bars appear automatically on the scrolling windowed control if it is not large enough to display all of its controls.

property AutoScroll: Boolean;

Description

If AutoScroll is True, the scroll bars appear automatically when necessary. For example, if the user resizes the scrolling windowed control so that some of its controls are partially obscured, scroll bars appear.

If AutoScroll is False, scroll bars don’t appear automatically. In this case, use the HorzScrollBar and VertScrollBar properties to make scroll bars appear.


TScrollingWinControl.HorzScrollBar

TScrollingWinControl	See also 	Example

Represents the horizontal scroll bar for the scrolling windowed control.

property HorzScrollBar: TControlScrollBar;

Description

Use HorzScrollBar to hide, show, or manipulate the horizontal scroll bar for the scrolling windowed control.


TScrollingWinControl.VertScrollBar

TScrollingWinControl	See also	Example

Represents the vertical scroll bar for the scrolling windowed control.

property VertScrollBar: TControlScrollBar;

Description

Use VertScrollBar to hide, show, or manipulate the vertical scroll bar for the scrolling windowed control.


TScrollingWinControl methods

TScrollingWinControl	Alphabetically	Legend

In TScrollingWinControl

AdjustClientRect

AlignControls

AutoScrollEnabled

AutoScrollInView

ChangeScale

Create

CreateParams

CreateWnd

Destroy

DisableAutoRange

DoFlipChildren

EnableAutoRange

Resizing

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TScrollingWinControl methods

TScrollingWinControl	By object	Legend

AdjustClientRect

AfterConstruction

AlignControls

Assign

AutoScrollEnabled

AutoScrollInView

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ChangeScale

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParams

CreateParented

CreateParentedControl

CreateWnd

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

DisableAutoRange

Dispatch

Dock

DockDrop

DoFlipChildren

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EnableAutoRange

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

Resizing

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TScrollingWinControl.AdjustClientRect

TScrollingWinControl

Adjusts the ClientRect property to exclude the scroll bars.

procedure AdjustClientRect(var Rect: TRect); override;

Description

Adjusts the ClientRect property to exclude the scroll bars, then calls the inherited AdjustClientRect method.


TScrollingWinControl.AlignControls

TScrollingWinControl	See also

Aligns the controls in the scrolling windowed control.

procedure AlignControls(AControl: TControl; var ARect: TRect); override;

Description

Use AlignControls to align the controls in the scrolling windowed control according to the values of their Align properties.

AControl is a TControl object specifying the control that takes precedence in alignment when other controls have the same Align value. AControl can be nil.

ARect is a TRect object specifying the area in the scrolling windowed control that contains the controls to align. ARect is automatically set to the entire area of the scrolling windowed control.

If AutoScroll is True and the scrolling windowed control is not being resized,  the ranges of the scroll bars on the scrolling windowed control are automatically recalculated.

After recalculating the ranges of the scroll bars and setting the value of ARect, AlignControls calls TWinControl.AlignControls, passing the AControl and ARect objects.


TScrollingWinControl.AutoScrollEnabled

TScrollingWinControl

Returns whether automatic scrolling is enabled.

function AutoScrollEnabled: Boolean; virtual;

Description

Call AutoScrollEnabled to determine whether automatic scrolling is enabled.

AutoScrollEnabled returns True if the control is not a dock site using the dock manager and the AutoSize property is False.


TScrollingWinControl.AutoScrollInView

TScrollingWinControl	See also

Scrolls a control into the visible area of the scrolling windowed control.

procedure AutoScrollInView(AControl: TControl); virtual;

Description

Use AutoScrollInView to scroll the control specified by the AControl parameter into the visible area of the scrolling windowed control.

Unlike ScrollInView, AutoScrollInView does not perform scrolling when the scrolling windowed control or the specified control are being loaded from a stream.

AutoScrollInView calls ScrollInView to perform any needed scrolling.


TScrollingWinControl.ChangeScale

TScrollingWinControl	See also

Resizes the scrolling windowed control by a specific ratio.

procedure ChangeScale(M, D: Integer); override;

Description

Use ChangeScale to resize the scrolling windowed control by a specific ratio.

M is the multiplier of the ratio; D is the divisor of the ratio. For example, to resize the scrolling windowed control to four-fifths of its current size, set M to four and D to five.

ChangeScale recalculates the ranges of the scroll bars on the scrolling windowed control according to the ratio, and then calls TControl.ChangeScale.


.Create
TScrollingWinControl.Create

TScrollingWinControl	See also

Creates and initializes a new TScrollingWinControl object.

constructor Create(AOwner: TComponent); override;

Description

Use Create to create and initialize a new TScrollingWinControl object.

AOwner is a TComponent object that owns the scrolling windowed control.

After calling the inherited constructor, Create performs the following tasks:

Creates horizontal and vertical scroll bar objects and assigns them to HorzScrollBar and VertScrollBar respectively.

Sets AutoScroll to True.


TScrollingWinControl.CreateParams

TScrollingWinControl	See also

Initializes the window creation parameters so that the entire window is not redrawn when the width or height of the client area changes.

procedure CreateParams(var Params: TCreateParams); override;

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle. CreateParams calls the inherited method and uses that Window class style, removing the CS_HREDRAW and CS_VREDRAW styles from it.

By removing these styles the scrolling windowed control will only redraw the invalidated regions, not the entire window.


TScrollingWinControl.CreateWnd

TScrollingWinControl	See also

Creates a Windows control corresponding to the TScrollingWinControl object.

procedure CreateWnd; override;

Description

CreateWnd is called automatically when the control is first created or when the window must be destroyed and recreated to reflect property changes.

CreateWnd initializes the scroll bars on the scrolling windowed control and then calls TWinControl.CreateWnd.


TScrollingWinControl.Destroy

TScrollingWinControl	See also

Removes the TScrollingWinControl object from memory.

destructor Destroy; override;

Description

Do not call Destroy. Instead, call Free, which calls Destroy if the TScrollingWinControl object is not nil.

Destroy frees the HorzScrollBar and VertScrollBar properties and then calls TWinControl.Destroy.


TScrollingWinControl.DisableAutoRange

TScrollingWinControl	See also

Disables automatic scrolling.

procedure DisableAutoRange;

Description

Use DisableAutoRange to temporarily disable scrolling when rearranging controls on a form.  Use the EnableAutoRange method to turn scrolling on again when finished rearranging the controls.


TScrollingWinControl.DoFlipChildren

TScrollingWinControl	See also

Flips the control’s children.

procedure DoFlipChildren; override;

Description

The FlipChildren method calls DoFlipChildren to reverse the positions of child controls. DoFlipChildren moves the control’s children to opposite positions on the control; that is, children on the left side of the control are moved to the right side of the control and vice versa. In addition, DoFlipChildren moves the vertical scrollbars to the other side of the control.

Note:	DoFlipChildren is a protected helper method for the public FlipChildren method. Unlike FlipChildren, DoFlipChildren does not adjust the alignment of controls that are aligned to one of the edges of the windowed control.


TScrollingWinControl.EnableAutoRange

TScrollingWinControl	See also

Enables automatic scrolling.

procedure EnableAutoRange;

Description

Use EnableAutoRange to reenable scrolling after turning it off. This method can be used with the DisableAutoRange method to turn scrolling on and off.


TScrollingWinControl.Resizing

TScrollingWinControl

Makes any required adjustments when the window changes size.

procedure Resizing(State: TWindowState); virtual;

Description

This protected method is called automatically when the control’s window is resized. As implemented in TScrollingWinControl, Resizing does nothing. Descendants override this method to adjust to the change in window size.

The State parameter indicates the state of the scrolling windowed control after the resize operation.


TScrollingWinControl.ScrollInView

TScrollingWinControl	See also

Scrolls a control into the visible area of the scrolling windowed control.

procedure ScrollInView(AControl: TControl)

Description

Use ScrollInView to ensure that a specified control is in the visible area of the scrolling windowed control. AControl specifies the TControl object to scroll into view.

Note:	If the ComponentState property for AControl or the scrolling windowed control might be csLoading, use AutoScrollInView instead.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TSessionList

Hierarchy	Properties	Methods	See also

TSessionList provides management of Borland Database Engine (BDE) sessions within a database application.

Unit

dbtables

Description

Use TSessionList to manage session components in applications that provide multiple sessions. Delphi automatically creates a globally accessible default session list component named Sessions for all database applications. In a multi-session application there can be more than one active session, but only one session can be current at a time. TSessionList enables an application to switch current sessions.

Note:	Applications should not instantiate additional session list components.


TSessionList properties

TSessionList	Alphabetically	Legend

In TSessionList

Count

CurrentSession

List

Sessions


TSessionList properties

TSessionList	By object	Legend

Count

CurrentSession

List

Sessions


TSessionList.Count

TSessionList	See also	Example

Indicates the number of available sessions for the application.

property Count: Integer;

Description

Read Count to determine the current number of available sessions. Count is typically used to iterate through the list of available sessions to perform some universal action on all sessions. Used with the Sessions property, which enables an application to access a session by index number, Count specifies the maximum number of index entries for Sessions (Count - 1).


TSessionList.CurrentSession

TSessionList	See also

Returns a pointer to the current session component

property CurrentSession: TSession

Description

Use CurrentSession to determine or specify which session in a database application is the current session. By default the current session is a pointer to the default session component, Session, that is created automatically by Delphi for all database applications. Setting CurrentSession makes the specified session component the current one. While any number of sessions may be active, only one session can be current at a time.


TSessionList.List

TSessionList	See also

Returns a specified session component.

property List[const SessionName: String]: TSession;

Description

Use List to return a pointer to a specific session component managed by the session list. List does not change which session is current. SessionName specifies the session component to return, and must match the SessionName property of an existing session component. If no such session exists, List raises an EDatabaseError exception with a message specifying the invalid session name.

Note:	To prevent raising an exception, call the FindSession method instead of using the List property.


TSessionList.Sessions

TSessionList	See also	Example

Lists all active session components in the session list.

property Sessions[Index: Integer]: TSession;

Description

Use Sessions to access available session components. Index specifies the session to access. Index must be in the range of zero to the current value of the Count property minus one, or an EListError exception is raised describing the out of bounds condition.

For example, an application might iterate through all available sessions in the list to perform a global action on them.


TSessionList methods

TSessionList	Alphabetically

In TSessionList

Create

Destroy

FindSession

GetSessionNames

OpenSession

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TSessionList methods

TSessionList	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

FindSession

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetSessionNames

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

OpenSession

SafeCallException


TSessionList.Create

TSessionList	See also

Creates an instance of a TSessionList component.

constructor Create;

Description

Do not create instances of TSessionList. A default session list component, Sessions, is automatically created for all database applications. Secondary session lists are not necessary.

Create calls its inherited constructor, creates an empty list object to keep track of session components, and both creates and initializes a critical section for opening databases.


TSessionList.Destroy

TSessionList	See also

Destroys the instance of a session list component.

destructor Destroy;

Description

Do not call Destroy. Delphi automatically handles the destruction of the default session list component, Sessions, when an application closes.

Destroy closes all session components, deletes the BDE critical section, and calls its inherited destructor.


TSessionList.FindSession

TSessionList	See also

Searches the list of sessions for a specified session.

function FindSession(const SessionName: String): TSession;

Description

Call FindSession to determine whether or not a specified session exists. SessionName specifies the session to search for.

FindSession compares the SessionName parameter to the SessionName property for each session component in the session list. If a match is found, FindSession returns a pointer to the session component. If an application passes an empty string in SessionName, FindSession returns the default session, Session. If a match is not found, FindSession returns nil.


TSessionList.GetSessionNames

TSessionList	See also	Example

Populates a string list with the names of all available sessions.

procedure GetSessionNames(List: TStrings);

Description

Call GetSessionNames to retrieve a list of all available sessions. List is a string list object, created and maintained by the application, into which to store session names. Names returned by GetSessionNames correspond to the SessionName properties of all available sessions.


TSessionList.OpenSession

TSessionList	See also

Makes an existing session active, or creates a new session component and makes it active.

function OpenSession(const SessionName: String): TSession;

Description

Call OpenSession to make an existing session active, or to create a new session and make it active. SessionName specifies the name of the session to open.

OpenSession calls FindSession to see if the session specified in the SessionName parameter already exists. If it finds a match, it starts that session if necessary, and makes the session active. If OpenSession does not find an existing session, it creates a new session using the name specified in the SessionName parameter, starts the session, and makes it active.

In either case, OpenSession returns a session object.


Accessibility

Read-only


Hierarchy

TObject


 TSession

Hierarchy	Properties	Methods	Events	See also

TSession provides global management of a group of database connections within an application.

Unit

dbtables

Description

Use TSession to manage a group of database connections within an application. There are three uses for TSession: standard, multiple net files for Paradox, and multi-threaded database applications.

Delphi automatically creates a globally accessible default TSession component named Session for all database applications. The default session component handles standard database connections. An application can control the default session by accessing its properties, events, and methods at runtime.

Database applications that must simultaneously access Paradox tables located in different network locations can establish multiple sessions, one for each network location.

Finally, database applications that must establish multiple, concurrent connections to the same database, such as performing two queries against the same data at once, are multi-threaded applications. Multi-threaded applications must create and maintain one additional session component for each simultaneous connection to a single database server.

Note:	Applications that maintain multiple sessions can manage them through the TSessionList component. A default session list component, called Sessions—note the plural which distinguishes it from the default session component, Session—is automatically created for all database applications.


TSession properties

TSession	Alphabetically	Legend

In TSession

Active

AutoSessionName

ConfigMode

DatabaseCount

Databases

Handle

KeepConnections

Locale

NetFileDir

PrivateDir

SessionName

SQLHourGlass

TraceFlags

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TSession properties

TSession	By object	Legend

Active

AutoSessionName

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConfigMode

DatabaseCount

Databases

DesignInfo

Handle

KeepConnections

Locale

Name

NetFileDir

Owner

PrivateDir

SessionName

SQLHourGlass

Tag

TraceFlags

VCLComObject


TSession.Active

TSession	See also

Specifies whether or not a session is active.

property Active: Boolean;

Description

Examine Active at runtime for the default session, Session, to determine if it is active or not. Active is False by default, meaning there are no open database connections or datasets associated with the session. If Active is True, the session is active even if there are currently no active database connections.

Set the Active property at design time or runtime for additional session components in a database application. Setting Active to True starts the session and makes it the current session. Setting Active to True triggers an OnStartup event handler for the session and initializes the NetFileDir, PrivateDir, and ConfigMode properties.

Setting Active to False (the default), closes any open datasets, and disconnects from attached database servers.

Note:	An application can close the default session by setting Active to False, but this is not recommended.


TSession.AutoSessionName

TSession	See also

Indicates whether or not a unique session name is automatically generated for a session.

property AutoSessionName: Boolean;

Description

Set AutoSessionName to control whether or not a unique session name is automatically generated. AutoSessionName is intended to guarantee developers of multi-threaded applications that sessions spawned for each thread are unique at runtime.

When AutoSessionName is False (the default), the application must set the SessionName property for a session component. When AutoSessionName is True, TSession assigns the SessionName property automatically and replicates the session name across the SessionName properties of all dataset components in the data module or form where the session component appears. This allows applications to use sessions in data modules that are replicated over multiple threads. TSession constructs a session name by taking the current value of the Name property and appending an underscore (_) followed by a numeric value. For example, if Name is CustomerSession, then the AutoSessionName might be CustomerSession_2.

Note:	The following restrictions apply to AutoSessionName:

•	You cannot set AutoSessionName for a session in a data module or form that contains more than one session component.

•	You cannot add a session component to a data module or form that already contains a session component with AutoSessionName set to True.

•	You cannot directly set the SessionName property of a session when AutoSessionName is True.


TSession.ConfigMode

TSession	See also 	Example

Specifies how the Borland Database Engine (BDE) should handle aliases for the session.

const

cmVirtual = [cfmVirtual];

  cmPersistent = [cfmPersistent];

  cmSession = [cfmSession];

  cmAll = [cfmVirtual, cfmPersistent, cfmSession];

type

  TConfigModes = (cfmVirtual, cfmPersistent, cfmSession);

  TConfigMode = set of TConfigModes;

property ConfigMode: TConfigMode;

Description

Set ConfigMode to specify how the BDE should handle aliases created using the AddAlias or AddStandardAlias methods within the context of a session. ConfigMode also determines which BDE aliases are reported to a session when an application calls the GetAliasNames method.

The default setting for ConfigMode is cmAll, which is a constant that includes all possible set items defined in TConfigModes. The following table summarizes the possible BDE configuration modes that can be set for aliases:

Mode	Meaning

cfmVirtual	All aliases in the BDE configuration file, the BDE persistent store, and aliases local to the session are available to the session.

cfmPersistent	Only aliases in the BDE configuration file, or that are added to the persistent store are available to the session.

cfmSession	Only aliases created within this session are available to the session.

The main purpose of ConfigMode is to enable an application to specify and restrict aliases at the session level.

For backward compatibility with the older TConfigMode, use the constants cmVirtual, cmPersistent, cmSession, and cmAll. The first three correspond to the three TConfigModes values of the same names. The constant cmAll represents a ConfigMode setting of all three. The two command lines below, the first using TConfigModes values and the second using the corresponding constant, are functionally the same.

Session.ConfigMode := [cfmSession];

Session.ConfigMode := cmSession;

Note:	Aliases created within a session are not automatically saved to the BDE configuration file. To save an alias to the configuration file, call the SaveConfigFile method.


TSession.DatabaseCount

TSession	See also	Example

Indicates the number of active database components currently associated with the session.

property DatabaseCount: Integer;

Description

Examine DatabaseCount to determine the number of active database components associated with a session. As database connections are opened or closed during a session’s life-span, this number can change. If DatabaseCount is zero, there are currently no active database components for the session.

DatabaseCount is typically used with the Databases property to iterate through the current set of active databases in a session.


TSession.Databases

TSession	See also	Example

Provides an indexed array of all active database component names for a session.

property Databases[Index: Integer]: TDatabase;

Description

Use Databases to access active database components associated with a session. An active database is one that is currently connected to a database server.

Databases is typically used with the DatabaseCount property to iterate through the current set of active databases in a session.


TSession.Handle

TSession	See also

Specifies the Borland Database Engine (BDE) handle for the session.

type HDBISES: Longint;

property Handle: HDBISES;

Description

Use Handle only to bypass TSession methods and write directly to the BDE API. Many BDE function calls require a handle parameter. Handle is assigned an initial value when a session is activated.

Note:	Do not use this property unless an application requires BDE functionality not available through standard Delphi components.


TSession.KeepConnections

TSession	See also

Specifies whether or not a temporary database component created in the context of a session maintains a database server connection even if there are no active datasets associated with the database component.

property KeepConnections: Boolean;

Description

Use KeepConnections to specify whether or not temporary database components created at runtime maintain server connections even when they have no active datasets. If KeepConnections is True (the default), the application maintains database connections until the application exits or calls the DropConnections method. For connections to remote database servers, or for applications that frequently open and close datasets, KeepConnections should remain True to reduce network traffic and speed up processing.

When KeepConnections is False, an application disconnects from a database when all datasets associated with a database component are closed. Dropping a connection releases system resources allocated to the connection, but if a dataset is later reopened that uses the same database, the connection must be reestablished and initialized.

Note:	Duration of server connection for a persistent database component is determined by the database component’s KeepConnection property instead of the session’s KeepConnections property.


TSession.Locale

TSession	See also

Identifies the Borland Database Engine (BDE) language driver for the session component.

type TLocale: Pointer;

property Locale: TLocale;

Description

Examine Locale to determine the BDE language driver used by the session component. Applications that make direct calls to the BDE may need to pass Locale information as an API function parameter.

Note:	Do not use this property unless an application requires BDE functionality not available through standard data access components.


TSession.NetFileDir

TSession	See also

Specifies the directory that contains the Borland Database Engine (BDE) network control file, PDOXUSRS.NET.

property NetFileDir: String;

Description

Use NetFileDir to specify the directory that contains the BDE network control file, PDOXUSRS.NET. This file governs the sharing of Paradox tables on network drives. All applications that share Paradox tables on a network directory must specify the same value for this property, and must have read, write, and create rights for the directory.

Delphi derives an initial value for NetFileDir from the BDE configuration file for the Paradox driver. Any value assigned to NetFileDir at design time or runtime overrides the BDE configuration setting.


TSession.PrivateDir

TSession	See also

Specifies the directory in which to store temporary table processing files generated by the Borland Database Engine (BDE) for database components associated with a session.

property PrivateDir: String;

Description

Use PrivateDir to set the directory in which to store temporary table processing files for all database connections, such as those generated by the BDE to handle local SQL statements. Ordinarily this value is only set at runtime, so that a user’s local hard disk is used to store temporary files. Local storage of these files improves performance. If no value is specified for PrivateDir, the BDE automatically stores temporary files in the directory current at the time the BDE was initialized.

Note:	For applications that run directly from a networked file server, the application should set PrivateDir to a user’s local drive to improve performance and to prevent temporary files from being created on the server where they might conflict with temporary files created by other instances of the application.


TSession.SessionName

TSession	See also

Specifies a unique session name that can be used by database and dataset components to link to this session.

property SessionName: String;

Description

Set SessionName to a unique and meaningful name that can be used to link database and dataset components to the session. Database and dataset components each have corresponding SessionName properties that must either match the SessionName property of an active session or that be blank, indicating that they should be associated with the default session, Session.

Note:	If the AutoSessionName property is True, an application cannot set SessionName directly.


TSession.SQLHourGlass

TSession

Indicates whether or not the mouse cursor changes to an hourglass during BDE operations.

property SQLHourGlass: Boolean;

Description

Set SQLHourGlass to False if you do not want the mouse cursor to change to an hourglass while the BDE is waiting for an SQL server to perform an operation. This property must be set before the session is opened.


TSession.TraceFlags

TSession	See also

Specifies the database operations to track with the SQL Monitor at runtime.

type

  TTraceFlag = (tfQPrepare, tfQExecute, tfError, tfStmt, tfConnect, tfTransact, tfBlob, tfMisc, tfVendor, tfDataIn, tfDataOut);

TTraceFlags = set of TTraceFlag;

property TraceFlags: TTraceFlags;

Description

Use TraceFlags to specify which database operations the SQL Monitor should track in an application at runtime. TraceFlags is only meaningful for the SQL Monitor, which is provided to enable performance tuning and SQL debugging when working with remote SQL database servers.

Note:	Normally trace options are set from the SQL Monitor rather than setting TraceFlags in application code.

The value of a session component’s TraceFlags property determines the initial settings of the TraceFlags property for database components associated with the session.

The TTraceFlags type defines the individual values that can be included in the TraceFlags property. The following table summarizes those values:

Values	Meaning

tfQPrepare	Monitor Prepare statements.

tfQExecute	Monitor ExecSQL statements.

tfError	Monitor server error messages. Such messages may include an error code.

tfStmt	Monitor all SQL statements.

tfConnect	Monitor database connect and disconnect operations, including allocation of connection handles, and freeing connection handles.

tfTransact	Monitor transaction statements, such as StartTransaction, Commit, and Rollback.

tfBlob	Monitor operations on blob data types.

tfMisc	Monitor any statements not covered by other flag options.

tfVendor	Monitor direct API function calls to the database server.

tfDataIn	Monitor data received from a server.

tfDataOut	Monitor data sent to a server.

Because TraceFlags is a set property, an application can specify different combinations of flags to monitor different combinations of statements. For example, the following statement limits monitoring to database connections and SQL statement preparation:

TraceFlags := [tfConnect, tfQPrepare];


TSession events

TSession	Alphabetically	Legend

In TSession

OnPassword

OnStartup


TSession events

TSession	By object	Legend

OnPassword

OnStartup


TSession.OnPassword

TSession	See also

Occurs when an application attempts to open a Paradox table for the first time and the Borland Database Engine (BDE) reports insufficient access rights.

type TPasswordEvent = procedure(Sender: TObject; var Continue: Boolean) of object;

property OnPassword: TPasswordEvent;

Description

Write an OnPassword event handler to take specific action when an application attempts to open a password-protected Paradox table for the first time. To gain access to the Paradox table, the event handler must pass a valid password to the BDE. The event handler should call the AddPassword method to make the password available to the session.

Use Continue to conditionally finalize adding the password. If Continue is set to True, the password addition is attempted. If set to False, the attempt to add the password is abandoned.

procedure TForm1.OpenTableBtnClick(Sender: TObject);

begin

  Session.OnPassword := Password;

  try

    Table1.Open;

  except

    if not Table1.Active then begin

      ShowMessage('Could not open table');

      Application.Terminate;

    end;

  end;

end;

procedure TForm1.Password(Sender: TObject; var Continue: Boolean);

var

  Passwrd: String;

begin

  Passwrd := InputBox('Enter password', 'Password:', '');

  Continue := (Passwrd > '');

end;

Note:	If an OnPassword event does not exist, but the BDE reports insufficient access rights, Delphi displays a default dialog box that prompts for a password.


TSession.OnStartup

TSession	See also

Occurs when an application activates a session.

property OnStartup: TNotifyEvent;

Description

Write an OnStartup event handler to take specific actions when an application activates a session. A session is activated by setting its Active property to True, or by opening a database or dataset associated with the session (both of which set Active to True).


TSession methods

TSession	Alphabetically

In TSession

AddAlias

AddDriver

AddPassword

AddStandardAlias

Close

CloseDatabase

Create

DeleteAlias

DeleteDriver

Destroy

DropConnections

FindDatabase

GetAliasDriverName

GetAliasNames

GetAliasParams

GetConfigParams

GetDatabaseNames

GetDriverNames

GetDriverParams

GetPassword

GetStoredProcNames

GetTableNames

IsAlias

ModifyAlias

ModifyDriver

Open

OpenDatabase

RemoveAllPasswords

RemovePassword

SaveConfigFile

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSession methods

TSession	By object

AddAlias

AddDriver

AddPassword

AddStandardAlias

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Close

CloseDatabase

Create

DefaultHandler

DeleteAlias

DeleteDriver

Destroy

DestroyComponents

Destroying

Dispatch

DropConnections

ExecuteAction

FieldAddress

FindComponent

FindDatabase

Free

FreeInstance

FreeNotification

FreeOnRelease

GetAliasDriverName

GetAliasNames

GetAliasParams

GetConfigParams

GetDatabaseNames

GetDriverNames

GetDriverParams

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetPassword

GetStoredProcNames

GetTableNames

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsAlias

MethodAddress

MethodName

ModifyAlias

ModifyDriver

NewInstance

Open

OpenDatabase

RemoveAllPasswords

RemoveComponent

RemovePassword

SafeCallException

SaveConfigFile

UpdateAction


TSession.AddAlias

TSession	See also	Example

Adds a specified Borland Database Engine (BDE) alias to the session for an SQL database server.

procedure AddAlias(const Name, Driver: String; List: TStrings);

Description

Call AddAlias at runtime to create a session-specific BDE alias for an SQL database server. Name is the unique name to assign to the alias. Driver is the name of the SQL Links database driver to use for the alias. List is a string list containing parameters for the alias.

A session’s ConfigMode property determines whether an alias is local to the session, or is available to all applications in the BDE persistent store as long as any BDE clients are active. To save an alias permanently, call the SaveConfigFile method before ending the session.

Note:	Although AddAlias can be used to create a Paradox or dBASE alias, AddStandardAlias provides a simpler method for Paradox and dBASE alias creation.


TSession.AddDriver

TSession	See also

Adds a specified Borland Database Engine (BDE) driver to the session for an SQL database server.

procedure AddDriver(const Name: string; List: TStrings);

Description

Call AddDriver at runtime to create a BDE driver for an SQL database server. AddDriver can also be used to create ODBC driver entries. Name is the unique name to assign to the driver. List is a string list containing parameters for the alias.

A session’s ConfigMode property determines whether a driver is local to the session, or is available to all applications in the BDE persistent store as long as any BDE clients are active. To save a driver permanently, call the SaveConfigFile method before ending the session.


TSession.AddPassword

TSession	See also

Adds a password to the current session for accessing encrypted Paradox tables.

procedure AddPassword(const Password: String);

Description

Call AddPassword to provide a password for a session prior to opening an encrypted Paradox table that requires a password. If an application opens a Paradox table that requires a password for access, the session does not have a password assigned to it, and the application does not provide its own OnPassword event handler, Delphi displays a dialog box prompting the user for a valid password before allowing table access.

For example, to provide the String literal “secret” as a password for the session:

Session.AddPassword('secret');

Note:	If an application defines its own OnPassword event handler, the handler should call this method to add passwords for the session. All passwords assigned by AddPassword should be deleted with RemoveAllPasswords or RemovePassword before an application closes.


TSession.AddStandardAlias

TSession	See also	Example

Adds a standard Borland Database Engine (BDE) alias to the session for Paradox, dBASE, or ASCII tables.

procedure AddStandardAlias(const Name, Path, DefaultDriver: String);

Description

Call AddStandardAlias at runtime to create a session-specific BDE alias for Paradox, dBASE or ASCII tables. Name is the unique name to assign to the alias. Path specifies the directory where the database is located. DefaultDriver is the name of the standard BDE driver to use for the alias. If set, DefaultDriver must be one of “Paradox,” “DBASE,” or “ASCIIDRV”. If left blank DefaultDriver defaults to “Paradox”. DefaultDriver is used when attempting to open a table that both does not have an extension and is defined as a table of type ttDefault.

A session’s ConfigMode property determines whether an alias is local to the session, or is available to all applications in the BDE persistent store as long as any BDE clients are active. the lifetime of the session. To save an alias permanently, call the SaveConfigFile method before ending the session.

Note:	To create an alias for an SQL database, call AddAlias instead of AddStandardAlias.


TSession.Close

TSession	See also

Disconnects from all databases, and closes the session.

procedure Close;

Description

Call Close to end a session. Close disconnects from all active databases by freeing temporary database components, and calling the Close methods persistent database components, and then sets its own session handle to nil.

Note:	Setting the Active property to False also closes a session.


TSession.CloseDatabase

TSession	See also

Closes a database connection associated with the current session.

procedure CloseDatabase(Database: TDatabase);

Description

Call CloseDatabase to close a persistent database connection, or to close and free a temporary database connection. Database specifies the name of the database component for which to close the connection.

CloseDatabase decrements the specified database component’s reference count, and then, if the reference count is zero and the database component’s KeepConnection property is False, CloseDatabase either frees a temporary database component or closes the connection for a persistent database component.

Note:	Calling CloseDatabase for a persistent database component does not close the connection. To close a connection for a persistent database component, call the database component’s Close method directly.

Temporary database components are closed automatically when the last dataset associated with the database component is closed, but an application can call CloseDatabase prior to that time to force closure. Closing a connection established by a temporary database component does not free the component if the session’s KeepConnections property is True (the default). To free temporary database components after closing their connections call DropConnections.


TSession.Create

TSession	See also

Creates an instance of a TSession component.

constructor Create(AOwner: TComponent);

Description

Do not call Create directly. The default session component, Session, is created automatically for all database applications. To create additional sessions for a multi-threaded database application at runtime call Sessions.OpenSession instead of Create. OpenSession calls Create only if the session does not already exist. (At design time, create additional sessions by dropping them on a data module.)

Create calls its inherited constructor and ensures that the session component cannot be inherited should the data module or form on which it is placed be stored in the Object Repository. Create also:

Creates an empty list of database components for the session.

Sets the KeepConnections property to True.

Adds the session to the session list.

Sets the Handle property to nil.


TSession.DeleteAlias

TSession	See also

Removes a specified Borland Database Engine (BDE) alias from the session.

procedure DeleteAlias(const Name: String);

Description

Call DeleteAlias to remove a BDE alias from a session. Removing an alias makes the alias unavailable to the session, but does not remove it from the BDE configuration file if the alias was stored there when it was created. To remove an alias from the BDE configuration file follow the call to DeleteAlias with a call to SaveConfigFile.


TSession.DeleteDriver

TSession	See also

Removes a specified Borland Database Engine (BDE) driver from the session.

procedure DeleteDriver(const Name: String);

Description

Call DeleteDriver to remove a BDE driver from a session. Removing a driver makes the driver unavailable to the session, but does not remove it from the BDE configuration file if the driver was stored there when it was created. To remove a driver from the BDE configuration file follow the call to DeleteDriver with a call to SaveConfigFile.


TSession.Destroy

TSession	See also

Destroys the instance of a session component.

destructor Destroy;

Description

Do not call Destroy directly. For session components other than the default session, an application should call Free, which verifies that the session component is not nil before calling Destroy.

Warning: Never destroy the default session. Freeing of the default session is handled automatically when an application terminates.

Destroy performs the following actions before calling its inherited destructor:

Makes the session inactive, which closes all database connections.

Removes the session from the session list.

Resets database session references, if necessary.

Frees the list of database components associated with the session.


TSession.DropConnections

TSession	See also

Frees all temporary database components associated with a session if they are inactive.

procedure DropConnections;

Description

Use DropConnections to free all temporary database components that are currently inactive. If the KeepConnections property of the session is True (the default), then temporary database components created as needed for the session by Delphi at runtime are not automatically freed when their database connections are closed. DropConnections enables an application to free these components when they are no longer needed.


TSession.FindDatabase

TSession	See also

Searches a session’s list of database components for a specified database.

function FindDatabase(const DatabaseName: String): TDatabase;

Description

Call FindDatabase to determine whether or not a specified database is associated with a session. DatabaseName specifies the name of the database component for which to search.

FindDatabase compares DatabaseName to the DatabaseName property for each database component in a session’s list. If a match is found, FindDatabase returns a pointer to the database component. Otherwise FindDatabase returns nil.

An application can call FindDatabase to see if a database component already exists before creating a new database component for a session.

var

  DB: TDatabase;

begin

  DB := Session.FindDatabase('DBDEMOS');

  if (DB = nil) then { database doesn't exist for session so,}

    DB := Session.OpenDatabase('DBDEMOS'); { create and open it}

  if Assigned(DB) and DB.Active then begin

    DB.StartTransaction;

...

  end;

end;


TSession.GetAliasDriverName

TSession	See also

Provides the name of the database driver used by a specified Borland Database Engine (BDE) alias associated with the session.

function GetAliasDriverName(const AliasName: String): String;

Description

Call GetAliasDriverName to determine the BDE database driver used by a specific alias. AliasName is the name of the alias for which to return driver information.

For aliases corresponding to Paradox and dBASE tables, GetAliasDriverName returns “STANDARD”. For ASCII tables the return value is “ASCIIDRV”. For SQL databases, the driver name depends on the database server.


TSession.GetAliasNames

TSession	See also	Example

Populates a string list with the names of persistent Borland Database Engine (BDE) aliases.

procedure GetAliasNames(List: TStrings);

Description

Call GetAliasNames to retrieve a list of persistent BDE aliases—those aliases that exist in persistent storage or in the BDE configuration file. List is a string list object, created and maintained by the application, into which to store the alias names.

A session’s ConfigMode property determines whether an alias created in the context of this session is reported by GetAliasNames. If ConfigMode is cmAll, aliases created within the session are reported.


TSession.GetAliasParams

TSession	See also	Example

Retrieves the parameters associated with a specified Borland Database Engine (BDE) alias.

procedure GetAliasParams(const AliasName: String; List: TStrings);

Description

Call GetAliasParams to retrieve the BDE configuration parameters for a specified alias. AliasName is the name of the alias for which to retrieve parameters. List is a string list object, created and maintained by the application, into which to store the parameters.


TSession.GetConfigParams

TSession	See also

Retrieves Borland Database Engine (BDE) configuration information.

procedure GetConfigParams(const Path, Section: String; List: TStrings);

Description

Call GetConfigParams to retrieve specific types of configuration information from the BDE configuration file used to initialize the application.

Path represents the internal node structure of the BDE configuration file, and must always start at the root, denoted by a backslash. Each node must be separated from others by a backslash, and no node may be empty. For example, a Path of \SYSTEM\FORMATS\TIME, returns the time format used by the BDE configuration file.

Path can contain a replaceable string formatting symbol (%s) in one of its node designations. If it does, Section must contain the missing node information. In this case, GetConfigParams inserts the contents of Section into Path before calling the BDE for the requested information.

List is a string list object, created and maintained by the application, into which to store the configuration information. For example, if Path is \DATABASES\%s\DB INFO, and Section is an alias name, then GetConfigParams returns the parameters for the alias in List.

For more information about the BDE Configuration File, see the on-line BDE help.


TSession.GetDatabaseNames

TSession	See also	Example

Populates a string list with the names of persistent Borland Database Engine (BDE) aliases and the names of all databases components known to the session.

procedure GetDatabaseNames(List: TStrings);

Description

Call GetDatabaseNames to retrieve a sorted, combined list of persistent BDE aliases—those aliases that exist in persistent storage or in the BDE configuration file—and the names of all database components known to the session. List is a string list object, created and maintained by the application, into which to store the database and alias names.


TSession.GetDriverNames

TSession	See also	Example

Populates a string list with the names of all Borland Database Engine (BDE) drivers available to the session.

procedure GetDriverNames(List: TStrings);

Description

Call GetDriverNames to retrieve the names of all BDE drivers that can be used by a session. List is a string list object, created and maintained by the application, into which to store the driver names.


TSession.GetDriverParams

TSession	See also	Example

Populates a string list with the parameters for a specified Borland Database Engine (BDE) driver.

procedure GetDriverParams(const DriverName: String; List: TStrings);

Description

Call GetDriverParams to retrieve a list of parameters associated with a specified BDE driver. DriverName is the BDE driver for which to return a parameter list. List is a string list object, created and maintained by the application, into which to store the driver parameters.

The actual number of parameters returned by GetDriverParams depends on the specified driver. For example, for the STANDARD driver used by Paradox and dBASE, returns only a few parameters. For SQL Links drivers multiple parameters are returned.


TSession.GetPassword

TSession	See also

Invokes the OnPassword event handler for the session or displays the default password dialog box.

function GetPassword: Boolean;

Description

Call GetPassword to invoke the OnPassword event handler for the session and handle response logic when an application is working with password-protected Paradox files. If an OnPassword event handler is not defined, GetPassword displays the default password dialog box.

An application can use the return value of GetPassword to control program logic. GetPassword returns True if a user chooses OK, or False if the user chooses Cancel.

var

  rslt: Boolean;

begin

  rslt := Session.GetPassword;

  try

    if rslt then

      Table1.Open

    else

      ShowMessage('No password given');

  except

    ShowMessage('Could not open table!');

  end;

  if not Table1.Active then

    Application.Terminate;

end;


TSession.GetStoredProcNames

TSession	See also	Example

Populates a string list with the names of all stored procedures associated with a specified database component that is connected to an SQL database server.

procedure GetStoredProcNames(const DatabaseName: String; List: TStrings);

Description

Call GetStoredProcNames to retrieve a list of all stored procedures for a database component that is attached to an SQL database server. DatabaseName specifies the name of the database for which to retrieve stored procedure names. List is a string list object, created and maintained by the application, into which to return the stored procedure names.

Note:	GetStoredProcNames raises an exception if called on Paradox or dBASE databases.


TSession.GetTableNames

TSession	See also	Example

Populates a string list with the names of tables associated with a specified database component.

procedure GetTableNames(const DatabaseName, Pattern: String; Extensions, SystemTables: Boolean; List: TStrings);

Description

Call GetTableNames to retrieve a list of the tables associated with a given database. DatabaseName specifies the name of the database from which to retrieve table names.

Pattern specifies a delimiter string that restricts the tables returned to those that match the string. Pattern can include wildcard symbols. Pass an empty Pattern string to match all files not restricted by other criteria.

For searches on Paradox and dBASE, set Extensions to True to include filename extensions as part of the table name. For SQL-based databases, set Extension to False.

Set SystemTables to True for SQL-based databases to return both data tables and the system tables that define the database structure. Set SystemTables to False for Paradox and dBASE tables.

List is a string list object, created and maintained by the application, into which to return the table names.


TSession.IsAlias

TSession	See also	Example

Determines whether or not a string value corresponds to an existing Borland Database Engine (BDE) database alias known to the session.

function IsAlias(const Name: String): Boolean;

Description

Call IsAlias to determine if a string corresponds to the name of an existing BDE alias that can be used by the session. Name is the string to test.

If IsAlias returns True, Name is a valid alias.

Note:	The aliases known to IsAlias depend on the session’s ConfigMode property. If ConfigMode is cmAll, then all aliases are available to the session.


TSession.ModifyAlias

TSession	See also	Example

Adds or changes parameters for a Borland Database Engine (BDE) alias.

procedure ModifyAlias(Name: String; List: TStrings);

Description

Call ModifyAlias to change the parameters for a specified BDE alias. Name is the name of the alias to modify. List is a string list object previously populated with parameter values to add or change. An application must create and maintain List.

Populate List with parameter strings before calling ModifyAlias. List need only contain the parameters to change. If ModifyAlias passes a parameter for which a value already exists, the new parameter replaces the existing one. New parameters that are not yet defined for the alias are added to the existing parameters. If List is empty, ModifyAlias does not change any existing parameters.


TSession.ModifyDriver

TSession	See also

Adds or changes parameters for a Borland Database Engine (BDE) driver.

procedure ModifyDriver(Name: String; List: TStrings);

Description

Call ModifyDriver to change the parameters for a specified BDE database driver. Name is the name of the driver to modify. List is a string list object previously populated with parameter values to add or change. An application must create and maintain List.

Populate List with parameter strings before calling ModifyDriver. List need only contain the parameters to change. If ModifyDriver passes a parameter for which a value already exists, the new parameter replaces the existing one. New parameters that are not yet defined for the driver are added to the existing parameters. If List is empty, ModifyDriver does not change any existing parameters.

A session’s ConfigMode property determines whether a driver is local to the session, or is available to all applications in the BDE persistent store as long as any BDE clients are active. To save a driver permanently, call the SaveConfigFile method before ending the session.


TSession.Open

TSession	See also

Starts a session and makes it the current session.

procedure Open;

Description

Call Open to start a session other than the default session in a database application. Open sets Active to True, triggers an OnStartup event handler for the session and initializes the NetFileDir, PrivateDir, and ConfigMode properties.


TSession.OpenDatabase

TSession	See also

Opens an existing database, or creates a temporary database component and opens it.

function OpenDatabase(const DatabaseName: String): TDatabase;

Description

Call OpenDatabase to connect to a database for which a persistent database component already exists, or to create a temporary database component and connect to a database. DatabaseName specifies the database to open.

OpenDatabase makes the current session active, then calls FindDatabase to determine if the DatabaseName parameter corresponds to the DatabaseName property of an existing database component. If it does not, OpenDatabase creates a temporary database component, assigning the DatabaseName parameter to the DatabaseName property. Finally, OpenDatabase calls the Open method of the database to connect to a database server, then increments the session’s database reference count by one.


TSession.RemoveAllPasswords

TSession	See also

Deletes all passwords previously added to the current session for accessing encrypted Paradox tables.

procedure RemoveAllPasswords;

Description

Call RemoveAllPasswords to delete all current Paradox table passwords associated with the current session. Subsequent attempts to access encrypted Paradox tables fail unless an application first calls AddPassword to reestablish a password.

Note:	Ordinarily an application should call RemoveAllPasswords to remove all session-specific passwords it creates from the Borland Database Engine (BDE) persistent store before terminating.


TSession.RemovePassword

TSession	See also

Deletes a single password previously added to the current session for accessing an encrypted Paradox table.

procedure RemovePassword(const Password: String);

Description

Call RemovePassword to delete a single Paradox table password associated with the current session from the Borland Database Engine (BDE) persistent store. Subsequent attempts to access the encrypted Paradox table fails unless an application first calls AddPassword to reestablish a password.

Session.AddPassword('secret');

Session.RemovePassword('secret');


TSession.SaveConfigFile

TSession	See also	Example

Writes the current information in the Borland Database Engine (BDE) persistent store from memory to the BDE configuration file on disk.

procedure SaveConfigFile;

Description

Call SaveConfigFile to write any BDE configuration changes currently in memory to the BDE configuration file on disk. When the BDE is first initialized, the current BDE configuration file is read into persistent storage in memory. Applications can read or modify the configuration file in memory, but modification exist only in memory, not on disk.

For example, if an application defines a new BDE alias with AddAlias, the alias exists in memory only for as long as the BDE resides in memory. To store the new alias for later use by all applications that use the BDE, call SaveConfigFile. SaveConfigFile overwrites the disk image of the configuration file with the in-memory image of the persistent configuration file.

Note:	If a session’s ConfigMode property is cmSession, added aliases cannot be saved to the BDE configuration file.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


 TShape

Hierarchy	Properties	Methods	Events	See also

TShape represents a geometric shape that can be drawn on a form.

Unit

extctrls

Description

Add a TShape object to a form to draw a simple geometric shape on the form. TShape introduces properties to describe the pen used to outline the shape and the brush used to fill it.

If the shape is only part of the image of a TCustomControl object, use the methods of the control’s canvas instead.


TShape properties

TShape	Alphabetically	Legend

In TShape

Brush

Pen

Shape

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentShowHint

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TShape properties

TShape	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlState

ControlStyle

Cursor

DesignInfo

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentShowHint

Pen

Shape

ShowHint

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

Width

WindowProc


TShape.Brush

TShape	See also

Specifies the color and pattern used for filling the shape control.

property Brush: TBrush;

Description

Read Brush to obtain the TBrush object that represents the color and pattern that fill the interior of the shape. Use the properties of Brush to change the color or pattern.

Set the Brush property to assign another TBrush object to the TBrush object maintained by TShape.


TShape.Pen

TShape	See also

Specifies the pen used to outline the shape control.

property Pen: TPen;

Description

Read Pen to obtain the TPen object that represents the color and style of the line used to outline the shape. Use the properties of Pen to change the color or style.

Set the Pen property to assign another TPen object to the TPen object maintained by TShape.


TShape.Shape

TShape

Specifies the shape of the control.

Type TShapeType = (stRectangle, stSquare, stRoundRect, stRoundSquare, stEllipse, stCircle);

property Shape: TShapeType;

Description

Set Shape to the geometric shape that should be drawn on the form. The Shape property has these possible values:

Value	Meaning

stCircle	The shape is a circle.

stEllipse	The shape is an ellipse.

stRectangle	The shape is a rectangle.

stRoundRect	The shape is a rectangle with rounded corners.

stRoundSquare	The shape is a square with rounded corners.

stSquare	The shape is a square.


TShape events

TShape	Alphabetically	Legend

Derived from TControl

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TShape events

TShape	By object	Legend

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TShape methods

TShape	Alphabetically

In TShape

Create

Destroy

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DefaultHandler

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

Hide

InitiateAction

Invalidate

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TShape methods

TShape	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

NewInstance

Perform

Refresh

RemoveComponent

Repaint

ReplaceDockedControl

SafeCallException

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

UpdateAction

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TShape.Create

TShape	See also

Creates an instance of TShape.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TShape object at runtime. Shapes added to a form at design time are created automatically.

Create allocates memory and initializes the Height and Width properties of the shape to 65.


TShape.Destroy

TShape	See also

Destroys of an instance of TShape.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the object is not nil before it calls Destroy.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl


TSharedImage

Hierarchy	Methods	See also

TSharedImage is the abstract base class for classes that contain images used for graphics objects.

Unit

graphics

Description

TSharedImage is used as a base class for classes that hold the internal representation of graphical images such as bitmaps and icons. TSharedImage is an abstract class. Its descendant classes are used internally by Delphi graphics objects, and are automatically created by their associated graphics objects.


TSharedImage methods

TSharedImage	Alphabetically

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TSharedImage methods

TSharedImage	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


Hierarchy

TObject


TSizeConstraints

Hierarchy	Properties	Methods	Events

Contains size constraints for a control.

Unit

Controls

Description

Use TSizeConstraints to specify size constraints for a control.

TSizeConstraints is used in the Constraints property of TControl and its descendants.


TSizeConstraints properties

TSizeConstraints	Alphabetically	Legend

In TSizeConstraints

Control

MaxHeight

MaxWidth

MinHeight

MinWidth


TSizeConstraints properties

TSizeConstraints	By object	Legend

Control

MaxHeight

MaxWidth

MinHeight

MinWidth


TSizeConstraints.Control

TSizeConstraints	Properties

Specifies the control to which the size constraints apply.

property Control: TControl;

Description

Use Control to determine the control to which the size constraints apply.

Control is set automatically when a TSizeConstraints object is created for the Constraints property of a control.


TSizeConstraints.MaxHeight

TSizeConstraints	Properties

Specifies the maximum height for the control.

TConstraintSize = 0..MaxInt;

property MaxHeight: TConstraintSize;

Description

Use MaxHeight to get or set the maximum height for the control.


TSizeConstraints.MaxWidth

TSizeConstraints	Properties

Specifies the maximum width for the control.

TConstraintSize = 0..MaxInt;

property MaxWidth: TConstraintSize;

Description

Use MaxWidth to get or set the maximum width for the control.


TSizeConstraints.MinHeight

TSizeConstraints	Properties

Specifies the minimum height for the control.

TConstraintSize = 0..MaxInt;

property MinHeight: TConstraintSize;;

Description

Use MinHeight to get or set the minimum height for the control.


TSizeConstraints.MinWidth

TSizeConstraints	Properties

Specifies the minimum width for the control.

TConstraintSize = 0..MaxInt;

property MinWidth: TConstraintSize;;

Description

Use MinWidth to get or set the minimum width for the control.


TSizeConstraints events

TSizeConstraints	Alphabetically

In TSizeConstraints

OnChange


TSizeConstraints events

TSizeConstraints	By object

OnChange


TSizeConstraints.OnChange

TSizeConstraints	Events

Occurs when the size constraints change.

property OnChange: TNotifyEvent;

Description

Use OnChange to perform actions when the size constraints change.


TSizeConstraints methods

TSizeConstraints	Alphabetically	Legend

In TSizeConstraints

AssignTo

Change

Create

Derived from TPersistent

Assign

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TSizeConstraints methods

TSizeConstraints	By object	Legend

AfterConstruction

AssignTo

Assign

BeforeDestruction

Change

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

FreeInstance

Free

GetInterfaceEntry

GetInterfaceTable

GetInterface

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TSizeConstraints.AssignTo

TSizeConstraints	Methods

Handles assignments for TSizeConstraint objects.

procedure AssignTo(Dest: TPersistent); override;

Description

Call AssignTo to copy the values of one TSizeConstraints object to another.

AssignTo overrides the inherited method in order to handle assignments specific to TSizeConstraints objects.


TSizeConstraints.Change

TSizeConstraints	Methods

Called when the size constraints change.

procedure Change; dynamic;

Description

Override Change in a derived class to perform actions when the size constraints change.

By default, Change calls the OnChange event handler.


TSizeConstraints.Create

TSizeConstraints	Methods

Creates and initializes an instance of TSizeConstraints.

constructor Create(Control: TControl); virtual;

Description

Create sets the Control property to Control and then calls the inherited constructor.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent


TSmallIntField

Hierarchy	Properties	Methods	Events	See also

TSmallintField represents a signed 16-bit integer field in a dataset.

Unit

db

Description

TSmallIntField is a persistent field object that encapsulates the fundamental behavior common to small-integer fields. As a descendant of TIntegerField, TSmallIntField includes many properties, methods, and events that are useful for managing the value and properties of a field in a database. TSmallIntField introduces no new methods or events. TDateField reimplements the DataSize property, adapting it to small-integer type data.

As with all persistent field objects, a TSmallIntField can be created at design-time using the Fields Editor or at runtime by calling the constructor for the class. Persistent field objects exist solely in the memory space of a Delphi application. Creating a persistent field object only creates an object in the application, and does not result in the creation of a field in a table.

Fields in a table can be accessed without use of persistent field objects. Virtual field objects are created to provide access to a field when the field is referenced through such means as the TDataSet.::Fields property or the TDataSet.FieldByName method.

Small-integer fields can hold values in the range -32768 to 32767, and are used to hold values that are signed 16-bit whole numbers.


TSmallIntField properties

TSmallIntField	Alphabetically	Legend

In TSmallIntField

DataSize

Derived from TIntegerField

AsFloat

AsInteger

AsString

AsVariant

MaxValue

MinValue

Value

Derived from TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TSmallIntField properties

TSmallIntField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

MaxValue

MinValue

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ReadOnly

Required

Size

Tag

Text

ValidChars

Value

VCLComObject

Visible


TSmallIntField.DataSize

TSmallIntField	See also 	Example

Indicates the amount of memory needed to store the value of a small integer field in its native database format.

property DataSize: Word;

Description

Check DataSize to determine the number of bytes required to store a small integer field component’s value. Use DataSize to determine the size needed for a buffer when working with the GetData and SetData methods.

For small integer fields, DataSize is always 2. This is the size of 16-bit integer values in the database tables, not the size of the LongInt data type used to store and manipulate integer values by TSmallIntField.


TSmallIntField events

TSmallIntField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TSmallIntField events

TSmallIntField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TSmallIntField methods

TSmallIntField	Alphabetically

In TSmallIntField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSmallIntField methods

TSmallIntField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TSmallIntField.Create

TSmallIntField	See also

Creates an instance of a TSmallintField object.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TSmallIntField. After calling the inherited constructor, Create sets the DataType property to ftInteger, MinValue to -32768, and MaxValue to 32767.After instantiating a TSmallIntField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TSmallIntField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TSmallIntField with a dataset component by setting its DataSet property to the name of the dataset component.

The example below creates a TSmallIntField object for a field named Children accessed through a TQuery named Query1.

var

  T: TSmallIntField;

begin

  Query1.Close;

  T := TSmallIntField.Create(Self);

  T.FieldName := 'Children';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TNumericField

TIntegerField


Create, Active, CommonAVI example

To run this example, create a new project, place a button on the form, and insert the example code to the button click event. Place the button on the bottom of the form to leave room for the TAnimate component that will be created on the fly.

procedure TForm1.Button1Click(Sender: TObject);

var

  TempForm: TForm;

  I: Integer;

begin

  TempForm := TForm.Create(Self);

  with TAnimate.Create(TempForm) do

  try

    Parent := TempForm;

    CommonAVI := aviFindFile;

    Active := True;

    TempForm.Show;

    // Simulate a lengthy process.  Alter this value

    // to accomodate your machine speed.

    for I := 0 to 900000 do Application.ProcessMessages;

  finally

    TempForm.Release;

  end;

end;


Assign, Dormant, FreeImage, Monochrome, ReleaseHandle example
Assign, Dormant, FreeImage, Monochrome, ReleaseHandle, LoadFromFile example

procedure TForm1.Button1Click(Sender: TObject);

var

 BitMap1,BitMap2 : TBitMap;

 MyFormat : Word;

begin

   BitMap2 := TBitMap.Create;

   BitMap1 := TBitMap.Create;

try

   BitMap1.LoadFromFile('c:\Program Files\common Files\Borland Shared\Images\Splash\256color\factory.bmp');

   BitMap2.Assign(BitMap1);     // Copy BitMap1 into BitMap2

   BitMap2.Dormant;             // Free up GDI resources

   BitMap2.FreeImage;           // Free up Memory.

   Canvas.Draw(20,20,BitMap2);  // Note that previous calls don't lose the image

   BitMap2.Monochrome := true;

   Canvas.Draw(80,80,BitMap2);

   BitMap2.ReleaseHandle;       // This will actually lose the bitmap;

 finally

   BitMap1.Free;

   BitMap2.Free;

 end;

end;


LoadFromClipboard example
LoadFromClipboardFormat example

The following code draws a bitmap image from the Clipboard when a button is pressed.

procedure TForm1.Button1Click(Sender: TObject);

var

  Bitmap : TBitmap;

begin

 Bitmap := TBitMap.create;

 try

   Bitmap.LoadFromClipBoardFormat(cf_BitMap,ClipBoard.GetAsHandle(cf_Bitmap),0);

   Canvas.draw(0,0,Bitmap);

 finally

   Bitmap.free;

 end;

end;


LoadFromResourceName example

procedure TForm1.Button1Click(Sender: TObject);

var

 BitMap1 : TBitMap;

begin

  BitMap1 := TBitMap.Create;

  try

    BitMap1.LoadFromResourceName(HInstance,'THEBITMAP');

    Canvas.Draw(12,12,BitMap1);

  finally

    BitMap1.Free;

  end;

end;


SaveToClipboardFormat, SetAsHandle example

procedure TForm1.Button1Click(Sender: TObject);

var

  MyFormat : Word;

  Bitmap : TBitMap;

  AData,APalette : THandle;

begin

  Bitmap := TBitmap.Create;

  try

    Bitmap.LoadFromFile('c:\Program Files\Common Files\Borland Shared\Images\Splash\256color\factory.bmp');

    Bitmap.SaveToClipBoardFormat(MyFormat,AData,APalette);

    ClipBoard.SetAsHandle(MyFormat,AData);

  finally

    Bitmap.Free;

  end;

end;


ScanLine, Height example

procedure TForm1.Button1Click(Sender: TObject);

// This example shows drawing directly to the BitMap

var

  x,y : Integer;

  BitMap : TBitMap;

  P : PByteArray;

begin

  BitMap := TBitMap.create;

  try

    BitMap.LoadFromFile('..\Images\Splash\256color\factory.bmp');

    for y := 0 to BitMap.height -1 do

    begin

      P := BitMap.ScanLine[y];

      for x := 0 to BitMap.width -1 do

        P[x] := y;

    end;

  Canvas.draw(0,0,BitMap);

  finally

    BitMap.free;

  end;

end;


Canvas, Transparent, TransparentMode, TransparentColor example

procedure TForm1.Button1Click(Sender: TObject);

var

  Bitmap : TBitMap;

begin

  Bitmap := TBitmap.Create;

  try

    with Bitmap do begin

      LoadFromFile('c:\Program Files\Common Files\Borland Shared\Images\Splash\256color\factory.bmp');

      Transparent := True;

      TransParentColor := BitMap.canvas.pixels[50,50];

      Form1.Canvas.Draw(0,0,BitMap);

      TransparentMode := tmAuto;   // Transparent color now is clDefault = TColor($20000000);

      Form1.Canvas.Draw(50,50,BitMap);

    end;

  finally

    Bitmap.Free;

  end;

end;


Bands, Items, Text example

To run this example, add the example code to a new project. The example code dynamically creates a TCoolbar and three TCoolBand objects populated with a windowed control in each TCoolBand.

procedure AddBand(CoolBar: TCoolBar; Const ControlClasses: array of TControlClass);

var

  CurrentControl: TControl;

  I: Integer;

begin

  for I := 0 to High(ControlClasses) do

    begin

      CurrentControl := ControlClasses[i].Create(CoolBar);

      if (CurrentControl is TWinControl) then

      begin

        { Placing the control onto the CoolBar causes the TCoolBar object to create a TCoolBand and place the control within the band. }

        CurrentControl.Parent := Coolbar;

        { Get the reference of the last TCoolBand created and assign text. }

        with CoolBar.Bands do

          Items[count - 1].Text := CurrentControl.ClassName;

      end;

    end;

end;

procedure TForm1.FormCreate(Sender: TObject);

var

  CoolBar: TCoolBar;

begin

  CoolBar := TCoolBar.Create(Self);

  CoolBar.Parent := Self;

  CoolBar.Align := alClient;

  AddBand(CoolBar, [TCheckBox, TEdit, TButton]);

end;


HeaderSection, OnDrawSection, Sections, Canvas, TextOut example

procedure TForm1.FormCreate(Sender: TObject);

var

  HeaderSection: THeaderSection;

  I: Integer;

begin

  for I := 0 to 4 do

  begin

    HeaderSection := HeaderControl1.Sections.Add;

    HeaderSection.Text := 'Text Section ' + IntToStr(I);

    HeaderSection.MinWidth := length(HeaderSection.Text) * Font.Size;

    // Owner draw every other section

    if (I mod 2 = 0) then

      HeaderSection.Style := hsOwnerDraw

    else

      HeaderSection.Style := hsText;

  end;

end;

procedure TForm1.HeaderControl1DrawSection(HeaderControl: THeaderControl;

  Section: THeaderSection; const Rect: TRect; Pressed: Boolean);

begin

  with HeaderControl.Canvas do

  begin

    // highlight pressed sections

    if Pressed then

      Font.Color := clRed

    else

      Font.Color := clBlue;

    TextOut(Rect.Left + Font.Size, Rect.Top + 2, 'Owner Drawn text');

  end;

end;


HotKey example

To use this example, create a form with a main menu component and a HotKey component.  At design time, use the Menu designer to add menu items, including a "File" menu with subitems that includes a "New" menu item.  Add the following code to the OnCreate method of the form and the OnClick event of the File menu item.

procedure TForm1.File1Click(Sender: TObject);

begin

  // Assign hotkey to the menu's File "New" item.

  New1.ShortCut := HotKey1.HotKey;

end;

procedure TForm1.FormCreate(Sender: TObject);

begin

  // Default to "Ctrl + A"

  HotKey1.Modifiers := [hkCtrl];

  // Don't allow shift or alt

  HotKey1.InvalidKeys := [hcShift, hcAlt];

end;


Columns, Caption, Items, SubItems, Add example

This example requires only a blank form.  All other objects: TListView, TListColumns, TListItems, are created dynamically.  You must add comctrls to the uses clause of the unit file.

procedure TForm1.FormCreate(Sender: TObject);

const

  Names: array[0..5, 0..1] of string = (

    ('Rubble', 'Barney'),

    ('Michael', 'Johnson'),

    ('Bunny', 'Bugs'),

    ('Silver', 'HiHo'),

    ('Simpson', 'Bart'),

    ('Squirrel', 'Rockey')

    );

var

  I: Integer;

  NewColumn: TListColumn;

  ListItem: TListItem;

  ListView: TListView;

begin

  ListView := TListView.Create(Self);

  with ListView do

  begin

    Parent := Self;

    Align := alClient;

    ViewStyle := vsReport;

    NewColumn := Columns.Add;

    NewColumn.Caption := 'Last';

    NewColumn := Columns.Add;

    NewColumn.Caption := 'First';

    for I := Low(Names) to High(Names) do

    begin

      ListItem := Items.Add;

      ListItem.Caption := Names[I][0];

      ListItem.SubItems.Add(Names[I][1]);

    end;

  end;

end;


Column, Items, ViewStyle, SmallImages, LargeImages, ImageIndex, AddObject, Objects example

This example requires a TListView, a TImageList and a TComboBox. You will need to double click the image list and add several images to the image list prior to running the project. You can use *.bmp or *.ico files from the \Images\Icons directory.

During the form’s OnCreate event handler, items for the List View control are created for each image in the Image List and the ImageIndex is assigned the number of the image within the ImageList. Two columns are created so that when ViewStyle is vsReport, you will have columns to view.

Also within the form’s OnCreate event handler assign the ComboBox each of the four TViewStyle constants to the Items’ Objects property. You could also simply code this within a series of OnClick event handlers as, for instance, ListView1.ViewStyle := vsIcon.

procedure TForm1.FormCreate(Sender: TObject);

var

  I: Integer;

  ListItem: TListItem;

  NewColumn: TListColumn;

begin

  // Create a ListView item for each image in the ImageList

  with ListView1 do

  begin

    SmallImages := ImageList1;

    LargeImages := ImageList1;

    for I := 0 to ImageList1.Count - 1 do

    begin

      ListItem := Items.Add;

      Listitem.Caption := 'Image' + IntToStr(I);

      ListItem.ImageIndex := I;

    end;

    // Create two columns to show during viewing as vsReport

    NewColumn := Columns.Add;

    NewColumn.Caption := 'Column 1';

    NewColumn := Columns.Add;

    NewColumn.Caption := 'Column 2';

    // Add View styles and constants to the Combo Box

    ComboBox1.Items.AddObject('vsIcon', TObject(vsIcon));

    ComboBox1.Items.AddObject('vsList', TObject(vsList));

    ComboBox1.Items.AddObject('vsReport', TObject(vsReport));

    ComboBox1.Items.AddObject('vsSmallIcon', TObject(vsSmallIcon));

    // Display first item in the Combo Box

    ComboBox1.ItemIndex := 0;

  end;

end;

procedure TForm1.ComboBox1Click(Sender: TObject);

begin

  with ComboBox1 do

    ListView1.ViewStyle := TViewStyle(Items.Objects[ItemIndex]);

end;


Open, VisibleButtons, Shareable example

begin

With MediaPlayer1 do begin

     Filename := 'c:\win95\roaring.wav'; //specify sound file

     ShowHint := True; //show buttons hints

     Shareable := True; //allow others to use the same .wav file

     VisibleButtons := [btPlay, btStop]; //limit to just two buttons

     Open; //play it

end;

end;


DeviceType, Display, Open, Play example

var sWinDir: String;

    iLength: Integer;

begin

// Initialize Variable

iLength := 255;

setLength(sWinDir, iLength);

iLength := GetWindowsDirectory(PChar(sWinDir), iLength);

setLength(sWinDir, iLength);

With MediaPlayer1 do begin

     Filename := sWinDir + '\Clock.avi'; //specify video file

     DeviceType := dtAVIVideo; //set Device compatibility to AVI

     Display := Panel1; //Set display device to a TPanel

     Open;

     Play;

end;

end;


ActivePage, PageCount, OnChange example

This example requires a TPageControl already on the form. Also, you must add pages to the TPageControl by right clicking and selecting New Page.

The example code will allow the user to select the ActivePage property through selection of a ComboBox item.  During the form create, the Combo Box control is loaded with the names of each of the tabs, as well as the instance pointers to the corresponding tab.  When the user selects the Combo Box item, the associated TTabSheet object contained in the Combo Box Objects array is used to set the ActivePage property.

procedure TForm1.FormCreate(Sender: TObject);

var

  i: Integer;

begin

  for i := 0 to PageControl1.PageCount - 1 do

    ComboBox1.Items.AddObject(PageControl1.Pages[i].Name,

      PageControl1.Pages[i]);

  ComboBox1.ItemIndex := 0;

end;

procedure TForm1.ComboBox1Change(Sender: TObject);

begin

  if (Sender is TComboBox) then

    with (Sender as TComboBox) do

      PageControl1.ActivePage := TTabSheet(Items.Objects[ItemIndex]);

end;


PageControl, FindNextPage, OnChange example

This example requires a new TPageControl, as-is, with no new pages created at design time.

The form OnCreate event handler adds several new TabSheet controls to the Page Control.  The Page Control’s OnChange event handler displays a message dialog when the user changes tabs.  The message dialog contains the captions for the tabs immediately before and after the active tab.

procedure TForm1.FormCreate(Sender: TObject);

var

  i: Integer;

begin

  for i := 0 to 9 do

    with TTabSheet.Create(Self) do

    begin

      PageControl := PageControl1;

      Caption := 'TabSheet #' + IntToStr(i);

    end;

end;

procedure TForm1.PageControl1Change(Sender: TObject);

var

  PrevCaption, NextCaption: ShortString;

begin

  with (Sender as TPageControl) do

  begin

    PrevCaption := FindNextPage(ActivePage, True, False).Caption;

    NextCaption := FindNextPage(ActivePage, False, False).Caption;

  end;

  ShowMessage('Previous tab caption: "' + PrevCaption +

    '"    Next tab Caption: "' + NextCaption + '"');

end;


MultiLine, Checked example

This example requires a PageControl with no pages created, and a TCheckBox. During the form create, a series of tabs will be created on the Page Control that exceed the Page Control's width.  When the Check Box control is clicked, the setting of the MultiLine property is toggled, alternately stacking the tabs vertically, or along a single line horizontally.

procedure TForm1.CheckBox1Click(Sender: TObject);

begin

  PageControl1.MultiLine := CheckBox1.Checked;

end;

procedure TForm1.FormCreate(Sender: TObject);

var

  i: Integer;

begin

  Checkbox1.Caption := 'Stack Tabs?';

  for i := 0 to 20 do

    with TTabSheet.Create(Self) do

    begin

      PageControl := PageControl1;

      Caption := 'Tab #' + IntToStr(i);

    end;

end;


OnChange, OnShow example

This project requires a Page Control.  You will need to  populate the Page Control by right clicking and selecting New Page from the context menu. As the tabs are selected by the user, the Page Control OnChange event fires which causes the form caption to display the captions of each of the TTabSheets attached to the Page Control.

Note the use of the Form’s OnShow event handler to set the caption when the form first appears, before any changes trigger the OnChange event of the Page Control.

procedure TForm1.PageControl1Change(Sender: TObject);

begin

  Caption := ' Now working on tab:  ' + PageControl1.ActivePage.Caption;

end;

procedure TForm1.FormShow(Sender: TObject);

begin

  PageControl1Change(Sender);

end;


OnChanging example

This project requires a TPageControl, several TTabSheets (to add sheets, right click the Page Control and select "New Page" from the context menu), and a TEdit control on the first tab sheet.

The user is not allowed to change to a new page if the active page is "TabSheet1" and there is no text in the Edit Control.

procedure TForm1.PageControl1Changing(Sender: TObject; var AllowChange: Boolean);

begin

  if ((Sender as TPageControl).ActivePage = TabSheet1) then

    AllowChange := (Edit1.Text <> '')

  else

    AllowChange := True;

end;


OnCreate, OnClick, SelectNextPage example

This example requires a new TPageControl, as-is, with no new pages created at design time, and a TUpDown control, also from the Win95 page of the component palette.

The form OnCreate event handler adds several new TabSheet controls to the Page Control.

The UpDown1Click event handler fires when the user clicks the up or down button on the TUpDown control.  The SelectNextPage method of the Page Control goes forward the comparison (Button = btNext) evaluates as true.  If Button is not btNext, the previous Tab Page is selected.

procedure TForm1.FormCreate(Sender: TObject);

var

  i: Integer;

begin

  for i := 0 to 9 do

    with TTabSheet.Create(Self) do

    begin

      PageControl := PageControl1;

      Caption := 'TabSheet #' + IntToStr(i);

    end;

end;

procedure TForm1.UpDown1Click(Sender: TObject; Button: TUDBtnType);

begin

  PageControl1.SelectNextPage(Button = btNext);

end;


Pages, TabHeight, TabWidth, TextHeight, TextWidth example

This project requires a TPageControl and several TTabPages. To add new pages, right click the TPageControl and select "New Page".

During the form creation the width and height of all tabs on the Page Control becomes double the largest previous value.  So if there are three tabs with captions that are 12, 23 and 19 characters long, the TabWidth would be the number of pixels required to fit 46 characters.

procedure TForm1.FormCreate(Sender: TObject);

var

  i: Integer;

begin

  with PageControl1 do

  begin

    for i := 0 to PageCount - 1 do

    begin

      if (Canvas.TextWidth(Pages[i].Caption) * 2) > TabWidth then

        TabWidth := Canvas.TextWidth(Pages[i].Caption) * 2;

      if (Canvas.TextHeight(Pages[i].Caption) * 2) > TabHeight then

        TabHeight := Canvas.TextHeight(Pages[i].Caption) * 2;

    end;

  end;

end;


Create, Align example

// dynamically create a TProgressBar control

// and align it to the bottom of the form.

procedure TForm1.Button1Click(Sender: TObject);

var

  ProgressBar: TProgressBar;

begin

  ProgressBar := TProgressBar.Create(Self);

  with ProgressBar do

  begin

    Parent := Self;

    Align := alBottom;

  end;

end;


Min, Max, Position, RecordCount, First, Next example
Min, Max, Position RecordCount, First, Next example

// Read through all records in a table and update

// the ProgressBar accordingly.

procedure TForm1.Button1Click(Sender: TObject);

var

  i: Integer;

begin

  with ProgressBar1 do

  begin

    Min := 0;

    Max := Table1.RecordCount;

    Table1.First;

    for i := Min to Max do

    begin

      Position := i;

      Table1.Next;

    end;

  end;

end;


Step, StepIt example

This example reads bytes from a file in tenths of the size of the file. The ProgressBar displays the status of each  1/10th step as it's read into the buffer.

The example assumes a TButton and a TProgressBar control already placed on the form.

procedure TForm1.Button1Click(Sender: TObject);

const

  FName = 'c:\autoexec.bat';

var

  F: File;

  MyData: array[1..2048] of byte;

  BytesRead: LongInt;

begin

  AssignFile(F, FName);

  try

    Reset(F);

    ProgressBar1.Max := FileSize(F);

    if (ProgressBar1.Max > 10) then

      // amount to move when StepIt method called

      ProgressBar1.Step := ProgressBar1.Max div 10

    else

      ProgressBar1.Step := ProgressBar1.Max;

    while (ProgressBar1.Position < ProgressBar1.Max) do

    begin

      // read one Step size chunk of data to buffer

      BlockRead(F, MyData, ProgressBar1.Step, BytesRead);

      // move the ProgressBar Position using StepIt

      ProgressBar1.StepIt; // move by Step amount

    end;

  finally;

    CloseFile(F);

  end;

end;


StepBy, CreateForm, Run, Show, Update, Initialize example

This example shows progress of loading forms as an application starts up. The code example is placed in the project source (*.dpr) file.  To see project source, select the View | Project Source menu item.

You will need to set up your project with the following steps before using the code example:

Add four additional forms to a default project.

Place a TProgressBar on Form5

Take the Project | Options | Forms menu option and place Form5 on the available forms list.

Change the code of your project (*.dpr) file to look like the example.

begin

  Application.Initialize;

  with TForm5.Create(nil) do

  try

    ProgressBar1.Max := 100;

    Show;   // show a splash screen contain ProgressBar control

    Update; // force display of Form5

    Application.CreateForm(TForm1, Form1);

    ProgressBar1.StepBy(25);

    Application.CreateForm(TForm2, Form2);

    ProgressBar1.StepBy(25);

    Application.CreateForm(TForm3, Form3);

    ProgressBar1.StepBy(25);

    Application.CreateForm(TForm4, Form4);

    ProgressBar1.StepBy(25);

  finally

    Free;

  end;

  Application.Run;

end.


Alignment example

To use this example, place a Toolbar and a RichEdit on the form. Right click the toolbar and select New Button three times.  Place the ToolButton1Click handling code in the on click event of the first TToolButton, then attach the same OnClick handler for each button.

procedure TForm1.ToolButton1Click(Sender: TObject);

begin

  if (Sender = ToolButton1) then

    RichEdit1.Paragraph.Alignment := taLeftJustify

  else if (Sender = Toolbutton2) then

    RichEdit1.Paragraph.Alignment := taCenter

  else if (Sender = Toolbutton3) then

    RichEdit1.Paragraph.Alignment := taRightJustify;

end;


SimplePanel, SimpleText, Add example

This example requires no additional controls.  All controls are created dynamically within the form's OnCreate event handler.

Note: Be sure to add comctrls.hpp to your uses clause to support TRichEdit.

uses ComCtrls;

procedure TForm1.FormCreate(Sender: TObject);

var

  i: Integer;

begin

  with TStatusBar.Create(Self) do

  begin

    // Display the StatusBar control on the surface

    // of the form.

    Parent := Self;

    // Allow a single line of text -- no panels.

    SimplePanel := True;

    // Provide sample text.

    // Create a new instance of TRichEdit, set it's

    // properties, and display on the form.

    with TRichEdit.Create(Self) do

    begin

      // Display the RichEdit control on the surface

      // of the form.

      Parent := Self;

      // The RichText control takes all space left

      // over from the StatusBar.

      Align := alClient;

      // Add 50 lines to the RichText

      for i := 1 to 50 do

        Lines.Add('Adding line ' + IntToStr(i));

      SelStart := 0; // set text cursor to first character

      SimpleText := 'Number of Lines loaded to RichText: ' +

        IntToStr(Lines.Count);

    end;

  end;

end;


DefAttributes, SelAttributes, Color, Height, Style example

This example requires a TRichEdit and a TButton. Leave the default text, usually "RichEdit1", in the lines property. The DefAttributes will apply to this text.

procedure TForm1.Button1Click(Sender: TObject);

begin

  with RichEdit1.SelAttributes do

  begin

    Color := clRed;

    Height := Height + 5;

  end;

  RichEdit1.Lines.Add('This line of text will be red.');

end;

procedure TForm1.Button2Click(Sender: TObject);

begin

  RichEdit1.DefAttributes.Color := clBlue;

  RichEdit1.DefAttributes.Style := [fsBold, fsItalic];

end;


Position, Execute, FindText, OnFind, SelStart, SelLength example

This example requires a TRichEdit, a TButton, and a TFindDialog.

Clicking the button click will display a Find Dialog to the right of the edit control.  Filling in the "Find what" text and pressing the Find Next button will select the first matching string in the Rich Edit control that follows the previous selection.

procedure TForm1.Button1Click(Sender: TObject);

begin

  FindDialog1.Position := Point(RichEdit1.Left + RichEdit1.Width, RichEdit1.Top);

  FindDialog1.Execute;

end;

procedure TForm1.FindDialog1Find(Sender: TObject);

var

  FoundAt: LongInt;

  StartPos, ToEnd: Integer;

begin

  with RichEdit1 do

  begin

    { begin the search after the current selection if there is one }

    { otherwise, begin at the start of the text }

    if SelLength <> 0 then

      StartPos := SelStart + SelLength;

    else

      StartPos := 0;

    { ToEnd is the length from StartPos to the end of the text in the rich edit control }

    ToEnd := Length(Text) - StartPos;

    FoundAt := FindText(FindDialog1.FindText, StartPos, ToEnd, [stMatchCase]);

    if FoundAt <> -1 then

    begin

      SetFocus;

      SelStart := FoundAt;

      SelLength := Length(FindDialog1.FindText);

    end;

  end;

end;


Font, Name, Fonts, ItemIndex example

To use this example, place a TComboBox and TRichEdit on a form.

During form creation, a list of font names is loaded into the combo box. When the combo box is clicked, the Rich Edit control font is set to the corresponding font name in the combo box.

procedure TForm1.FormCreate(Sender: TObject);

begin

  ComboBox1.Items := Screen.Fonts;

end;

procedure TForm1.ComboBox1Click(Sender: TObject);

begin

  RichEdit1.Font.Name := ComboBox1.Items[ComboBox1.ItemIndex];

end;


HideSelection example
HideSelection, Height example

This example needs only a blank form.  Three Rich Edit controls are placed vertically on the form, each contain a line of text, and the second form has HideSelection set to false.

Try tabbing between the three Rich Edit controls and observe the effect on the selected text.

uses ComCtrls;

procedure TForm1.FormCreate(Sender: TObject);

var

  I: Integer;

begin

  for I := 0 to 2 do

    with TRichEdit.Create(Self) do

    begin

      Parent := Self;

      Top := Height * I;

      Text := 'This text will take the focus.';

      SelStart := 0;

      SelLength := Length(Text);

      if (I = 1) then

        HideSelection := False;

    end;

end;


OnSelectionChange example

This example requires a TStatusBar and a TRichEdit.  The code within the form's OnCreate will take care of sizing the Rich Edit and setting the OnSelectionChange event to be handled by RichEdit1SelectionChange (or you can paste the code directly into the OnSelectionChange event handler.)

As you type in the Rich Edit control, the current character location the selection begin and end will display in the status bar control.

procedure TForm1.RichEdit1SelectionChange(Sender: TObject);

begin

  with RichEdit1 do

    StatusBar1.SimpleText := '  Selection Start: ' + IntToStr(SelStart) +

      '  Selection End: ' + IntToStr(SelStart + SelLength);

end;

procedure TForm1.FormCreate(Sender: TObject);

begin

  with RichEdit1 do

  begin

    Align := alClient;

    OnSelectionChange := RichEdit1SelectionChange;

  end;

  StatusBar1.SimplePanel := True;

end;


Lines, Paragraph, FirstIndent, Numbering example

This example requires only a form.

A Rich Edit control is created on the form and aligned to take the entire client area of the form.  A series of lines are written to the Rich Edit control's Lines property, and the Paragraph property manipulated such that the first items displayed are bulleted, a second group of lines are unbulleted and centered, and the last group is left justified and indented.

uses ComCtrls;

procedure TForm1.FormCreate(Sender: TObject);

begin

  with TRichEdit.Create(Self) do

  begin

    Parent := Self;

    Align := alClient;

    Lines.Clear;

    // set numbering style

    Paragraph.Numbering := nsBullet;

    Lines.Add('Introduction');

    Lines.Add('New members to our team');

    Lines.Add('New Budget discussion');

    Lines.Add('Facilities');

    Lines.Add('Q & A');

    Paragraph.Numbering := nsNone;

    Paragraph.Alignment := taCenter;

    Lines.Add('');

    Lines.Add('Suggested Topics:');

    Lines.Add('');

    Paragraph.Alignment := taLeftJustify;

    Paragraph.FirstIndent := 10;

    Lines.Add('');

    Lines.Add('Parking lot repair');

    Lines.Add('Cost overruns');

  end;

end;


PlainText, LoadFromFile example

This example requires two TRichEdit controls placed on the form.

When the form becomes visible, the first Rich Edit control will display the rich text in its raw form, including formatting characters. The second will show the rich text in its intended format.

procedure TForm1.FormCreate(Sender: TObject);

const

  // you may need to change this path to suit your environment

  Path = '..\Demos\RichEdit\OverView.RTF';

begin

  RichEdit1.PlainText := True;

  RichEdit1.Lines.LoadFromFile(Path);

  RichEdit2.PlainText := False;

  RichEdit2.Lines.LoadFromFile(Path);

end;


Print example

procedure TForm1.FormCreate(Sender: TObject);

const

  // The path may need to be changed to accomodate locations of files

  // on your system.

  Path = '..\DEMOS\RICHEDIT\OVERVIEW.RTF';

begin

   RichEdit1.Lines.LoadFromFile(Path);

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

  // The parameter string shows in the print queue under "Document   // name".

  RichEdit1.Print('My Document Name');

end;


HideScrollBars, ScrollBars example

This example requires: TRichEdit, TRadioGroup, TCheckBox, TButton. Clicking the Radio Group control sets the ScrollBar style of the RichEdit. Toggling the Check Box turns HideScrollBars on and off.  Clicking the button loads the Rich Edit with a large amount of contiguous text.

procedure TForm1.Button1Click(Sender: TObject);

var

  I: Integer;

begin

  RichEdit1.Lines.Clear;

  for I := 0 to 500 do

    RichEdit1.Text := RichEdit1.Text + 'test line ' + IntToStr(I);

  RichEdit1.SelStart := 0; // move text cursor to top of edit

end;

procedure TForm1.CheckBox1Click(Sender: TObject);

begin

  RichEdit1.HideScrollbars := CheckBox1.Checked;

end;

procedure TForm1.RadioGroup1Click(Sender: TObject);

const

  ScrollBarA: array[0..3] of TScrollStyle = (

    ssBoth,

    ssHorizontal,

    ssNone,

    ssVertical);

begin

  RichEdit1.ScrollBars := ScrollBarA[RadioGroup1.ItemIndex];

end;

procedure TForm1.FormCreate(Sender: TObject);

begin

  with RadioGroup1, Items do

  begin

    Caption := 'Scroll Bars';

    Clear;

    Add('ssBoth');

    Add('ssHorizontal');

    Add('ssNone');

    Add('ssVertical');

  end;

  with CheckBox1 do

  begin

    Caption := 'HideScrollBars';

    Checked := True;

  end;

  Button1.Caption := 'Loaded';

end;


Assign, Add example

var

  StringList: TStrings;

begin

  StringList := TStringList.Create;

  try

    with StringList do begin

      Add('This example uses A string List.');

      Add('It is the easiest way to add strings');

      Add('to a combobox''s list of strings.');

      Add('Always remember TStrings.Create method');

      Add('is abstract; So use TStringList.Create');

      Add('method instead.');

    end;

    with ComboBox1 do begin

      Width := 210;

      Items.Assign(StringList);

      ItemIndex := 0;

    end;

  finally

    StringList.free;

  end;

end;


Caption example

This example requires a TPageControl, a TEdit and a TButton. When the button is clicked, the caption of the active tab changes to that of the TEdit.

These lines of code could also be written :

PageControl1.ActivePage.Caption := Edit1.Text;

This would obviate the need for a TTabSheet variable since PageControl1.ActivePage is already of type TTabSheet.

procedure TForm1.Button1Click(Sender: TObject);

var

  TSheet: TTabSheet;

begin

  TSheet := PageControl1.ActivePage;

  TSheet.Caption := Edit1.Text;

end;


PageIndex, TabIndex, TabVisible example

This example creates ten Tab Sheets and sets the captions to display PageIndex and TabIndex for each tab.  Odd numbered tabs have their TabVisible property set off to demonstrate the effect on PageIndex vs TabIndex.  On the series of visible tabs, PageIndex will read 0, 2, 4, 6, 8, and TabIndex will read 0, 1, 2, 3, 4.  PageIndex counts only visible tabs.

{ Note: Pages[i] is of type TTabSheet. }

procedure TForm1.FormCreate(Sender: TObject);

var

  i: Integer;

begin

  with PageControl1 do

    for i := 0 to 9 do

      with TTabSheet.Create(Self) do

      begin

        PageControl := PageControl1;

        Pages[i].TabVisible := (i mod 2 = 0);

        Caption := 'PageIndex: ' +

        IntToStr(Pages[i].PageIndex) + '  TabIndex: ' +

          IntToStr(Pages[i].TabIndex);

      end;

end;


Visible, OnClick example

This examples requires a TPageControl and a TCheckBox.  The form OnCreate event handler populates each sheet with an edit control placed somewhere on the client area of the sheet.

Clicking the checkbox will cause the client area (not the tab area) of the Tab Control to become invisible when the Check Box is unchecked.

procedure TForm1.PageControl1Change(Sender: TObject);

begin

  CheckBox1.Checked := PageControl1.ActivePage.Visible;

end;

procedure TForm1.CheckBox1Click(Sender: TObject);

begin

  PageControl1.ActivePage.Visible := CheckBox1.Checked;

end;

procedure TForm1.FormCreate(Sender: TObject);

var

  i: Integer;

begin

  for i := 0 to 9 do

    with TTabSheet.Create(Self) do

    begin

      PageControl := PageControl1;

      Caption := 'TabSheet' + IntToStr(i);

      with TEdit.Create(Self) do

      begin

        Parent := PageControl1.Pages[i];

        Left := Random(PageControl1.ActivePage.ClientWidth - Width);

        Top := Random(PageControl1.ActivePage.ClientHeight - Height);

      end;

    end;

    PageControl1Change(Sender);

end;


TToolButton, TToolBar example

To use this example, create a new application and add the example code to the unit.

procedure AddButtons(ToolBar: TToolBar;

  Const ButtonCaptions: array of String);

var

  I: Integer;

begin

  for I := 0 to High(ButtonCaptions) do

    begin

      with TToolButton.Create(ToolBar) do

      begin

        Parent := ToolBar;

        Caption := ButtonCaptions[I];

        if (ButtonCaptions[I] = '|') then

          Style := tbsSeparator

        else

          Style := tbsButton;

      end;

    end;

end;

procedure TForm1.FormCreate(Sender: TObject);

var

  ToolBar: TToolBar;

begin

  ToolBar := TToolBar.Create(Self);

  ToolBar.Parent := Self;

  AddButtons(ToolBar, ['New', 'Save', '|', 'Cut', 'Copy', 'Paste']);

  ToolBar.ShowCaptions := True;

  ToolBar.Height := 40;

end;


OnClose example

This example displays a message dialog box when the user attempts to close the form. If the user clicks the Yes button, the form closes; otherwise, the form only minimizes.

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);

begin

  if MessageDlg('Close application ?', mtConfirmation,

    [mbYes, mbNo], 0) = mrYes then

    Action := caFree

  else

    Action := caNone;

end;


OnCloseQuery example

When the user attempts to close the form in this example, a message dialog appears that asks the user if it is OK to close the form. If the user chooses the OK button, the form closes. If the user chooses Cancel, the form doesn't close.

procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);

begin

  if MessageDlg('Close the form?', mtConfirmation,

    [mbOk, mbCancel], 0) = mrCancel then

     CanClose := False;

end;


OnPaint example

The following code loads a background bitmap onto the Canvas of the main form in the OnPaint event handler.  In the header file for Unit 1. add a private member to TForm1 of type Graphics::TBitmap named TheGraphic;

unit Unit1;

interface

uses

  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls, Forms, Dialogs;

type

  TForm1 = class(TForm)

    procedure FormPaint(Sender: TObject);

    procedure FormCreate(Sender: TObject);

  private

    TheGraphic: TBitmap; { Add this declaration for the graphic}

  public

    { Public declarations }

  end;

var

  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormPaint(Sender: TObject); { OnPaint event handler}

begin

  Form1.Canvas.Draw(0, 0, TheGraphic); { Draw the graphic on the Canvas }

end;

procedure TForm1.FormCreate(Sender: TObject); { OnCreate event handler }

begin

  TheGraphic := TBitmap.Create; { Create the bitmap object }

  TheGraphic.LoadFromFile('C:\APP\BKGRND.BMP'); { Load the bitmap from a file}

end;

end.


TopIndex example

The following example uses a list box containing a list of strings, a button, and an edit box on a form. When the user runs the application and clicks the button, the third item in the list becomes the first item, and the index value of that item appears in the edit box. The index value displayed is 2, indicating the third item in the list (the first item in the list has an index value of 0):

procedure TForm1.FormCreate(Sender: TObject);

var

Number: Integer;

begin

for Number := 1 to 20 do

ListBox1.Items.Add('Item ' + IntToStr(Number));

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

ListBox1.TopIndex := 2;

Edit1.Text := IntToStr(ListBox1.TopIndex);

end;


OnMeasureItem example

Here is a typical handler for an OnMeasureItem event. The example assumes that a variable owner-draw list box already has bitmaps associated with each of its strings. It sets the height of the item to the height of the associated bitmap if that height is greater than the default height.

procedure TForm1.ListBox1MeasureItem(Control: TWinControl; Index: Integer; var Height: Integer);

var

Bitmap: TBitmap;

begin

with Control as TListBox do

begin

Bitmap := TBitmap(Items.Objects[Index]);

if Bitmap <> nil then

if Bitmap.Height > Height then Height := Bitmap.Height;

end;

end;


CustomSort example

This example shows how to use the CustomSort method to order a tree view in case-insensitive alphabetical order (either forward or backward). The application must provide a callback function such as CompareFunc below, which calls the global AnsiStrIComp function to perform the actual comparison.

function CustomSortProc(Node1, Node2: TTreeNode; Data: Integer): Integer; stdcall;

begin

  Result := -AnsiStrIComp(PChar(Node1.Text), PChar(Node2.Text));

end;

This procedure can then be used as a parameter to CustomSort to sort the nodes of the tree view:

TreeView1.CustomSort(@CustomSortProc, 0);


GetHitTestInfoAt example

The following code checks a list of htHitTest types and adds the ones that occur when the mouse was pressed while on the tree view.

procedure TForm1.TreeView1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

var

  MyHitTest : THitTests;

begin

  MyHitTest := TreeView1.GetHitTestInfoAt(X,Y);

  if htNowhere in MyHitTest then

    ListBox1.Items.Add('NoWhere');

  if htOnItem in MyHitTest then

    ListBox1.Items.Add('OnItem');

  if htOnButton in MyHitTest then

    ListBox1.Items.Add('OnButton');

  if htOnIndent in MyHitTest then

    ListBox1.Items.Add('OnIndent');

  if htOnLabel in MyHitTest then

    ListBox1.Items.Add('OnLabel');

  if htOnRight in MyHitTest then

    ListBox1.Items.Add('OnRight');

end;


GetNodeAt, MoveTo, Selected example

The following code uses GetNodeAt to add a dragged node as a child of the node under then mouse when it is dropped.

procedure TForm1.TreeView1DragDrop(Sender, Source: TObject; X, Y: Integer);

var

  AnItem: TTreeNode;

  AttachMode: TNodeAttachMode;

  HT: THitTests;

begin

  if TreeView1.Selected = nil then Exit;

  HT := TreeView1.GetHitTestInfoAt(X, Y);

  AnItem := TreeView1.GetNodeAt(X, Y);

  if (HT - [htOnItem, htOnIcon, htNowhere, htOnIndent] <> HT) then

  begin

    if (htOnItem in HT) or (htOnIcon in HT) then AttachMode := naAddChild

    else if htNowhere in HT then AttachMode := naAdd

    else if htOnIndent in HT then AttachMode := naInsert;

    TreeView1.Selected.MoveTo(AnItem, AttachMode);

  end;

end;


Command example

The following procedure is a WM_COMMAND message handler. It checks the ItemID field of Msg to see if the message was generated by a menu item called MenuThink. If so, it displays a message dialog. When writing message handlers, remember to call the ancestor’s method afterward, if necessary, so Windows can perform default message processing.

procedure TForm1.WMCommand(var Msg: TWMCommand);

begin

  if Msg.ItemID = MenuThink.Command then

    MessageDlg('This is the Think command', mtInformation, [mbOk], 0);

  Inherited;

end;


Insert example

This code inserts a menu item after the first item in a menu named FileMenu:

procedure TForm1.Button1Click(Sender: TObject);

var

  NewItem: TMenuItem;

begin

  NewItem := TMenuItem.Create(FileMenu);

  try

    NewItem.Caption := 'Do this';

    FileMenu.Insert(1, NewItem);

  except

    NewItem.Free;

    raise; { reraise the exception }

  end;

end;


CustomForms example

The following code adds the name of all forms, dialogs, and property pages on the screen to ListBox1 when Button1 is clicked.

procedure TForm1.Button1Click(Sender: TObject);

var

  I: Integer;

begin

  for I := 0 to Screen.CustomFormCount-1 do

    ListBox1.Items.Add(Screen.CustomForms[I].Name);

end;


Height, Width example

The following code determines the height of all forms on the screen and resizes any that are taller than the screen height.

with Screen do

  for I := 0 to FormCount-1 do

    begin

    if Forms[I].Height > Height then

      Forms[I].Height := Height;

    if Forms[I].Width > Width then

      Forms[I].Width := Width;

    end;


Item example

The following code uses Item to add the labels of all child nodes of the selected node to a list box when a button is clicked.

procedure TForm1.Button1Click(Sender: TObject);

var

  I : Integer;

begin

  for I := 0 to (TreeView1.Selected.Count - 1) do

    ListBox1.Items.Add(TreeView1.Selected.Item[I].Text);

end;


CustomSort example

This example shows how to use the CustomSort method to order a subtree in case-insensitive alphabetical order (either forward or backward). The callback function CompareFunc below calls the global AnsiStrIComp function to perform the actual comparison.

function CustomSortProc(Node1, Node2: TTreeNode; Data: Longint): Integer; stdcall;

begin

  if Data = 0 then

    Result := AnsiStrIComp(Pchar(Node1.Text), PChar(Node2.Text));

  else

    Result := -AnsiStrIComp(PChar(Node1.Text), PChar(Node2.Text));

end;

This procedure can then be used as a parameter to CustomSort to sort the children of a node:

TreeNode1.CustomSort(@CustomSortProc, 0);  { Sorts in ascending order }

TreeNode1.CustomSort(@CustomSortProc, 1);  { Sorts in descending order }


Hint, OnHint, GetLongHint example

{ This shows how the OnHint event handler is declared as a public property of the form }

type

  TForm1 = class(TForm)

    Button1: TButton;

    StatusBar1: TStatusBar;

    Edit1: TEdit;

    procedure FormCreate(Sender: TObject);

  private

    { Private declarations }

  public

    procedure DisplayHint(Sender: TObject);

  end;

var

  Form1: TForm1;

implementation

{$R *.DFM}

{ Here is the implementation of the OnHint event handler }

{ It displays the application’s current hint in the status bar }

procedure TForm1.DisplayHint(Sender: TObject);

begin

  StatusBar1.SimpleText := GetLongHint(Application.Hint);

end;

{ Here is the form’s OnCreate event handler. }

{ It assign’s the application’s OnHint event handler at runtime }

{ because the Application is not available in the Object Inspector }

{ at design time }

procedure TForm1.FormCreate(Sender: TObject);

begin

  Application.OnHint := DisplayHint;

end;


Cursors, Cursor example

This example shows how to add custom cursors to an application.  It assumes that a custom cursor with the name NewCursor has been added to the resources (.RES file) of the application. You can add the cursor using the image editor. (Tools | Image Editor)

The following code makes this cursor available to the application via the constant crMyCursor, and sets it as the global cursor to the application.

const

  crMyCursor = 5;

procedure TForm1.FormCreate(Sender: TObject);

begin

  Screen.Cursors[crMyCursor] := LoadCursor(HInstance, 'NewCursor');

  Cursor := crMyCursor;

end;


Cursor example

Assignments to the Screen object's cursor property are typically guarded by a try...finally statement to ensure that normal cursor behavior is restored. Note that the original cursor is saved and restored.  This allows cursor changes to be nested without accidentally restoring the cursor to a hard-code value prematurely.

var

  Save_Cursor:TCursor;

Begin

  Save_Cursor := Screen.Cursor;

  Screen.Cursor := crHourglass;    { Show hourglass cursor }

  try

    { Do some lengthy operation }

  finally

    Screen.Cursor := Save_Cursor;  { Always restore to normal }

  end;

end;


StartTransaction, ApplyUpdates, Commit, Rollback, CommitUpdates example

The following procedure illustrates how to apply a dataset’s cached updates to a database in response to a button click:

procedure TForm1.ApplyButtonClick(Sender: TObject);

begin

  with CustomerQuery do

  begin

  Database1.StartTransaction;

    try

      ApplyUpdates; {try to write the updates to the database};

      Database1.Commit; {on success, commit the changes};

    except

      Database1.Rollback; {on failure, undo the changes};

    raise; {raise the exception to prevent a call to CommitUpdates!}

    end;

  CommitUpdates; {on success, clear the cache}

  end;

end;


UpdateRecordTypes, RevertRecord example

With minor coding, UpdateRecordTypes and RevertRecord can be used to undelete records when cached updates are enabled, as the following procedure demonstrates:

procedure UndeleteAll(DataSet: TBDEDataSet);

begin

  with DataSet do

  begin

  UpdateRecordTypes := [rtDeleted]; {make only deleted records visible}

   try

    First; {move to beginning of dataset}

    while not EOF do

      begin

      RevertRecord; {undelete the current record}

      Next; {move to the next record}

      end;

   finally

    UpdateRecordTypes := [rtModified, rtInserted, rtUnmodified];

   end;

  end;

end;


DataSetCount, DataSets example

The following code fragment illustrates how DataSets and DataSetCount can be used to ensure that an action is taken for every open dataset that is a table:

var

I: Integer;

begin

  with Database1 do

   for I := 0 to DataSetCount - 1 do

    if DataSets[I] is TTable then

      DataSets[I].CachedUpdates := True;

end;


DatabaseCount, Databases example

var

MaxDbCount: Integer;

begin

  with Session do

    if DatabaseCount > 0 then

    begin

      for MaxDbCount := 0 to DatabaseCount - 1 do

        Databases[MaxDbCount].KeepConnection := True;

    end;

  end;

end;


AddAlias example

This example creates an alias for an InterBase database server:

var

  MyList: TStringList;

begin

  MyList := TStringList.Create;

  try

    with MyList do

    begin

      Add('SERVER NAME=IB_SERVER:/PATH/DATABASE.GDB');

      Add('USER NAME=MYNAME');

    end;

    Session1.AddAlias('NewIBAlias', 'INTRBASE', MyList);

  finally

    MyList.Free;

  end;

end;


OpenKey, ReadString Example

The following example retrieves a value from a registry-entry.

uses Registry;

function GetRegistryValue: string;

var

  Registry: TRegistry;

  S: string;

begin

  Registry:=TRegistry.Create;

  Registry.RootKey:=HKEY_LOCAL_MACHINE;

  {False because we do not want to create it if it doesn’t exist}

  Registry.OpenKey('MYKEY',False);

  Result :=Registry.ReadString('VALUE1');

  Registry.Free;

end;


OnMoved example

This example uses a splitter and two image controls to create a “slide show” effect.  The example displays an image (the current “slide”), which can be hidden behind a screen that looks like a venetian blind.  When the blind is pulled down to completely cover the current slide, the slide changes to a different image.  When the blind is raised, the new image appears.

To prepare this example, follow these steps:

1. Place an image control on the form.

Set the picture property to a bitmap of a venetian blind,

Set the Stretch property to True.

Set the Align property to alTop.

2. Add a splitter control to the form.

Set the Align property to alTop.

Set the Cursor property to crVSplit.

Set the OnMoved event handler to the code that appears below.

Set the MinSize property to 1.

3. Add a second image control to the form.

Set the Align property to alClient.

Set the Stretch property to True.

4. Select the form and add the OnCreate and OnDestroy event handlers that appear below.

5. Add the global variables below to the unit.

var

  CurImage: Integer;

  BMPs: Array[1..5] of TBitmap;

procedure TForm1.Splitter1Moved(Sender: TObject);

begin

  { check if the blind is closed }

  if Image2.Height <= 1 then

  begin

    { the blind is closed, change the current slide }

    CurImage := CurImage + 1;

    if CurImage = 6 then

       CurImage := 1;

    Image2.Picture.Bitmap := BMPs[CurImage];

  end;

end;

procedure TForm1.FormCreate(Sender: TObject);

begin

  { Initialize the array of slides.

    These must be freed in the OnDestroy event handler. }

  BMPs[1] := TBitmap.Create;

  BMPs[1].LoadFromFile('c:\windows\Fiddle Head.bmp');

  BMPs[2] := TBitmap.Create;

  BMPs[2].LoadFromFile('c:\windows\Rhododendron.bmp');

  BMPs[3] := TBitmap.Create;

  BMPs[3].LoadFromFile('c:\windows\Furry dog.bmp');

  BMPs[4] := TBitmap.Create;

  BMPs[4].LoadFromFile('c:\windows\Soap bubbles.bmp');

  BMPs[5] := TBitmap.Create;

  BMPs[5].LoadFromFile('c:\windows\Gone Fishing.bmp');

  CurImage := 1;

  Image2.Picture.Bitmap := BMPs[1];

end;

procedure TForm1.FormDestroy(Sender: TObject);

var

  I: Integer;

begin

  { clean up }

  for I := 1 to 5 do

    BMPs[I].Free;

end;


LockList, UnlockList example

The following example shows how to use the LockList and UnlockList methods to access a thread-safe version  of a TList object:

with MyThreadList.LockList do

  try

    for X := 0 to Count-1 do

      Something(Items[X]);

  finally

    MyThreadList.UnlockList;

  end;


TThread, Priority, Resume Example
Create, Priority, Resume example

This example shows how to create a thread and start it running at a lower priority than the main execution thread. It assumes that the thread’s FreeOnTerminate property is True, so that there is no need to free the thread when it finishes.

var

  SecondProcess TMyThread; { TMyThread is a custom descendant of TThread }

begin

  SecondProcess := TMyThread.Create(True); { create suspended – secondprocess does not run yet }

  SecondProcess.Priority = tpLower; { set the priority to lower than normal }

  SecondProcess.Resume; { now run the thread }

end;


Synchronize example

This example shows how to call a button’s click method in a thread-safe manner:

procedure TMyThread.PushTheButton;

begin

  Button1.Click();

end;

procedure TMyThread.Execute;

begin

...

  Synchronize(PushTheButton);

  ...

end;


Execute, Socket, Write, Terminated, Active example

This example shows the execute method of a thread used to send requests to a server over a socket connection:

procedure TMyClientThread.Execute;

var

  TheStream: TWinSocketStream;

  buffer: string;

begin

  { create a TWinSocketStream for reading and writing }

  TheStream := TWinSocketStream.Create(ClientSocket1.Socket, 60000);

  try

    { fetch and process commands until the connection or thread is terminated }

    while (not Terminated) and (ClientSocket1.Active) do

    begin

      try

        GetNextRequest(buffer); { GetNextRequest must be a thread-safe method }

        { write the request to the server }

        TheStream.Write(buffer, Length(buffer) + 1);

        { continue the communication (eg read a response from the server) }

        ...

      except

        if not(ExceptObject is EAbort) then

          Synchronize(HandleThreadException); { you must write HandleThreadException }

      end;

    end;

  finally

   TheStream.Free;

  end;

end;


Copy, Component example

The following Copy method allows a TImage component to copy its picture to the Clipboard. This picture is ignored by the IDE, but can be pasted into other applications.

procedure TComponentEditor.Copy;

var

  AFormat : Word;

  AData,APalette : THandle;

begin

  with Component as TImage do

  begin

    Picture.SaveToClipBoardFormat(AFormat,AData,APalette);

    ClipBoard.SetAsHandle(AFormat,AData);

  end;

end;


Perform example

The following example demonstrates the use of the Perform method to send a windows message. The EM_SCROLLCARET message scrolls the caret in the rich edit into view. The caret position is set to the contents of the mask edit prior to calling Perform.

procedure TForm1.Button1Click(Sender: TObject);

begin

with RichEdit1 do

  Begin

    SelStart := StrToInt(MaskEdit1.Text);

    RichEdit1.Perform(EM_SCROLLCARET, 0, 0);

  end;

end;


CompareBookmarks example

function CompareRecordsAtCursor: Boolean;

begin

  if Table1.Bookmark and Table2.Bookmark then

    result := Table1.CompareBookmarks(Table1.Bookmark, Table2.Bookmark);

end;


Align, PageControl, TPageControl.Create example

This example dynamically creates a Page Control, then a series of Tab Sheets on the Page Control.

procedure TForm1.FormCreate(Sender: TObject);

const

  TabTitles: array[0..3] of ShortString = ('Customer', 'Orders', 'Items', 'Parts' );

var

  i: Integer;

  PageControl1: TPageControl;

begin

  PageControl1 := TPageControl.Create(Self);

  PageControl1.Parent := Self;

  PageControl1.Align := alClient;

  for i := Low(TabTitles) to High(TabTitles) do

    with TTabSheet.Create(PageControl1) do

    begin

      PageControl := PageControl1;

      Name := 'ts' + TabTitles[i];

      Caption := TabTitles[i];

   end;

end;


SaveToStream, LoadFromStream example

This example requires TListBox, TRichEdit, and TButton controls placed on the form.  The list box should contain one or more items.

When the form becomes visible, click on the button and the contents of the list box will be transferred to the rich edit control.

procedure TForm1.Button1Click(Sender: TObject);

var

  TempStream : TMemoryStream;

begin

  TempStream := TMemoryStream.Create;

  ListBox1.Items.SaveToStream(TempStream);  // write list box contents to the

                                            // stream

  TempStream.Position := 0;      // reset to the beginning of the stream

  RichEdit1.Lines.LoadFromStream( TempStream); // load stream contents into rich

                                               // edit control

  TempStream.Free;

end;


DialogHandle Example

Here is part of the window procedure for Delphi's encapsulation of the Windows search-and-replace common dialog box:

function SearchAndReplaceWndProc(Wnd: HWnd; Msg, WParam: Word; LParam: Longint): Longint;

begin

  try

    case Msg of

      WM_DESTROY: Application.DialogHandle := 0;	{ clear handle on destroy }

      WM_NCACTIVATE:

        if Bool(WParam) then	{ if it's activating... }

          Application.DialogHandle := Wnd;	{ ...assign the handle... }

        else Application.DialogHandle := 0;	{ ...otherwise clear it }

      ...

    end;

    Result := CallDefDialogProc;

  except

    Application.HandleException(nil);

  end;

end;


Splitter Example

This example shows how to use a splitter to divide a form into resizeable panes.  All objects on the form are created dynamically in the OnCreate event handler of the form.  To run this example, add extctrls and filectrl to the uses clause of the form’s implementation section.

Note that when creating a splitter dynamically at runtime, it is important to set its position to the appropriate side of the control it will resize.

procedure TForm1.Form1Create(Sender: TObject);

var

  Split: TSplitter;

  Files: TFileListBox;

  Dirs: TDirectoryListBox;

begin

  { first add a directory list box to the form }

  Dirs := TDirectoryListBox.Create(Form1);

  { line it up on the left of the form }

  Dirs.Parent := Form1;

  Dirs.Align := alLeft;

  Dirs.Width := Form1.ClientWidth div 3

{ now add the splitter to divide the directory pane from the file pane }

  Split := TSplitter.Create(Form1);

  Split.Parent := Form1;

  { make sure the splitter is to the right of the directory list box! }

  Split.Left := Dirs.Left + Dirs.Width + 1;

  Split.Align := Dirs.Align; { give it the same alignment as the directory }

  { each pane must be at least one quarter of the form’s width }

  Split.MinSize := Form1.ClientWidth div 4;

  { Finally, create the last pane – a file list box }

  Files := TFileListBox.Create(Form1);

  Files.Parent := Form1;

  Files.Align := alClient;

  Dirs.FileList := Files; { link the file list box to the directory list box }

end;


ClientExecute, ClientSocket, WaitForData, Read, HandleException example

The following example shows a typical ClientExecute method for a custom descendant of TServerClientThread. It reads from the socket connection specified by ClientSocket using a thread-local instance of TWinSocketStream.

procedure TMyServerThread.ClientExecute;

var

  Stream : TWinSocketStream;

  Buffer : array[0 .. 9] of Char;

begin

  { make sure connection is active }

  while (not Terminated) and ClientSocket.Connected do

  begin

    try

      Stream := TWinSocketStream.Create(ClientSocket, 60000);

      try

        FillChar(Buffer, 10, 0); { initialize the buffer }

        { give the client 60 seconds to start writing }

        if Stream.WaitForData(60000) then

        begin

          if Stream.Read(Buffer, 10) = 0 then { if can’t read in 60 seconds }

            ClientSocket.Close;               { close the connection }

          { now process the request }

          ...

        end

        else

          ClientSocket.Close; { if client doesn’t start, close }

      finally

        Stream.Free;

      end;

    except

      HandleException;

    end;

  end;

end;


OnUndock, DockSite, DockClientCount example

The following example is taken from the docking demo. It shows how the OnUnDock event handler of the conjoinment docking site re-enables docking in the control that is undocked (if it is a dockable form). In addition, when the next to last docked control is undocked, the conjoinment docking site sends itself a close message so that the last docked control is undocked to its old position and size.

procedure TConjoinDockHost.FormUnDock(Sender: TObject; Client: TControl; NewTarget: TWinControl; var Allow: Boolean);

begin

  //only 2 dock clients means the host must be destroyed and

  //the remaining window undocked to its old position and size.

  //(Recall that OnUnDock gets called before the undocking actually occurs)

  if Client is TDockableForm then

    TDockableForm(Client).DockSite := True;

  if (DockClientCount = 2) and (NewTarget <> Self) then

    PostMessage(Self.Handle, WM_CLOSE, 0, 0);

  UpdateCaption(Client);

end;


OnDockOver, DockRect example

The following example is taken from the docking demo. It shows how the OnDockOver event handler conditionally accepts controls (only TDockableForm descendants) and specifies the docking rectangle where they may appear.

procedure TDockableForm.FormDockOver(Sender: TObject; Source: TDragDockObject; X, Y: Integer; State: TDragState; var Accept: Boolean);

var

  ARect: TRect;

begin

  Accept := (Source.Control is TDockableForm);

  //Draw dock preview depending on where the cursor is relative to our client area

  if Accept and (ComputeDockingRect(ARect, Point(X, Y)) <> alNone) then

    Source.DockRect := ARect;

end;


OnCustomDraw, Canvas, Bitmap, StretchDraw example

The following example is taken from the custom draw demo. It shows how the OnCustomDraw event handler draws the background for the tree view before the items and lines are drawn.

procedure TCustomDrawForm.TVCustomDraw(Sender: TCustomTreeView; const ARect: TRect; var DefaultDraw: Boolean);

begin

//This event should be used to draw any background colors or images.

//ARect represents the entire client area of the TreeView.

//Use the TreeView's canvas to do the drawing.

//Note that drawing a background bitmap is not really supported by CustomDraw,

//so scrolling can get messy. Best to subclass the TreeView and handle scrolling

//messages.

  with TV.Canvas do

  begin

    if None1.Checked then //no picture

    begin

      Brush.Color := BkgColorDialog.Color;

      Brush.Style := FBrushStyle;

      FillRect(ARect);

    end else

      if Tile1.Checked then //tile bitmap

      begin

        Brush.Bitmap := Image1.Picture.Bitmap;

          FillRect(ARect);

        end else //Stretch across the canvas.

            StretchDraw(ARect, Image1.Picture.Bitmap);

  end;

  DefaultDraw := FDefaultDraw;

  //setting DefaultDraw to false here prevents all calls to OnCustomDrawItem.

end;


OnCustomDrawItem, DisplayRect, Level, Indent example

The following example is taken from the custom draw demo. It shows how the OnCustomDrawItem event handler draws items and lines of the tree view after the OnCustomDraw event handler has filled in the background.

procedure TCustomDrawForm.TVCustomDrawItem(Sender: TCustomTreeView; Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);

var

  NodeRect: TRect;

begin

  with TV.Canvas do

  begin

    //If DefaultDraw it is true, any of the node's font properties can be

    //changed. Note also that when DefaultDraw = True, Windows draws the

    //buttons and ignores our font background colors, using instead the

    //TreeView's Color property.

    if cdsSelected in State then

    begin

      Font.Assign(SelectedFontDialog.Font);

      Brush.Color := SelBkgColorDialog.Color;

    end;

    DefaultDraw := FDefaultDrawItem;

    //DefaultDraw = False means you have to handle all the item drawing yourself,

    //including the buttons, lines, images, and text.

    if not DefaultDraw then

    begin

      //draw the selection rect.

      if cdsSelected in State then

      begin

        NodeRect := Node.DisplayRect(True);

        FillRect(NodeRect);

      end;

      NodeRect := Node.DisplayRect(False);

      if None1.Checked then

      //no bitmap, so paint in the background color.

      begin

        Brush.Color := BkgColorDialog.Color;

        Brush.Style := FBrushStyle;

        FillRect(NodeRect)

      end

      else

        //don't paint over the background bitmap.

        Brush.Style := bsClear;

      NodeRect.Left := NodeRect.Left + (Node.Level * TV.Indent);

      //NodeRect.Left now represents the left-most portion of the expand button

      DrawButton(NodeRect, Node);

      NodeRect.Left := NodeRect.Left + TV.Indent + FButtonSize;

      //NodeRect.Left is now the leftmost portion of the image.

      DrawImage(NodeRect, Node.ImageIndex);

      NodeRect.Left := NodeRect.Left + ImageList.Width;

      //Now we are finally in a position to draw the text.

      TextOut(NodeRect.Left, NodeRect.Top, Node.Text);

    end;

  end;

end;


Items example

The following example adds the name of each field def of a table to a list box.

procedure TForm1.Button1Click(Sender: TObject);

var i: Integer;

begin

  Table1.Active := True;

  for i:= 1 to Table1.FieldDefs.Count - 1 do

  begin

    ListBox1.Items.Add(Table1.FieldDefs[i].Name);

  end;

  Table1.Active := False;

end;


Items Example
VertScrollBar example

The following example demonstrates form scrolling with the PgUp and PgDown keys.

procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;

Shift: TShiftState);

const

  PageDelta = 10;

begin

  With VertScrollbar do

    if Key = VK_NEXT then

      Position := Position + PageDelta

    else if Key = VK_PRIOR then

      Position := Position - PageDelta;

end;


OnUpdate, Checked example

When the application is idle, the OnUpdate event occurs for every action that is linked to a visible control or menu item that is showing. This provides an opportunity for applications to execute centralized code for enabling and disabling, checking and unchecking, and so on. For example, the following code illustrates the OnUpdate event handler for an action that is “checked” when the toolbar is visible. This example requires a TActionList (with one TAction) and a TToolBar on a form.

procedure TForm1.Action1Update(Sender: TObject);

begin

{ Indicate whether ToolBar1 is currently visible }

(Sender as TAction).Checked := ToolBar1.Visible;

end;


OnExecute example

When a client component or control is clicked, the OnExecute event occurs for it’s associated action. For example, the following code illustrates the OnExecute event handler for an action that toggles the visibility of a toolbar when the action is executed. This example requires a TActionList (with one TAction) and a TToolBar on a form.

procedure TForm1.Action1Execute(Sender: TObject);

begin

{ Toggle Toolbar1’s visibility }

ToolBar1.Visible := not ToolBar1.Visible;

end;


WriteComponent, Seek, ObjectBinaryToText, DataString, ObjectTextToBinary, ReadComponent Example

This example shows how to use the built-in VCL component streaming support to convert any component into a string and convert that string back into a component.

function ComponentToString(Component: TComponent): string;

var

  BinStream:TMemoryStream;

  StrStream: TStringStream;

  s: string;

begin

  BinStream := TMemoryStream.Create;

  try

    StrStream := TStringStream.Create(s);

    try

      BinStream.WriteComponent(Component);

      BinStream.Seek(0, soFromBeginning);

      ObjectBinaryToText(BinStream, StrStream);

      StrStream.Seek(0, soFromBeginning);

      Result:= StrStream.DataString;

    finally

      StrStream.Free;

    end;

  finally

    BinStream.Free

  end;

end;

function StringToComponent(Value: string): TComponent;

var

  StrStream:TStringStream;

  BinStream: TMemoryStream;

begin

  StrStream := TStringStream.Create(Value);

  try

    BinStream := TMemoryStream.Create;

    try

      ObjectTextToBinary(StrStream, BinStream);

      BinStream.Seek(0, soFromBeginning);

      Result := BinStream.ReadComponent(nil);

    finally

      BinStream.Free;

    end;

  finally

    StrStream.Free;

  end;

end;


DirectoryExists, CreateDir, Create example

The following example creates a directory ‘C:\temp’ if it does not already exist.

uses FileCtrl;

procedure TForm1.Button1Click(Sender: TObject);

begin

  if not DirectoryExists('c:\temp') then

    if not CreateDir('C:\temp') then

    raise Exception.Create('Cannot create c:\temp');

end;


BeforeClose, UpdatesPending, UpdateStatus, ApplyUpdates example

The following example applies cached updates from a master/detail relationship. The updates are applied from the BeforeClose event handler of the detail set. Note that using cached updates in this manner requires that you apply updates any time you change the master record. For more control over cached updates, you must use a client dataset instead.

procedure TForm1.DetailBeforeClose(DataSet: TDataSet);

begin

  if Master.UpdatesPending or Detail.UpdatesPending then

    if Master.UpdateStatus = usInserted then

      Database1.ApplyUpdates([Master, Detail])

    else

      Database1.ApplyUpdates([Detail, Master]);

end;


IsAlias, GetAliasParams, ModifyAlias, SaveConfigFile example

The following example changes a parameter of a session’s alias.

procedure TForm1.ChangeAlias;

var

  AParams: TStringList;

  Dir: string;

begin

  if not Session.IsAlias('MyAlias') then

    begin

      ShowMessage('Alias MyAlias does not exist');

      Exit;

    end;

  AParams := TStringList.Create;

  try

    // get the current PATH parameter

    Session.GetAliasParams('MyAlias',AParams);

    Dir := Copy(AParams.Strings[0],6,255);

    // get the new PATH parameter

    if InputQuery('MyAlias Alias Path','Path:' ,Dir) then

      begin

        // Update the alias parameters

        AParams.Clear;

        AParams.Add('PATH=' + Dir);

        Session.ModifyAlias('MyAlias',AParams);

        Session.SaveConfigFile;

      end;

    finally

      AParams.Free;

    end;

  end;


Create, OpenKey, RootKey, WriteString, CloseKey example

The following example shows how to tell Windows to relaunch your application when Windows starts up if it was running when the system shut down. When Windows starts up, it launches each application listed in the RunOnce key and then deletes the entry for that application.  Therefore, you do not need to remove the entry written here.

procedure TForm1.WMEndSession(var Message: TWMEndSession);

var

  Reg: TRegistry;

begin

  Reg := TRegistry.Create;

  try

    Reg.RootKey := HKEY_CURRENT_USER;

    if Reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\RunOnce', True)

    then Reg.WriteString('MyApp','"' + ParamStr(0) + '"');

  finally

    Reg.CloseKey;

    Reg.Free;

    inherited;

  end;

end;

In order for this method to be called, it must be declared in the interface section of your unit as follows:

private

  procedure WMEndSession(var Msg:TWMEndSession); message WM_ENDSESSION;


Exit, Source, Destination, Mode, Execute example

The following example uses a batch move component to move the contents of a query to the table chosen from a save dialog. The Exit procedure allows the event handler to terminate if the query has no answer set.

procedure TForm1.Button1Click(Sender: TObject);

begin

  if Query1.Active = False then

    Exit;

  if SaveDialog1.Execute then

    begin

      Table1.TableName := SaveDialog1.FileName;

      with BatchMove1 do

        begin

          Source := Query1;

          Destination := Table1;

          Mode := batCopy;

          Execute;

          ShowMessage(IntToStr(MovedCount) + ' records copied');

        end;

     end;

  end;


CopyMode, CopyRect Example
CopyMode example

The following example uses the CopyMode of an image’s canvas to blank out the image when the user chooses the “Cut” menu item.

procedure TForm1.Cut1Click(Sender: TObject);

var

  ARect: TRect;

begin

  Copy1Click(Sender); { do the same thing as the copy menu item }

  with Image.Canvas do

  begin

    CopyMode := cmWhiteness;

    ARect := Rect(0, 0, Image.Width, Image.Height);

    CopyRect(ARect, Image.Canvas, ARect);

    CopyMode := cmSrcCopy; { restore the copy mode }

  end;

end;


Copy, SelStart, SelLength Example
Copy, Chr, SelStart, SelLength example

The following example shows how to complete partial strings typed into a combo box. The code represents the OnKeyPress event handler of the combo box, which performs most of the default keystroke handling before finding a matching list item and updating the text.

Note:	This OnKeyPress event handler does not deal with the case when the user types the Delete key. That case must be caught in the OnKeyDown event handler instead.

procedure TForm1.ComboBox1KeyPress(Sender: TObject; var Key: Char);

var

  Found: boolean;

  i,SelSt: Integer;

  TmpStr: string;

begin

  { first, process the keystroke to obtain the current string }

  { This code requires all items in list to be uppercase}

  if Key in ['a'..'z'] then Dec(Key,32); {Force Uppercase only!}

  with (Sender as TComboBox) do

  begin

    SelSt := SelStart;

    if (Key = Chr(vk_Back)) and (SelLength <> 0) then

     TmpStr := Copy(Text,1,SelStart)+Copy(Text,SelLength+SelStart+1,255)

    else if Key = Chr(vk_Back) then {SelLength = 0}

     TmpStr := Copy(Text,1,SelStart-1)+Copy(Text,SelStart+1,255)

    else {Key in ['A'..'Z', etc]}

     TmpStr := Copy(Text,1,SelStart)+Key+Copy(Text,SelLength+SelStart+1,255);

    if TmpStr = '' then Exit;

    { update SelSt to the current insertion point }

    if (Key = Chr(vk_Back)) and (SelSt > 0) then Dec(SelSt)

    else if Key <> Chr(vk_Back) then Inc(SelSt);

    Key := #0; { indicate that key was handled }

    if SelSt = 0 then

    begin

      Text:= '';

      Exit;

    end;

   {Now that TmpStr is the currently typed string, see if we can locate a match }

    Found := False;

    for i := 1 to Items.Count do

      if Copy(Items[i-1],1,Length(TmpStr)) = TmpStr then

      begin

        Text := Items[i-1]; { update to the match that was found }

        ItemIndex := i-1;

        Found := True;

        Break;

      end;

    if Found then { select the untyped end of the string }

    begin

      SelStart := SelSt;

      SelLength := Length(Text)-SelSt;

    end

    else Beep;

  end;

end;


EXEName example

The following example uses EXEName to locate a data directory off of the application directory.

procedure TForm1.Button1Click(Sender: TObject);

begin

  Table1.DatabaseName := ExtractFilePath(Application.EXEName) + 'Data';

  Table1.TableName := 'Animals.dbf';

  Table1.Active := True;

end;


OnDrawDataCell, DefaultDrawDataCell example

The following example conditionally changes the font color of rows in a DB Grid. The following code is added to the DB Grid’s OnDrawDataCell event. If the field Size is greater than 10, the row’s font will be red.

procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect; Field: TField; State: TGridDrawState);

begin

  if Table1.FieldByName('Size').AsFloat > 10 then

    DBGrid1.Canvas.Font.Color := clRed;

  DBGrid1.DefaultDrawDataCell(Rect, Field, State);

end;


SetRange, CancelRange, Refresh example

The following example sets a range for a table. The form requires two edit boxes, a data source, a table, a db grid, and a button.

procedure TForm1.FormActivate(Sender: TObject);

begin

  Table1.DatabaseName := 'DBDemos';

  Table1.TableName := 'Customer.db';

  Table1.Active := True;

  Table1.IndexName := 'ByCompany';

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

  Table1.DatabaseName := ‘DBDemos’;

  Table1.TableName := ‘Customer.db’;

  Table1.Active := True;

  Table1.IndexName := 'ByCompany';

  if Button1.Caption = '&Apply Range' then

    begin

      Table1.SetRange([Edit1.Text],[Edit2.Text]);

      Button1.Caption := '&Drop Range';

    end

  else

    begin

      Table1.CancelRange;

      Table1.Refresh;

      Button1.Caption := '&Apply Range';

    end;

end;


ReadSection, ReadSections, ReadSectionValues example

The following example reads information from a WIN.INI file into three listboxes on a form.

uses IniFiles;

procedure TForm1.FormActivate(Sender: TObject);

var

  AppIni: TIniFile;

begin

  AppIni := TIniFile.Create('WIN.INI');

  AppIni.ReadSections(ListBox1.Items);

  AppIni.ReadSection('Ports',Listbox2.Items);

  AppIni.ReadSectionValues('Ports',ListBox3.Items);

  AppIni.Free;

end;


FindNearest example

The following example performs an incremental search on a table.  The form contains a db grid, an edit box, a data source, and a table. As the user types in the edit box, the cursor of the grid moves to the nearest match in the table.

procedure TForm1.FormActivate(Sender: TObject);

begin

  Table1.DatabaseName := 'DBDemos';

  Table1.TableName := 'Customer.db';

  Table1.Active := True;

  Table1.IndexName := 'ByCompany';

end;

procedure TForm1.Edit1Change(Sender: TObject);

begin

    Table1.FindNearest([Edit1.Text]);

end;


FormatFloat, DiskFree example

The following example displays in a dialog the disk free space of the current drive with commas as thousand separators.

ShowMessage(FormatFloat('#,##0 bytes', DiskFree(0)));


OleCheck, GuidToString example

The following example manufactures a GUID and displays it in a dialog box after translating it to a string.

uses ActiveX, ComObj;

procedure TForm1.Button1Click(Sender: TObject);

var

  G: TGUID;

begin

  OleCheck(CoCreateGuid(G));

  ShowMessage(GuidToString(G));

end;


FindComponent example

The following example creates 20 edit boxes, using FindComponent with the edit box name to access each newly created edit box.

procedure TForm1.Button1Click(Sender: TObject);

var

  i: Integer;

const

  NamePrefix = 'MyEdit';

begin

  for i := 1 to 20 do begin

    TEdit.Create(Self).Name := NamePrefix + IntToStr(i);

    with TEdit(FindComponent(NamePrefix + IntToStr(i))) do

    begin

      Left := 10;

      Top := i * 20;

      Parent := self;

    end;

  end;

end;


MoveBy, SelectedIndex, Tag example

The following example enables the user to move the current selected cell in a db grid.  The Up and Down buttons have their OnClick events assigned to the UpDownClick procedure.  The Left and Right buttons have their OnClick events assigned to the LeftRightClick procedure.  The Up and Left buttons have their Tag property set to –1, while the Down and Right buttons have their Tag property set to 1.

procedure TForm1.UpDownClick(Sender: TObject);

begin

  Table1.MoveBy(TComponent(Sender).Tag);

  DBGrid1.SetFocus;

end;

procedure TForm1.LeftRightClick(Sender: TObject);

begin

  DBGrid1.SelectedIndex := DBGrid1.SelectedIndex + TComponent(Sender).Tag;

  DBGrid1.SetFocus;

end;


WndProc, WindowProc example

This example shows how to use the WndProc method and the WindowProc property to subclass a custom control’s window procedure.  This example subclasses the window procedure of a TListBox descendant to respond to a user-defined message called WM_STYLEMESSAGE. The subclassed window procedure can be turned on or off by pressing a radio button.

procedure TMyListBoxDescendant.SubClassWndProc(var Message: TMessage);

begin

  if Message.Msg = WM_STYLEMESSAGE then

    Style := TListBoxStyle(Message.WParam)

  else

    WndProc(Message);

end;

procedure TMyListBoxDescendant.ToggleSubClass(On: Boolean);

begin

  if On then

    WindowProc := SubClassWndProc;

  else

    WindowProc := WndProc;

end;

procedure TForm1.SubClassRadioGroup1Click(Sender: TObject);

begin

  MyListBoxDescendant1.ToggleSubClass(SubClassRadioGroup1.ItemIndex = 0);

end;


SelectedRows, Count, Items, DataSource, FieldCount, Fields, GoToBookmark, DataSet example

The following example copies the selected rows in a db grid to a list box.

procedure TForm1.Button1Click(Sender: TObject);

var

  i, j: Integer;

  s: string;

begin

  if DBGrid1.SelectedRows.Count>0 then

    with DBGrid1.DataSource.DataSet do

      for i:=0 to DBGrid1.SelectedRows.Count-1 do

      begin

        GotoBookmark(pointer(DBGrid1.SelectedRows.Items[i]));

        for j := 0 to FieldCount-1 do

        begin

          if (j>0) then s:=s+', ';

          s:=s+Fields[j].AsString;

        end;

        Listbox1.Items.Add(s);

        s:= '';

      end;

end;


SaveToFile, Create, Height, Width, Canvas, ChangeFileExt example

This example converts a specified icon to a bitmap. To run this example, add an image, a button, and an Open dialog to a form. Name the button ConvertIcon2Bitmap, and add the following code as its OnClick event handler.

procedure TForm1.ConvertIcon2BitmapClick(Sender: TObject);

var

  s : string;

  Icon: TIcon;

begin

  OpenDialog1.DefaultExt := '.ICO';

  OpenDialog1.Filter := 'icons (*.ico)|*.ICO';

  OpenDialog1.Options := [ofOverwritePrompt, ofFileMustExist, ofHideReadOnly ];

  if OpenDialog1.Execute then

  begin

    Icon := TIcon.Create;

    try

      Icon.Loadfromfile(OpenDialog1.FileName);

      s:= ChangeFileExt(OpenDialog1.FileName,'.BMP');

      Image1.Width := Icon.Width;

      Image1.Height := Icon.Height;

      Image1.Canvas.Draw(0,0,Icon);

      Image1.Picture.SaveToFile(s);

      ShowMessage(OpenDialog1.FileName + ' Saved to ' + s);

    finally

      Icon.Free;

    end;

  end;

end;


Tabs, TabIndex, OnChange, Assign example

This example uses a tab control to display the contents of several files. To run the example, place a tab control on a form and add a memo control that fits nicely into its client area. Be sure to leave enough room for the tabs when they appear. Then add an OpenDialog and a button to the form.

Place the following code in the button’s OnClick event handler:

procedure TForm1.Button1Click(Sender: TObject);

begin

  OpenDialog1.Options := [ofAllowMultiSelect, ofFileMustExist, ofHideReadOnly ];

  if OpenDialog1.Execute then

  begin

    TabControl1.Tabs.Assign(OpenDialog1.Files);

    Memo1.Lines.LoadFromFile(TabContol1.Tabs[TabControl1.TabIndex]);

  end;

end;

Place the following code in the tab control’s OnChange event handler:

procedure TForm1.TabControl1Change(Sender: TObject);

begin

  with TabControl1 do

    Memo1.Lines.LoadFromFile(Tabs[TabIndex]);

end;


FindComponent, TCanvas.Create, GetDeviceContext, Handle, Palette example

The GetFormImage allows you to easily obtain a bitmap of a form. The following code allows you to obtain a bitmap for any other control. The name of the control to draw is read from an edit control.

type

  LogPal = record

  lpal : TLogPalette;

  dummy:Array[0..255] of TPaletteEntry;

  end;

procedure TForm1.SaveAsBmpClick(Sender: TObject);

var

  Source: TComponent;

  SysPal : LogPal;

  tempCanvas: TCanvas;

  sourceRect, destRect: TRect;

  image2save: TImage;

  notUsed: HWND;

begin

  Source := FindComponent(Edit1.Text);

  if (not Source is TControl) or

     ((not Source is TWinControl) and ((Source as TControl).Parent = nil)) then

  begin

    Beep;

    ShowMessage(Edit1.Text + ' is not a valid control.');

    Exit;

  end;

  tempCanvas := TCanvas.Create;

  try

    with Source as TControl do

      tempCanvas.Handle := GetDeviceContext(notUsed);

    image2save:=TImage.create(self);

    try

      with image2save do

      begin

        Height := (Source as TControl).Height;

        Width :=  (Source as TControl).Width;

        destRect := Rect(0,0,Width,Height);

        if Source is TWinControl then

          sourceRect := destRect;

        else

          sourceRect := (Source as TControl).BoundsRect;

        Canvas.CopyRect(destRect,tempCanvas,sourceRect);

        SysPal.lPal.palVersion:=$300;

        SysPal.lPal.palNumEntries:=256;

        GetSystemPaletteEntries(tempCanvas.Handle,0,256,SysPal.lpal.PalpalEntry);

        Picture.Bitmap.Palette:= CreatePalette(Syspal.lpal);

      end;

      if SaveDialog1.Execute then

        image2save.Picture.SaveToFile(SaveDialog1.FileName);

    finally

     image2save.Free;

    end;

  finally

    tempCanvas.Free;

  end;

end;


GetVerb, GetVerbCount, ExecuteVerb example

This example shows how to use a component editor to create a context menu for a component.

type

  THelloGoodByeComponentEditor = class(TComponentEditor)

    procedure ExecuteVerb(Index: Integer); override;

    function GetVerb(Index: Integer): string; override;

    function GetVerbCount: Integer; override;

  end;

procedure THelloGoodByeComponentEditor.ExecuteVerb(Index: Integer);

begin

  case Index of

    0 : ShowMessage('Hello');

    1 : ShowMessage('Goodbye');

  end;

end;

function THelloGoodByeComponentEditor.GetVerb(Index: Integer): string;

begin

  case Index of

    0: Result := 'Arrive';

    1 : Result := 'Depart';

  end;

end;

function THelloGoodByeComponentEditor.GetVerbCount: Integer;

begin

  Result := 2;

end;


Create, CreateKey, WriteString example

This OnClick event handler adds the value specified in the ValueforKey edit box to the registry key specified by the NameofKey edit box. If the named key does not already exist, it creates one. (Note that if you don’t want to give the user a choice, this could be accomplished more simply by setting the CanCreate parameter of the OpenKey call to True).

procedure TForm1.Button1Click(Sender: TObject);

var

  Reg: TRegIniFile;

begin

  if Length(NameofKey.Text) or Length(ValueforKey.Text) <=0 then

    Showmessage('Either the key name or value is missing.')

  else

  begin

    Reg:=TRegIniFile.Create;

    try

      Reg.RootKey:=HKey_Local_Machine; // Section to look for within the registry

      if not Reg.OpenKey(NameofKey.Text,False) then

        if MessageDlg('The specified key does not exist, create it?'

                 ,Mtinformation,[mbYes,mbNo],0)=mryes then

        begin

          Reg.CreateKey(NameofKey.Text);

          if not Reg.OpenKey(NameofKey.Text,False) then

            ShowMessage('Error in Opening Created Key')

          else

            Reg.WriteString('Value1',ValueForKey.Text);

        end

     else

       Reg.WriteString('Value1',ValueForKey.Text);

    finally

      Reg.Free;

    end;

  end;

end;


GetValueNames, DeleteKey example

This OnClick event handler deletes all values saved in the registry under they key named in an edit control.

procedure TForm1.Button1Click(Sender: TObject);

var

  Reg: TRegistry;

  Val:TStringList;

  I:Integer;

begin

  Reg:=TRegistry.Create;

  try

    Val:=TStringList.Create;

    try

      Reg.RootKey:=HKey_Local_Machine; // Section to look for within the registry

      if not Reg.OpenKey(Edit1.Text,False) then

        ShowMessage('Error opening key')

      else

      begin

        Reg.GetValueNames(Val);

        for I:=0 to Val.Count-1 do

        begin

          ShowMessage(Edit1.Text + Chr(13) +

                      'has an Entry Called '+Val.Strings[I]+Chr(13)+

                      'With a Value of '+Reg.ReadString(Val.Strings[I]));

        end;

        if MessageDlg('Ok to delete the key and lose all these values?'

                     ,Mtinformation,[mbYes,mbNo],0)=mryes then

           Reg.DeleteKey(Edit1.Text);

      end;

    finally

      Val.Free;

    end;

  finally

    Reg.Free;

  end;

end;


Canvas Example
OnDrawItem, Canvas example

Here is a typical handler for an OnDrawItem event. In the example, a list box with the lbOwnerDrawFixed style draws a bitmap to the left of each string.

procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;

Rect:TRect;State: TOwnerDrawState);

var

Bitmap: TBitmap;      { temporary variable for the item’s bitmap }

Offset: Integer;      { text offset width }

begin

with (Control as TListBox).Canvas do  { draw on control canvas, not on the form }

begin

FillRect(Rect);       { clear the rectangle }

Offset := 2;          { provide default offset }

Bitmap := TBitmap((Control as TListBox).Items.Objects[Index]);  { get the bitmap }

if Bitmap <> nil then

begin

BrushCopy(Bounds(Rect.Left + 2, Rect.Top, Bitmap.Width, Bitmap.Height),

Bitmap, Bounds(0, 0, Bitmap.Width, Bitmap.Height), clRed);  {render bitmap}

Offset := Bitmap.width + 6;    { add four pixels between bitmap and text}

end;

TextOut(Rect.Left + Offset, Rect.Top, (Control as TListBox).Items[Index])  { display the text }

end;

end;


ReadBoolean, WriteBoolean, ReadComponent, WriteComponent, DefineProperties, DefineProperty, Ancestor example

This example shows how to load and save an unpublished property whose value is a component that was created at runtime. It defines two methods, LoadCompProperty and StoreCompProperty that load or save the property value. The also defines an override for the DefineProperties method where these methods are passed to the streaming system. The DefineProperties method checks the filer’s Ancestor property to avoid saving a property value in inherited forms.

procedure TSampleComponent.LoadCompProperty(Reader: TReader);

begin

  if Reader.ReadBoolean then

    MyCompProperty := Reader.ReadComponent(nil);

end;

procedure TSampleComponent.StoreCompProperty(Writer: TWriter);

begin

  Writer.WriteBoolean(MyCompProperty <> nil);

  if MyCompProperty <> nil then

    Writer.WriteComponent(MyCompProperty);

end;

procedure TSampleComponent.DefineProperties(Filer: TFiler);

  function DoWrite: Boolean;

  begin

    if Filer.Ancestor <> nil then { check Ancestor for an inherited value }

    begin

      if TSampleComponent(Filer.Ancestor).MyCompProperty = nil then

        Result := MyCompProperty <> nil

      else if MyCompProperty = nil or

         TSampleComponent(Filer.Ancestor).MyCompProperty.Name <> MyCompProperty.Name then

        Result := True

      else Result := False;

    end

    else { no inherited value -- check for default (nil) value }

      Result := MyCompProperty <> nil;

  end;

begin

  inherited; { allow base classes to define properties }

  Filer.DefineProperty('MyCompProperty', LoadCompProperty, StoreCompProperty, DoWrite);

end;


Connected, Execute, Handle example

The example below demonstrates executing an SQL statement from a TDatabase that both returns a result set and uses parameters. The SQL statement that produces the result set is assigned to the String variable SQLstmt and passed in the Execute method through its SQL parameter. The SQL statement includes one parameter, named StateParam. A TParams object named stmtParams is created to pass parameters to the Execute method. One TParam object is created to represent the SQL parameter StateParam using the TParams.CreateParam method. The TParams object is then passed in the Params parameter of the Execute method. The result set produced by this call to Execute is made available through the variable Cursor, which is a handle to a BDE cursor. This handle is assigned to the Handle property of a TTable to make the result set accessible through standard data controls, such as a TDBGrid.

procedure TDataForm.SELECT_WithParamBtnClick(Sender: TObject);

var

  SQLstmt: String;

  stmtParams: TParams;

  Cursor: hDBICur;

begin

  { create the TParams object }

  stmtParams := TParams.Create;

  try

    { activate the TDatabase component }

    Database1.Connected := True;

    { create the TParam object for StateParam }

    stmtParams.CreateParam(ftString, 'StateParam', ptInput);

    { assign the data value for the StateParam parameter }

    stmtParams[0].AsString := 'CA';

    { assign the SQL statement to the String variable }

    SQLstmt := 'SELECT Company, State '+

      'FROM Customer ' +

      'WHERE (State = :StateParam) ' +

      'ORDER BY State, Company';

    { call the Execute method }

    Database1.Execute(SQLstmt, stmtParams, False, @Cursor);

    { close any cursor previously active in the TTable }

    Table1.Close;

    { assign the BDE cursor handle to the TTable handle }

    TDBDataSet(Table1).Handle := Cursor;

  finally

    { free the dynamically created TParams object }

    stmtParams.Free;

  end;

end;


Create, Assign, SaveToFile example

This example converts a bitmap image to a jpeg file by using the Assign method.

procedure TForm1.Button1Click(Sender: TObject);

var

  jp: TJpegImage;  //Requires the "jpeg" unit added to "uses" clause.

begin

  jp := TJpegImage.Create;

  try

    with jp do

    begin

      Assign(Image1.Picture.Bitmap);

      SaveToFile('c:\oneeye.jpg')

    end;

  finally

    jp.Free;

  end;

end;


EditProperty example

This example shows how to override the EditProperty method to create a component editor that displays a particular event handler when the user double-clicks.

procedure TMyEditor.EditProperty(PropertyEditor: TPropertyEditor; Continue, FreeEditor: Boolean)

begin

  if (PropertyEditor.ClassName = 'TMethodProperty') and

    (PropertyEditor.GetName = 'OnSpecialEvent') then

    inherited EditProperty(PropertyEditor, Continue, FreeEditor);

end;


OnColumnClick, AlphaSort, OnCompare, CompareText example

This example shows how to use the OnColumnClick and OnCompare events of a list view to let users sort the columns in a report-style list view by clicking on the column headers. This requires a global variable to keep track of the column that was clicked:

var ColumnToSort: Integer;

The OnColumnClick event handler sets the global variable to indicate the column to sort and calls AlphaSort:

procedure TForm1.ListView1ColumnClick(Sender: TObject; Column: TListColumn);

begin

  ColumnToSort := Column.Index;

  (Sender as TCustomListView).AlphaSort;

end;

The OnCompare event handler causes the list view to sort on the selected column:

procedure TForm1.ListView1Compare(Sender: TObject; Item1, Item2: TListItem; Data: Integer; var Compare: Integer);

var

  ix: Integer;

begin

  if ColumnToSort = 0 then

    Compare := CompareText(Item1.Caption,Item2.Caption)

  else begin

   ix := ColumnToSort - 1;

   Compare := CompareText(Item1.SubItems[ix],Item2.SubItems[ix]);

  end;

end;

Note:	This OnCompare event handler uses the global CompareText function. An application may want to use AnsiCompareText, CompareStr, or AnsiCompareStr instead, depending on whether the comparison should be case-sensitive and whether the locale should be considered.


Socket, Connections, SendText example

This example comes from the Chat demo. It shows how to send the newly inserted line of a memo over the socket connection when the user hits the Enter key.

procedure TChatForm.Memo1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);

begin

  if Key = VK_Return then

    if IsServer then

      ServerSocket.Socket.Connections[0].SendText(Memo1.Lines[Memo1.Lines.Count - 1])

    else

      ClientSocket.Socket.SendText(Memo1.Lines[Memo1.Lines.Count - 1]);

end;


 TSpeedButton

Hierarchy	Properties	Methods	Events	See also

TSpeedButton is a button that is used to execute commands or set modes.

Unit

buttons

Description

Use TSpeedButton to add a button to a group of buttons in a form. TSpeedButton introduces properties that can be used to set graphical images that represent the different button states (selected, unselected, disabled and so on). Use other properties to specify multiple images or to rearrange the images and text on the button. TSpeedButton also introduces properties that allow speed buttons to work together as a group. Speed buttons are commonly grouped in panels to create specialized tool bars and tool palettes.

Note:	To create a speed button with a client-aligned glyph that covers the button's edges, add a 1-pixel margin around the button's top and left edges and a 3-pixel margin around its bottom and right edges. Do this by manually editing the bitmap specified by the Glyph property.


TSpeedButton properties

TSpeedButton	Alphabetically	Legend

In TSpeedButton

AllowAllUp

Down

Flat

Glyph

GroupIndex

Layout

Margin

MouseInControl

NumGlyphs

Spacing

Transparent

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TSpeedButton properties

TSpeedButton	By object	Legend

Action

Align

AllowAllUp

Anchors

BiDiMode

BoundsRect

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlState

ControlStyle

Cursor

DesignInfo

DockOrientation

Down

Enabled

Flat

Floating

FloatingDockSiteClass

Font

Glyph

GroupIndex

Height

Hint

HostDockSite

bmc publishd.bmp}	Layout

Left

LRDockWidth

Margin

MouseInControl

Name

NumGlyphs

Owner

Parent

ParentBiDiMode

ParentFont

ParentShowHint

PopupMenu

ShowHint

Spacing

Tag

TBDockHeight

Top

Transparent

UndockHeight

UndockWidth

VCLComObject

Visible

Width

WindowProc


TSpeedButton.AllowAllUp

TSpeedButton	See also

Specifies whether all speed buttons in the group that contains this speed button can be unselected at the same time.

property AllowAllUp: Boolean;

Description

Use AllowAllUp with a group of buttons that belong to the same group. Speed buttons belong to the same group if they have the same value on their GroupIndex property. Buttons in the same group behave in a mutually exclusive fashion: when one button in the group is selected (down), all other buttons in the group become unselected (up).

If AllowAllUp is True, all of the speed buttons in a group can be unselected at the same time. Clicking the single selected button in the group will deselect that button without selecting another. If AllowAllUp is False, exactly one of the buttons in the group must be selected at any time. Clicking a down button won't return the button to its up state.

Changing the value of the AllowAllUp property for one speed button in a group changes the AllowAllUp value for all buttons in the group.

Note:	If GroupIndex is zero, AllowAllUp has no effect.


TSpeedButton.Down

TSpeedButton	See also

Specifies whether the button is selected (down) or unselected (up).

property Down: Boolean;

Description

Read Down to determine whether a speed button is selected. The Down property only applies if the GroupIndex property of the button is nonzero.

When GroupIndex is greater than 0, set Down to True to select a button. When the user clicks on a button in the unselected (up) state, the button is selected and Down is set to True. When the user clicks on a button in the selected (down) state, if AllowAllUp is True, the button becomes unselected and Down is set to False.

At design time, specify which button in a group is the initially selected button by setting the Down property of the selected button to True.

Note:	When GroupIndex is 0, buttons do not remain in the selected state when clicked.


TSpeedButton.Flat

TSpeedButton	See also

Determines whether the button has a 3D border that provides a raised or lowered look.

property Flat: Boolean;

Description

Set Flat to True to remove the raised border when the button is unselected and the lowered border when the button is clicked or selected. When Flat is True, use separate bitmaps for the different button states to provide visual feedback to the user about the button state.


TSpeedButton.Glyph

TSpeedButton	See also 	Example

Specifies the bitmap that appears on the speed button.

property Glyph: TBitmap;

Description

Set Glyph to a bitmap object that contains the image that should appear on the face of the button. Bring up the Open dialog box from the Object Inspector to choose a bitmap file (with a .BMP extension), or specify a bitmap file at runtime.

Glyph can provide up to four images within a single bitmap. All images must be the same size and next to each other in a horizontal row. TSpeedButton displays one of these images depending on the state of the button.

Image position	Button state	Description

First	Up	This image appears when the button is unselected. If no other images exist in the bitmap, this image is used for all states.

Second	Disabled	This image usually appears dimmed to indicate that the button can't be selected.

Third	Clicked	This image appears when the button is clicked. If GroupIndex is 0, the Up image reappears when the user releases the mouse button.

Fourth	Down	This image appears when the button stays down indicating that it remains selected.

If only one image is present, TSpeedButton attempts to represent the other states by altering the image slightly for each state, although the Down state is always the same as the Up state.

If the bitmap contains multiple images, specify the number of images in the bitmap with the NumGlyphs property.

Note:	The lower left pixel of the bitmap is reserved for the “transparent” color. Any pixel in the bitmap that matches the lower left pixel will be transparent.


TSpeedButton.GroupIndex

TSpeedButton	See also

Allows speed buttons to work together as a group.

property GroupIndex: Integer;

Description

Set GroupIndex to determine how the button behaves when clicked.

When GroupIndex is 0, the button behaves independently of all other buttons on the form. When the user clicks such a speed button, the button appears pressed (in its clicked state) and then returns to its normal up state when the user releases the mouse button.

When GroupIndex is greater than 0, the button remains selected (in its down state) when clicked by the user. When the user clicks a selected button, it returns to the up state, unless AllowAllUp is False. Setting the GroupIndex property of a single speed button to a value greater than 0 causes the button to behave as a two-state button when AllowAllUp is True.

Speed buttons with the same GroupIndex property value (other than 0), work together as a group. When the user clicks one of these buttons, it remains selected until the user clicks another speed button belonging to the same group. Speed buttons used in this way can present mutually exclusive choices to the user.


TSpeedButton.Layout

TSpeedButton	See also

Determines where the image or text appears on the speed button.

property Layout: TButtonLayout;

Description

Set Layout to determine the position of the bitmap specified by the Glyph property or the text specified by the Caption property. These are the possible values:

Value	Meaning

blGlyphLeft	The image or caption appears near the left side of the button.

blGlyphRight	The image or caption appears near the right side of the button.

blGlyphTop	The image or caption appears near the top of the button.

blGlyphBottom	The image or caption appears near the bottom of the button.


TSpeedButton.Margin

TSpeedButton	See also

Specifies the number of pixels between the edge of the button and the image or caption drawn on its surface.

property Margin: Integer;

Description

Use Margin to specify the indentation of the image specified by the Glyph property or the text specified by the Caption property. The edges that Margin separates depends on the Layout property. If Layout is blGlyphLeft, the margin appears between the left edge of the image or caption and the left edge of the button. If Layout is blGlyphRight, the margin separates the right edges. If Layout is blGlyphTop, the margin separates the top edges, and if Layout is blGlyphBottom, the margin separates the bottom edges.

If Margin is –1, the image or text is centered on the button.


TSpeedButton.MouseInControl

TSpeedButton	See also

Specifies whether the mouse pointer is over the speed button.

property MouseInControl: Boolean;

Description

Use MouseInControl to determine whether the mouse pointer is over the speed button.


TSpeedButton.NumGlyphs

TSpeedButton	See also 	Example

Specifies the number of images specified in the Glyph property.

type TNumGlyphs = 1..4;

property NumGlyphs:

Description

Set NumGlyphs to the number of images provided by the bitmap assigned to the Glyph property. All images must be the same size and next to each other in a row. The Glyph property can provide up to four images.


TSpeedButton.Spacing

TSpeedButton	See also

Determines where the image and text appear on a speed button.

property Spacing: Integer;

Description

Set Spacing to the number of pixels that should appear between the image specified in the Glyph property and the text specified in the Caption property.

If Spacing is a positive number, its value is the number of pixels between the image and text. If Spacing is 0, the image and text appear flush with each other. If Spacing is -1, the text appears centered between the image and the button edge.


TSpeedButton.Transparent

TSpeedButton	See also

Specifies whether the background of the button is transparent.

property Transparent: Boolean;

Description

Use Transparent to specify whether the background of the button is transparent.


TSpeedButton events

TSpeedButton	Alphabetically	Legend

Derived from TControl

OnClick

OnDblClick

OnMouseDown

OnMouseMove

OnMouseUp


TSpeedButton events

TSpeedButton	By object	Legend

OnDblClick

OnMouseDown

OnMouseMove

OnMouseUp

OnClick


TSpeedButton methods

TSpeedButton	Alphabetically

In TSpeedButton

ActionChange

Click

Create

Destroy

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DefaultHandler

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

Invalidate

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

Repaint

ReplaceDockedControl

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetParentComponent

GetNamePath

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSpeedButton methods

TSpeedButton	By object

ActionChange

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Click

ClientToScreen

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

NewInstance

Perform

Refresh

RemoveComponent

Repaint

ReplaceDockedControl

SafeCallException

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

UpdateAction

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TSpeedButton.ActionChange

TSpeedButton	See also

Updates the speedbutton control to reflect changes in its associated action.

procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;

Description

ActionChange is called automatically when the associated action changes. It updates the speed button control image to reflect its associated action’s current image. If the action’s image index references a valid image in its containing action list’s associated image list, then ActionChange copies the image into the speed button’s glyph. Then it calls the inherited method which checks the associated properties for that client type.

The Sender parameter is the associated action. The CheckDefaults parameter specifies whether properties and event handlers should be changed if they differ from the default values. When CheckDefaults is True, properties and event handlers are only changed when the current values are the default values (that is, when the values have not been previously changed). When CheckDefaults is False, properties and event handlers are changed, regardless of their current values.


TSpeedButton.Click

TSpeedButton	See also

Generates an OnClick event.

procedure Click; override;

Description

Call Click to generate an OnClick event. If the speed button has an OnClick event handler, Click allows an application to simulate a click on the button.


TSpeedButton.Create

TSpeedButton	See also

Creates and initializes an instance of TSpeedButton.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create a speed button at runtime. Speed buttons placed on forms at design time are created automatically. After calling the inherited constructor, Create initializes the following values:

ControlStyle is set to [csCaptureMouse, csOpaque, csDoubleClicks].

Height and Width are both set to 25.

Layout is set to blGlyphLeft.

Margin is set to -1, and Spacing to 4.

ParentFont is set to True.


TSpeedButton.Destroy

TSpeedButton	See also

Destroys an instance of TSpeedButton.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the speed button is not nil, and only then calls Destroy.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl


 TSplitter

Hierarchy	Properties	Methods	Events	See also	Example

TSplitter divides the client area of a form into resizable panes.

Unit

extctrls

Description

Add a splitter to a form between two aligned controls to allow users to resize the controls at runtime. The splitter sits between a control aligned to one edge of the form and the controls that fill up the rest of the client area. Give the splitter the same alignment as the control that is anchored to the edge of the form. When the user moves the splitter, it resizes the anchored control. This, in turn, changes the client area of the form, and the controls that fill up the rest of the client area resize accordingly.

Use each control on the form as a separate pane. After each pane is placed, place a splitter with the same alignment to allow that pane to be resized. The last pane to be placed on the form should be client-aligned, so that it resizes automatically to fill up the remaining space after all other panes are resized.


TSplitter properties

TSplitter	Alphabetically	Legend

In TSplitter

AutoSnap

Beveled

MinSize

ResizeStyle

Derived from TGraphicControl

Canvas

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TSplitter properties

TSplitter	By object	Legend

Action

Align

Anchors

AutoSnap

Beveled

BiDiMode

BoundsRect

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlState

ControlStyle

Cursor

DesignInfo

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

MinSize

Name

Owner

Parent

ParentColor

ResizeStyle

ShowHint

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

Width

WindowProc


TSplitter.AutoSnap

TSplitter	See also

Determines whether neighboring objects are resized to zero when the splitter is used to make them smaller than MinSize.

property AutoSnap: Boolean;

Description

Set AutoSnap to False to prevent the splitter from resizing neighboring objects to zero when the user tries to make them smaller than MinSize. When AutoSnap is False, such resize attempts are simply blocked, leaving the neighboring object with a size of MinSize.


TSplitter.Beveled

TSplitter	See also

Determines whether the splitter looks beveled along the edge that moves.

property Beveled: Boolean;

Description

Set Beveled to False to remove the beveled edges from the splitter. Set Beveled to True to give the edge a 3D beveled look.

The bevel on a splitter runs in a single direction only: along the edges the user moves to resize neighboring objects. Thus, if the Align property is alLeft or alRight, the vertical edges of the splitter are beveled. If the Align property is alTop or alBottom, the horizontal edges of the splitter are beveled.


TSplitter.MinSize

TSplitter	See also 	Example

Specifies the minimum size, in pixels, of the panes on either side of the splitter.

type NaturalNumber = 1..High(Integer);

property MinSize: NaturalNumber;

Description

Set MinSize to provide a minimum size the splitter must leave when resizing its neighboring control.  For example, if the Align property is alLeft or alRight, the splitter can’t resize the regions to its left or right any smaller than MinSize pixels. If the Align property is alTop or alBottom, the splitter can’t resize the regions above or below it any smaller than MinSize pixels.

Note:	Always set MinSize to a value less than half the client width of its parent.  When MinSize is half the client width of the splitter’s parent, the splitter can’t move because to do so would be to resize one of the panes less than MinSize pixels.


TSplitter.ResizeStyle

TSplitter	See also 	Example

Specifies the effect of moving the splitter.

type TResizeStyle = (rsNone, rsLine, rsUpdate, rsPattern);

property ResizeStyle: TResizeStyle;

Description

Use ResizeStyle to determine what happens when the user moves the splitter with the mouse. ResizeStyle can have one of the values in the following table:

Value	Meaning

rsNone	Moving the splitter with the mouse has no effect.

rsLine	A line is drawn indicating the new position of the splitter that would result if the user released the mouse at the current position. The splitter does not actually move and no controls are resized.

rsUpdate	The control against which the splitter is aligned is resized based on the current mouse position, and the splitter is moved to that position.

rsPattern	A pattern is drawn indicating the new position of the splitter that would result if the user released the mouse at the current position. The splitter does not actually move and no controls are resized.


TSplitter events

TSplitter	Alphabetically	Legend

In TSplitter

OnCanResize

OnMoved

OnPaint


TSplitter events

TSplitter	By object	Legend

OnCanResize

OnMoved

OnPaint


TSplitter.OnCanResize

TSplitter	See also

Occurs when the user tries to move the splitter with the mouse.

type TCanResizeEvent = procedure(Sender: TObject; var NewSize: Integer; var Accept: Boolean) of object;

property OnCanResize: TCanResizeEvent;

Description

Write an OnCanResize event handler to conditionally prevent the user from resizing neighboring components using the splitter.

The NewSize parameter indicates the size the associated control will have if the splitter is allowed to perform the resize.  This value can be changed if the attempted resize can be partially allowed.  The Accept parameter indicates whether the resize should be permitted at all.  Set Accept to False to disallow any movement of the splitter.


TSplitter.OnMoved

TSplitter	See also 	Example

Occurs after the user has retiled the form using the splitter.

property OnMoved: TNotifyEvent;

Description

Write an OnMoved event handler to take specific action when the user finishes dragging the edge of the neighboring control using the splitter. For example, after resizing a control on the edge of the form, use an OnMoved event handler to update the layout of the new client area of the form. Use the ClientRect property of the form to determine the new size remaining.


TSplitter.OnPaint

TSplitter	See also

Occurs when the splitter needs to draw itself.

property OnPaint: TNotifyEvent;

Description

Write an OnPaint event handler to customize the appearance of the splitter. For example, use an OnPaint event handler to give a splitter the appearance of the splitters that appear in cool bar objects. Use the Canvas property as a drawing surface for painting the splitter. Use the ClientRect property to determine the coordinates of the canvas on which to paint the splitter.

When a splitter object receives a WM_PAINT message, it paints its background before generating the OnPaint event. If the Beveled property is True, the beveled appearance will also be added before the OnPaint event.  Most applications set Beveled to False when using the OnPaint event to customize the appearance of the splitter.


TSplitter methods

TSplitter	Alphabetically	Legend

In TSplitter

CanResize

Create

Destroy

DoCanResize

MouseDown

MouseMove

MouseUp

Paint

RequestAlign

StopSizing

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

Invalidate

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

Repaint

ReplaceDockedControl

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSplitter methods

TSplitter	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

CanResize

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DoCanResize

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseDown

MouseMove

MouseUp

NewInstance

Paint

Perform

Refresh

RemoveComponent

Repaint

ReplaceDockedControl

RequestAlign

SafeCallException

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

StopSizing

Update

UpdateAction

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TSplitter.CanResize

TSplitter	See also

Determines how the splitter responds to mouse moves.

function CanResize(var NewSize: Integer): Boolean; reintroduce; virtual;

Description

CanResize is called by the DoCanResize method to generate an OnCanResize event. The NewSize parameter indicates the size the associated control will have if the splitter is allowed to perform the resize. CanResize returns a Boolean that indicates whether the value specified by NewSize should be applied by redrawing the line (when ResizeStyle is rsLine) or resizing the associated control (when ResizeStyle is rsUpdate);

Unless an OnCanResize event handler sets the value of NewSize and the return value, CanResize returns True without changing the NewSize parameter.

Note:	CanResize is not called if the value of ResizeStyle is rsNone when the user presses the mouse button.


TSplitter.Create

TSplitter	See also	Example

Creates an instance of TSplitter.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a splitter at runtime. TSplitter objects placed on forms at design time are created automatically.

Create allocates memory for the TSplitter object and initializes

Beveled to True.

MinSize to 30.

Align to alLeft.

Width to 3.

Cursor to crHSplit.


TSplitter.Destroy

TSplitter	See also

Frees the memory associated with the splitter.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead,call Free, which checks that the splitter is not nil before calling Destroy.


TSplitter.MouseDown

TSplitter	See also

Dynamically locates the control that can be resized by the splitter.

procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;

Description

After calling the parent class’s method, MouseDown locates the control that it is about to resize. Because this control is located dynamically, an application can delete or add aligned controls beside a splitter at runtime and the splitter will resize whichever control is currently beside it.


TSplitter.DoCanResize

TSplitter

Generates an OnCanResize event and enforces the MinSize property.

function DoCanResize(var NewSize: Integer): Boolean; virtual;

Description

DoCanResize is called automatically when the user moves the mouse after pressing the mouse button on the splitter. The NewSize parameter indicates the size the associated control will have if the splitter is allowed to perform the resize. DoCanResize returns a Boolean that indicates whether the value specified by NewSize should be applied by redrawing the line (when ResizeStyle is rsLine) or resizing the associated control (when ResizeStyle is rsUpdate);

DoCanResize calls CanResize to generate an OnCanResize event. If, after calling the event handler, NewSize is less than the value of MinSize, NewSize is changed to zero.

Note:	DoCanResize is not called if the value of ResizeStyle is rsNone when the user presses the mouse button.


TSplitter.MouseMove

TSplitter	See also

Provides visual feedback of how the neighboring control would be resized.

procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;

Description

After calling the inherited method, MouseMove computes the new boundaries of the neighboring control and draws a line where the new edge would be. The control is not actually resized until the mouse is released.


TSplitter.MouseUp

TSplitter	See also

Resizes the neighboring control when the user releases the mouse.

procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;

Description

After calling the inherited method, MouseUp resizes the neighboring control that was located when the mouse went down. After the control is resized, MouseUp generates an OnMoved event.


TSplitter.Paint

TSplitter 	See also

Draws the image of the splitter in response to paint messages.

procedure Paint; override;

Description

When the splitter receives WM_PAINT messages from its Parent, the splitter calls the Paint method. Paint draws the background color of the splitter, and if Beveled is True, draws a bevel along the moveable edges. After drawing the background and bevel, Paint generates an OnPaint event.


TSplitter.RequestAlign

TSplitter 	See also

Changes the cursor when the alignment of the splitter changes.

procedure RequestAlign; override;

Description

RequestAlign changes the cursor from crHSplit to crVSplit when the Align property changes to alBottom or alTop.  It changes the cursor from crVSplit to crHSplit when the Align property changes to any other value.

If the Cursor property is not crHSplit or crVSplit, RequestAlign has no effect.

Override RequestAlign to suppress the automatic cursor change or to implement a different association between alignment and the splitter’s cursor.


TSplitter.StopSizing

TSplitter	See also

Cleans up after the splitter has resized its neighboring control.

procedure StopSizing; dynamic;

Description

This protected procedure is called when the user releases the mouse or hits the Escape key while using the splitter to resize a control. StopSizing makes sure that the resize line is no longer visible and generates an OnMoved event.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl


TSQLUpdateObject

Hierarchy	Properties	Methods	See also

TSQLUpdateObject is the base class for classes that use an SQL command to apply cached updates on behalf of queries or stored procedures that can’t post updates directly.

Unit

dbtables

Description

Use TSQLUpdateObject as a base class when creating customized update objects that can update BDE datasets.  TSQLUpdateObject adds support for accessing a SQL statement that applies an update to the properties and methods introduced by TDataSetUpdateObject.

Do not create instances of TSQLUpdateObject. Most of this class’s methods are abstract, so that trying to use an instance of TSQLUpdateObject merely generates an EAbstractError exception. To add a component that applies updates on behalf of a query or stored procedure, use a descendant such as TUpdateSQL instead.


TSQLUpdateObject properties

TSQLUpdateObject	Alphabetically	Legend

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TSQLUpdateObject properties

TSQLUpdateObject	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TSQLUpdateObject methods

TSQLUpdateObject	Alphabetically

In TSQLUpdateObject

GetSQL

Derived from TComponent

Create

Destroy

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSQLUpdateObject methods

TSQLUpdateObject	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetSQL

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TSQLUpdateObject.GetSQL

TSQLUpdateObject	See also

Returns the SQL statement that performs a specified update operation.

function GetSQL(UpdateKind: TUpdateKind): TStrings; virtual; abstract;

Description

Override GetSQL to allow the update object to access an SQL statement that applies an update of the type specified by UpdateKind. TSQLUpdateObject introduces this method as an abstract method, which is used internally to obtain an SQL command for applying updates.

GetSQL provides the underlying implementation for the SQL property in the descendant class TUpdateSQL.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TDataSetUpdateObject


TStack

Hierarchy	Methods	See also

TStack maintains a last-in first-out array of pointers.

Unit

contnrs

Description

Use a TStack object to store and maintain a last-in first-out list.


TStack methods

TStack	Alphabetically

In TStack

Peek

Pop

Push

Derived from TOrderedList

AtLeast

Count

Create

Destroy

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TStack methods

TStack	By object

AfterConstruction

AtLeast

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Count

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Peek

Pop

Push

SafeCallException


TStack.Peek

TStack	See also

Returns a pointer to the top of the stack.

function Peek: Pointer;

Description

Call Peek to access the stack without removing an item. Peek returns a pointer to the next item in the stack (that is, the last item added).

To remove an item from the stack, call Pop.


TStack.Pop

TStack	See also

Removes and returns the item at the top of the stack.

function Pop: Pointer;

Description

Call Pop to retrieve an item from the stack. Pop removes the next item from the stack (that is, the last item added), then returns a pointer to the deleted item.

To access the stack without removing an item, call Peek.


TStack.Push

TStack	See also

Adds an item to the top of the stack.

procedure Push(AItem: Pointer);

Description

Call Push to add an item to the stack.

To retrieve the last item added with Push, call Pop or Peek.


Hierarchy

TObject

TOrderedList


 TStaticText

Hierarchy	Properties	Methods	Events	See also

TStaticText is a windowed control that displays text on a form.

Unit

stdctrls

Description

The TStaticText component functions like TLabel, except that it descends from TWinControl and therefore has a window handle. Use TStaticText instead of TLabel when the component’s accelerator key must belong to a windowed control—for example, on an ActiveX property page.


TStaticText properties

TStaticText	Alphabetically	Legend

Derived from TCustomStaticText

Alignment

AutoSize

BorderStyle

FocusControl

ShowAccelChar

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

Caption

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TStaticText properties

TStaticText	By object	Legend

Action

Align

Alignment

Anchors

AutoSize

BiDiMode

BorderStyle

BoundsRect

Brush

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

FocusControl

Font

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ShowAccelChar

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TStaticText events

TStaticText	Alphabetically	Legend

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TStaticText events

TStaticText	By object	Legend

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TStaticText methods

TStaticText	Alphabetically

Derived from TCustomStaticText

Create

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStaticText methods

TStaticText	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomStaticText


 TStoredProc

Hierarchy	Properties	Methods	Events	See also

TStoredProc encapsulates a stored procedure on a database server.

Unit

dbtables

Description

Use a TStoredProc object when a client application must use a stored procedure on a database server. A stored procedure is a grouped set of statements, stored as part of a database server’s metadata (just like tables, indexes, and domains), that performs a frequently-repeated, database-related task on the server and passes results to the client.

Note:	Not all database servers support stored procedures. See a specific server’s documentation to determine if it supports stored procedures.

Many stored procedures require a series of input arguments, or parameters, that are used during processing. TStoredProc provides a Params property that enables an application to set these parameters before executing the stored procedure.

TStoredProc reuses the Params property to hold the results returned by a stored procedure. Params is an array of values. Depending on server implementation, a stored procedure can return either a single set of values, or a result set similar to the result set returned by a query.


TStoredProc properties

TStoredProc	Alphabetically	Legend

In TStoredProc

Overload

ParamBindMode

ParamCount

Params

Prepared

StmtHandle

StoredProcName

Derived from TDBDataSet

AutoRefresh

Database

DatabaseName

DBHandle

DBLocale

DBSession

Handle

SessionName

Derived from TBDEDataSet

BlockReadSize

CacheBlobs

CachedUpdates

CanModify

ExpIndex

Filter

Filtered

FilterOptions

KeySize

Locale

RecNo

RecordCount

RecordSize

UpdateObject

UpdateRecordTypes

UpdatesPending

Derived from TDataSet

Active

AggFields

AutoCalcFields

Bof

Bookmark

DataSetField

DataSource

DefaultFields

Designer

Eof

FieldCount

FieldDefList

FieldDefs

FieldList

Fields

FieldValues

Found

Modified

Name

ObjectView

SparseArrays

State

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TStoredProc properties

TStoredProc	By object	Legend

Active

AggFields

AutoCalcFields

AutoRefresh

BlockReadSize

Bof

Bookmark

CacheBlobs

CachedUpdates

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Database

DatabaseName

DataSetField

DataSource

DBHandle

DBLocale

DBSession

DefaultFields

Designer

DesignInfo

Eof

ExpIndex

FieldCount

FieldDefList

FieldDefs

FieldList

Fields

FieldValues

Filter

Filtered

FilterOptions

Found

Handle

KeySize

Locale

Modified

Name

ObjectView

Overload

Owner

ParamBindMode

ParamCount

Params

Prepared

RecNo

RecordCount

RecordSize

SessionName

SparseArrays

State

StmtHandle

StoredProcName

Tag

UpdateObject

UpdateRecordTypes

UpdatesPending

VCLComObject


TStoredProc.Overload

TStoredProc	See also

Specifies which Oracle overloaded stored procedure to execute.

property Overload: Word;

Description

Use Overload to specify which overloaded stored procedure to execute on an Oracle server. An Oracle overloaded stored procedure is one that shares a name with one or more other stored procedures. Oracle distinguishes among overloaded stored procedures by assigning each procedure a unique numeric identifier. An application can specify this identifier using the Overload property.

By default, Overload is zero, which assumes there is no procedure overloading. For all servers except Oracle, do not change this value. If an application attempts to access an Oracle overloaded procedure without setting Overload, the Borland Database Engine (BDE) accesses the lowest numbered, or first, overloaded procedure on the server.

If Overload is 1, the BDE executes the first overloaded procedure on the server. If Overload is 2, it executes the second, and so on.

Note:	While Oracle overloaded procedures share names, their parameter lists are unique. An application must ensure that it passes the correct parameter list to an overloaded procedure.


TStoredProc.ParamBindMode

TStoredProc	See also

Determines the order in which a component’s parameters are assigned to the parameter list for the stored procedure on the server.

type TParamBindMode = (pbByName, pbByNumber);

property ParamBindMode: TParamBindMode;

Description

Examine or set ParamBindMode to determine the order in which parameters in the Params property are matched to the parameters used by the stored procedure on the server. ParamBindMode can be one of the following:

Value	Ordering

pbByName	Parameters specified in the Params property are matched to identically named parameters on the server. This is the default.

pbByNumber	Parameters in Params are assigned one-by-one to the next available parameter on the server (for example, the first parameter in Params is assigned to the first parameter used by the stored procedure, and so on).

Whenever possible, ParamBindMode should be pbByName. This guarantees that parameters are matched to the correct parameters used by the stored procedure regardless of physical ordering in Params. At design time, the names of known parameters appear in the Parameters editor.

In some cases stored procedures on the server (for example, Informix) do not provide the Borland Database Engine (BDE) with parameter names. If parameter names as they exist on the server side are not known at design or runtime, it may be necessary to set ParamBindMode to pbByNumber. In this case, however, it is necessary to know the correct data type for each parameter in sequence. Otherwise an exception may be raised on execution.


TStoredProc.ParamCount

TStoredProc	See also	Example

Indicates the number of parameters for the stored procedure component.

property ParamCount: Word;

Description

Examine ParamCount to determine the number of parameters currently stored in the Params property.


TStoredProc.Params

TStoredProc	See also	Example

Stores the input and output parameters for a stored procedure.

property Params: TParams;

Description

Access Params at runtime to set input parameter names, values, and data types dynamically (at design time use the Parameters editor to set parameter information). Params is an array of parameter values.

An application can also access Params after executing a stored procedure to retrieve the output parameters returned to the procedure by the server.


TStoredProc.Prepared

TStoredProc	See also

Determines whether or not a stored procedure is prepared for execution.

property Prepared: Boolean;

Description

Examine Prepared to determine if a stored procedure is already prepared for execution. If Prepared is True, the stored procedure is prepared, and if Prepared is False, the procedure is not prepared. A stored procedure must be prepared before it can be executed.

Note:	Delphi automatically prepares a stored procedure if it is unprepared when the application calls ExecProc. After execution, Delphi automatically unprepares the stored procedure. If a procedure will be executed a number of times, it is more efficient for the application to prepare the stored procedure once, and unprepare it when it is no longer needed.

An application can change the current setting of Prepared to prepare or unprepare a stored procedure. If Prepared is True, setting it to False calls the Unprepare method to unprepare the stored procedure. If Prepared is False, setting it to True calls the Prepare method to prepare the procedure. Generally, however, it is better programming practice to call Prepare and Unprepare directly. These methods automatically update the Prepared property.


TStoredProc.StmtHandle

TStoredProc

Identifies the Borland Database Engine (BDE) statement handle for the stored procedure.

property StmtHandle: HDBIStmt;

Description

Retrieve StmtHandle if an application makes a direct call to the BDE, bypassing the methods of TStoredProc. Some BDE API calls require a statement handle as a parameter. Under all other circumstances an application does not need to access this property.


TStoredProc.StoredProcName

TStoredProc	See also

Identifies the name of the stored procedure on the server for which this object is an encapsulation.

property StoredProcName: String;

Description

Set StoredProcName to specify the name of the stored procedure to call on the server. If StoredProcName does not match the name of an existing stored procedure on the server, then when the application attempts to prepare the procedure prior to execution, an exception is raised.


TStoredProc events

TStoredProc	Alphabetically	Legend

Derived from TBDEDataSet

OnUpdateError

OnUpdateRecord

Derived from TDataSet

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TStoredProc events

TStoredProc	By object	Legend

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnUpdateError

OnUpdateRecord


TStoredProc methods

TStoredProc	Alphabetically

In TStoredProc

CopyParams

Create

DescriptionsAvailable

Destroy

ExecProc

GetResults

ParamByName

Prepare

UnPrepare

Derived from TDBDataSet

CheckOpen

CloseDatabase

OpenDatabase

Derived from TBDEDataSet

ApplyUpdates

BookmarkValid

Cancel

CancelUpdates

CommitUpdates

CompareBookmarks

ConstraintCallBack

ConstraintsDisabled

CreateBlobStream

DisableConstraints

EnableConstraints

FetchAll

FlushBuffers

GetBlobFieldData

GetCurrentRecord

GetFieldData

GetIndexInfo

IsSequenced

Locate

Lookup

Post

RevertRecord

Translate

UpdateStatus

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

CheckBrowseMode

ClearFields

Close

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetDetailDataSets

GetDetailLinkFields

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsEmpty

IsLinkedTo

Last

MoveBy

Next

Open

Prior

Refresh

Resync

SetFields

UpdateCursorPos

UpdateRecord

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStoredProc methods

TStoredProc	By object

ActiveBuffer

AfterConstruction

Append

AppendRecord

ApplyUpdates

Assign

BeforeDestruction

BookmarkValid

Cancel

CancelUpdates

CheckBrowseMode

CheckOpen

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClearFields

Close

CloseDatabase

CommitUpdates

CompareBookmarks

ConstraintCallBack

ConstraintsDisabled

ControlsDisabled

CopyParams

Create

CreateBlobStream

CursorPosChanged

DefaultHandler

Delete

DescriptionsAvailable

Destroy

DestroyComponents

Destroying

DisableConstraints

DisableControls

Dispatch

Edit

EnableConstraints

EnableControls

ExecProc

ExecuteAction

FetchAll

FieldAddress

FieldByName

FindComponent

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FlushBuffers

Free

FreeBookmark

FreeInstance

FreeNotification

FreeOnRelease

GetBlobFieldData

GetBookmark

GetCurrentRecord

GetDetailDataSets

GetDetailLinkFields

GetFieldData

GetFieldList

GetFieldNames

GetIndexInfo

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetResults

GotoBookmark

HasParent

InheritsFrom

InitInstance

Insert

InsertComponent

InsertRecord

InstanceSize

IsEmpty

IsLinkedTo

IsSequenced

Last

Locate

Lookup

MethodAddress

MethodName

MoveBy

NewInstance

Next

Open

OpenDatabase

ParamByName

Post

Prepare

Prior

Refresh

RemoveComponent

Resync

RevertRecord

SafeCallException

SetFields

Translate

UnPrepare

UpdateAction

UpdateCursorPos

UpdateRecord

UpdateStatus


TStoredProc.CopyParams

TStoredProc	See also

Copies a stored procedure’s parameters into another parameter list.

procedure CopyParams(Value: TParams);

Description

Call CopyParams to copy this stored procedure’s parameters into a separate parameter list object. Value is the parameter list into which to assign this stored procedure’s parameters. Value can be the parameter list of another stored procedure. For example:

TStoredProc1.CopyParams(TStoredProc2.Params);

If the stored procedure is not prepared when an application calls CopyParams, CopyParams calls Prepare before assigning the parameters to the target parameters list, and then calls UnPrepare to return the stored procedure to its previous state.


TStoredProc.Create

TStoredProc	See also

Creates an instance of a stored procedure component.

constructor Create(AOwner: TComponent);

Description

Call Create to instantiate a stored procedure declared in an application. Create calls its inherited Create constructor, creates an empty parameter list for the newly instantiated stored procedure, and initializes its parameter, server, and record buffers to nil.


TStoredProc.DescriptionsAvailable

TStoredProc	See also

Determines if parameter information is available from the stored procedure on the server.

function DescriptionsAvailable: Boolean;

Description

Call DescriptionsAvailable to determine if a stored procedure on a server can return parameter information to the application. If DescriptionsAvailable returns True, parameter information is available from the server. If DescriptionsAvailable returns False, parameter information is not available.

Note:	If DescriptionsAvailable returns False, the application must still provide correct parameter information to the stored procedure on the server. It is up to the application developer to know the necessary parameters at design time.


TStoredProc.Destroy

TStoredProc	See also

Destroys the instance of a stored procedure.

destructor Destroy;

Description

Do not call Destroy directly. Instead, call Free, which verifies that the stored procedure is not nil before calling Destroy.

Destroy disconnects from the server, frees the parameter list, and calls its inherited Destroy destructor.


TStoredProc.ExecProc

TStoredProc	See also	Example

Executes the stored procedure on the server.

procedure ExecProc;

Description

Call ExecProc to execute a stored procedure on the server. Before calling ExecProc:

1	Provide any input parameters in the Params property. At design time, a developer can provide parameters using the Parameters editor. At runtime an application must access Params directly.

2	Call Prepare to bind the parameters.

If a stored procedure returns output parameters, they are stored in the Params property when ExecProc returns control to the application. An application can access the output parameters by indexing into the Params list, or by using the ParamByName method.

Tip:	If an application is only interested in the result set returned by a stored procedure, call StoredProc.Open or set its Active property to True.


TStoredProc.GetResults

TStoredProc	See also	Example

Returns the output parameter values from a Sybase or MSSQL stored procedure.

procedure GetResults;

Description

Call GetResults to force a Sybase or MSSQL stored procedure to return its result set, if any, to the client. For stored procedures on all other servers, result sets are automatically flushed to the client, but Sybase and MSSQL stored procedures do not return a result set until the cursor is positioned at the end of the set. GetResults forces the cursor to the end of the set.

If a stored procedure returns a result set and output parameters in response to GetResults, the output parameters are stored in the Params property. An application can access the output parameters by indexing into the Params list, or by using the ParamByName method.

Tip:	If an application is only interested in the result set returned by a stored procedure, call Open or set the Active property to True.


TStoredProc.Handle

TStoredProc	See also

Specifies the Borland Database Engine (BDE) cursor handle for the stored procedure.

type HDBICur: Longint;

property Handle: HDBICur;

Description

Use Handle only to bypass TStoredProc methods and call directly into the BDE. Many BDE function calls require a cursor handle parameter. Handle is assigned an initial value when a stored procedure is executed. If used with a BDE call that changes the current record position, call Resync immediately after returning from the BDE call.

Note:	Do not use this property unless an application requires BDE functionality not available through built-in components.


TStoredProc.ParamByName

TStoredProc	See also	Example

Accesses parameter information based on a specified parameter name.

function ParamByName(const Value: String): TParam;

Description

Call ParamByName to return parameter information for a specific parameter based on its name. Value is the name of the parameter for which to retrieve information. Typically ParamByName is used to set an input parameter’s value at runtime, or to retrieve the value of an output parameter. The following command line assigns the value "Jane Smith" as the value for the parameter named Contact:

StoredProc1.ParamByName('Contact').AsString := 'Jane Smith';


TStoredProc.Prepare

TStoredProc	See also	Example

Prepares a stored procedure for execution.

procedure Prepare;

Description

Call Prepare to bind a stored procedure’s parameters before calling ExecProc to execute the procedure. Prepare readies a stored procedure’s parameters, initializes the Borland Database Engine (BDE), and informs the server of the stored procedure’s readiness. These steps allocate system resources and optimize the query for server performance.

Note:	If an application attempts to execute a stored procedure that has not been prepared, Delphi automatically prepares the procedure before executing it, and then unprepares it when execution is complete. If a stored procedure will be executed more than once, it is more efficient for an application to call Prepare explicitly once to avoid repeated and unnecessary preparing and unpreparing of the stored procedure, and then call UnPrepare when the stored procedure is no longer needed.


TStoredProc.UnPrepare

TStoredProc	See also

Frees the resources allocated for a previously prepared stored procedure.

procedure UnPrepare;

Description

Call UnPrepare to free the resources allocated for a previously prepared stored procedure on the server and client sides.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataSet

TBDEDataSet

TDBDataSet


TStream

Hierarchy	Properties	Methods	See also

TStream is the base class type for stream objects that can read from or write to various kinds of storage media, such as disk files, dynamic memory, and so on.

Unit

classes

Description

Use specialized stream objects to read from, write to, or copy information stored in a particular medium. Each descendant of TStream implements methods for transferring information to and from a particular storage medium, such as a disk file, dynamic memory, and so on.  In addition to methods for reading, writing, and copying bytes to and from the stream, stream objects permit applications to seek to an arbitrary position in the stream. Properties of TStream provide information about the stream, such as its size and the current position in the stream.

TStream also introduces methods that work in conjunction with components and filers for loading and saving components in simple and inherited forms. These methods are called automatically by global routines that initiate component streaming. They can also be called directly to the initiate the streaming process. Note, however, that component streaming always involves two additional objects:

A component object that is passed as a parameter to the stream’s methods.

A filer object that is automatically created by the stream, and associated with the stream.

As an abstract class, TStream should not be instantiated. Descendant stream objects, such as memory and file streams used for component streaming, are created automatically by the global functions ReadComponentRes and WriteComponentRes. For streaming other kinds of information, choose a descendant class according to the specific data and storage needs. These include

TFileStream (for working with files)

TStringStream (for manipulating in-memory strings)

TMemoryStream (for working with a memory buffer)

TBlobStream (for working with BLOB fields)

TWinSocketStream (for reading and writing over a socket connection)

TOleStream (for using a COM interface to read and write)


TStream properties

TStream	Alphabetically

In TStream

Position

Size


TStream properties

TStream	By object

Position

Size


TStream.Position

TStream	See also	Example

Indicates the current offset into the stream for reading and writing.

property Position: Longint;

Description

Use Position to obtain the current position of the stream. This is the number of bytes from the beginning of the streamed data.


TStream.Size

TStream	See also

Indicates the size in bytes of the stream.

property Size: Longint;

Description

Use Size to find the size of the stream. Size is used internally in routines that read and write to and from the stream. Setting the Size property of TStream does nothing. Some descendants of TStream override this property to allow applications to change the size of the resource accessed using the stream.


TStream methods

TStream	Alphabetically	Legend

In TStream

CopyFrom

FixupResourceHeader

Read

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

Seek

SetSize

Write

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TStream methods

TStream	By object	Legend

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

CopyFrom

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

FixupResourceHeader

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Read

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

SafeCallException

Seek

SetSize

Write

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader


TStream.CopyFrom

TStream 	Example

Copies a specified number of bytes from one stream to another.

function CopyFrom(Source: TStream; Count: Longint): Longint;

Description

Use CopyFrom to copy data to the stream from a different stream. Using CopyFrom eliminates the need for the user to create, read into, write from, and free a buffer when copying data.

CopyFrom copies Count bytes from the stream specified by Source into the stream. It then moves the current position by Count bytes, and returns the number of bytes copied.

If Count is 0, CopyFrom sets Source position to 0 before reading and then copies the entire contents of Source into the stream. If Count is greater than or less than 0, CopyFrom reads from the current position in Source.


TStream.FixupResourceHeader

TStream 	See also

Patches the resource header for a resource that has been written to the stream.

procedure FixupResourceHeader(FixupInfo: Integer);

Description

Do not call FixupResourceHeader, it is used internally. The WriteDescendentRes method calls FixupResourceHeader after writing a component to the stream. This method then uses the current position to determine the size of the resource just written and adjust the resource header accordingly.

The FixupInfo parameter is the value returned by WriteResourceHeader when it writes the resource header (before WriteDescendentRes streams out the component).


TStream.Read

TStream	See also

Introduces an abstract method responsible for reading from the stream.

function Read(var Buffer; Count: Longint): Longint; virtual; abstract;

Description

Each descendant stream object defines a Read method that reads data from its particular storage medium (such as memory or a disk file).

Read is used in cases where the number of bytes to read from the stream is not necessarily fixed. It attempts to read up to Count bytes into buffer and returns the number of bytes actually read.

All the other data-reading methods of a stream (ReadBuffer, ReadComponent) call Read to do their actual reading.


TStream.ReadBuffer

TStream	See also

Reads bytes from the stream into Buffer.

procedure ReadBuffer(var Buffer; Count: Longint);

Description

Use ReadBuffer to read Count bytes from the stream into a buffer in cases where the number of bytes is known and fixed, for example when reading in structures. ReadBuffer is used internally for loading from a stream and copying from a stream.

ReadBuffer calls Read to do the actual reading. If Count bytes cannot be read from the stream, an EReadError exception is raised.


TStream.ReadComponent

TStream	See also	Example

Initiates streaming of components and their properties.

function ReadComponent(Instance: TComponent): TComponent;

Description

ReadComponent is called indirectly by the global routine ReadComponentRes, by the ReadComponentRes method, or it can be called directly to initiate component streaming.

ReadComponent reads data values from the stream and assigns them to Instance’s properties. It then constructs a reader object and calls the reader’s ReadRootComponent method to read Instance’s property values and construct child objects defined in the stream as children of the Instance. ReadComponent returns the component.

If Instance is nil, ReadComponent constructs a component based on the type information in the stream and returns the newly-constructed component.


TStream.ReadComponentRes

TStream	See also

Reads components and their properties from a stream in a Windows resource file format.

function ReadComponentRes(Instance: TComponent): TComponent;Description

ReadComponentRes is called automatically by the global routine ReadComponentResFile. It can also be called directly if the current position of the stream points to a component written using the WriteComponentRes method.

ReadComponentResFile creates a file stream object, which then calls its ReadComponentRes method.

ReadComponentRes first calls the ReadResHeader method to read a resource header from the stream. If the stream does not contain a resource header at the current position, ReadResHeader will raise an EInvalidImage exception. ReadComponentRes then calls ReadComponent to read the properties that must be set on Instance.


TStream.ReadResHeader

TStream	See also

Reads a Windows resource-file header from the stream.

procedure ReadResHeader;

Description

Do not call ReadResHeader directly. It is called automatically by ReadComponentRes before reading a component from a resource file.

After reading the resource-file header, ReadResHeader moves the current position of the stream to just beyond the header. If the stream does not contain a valid resource-file header, ReadResHeader throws an EInvalidImage exception.


TStream.Seek

TStream	See also

Introduces an abstract method for moving to a specified position in the streamed resource.

function Seek(Offset: Longint; Origin: Word): Longint; virtual; abstract;

Description

Each descendant stream object defines a Seek method that moves the current position of the stream in its particular storage medium (such as memory or a disk file).

The Origin parameter indicates how to interpret the Offset parameter. Origin should be one of the following values:

Value	Meaning

soFromBeginning	Offset is from the beginning of the resource. Seek moves to the position Offset. Offset must be >= 0.

soFromCurrent	Offset is from the current position in the resource. Seek moves to Position + Offset.

soFromEnd	Offset is from the end of the resource. Offset must be <= 0 to indicate a number of bytes before the end of the file.

Seek returns the new value of the Position property.

Seek is called by the Position and Size properties.


TStream.SetSize

TStream

Provides a placeholder for a method to change the size of the streamed resource.

procedure SetSize(NewSize: Longint); virtual;

Description

SetSize does nothing in TStream. Descendant stream classes can override this method to set the Size property of their objects. SetSize is the write procedure for the Size property.

Note:	SetSize is introduced in TStream, even though it does nothing, because it is not possible to change the definition of a property in a descendant class. SetSize must therefore be introduced when Size is introduced.


TStream.Write

TStream	See also

Introduces a pure virtual method for writing to the stream.

function Write(const Buffer; Count: Longint): Longint; virtual; abstract;

Description

Each descendant stream object defines a Write method that writes data to its particular storage medium (such as memory or a disk file). Write attempts to write up to Count bytes to Buffer, and returns the number of bytes actually written.

All the other data-writing methods of a stream (WriteBuffer, WriteComponent) call Write to do their actual writing.


TStream.WriteBuffer

TStream	See also

Writes Count bytes from Buffer onto the stream and advances the current position of the stream by Count bytes.

procedure WriteBuffer(const Buffer; Count: Longint);

Description

Use WriteBuffer to save data to a stream. WriteBuffer and ReadBuffer are used in cases where the number of bytes is known and required, for example when reading in structures. Use WriteBuffer for standard file I/O streaming.

WriteBuffer is used internally for writing to a stream and copying from a stream. It is used by other objects, such as strings and lists, for writing strings to a buffer.

WriteBuffer calls Write to handle the actual writing. If the stream fails to write all the requested bytes, an EWriteError exception is raised.


TStream.WriteComponent

TStream	See also	Example

Initiates the writing of components and their properties to a stream.

procedure WriteComponent(Instance: TComponent);

Description

WriteComponent is used internally in the Delphi component streaming system, but can also be called directly when writing components to memory streams or database blobs.

WriteComponent constructs a writer object and calls its WriteRootComponent method to write the component specified by Instance, and its owned objects, to the stream.


TStream.WriteComponentRes

TStream	See also

Writes components and their properties to a stream from a Windows resource file format.

procedure WriteComponentRes(const ResName: string; Instance: TComponent);

Description

WriteComponentRes is used internally in the VCL streaming system, but can also be called directly when sending data to other applications on disk. WriteComponentRes is used for streaming components that need data, such as a bitmap, or icon to be stored specifically in a Windows resource-file format.

WriteComponentRes calls WriteDescendentRes, passing in nil as the Ancestor. Therefore, WriteDescendentRes initiates the remainder of the streaming process for a component that, in this case, is not a descendant.

To read a component written with WriteComponentRes, call the ReadComponentRes method.


TStream.WriteDescendent

TStream	See also

Streams components and their properties in inherited forms.

procedure WriteDescendent(Instance, Ancestor: TComponent);Description

Do not call WriteDescendent directly. WriteDescendent is called automatically by WriteComponent.

WriteDescendent constructs a writer object, then calls the writer object's WriteDescendent method to write the component passed in Instance to the stream. Instance is either an inherited form descended from Ancestor or nil. However, WriteDescendent is never used to write owned components, only to initiate streaming on the root component.


TStream.WriteDescendentRes

TStream	See also

Streams components and their properties in inherited forms.

procedure WriteDescendentRes(const ResName: string; Instance, Ancestor: TComponent);

Description

Do not call WriteDescendentRes directly. WriteDescendentRes is called automatically by WriteComponentRes.

WriteDescendentRes writes a standard Windows resource-file header to the stream, using the resource name passed in ResName as the name of the resource. It then calls WriteDescendent to write Instance to the stream as a descendant of Ancestor.


TStream.WriteResourceHeader

TStream 	See also

Writes a standard Windows resource-file header to the stream.

procedure WriteResourceHeader(const ResName: string; out FixupInfo: Integer);

Description

Do not call WriteResourceHeader, it is used internally. The WriteDescendentRes method calls WriteResourceHeader before writing a component to the stream. This method writes the standard Windows resource-file header, using the value passed as ResName for the name of the resource. It returns a position in FixupInfo that must be used to adjust the header after the size of the resource is known. WriteDescendentRes calls FixupResourceHeader with the value returned as FixupInfo after streaming out the component.


Scope

Protected


Hierarchy

TObject


TStringGridStrings

Hierarchy	Properties	Methods	See also

TStringGridStrings maintains a list of the strings that appear in the cells of a string grid.

Unit

grids

Description

Do not use TStringGridStrings directly in an application. It is tailored to work with a TStringGrid object, and is created by the string grid to represent the strings (and associated objects) in a row or column of the grid.


TStringGridStrings properties

TStringGridStrings	Alphabetically	Legend

In TStringGridStrings

Count

Objects

Strings

Derived from TStrings

Capacity

CommaText

Names

StringsAdapter

Text

Values


TStringGridStrings properties

TStringGridStrings	By object	Legend

Capacity

CommaText

Count

Names

Objects

Strings

StringsAdapter

Text

Values


TStringGridStrings.Count

TStringGridStrings	See also

Indicates the number of entries in the Strings property array.

property Count: Integer;

Description

Use Count to determine the number of strings managed by the instance of TStringGridStrings. If the TStringGridStrings object represents the strings in a row of the grid, Count is the number of columns in the grid. If the TStringGridStrings object represents the strings in a column of the grid, Count is the number of rows in the grid.


TStringGridStrings.Objects

TStringGridStrings	See also

Lists the objects associated with the strings listed by the Strings property.

property Objects[Index: Integer]: TObject;

Description

Use Objects to obtain the object associated with a string in the Strings array. Set Objects to associate an object with one of the strings in the Strings array. Each entry in the Objects array points to the same object as the entry for the corresponding cell in the Objects property array of the string grid.


TStringGridStrings.Strings

TStringGridStrings	See also

Lists the strings displayed in the row or column of the string grid that is represented by the TStringGridStrings object.

property Strings[Index: Integer]: string;

Description

Use Strings to read or set the string for one of the cells in the row or column represented by the TStringGridStrings object. Each string appears in the corresponding cell of the string grid. To locate the object associated with the string, use the Objects property array.


TStringGridStrings methods

TStringGridStrings	Alphabetically

In TStringGridStrings

Assign

Create

Delete

Insert

Derived from TStrings

Add

AddObject

AddStrings

Append

BeginUpdate

Clear

Destroy

EndUpdate

Equals

Exchange

GetText

IndexOf

IndexOfName

IndexOfObject

InsertObject

LoadFromFile

LoadFromStream

Move

SaveToFile

SaveToStream

SetText

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TStringGridStrings methods

TStringGridStrings	By object

Add

AddObject

AddStrings

AfterConstruction

Append

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

Equals

Exchange

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetText

IndexOf

IndexOfName

IndexOfObject

InheritsFrom

InitInstance

Insert

InsertObject

InstanceSize

LoadFromFile

LoadFromStream

MethodAddress

MethodName

Move

NewInstance

SafeCallException

SaveToFile

SaveToStream

SetText


TStringGridStrings.Assign

TStringGridStrings	See also

Copies the list of strings and objects from another TStrings object.

procedure Assign(Source: TPersistent); override;

Description

Call Assign to copy the strings and objects from a source object of type TStrings. If the source object has more strings than the number of cells in the row or column represented by the TStringGridStrings object, Assign only copies the first Count strings and objects.

If the Source parameter is not a TStrings object, Assign calls the inherited method.


TStringGridStrings.Create

TStringGridStrings	See also

Creates an instance of TStringGridStrings.

constructor Create(AGrid: TStringGrid; AIndex: Longint);

Description

Do not create instances of TStringGridStrings. String grids create TStringGridStrings objects for every row and column, to allow quick access of the strings and objects associated with the cells in the grid.

The AGrid parameter specifies the string grid that will use the TStringGridStrings object. The AIndex parameter specifies the index of the row or column associated with the TStringGridStrings object. If AIndex is greater than 0, the TStringGridStrings object represents the row indexed by AIndex. If AIndex is less than 0, the TStringGridStrings object represents the column indexed by the absolute value of AIndex.   If AIndex is 0, the TStringGridStrings object represents an empty row or column.


TStringGridStrings.Delete

TStringGridStrings	See also

Prevents strings from being deleted.

procedure Delete(Index: Integer); override;

Description

Because TStringGridStrings objects represent the rows or columns of a string grid, the number of entries in the list must correspond exactly to the number of cells in the corresponding row or column. Rather than allow entries to be deleted, destroying this correspondence, Delete raises an EInvalidGridOperation exception.


TStringGridStrings.Insert

TStringGridStrings	See also

Prevents strings from being inserted.

procedure Insert(Index: Integer; const S: string); override;

Description

Because TStringGridStrings objects represent the rows or columns of a string grid, the number of entries in the list must correspond exactly to the number of cells in the corresponding row or column. Rather than allow entries to be inserted, destroying this correspondence, Insert raises an EInvalidGridOperation exception.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TStrings


TStrings

Hierarchy	Properties	Methods	See also

TStrings is an abstract base class for objects that represent a list of strings.

Unit

classes

Description

Derive a class from TStrings to store and manipulate a list of strings. Descendants of TStrings can represent several individual strings, such as the individual lines that appear in a list box. Some objects use descendants of TStrings to represent one long body of text so that it can be manipulated in smaller chunks.

TStrings introduces many properties and methods to

Add or delete strings at specified positions in the list.

Rearrange the strings in the list.

Access the string at a particular location.

Read the strings from or write the strings to a file or stream.

Associate an object with each string in the list.


TStrings properties

TStrings	Alphabetically	Legend

In TStrings

Capacity

CommaText

Count

Names

Objects

Strings

StringsAdapter

Text

Values


TStrings properties

TStrings	By object	Legend

Capacity

CommaText

Count

Names

Objects

Strings

StringsAdapter

Text

Values


TStrings.Capacity

TStrings	See also

Indicates the number of strings the TStrings object can hold.

property Capacity: Integer;

Description

Read Capacity to determine the currently allocated size of the string list. For the TStrings object, reading Capacity returns the Count property, and setting Capacity does nothing. Descendants of TStrings can override this property to allow a string list to allocate memory for entries that have not been added to the list.


TStrings.CommaText

TStrings	See also

Lists the strings in the TStrings object in system data format (SDF).

property CommaText: string;

Description

Use CommaText to get or set all the strings in the TStrings object in a single comma-delimited string.

When retrieving CommaText, any string in the list that include spaces, commas or quotes will be contained in double quotes, and any double quotes in a string will be repeated. For example, if the list contains the following strings:

Stri,ng 1

Stri"ng 2

String 3

String4

CommaText will return:

"Stri,ng 1","Stri""ng 2","String 3",String4

When assigning CommaText, the value is parsed as SDF formatted text. For SDF format, strings are separated by commas or spaces, and optionally enclosed in double quotes. Double quote marks that are part of the string are repeated to distinguish them from the quotes that surround the string. Spaces and commas that are not contained within double quote marks are delimiters. Two commas next to each other will indicate an empty string, but spaces that appear next to another delimiter are ignored. For example, suppose CommaText is set to:

"Stri,ng 1", "Stri""ng 2" , String 3,String4

The list will then contain:

Stri,ng 1

Stri"ng 2

String

3

String4


TStrings.Count

TStrings	See also 	Example

Introduces an abstract property to represent the number of strings in the list.

property Count: Integer;

Description

Descendants of TStrings implement a Count property to indicate the number of strings in the list.

Use the Count property when iterating over all the strings in the list, or when trying to locate the position of a string relative to the last string in the list.


TStrings.Names

TStrings	See also 	Example

Indicates the name part of strings with the form Name=Value.

property Names[Index: Integer]: string;

Description

When the list of strings for the TStrings object includes strings of the form Name=Value, read Names to access the name part of a string. Names is the name part of the string at the position indicated by Index. Index gives the position of the string, where 0 is the first string, 1 is the second string, and so on. If the string at the specified position is not of the form Name=Value, Names returns an empty string.

Strings of the form Name=Value are commonly found in .INI files. For example, here are a few strings taken from a DELPHI.INI file:

DisplayGrid=1

SnapToGrid=1

GridSizeX=8

GridSizeY=8

The strings that make up the Params property of a database component (TDatabase) have this format as well.

The Name that identifies the string is to the left of the equal sign (=), and the current Value of the Name identifier is on the right side. There should be no spaces present before or after the equal sign.


TStrings.Objects

TStrings	See also 	Example

Represents a set of objects that are associated one with each of the strings in the Strings property.

property Objects[Index: Integer]: TObject;

Description

Setting the Objects property for TStrings does nothing. Reading the Objects property for TStrings returns nil. Descendant classes can associate objects with the strings in the set by implementing the Objects property.

Use the Objects property of a descendant of TStrings to get or set the object associated with the string at the position indicated by Index. Index gives the position of the string associated with the object, where 0 is the first string, 1 is the second string, and so on. If a descendant of TStrings does not support the Objects property, reading this property returns nil.


TStrings.Strings

TStrings	See also 	Example

References the strings in the list by their positions.

property Strings[Index: Integer]: string;

Description

Descendants of TStrings must implement an accessor function for the Strings property to return the string at the position indicated by Index. Index gives the position of the string, where 0 is the first string, 1 is the second string, and so on.

Use the Strings property to get or set the string at a particular position. Strings is the default property of TStrings objects. The Strings identifier can be omitted when accessing the Strings property of a descendant of TStrings. For example, the following two lines of code are both acceptable and do the same thing:

MyStrings.Strings[0] := 'This is the first string';

MyStrings[0] := 'This is the first string';


TStrings.StringsAdapter

TStrings	See also

Implements an IStrings interface that enables the TStrings object to communicate using OLE.

property StringsAdapter: IStringsAdapter;

Description

Do not use the StringsAdapter property. StringsAdapter is used internally by ActiveX controls to communicate information through an OLE interface.


TStrings.Text

TStrings	See also

Lists the strings in the TStrings object as a single string with the individual strings delimited by carriage returns and line feeds.

property Text: string;

Description

Use Text to get or set all the strings in the TStrings object in a single string delimited by carriage return, line feed pairs.

When reading Text, the strings in the list will be separated by carriage return, line feed pairs. If any of the strings in the list contain a carriage return and line feed pair, the resulting value of Text will appear to contain more strings than is indicated by the Count property.

When setting Text, the value will be parsed by separating into substrings whenever a carriage return or linefeed is encountered. (The two do not need to form pairs).

If the strings in the list contain carriage return or linefeed characters, a less ambiguous format for the strings is available through the CommaText property.


TStrings.Values

TStrings	See also

Represents the value part of a string associated with a given Name, on strings with the form Name=Value.

property Values[const Name: string]: string;

Description

When the list of strings for the TStrings object includes strings of the form Name=Value, use Values to get or set the value part of a string associated with a specific name part. If the list does not contain any strings of the proper Name=Value form, or if none of those strings matches the Name index, Values returns an empty string.

Strings of the form Name=Value are commonly found in .INI files. For example, here are a few strings taken from a DELPHI.INI file:

DisplayGrid=1

SnapToGrid=1

GridSizeX=8

GridSizeY=8

The strings that make up the Params property of a database component (TDatabase) have this format as well.

The Name that identifies the string is to the left of the equal sign (=), and the current Value of the Name identifier is on the right side. There should be no spaces present before or after the equal sign.


TStrings methods

TStrings	Alphabetically

In TStrings

Add

AddObject

AddStrings

Append

Assign

BeginUpdate

Clear

Delete

Destroy

EndUpdate

Equals

Exchange

GetText

IndexOf

IndexOfName

IndexOfObject

Insert

InsertObject

LoadFromFile

LoadFromStream

Move

SaveToFile

SaveToStream

SetText

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TStrings methods

TStrings	By object

Add

AddObject

AddStrings

AfterConstruction

Append

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

Equals

Exchange

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetText

IndexOf

IndexOfName

IndexOfObject

InheritsFrom

InitInstance

Insert

InsertObject

InstanceSize

LoadFromFile

LoadFromStream

MethodAddress

MethodName

Move

NewInstance

SafeCallException

SaveToFile

SaveToStream

SetText


TStrings.Add

TStrings	See also	Example

Adds a string at the end of the list.

function Add(const S: string): Integer; virtual;

Description

Call Add to add a string to the end of the list. Add returns the index of the new string.


TStrings.AddObject

TStrings	See also 	Example

Adds a string to the list, and associates an object with the string.

function AddObject(const S: string; AObject: TObject): Integer; virtual;

Description

Call AddObject to add a string and its associated object to the list. AddObject returns the index of the new string and object.


TStrings.AddStrings

TStrings	See also	Example

Adds a group of strings to the list.

procedure AddStrings(Strings: TStrings); virtual;

Description

Call AddStrings to add the strings from another TStrings object to the list. If both the source and destination TStrings objects support objects associated with their strings, references to the associated objects will be added as well.


TStrings.Append

TStrings	See also 	Example

Adds the string S to the list.

procedure Append(const S: string);

Description

Append is the same as the Add method, except that it does not return a value. Use Append when there is no need to know the index of the string after it has been added, or with descendants of TStrings for which the index returned is not meaningful.

For example, the TStrings descendant used by memo objects uses an index to determine where to insert a string, but the inserted string does not necessarily end up as a single string in the list. Part of the inserted text may become part of the previous string, and part may be broken off into a subsequent string. The index returned by Add is not meaningful in this case.

Use Append rather than Add as a parameter for a function requiring a TGetStrProc.


TStrings.Assign

TStrings	See also	Example

Sets the strings in the list, and possibly associated objects, from a source object.

procedure Assign(Source: TPersistent); override;

Description

Use Assign to set the value of the TStrings object from another object. If Source is of type TStrings, the list is set to the list of the source TStrings object, and if associated objects are supported, any associated objects are copied from the Source as well.

If Source is not of type TStrings, the inherited Assign will set the value of the list from any object that supports TStrings in its AssignTo method.


TStrings.BeginUpdate

TStrings	See also 	Example

Enables the TStrings object to track when the list of strings is changing.

procedure BeginUpdate;

Description

BeginUpdate is called automatically by any property or method that changes the list of strings. Once the changes are complete, the property or method calls EndUpdate. Call BeginUpdate before directly modifying the strings in the list, and EndUpdate after. When implementing properties or methods that change the list in descendants of TStrings, call BeginUpdate before the changes are made, and EndUpdate when the changes are complete.

TStrings simply keeps track of when the list of strings is being changed. Some descendants of TStrings use this information to perform certain actions, such as telling a control to repaint, when updates are complete.


TStrings.Clear

TStrings	See also 	Example

Introduces an abstract method to empty the list and any associated objects.

procedure Clear; virtual; abstract;

Description

Descendants of TStrings implement a Clear method to delete all the strings in the list, and to remove any references to associated objects.


TStrings.Delete

TStrings	See also

Introduces an abstract method to delete a specified string from the list.

procedure Delete(Index: Integer); virtual; abstract;

Description

Descendants of TStrings implement a Delete method to remove a specified string from the list. If an object is associated with the string, the reference to the object is removed as well. Index gives the position of the string, where 0 is the first string, 1 is the second string, and so on.


TStrings.Destroy

TStrings	See also

Destroys an instance of TStrings.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TStrings reference is not nil, and only then calls Destroy.


TStrings.EndUpdate

TStrings	See also 	Example

Enables the TStrings object to keep track of when the list of strings has finished changing.

procedure EndUpdate;

Description

EndUpdate is called automatically by any property or method that changes the list of strings. Call BeginUpdate before directly modifying the strings in the list, and EndUpdate after. When implementing properties or methods that change the list in descendants of TStrings, call BeginUpdate before the changes are made, and EndUpdate when the changes are complete.

TStrings simply keeps track of when the list of strings is being changed. Some descendants of TStrings use this information to perform certain actions, such as telling a control to repaint, when updates are complete.


TStrings.Equals

TStrings	See also

Compares the list of strings to the list from another TStrings object and returns True if the two lists are the same.

function Equals(Strings: TStrings): Boolean;

Description

Call Equals to compare the lists in two TStrings objects. Equals compares only the strings, not any references to associated objects. Equals returns True if the lists for both TStrings objects have the same number of strings and the strings in each list are identical. Equals returns False if the lists are different in length, if they contain different strings, or if the order of the strings in the two lists differ.


TStrings.Exchange

TStrings	See also

Swaps the position of two strings in the list.

procedure Exchange(Index1, Index2: Integer); virtual;

Description

Call Exchange to rearrange the strings in the list. The strings are specified by their index values in the Index1 and Index2 parameters. Indexes are zero-based, so the first string in the list has an index value of 0, the second has an index value of 1, and so on.

If either string has an associated object, Exchange changes the position of the object as well.


TStrings.GetText

TStrings	See also

Allocates a text buffer and fills it with the value of the Text property.

function GetText: PChar; virtual;

Description

Call GetText to obtain a dynamically allocated character buffer containing all of the strings in the list. Individual strings are separated by a carriage return and line feed. The caller is responsible for freeing the returned value.


TStrings.IndexOf

TStrings	See also 	Example

Returns the position of a string in the list.

function IndexOf(const S: string): Integer; virtual;

Description

Call IndexOf to obtain the position of the first occurrence of the string S. IndexOf returns the 0-based index of the string. Thus, if S matches the first string in the list, IndexOf returns 0, if S is the second string, IndexOf returns 1, and so on. If the string is not in the string list, IndexOf returns -1.

Note:	If the string appears in the list more than once, IndexOf returns the position of the first occurrence.


TStrings.IndexOfName

TStrings	See also 	Example

Returns the position of the first string with the form Name=Value with the specified name part.

function IndexOfName(const Name: string): Integer;

Description

Call IndexOfName to locate the first occurrence of a string with the form Name=Value where the name part is equal to the Name parameter. IndexOfName returns the 0-based index of the string. If no string in the list has the indicated name, IndexOfName returns -1.

Strings of the form Name=Value are commonly found in .INI files. For example, here are a few strings taken from a DELPHI.INI file:

DisplayGrid=1

SnapToGrid=1

GridSizeX=8

GridSizeY=8

The strings that make up the Params property of a database component (TDatabase) have this format as well.

The Name that identifies the string is to the left of the equal sign (=), and the current Value of the Name identifier is on the right side. There should be no spaces present before or after the equal sign.

Note:	If there is more than one string with a name portion matching the Name parameter, IndexOfName returns the position of the first such string.


TStrings.IndexOfObject

TStrings	See also

Returns the index of the first string in the list associated with a given object.

function IndexOfObject(AObject: TObject): Integer;

Description

Call IndexOfObject to locate the first string in the list associated with the object AObject. Specify the object you want to locate as the value of the AObject parameter. IndexOfObject returns the 0-based index of the string and object. If the object is not associated with any of the strings, IndexOfObject returns -1.


TStrings.Insert

TStrings	See also

Introduces an abstract method to insert a string at a specified position.

procedure Insert(Index: Integer; const S: string); virtual; abstract;

Description

Descendants of TStrings implement an Insert method to add the string S to the list at the position specified by Index. If Index is 0, the string is inserted at the beginning of the list. If Index is 1, the string is put in the second position of the list, and so on.

All methods that add strings to the list use the Insert method to add the string.

If the string has an associated object, use the InsertObject method instead.


TStrings.InsertObject

TStrings	See also 	Example

Inserts a string into the list at the specified position, and associates it with an object.

procedure InsertObject(Index: Integer; const S: string; AObject: TObject);

Description

Call InsertObject to insert the string S into the list at the position identified by Index, and associate it with the object AObject. If Index is 0, the string is inserted at the beginning of the list. If Index is 1, the string is put in the second position of the list, and so on.


TStrings.LoadFromFile

TStrings	See also 	Example

Fills the list with the lines of text in a specified file.

procedure LoadFromFile(const FileName: string); virtual;

Description

Call LoadFromFile to fill the list of the TStrings object from the file specified by FileName. Each line in the file, as indicated by carriage return or linefeed characters, is appended as a string in the list.

Note:	LoadFromFile uses the Add method to add the strings that are read from the file.


TStrings.LoadFromStream

TStrings	See also	Example

Fills the list with lines of text read from a stream.

procedure LoadFromStream(Stream: TStream); virtual;

Description

Call LoadFromStream to fill the list of the TStrings object from the stream specified by Stream. The text read from the stream is parsed into strings separated by carriage return or linefeed characters. Thus, LoadFromStream reads the value of the Text property.

If the stream is a file stream, LoadFromStream does the same thing as LoadFromFile, except the application must create and destroy the file stream.


TStrings.Move

TStrings	See also 	Example

Changes the position of a string in the list.

procedure Move(CurIndex, NewIndex: Integer); virtual;

Description

Use Move to move the string at position CurIndex so that it occupies the position NewIndex. The positions are specified as 0-based indexes. For example, the following line of code moves the string in the first position to the last position.

MyStringsObject.Move(0, MyStringsObject.Count - 1);

If the string has an associated object, the object remains associated with the string in its new position.


TStrings.SaveToFile

TStrings	See also 	Example

Saves the strings in the list to the specified file.

procedure SaveToFile(const FileName: string); virtual;

Description

Call SaveToFile to save the strings in the list to the file specified by FileName. Each string in the list is written to a separate line in the file.


TStrings.SaveToStream

TStrings	See also

Writes the value of the Text property to a stream object.

procedure SaveToStream(Stream: TStream); virtual;

Description

Call SaveToStream to save the strings in the list to the stream specified by the Stream parameter. SaveToStream writes the strings delimited by carriage return, line feed pairs. If the stream is a file stream, SaveToStream does the same thing as SaveToFile, except the application must create and destroy the file stream.


TStrings.SetText

TStrings	See also

Sets the Text property.

procedure SetText(Text: PChar); virtual;

Description

Call SetText to replace the list with the strings specified by the Text parameter. SetText adds strings one at a time to the list, using the carriage returns or linefeed characters in Text as delimiters indicating when to add a new string.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TStringStream

Hierarchy	Properties	Methods	See also

TStringStream provides file-like access to information stored as a long string.

Unit

classes

Description

Use TStringStream to store data as a long string enhanced with I/O capabilities. TStringStream is useful as an intermediary object that can hold text as well as read it from or write it to another storage medium. TStringStream provides a mechanism for manipulating text that is obtained from a less accessible medium.


TStringStream properties

TStringStream	Alphabetically	Legend

In TStringStream

DataString

Size

Derived from TStream

Position


TStringStream properties

TStringStream	By object	Legend

DataString

Position

Size


TStringStream.DataString

TStringStream	See also	Example

Provides direct access to the string that stores the text represented by the TStringStream object.

property DataString: string;

Description

Use DataString to get access to the text of the stream. The text represents the information that is being transferred by means of the string stream. Size is the number of bytes in the string, and Position is the current position within DataString.

Note:	DataString is a read-only property. DataString can be used to change the contents of the string, but applications can’t change the DataString itself.


TStringStream.Size

TStringStream	See also

Indicates the length of the string that stores the text.

property Size: Longint;

Description

Read Size to determine how many bytes are used to store the value of DataString. Set Size to truncate the text or to increase the length of DataString. If Size is set to a value greater than the current length of the text, the content of the new bytes is undefined.


TStringStream methods

TStringStream	Alphabetically

In TStringStream

Create

Read

ReadString

Seek

Write

WriteString

Derived from TStream

CopyFrom

FixupResourceHeader

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TStringStream methods

TStringStream	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

CopyFrom

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

FixupResourceHeader

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Read

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

ReadString

SafeCallException

Seek

Write

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

WriteResourceHeader

WriteString


TStringStream.Create

TStringStream	See also

Creates an instance of TStringStream.

constructor Create(AString: string);

Description

Call Create to instantiate a TStringStream object. Create initializes the DataString property to the AString parameter.


TStringStream.Read

TStringStream	See also

Reads up to Count bytes from the string stream into Buffer, and advances the current position of the stream by the number of bytes read.

function Read(var Buffer; Count: Longint): Longint; override;

Description

Use Read to read the contents of the string stream into a buffer, starting at the current position. If Count extends beyond the end of the DataString, Read will only transfer the characters up to the end of the DataString, and advances the current position accordingly. If the return value is less than Count, it means that the end of the string was read.

The ReadBuffer method and ReadComponent method call Read to do the actual reading.

Note:	Read treats Count as an upper bound. The ReadBuffer method, by contrast, raises an exception if Count bytes cannot be read.


TStringStream.ReadString

TStringStream	See also

Returns a string that consists of up to Count bytes from the current position in the string stream, and advances the current position of the stream by the number of bytes read.

function ReadString(Count: Longint): string;

Description

Use Read to read the contents of the string stream into a string, starting at the current position. If Count extends beyond the end of the DataString, the returned string will only contain the characters up to the end of DataString, and the current position is advanced accordingly.

Note:	ReadString does the same thing as Read, except that it returns a string rather than filling a buffer.


TStringStream.Seek

TStringStream	See also	Example

Moves the current position in the stream by Offset bytes, relative to a specified origin.

function Seek(Offset: Longint; Origin: Word): Longint; override;

Description

Use Seek to move the current position within the string stream by the indicated offset. Seek allows an application to read from or write to a particular location within the DataString.

If Offset is a negative number, the seek is backwards from the specified origin. The following table shows the different values of Origin and their meanings for seeking.

Value	Meaning

soFromBeginning	Offset is from the beginning of DataString. Seek moves to the position Offset. Offset must be >= 0.

soFromCurrent	Offset is from the current position. Seek moves to Position + Offset.

soFromEnd	Offset is from the end of Memory. Offset must be <= 0 to indicate a number of bytes before the end of the DataString.

Seek returns the new value of the Position property.


TStringStream.Write

TStringStream	See also

Write writes Count bytes from Buffer to the current position in the string stream and updates the current position by Count bytes.

function Write(const Buffer; Count: Longint): Longint; override;

Description

Use Write to replace the end of the string from the current position on with the first Count bytes of Buffer. Write will change the Size property to reflect the new length of the DataString.

Write always writes Count bytes from Buffer, even if a null character is included as one of the Count bytes. Thus, Write is equivalent to the WriteBuffer method.


TStringStream.WriteString

TStringStream	See also

Concatenates a specified string to the current position in the string stream, and updates the current position accordingly.

procedure WriteString(const AString: string);

Description

Use WriteString to replace the end of the string from the current position on with the string specified by the AString parameter. WriteString changes the Size property to reflect the new length of the DataString.


Accessibility

Read-only


Hierarchy

TObject

TStream


TStringField

Hierarchy	Properties	Methods	Events	See also

TStringField represents a string field in a dataset.

Unit

db

Description

TStringField is a persistent field object that encapsulates the fundamental behavior common to string data. In addition to the properties, methods, and events common to all fields that are introduced by the TField class, TStringField includes many properties, methods, and events that are useful for managing the value and properties of a string field in a database. TStringField introduces no new methods or events, but reimplements a number of properties to adapt them to accessing string fields and to manage language driver conversions.

As with all persistent field objects, a TStringField can be created at design-time using the Fields Editor or at runtime by calling the constructor for the class. Persistent field objects exist solely in the memory space of an application. Creating a persistent field object only creates an object in the application, and does not result in the creation of a field in a table.

Fields in a table can be accessed without use of persistent field objects. Virtual field objects are created to provide access to a field when the field is referenced through such means as the TDataSet.::Fields property or the TDataSet.FieldByName method. However, as both the Fields property and the FieldByName method return a value of type TField, the return value must be typecast as a TStringField before using any property specific to TStringField.

A value of a string field is physically stored as a sequence of up to 8192 characters. However, some table types may only support string fields of smaller dimensions. Common uses for string fields are to store text, such as names and addresses.


TStringField properties

TStringField	Alphabetically	Legend

In TStringField

AsBoolean

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

DataSize

FixedChar

Transliterate

Value

Derived from TField

Alignment

AsCurrency

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TStringField properties

TStringField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FixedChar

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

Transliterate

ValidChars

Value

VCLComObject

Visible


TStringField.AsBoolean

TStringField	See also

Represents the value of the field as a Boolean value.

property AsBoolean: Boolean;

Description

Use AsBoolean to

Assign the string field value to a Boolean variable.

Assign a Boolean value to the string field.

AsBoolean returns True on reading the value of the field if its text begins with the letters Y, y, T or t (for Yes or True), and False otherwise. Using AsBoolean to write a TStringField's value sets the string to T or F.


TStringField.AsDateTime

TStringField	See also

Represents the value of the field as a TDateTime value.

property AsDateTime: TDateTime;

Description

Use AsDateTime to

Assign the string field value to a TDateTime value.

Assign a TDateTime value to the string field.

Reading AsDateTime converts the value of the field to a date-time using the StrToDateTime function. Setting AsDateTime converts the date-time value to a string using the DateTimeToStr function.

Table1StrDateField.AsDateTime := Now;


TStringField.AsFloat

TStringField	See also

Represents the value of the field as a floating-point value.

property AsFloat: Double;

Description

Use AsFloat to

Assign the string field value to a floating-point value.

Assign a floating-point value to the string field.

For example, this code assigns a floating-point value to a string field value:

MyStringField.AsFloat := 7.345;

To assign a string field value to a floating-point value, use code similar to this:

FloatVariable := MyStringField.AsFloat;

Reading AsFloat converts the value of the field to a floating-point value using the StrToFloat function. Setting AsFloat converts the floating-point value to a string using the FloatToStr function.


TStringField.AsInteger

TStringField	See also

Represents the value of the field as an integer value.

property AsInteger: Longint;

Description

Use AsInteger to

•	Assign the string field value to an integer value.

•	Assign an integer value to the string field.

For example, this code assigns integer value to a string field value:

MyStringField.AsInteger := 12;

To assign a string field value to an integer value, use code similar to this:

IntegerVariable := MyStringField.AsInteger;

Reading AsInteger converts the value of the field to an integer using the StrToInt function. Setting AsInteger converts the integer to a string using the IntToStr function.


TStringField.AsString

TStringField	See also	Example

Represents the value of the field.

property AsString: String;

Description

String values need no conversion, because the native format of a string field is a string. For string fields, AsString is the same as the Value property. AsString provides a uniform interface that allows applications to get or set string values with generic field components when the internal format of the data is not known.

When setting the AsString property, TStringField converts the assigned string from ANSI, using the language driver for the dataset, if the Transliterate property is True. Strings that have more characters than permitted by the value of the Size property are truncated when setting AsString.


TStringField.AsVariant

TStringField	See also

Represents the value of a string field as a variant value.

property AsVariant: Variant;

 Description

Use AsVariant to

Assign the string field value to variant variable.

Assign a variant value to the string field.

Using variants is useful when both the field type and the type of the value to be assigned to the field are unknown.


TStringField.DataSize

TStringField	See also	Example

Indicates amount of memory needed to store the string field in its native database format.

property DataSize: Word;

Description

Check DataSize to determine the number of bytes required to store a string field component’s value. Use DataSize to determine the size needed for a buffer when working with the GetData and SetData methods.

For string fields, DataSize is one more than the value of the Size property. The characters in the string can take up to Size bytes, and the extra byte is the null character at the end.


TStringField.FixedChar

TStringField	See also

Specifies whether the field represented is of Char type.

property FixedChar: Boolean;

Description

FixedChar will be True when the field in the underlying database is a CHAR type as opposed to VARCHAR.


TStringField.Transliterate

TStringField	See also

Indicates whether to convert the value of the string field between the ANSI character set and the character set identified by the dataset when reading from or writing to the physical database tables.

property Transliterate: Boolean;

Description

Use Transliterate when the physical database table identified by the dataset does not use an ANSI language driver and the data may contain extended ASCII characters.

When Transliterate is True, the AnsiToNative function is called to translate the ANSI characters to the character set used by the dataset when the string field value is set. When the string field value is read, the NativeToAnsi function is called to translate the characters in the database table to the ANSI character set.


TStringField.Value

TStringField	See also

Represents the data in the string field.

property Value: String;

Description

Use Value to read data directly from and write data directly to a string field component at runtime. Using the Value property is the same as using the AsString property. Use Value when you know the field component is a string field. Use AsString when working with a generic field component.

When setting the Value property, TStringField converts the assigned string from ANSI, using the language driver for the dataset, if the Transliterate property is True. Strings that have more characters than permitted by the value of the Size property are truncated when setting Value.


TStringField events

TStringField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TStringField events

TStringField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TStringField methods

TStringField	Alphabetically

In TStringField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStringField methods

TStringField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TStringField.Create

TStringField	See also

Creates an instance of a TStringField object.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TStringField. After calling the inherited constructor, Create sets the DataType property to ftString, Size to 20, and Transliterate to True.

After instantiating a TStringField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TStringField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TStringField with a dataset component by setting its DataSet property to the name of the dataset component.

The example below creates a TStringField object for a field named LastName accessed through a TQuery named Query1.

var

  T: TStringField;

begin

  Query1.Close;

  T := TStringField.Create(Self);

  T.FieldName := 'LastName';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField


 TStringGrid

Hierarchy	Properties	Methods	Events	See also

TStringGrid represents a grid control designed to simplify the handling of strings and associated objects.

Unit

grids

Description

Add a TStringGrid object to a form to present textual data in a tabular format. TStringGrid provides many properties to control the appearance of the grid, as well as events and methods that take advantage of the tabular organization of the grid in responding to user actions.

TStringGrid introduces the ability to associate an object with each string in the grid. These objects can encapsulate any information or behavior represented by the strings that are presented to the user.

If the strings to be presented in a grid represent field values from the records in a dataset, use TDBGrid instead.


TStringGrid properties

TStringGrid	Alphabetically	Legend

In TStringGrid

Cells

Cols

Objects

Rows

Derived from TCustomGrid

BorderStyle

Col

ColCount

ColWidths

DefaultColWidth

DefaultDrawing

DefaultRowHeight

EditorMode

FixedColor

FixedCols

FixedRows

GridHeight

GridLineWidth

GridWidth

LeftCol

Options

Row

RowCount

RowHeights

ScrollBars

Selection

TabStops

TopRow

VisibleColCount

VisibleRowCount

Derived from TCustomControl

Canvas

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

HostDockSite

Height

Hint

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TStringGrid properties

TStringGrid	By object	Legend

Action

Align

Anchors

BiDiMode

BorderStyle

BoundsRect

Brush

Canvas

Cells

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Col

ColCount

Color

Cols

ColWidths

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DefaultColWidth

DefaultDrawing

DefaultRowHeight

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

EditorMode

Enabled

FixedColor

FixedCols

FixedRows

Floating

FloatingDockSiteClass

Font

GridHeight

GridLineWidth

GridWidth

Handle

Height

HelpContext

Hint

HostDockSite

Left

LeftCol

LRDockWidth

Name

Objects

Options

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

Row

RowCount

RowHeights

Rows

ScrollBars

Selection

ShowHint

Showing

TabOrder

TabStop

TabStops

Tag

TBDockHeight

Top

TopRow

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleColCount

VisibleDockClientCount

VisibleRowCount

Width

WindowProc


TStringGrid.Cells

TStringGrid	See also 	Example

Lists the strings for each cell in the grid.

property Cells[ACol, ARow: Integer]: string;

Description

Use Cells to access the string within a particular cell. ACol is the column coordinate of the cell, and ARow is the row coordinate of the cell. The first row is row zero, and the first column is column zero.

The ColCount and RowCount property values define the size of the array of strings.

To access the objects associated with the strings in the Cells array, use the Objects property.


TStringGrid.Cols

TStringGrid	See also

Lists strings with their associated objects for each column.

property Cols[Index: Integer]: TStrings;

Description

Use Cols to access all the strings for a single column, along with their associated objects. The number of strings and associated objects is always equal to the value of the ColCount property, the number of columns in the grid. The Index parameter is the number of the column, where the value of the first column in the grid is zero.

To get all the strings and objects for a row, rather than for a column, use the Rows property.


TStringGrid.Objects

TStringGrid	See also

Lists the objects for each cell in the grid.

property Objects [ACol, ARow: Integer]: TObject;

Description

Use the Objects property to access the object associated with a particular cell. The ColCount and RowCount values define the size of the array of objects. ACol is the column coordinate of the cell, and ARow is the row coordinate of the cell, where the first column is column 0, and the first row is row 0.

Note:	The string grid does not own the objects in the Objects array. Objects added to the Objects array still exist even if the string grid is destroyed. They must be explicitly destroyed by the application.


TStringGrid.Rows

TStringGrid	See also 	Example

Lists the strings and their associated objects for each row.

property Rows[Index: Integer]: TStrings;

Description

Use Rows to access all the strings for a single row, along with their associated objects. The number of strings and associated objects is always equal to the value of the RowCount property, the number of rows in the grid. The Index parameter is the number of the row, where the value of the first row in the grid is zero.

To get all the strings and objects for a column, rather than for a row, use the Cols property.


TStringGrid events

TStringGrid	Alphabetically	Legend

Derived from TDrawGrid

OnColumnMoved

OnDrawCell

OnGetEditMask

OnGetEditText

OnRowMoved

OnSelectCell

OnSetEditText

OnTopLeftChanged

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TStringGrid events

TStringGrid	By object	Legend

OnClick

OnColumnMoved

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnDrawCell

OnEndDrag

OnEnter

OnExit

OnGetEditMask

OnGetEditText

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnRowMoved

OnSelectCell

OnSetEditText

OnStartDrag

OnTopLeftChanged


TStringGrid methods

TStringGrid	Alphabetically

In TStringGrid

Create

Destroy

Derived from TDrawGrid

CellRect

MouseToCell

Derived from TCustomGrid

MouseCoord

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

Focused

FindChildControl

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStringGrid methods

TStringGrid	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

CellRect

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseCoord

MouseToCell

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TStringGrid.Create

TStringGrid	See also

Creates an instance of TStringGrid.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create an instance of TStringGrid at runtime. For string grids placed on forms at design time, Create is called automatically.

After calling the inherited constructor, Create creates the helper objects used by TStringGrid to manage the array of strings and their associated objects.


TStringGrid.Destroy

TStringGrid	See also

Destroys an instance of TStringGrid.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the string grid is not nil, and only then calls Destroy.

Destroy frees the helper objects used to manage the array of strings and their associated objects.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGrid

TDrawGrid


TStringList

Hierarchy	Properties	Methods	Events	See also

TStringList maintains a list of strings.

Unit

classes

Description

Use a string list object to store and manipulate a list of strings. TStringList implements the abstract properties and methods introduced by TStrings, and introduces new properties, events, and methods to

Sort the strings in the list.

Prohibit duplicate strings in sorted lists.

Respond to changes in the contents of the list.


TStringList properties

TStringList	Alphabetically	Legend

In TStringList

Capacity

Count

Duplicates

Objects

Sorted

Strings

Derived from TStrings

CommaText

Names

StringsAdapter

Text

Values


TStringList properties

TStringList	By object	Legend

Capacity

CommaText

Count

Duplicates

Names

Objects

Sorted

Strings

StringsAdapter

Text

Values


TStringList.Capacity

TStringList	See also

Indicates the number of strings the string list has allocated memory to hold.

property Capacity: Integer;

Description

Use Capacity to find out how much memory is available for holding strings, or to reallocate the memory to allow more or fewer strings.

Capacity is the number of entries in the string list that have been allocated, as opposed to Count, which is the number of strings in the list. Thus, Capacity is always greater than or equal to Count.

Adding new strings will cause the Capacity property to increase if necessary, but setting the Capacity property will not change the Count property. Do not set Capacity to a value less than Count, or the list will be truncated and Count will indicate that the list contains more strings than is the case. Also, if Capacity is set to a value less than Count, the memory used to store the strings that are dropped from the list (as opposed to the entries in the list that point to those strings) is not freed.


TStringList.Count

TStringList	See also 	Example

Indicates the number of strings in the list.

property Count: Integer;

Description

Use Count when iterating over all the strings in the list, or when trying to locate the position of a string relative to the last string in the list.


TStringList.Duplicates

TStringList	See also

Specifies whether duplicate strings can be added to sorted lists.

type TDuplicates = (dupIgnore, dupAccept, dupError);

property Duplicates: TDuplicates;

Description

Set Duplicates to specify what should happen when an attempt is made to add a duplicate string to a sorted list. The value of Duplicates should be one of the following.

Value	Meaning

dupIgnore	Ignore attempts to add duplicate strings to the sorted list.

dupError	Raise an EStringListError exception when an attempt is made to add duplicate strings to the sorted list.

dupAccept	Permit duplicate strings in the sorted list.

Set Duplicates before adding any strings to the list. Setting Duplicates to dupIgnore or dupError does nothing about duplicate strings that are already in the list.

Note:	Duplicates does nothing if the list is not sorted.


TStringList.Objects

TStringList	See also

Lists a set of objects associated one with each of the strings in the Strings property.

property Objects[Index: Integer]: TObject;

Description

Associate an object with an existing string by setting the Objects property using the same index as that of the string in the Strings property. Look up the object associated with a string by reading the Objects property with the index of the string. Index gives the position of the string associated with the object, where 0 is the first string, 1 is the second string, and so on. Use the IndexOf method to find the index of the string.

For example, use Objects to associate bitmap objects with the strings in the string list. The Objects property then enables the application to quickly locate the bitmaps for display beside the strings in a listbox, or for drawing when the associated string is selected in a control.


TStringList.Sorted

TStringList	See also 	Example

Specifies whether the strings in the list should be automatically sorted.

property Sorted: Boolean;

Description

Set Sorted to True to cause the strings in the list to be automatically sorted in ascending order. Set Sorted to False to allow strings to remain where they are inserted. When Sorted is False, the strings in the list can be put in ascending order at any time by calling the Sort method.

When Sorted is True, do not use Insert to add strings to the list. Instead, use Add, which will insert the new strings in the appropriate position. When Sorted is False, use Insert to add strings to an arbitrary position in the list, or Add to add strings to the end of the list.

Note:	When Sorted is True, the string list uses AnsiCompareStr to sort the strings. This sort order takes into account the locale of the system on which the application is running.


TStringList.Strings

TStringList	See also

Lists the strings, referenced by a 0-based index.

property Strings[Index: Integer]: string; default;

Description

Use Strings to read or modify the string at a particular position. Index gives the position of the string, where 0 is the position of the first string, 1 is the position of the second string, and so on. To locate a particular string in the list, call the IndexOf method.

Strings is the default property of string list objects. The Strings identifier can be omitted when accessing the Strings property of a string list object. For example, the following two lines of code are both acceptable and do the same thing:

MyStringList.Strings[0] := 'This is the first string';

MyStringList[0] := 'This is the first string';


TStringList events

TStringList	Alphabetically

In TStringList

OnChange

OnChanging


TStringList events

TStringList	By object

OnChange

OnChanging


TStringList.OnChange

TStringList	See also

Occurs immediately after the list of strings changes.

property OnChange: TNotifyEvent;

Description

Write an OnChange event handler to respond to changes in the list of strings. For example, if the string list is associated with a control, the OnChange event handler could tell the control to repaint itself whenever the content of the list changes.

Whenever strings in the list are added, deleted, moved, or modified, the following events take place:

1	First, an OnChanging event occurs before the change.

2	The strings are added, deleted, moved, or modified.

3	Finally, an OnChange event occurs.


TStringList.OnChanging

TStringList	See also

Occurs immediately before the list of strings changes.

property OnChanging: TNotifyEvent;

Description

Write an OnChanging event handler to prepare for changes in the list of strings. For example, if the string list is associated with a control, the OnChanging event handler could tell the control to disable repaints until the OnChange event when the list has finished changing.

Whenever strings in the list are added, deleted, moved, or modified, the following events take place:

1	First, an OnChanging event occurs.

2	The strings are added, deleted, moved, or modified.

3	Finally, an OnChange event occurs after the changes are complete.


TStringList methods

TStringList	Alphabetically

In TStringList

Add

Clear

CustomSort

Delete

Destroy

Exchange

Find

IndexOf

Insert

Sort

Derived from TStrings

AddObject

AddStrings

Append

Assign

BeginUpdate

EndUpdate

Equals

GetText

IndexOfName

IndexOfObject

InsertObject

LoadFromFile

LoadFromStream

Move

SaveToFile

SaveToStream

SetText

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TStringList methods

TStringList	By object

Add

AddObject

AddStrings

AfterConstruction

Append

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

CustomSort

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

Equals

Exchange

FieldAddress

Find

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetText

IndexOf

IndexOfName

IndexOfObject

InheritsFrom

InitInstance

Insert

InsertObject

InstanceSize

LoadFromFile

LoadFromStream

MethodAddress

MethodName

Move

NewInstance

SafeCallException

SaveToFile

SaveToStream

SetText

Sort


TStringList.Add

TStringList	See also	Example

Adds a new string to the list.

function Add(const S: string): Integer; override;

Description

Call Add to add the string S to the list. If the list is sorted, S is added to the appropriate position in the sort order. If the list is not sorted, S is added to the end of the list. Add returns the position of the item in the list, where the first item in the list has a value of 0.

Note:	For sorted lists, Add will raise an EListError exception if the string S already appears in the list and Duplicates is set to dupError. If Duplicates is set to dupIgnore, trying to add a duplicate string to a sorted list does nothing.


TStringList.Clear

TStringList	See also

Deletes all the strings from the list.

procedure Clear; override;

Description

Call clear to empty the list of strings. All references to associated objects are also removed. However, the objects themselves are not freed.


TStringList.CustomSort

TStringList	See also

Sorts the strings in the list in a customized order.

type TStringListSortCompare = function(List: TStringList; Index1, Index2: Integer): Integer;

procedure CustomSort(Compare: TStringListSortCompare); virtual;

Description

Use CustomSort to sort the strings in the list, where the sort order is defined by the Compare parameter.

Supply a value for the Compare function that compares two strings in the string list. The List parameter provides access to the string list, while the Index1 and Index2 parameters identify the strings to be compared. Use Index1 and Index2 as indexes into the Strings property array. The Compare function should return

a value less than 0 if the string identified by Index1 comes before the string identified by Index2

0 if the two strings are equivalent

a value greater than 0 if the string with Index1 comes after the string identified by Index2.

Do not pass nil as the value of the Compare parameter.

Note:	You must explicitly call the CustomSort method. Setting the Sorted property only sorts strings using ANSI order, as implemented in the Sort method.


TStringList.Delete

TStringList	See also

Removes the string specified by the Index parameter.

procedure Delete(Index: Integer); override;

Description

Call Delete to remove a single string from the list. If an object is associated with the string, the reference to the object is removed as well. Index gives the position of the string, where 0 is the first string, 1 is the second string, and so on.


TStringList.Destroy

TStringList	See also

Destroys an instance of TStringList.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TStringList reference is not nil and only then calls Destroy.

Destroy frees the memory allocated to hold the list of strings and object references before calling the inherited destructor.


TStringList.Exchange

TStringList	See also

Swaps the position of two strings in the list.

procedure Exchange(Index1, Index2: Integer); override;

Description

Call Exchange to rearrange the strings in the list. The strings are specified by their index values in the Index1 and Index2 parameters. Indexes are zero-based, so the first string in the list has an index value of 0, the second has an index value of 1, and so on.

If either string has an associated object, Exchange changes the index of the object as well.

Warning:	Do not call Exchange on a sorted list except to swap two identical strings with different associated objects. Exchange does not check whether the list is sorted, and can destroy the sort order of a sorted list.


TStringList.Find

TStringList	See also 	Example

Locates the index for a string in a sorted list and indicates whether a string with that value already exists in the list.

function Find(const S: string; var Index: Integer): Boolean; virtual;

Description

Use Find to obtain the index in a sorted list where the string S should be added. If the string S already exists in the list, Find returns True. If the list does not contain S, Find returns False. The index where S should go is returned in the Index parameter. The value of Index is zero-based, where the first string has the index 0, the second string has the index 1, and so on.

Note:	Only use Find with sorted lists. For unsorted lists, use the IndexOf method instead.


TStringList.IndexOf

TStringList	See also

Returns the position of a string in the list.

function IndexOf(const S: string): Integer; override;

Description

Call IndexOf to obtain the position of the first occurrence of the string S. IndexOf returns the 0-based index of the string. Thus, if S matches the first string in the list, IndexOf returns 0, if S is the second string, IndexOf returns 1, and so on. If the string is not in the string list, IndexOf returns -1.


TStringList.Insert

TStringList	See also

Inserts a string to the list at the position specified by Index.

procedure Insert(Index: Integer; const S: string); override;

Description

Call Insert to add the string S to the list at the position specified by Index. If Index is 0, the string is inserted at the beginning of the list. If Index is 1, the string is put in the second position of the list, and so on.

If the string has an associated object, use the InsertObject method instead.

Note:	If the list is sorted, calling Insert or InsertObject will raise an EListError exception. Use Add or AddObject with sorted lists.


TStringList.Sort

TStringList	See also

Sorts the strings in the list in ascending order.

procedure Sort; virtual;

Description

Call Sort to sort the strings in a list that has the Sorted property set to False. String lists with the Sorted property set to True are automatically sorted.

Note:	Sort uses AnsiCompareStr to sort the strings. This sort order takes into account the locale of the system on which the application is running. To provide your own comparison operator instead, use the CustomSort method.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TStrings


TStatusPanel

Hierarchy	Properties	Methods	See also

TStatusPanel represents a single panel of a status bar.

Unit

comctrls

Description

Each TStatusBar uses a TStatusPanels to maintain a collection of TStatusPanel objects.


TStatusPanel properties

TStatusPanel	Alphabetically	Legend

In TStatusPanel

Alignment

BiDiMode

Bevel

ParentBiDiMode

DisplayName

Style

Text

Width

Derived from TCollectionItem

Collection

ID

Index


TStatusPanel properties

TStatusPanel	By object	Legend

Alignment

Bevel

BiDiMode

Collection

DisplayName

ID

Index

ParentBiDiMode

Style

Text

Width


TStatusPanel.Alignment

TStatusPanel	See also

Specifies how text is aligned within the status panel.

property Alignment: TAlignment;

Description

Use Alignment to indicate whether the text should be left-justified, right-justified, or centered in the panel.

These are the possible values of Alignment:

Value	Meaning

taLeftJustify	Align text on the left side of the panel.

taCenter	Center the text in the panel.

taRightJustify	Align text on the right side of the panel.

Note:	If the status bar has a sizing grip, setting the Alignment of the last status panel to taRightJustify truncates the panel’s text.


TStatusPanel.Bevel

TStatusPanel

Determines the style of the panel’s border.

type TStatusPanelBevel = (pbNone, pbLowered, pbRaised);

property Bevel: TStatusPanelBevel;

Description

These are the possible values of Bevel:

Value	Meaning

pbNone	The panel has no bevel and appears flat.

pbLowered	The panel appears recessed.

pbRaised	The panel appears raised.


TStatusPanel.BiDiMode

TStatusPanel

Specifies the bi-directional mode for the status panel.

property BiDiMode: TBiDiMode;

Description

Use BiDiMode to specify the bi-directional mode for the status panel.


TListColumn.DisplayName
TStatusPanel.DisplayName

TStatusPanel	See also

DisplayName is a string that names an individual panel within a collection of panels.

property DisplayName: string

Description

Use DisplayName to specify the name of the panel as it should appear in the Panels editor at design time. If the Text property is set, the value of DisplayName is the same as Text. Otherwise, DisplayName is the name of the list column class.


TStatusPanel.ParentBiDiMode

TStatusPanel

Specifies whether the status panel uses its parent’s bi-directional mode.

property ParentBiDiMode: Boolean;

Description

Use BiDiMode to specify whether the status panel uses its parent’s bi-directional mode.


TStatusPanel.Style

TStatusPanel	See also

Determines how the status panel’s text is displayed.

type TStatusPanelStyle = (psText, psOwnerDraw);

property Style: TStatusPanelStyle;

Description

If Style is set to psText (the default), the string contained in the Text property is displayed in the status panel, using the alignment specified by Alignment. The font is determined by the status bar’s Font property.

If Style is set to psOwnerDraw, the content displayed in the status panel is drawn at runtime on the status bar’s canvas by code in an OnDrawPanel event handler.


TStatusPanel.Text

TStatusPanel 	Example

Specifies the text appearing in the status panel.

property Text: string;

Description

The Text property contains a string that appears in the status panel if Style is set to psText.


TStatusPanel.Width

TStatusPanel

Specifies the width of the status panel.

property Width: Integer;

Description

The Width property determines the horizontal size of the status panel, in pixels.


TStatusPanel methods

TStatusPanel	Alphabetically

In TStatusPanel

Assign

Create

GetDisplayName

ParentBiDiModeChanged

UseRightToLeftAlignment

UseRightToLeftReading

Derived from TCollectionItem

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TStatusPanel methods

TStatusPanel	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetDisplayName

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ParentBiDiModeChanged

SafeCallException

UseRightToLeftAlignment

UseRightToLeftReading


TStatusPanel.Assign

TStatusPanel	See also

Copies the contents of the source status panel to a new status panel.

procedure Assign(Source: TPersistent); override;

Description

Assign copies the values of Alignment, Bevel, Style, Text, and Width from the source status panel.


TStatusPanel.Create

TStatusPanel	See also

Creates and initializes a status panel.

constructor Create(Collection: TCollection); override;

Description

Create takes a TStatusPanels instance as its argument.


TStatusPanel.GetDisplayName

TStatusPanel

Returns the display name of the panel.

function GetDisplayName: string override;

Description

Use GetDisplayName to return the display name of the panel.

If Text is set, GetDisplayName overrides the inherited method to return Text; Otherwise, GetDisplayName returns the result of a call to the inherited GetDisplayName method.


TStatusPanel.ParentBiDiModeChanged

TStatusPanel

Synchronizes the status panel’s BiDiMode with its parent’s BiDiMode..

procedure ParentBiDiModeChanged;

Description

Use ParentBiDiModeChanged to synchronize the status panel’s BiDiMode with its parent’s BiDiMode.


TStatusPanel.UseRightToLeftAlignment

TStatusPanel

Specifies whether the control’s alignment is in a right-to-left mode.

function UseRightToLeftAlignment: Boolean;

Description

Call UseRightToLeftAlignment to determine whether the control’s alignment is in a right-to-left mode. This information can be used when painting the control, or when responding to mouse events.

UseRightToLeft alignment returns True if SysLocale.MiddleEast is True and BiDiMode = bdRightToLeft.


TStatusPanel.UseRightToLeftReading

TStatusPanel

Specifies whether the control is using a right-to-left reading order.

function UseRightToLeftReading: Boolean;

Description

Call UseRightToLeftReading to determine which style flags to set for the control when it is created and which flags to set for drawing text (for example, when calling ExTextOut or DrawText).

UseRightToLeftReading returns True if SysLocale.MiddleEast = True and BiDiMode <> bdLeftToRight.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem


TStatusPanels

Hierarchy	Properties	Methods	See also

TStatusPanels is a container for TStatusPanel objects.

Unit

comctrls

Description

Each TStatusPanels holds a collection of TStatusPanel objects in a TStatusBar. TStatusPanels maintains an index of the status panels in its Items array. The Count property contains the number of status panels in the collection. At design time, use the status bar’s Panels editor to add, remove, or modify status panels.


TStatusPanels properties

TStatusPanels	Alphabetically	Legend

In TStatusPanels

Items

Derived from TCollection

Count

ItemClass


TStatusPanels properties

TStatusPanels	By object	Legend

Count

ItemClass

Items


TStatusPanels.Items

TStatusPanels	See also	Example

Lists the status panels in the collection.

property Items[Index: Integer]: TStatusPanel; default;

Description

The value of the Index parameter corresponds to the Index property of TStatusPanel. It represents the position of the status panel in the status bar.


TStatusPanels methods

TStatusPanels	Alphabetically

In TStatusPanels

Add

Create

Derived from TCollection

Assign

BeginUpdate

Clear

Delete

Destroy

EndUpdate

FindItemID

GetNamePath

Insert

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TStatusPanels methods

TStatusPanels	By object

Add

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

FindItemID

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TStatusPanels.Add

TStatusPanels	See also 	Example

Creates a new TStatusPanel instance and adds it to the Items array.

function Add: TStatusPanel;

Description

Add returns the new status panel. At design time, use the Panels editor to add panels to the status bar.


TStatusPanels.Create

TStatusPanels	See also

Creates and initializes a TStatusPanels object.

constructor Create(StatusBar: TStatusBar);

Description

Do not call Create directly. Instances of TStatusBar create the TStatusPanels object from their own constructors.

The Create method takes, as a parameter, the TStatusBar instance that uses TStatusPanels to manage its panels.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


 TStatusBar

Hierarchy	Properties	Methods	Events	See also

TStatusBar represents a Windows status bar.

Unit

comctrls

Description

The TStatusBar component is a row of panels, usually aligned at the bottom of the form, that display information about the application as it runs. Each panel is represented by a TStatusPanel object listed in the Panels property. The SimplePanel property can be used to toggle the status bar at runtime between a single-panel and multiple-panel display.


TStatusBar properties

TStatusBar	Alphabetically	Legend

In TStatusBar

Canvas

AutoHint

UseSystemFont

Panels

SimplePanel

SimpleText

SizeGrip

Derived from TWinControl

BorderWidth

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TStatusBar properties

TStatusBar	By object	Legend

Action

Align

Anchors

AutoHint

BiDiMode

BorderWidth

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Panels

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ShowHint

Showing

SimplePanel

SimpleText

SizeGrip

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

UseSystemFont

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TStatusBar.AutoHint

TStatusBar	Properties

Specifies whether the status bar’s text is set automatically to the current hint.

property AutoHint: Boolean;

Description

Use AutoHint to specify whether the status bar’s text is set automatically to the current hint.


TStatusBar.Canvas

TStatusBar	See also 	Example

Provides runtime access to the status bar’s drawing surface.

property Canvas: TCanvas;

Description

The read-only Canvas property provides access to the status bar’s drawing surface that you can use when implementing a handler for the OnDrawPanel event.


TStatusBar.Panels

TStatusBar	See also 	Example

Lists the panels (TStatusPanel) in the status bar.

property Panels: TStatusPanels;

Description

The Panels property holds a TStatusPanels—that is, a collection of TStatusPanel objects. At design time, you can add, remove, or modify panels with the Panels editor. To open the Panels editor, select the Panels property in the Object Inspector, then double-click in the Value column to the right or click the ellipsis (...) button.


TStatusBar.SimplePanel

TStatusBar	See also	Example

Determines whether the status bar displays a single panel or multiple panels.

property SimplePanel: Boolean;

Description

If SimplePanel is set to True, the status bar consists of a single panel displaying the text in SimpleText. If SimplePanel is set to False, the status bar displays a separate panel for each item in its Panels property. To alter the appearance of the status bar at runtime, change the value of SimplePanel programmatically.


TStatusBar.SimpleText

TStatusBar	See also	Example

Contains the string that is displayed in the status bar when SimplePanel is set to True.

property SimpleText: string;

Description

SimpleText contains a text string to be displayed in the status panel when SimplePanel is True.


TStatusBar.SizeGrip

TStatusBar	See also

Determines whether the status bar is resizable at runtime.

property SizeGrip: Boolean;

Description

If SizeGrip is set to True, the status bar has a triangular grip on the lower right corner. The user can resize the status bar by dragging the grip with the mouse.

A size grip will not be drawn unless the TStatusBar is the child of a TCustomForm with a BorderStyle of bsSizeable or bsSizeToolWin.

If Align is set to alBottom, alRight, or alClient, the sizing grip will not work. If the Alignment property of the last panel in the status bar is set to taRightJustify, the sizing grip will truncate the panel’s text.


TStatusBar.UseSystemFont

TStatusBar	Properties

Specifies whether the status bar uses the system font.

property UseSystemFont: Boolean;

Description

Use UseSystemFont to specify whether the status bar uses the system font.


TStatusBar events

TStatusBar	Alphabetically	Legend

In TStatusBar

OnDrawPanel

OnHint

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock

OnStartDrag


TStatusBar events

TStatusBar	By object	Legend

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnDrawPanel

OnEndDock

OnEndDrag

OnHint

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock

OnStartDrag


TStatusBar.OnDrawPanel

TStatusBar	See also 	Example

Occurs when a status panel needs to be redrawn.

type TDrawPanelEvent = procedure(StatusBar: TStatusBar; Panel: TStatusPanel; const Rect: TRect) of object;

property OnDrawPanel: TDrawPanelEvent;

Description

The OnDrawPanel event occurs when a status panel needs to be redisplayed—for example, when the user resizes the status bar. The Rect parameter gives the (new) dimensions of the status panel. OnDrawPanel occurs only if the status panel’s Style property is set to psOwnerDraw.

TDrawPanelEvent is the type of the OnDrawPanel property.


TStatusBar.OnHint

TStatusBar	Events

Occurs before the status bar’s hint is displayed.

property OnHint: TNotifyEvent;

Description

Write code in the OnHint event handler to customize the hint text.


TStatusBar methods

TStatusBar	Alphabetically

In TStatusBar

Create

Destroy

DoHint

ExecuteAction

FlipChildren

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStatusBar methods

TStatusBar	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DoHint

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TStatusBar.Create

TStatusBar	See also

Creates and initializes a TStatusBar component.

constructor Create(AOwner: TComponent); override;

Description

The Create method creates a status bar along with its canvas and status panels.


TStatusBar.Destroy

TStatusBar	See also

Destroys TStatusBar and frees its memory.

destructor Destroy; override;

Description

The Destroy method destroys the status bar along with its canvas and status panels.


TStatusBar.::DoHint
TStatusBar.DoHint

TStatusBar	Methods

Processes hint actions.

function DoHint: Boolean; virtual;

Description

Override DoHint in a derived class to process hint actions.

DoHint returns whether or not the hint action was processed.

By default, DoHint calls the OnHint event handler and returns True. If no OnHint event handler is assigned, DoHint returns False.


TStatusBar.ExecuteAction

TStatusBar	Methods

Processes actions for the status bar.

function ExecuteAction(Action: TBasicAction): Boolean; override;

Description

Override ExecuteAction in a derived class to specify how actions are processed.

ExecuteAction overrides the inherited method in order to process hint actions.

ExecuteAction calls DoHint. If DoHint returns True and AutoHint is True, ExecuteAction displays the application’s current hint in the first panel of the status bar. Otherwise, ExecuteAction calls the inherited method.


TStatusBar.FlipChildren

TStatusBar	Methods

Flips the panels of the status bar from left to right or from right to left.

procedure FlipChildren(AllLevels: Boolean); override;

Description

FlipChildren overrides the inherited method to specify how the status bar’s panels are flipped.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


 TTabControl

Hierarchy	Properties	Methods	Events	See also	Example

TTabControl is a tab set that has the appearance of notebook dividers.

Unit

comctrls

Description

Use TTabControl to add a control with multiple tab settings to a form. Unlike a page control, TTabControl is not made up of several pages that contain different controls. Instead, TTabControl is a single object. When the current tab changes, the tab control must directly update its contents to reflect the change in an OnChange event handler.

Disabling a TTabControl object disables all tabs because it is one control. To disable individual tabs, use TPageControl and disable the individual TTabSheet controls that represent the pages.


TTabControl properties

TTabControl	Alphabetically	Legend

Derived from TCustomTabControl

Canvas

DisplayRect

HotTrack

Images

MultiLine

MultiSelect

OwnerDraw

RaggedRight

ScrollOpposite

Style

TabHeight

TabIndex

TabPosition

Tabs

TabWidth

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DockSite

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TTabControl properties

TTabControl	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DisplayRect

DockClientCount

DockClients

DockOrientation

DockSite

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

HotTrack

Images

Left

LRDockWidth

MultiLine

MultiSelect

Name

Owner

OwnerDraw

Parent

ParentBiDiMode

ParentFont

ParentShowHint

ParentWindow

PopupMenu

RaggedRight

ScrollOpposite

ShowHint

Showing

Style

TabHeight

TabIndex

TabOrder

TabPosition

Tabs

TabStop

TabWidth

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TTabControl events

TTabControl	Alphabetically	Legend

Derived from TCustomTabControl

OnChange

OnChanging

OnDrawTab

OnGetImageIndex

Derived from TWinControl

OnDockDrop

OnDockOver

OnEnter

OnExit

OnGetSiteInfo

OnUnDock

Derived from TControl

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock

OnStartDrag


TTabControl events

TTabControl	By object	Legend

OnChange

OnChanging

OnContextPopup

OnDockDrop

OnDockOver

OnDragDrop

OnDragOver

OnDrawTab

OnEndDock

OnEndDrag

OnEnter

OnExit

OnGetImageIndex

OnGetSiteInfo

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock

OnStartDrag

OnUnDock


TTabControl methods

TTabControl	Alphabetically

Derived from TCustomTabControl

Create

Destroy

GetHitTestInfoAt

IndexOfTabAt

RowCount

ScrollTabs

TabRect

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTabControl methods

TTabControl	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetHitTestInfoAt

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

IndexOfTabAt

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

RowCount

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

ScrollTabs

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TabRect

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomTabControl


 TTable

Hierarchy	Properties	Methods	Events	See also

TTable encapsulates a database table.

Unit

dbtables

Description

Use TTable to access data in a single database table using the Borland Database Engine (BDE). TTable provides direct access to every record and field in an underlying database table, whether it is from Paradox, dBASE, Access, FoxPro, an ODBC-compliant database, or an SQL database on a remote server, such as InterBase, Oracle, Sybase, MS-SQL Server, Informix, or DB2. A table component can also work with a subset of records within a database table using ranges and filters.

At design time, create, delete, update, or rename the database table connected to a TTable by right-clicking on the TTable and using the pop-up menu.


TTable properties

TTable	Alphabetically	Legend

In TTable

CanModify

DataSource

DefaultIndex

Exclusive

Exists

Handle

IndexDefs

IndexFieldCount

IndexFieldNames

IndexFields

IndexFiles

IndexName

KeyExclusive

KeyFieldCount

MasterFields

MasterSource

ReadOnly

StoreDefs

TableLevel

TableName

TableType

Derived from TDBDataSet

AutoRefresh

Database

DatabaseName

DBHandle

DBLocale

DBSession

SessionName

UpdateMode

Derived from TBDEDataSet

BlockReadSize

CacheBlobs

CachedUpdates

ExpIndex

Filter

Filtered

FilterOptions

KeySize

Locale

RecNo

RecordCount

RecordSize

UpdateObject

UpdateRecordTypes

UpdatesPending

Derived from TDataSet

Active

AggFields

AutoCalcFields

Bof

Bookmark

Constraints

DataSetField

DefaultFields

Designer

Eof

FieldCount

FieldDefList

FieldDefs

FieldList

Fields

FieldValues

Found

Modified

Name

ObjectView

SparseArrays

State

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TTable properties

TTable	By object	Legend

Active

AggFields

AutoCalcFields

AutoRefresh

BlockReadSize

Bof

Bookmark

CacheBlobs

CachedUpdates

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

Database

DatabaseName

DataSetField

DataSource

DBHandle

DBLocale

DBSession

DefaultFields

DefaultIndex

Designer

DesignInfo

Eof

Exclusive

Exists

ExpIndex

FieldCount

FieldDefList

FieldDefs

FieldList

Fields

FieldValues

Filter

Filtered

FilterOptions

Found

Handle

IndexDefs

IndexFieldCount

IndexFieldNames

IndexFields

IndexFiles

IndexName

KeyExclusive

KeyFieldCount

KeySize

Locale

MasterFields

MasterSource

Modified

Name

ObjectView

Owner

ReadOnly

RecNo

RecordCount

RecordSize

SessionName

SparseArrays

State

StoreDefs

TableLevel

TableName

TableType

Tag

UpdateMode

UpdateObject

UpdateRecordTypes

UpdatesPending

VCLComObject


TTable.CanModify

TTable	See also

Indicates whether an application can insert, edit, and delete data in a table.

property CanModify: Boolean;

Description

Check the status of CanModify to determine if an application can modify a dataset in any way. If CanModify is True, the dataset can be modified. If CanModify is False, the table is read-only.

CanModify is set automatically when an application opens a table. If the ReadOnly property of a table component is True, then CanModify is set to False. CanModify can also be False because

Another application currently has exclusive write access to the table.

The table is read-only by database design.

Note:	Even if CanModify is True, it is not a guarantee that a user will be able to insert or update records in a table. Other factors may come in to play, for example, SQL access privileges.


TTable.DataSource

TTable	See also

Provides read-only access to the data source for the master dataset when this table is the detail of a master/detail relationship.

property DataSource: TDataSource;

Description

DataSource is a read-only version of the MasterSource property.


TTable.DefaultIndex

TTable	See also

Specifies if the data in the table should be ordered on a default index when opened.

property DefaultIndex: Boolean;

Description

When this property is set to False, the BDE does not use an ORDER BY clause when opening a table on a SQL server. When DefaultIndex is True, the BDE attempts to order the data based on the primary key or a unique index when opening the table. DefaultIndex defaults to True.


TTable.Exclusive

TTable	See also	Example

Enables an application to gain sole access to a Paradox or dBASE table.

property Exclusive: Boolean;

Description

Use Exclusive to prevent other applications from accessing a Paradox or dBASE table while it is open in this application. Before opening the table, set Exclusive to True. A table must be closed before changing the Exclusive property.

When Exclusive is True, then when the application successfully opens the table, no other application can access it. If the table for which the application has requested exclusive access is already in use by another application, an exception is raised. To handle such exceptions, wrap the code that opens the table in a try..except block.

Do not set Exclusive to True at design time if you also set the Active property to True at design time. In this case an exception is raised because the table is already in use by the IDE.

Note:	An application can attempt to set Exclusive to True for SQL tables, but some SQL servers do not support exclusive table-locking. Others may grant an exclusive read/write lock, but still permit read-only access to other applications. For more information about exclusive locking of database tables for a specific server, see the server’s documentation.


TTable.Exists

TTable	See also	Example

Indicates whether the underlying database table exists.

property Exists: Boolean;

Description

Read Exists at runtime to determine whether a database table exists. If the table does not exist, create a table from the field definitions and index definitions using the CreateTable method.

This property is read-only.


TTable.Handle

TTable	See also

Specifies the Borland Database Engine (BDE) cursor handle for the dataset.

type HDBICur: Longint;

property Handle: HDBICur;

Description

Use Handle only to bypass TTable methods and call directly into the BDE. Many BDE function calls require a cursor handle parameter. Handle is assigned an initial value when a dataset is opened. If used with a BDE call that changes the current record position, call Resync immediately after returning from the BDE call.

Note:	Do not use this property unless an application requires BDE functionality not available through built-in components.


TTable.IndexDefs

TTable	See also	Example

Contains information about the indexes for a table.

property IndexDefs: TIndexDefs;

Description

IndexDefs is a collection of index definitions, each of which describes an available index for the table. Define the index definitions of a table before calling CreateTable or creating a table at design time.

Ordinarily, an application accesses or specifies indexes at runtime through the IndexFieldNames or IndexFields properties.

If IndexDefs is updated or manually edited, the StoreDefs property becomes True.

Note:	The index definitions in IndexDefs may not always reflect the current indexes available for a table. Before examining IndexDefs, call its Update method to refresh the list.


TTable.IndexFieldCount

TTable	See also	Example

Indicates the number of fields that comprise the current key.

property IndexFieldCount: Integer;

Description

Examine IndexFieldCount to determine the number of fields that comprise the current index. For indexes based on a single column, IndexFieldCount returns 1. For multi-column indexes, IndexFieldCount indicates the number of fields upon which the index is based.


TTable.IndexFieldNames

TTable	See also

Lists the columns to use as an index for a table.

property IndexFieldNames: String;

Description

Use IndexFieldNames as an alternative method of specifying the index to use for a table. In IndexFieldNames, specify the name of each column to use as an index for a table. Ordering of column names is significant. Separate names with semicolon.

For Paradox and dBASE any column names specified in IndexFieldNames must already be indexed. For SQL-based tables, the specified columns need not be indexed.

Note:	The IndexFieldNames and IndexName properties are mutually exclusive. Setting one clears the other.


TTable.IndexFields

TTable	See also	Example

Lists the fields of the current index.

property IndexFields: [Index: Integer]: TField;

Description

IndexFields is a zero-based array of field objects, each of which corresponds to a field in the current index. Index is an ordinal value indicating the position of a field in the index. The first field in the index is IndexFields[0], the second is IndexFields[1], and so on.

Note:	Do not set IndexFields directly. Instead use the IndexFieldNames property to order datasets on the fly at runtime.


TTable.IndexFiles

TTable	See also

Specifies one or more dBASE index file to use for a dBASE table that uses non-production indexes.

property IndexFiles: TStrings;

Description

Use IndexFiles to specify dBASE index files to make available for the table that uses non-production indexes. A dBASE index file can contain multiple indexes. Each index in an index file becomes available as a selection for the IndexName property, which specifies the actual index to use at any given time.

When index files are added to the list of available indexes, the table component opens them. Insertions and modifications made to the table are maintained in the index files. When files are removed from the list, the table component closes them, and they are no longer maintained.

Note:	At design time, use the Object Inspector to add or remove index file names for the IndexFiles property. At runtime, set IndexFiles to a string of semicolon-delimited file names to specify multiple index files.


TTable.IndexName

TTable	See also	Example

Identifies a secondary index for the table.

property IndexName: String;

Description

Use IndexName to specify an alternative index for a table. If IndexName is empty, a table’s sort order is based on its default index, or, for dBASE tables, on its physical record order.

If IndexName contains a valid index name, then that index determines the sort order of records. For dBASE tables, an index name supplied to the IndexName property must either reside in the table's master index file, or in another index file already specified in the IndexFiles property.

Note:	IndexFieldNames and IndexName are mutually exclusive. Setting one clears the other.


TTable.KeyExclusive

TTable	See also	Example

Specifies how the upper and lower boundaries for a range should be interpreted.

property KeyExclusive: Boolean;

Description

Use KeyExclusive to specify whether a range includes or excludes the records that match the starting and ending values of the range. By default, KeyExclusive is False meaning that matching values are included.

To restrict a range to those records that are greater than the specified starting value and less than the specified ending value, set KeyExclusive to True.


TTable.KeyFieldCount

TTable	See also

Specifies the number of fields to use when conducting a partial key search on a multi-field key.

property KeyFieldCount: Integer;

Description

Use KeyFieldCount to limit a search based on a multi-field key to a consecutive sub-set of those fields. For example, if the primary key for a dataset consists of three-fields, a partial-key search can be conducted using only the first field in the key by setting KeyFieldCount to 1. If KeyFieldCount is 0, the dataset searches on all fields in the key.

Note:	Searches are only conducted based on consecutive key fields beginning with the first field in the key. For example if a key consists of three fields, an application can set KeyFieldCount to 1 to search on the first field, 2 to search on the first and second fields, or 3 to search on all fields. By default KeyFieldCount is initially set to include all fields in a search.


TTable.MasterFields

TTable	See also	Example

Specifies one or more fields in a master table to link with corresponding fields in this table in order to establish a master-detail relationship between the tables.

property MasterFields: String;

Description

Use MasterFields after setting the MasterSource property to specify the names of one or more fields to use in establishing a detail-master relationship between this table and the one specified in MasterSource.

MasterFields is a string containing one or more field names in the master table. Separate field names with semicolons.

Each time the current record in the master table changes, the new values in those fields are used to select corresponding records in this table for display.

Note:	At design time, use the Field Link designer to establish the master-detail relationship between two tables.


TTable.MasterSource

TTable	See also	Example

Specifies the name of the data source for a dataset to use as a master table in establishing a detail-master relationship between this table and another one.

property MasterSource: TDataSource;

Description

Use MasterSource to specify the name of the data source component whose DataSet property identifies a dataset to use as a master table in establishing a detail-master relationship between this table and another one.

Note:	At design time choose an available data source from the MasterSource property’s drop-down list in the Object Inspector.

After setting the MasterSource property, specify which fields to use in the master table by setting the MasterFields property. At runtime each time the current record in the master table changes, the new values in those fields are used to select corresponding records in this table for display.

Note:	At design time, use the Field Link designer to establish the master-detail relationship between two tables.


TTable.ReadOnly

TTable	See also

Specifies whether a table is read-only for this application.

property ReadOnly: Boolean;

Description

Use the ReadOnly property to prevent users from updating, inserting, or deleting data in the table. By default, ReadOnly is False, meaning users can potentially alter a table’s data.

Note:	Even if ReadOnly is False, users may not be able to modify or add data to a table. Other factors, such as insufficient SQL privileges for the application or its current user may prevent successful alterations.

To guarantee that users cannot modify or add data to a table,

1	Set the Active property to False.

2	Set ReadOnly to True.

When ReadOnly is True, the table’s CanModify property is False.


TTable.StoreDefs

TTable	See also

Indicates whether the table's field and index definitions persist with the data module or form.

property StoreDefs: Boolean;

Description

If StoreDefs is True, the table's index and field definitions are stored with the data module or form. Setting StoreDefs to True makes the CreateTable method into a one-step procedure that creates fields, indexes, and validity checks at runtime.

StoreDefs is False by default. It becomes True whenever FieldDefs or IndexDefs is updated or edited manually; to prevent edited (or imported) definitions from being stored, reset StoreDefs to False.


TTable.TableLevel

TTable	See also

Specifies the Borland Database Engine (BDE) driver-dependent table level.

property TableLevel: Integer;

Description

Use TableLevel when creating a table to specify that the table associated with this dataset requires a specific level of BDE driver. If TableLevel is 0, the default, this property is ignored.

For more information about BDE driver table level specification, see the online BDE help file, BDE32.HLP.


TTable.TableName

TTable	See also	Example

Indicates the name of the database table that this component encapsulates.

property TableName: TFileName;

Description

Use TableName to specify the name of the database table this component encapsulates. To set TableName to a meaningful value, the DatabaseName property should already be set. If DatabaseName is set at design time, then select a valid table name from the TableName drop-down list in the Object Inspector.

Note:	To set TableName, the Active property must be False.


TTable.TableType

TTable	See also	Example

Indicates the database table structure for the table that this component represents.

type TTableType = (ttDefault, ttParadox, ttDBase, ttASCII, ttFoxPro);

property TableType: TTableType;

Description

Use TableType to specify the database table structure for a dBASE, Paradox, FoxPro or ASCII table. TableType does not apply to tables for remote SQL servers. TableType can be set to any of the following values:

Value	Meaning

ttDefault	(Default) Determine table type based on file extension for the table.

ttParadox	Table is a Paradox table.

ttDBase	Table is a dBASE table.

ttFoxPro	Table is a FoxPro table.

ttASCII	Table is a text file with comma-delimited, quoted strings for each field

If TableType is set to ttDefault, the table's file-name extension determines the table type:

Extension	Meaning

DB or none	Paradox table

DBF	dBASE table

TXT	ASCII table

If TableType is ttParadox, ttDBase, ttFoxPro or ttASCII, the table type is assumed to be of the type specified, regardless of the table’s file name extension.


TTable events

TTable	Alphabetically	Legend

Derived from TBDEDataSet

OnUpdateError

OnUpdateRecord

Derived from TDataSet

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TTable events

TTable	By object	Legend

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

AfterRefresh

AfterScroll

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

BeforeRefresh

BeforeScroll

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnUpdateError

OnUpdateRecord


TTable methods

TTable	Alphabetically

In TTable

AddIndex

ApplyRange

BatchMove

CancelRange

CloseIndexFile

Create

CreateTable

DeleteIndex

DeleteTable

Destroy

EditKey

EditRangeEnd

EditRangeStart

EmptyTable

FindKey

FindNearest

GetDetailLinkFields

GetIndexNames

GotoCurrent

GotoKey

GotoNearest

LockTable

OpenIndexFile

RenameTable

SetKey

SetRange

SetRangeEnd

SetRangeStart

UnlockTable

Derived from TDBDataSet

CheckOpen

CloseDatabase

OpenDatabase

Derived from TBDEDataSet

ApplyUpdates

BookmarkValid

Cancel

CancelUpdates

CommitUpdates

CompareBookmarks

ConstraintCallBack

ConstraintsDisabled

CreateBlobStream

DisableConstraints

EnableConstraints

FetchAll

FlushBuffers

GetBlobFieldData

GetCurrentRecord

GetFieldData

GetIndexInfo

IsSequenced

Locate

Lookup

Post

RevertRecord

Translate

UpdateStatus

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

CheckBrowseMode

ClearFields

Close

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetDetailDataSets

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsEmpty

IsLinkedTo

Last

MoveBy

Next

Open

Prior

Refresh

Resync

SetFields

UpdateCursorPos

UpdateRecord

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTable methods

TTable	By object

ActiveBuffer

AddIndex

AfterConstruction

Append

AppendRecord

ApplyRange

ApplyUpdates

Assign

BatchMove

BeforeDestruction

BookmarkValid

Cancel

CancelRange

CancelUpdates

CheckBrowseMode

CheckOpen

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClearFields

Close

CloseDatabase

CloseIndexFile

CommitUpdates

CompareBookmarks

ConstraintCallBack

ConstraintsDisabled

ControlsDisabled

Create

CreateBlobStream

CreateTable

CursorPosChanged

DefaultHandler

Delete

DeleteIndex

DeleteTable

Destroy

DestroyComponents

Destroying

DisableConstraints

DisableControls

Dispatch

Edit

EditKey

EditRangeEnd

EditRangeStart

EmptyTable

EnableConstraints

EnableControls

ExecuteAction

FetchAll

FieldAddress

FieldByName

FindComponent

FindField

FindFirst

FindKey

FindLast

FindNearest

FindNext

FindPrior

First

FlushBuffers

Free

FreeBookmark

FreeInstance

FreeNotification

FreeOnRelease

GetBlobFieldData

GetBookmark

GetCurrentRecord

GetDetailDataSets

GetDetailLinkFields

GetFieldData

GetFieldList

GetFieldNames

GetIndexInfo

GetIndexNames

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GotoBookmark

GotoCurrent

GotoKey

GotoNearest

HasParent

InheritsFrom

InitInstance

Insert

InsertComponent

InsertRecord

InstanceSize

IsEmpty

IsLinkedTo

IsSequenced

Last

Locate

LockTable

Lookup

MethodAddress

MethodName

MoveBy

NewInstance

Next

Open

OpenDatabase

OpenIndexFile

Post

Prior

Refresh

RemoveComponent

RenameTable

Resync

RevertRecord

SafeCallException

SetFields

SetKey

SetRange

SetRangeEnd

SetRangeStart

Translate

UnlockTable

UpdateAction

UpdateCursorPos

UpdateRecord

UpdateStatus


TTable.AddIndex

TTable	See also	Example

Creates a new index for the table.

procedure AddIndex(const Name, Fields: String; Options: TIndexOptions, const DescFields: String='');

Description

Call AddIndex to create a new index for the already-existing table associated with a dataset component. The index created with this procedure is added to the database table underlying the dataset component.

Name is the name of the new index. Name must contain an index name that is valid for the particular database type used (naming rules vary from one database type to another).

Fields is a String value containing the field or fields on which the new index will be based. If more than one field is used, separate the field names in the list with semi-colons.

Options is a set of attributes for the index. The Options parameter may contain any one, multiple, or none of the TIndexOptions constants: ixPrimary, xUnique, ixDescending, ixCaseInsensitive, and ixExpression. Not all database systems will necessarily support all of these options. Even within a particular table type, any given option may only be supported in certain versions of a table type. Consult the documentation for the particular database system used to determine which options are and are not supported. See the topic for the TIndexOptions type for definitions of individual constants and the implications of their use.

DescFields is a string containing a list of field names, separated by semi-colons. The fields specified in DescFields are the fields in the new index for which the ordering will be descending. Fields in the index definition but not in the DescFields list use the default ascending ordering. It is possible that a single index can have fields using both ascending and descending ordering.

Table1.AddIndex('MostPaid', 'CustNo;SaleDate;AmountPaid', [ixCaseInsensitive], 'SaleDate;AmountPaid');

Warning:	Attempting to create an index using options that are not applicable to the table type causes AddIndex to raise an exception.

dBASE tables only support primary indexes and true unique indexes when the table level is 7 or higher (concurrent with Visual dBASE 7). dBASE tables do not support case-insensitive or descending indexes at all. Use the ixExpression constant when the index is based on multiple fields or uses dBASE data manipulation language functions (that is, for expression indexes). Multi-field dBASE indexes cannot be created simply with a list of field names (separated by semi-colons) in the Fields parameter of AddIndex. The ixExpression constant is only applicable to dBASE tables.

Paradox tables support the ixDescending option for secondary indexes if the table level is 7 or higher and ixUnique if the table level is 5 or higher. The ixDescending and ixCaseInsensitive constants are not applicable to primary indexes.

For other table types, see the vendor-supplied documentation for the particular database system for details on what index options are applicable.


TTable.ApplyRange

TTable	See also	Example

Applys a range to the dataset.

procedure ApplyRange;

Description

Call ApplyRange to cause a range established with SetRangeStart and SetRangeEnd, or EditRangeStart and EditRangeEnd, to take effect. When a range is in effect, only those records that fall within the range are available to the application for viewing and editing.


TTable.BatchMove

TTable	See also

Moves records from a dataset into this table.

function BatchMove(ASource: TBDEDataSet; AMode: TBatchMode): Longint;

Description

Call BatchMove to

Copy records from another table into this table.

Update records in this table that occur in another table.

Append records from another table to the end of this table.

Delete records in this table that occur in another table.

ASource is a dataset component containing the records to import or (if deleting) match. The AMode parameter indicates what operation to perform (copy, update, append, or delete). This table is the destination of the batch operation.

BatchMove returns the number of records operated on.


TTable.CancelRange

TTable	See also	Example

Removes any ranges currently in effect for the table.

procedure CancelRange;

Description

Call CancelRange to remove a range currently applied to a table. Canceling a range reenables access to all records in the dataset.


TTable.CloseIndexFile

TTable	See also

Closes a specified dBASE non-production index file.

procedure CloseIndexFile(const IndexFileName: String);

Description

Call CloseIndexFile to shut down a specified dBASE non-production index file. IndexFileName is the name of the file to close, and is either the name of an index file previously opened with a call to OpenIndexFile or previously opened because the file’s name is listed in the IndexFiles property.

Once closed, non-production index files are no longer maintained. Subsequent changes made to the dataset are not reflected in the index.


TTable.Create

TTable	See also

Creates an instance of a table component.

constructor Create(AOwner: TComponent);

Description

Call Create to instantiate a table declared in an application if it was not placed on a form or data module at design time. Create calls its inherited  constructor, creates an empty index definitions list, creates an empty data link, and creates an empty list of index files.


TTable.CreateTable

TTable	See also	Example

Builds a new table using new structure information.

procedure CreateTable;

Description

Call CreateTable at runtime to create a table using this dataset’s current definitions. If the table already exists, CreateTable overwrites the table’s structure and data. To avoid overwriting an existing table, check the Exists property before calling CreateTable.

If the FieldDefs property contains values, these values are used to create field definitions. Otherwise the Fields property is used. One or both of these properties must contain values in order to create a database table.

If the IndexDefs property contain values, these values are used to create indexes on the table.


TTable.DeleteIndex

TTable	See also

Deletes a secondary index for the table.

procedure DeleteIndex(const Name: String);

Description

Call DeleteIndex to remove a secondary index for a table. Name is the name of the index to delete. DeleteIndex cannot remove a primary index.

Note:	To delete an index, an application must first open the table for exclusive access.


TTable.DeleteTable

TTable	See also	Example

Deletes an existing database table.

procedure DeleteTable;

Description

Call DeleteTable to delete an existing database table associated with the table component through its DatabaseName and TableName properties. A table must be closed before it can be deleted.

Warning:	Deleting a table erases any data the table contains and destroys the table’s structure information.


TTable.Destroy

TTable	See also

Destroys the instance of a table.

destructor Destroy;

Description

Do not call Destroy directly. Instead, call Free, which verifies that the table is not nil before calling Destroy. Destroy frees the index files list for the table, frees its data link, frees its index definitions, and then calls its inherited destructor.


TTable.EditKey

TTable	See also	Example

Enables modification of the search key buffer.

procedure EditKey;

Description

Call EditKey to put the dataset in dsSetKey state while preserving the current contents of the current search key buffer. To determine current search keys, you can use the IndexFields property to iterate over the fields used by the current index.

EditKey is especially useful when performing multiple searches where only one or two field values among many change between each search.


TTable.EditRangeEnd

TTable	See also	Example

Enables changing the ending value for an existing range.

procedure EditRangeEnd;

Description

Call EditRangeEnd to change the ending value for an existing range. To specify an end range value, call FieldByName after calling EditRangeEnd. After assigning a new ending value, call ApplyRange to activate the modified range.

Note:	With Paradox or dBASE tables, EditRangeEnd works only on indexed fields. With SQL databases, EditRangeEnd also works with any columns specified in the IndexFieldNames property.


TTable.EditRangeStart

TTable	See also	Example

Enables changing the starting value for an existing range.

procedure EditRangeStart;

Description

Call EditRangeStart to change the starting value for an existing range. To specify a start range value, call FieldByName after calling EditRangeStart. After assigning a new ending value, call ApplyRange to activate the modified range.

Note:	With Paradox or dBASE tables, EditRangeStart works only on indexed fields. With SQL databases, EditRangeStart also works with any columns specified in the IndexFieldNames property.


TTable.EmptyTable

TTable	See also	Example

Deletes all records from the table.

procedure EmptyTable;

Description

The EmptyTable method deletes all records from the database table specified by the DatabaseName and TableName properties.

Note:	Deletion of records can fail if the user lacks sufficient privileges to perform the delete operation.


TTable.FindKey

TTable	See also

Searches for a record containing specified field values.

function FindKey(const KeyValues: array of const): Boolean;

Description

Call FindKey to search for a specific record in a dataset. KeyValues contains a comma-delimited array of field values, called a key. Each value in the key can be a literal, a variable, a null, or nil. If the number of values passed in KeyValues is less than the number of columns in the index used for the search, the missing values are assumed to be null.

For Paradox and dBASE tables, the key must always be an index, which can be specified in the IndexName property. If IndexName is empty, FindKey uses the table’s primary index.

For SQL tables, the key may correspond to a specified index in IndexName, or to a list of field names in the IndexFieldNames property.

If the search is successful, FindKey positions the cursor on the matching record and returns True. Otherwise the cursor is not moved, and FindKey returns False.


TTable.FindNearest

TTable	See also	Example

Moves the cursor to the record that most closely matches a specified set of key values.

procedure FindNearest(const KeyValues: array of const);

Description

Call FindNearest to move the cursor to a specific record in a dataset or to the first record in the dataset that is greater than the values specified in the KeyValues parameter. KeyValues contains a comma-delimited array of field values, called a key. Each value in the key can be a literal, a variable, a null, or nil. If the number of values passed in KeyValues is less than the number of columns in the index used for the search, the missing values are assumed to be null.

For Paradox and dBASE tables, the key must always be an index, which can be specified in the IndexName property. If IndexName is empty, FindNearest uses the table’s primary index.

For SQL tables, the key may correspond to a specified index in IndexName, or to a list of field names in the IndexFieldNames property.

FindNearest positions the cursor either on a record that exactly matches the search criteria, or on the first record whose values are greater than those specified in the search criteria. KeyExclusive affects the boundary conditions of ranges and will affect the record selected by FindNearest.


TTable.GetDetailLinkFields

TTable	See also

Lists the field components that link this dataset as a detail of a master dataset.

procedure GetDetailLinkFields(MasterFields, DetailFields: TList); override;

Description

GetDetailLinkFields fills two lists of TFields that define a master-detail relationship between this table and another (master) dataset. The MasterFields list is filled with fields from the master table whose values must equal the values of the fields in the DetailFields list. The DetailFields list is filled with fields from the calling dataset.


TTable.GetIndexNames

TTable	See also

Retrieves a list of available indexes for a table.

procedure GetIndexNames(List: TStrings);

Description

Call GetIndexNames to retrieve a list of all available indexes for a table. List is a string list object, created and maintained by the application, into which to retrieve the index names.


TTable.GotoCurrent

TTable	See also

Synchronizes the current record for this table with the current record of a specified table component.

procedure GotoCurrent(Table: TTable);

Description

Call GotoCurrent to synchronize the cursor position for this table with the cursor position in another dataset that uses a different data source component, but which is connected to the same underlying database table. Table is the name of the table component whose cursor position to use for synchronizing.

Note:	This procedure works only for table components that have the same DatabaseName and TableName properties. Otherwise, GotoCurrent raises an exception.

GotoCurrent is mainly for use in applications that have two table components that are linked to the same underlying database table through different data source components. It enables an application to ensure that separate views of the data appear to be linked.


TTable.GotoKey

TTable	See also	Example

Moves the cursor to a record specified by the current key.

function GotoKey: Boolean;

Description

Use GotoKey to move to a record specified by key values assigned with previous calls to SetKey or EditKey and actual search values indicated in the Fields property.

If GotoKey finds a matching record, it positions the cursor on the record and returns True. Otherwise the current cursor position remains unchanged, and GotoKey returns False.


TTable.GotoNearest

TTable	See also	Example

Moves the cursor to the record that most closely matches the current key.

procedure GotoNearest;

Description

Call GotoNearest to position the cursor on the record that is either the exact record specified by the current key values in the key buffer, or on the first record whose values exceed those specified.

Note:	KeyExclusive determines which records are considered part of a search range.

Before calling GotoNearest, an application must specify key values by calling SetKey or EditKey to put the dataset is dsSetKey state, and then use FieldByName to populate the key buffer property with search values.


TTable.LockTable

TTable	See also

Locks a Paradox or dBASE table.

procedure LockTable(LockType: TLockType);

Description

Call LockTable to lock a Paradox or dBASE table to prevent other applications from placing a particular type of lock on the table. LockType specifies the lock requested by this application.

Requesting a read lock prevents other applications from reading a table. Requesting a write lock prevents other application from writing to a table.

An application can request both types of lock by calling LockTable twice, once for each lock type.


TTable.OpenIndexFile

TTable	See also

Opens a specified dBASE non-production index file.

procedure OpenIndexFile(const IndexFileName: String);

Description

Call OpenIndexFile to open a specified dBASE non-production index file. IndexFileName is the name of the file to open. OpenIndexFile opens the file and adds its name to the list of index files in the IndexFiles property.

While a non-production index file is open, it is maintained.


TTable.RenameTable

TTable	See also

Renames the Paradox or dBASE table associated with this table component.

procedure RenameTable(const NewTableName: String);

Description

Call RenameTable to give a new name to the Paradox or dBASE table underlying this table component. RenameTable renames the table and any support files (for example, Paradox .DB and .MB files).


TTable.SetKey

TTable	See also	Example

Enables setting of keys and ranges for a dataset prior to a search.

procedure SetKey;

Description

Call SetKey to put the dataset into dsSetKey state and clear the current contents of the key buffer. The FieldByName method can then be used to supply a new set of search values prior to conducting a search.

Note:	To modify an existing key or range, call EditKey.


TTable.SetRange

TTable	See also	Example

Sets the starting and ending values of a range, and applies it.

procedure SetRange(const StartValues, EndValues: array of const);

Description

Call SetRange to specify a range and apply it to the dataset. StartValues indicates the field values that designate the first record in the range.  EndValues indicates the field values that designate the last record in the range.

SetRange combines the functionality of SetRangeStart, SetRangeEnd, and ApplyRange in a single procedure call. SetRange performs the following functions:

1	Puts the dataset into dsSetKey state.

2	Erases any previously specified starting range values and ending range values.

3	Sets the start and end range values.

4	Applies the range to the dataset.

If either StartValues or EndValues has fewer elements than the number of fields in the current index, then the remaining entries are set to NULL.

Note:	With Paradox or dBASE tables, SetRange works only on indexed fields. With SQL databases, SetRange also works with any columns specified in the IndexFieldNames property.


TTable.SetRangeEnd

TTable	See also	Example

Indicates that subsequent assignments to field values specify the end of the range of rows to include in the dataset.

procedure SetRangeEnd;

Description

Call SetRangeEnd to put the dataset into dsSetKey state, erase any previous end range values, and set them to NULL. Subsequent key buffer field assignments can be made using the FieldByName method to set the ending values for a range.

After assigning end-range values to FieldValues, call ApplyRange to activate the modified range.

Note:	With Paradox or dBASE tables, SetRangeEnd works only on indexed fields. With SQL databases, SetRangeEnd also works with any columns specified in the IndexFieldNames property.


TTable.SetRangeStart

TTable	See also	Example

Indicates that subsequent assignments to field values specify the start of the range of rows to include in the dataset.

procedure SetRangeStart;

Description

Call SetRangeStart to put the dataset into dsSetKey state, erase any previous start range values, and set them to NULL. Subsequent field assignments to the FieldValues property indicate the actual set of starting values for a range.

After assigning start-range values to FieldValues, call ApplyRange to activate the modified range.

Note:	With Paradox or dBASE tables, SetRangeStart works only on indexed fields. With SQL databases, SetRangeStart also works with any columns specified in the IndexFieldNames property.


TTable.UnlockTable

TTable	See also

Removes a previously applied lock on a Paradox or dBASE table.

procedure UnlockTable(LockType: TLockType);

Description

Call UnlockTable to remove a lock previously applied to a Paradox or dBASE table. LockType specifies the lock to remove.

Removing a read lock enables other applications to read a table. Removing a write lock enables other application to write to a table.

An application can remove both types of lock by calling UnlockTable twice, once for each lock type.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataSet

TBDEDataSet

TDBDataSet


TTabbedNotebook

Hierarchy	Properties	Methods	Events

TTabbedNotebook contains multiple pages, each with its own set of controls.

Unit

tabnotbk

Description

TTabbedNotebook is provided for backwards compatibility. New applications should use TPageControl instead.


TTabbedNotebook properties

TTabbedNotebook	Alphabetically	Legend

In TTabbedNotebook

ActivePage

PageIndex

Pages

TabFont

TabsPerRow

TopFont

Derived from TCustomTabControl

Canvas

Derived from TWinControl

Brush

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Parent

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TTabbedNotebook properties

TTabbedNotebook	By object	Legend

Action

ActivePage

Align

Anchors

BiDiMode

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

PageIndex

Pages

Parent

ParentShowHint

ParentWindow

PopupMenu

ShowHint

Showing

TabFont

TabOrder

TabsPerRow

TabStop

Tag

TBDockHeight

Top

TopFont

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TTabbedNotebook.ActivePage

TTabbedNotebook	See also

Determines which page displays in the tabbed notebook control.

property ActivePage: string;

Description

The value of ActivePage must be one of the strings contained in the Pages property.

Note:	To indicate the page that appears in the tabbed notebook by index rather than text, use the PageIndex property instead.


TTabbedNotebook.PageIndex

TTabbedNotebook	See also

Determines which page displays in the tabbed notebook component.

property PageIndex: Integer;

Description

Changing the PageIndex value changes the page in the control.

Each string in the Pages property is automatically assigned a PageIndex value when the page is created. The first page receives a value of 0, the second has a value of 1, and so on. If you delete a string from the Pages property, the PageIndex values are reassigned so that the values always begin with 0 and continue to increase without any gaps between values.


TTabbedNotebook.Pages

TTabbedNotebook	See also

Contains the strings that identify the individual pages of the tabbed notebook control.

property Pages: TStrings;

Description

Tabbed notebook controls create a separate page for each string in the Pages property. For example, if Pages contains three strings, First, Second, and Third, the control has three separate pages.  Each string in Pages corresponds to a TTabPage object whose Caption property is the same as the string.

You can change the active page in a tabbed notebook control with either the ActivePage or PageIndex property.


TTabbedNotebook.TabFont

TTabbedNotebook	See also

Determines the font used on the tabs of the tabbed notebook control.

property TabFont: TFont;

Description

Use TabFont to specify the font characteristics used to display the label on the tabs of the notebook.

Note:	The text on the selected tab is boldfaced if the selected font for the TabFont property is not also boldfaced.


TTabbedNotebook.TabsPerRow

TTabbedNotebook	See also

TabsPerRow is obsolete and retained only for backwards compatibility.

property TabsPerRow: Integer;

Description

The TabsPerRow property determines the number of tabs that can appear in a row at the top of the tabbed notebook control. If there are more tabbed pages in the control than can fit in one row, multiple rows are displayed. The number of tabs you specify affects the size of the tabs--the more tabs per row--the smaller the tabs.

TabsPerRow can’t be set to a value smaller than 3.


TTabbedNotebook.TopFont

TTabbedNotebook	See also

Returns the current value of font used on the tabs of the tabbed notebook.

property TopFont: TFont;

Description

TopFont is a read-only property that reports the TabFont value.


TTabbedNotebook events

TTabbedNotebook	Alphabetically	Legend

In TTabbedNotebook

OnChange

OnClick

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnContextPopup


TTabbedNotebook events

TTabbedNotebook	By object	Legend

OnChange

OnClick

OnContextPopup

OnEnter

OnExit


TTabbedNotebook.OnChange

TTabbedNotebook	See also

Occurs when the page of a tabbed notebook changes.

type TPageChangeEvent = procedure(Sender: TObject; NewTab: Integer; var AllowChange: Boolean) of object;

property OnChange: TPageChangeEvent;

Description

Write an OnPage event handler to respond to a page change in a tabbed notebook. The NewTab parameter is the tab that is about to become the selected or current tab. The AllowChange parameter specifies whether the change to a new page is allowed. If AllowChange is set to False, a new page change doesn’t occur.


TTabbedNotebook.OnClick

TTabbedNotebook	See also

Occurs when a tab of a tabbed notebook is selected.

property OnClick: TNotifyEvent;

Description

Write an OnClick event handler to respond when the user selects a tab in the tabbed notebook. Immediately after the OnClick event occurs, the OnChange event occurs.


TTabbedNotebook methods

TTabbedNotebook	Alphabetically

In TTabbedNotebook

Create

Destroy

GetIndexForPage

TabFontChanged

Derived from TCustomTabControl

GetHitTestInfoAt

IndexOfTabAt

RowCount

TabRect

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTabbedNotebook methods

TTabbedNotebook	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetHitTestInfoAt

GetIndexForPage

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

IndexOfTabAt

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

RowCount

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TabFontChanged

TabRect

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TTabbedNotebook.Destroy

TTabbedNotebook	See also

Destroys a tabbed notebook component.

destructor Destroy: override;

Description

Do not call Destroy directly in an application, Instead, use Free method, which checks that the notebook has is not nil before calling Destroy.


TTabbedNotebook.GetIndexForPage

TTabbedNotebook	See also

Returns the PageIndex value of the specified page.

function GetIndexForPage(const PageName: string): Integer;

Description

The PageIndex property value is determined by the page's position in the Pages property array. Specify the name of the page as the value of the PageName parameter. The name you specify must be one of the strings in the Pages property.


TTabbedNotebook.TabFontChanged

TTabbedNotebook	See also

Invalidates the tabs when the TabFont property changes.

procedure TabFontChanged(Sender: TObject);

Description

TabFontChanged is called automatically when the TabFont property changes. It invalidates the notebook so that the tabs are repainted in the new font.


TTabbedNotebook.Create

TTabbedNotebook	See also

Constructs a tabbed notebook component.

constructor Create(AOwner: TComponent); override;

Description

Call CreateTTabbedNotebook indirectly, using the new keyword, to instantiate a tabbed notebook at runtime. Tabbed notebooks added to forms at design time are created automatically.

The AOwner parameter assigns a value to the notebook’s Owner property.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomTabControl


TTabPage

Hierarchy	Properties	Methods	See also

TTabPage implements an individual tab page of a tabbed notebook control.

Unit

tabnotbk

Description

Each instance of this class holds the controls to be displayed when it is the active page of a tabbed notebook. TTabPage objects are associated with the strings in the corresponding tabbed notebook’s Pages property by setting their Caption property.


TTabPage properties

TTabPage	Alphabetically	Legend

Derived from TWinControl

Brush

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TTabPage properties

TTabPage	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentWindow

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TTabPage methods

TTabPage	Alphabetically

In TTabPage

Create

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTabPage methods

TTabPage	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TTabPage.Create

TTabPage

Constructs a page for a tabbed notebook control.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a tab page at runtime. Tab pages added to tabbed notebooks at design time are created automatically.

The AOwner parameter specifies the component (usually the form) that is responsible for freeing the tab page.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


 TTabSet

Hierarchy	Properties	Methods	Events

The TTabSet component presents horizontal tabs users can click to initiate actions.

Unit

tabs

Description

Tab set controls are commonly used to display tabbed pages within a dialog box. TTabSet is provided for backward compatibility. Use TTabControl component in 32-bit Windows applications.

You create a set of tabs for the tab set control when you specify a list of strings as the value of the Tabs property. One tab is created for each string.

To determine which tab is currently selected or to use code to select a tab, use the TabIndex property. To find out which tab is the first visible tab in the tab set control or to make a tab the first visible tab, use the FirstIndex property.


TTabSet properties

TTabSet	Alphabetically	Legend

In TTabSet

AutoScroll

BackgroundColor

DitherBackground

EndMargin

FirstIndex

SelectedColor

StartMargin

Style

TabHeight

TabIndex

Tabs

UnselectedColor

VisibleTabs

Derived from TCustomControl

Canvas

Derived from TWinControl

Brush

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TTabSet properties

TTabSet	By object	Legend

Action

Align

Anchors

AutoScroll

BackgroundColor

BiDiMode

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DitherBackground

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

EndMargin

FirstIndex

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentShowHint

ParentWindow

PopupMenu

SelectedColor

ShowHint

Showing

StartMargin

Style

TabHeight

TabIndex

TabOrder

Tabs

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

UnselectedColor

VCLComObject

Visible

VisibleDockClientCount

VisibleTabs

Width

WindowProc


TTabSet.AutoScroll

TTabSet	See also

Determines if scroll buttons automatically appear in a tab set control if there isn’t room in the control to display all the tabs.

property AutoScroll: Boolean;

Description

If AutoScroll is False, the application can still access tabs that aren’t visible by using the FirstIndex or TabIndex properties at design time or runtime, but the user can’t click on the tabs with the mouse at runtime.


TTabSet.BackgroundColor

TTabSet	See also

Determines the background color of the tab set control.

property BackgroundColor: TColor;

Description

Use BackgroundColor to indicate the color that the tab set control uses to paint the area between the tabs and the border of the control.


TTabSet.DitherBackground

TTabSet	See also

Determines whether the background color set with the BackgroundColor property is dithered.

property DitherBackground: Boolean;

Description

Dithering means the background is lightened by 50%, which is intended to make the tabs easier to see. If DitherBackground is True, the tab set control background is dithered. If it is False, there is no dithering.


TTabSet.EndMargin

TTabSet	See also

Determines how far, in pixels, the rightmost tab appears from the right edge of the tab set control.

property EndMargin: Integer;

Description

EndMargin determines how far in pixels the rightmost tab appears from the right edge of the tab set control. Together with the StartMargin property, EndMargin can play a role in determining how many tabs can fit within the tab set control.

If AutoScroll is True and scroll buttons appear in the tab set control, EndMargin determines how far in pixels the rightmost tab appears from the left edge of the scroll buttons, rather than the edge of the tab set control.


TTabSet.FirstIndex

TTabSet	See also

Specifies the tab that appears in the leftmost visible position in the tab set control.

property FirstIndex: Integer;

Description

Any tabs with a lower value in the FirstIndex property scroll to the left in the tab set control and don’t appear until the user scrolls the tabs.

The default value of FirstIndex is 0 indicating that the tab with an index of 0 is in the leftmost position. For example, if you have three tabs labeled First, Second, and Third with TabIndex values of 0, 1, and 2, respectively, First appears first, by default, because it has an index value of 0. If you want to shift the tabs so the Second or Third tab appears leftmost in the tab set control, change the FirstIndex value to 1 or 2.


TTabSet.SelectedColor

TTabSet	See also

Determines the color of the selected tab in the tab set control.

property SelectedColor: TColor;

Description

SelectedColor determines the color of the selected tab in the tab set control.


TTabSet.StartMargin

TTabSet	See also

Determines how far, in pixels, the first tab appears from the left edge of the tab set control.

property StartMargin: Integer;

Description

Together with the EndMargin property, StartMargin determines how many tabs fit in the tab set control.


TTabSet.Style

TTabSet	See also

Determines whether the tab set is owner-drawn.

type TTabStyle = (tsStandard, tsOwnerDraw);

property Style: TTabStyle;

Description

Use Style to indicate whether the control has owner-drawn tabs. These are the possible values:

Value	Meaning

tsStandard	Each tab has the standard size and look.

tsOwnerDraw	Each tab has the height specified with the TabHeight property and width needed to hold the text or glyph.

Owner-draw tabs can display objects other than strings, such as graphical images. Owner-draw tabs require more programming, however, because the application needs information on how to render the image for each tab in the tab set control.

Each time an item is displayed in an owner-drawn tab, two events occur. The first is the OnMeasureTab event. In the OnMeasureTab event handler, you write the code that calculates the width of the tab needed to hold the text or graphical image. After the OnMeasureTab event, the OnDrawTab event occurs. The code you write for the OnDrawTab event draws the tab and its contents using the width found with the OnMeasureTab event and the height specified as the value of the TabHeight property.

Note:	The TTabStyle type defined in the tabs unit for the Style property differs from the TTabStyle type defined in the comctrls unit. Do not to use the comctrls unit in source files where you are working with the tab control. Doing so can lead to compiler errors because of type mismatches.


TTabSet.TabHeight

TTabSet	See also

Determines the height of the tabs in an owner-drawn tab set control.

property TabHeight: Integer;

Description

If the Style property value is tsStandard, the TabHeight property value is ignored. If the Style property value is tsOwnerDraw, TabHeight is the height of the tabs.


TTabSet.TabIndex

TTabSet	See also

Determines which tab of a tab set control is currently selected.

property TabIndex: Integer;

Description

The value of TabIndex can be from –1 to one less than the number of strings in the Tabs property array (Count – 1). TabIndex is an index to the Tabs array property: A value of 0 indicates the first tab in the tab set control, 1 is the second tab, and so on. If no tabs are selected, TabIndex has a value of –1.

When a value is assigned to TabIndex, the OnClick event for the tab set occurs, followed by the OnChange event, just as if the user had clicked on a new tab.


TTabSet.Tabs

TTabSet	See also

Contains the list of text strings that appear on the tabs.

property Tabs: TStrings;

Description

For each string in the Tabs property, a new tab is created to display the text string. At design time, you enter the text strings you want to appear on the tabs using the String List editor. Double-click the value column of the Tabs property to display the String List editor. You can also change strings in the Tabs property at runtime.


TTabSet.UnselectedColor

TTabSet	See also

Determines the color of the tabs that aren’t currently selected in the tab set control.

property UnselectedColor: TColor;

Description

UnselectedColor determines the color of the tabs that aren’t currently selected in the tab set control.


TTabSet.VisibleTabs

TTabSet	See also

Contains the number of tabs currently visible in the tab set control.

property VisibleTabs: Integer;

Description

Use VisibleTabs to determine how many tabs are visible in the tab set.


TTabSet events

TTabSet	Alphabetically	Legend

In TTabSet

OnChange

OnDrawTab

OnMeasureTab

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TTabSet events

TTabSet	By object	Legend

OnChange

OnClick

OnDragDrop

OnDragOver

OnDrawTab

OnEndDock

OnEndDrag

OnEnter

OnExit

OnMeasureTab

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TTabSet.OnChange

TTabSet

Occurs just before a new tab is selected.

type TTabChangeEvent = procedure(Sender: TObject; NewTab: Integer; var AllowChange: Boolean) of object;

property OnChange: TTabChangeEvent;

Description

OnChange occurs just as the TabIndex value is about to change. To prevent the TabIndex value from changing, set AllowChange to False in the OnChange event handler.

The TTabChangeEvent type points to a method that is called when the selected tab is about to change in a tab set control. The NewTab parameter is the tab that is about to become the selected tab. The AllowChange variable determines whether the change is permitted. If AllowChange is False, the user won’t be able to select the new tab, in effect disabling it.


TTabSet.OnDrawTab

TTabSet	See also

Occurs when a tab in an owner-drawn tab set control needs to redisplay.

type TDrawTabEvent = procedure(Sender: TObject; TabCanvas: TCanvas; R: TRect; Index: Integer; Selected: Boolean) of object;

property OnDrawTab: TDrawTabEvent;

Description

OnDrawTab occurs when a tab redisplays if the Style property value is tsOwnerDraw. For example, it happens when the user selects a tab or scrolls the tabs.

You must write the code in the OnDrawTab event handler to draw the tab.

OnDrawTab occurs just after the OnMeasureTab event, which contains the code to calculate the width of the tab needed. The height of the tab is determined by the value of the TabHeight property of the tab set control. The code you write in the OnDrawTab event handler, therefore, must use the width determined with the OnMeasureTab event to draw the tab.

The TDrawTabEvent type points to a method that handles the drawing of an item in an owner-draw tab. The TabCanvas parameter is the canvas on which the item is drawn, the Index parameter is the position of the tab in the tab set control, R is the area in the tab where the item is to be drawn, and Selected indicates whether the tab is currently selected.

Note:	The TDrawTabEvent type defined in the tabs unit for the OnDrawTab event handler differs from the TDrawTabEvent type defined in the comctrls unit. Do not to use the comctrls unit in source files where you are working with the tab control.


TTabSet.OnMeasureTab

TTabSet	See also

Occurs when an application needs to redisplay a tab in an owner-draw tab set.

type TMeasureTabEvent = procedure(Sender: TObject; Index: Integer; var TabWidth: Integer) of object;

property OnMeasureTab: TMeasureTabEvent;

Description

OnMeasureTab occurs only if the Style property is tsOwnerDraw. In the OwnerMeasureTab event handler, write the code to calculate the width needed to draw the tab. After the OnMeasureTab event occurs, the OnDrawTab event occurs, when the OnDrawTab event handler draws the tab using the width calculated in OnMeasureTab.

The TMeasureTabEvent type points to a method that handles the measuring of a tab in an owner-draw tab set control. Your code is responsible for calculating and returning the tab width, depending on what you have drawn in the tab (if the tab is of Style tsOwnerDraw). The Index parameter identifies the position of the tab in the tab set control and TabWidth is the width of the tab.


TTabSet methods

TTabSet	Alphabetically

In TTabSet

Create

Destroy

ItemAtPos

ItemRect

SelectNext

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTabSet methods

TTabSet	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ItemAtPos

ItemRect

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SelectNext

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TTabSet.Destroy

TTabSet	See also

Frees the memory associated with the TTabSet object.

destructor Destroy; override;

Description

Do not call Destroy directly. Instead, use the Free method, which checks that the tab set is not nil before calling Destroy. Destroy frees the TTabList object that holds the list of tabs.


TTabSet.ItemAtPos

TTabSet	See also

Returns the index of the tab indicated by the coordinates of a point on the control.

function ItemAtPos(Pos: TPoint): Integer;

Description

Call ItemAtPos to identify the tab under the point specified by the Pos parameter. Pos is the point in the control in client coordinates. If the returned index is 0, the tab is the first tab in the tab set, if the index is 1, the tab is the second tab, and so on. ItemAtPos returns –1 if there is no tab at the specified point.


TTabSet.ItemRect

TTabSet	See also

Returns the rectangle that surrounds the item specified in the Item parameter.

function ItemRect(Item: Integer): TRect;

Description

Use ItemRect to obtain the rectangle that surrounds the tab when you are drawing on an owner-draw tab set.


TTabSet.SelectNext

TTabSet	See also

Selects the next tab in a tab set control, scrolling if necessary to bring the selected tab into view.

procedure SelectNext(Direction: Boolean);

Description

The value of the Direction parameters determines if the tab to the left or right is selected. If Direction is True, the tab to the right is selected. If Direction is False, the tab to the left is selected. When the last tab in either direction is selected, calling SelectNext using the same direction wraps around to the beginning of the tab order. For example, if your application has three tabs, First, Second, and Third, and Third is the current tab, calling SelectNext(True) selects First. Likewise, if First is the current tab, SelectNext(False) selects Third.

When SelectNext is called, the OnClick event of the tab set occurs, followed by the OnChange event, just as if the user had clicked on a new tab.


TTabSet.Create

TTabSet	See also

Constructs a tab set control.

constructor Create(AOwner: TComponent); override;

Description

Create sets the initial values of the control, including creating a TTabList object that holds the list of tabs for the control. The AOwner parameter specifies the component (usually a form) that is responsible for freeing the tab set.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TTabSheet

Hierarchy	Properties	Methods	Events	See also

TTabSheet is an individual page in a TPageControl object.

Unit

comctrls

Description

Use TTabSheet to represent a single page in a tabbed page control. Tab sheets are typically referred to as pages. TPageControl maintains an indexed array of its tab sheets in its Pages property. Users can click on a tab to activate the tab sheet.


TTabSheet properties

TTabSheet	Alphabetically	Legend

In TTabSheet

Highlighted

ImageIndex

PageControl

PageIndex

TabIndex

TabVisible

Derived from TWinControl

Brush

BorderWidth

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

Caption

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TTabSheet properties

TTabSheet	By object	Legend

Action

Align

Anchors

BiDiMode

BorderWidth

BoundsRect

Brush

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Highlighted

Hint

HostDockSite

ImageIndex

Left

LRDockWidth

Name

Owner

PageControl

PageIndex

Parent

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ShowHint

Showing

TabIndex

TabOrder

TabStop

TabVisible

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TTabSheet.Highlighted

TTabSheet	See also

Indicates whether the tab sheet appears highlighted.

property Highlighted: Boolean;

Description

Use Highlighted to make a tab sheet stand out visually. When Highlighted is True, the tab sheet is drawn using a highlight color so that it stands out visually from other tab sheets.

Note:	Highlighted is not linked to the active page of the host page control. A page control can have only one active page, but can have multiple highlighted pages.


TTabSheet.ImageIndex

TTabSheet	See also

Specifies an image for the tab.

property ImageIndex: TImageIndex;

Description

Use ImageIndex to get or set the index of an image to be drawn in the tab. This index identifies an image from the Images property of the page control that contains the tab sheet. Specify -1 to prevent an image from being drawn.


TTabSheet.PageControl

TTabSheet	Example

Indicates the page control object that contains the tab sheet.

property PageControl: TPageControl;

Description

Read PageControl to gain access to the page control object that uses the tab sheet. The properties and methods of the PageControl object can be used to locate the selected page, iterate through the other pages in the page control, or change the display properties of the tabs.

Set PageControl to remove the tab sheet from its current page control (if any) and insert it into a new page control.


TTabSheet.PageIndex

TTabSheet	See also	Example

Indicates the index of the tab sheet in the list of tab sheets maintained by the page control.

property PageIndex: Integer;

Description

Use PageIndex to determine where the tab sheet sits in its page control. Each tab sheet in a page control is automatically assigned a PageIndex when it is inserted in the page control. The first tab sheet receives a value of 0, the second has a value of 1, and so on. PageIndex values are reassigned if tab sheets are deleted or moved.

To access a particular tab sheet given its index value, use the indexed Pages property of the TPageControl object.


TTabSheet.TabIndex

TTabSheet	See also

Indicates the position of the tab sheet in the set of visible tabs in a TPageControl object.

property TabIndex: Integer;

Description

Read TabIndex to determine where the user sees the tab sheet. A value of 0 indicates the first visible tab sheet, a value of 1 indicates the second visible tab sheet, and so on. TabIndex is always less than or equal to PageIndex. For example, a tab sheet that has a PageIndex of 3 will have a TabIndex of 2 if one of the previous tab sheets in the page control is not visible.

If a tab sheet's TabVisible property is False, the TabIndex property is -1.


TTabSheet.TabVisible

TTabSheet	See also	Example

Specifies whether the tab of the TTabSheet object appears in its TPageControl.

property TabVisible Boolean;

Description

Use TabVisible to temporarily remove a tab sheet from a page control. When TabVisible is False, the tab does not appear in the page control and its TabIndex property is -1. Setting TabVisible to True allows the user to see the tab of the tab sheet again.


TTabSheet events

TTabSheet	Alphabetically	Legend

In TTabSheet

OnHide

OnShow

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnContextPopup

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDrag


TTabSheet events

TTabSheet	By object	Legend

OnContextPopup

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnHide

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnShow

OnStartDrag


TTabSheet.OnHide

TTabSheet	See also

Occurs when the TabVisible property changes to False.

property OnHide: TNotifyEvent;

Description

Write an OnHide event handler to take specific action when the tab sheet is temporarily removed from its page control.


TTabSheet.OnShow

TTabSheet	See also

Occurs when the TabVisible property changes to True.

property OnShow: TNotifyEvent;

Description

Write an OnShow event handler to take specific action when the tab sheet appears in its page control after being temporarily hidden.


TTabSheet methods

TTabSheet	Alphabetically

In TTabSheet

Create

Destroy

DoHide

DoShow

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTabSheet methods

TTabSheet	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DoHide

DoShow

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TTabSheet.Create

TTabSheet	See also	Example

Creates and initializes an instance of TTabSheet.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a tab sheet at runtime. Tab sheets added to a page control at design time are created automatically.

Create calls the inherited Create method, then sets the initial values for the tab sheet component.

When creating tab sheets at runtime, use the PageControl property to insert them into a page control object.


TTabSheet.Destroy

TTabSheet	See also

Destroys an instance of TTabSheet.

destructor Destroy; override;

Description

Do not call Destroy directly at runtime. Instead, call Free. Free verifies that the tab sheet is not nil and only then calls Destroy. Destroy removes the tab sheet from the page control and then calls the inherited Destroy method.


TTabSheet.DoHide

TTabSheet	See also

Generates an OnHide event.

procedure DoHide; dynamic;

Description

DoHide is called automatically when the TabVisible property changes to True. Override DoHide in a derived class to perform class-specific actions when the tab sheet is temporarily removed from its page control, or to block the OnHide event.


TTabSheet.DoShow

TTabSheet	See also

Generates an OnShow event.

procedure DoShow; dynamic;

Description

DoShow is called automatically when the TabVisible property changes to False. Override DoShow in a derived class to perform class-specific actions when the tab sheet appears in its page control after being temporarily hidden, or to block the OnHide event.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TTextAttributes

Hierarchy	Properties	Methods	See also 	Example

TTextAttributes represents the font characteristics of a section of text in a rich edit control.

Unit

comctrls

Description

TTextAttributes includes a number of properties that describe the font characteristics of some text in a rich text document. TTextAttributes is tailored to allow a descendant of TCustomRichEdit to read and write the default text characteristics (via its DefAttributes property) or the characteristics of the selected text (via its SelAttributes property). The properties of a TTextAttributes object are invalid unless it is owned by a descendant of TCustomRichEdit.

Most of the font characteristics represented by a TTextAttributes object are the same as the properties of a TFont object with the same names. Applications can assign fonts to text attributes and vice versa.


TTextAttributes properties

TTextAttributes	Alphabetically	Legend

In TTextAttributes

CharSet

Color

ConsistentAttributes

Height

Name

Pitch

Protected

Size

Style


TTextAttributes properties

TTextAttributes	By object	Legend

CharSet

Color

ConsistentAttributes

Height

Name

Pitch

Protected

Size

Style


TTextAttributes.CharSet

TTextAttributes	See also

Specifies the character set of the font.

property Charset: TFontCharset;

Description

Set Charset to identify the character set of the font. Each typeface (specified by the Name property) supports one or more character sets. Check the information supplied by the font vendor to determine what values of Charset are valid.


TTextAttributes.Color

TTextAttributes	See also	Example

Indicates the foreground color of the text.

property Color: TColor;

Description

Use color to indicate the color of the actual characters. the background color is a property of the rich edit control that uses the TTextAttributes object, and should be set by the Color property of the rich edit control.


TTextAttributes.ConsistentAttributes

TTextAttributes	See also

Indicates which of the properties of the TTextAttributes object are consistent throughout the text of the current selection in the rich edit object.

type

  TConsistentAttribute = (caBold, caColor, caFace, caItalic, caSize, caStrikeout, caUnderline, caProtected);

  TConsistentAttributes = set of TConsistentAttribute;

property ConsistentAttributes: TConsistentAttributes;

Description

Read the ConsistentAttributes of the SelAttributes property of a rich text object to discover which of the properties of the TTextAttributes are meaningful for the current selection. This information is relevant if you want to then read the text characteristics of the current selection. Setting a property of TTextAttributes will cause that property to become a consistent attribute until the selection changes.

ConsistentAttributes is a set drawn from the following values:

Value	Meaning

caBold	Characters are consistently either bold or not bold throughout the selection.

caColor	The color of character font is consistent throughout the selection.

caFace	The typeface of the character font is consistent throughout the selection.

caItalic	Characters are consistently either italic or not italic throughout the selection.

caSize	The size of the character font is consistent throughout the selection.

caStrikeout	Characters consistently either have the strikeout style or they do not have the strikeout style throughout the selection.

caUnderline	Characters are consistently either underlined or not underlined throughout the selection.

caProtected	Text is consistently either protected or not protected.

Note:	Use ConsistentAttributes with the SelAttributes property of the rich edit control. The ConsistentAttributes of the DefAttributes property of the rich edit control is the empty set, even though all attributes are consistent in the section of text that has the default attributes.


TTextAttributes.Height

TTextAttributes	See also	Example

Specifies the height of the font in pixels.

property Height: Integer;

Description

To specify a font height in pixels, use the Height property. To specify the size of the font in points instead, use the Size property. Users usually specify font size in points within an application, while programmers are often concerned with the actual size of the font in pixels when displaying a font on the screen.

The relationship between the Height and Size properties is expressed by the formula:

Height = Size * ScreenPixelsPerInch / 72

Note:	Unlike the Height property of a TFont object, the Height property of a TTextAttributes object always includes the internal leading that appears at the top of the font.


TTextAttributes.Name

TTextAttributes	See also

Specifies the typeface of the font described by the TTextAttributes object.

type

  TFontName = type string;

property Name: TFontName;

Description

Use Name to specify the typeface of the font. Typefaces are strings of up to 32 characters used by Windows to identify a font. The Name is the identifier for the font that most font selection controls show.


TTextAttributes.Pitch

TTextAttributes	See also

Specifies whether the characters in the font all have the same width.

type TFontPitch = (fpDefault, fpVariable, fpFixed);

property Pitch: TFontPitch;

Description

Each typeface has an associated pitch. The characters in fixed-pitch fonts are all the same width. The characters in variable-pitch fonts differ in width. Fixed pitch fonts are generally used for representing source code, because they allow the indentation to line up properly. Variable pitch fonts are generally used to give text a more natural appearance.

Here are the possible values for Pitch:

Value	Meaning

fpDefault	The font pitch is set to the default value, which depends on the font specified in the Name property.

fpFixed	The font pitch is set to fixed. All characters in the font have the same width.

fpVariable	The font pitch is set to variable. The characters in the font have different widths.

Note:	Setting the Pitch of a fixed-pitch font to fpVariable or a variable-pitch font to fpFixed will cause Windows to find what it considers the best match to all of the font characteristics that have been specified. This might have no effect on the appearance of a font, or might cause Windows to substitute a different font with the appropriate pitch. For example, setting the pitch of MS Serif (a variable-pitch font) to fpFixed causes Courier to be displayed.


TTextAttributes.Protected

TTextAttributes	See also

Indicates whether the text represented by the TTextAttributes object is protected.

property Protected: Boolean;

Description

Protected text can’t be changed by the user. When the user attempts to edit a selection that includes protected text, the rich edit control calls the OnProtectChange event handler. The OnProtectChange event handler can then permit or disallow the editing of the protected text. If there is no OnProtectChange event handler, protected text is read-only.


TTextAttributes.Size

TTextAttributes	See also

Specifies the height of the font in points.

property Size: Integer;

Description

To specify a font height in points, use the Size property. To specify the size of the font in pixels instead, use the Height property. Users usually specify font size in points within an application, while programmers are usually concerned with the actual size of the font in pixels when displaying a font on the screen.

The relationship between the Height and Size properties is expressed by the formula:

Size = Height * 72 / ScreenPixelsPerInch

Note:	Unlike the Size property of a TFont object, the Size property of a TTextAttributes object always omits the internal leading that appears at the top of the font.


TTextAttributes.Style

TTextAttributes	See also	Example

Determines whether the font is normal, italic, underlined, bold, or strikeout.

type

  TFontStyle = (fsBold, fsItalic, fsUnderline, fsStrikeOut);

  TFontStyles = set of TFontStyle;

property Style: TFontStyles;

Description

The Style property is a set drawn from the following values:

Value	Meaning

fsBold	The font is boldfaced.

fsItalic	The font is italicized.

fsUnderline	The font is underlined.

fsStrikeout	The font is displayed with a horizontal line through it.

Because the Style property is a set, it can contain multiple values. For example, a font could be both boldfaced and italicized.


TTextAttributes methods

TTextAttributes	Alphabetically	Legend

In TTextAttributes

Assign

AssignTo

Create

InitFormat

Derived from TPersistent

Destroy

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TTextAttributes methods

TTextAttributes	By object	Legend

AfterConstruction

Assign

AssignTo

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitFormat

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TTextAttributes.Assign

TTextAttributes	See also 	Example

Sets the properties of a TTextAttributes object to match the properties specified in another TTextAttributes object or in a TFont object.

procedure Assign(Source: TPersistent); override;

Description

Use Assign to change all the text attributes at once. Assign can set the font characteristics of the selected text to match the default font characteristics or vice versa. When the Source is a TTextAttributes object, Assign matches only the Color, Name, Style, and Pitch properties. When the Source is a TFont object, Assign matches the Size as well.

Note:	Assign only succeeds at runtime when the Source is a TTextAttributes object, a TFont object, or an object that has implemented an AssignTo method that deals with the TTextAttributes object. Other source objects will raise an EConvertError exception.


TTextAttributes.AssignTo

TTextAttributes	See also

Enables the properties of a TTextAttributes object to be assigned to a TFont object.

procedure AssignTo(Dest: TPersistent); override;

Description

TTextAttributes overrides the inherited AssignTo to enable its font properties to be assigned to a TFont object. Applications should not call AssignTo. It is called when the Assign method of the TFont object is called. AssignTo copies the CharSet, Color, Name, Style, Size, and Pitch properties to the TFont object.


TTextAttributes.Create

TTextAttributes	See also

Creates an instance of TTextAttributes.

type TAttributeType = (atSelected, atDefaultText);

constructor Create(AOwner: TCustomRichEdit; AttributeType: TAttributeType);

Description

Do not call the constructor for TTextAttributes. TTextAttributes objects are created from the constructor of the rich edit control. The rich edit control uses an attribute type of atDefaultText to implement its DefAttributes property, and an attribute type of atSelected to implement its SelAttributes property.


TTextAttributes.InitFormat

TTextAttributes	See also

Initializes a Windows TCharFormat structure.

procedure InitFormat(var Format: TCharFormat);

Description

TTextAttributes uses the TCharFormat structure to communicate with the rich edit control window when it gets and sets properties. InitFormat initializes this structure before any particular properties are read or set. InitFormat is exposed as a protected method so that derived classes can use the TCharFormat structure in the implementation of any other text properties.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent


TThreadList

Hierarchy	Properties	Methods	See also

TThreadList represents a thread-safe list.

Unit

classes

Description

A TThreadList object is a thread-safe list. Each TThreadList maintains a private TList (a list of pointers to objects). You can add or remove items in a TThreadList from multiple threads without explicit locks.

To access the actual TList object managed by the thread list, first lock the list by calling the LockList method.  Unlock the list by calling the Unlock method when done.


TThreadList properties

TThreadList	Alphabetically

In TThreadList

Duplicates


TThreadList properties

TThreadList	By object

Duplicates


TThreadList.Duplicates

TThreadList	See also

Indicates whether the thread list allows duplicate entries.

type TDuplicates = (dupIgnore, dupAccept, dupError);

property Duplicates: TDuplicates;

Description

Set Duplicates to specify what should happen when an attempt is made to add a duplicate item to the list. The value of Duplicates should be one of the following.

Value	Meaning

dupIgnore	Ignore attempts to add duplicate items to the list.

dupError	Raise an EListError exception when an attempt is made to add duplicate items to the list.

dupAccept	Permit duplicate items in the list.

Set Duplicates before adding any strings to the list. Setting Duplicates to dupIgnore or dupError does nothing about duplicate strings that are already in the list.

Note:	Setting duplicates to dupIgnore or dupError can be computationally expensive if the list has many items.


TThreadList methods

TThreadList	Alphabetically

In TThreadList

Add

Clear

Create

Destroy

LockList

Remove

UnlockList

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TThreadList methods

TThreadList	By object

Add

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

LockList

MethodAddress

MethodName

NewInstance

Remove

SafeCallException

UnlockList


TThreadList.Add

TThreadList

Adds an item to the list.

procedure Add(Item: Pointer);

Description

Call Add to insert a new object at the end of the thread-safe list.


TThreadList.Clear

TThreadList	See also

Deletes all items from the list.

procedure Clear;

Description

Clear locks the list, calls the Clear method in TList, then unlocks the list.


TThreadList.Create

TThreadListSee also

Creates and initializes a TThreadList instance.

constructor Create;

Description

The Create method generates a TThreadList object.


TThreadList.Destroy

TThreadList	See also

Destroys the TThreadList and frees its memory.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the thread list is not nil, and only then calls Destroy.


TThreadList.LockList

TThreadList	See also 	Example

Locks the thread-safe list and returns a TList object.

function  LockList: TList;

Description

LockList calls the Windows EnterCriticalSection function to lock the thread-safe list. It then returns the TList object that contains the list.


TThreadList.Remove

TThreadList	See also

Removes an item from the list.

procedure Remove(Item: Pointer);

Description

Call Remove to remove a specific item from the list without having to determine its index. Remove locks the list, calls the Remove method in TList, then unlocks the list.


TThreadList.UnlockList

TThreadList	See also 	Example

Unlocks the thread-safe list.

procedure UnlockList;

Description

UnlockList calls the Windows LeaveCriticalSection function. Use UnlockList after LockList to relock the list.


Hierarchy

TObject


TThread

Hierarchy	Properties	Methods	Events	See also	Example

TThread is an abstract class that enables creation of separate threads of execution in an application.

Unit

classes

Description

Create a descendant of TThread to represent an execution thread in a multi-threaded application.  Each new instance of a TThread descendant is a new thread of execution. Multiple instances of a TThread derived class make a Delphi application multi-threaded.

When an application is run, it is loaded into memory ready for execution. At this point it becomes a process containing one or more threads that contain the data, code and other system resources for the program. A thread executes one part of an application and is allocated CPU time by the operating system. All threads of a process share the same address space and can access the process’s global variables.

Use threads to improve application performance by

Managing input from several communication devices.

Distinguishing among tasks of varying priority.  For example, a high priority thread handles time critical tasks, and a low priority thread performs other tasks.

Following are issues and recommendations to be aware of when using threads:

Keeping track of too many threads consumes CPU time; the recommended limit is 16 active threads per process on single processor systems.

When multiple threads update the same resources, they must be synchronized to avoid conflicts.

Most methods that access a VCL object and update a form must only be called from within the main VCL thread or use a synchronization object such as TMultiReadExclusiveWriteSynchronizer.

To create and use a new thread object:

Choose File | New | Thread Object to create a new unit that contains an object derived from the TThread class.

Define the thread object’s Execute method by inserting the code that should execute when the thread is executed.

Note:	See the Threads demo for multi-threading program samples.


TThread properties

TThread	Alphabetically	Legend

In TThread

FreeOnTerminate

Handle

Priority

ReturnValue

Suspended

Terminated

ThreadID


TThread properties

TThread	By object	Legend

FreeOnTerminate

Handle

Priority

ReturnValue

Suspended

Terminated

ThreadID


TThread.FreeOnTerminate

TThread	See also

Determines whether the thread object is automatically destroyed when the thread terminates.

property FreeOnTerminate: Boolean;

Description

Set FreeOnTerminate to True if you don’t want to explicitly destroy threads after they finish executing. When FreeOnTerminate is False, the thread object must be explicitly destroyed in application code.


TThread.Handle

TThread	See also

Contains the thread's handle.

type THandle = Integer;

property Handle: THandle;

Description

Use Handle when calling Win32 API functions for thread manipulation.


TThread.Priority

TThread	See also 	Example

Determines the thread's scheduling priority relative to other threads in the process.

type  TThreadPriority = (tpIdle, tpLowest, tpLower, tpNormal, tpHigher, tpHighest, tpTimeCritical);

property Priority: TThreadPriority;

Description

Priority indicates the priority used when scheduling the thread. Adjust the priority higher or lower as needed.

TThreadPriority type defines the possible values for the Priority property of the TThread component, as defined in the following table. Windows schedules CPU cycles to each thread based on a priority scale; the Priority property adjusts a thread's priority higher or lower on the scale.

Values	Meaning

tpIdle	The thread executes only when the system is idle-Windows won't interrupt other threads to execute a thread with tpIdle priority.

tpLowest	The thread's priority is two points below normal.

tpLower	The thread's priority is one point below normal.

tpNormal	The thread has normal priority.

tpHigher	The thread's priority is one point above normal.

tpHighest	The thread's priority is two points above normal.

tpTimeCritical	The thread gets highest priority.

Warning:	Boosting the thread priority of a CPU intensive operation may “starve” the other threads in the application. Only apply priority boosts to threads that spend most of their time waiting for external events.


TThread.ReturnValue

TThread	See also

Specifies the value returned to other waiting threads when the thread finishes executing.

property ReturnValue: Integer

Description

Use ReturnValue to indicate success/failure or numeric result/output of the thread to the application or other threads. The WaitFor method returns the value stored in ReturnValue.


TThread.Suspended

TThread	See also

Indicates whether a thread is suspended.

property Suspended: Boolean;

Description

Set Suspended to True to suspend a thread; set it to False to resume it. Suspended threads don't continue execution until they're resumed.


TThread.Terminated

TThread	See also 	Example

Indicates whether the thread has been asked to terminate.

property Terminated: Boolean;

Description

The thread's Execute method and any methods that Execute calls should check Terminated periodically and exit when it's True.. The Terminate method sets the Terminated property to True.

The Terminate method is the polite way to abort the execution of a thread, but it requires cooperation from the thread’s Execute code. Using terminate is recommended over the TerminateThread Win32 API call.


TThread.ThreadID

TThread	See also

Identifies the thread throughout the system.

type THandle = Integer;

property ThreadID: THandle;

Description

Use ThreadID, during debugging, to identify the thread in the Threads status box. ThreadID is also useful when calling Win32 API functions for manipulating the thread.

Note:	ThreadID is different than the thread’s handle in the Handle property.


TThread events

TThread	Alphabetically

In TThread

OnTerminate


TThread events

TThread	By object

OnTerminate


TThread.OnTerminate

TThread	See also

Occurs after the thread's Execute method has returned and before the thread is destroyed.

property OnTerminate: TNotifyEvent;

Description

Write an OnTerminate event handler to execute code after the thread finishes executing. The OnTerminate event handler is called in the context of the main VCL thread, which means VCL methods and properties can be called freely. The thread object may also be freed within the event handler.


TThread methods

TThread	Alphabetically	Legend

In TThread

Create

Destroy

DoTerminate

Execute

Resume

Suspend

Synchronize

Terminate

WaitFor

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TThread methods

TThread	By object	Legend

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

DoTerminate

Execute

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Resume

SafeCallException

Suspend

Synchronize

Terminate

WaitFor


TThread.Create

TThread	See also 	Example

Creates an instance of a thread object.

constructor Create(CreateSuspended: Boolean);

Description

Call Create to create a thread in an application. If CreateSuspended is False, Execute is called immediately. If CreateSuspended is True, Execute won’t be called until after Resume is called.


TThread.Destroy

TThread	See also

Destroys the thread object and releases the memory allocated to it.

destructor Destroy; override;

Description

Do not call Destroy in an application. Instead, use Free to destroy a thread when FreeOnTerminate is False.

Destroy signals the thread to terminate and then waits for the thread to return before calling the inherited Destroy method.


TThread.DoTerminate

TThread	See also

Generates an OnTerminate event.

procedure DoTerminate; virtual;

Description

DoTerminate calls the OnTerminate event handler, but does not terminate the thread.


TThread.Execute

TThread	See also 	Example

Provides an abstract method that contains the code which executes when the thread is run.

procedure Execute; virtual; abstract;

Description

Override Execute and insert the code that should be executed when the thread runs. Execute is responsible for checking the value of the Terminated property to determine if the thread needs to exit.

A thread executes when Create is called if CreateSuspended set to False, or when Resume is first called after the thread is created if CreateSuspended set to True.

Note:	Do not use the properties and methods of other objects directly in the Execute method of a thread.  Instead, separate the use of other objects into a separate procedure call, and call that procedure by passing it as a parameter to the Synchronize method.


TThread.Resume

TThread	See also 	Example

Restarts the execution of a suspended thread.

procedure Resume;

Description

Call Resume to cause a suspended thread to start running again. Calls to Suspend can be nested; Resume must be called the same number of times Suspend was called before the thread will resume execution.


TThread.Suspend

TThread	See also

Pauses a running thread.

procedure Suspend;

Description

Call Suspend to temporarily halt execution of the thread. To resume execution after a call to Suspend, call Resume. Calls to Suspend can be nested; Resume must be called the same number of times Suspend was called before the thread will resume execution.


TThread.Synchronize

TThread	See also 	Example

Executes a method call within the main VCL thread.

type TThreadMethod = procedure of object;

procedure Synchronize(Method: TThreadMethod);

Description

Synchronize causes the call specified by Method to be executed using the main VCL thread, thereby avoiding multi-thread conflicts. If you are unsure whether a method call is thread-safe, call it from within the main VCL thread by passing it to the Synchronize method.

Execution of the thread is suspended while Method is executing in the main VCL thread.

Note:	You can also protect unsafe methods using critical sections or the multi-read exclusive-write synchronizer.


TThread.Terminate

TThread	See also

Signals the thread to terminate by setting the Terminated property to True.

procedure Terminate;

Description

Terminate sets the thread’s Terminated property to True, signaling that the thread should be terminated as soon as possible. Unlike the Windows API TerminateThread, which forces the thread to terminate immediately, the Terminate method merely requests that the thread terminate. This allows the thread to perform any cleanup before it shuts down.

For Terminate to work, the thread's Execute method and any methods that Execute calls should check Terminated periodically and exit when it's True.


TThread.WaitFor

TThread	See also

Waits for the thread to terminate and then returns the value of the ReturnValue property.

function WaitFor: LongWord;

Description

Call WaitFor to obtain the value of ReturnValue when the thread finishes executing. WaitFor doesn't return until the thread terminates, so the thread must exit either by finishing the Execute method or by exiting when the Terminated property is True.


Scope

Protected

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject


TTimeField

Hierarchy	Properties	Methods	Events	See also

TTimeField represents a time field in a dataset.

Unit

db

Description

TTimeField is a persistent field object that encapsulates the fundamental behavior common to string data. TTimeField descends from the TDateTimeField class, and is useful for managing the value and properties of a time field in a database. TTimeField introduces no new properties, events, or methods. It overrides the DataSize property and Create method to reflect the specifics of a field of type ftTime.

As with all persistent field objects, a TTimeField can be created at design-time using the Fields Editor or at runtime by calling the constructor for the class. Persistent field objects exist solely in the memory space of a Delphi application. Creating a persistent field object only creates an object in the application, and does not result in the creation of a field in a table.

Fields in a table can be accessed without use of persistent field objects. Virtual field objects are created to provide access to a field when the field is referenced through such means as the TDataSet.Fields property or the TDataSet.FieldByName method.

Time fields contain time values.


TTimeField properties

TTimeField	Alphabetically	Legend

In TTimeField

DataSize

Derived from TDateTimeField

AsDateTime

AsFloat

AsString

AsVariant

DisplayFormat

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsInteger

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TTimeField properties

TTimeField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

ValidChars

Value

VCLComObject

Visible


TTimeField.DataSize

TTimeField	See also	Example

Indicates the amount of memory needed to store the value of a time field in its native database format.

property DataSize: Word;

Description

Check DataSize to determine the number of bytes required to store a time field component’s value. Use DataSize to determine the size needed for a buffer when working with the GetData and SetData methods.

For time fields, DataSize is always 4. This is the size of time values in the database tables, not the size of the TDateTime data type used to store and manipulate time values by TTimeField.


TTimeField events

TTimeField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TTimeField events

TTimeField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TTimeField methods

TTimeField	Alphabetically

In TTimeField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTimeField methods

TTimeField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TTimeField.Create

TTimeField	See also

Creates and initializes an instance of TTimeField.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TTimeField. After calling the inherited constructor, Create sets the DataType property to ftTime.After instantiating a TTimeField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TTimeField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TTimeField with a dataset component by setting its DataSet property to the name of the dataset component.

The example below creates a TTimeField object for a field named CheckOutTime accessed through a TQuery named Query1.

var

  T: TimeField;

begin

  Query1.Close;

  T := TTimeField.Create(Self);

  T.FieldName := 'CheckOutTime';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TDateTimeField


 TTimer

Hierarchy	Properties	Methods	Events

TTimer encapsulates the Windows API timer functions.

Unit

extctrls

Description

TTimer is used to simplify calling the Windows API timer functions SetTimer and KillTimer, and to simplify processing the WM_TIMER messages. Use one timer component for each timer in the application.

Timer properties and methods affect the functionality of the timer by providing information for the timer event. This information includes the timer interval, which corresponds to the parameter for the Windows API SetTimer function. The actual execution of the timer occurs through its OnTimer event.

Caution:	Limitations on the total number of timers system-wide are system dependent.


TTimer properties

TTimer	Alphabetically	Legend

In TTimer

Enabled

Interval

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TTimer properties

TTimer	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Enabled

Interval

Name

Owner

Tag

VCLComObject


TTimer.Enabled

TTimer	See also 	Example

Controls whether the timer responds to timer events.

property Enabled: Boolean;

Description

Use Enabled to enable or disable the timer. If Enabled is True, the timer responds normally. If Enabled is False, the timer ignores the OnTimer event. The default is True.


TTimer.Interval

TTimer	See also 	Example

Determines the amount of time, in milliseconds, that passes before the timer component initiates another OnTimer event.

property Interval: Cardinal;

};

Description

Interval determines how frequently the OnTimer event occurs. Each time the specified interval passes, the OnTimer event occurs.

Use Interval to specify any cardinal value as the interval between OnTimer events. The default value is 1000 (one second).

Note:	A 0 value is valid, however the timer won't call an OnTimer event for a value of 0.


TTimer events

TTimer	Alphabetically	Legend

In TTimer

OnTimer


TTimer events

TTimer	By object	Legend

OnTimer


TTimer.OnTimer

TTimer	See also 	Example

Occurs when a specified amount of time, determined by the Interval property, has passed.

property OnTimer: TNotifyEvent;

Description

Use OnTimer to write an event handler to execute an action at regular intervals.

The Interval property of a timer determines how frequently the OnTimer event occurs. Each time the specified interval passes, the OnTimer event occurs.


TTimer methods

TTimer	Alphabetically

In TTimer

Create

Destroy

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTimer methods

TTimer	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

UpdateAction


TTimer.Create

TTimer

Instantiates a timer object.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a timer at runtime. For timers created at design time, Create is called automatically.

Create allocates memory for a timer, and calls the inherited constructor. Then it:

Initializes the Enabled property to True.

Initializes the Interval property to 1000.

Allocates a window handle for the timer passing it the timer window procedure which processes the WM_TIMER messages.


TTimer.Destroy

TTimerSee also

Disposes of a timer object.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, an application should call Free. Free verifies that the timer is not nil before it calls Destroy.

Destroy deactivates the timer by setting Enabled to False. Then it kills the timer by calling the Windows API KillTimer function and deallocates the timer window handle before calling the inherited Destroy.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TToolButtonActionLink

Hierarchy	Properties	Methods	Events

TToolButtonActionLink is an action link designed for tool button control clients.

Unit

ComCtrls

Description

TToolButtonActionLink is designed to link actions to tool button control clients. It overrides methods to determine whether the action and client are linked, and to ensure that action events are appropriate for properties and events of tool button control clients.

TToolButtonActionLink inherits, from its ancestors, support for linking actions with the properties of components, generic controls, and windowed controls. TToolButtonActionLink adds support for linking the following actions to the appropriate behavior for a tool button control:

Checked

ImageIndex

Not all actions correspond to properties and events of the same name. For example, the tool button ‘down’ property is linked to the ‘checked’ action.


TToolButtonActionLink properties

TToolButtonActionLink	Alphabetically

Derived from TBasicActionLink

Action


TToolButtonActionLink properties

TToolButtonActionLink	By object

Action


TToolButtonActionLink events

TToolButtonActionLink	Alphabetically

Derived from TBasicActionLink

OnChange


TToolButtonActionLink events

TToolButtonActionLink	By object

OnChange


TToolButtonActionLink methods

TToolButtonActionLink	Alphabetically	Legend

In TToolButtonActionLink

AssignClient

IsCheckedLinked

IsImageIndexLinked

SetChecked

SetImageIndex

Derived from TBasicActionLink

Create

Destroy

Execute

Derived from TBasicActionLink

Update

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TToolButtonActionLink methods

TToolButtonActionLink	By object	Legend

AfterConstruction

AssignClient

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

Execute

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

IsCheckedLinked

IsImageIndexLinked

MethodAddress

MethodName

NewInstance

SafeCallException

SetChecked

SetImageIndex

Update


TToolButtonActionLink.AssignClient

TToolButtonActionLink	See also

Assigns a client tool button that is linked to the associated action.

procedure AssignClient(AClient: TObject); override;

Description

TToolButtonControlActionLink overrides AssignClient to ensure that the client for the link is a tool button control.


TToolButtonActionLink.IsCheckedLinked

TToolButtonActionLink	See also

Indicates whether the action for the checked state and the client are linked.

function IsCheckedLinked: Boolean; override;

Description

IsCheckedLinked indicates whether the action, for the checked state, is linked to the appropriate client property. IsCheckedLinked returns True if the client requests that the action control this event, False otherwise.


TToolButtonActionLink.IsImageIndexLinked

TToolButtonActionLink	See also

Indicates whether the action for the image index and the client are linked.

function IsImageIndexLinked: Boolean; override;

Description

IsImageIndexLinked indicates whether the action, for the image index, is linked to the appropriate client property. IsImageIndexLinked returns True if the client requests that the action control this event, False otherwise.


TToolButtonActionLink.SetChecked

TToolButtonActionLink	See also

Sets the checked state of a tool button control if the client is linked to the action for this event.

procedure SetChecked(Value: Boolean); override;

Description

SetChecked sets the checked state of a tool button control, and is called only if the client is linked for this event. Value specifies whether the checked state should be set.


TToolButtonActionLink.SetImageIndex

TToolButtonActionLink	See also

Sets the image index of a tool button control if the client is linked to the action for this event.

procedure SetImageIndex(Value: Integer); override;

Description

SetImageIndex sets the image index of a tool button control, and is called only if the client is linked for this event. Value specifies what the image index should be.


Scope

Protected


Hierarchy

TObject

TBasicActionLink

TActionLink

TControlActionLink·


 TToolBar

Hierarchy	Properties	Methods	Events	See also	Example

TToolBar manages tool buttons and other controls, arranging them in rows and automatically adjusting their sizes and positions.

Unit

comctrls

Description

TToolBar is a container for tool buttons (TToolButton). It provides an easy way to arrange and manage visual controls.

All tool buttons on a tool bar maintain a uniform width and height.

Other controls can sit on a tool bar. These controls (which are held in place by invisible tool buttons) maintain a uniform height.

Controls can automatically wrap around and start a new row when they do not fit horizontally on the tool bar.

The Flat property allows the background to show through the tool bar and gives pop-up borders to the tool buttons.

Spaces and dividers (which are in fact specially configured tool buttons) can group controls on the tool bar both visually and functionally.

Typically, the tool buttons correspond to items in an application’s menu and give the user more direct access to the application’s commands.


TToolBar properties

TToolBar	Alphabetically	Legend

In TToolBar

ButtonCount

ButtonHeight

Buttons

ButtonWidth

Canvas

DisabledImages

Flat

HotImages

Images

Indent

List

RowCount

ShowCaptions

Transparent

Wrapable

Derived from TToolWindow

EdgeBorders

EdgeInner

EdgeOuter

Derived from TWinControl

BorderWidth

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DockSite

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

AutoSize

BiDiMode

BoundsRect

Caption

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TToolBar properties

TToolBar	By object	Legend

Action

Align

Anchors

AutoSize

BiDiMode

BorderWidth

BoundsRect

Brush

ButtonCount

ButtonHeight

Buttons

ButtonWidth

Canvas

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DisabledImages

DockClientCount

DockClients

DockOrientation

DockSite

DoubleBuffered

DragCursor

DragKind

DragMode

EdgeBorders

EdgeInner

EdgeOuter

Enabled

Flat

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

Hint

HostDockSite

HotImages

Images

Indent

Left

List

LRDockWidth

Name

Owner

Parent

ParentColor

ParentFont

ParentShowHint

ParentWindow

PopupMenu

RowCount

ShowCaptions

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

Transparent

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc

Wrapable


TToolBar.AutoSize

TToolBar	See also

Changes the tool bar’s height to accommodate the controls in it.

property AutoSize: Boolean;

Description

If AutoSize is set to True, the height of the tool bar adjusts automatically so that the controls fit in it with no vertical margin.


TToolBar.ButtonCount

TToolBar	See also

Indicates the number of buttons in the tool bar.

property ButtonCount: Integer;

Description

ButtonCount gives the number of buttons in the Buttons array.


TToolBar.ButtonHeight

TToolBar	See also

Specifies the height of the controls in the tool bar.

property ButtonHeight: Integer;

Description

ButtonHeight represents the height, in pixels, of the controls in the tool bar.


TToolBar.Buttons

TToolBar	See also

Lists the tool buttons (TToolButton) in the tool bar.

property Buttons[Index: Integer]: TToolButton;

Description

Buttons maintains a list of TToolButton instances. All tool buttons that share a TToolBar parent have the same height and (except for separators and dividers) the same width. Other controls on a tool bar are held in place by invisible separators, which are automatically created and destroyed.

To add tool buttons to the tool bar at design time, select the tool bar, right-click, and choose New Button. To create a space (separator) between one button and the next, select New Separator. To create a divider between buttons, add a button and set its Style property to tbsDivider. Other controls may be added to the tool bar directly from the Component palette.


TToolBar.ButtonWidth

TToolBar	See also

Specifies the width of the tool buttons (TToolButton) in the tool bar.

property ButtonWidth: Integer;

Description

ButtonWidth represents the width, in pixels, of the TToolButton components in the tool bar. It has no effect on tool buttons whose Style property is set to tbsSeparator or tbsDivider.


TToolBar.Canvas

TToolBar	See also

Specifies the drawing surface for the toolbar.

property Canvas: TCanvas;

Description

Use Canvas to draw or paint on the surface of the tool bar in an OnCustomDraw or OnCustomDrawItem event handler. The TCanvas object provides the properties and methods needed for drawing and painting.


TToolBar.DisabledImages

TToolBar	See also

Lists the images that can appear on disabled tool buttons.

property DisabledImages: TCustomImageList;

Description

DisabledImages contains a list of images that can appear on tool buttons when they are disabled. Each tool button’s ImageIndex property determines the specific image displayed on it. If DisabledImages is unassigned, disabled tool buttons display grayed versions of their regular images (specified by the Images property).


TToolBar.Flat

TToolBar	See also

Makes the tool bar transparent and eliminates tool-button borders.

property Flat: Boolean;

Description

If Flat is set to True, the tool bar and its tool buttons are transparent; background colors and graphics show through them. In addition, when Flat is True, tool buttons (TToolButton) on the tool bar have pop-up borders that appear only when the mouse is passed over the button.

Note:	If Flat is set to True, TToolBar requires version 4.70 or later of COMCTL32.DLL at both design time and runtime.


TToolBar.HotImages

TToolBar	See also

Lists the images that can appear on tool buttons when the mouse points to them.

property HotImages: TCustomImageList;

Description

HotImages contains a list of images that can appear on tool buttons when the mouse passes over them at runtime. Each tool button’s ImageIndex property determines the specific image displayed when the mouse points to it. If HotImages is unassigned, tool buttons retain their regular images (specified by the Images property) when pointed to.


TToolBar.Images

TToolBar	See also

Lists the images that can appear on tool buttons.

property Images: TCustomImageList;

Description

Images contains a list of images that can appear on the tool bar’s tool buttons. Each tool button’s ImageIndex property determines the specific image displayed on it. If Images is unassigned, no images are displayed on the tool buttons.


TToolBar.Indent

TToolBar

Creates a margin on the left side of the tool bar.

property Indent: Integer;

Description

Indent specifies, in pixels, the margin that separates the left edge of the tool bar from the controls within it.


TToolBar.List

TToolBar	See also

Aligns captions on the right and images on the left in tool buttons.

property List: Boolean;

Description

When List is False, tool buttons (TToolButton) appear in the tool bar with their images (if any) centered and their captions (if visible) underneath. Setting List to True aligns captions to the right and images to the left.


TToolBar.RowCount

TToolBar	See also

Indicates the number of rows in the tool bar.

property RowCount: Integer;

Description

Reading RowCount returns the number of rows the tool buttons are arranged in.


TToolBar.ShowCaptions

TToolBar	See also	Example

Determines whether text captions are displayed on tool buttons.

property ShowCaptions: Boolean;

Description

If ShowCaptions is set to True, tool buttons appear in the tool bar with their captions displayed. Setting ShowCaptions to True may increase the size of the tool buttons.


TToolBar.Transparent

TToolBar	Properties

Specifies whether the toolbar is transparent.

property Transparent: Boolean;

Description

Use Transparent to get or set whether the toolbar is transparent. Note the Transparent property applies only to the toolbar itself—not its buttons.

To avoid painting problems, set the Transparent property before the toolbar becomes visible.


TToolBar.Wrapable

TToolBar	See also

Enables automatic line-wrap for components in the tool bar.

property Wrapable: Boolean;

Description

If Wrapable is True, components automatically wrap around and form new rows when they do not fit horizontally in the tool bar.


TToolBar events

TToolBar	Alphabetically	Legend

In TToolBar

OnAdvancedCustomDraw

OnAdvancedCustomDrawButton

OnCustomDraw

OnCustomDrawButton

Derived from TWinControl

OnDockDrop

OnDockOver

OnEnter

OnExit

OnGetSiteInfo

OnUnDock

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock

OnStartDrag


TToolBar events

TToolBar	By object	Legend

OnAdvancedCustomDraw

OnAdvancedCustomDrawButton

OnClick

OnContextPopup

OnCustomDraw

OnCustomDrawButton

OnDblClick

OnDockDrop

OnDockOver

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnGetSiteInfo

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDock

OnStartDrag

OnUnDock


TToolBar.OnCustomDraw

TToolBar	See also

Occurs when the toolbar must be painted.

type TTBCustomDrawEvent = procedure(Sender: TToolBar; const ARect: TRect; var DefaultDraw: Boolean) of object;

property OnCustomDraw: TTBCustomDrawEvent;

Description

Write an OnCustomDraw event handler to enhance or replace the automatic painting of the tool bar. Use the tool bar’s Canvas property to render the tool bar’s image. OnCustomDraw is for painting the background of the tool bar. The painting of individual buttons on the tool bar should be handled in an OnCustomDrawButton or OnAdvancedCustomDrawButton event handler.

Sender is the tool bar that needs to be painted.

ARect indicates the dimensions of the tool bar on the canvas.

Leave DefaultDraw as True if the tool bar should continue with the normal painting process. Set DefaultDraw to Ffalse if the OnCustomDraw event handler has completely painted the tool bar.

Note:	OnCustomDraw only occurs prior to painting the tool bar’s background. To respond at other points in the paint process (when the background is erased, or after the default painting of the tool bar’s background), use OnAdvancedCustomDraw instead.


TToolBar.OnCustomDrawButton

TToolBar	See also

Occurs when one of the buttons in the toolbar must be painted.

type TTBCustomDrawBtnEvent = procedure(Sender: TToolBar; Button: TToolButton; State: TCustomDrawState; var DefaultDraw: Boolean) of object;

property OnCustomDrawButton: TTBCustomDrawBtnEvent;

Description

Write an OnCustomDrawButton event handler to enhance or replace the automatic painting of the tool bar’s buttons. Use the tool bar’s Canvas property to render the button’s image. OnCustomDrawButton is for painting individual buttons on the tool bar. The painting of the tool bar itself should be handled in an OnCustomDraw or OnAdvancedCustomDraw event handler.

Sender is the tool bar that contains the button.

Button is the button that needs to be painted. Use its properties to determine what to paint and where the button sits on the tool bar’s canvas.

State provides information that you may want to visually represent when painting the button.

Leave DefaultDraw as True if the button should be painted using the normal process after the event handler exists. Set DefaultDraw to Ffalse if the OnCustomDrawButton event handler has completely painted the tool button.

Note:	OnCustomDrawButton only occurs prior to painting the button. To respond at other points in the process of painting a button (when the background is erased, or after the default painting of the button), use OnAdvancedCustomDrawButton instead.


TToolBar.OnAdvancedCustomDraw

TToolBar	See also

Occurs at discrete stages during the painting of the toolbar’s background.

type TTBAdvancedCustomDrawEvent = procedure(Sender: TToolBar; const ARect: TRect; Stage: TCustomDrawStage; var DefaultDraw: Boolean) of object;

property OnAdvancedCustomDraw: TTBAdvancedCustomDrawEvent;

Description

Write an OnAdvancedCustomDraw event handler to enhance or replace the automatic painting of the tool bar. Use the tool bar’s Canvas property to render the tool bar’s image. OnAdvancedCustomDraw is for painting the background of the tool bar. The painting of individual buttons on the tool bar should be handled in an OnCustomDrawButton or OnAdvancedCustomDrawButton event handler.

Sender is the tool bar that needs to be painted.

ARect indicates the dimensions of the tool bar on the canvas.

Stage indicates the current stage of the drawing process.

Leave DefaultDraw as True if the tool bar should continue with the normal painting process. Set DefaultDraw to Ffalse if the OnAdvancedCustomDraw event handler has completely painted the tool bar. DefaultDraw is only meaningful when Stage is cdPrePaint.

Note:	OnAdvancedCustomDraw occurs at several points during the painting of the tool bar’s background. If you only need to respond immediately prior to the default painting of the tool bar, use OnCustomDraw instead.


TToolBar.OnAdvancedCustomDrawButton

TToolBar	See also

Occurs at discrete stages during the painting of the toolbar’s buttons.

type TTBAdvancedCustomDrawBtnEvent = procedure(Sender: TToolBar; Button: TToolButton; State: TCustomDrawState;; Stage: TCustomDrawStage; var Flags TTBCustomDrawFlags; var DefaultDraw: Boolean) of object;

property OnAdvancedCustomDrawButton: TTBAdvancedCustomDrawBtnEvent;

Description

Write an OnAdvancedCustomDrawButton event handler to enhance or replace the automatic painting of the tool bar’s buttons. Use the tool bar’s Canvas property to render the button’s image. OnAdvancedCustomDrawButton occurs during the erasure and painting of individual buttons on the tool bar. The painting of the tool bar itself should be handled in an OnCustomDraw or OnAdvancedCustomDraw event handler.

Sender is the tool bar that contains the button.

Button is the button that needs to be painted. Use its properties to determine what to paint and where the button sits on the tool bar’s canvas.

State provides information that you may want to visually represent when painting the button.

Stage indicates the current stage of the drawing process.

Flags is used only when Stage is cdPrePaint. It influences how the button is subsequently rendered by the default drawing process. Return the set of flags that indicate how you want the tool button to be drawn.

DefaultDraw is used only when Stage is cdPrePaint. Leave DefaultDraw as True if the button should be painted using the normal process after the event handler exists. Set DefaultDraw to Ffalse if the OnAdvancedCustomDrawButton event handler has completely painted the tool button.

Note:	OnAdvancedCustomDrawButton occurs at several points during the painting of the tool bar’s buttons. If you only need to respond immediately prior to the default painting of each button and are not using the Flags parameter, use OnCustomDrawButton instead.


TToolBar methods

TToolBar	Alphabetically

In TToolBar

CanAutoSize

CancelMenu

ChangeScale

CheckMenuDropdown

ClickButton

Create

Destroy

FindButtonFromAccel

InitMenu

TrackMenu

WrapButtons

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TToolBar methods

TToolBar	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanAutoSize

CancelMenu

CanFocus

ChangeScale

CheckMenuDropdown

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClickButton

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindButtonFromAccel

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InitMenu

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TrackMenu

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

WrapButtons


TToolBar.CanAutoSize

TToolBar	See also

Indicates whether the control can resize itself automatically to accommodate its contents.

function CanAutoSize(var NewWidth, NewHeight: Integer): Boolean; override;

Description

CanAutoSize is called automatically when the AutoSize property is True and an attempt is made to resize the control. It allows the tool bar to implement the AutoSize property before the resize sequence that begins with the OnCanResize and OnConstrainedResize events and ends with the OnResize event.

When CanAutoSize is called, the NewWidth and NewHeight parameters indicate the proposed new dimensions of the control. CanAutoSize adjusts these values so that the tool bar’s size adjusts to its buttons. If the adjustment results in values of NewWidth and NewHeight that differ from the control’s current width and height, CanAutoSize returns True, indicating that the resize sequence should proceed. If, after adjustment, NewWidth and NewHeight equal Width and Height, CanAutoSize returns False, and the resize sequence is aborted.


TToolBar.CancelMenu

TToolBar	See also

Called when the menu associated with a toolbar button is canceled.

procedure CancelMenu; dynamic;

Description

Override CancelMenu in a derived class to handle the canceling of a menu on one of the tool buttons.

By default, CancelMenu clears the highlighting and hot item in the menu.


TToolBar.ChangeScale

TToolBar	See also

Repositions and resizes the tool bar by a specified ratio.

procedure ChangeScale(M, D: Integer); override;

Description

Use ChangeScale to change the scale of the toolbar.

ChangeScale modifies the position and size of a tool bar as well as rescaling the buttons. Thus, ChangeScale modifies the Top, Left, Width, and Height properties.

The M and D parameters define a fraction by which to scale the control. The M parameter is the multiplier and the D parameter is the divisor. For example, to make a control 75% of its original size, specify the value of M as 75, and the value of D as 100 (75/100). Alternately, the same results are achieved by specifying the value of M as 3, and the value of D as 4 (3/4). Both fractions are equal and result in the control being scaled by the same amount, 75%.


TToolBar.CheckMenuDropdown

TToolBar	See also

Displays a toolbar button’s drop-down menu.

function CheckMenuDropdown(Button: TToolButton): Boolean; dynamic;

Description

Call CheckMenuDropdown to manually display a button’s drop-down menu. CheckMenuDropdown is called automatically when the drop-down arrow portion of a toolbutton is clicked or if a toolbutton has an assigned MenuItem property.

Button is the drop-down toolbar button that was clicked.

CheckMenuDropdown has no effect unless the button’s Style property contains tbsDropDown.


TToolBar.ClickButton

TToolBar

Simulates the clicking of a toolbar button.

procedure ClickButton(Button: TToolButton); dynamic;

Description

Call ClickButton to simulate the clicking of a toolbar button.

Button is the toolbar button to click.

ClickButton posts a Windows message that simulates the clicking of the left mouse button on the toolbar button.


TToolBar.Create
TToolBar.CreateTToolBar 	See also	Example

Creates and initializes a TToolBar instance.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create a tool bar at runtime. Tool bars added to forms at design time are created automatically.


TToolBar.Destroy

TToolBar	See also

Destroys the TToolBar instance and frees its memory.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TToolBar reference is not nil, and only then calls Destroy.


TToolBar.FindButtonFromAccel

TToolBar	See also

Returns the toolbar button with the specified accelerator.

function FindButtonFromAccel(Accel: Word): TToolButton;

Description

Use FindButtonFromAccel to determine which toolbar button has the specified accelerator.

If the accelerator is not found, FindButtonFromAccel returns nil.


TToolBar.FlipChildren

TToolBar	See also

Flips the control’s children.

procedure FlipChildren(AllLevels: Boolean); override;

Description

FlipChildren overrides the inherited method in order to prevent the flipping of the toolbar’s children.


TToolBar.InitMenu

TToolBar	See also

Called when the menu associated with a drop-down toolbar button is about to be displayed.

procedure InitMenu(Button: TToolButton); dynamic;

Description

Override InitMenu in a derived class to specify how the toolbar button’s menu is initialized.

By default, InitMenu initializes the highlighting and hot-tracking for the menu.


TToolBar.TrackMenu

TToolBar	See also

Called when the accelerator for a toolbar button is pressed.

function TrackMenu(Button: TToolButton): Boolean; dynamic;

Description

Override TrackMenu in a derived class to perform actions when the accelerator for a toolbar button is pressed.

Button is the toolbar button for which an accelerator was pressed.

TrackMenu calls ClickButton on the specified toolbar button.


TToolBar.WrapButtons

TToolBar

Rearranges the toolbar’s buttons so they fit in the toolbar.

function WrapButtons(var NewWidth, NewHeight: Integer): Boolean;

Description

Call WrapButtons to rearrange the toolbar’s buttons.

NewWidth is the width in which the buttons must fit.

NewHeight is the height in which the buttons must fit.

WrapButtons returns True if the buttons fit; otherwise, WrapButtons returns False.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TToolWindow


TToolButton

Hierarchy	Properties	Methods	Events	See also	Example

TToolButton is a button control in a TToolBar object.

Unit

comctrls

Description

Use TToolButton to implement buttons on a toolbar. While other controls (including TButton and TSpeedButton) can be placed on toolbars, TToolButton utilizes special toolbar features to simplify the configuration of buttons and offers added display options such as pop-up borders and transparency.

To place tool buttons on a toolbar at design time, select the toolbar, right-click, and choose New Button.


TToolButton properties

TToolButton	Alphabetically	Legend

In TToolButton

AllowAllUp

AutoSize

Down

DropDownMenu

Grouped

ImageIndex

Indeterminate

Index

Marked

MenuItem

Style

Wrap

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TToolButton properties

TToolButton	By object	Legend

Action

Align

AllowAllUp

Anchors

AutoSize

BiDiMode

BoundsRect

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlState

ControlStyle

Cursor

DesignInfo

DockOrientation

Down

DragCursor

DragKind

DragMode

DropDownMenu

Enabled

Floating

FloatingDockSiteClass

Grouped

Height

Height

Hint

HostDockSite

ImageIndex

Indeterminate

Index

Left

LRDockWidth

Marked

MenuItem

Name

Owner

Parent

ParentShowHint

PopupMenu

ShowHint

Style

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

Width

Width

WindowProc

Wrap


TToolButton.AllowAllUp

TToolButton	See also

Indicates whether all the tool buttons in a group can be unselected at the same time.

property AllowAllUp: Boolean;

Description

If AllowAllUp is set to True, all of the tool buttons in the group can be unselected. If AllowAllUp is set to False, at least one tool button in the group must be selected at any time. (Determine which tool button is initially selected by setting its Down property to True.)

AllowAllUp is effective only when Grouped is True and Style is set to tbsCheck. Changing the value of AllowAllUp for one button in a group automatically changes the value for all buttons in the group.


TToolButton.AutoSize

TToolButton	Properties

Specifies whether the tool button automatically sizes itself to accommodate its text and image.

property AutoSize: Boolean;

Description

If AutoSize is True, the tool button sizes itself automatically; otherwise, the tool button keeps a fixed size.


TToolButton.Down

TToolButton	See also

Specifies whether the button is selected (down) or unselected (up).

property Down: Boolean;

Description

Read Down to determine whether a tool button is selected. Setting Down to True at design time causes the button to be initially selected.

Tool buttons can remain Down only if Style is tbsCheck.


TToolButton.DropdownMenu

TToolButton	See also

Identifies a pop-up menu associated with the tool button.

property DropdownMenu: TPopupMenu;

Description

Assign a value to DropdownMenu to make a menu appear when the button is pressed. (To display the menu programmatically, call the tool button’s Click method.) If the menu’s AutoPopup property is set to True, the menu appears automatically. If AutoPopup is False, display the menu by calling the menu’s Popup method in the tool button’s OnClick event handler.

When associating a drop-down menu with the tool button, set the Style to tbsDropDown.


TToolButton.Grouped

TToolButton	See also	Example

Aggregates a sequence of adjacent tbsCheck buttons.

property Grouped: Boolean;

Description

When an unbroken sequence of adjacent tool buttons each has its Grouped property set to True and Style set to tbsCheck, then no more than one of the buttons can be selected at the same time. Selecting a grouped button at runtime unselects the other buttons in its group.

To create distinct groups of buttons within a toolbar, separate the groups with any of the following: tool buttons whose Grouped property is False, tool buttons whose Style property is not tbsCheck (tbsSeparator and tbsDivider buttons are useful for this), or controls other than tool buttons.


TToolButton.ImageIndex

TToolButton	See also

Determines which image appears on the tool button.

property ImageIndex: TImageIndex;

Description

The ImageIndex property determines which image—from TToolBar’s Images list—appears on the tool button. If TToolBar.DisabledImages and TToolBar.HotImages are defined, different images appear when the button is disabled and when the mouse pointer passes over the button.

These lists are zero-based; the first image is indexed by 0, the second by 1, and so forth. Since ImageIndex holds only a single integer value, the positions of the selected images must coincide on the different lists. For example, if ImageIndex = 2, the button displays the third image in each list.


TToolButton.Index

TToolButton

Specifies the index of the tool button.

property Index: Integer;

Description

Use Index to get the index of the tool button.


TToolButton.Indeterminate

TToolButton	See also

Indicates that the tool button is neither selected nor unselected.

property Indeterminate: Boolean;

Description

Indeterminate provides a third state for tool buttons that are neither selected nor unselected. Set this property in program code to indicate that a button is inapplicable in a particular context. Buttons with the Indeterminate property set to True appear grayed.

When Indeterminate is set to True, Down is automatically set to False.


TToolButton.Marked

TToolButton	Properties

Specifies whether the button is marked.

property Marked: Boolean;

Description

Use Marked to get or set whether the button is marked. A marked button has a shaded surface.


TToolButton.MenuItem

TToolButton	See also	Example

Specifies the menu item corresponding to the button.

property MenuItem: TMenuItem;

Description

Use MenuItem to get or set the menu item corresponding to the button.

Note: To use the tool button as a menu item, the Style property must be tbsDropDown. If you are using multiple drop-down tool buttons, set the Grouped property to True.


TToolButton.Style

TToolButton	See also	Example

Determines the style of the tool button.

type TToolButtonSyle = (tbsButton, tbsCheck, tbsDropDown, tbsSeparator, tbsDivider);

property Style: TToolButtonStyle;

Description

These are the possible values of Style:

Value	Meaning

tbsButton	The button appears and functions like a normal speed button.

tbsCheck	Clicking the button toggles the Down property. Once selected, the button remains selected until clicked again.

tbsDropDown	The button displays a downward-pointing arrow (suitable for accessing a drop-down menu).

tbsSeparator	The button appears as an empty space on the toolbar (used to separate other controls).

tbsDivider	The button appears as a vertical line on the toolbar (used to separate other controls).


TToolButton.Wrap

TToolButton	See also

Forces a new row after the tool button.

property Wrap: Boolean;

Description

Set Wrap to True to make the tool button the last in its row. Wrap is disabled when TToolBar.Wrapable is True.


TToolButton events

TToolButton	Alphabetically	Legend

Derived from TControl

OnClick

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TToolButton events

TToolButton	By object	Legend

OnClick

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TToolButton methods

TToolButton	Alphabetically

In TToolButton

ActionChange

AssignTo

BeginUpdate

CheckMenuDropdown

Click

Create

GetActionLinkClass

MouseDown

MouseMove

MouseUp

Notification

Paint

RefreshControl

SetToolBar

UpdateControl

ValidateContainer

Derived from TGraphicControl

Destroy

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DefaultHandler

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

Invalidate

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

Repaint

ReplaceDockedControl

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TToolButton methods

TToolButton	By object

ActionChange

AfterConstruction

Assign

AssignTo

BeforeDestruction

BeginDrag

BeginUpdate

BringToFront

CheckMenuDropdown

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Click

ClientToScreen

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetActionLinkClass

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseDown

MouseMove

MouseUp

NewInstance

Notification

Paint

Perform

Refresh

RefreshControl

RemoveComponent

Repaint

ReplaceDockedControl

SafeCallException

ScreenToClient

SendToBack

SetBounds

SetTextBuf

SetToolBar

Show

Update

UpdateAction

UpdateControl

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

ValidateContainer


TToolButton.ActionChange

TToolButton	See also

Called when the action associated with the button changes.

procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;

Description

ActionChange is called automatically when the action object specified by the Action property, or any of its properties, changes. ActionChange updates the control properties that correspond to properties of the associated action. These properties include the Down, ImageIndex, Caption, Enabled, Hint, and Visible properties and the OnClick event handler.

The Sender parameter is the action object that changed. The CheckDefaults parameter indicates whether the control’s properties should all be updated or only those that have not been explicitly changed from their default values. When CheckDefaults is True, only those properties and event handlers that have not been changed from the default values are updated.


TToolButton.AssignTo

TToolButton	See also

Called when a button is used in an assignment.

procedure AssignTo(Dest: TPersistent); override;

Description

The Assign method of the destination object specified by Dest calls AssignTo if it doesn’t know how to copy the methods of a tool button.  AssignTo copies properties if Dest is a TCustomAction descendant.


TToolButton.BeginUpdate

TToolButton	See also

Suspends screen repainting.

procedure BeginUpdate; virtual;

Description

The BeginUpdate method prevents the tool bar that contains the button from adjusting to changes in the buttons size and position until the EndUpdate method is called. Use BeginUpdate to speed processing and avoid flicker while making changes to the tool button’s properties.


TToolButton.CheckMenuDropdown

TToolButton	See also

Displays a button’s drop-down menu.

function CheckMenuDropdown: Boolean; dynamic;

Description

Call CheckMenuDropdown to manually display a button’s pop-up menu. It returns True and displays the menu if the tool button has an associated menu. It returns False if there is no menu to display.


TToolButton.Click

TToolButton	See also

Generates an OnClick event.

procedure Click; override;

Description

Click calls any event handler attached to the OnClick event. Override Click to provide other responses in addition to the inherited event-handler call when the user clicks the control.

A control calls Click whenever it receives a left-button mouse-up message (WM_LBUTTONUP) if that message indicates that the mouse up occurred near the corresponding mouse-down. Many controls call Click in other circumstances, such as when a user types the shortcut key for a button or menu item.


TToolButton.Create

TToolButton 	Example

Creates and initializes a TToolButton instance.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create a TToolButton object at runtime.  Tool buttons added at design time are created automatically.

Create generates a TToolButton and initializes its properties.


TToolButton.EndUpdate

TToolButton	See also

Re-enables screen repainting.

procedure EndUpdate; virtual;

Description

Use EndUpdate to enable the associated tool bar to adjust to changes in the button’s size and position, after this was turned off by the BeginUpdate method. Calls to BeginUpdate and EndUpdate can be nested. The tool bar will not adjust to changes in the tool button until every call to BeginUpdate has been matched to a corresponding call to EndUpdate.


TToolButton.GetActionLinkClass

TToolButton	See also

Returns TToolButtonActionLink.

function GetActionLinkClass: TControlActionLinkClass; override;

Description

GetActionLinkClass returns the appropriate class type for the action link used with a tool button. This class is used internally to create an action link object for the tool button when it has an associated action. Each Action link class is designed to link specific properties and event handlers of the action to its client, based on the types of properties the client supports.

As implemented in TToolButton, GetActionLinkClass returns the TToolButtonActionLink class type, which associates the Down, ImageIndex, ShowHint, Caption, Enabled and Visible properties and the OnClick event handler.


TToolButton.MouseDown

TToolButton	See also

Responds when the user clicks the button with the mouse.

procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);  override;

Description

Do not call MouseDown. It is called automatically when the user clicks the tool button with the mouse. As implemented in TToolButton, MouseDown first toggles the Down property if the button’s style is tbsDropDown and the user clicked the left mouse button. Then it generates an OnMouseDown event.

The Button parameter determines which mouse button the user pressed. Shift indicates which shift keys (Shift, Ctrl, or Alt) were down when the user pressed the mouse button. X and Y are the pixel coordinates of the mouse pointer within the client area of the control.

MouseDown helps ensure that the tool button’s behavior remains unchanged, regardless of the version of ComCtl32.dll that is installed on the users system.


TToolButton.MouseMove

TToolButton	See also

Responds when the user moves the mouse over the tool button.

procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;

Description

Do not call MouseMove. It is called automatically when the user moves the mouse over the tool button or when the tool button has captured the mouse. As implemented in TToolButton, MouseMove ensures that the Down property is False if the button’s style is tbsDropDown and the user moved the mouse off the tool button. Then it generates an OnMouseMove event.

The Shift parameter indicates which keys (Shift, Ctrl, and Alt) were down when the mouse moved. X and Y indicate the new position of the mouse pointer.

MouseDown helps ensure that the tool button’s behavior remains unchanged, regardless of the version of ComCtl32.dll that is installed on the users system.


TToolButton.MouseUp

TToolButton	See also

Responds when the user releases the mouse.

procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;

Description

Do not call MouseUp. It is called automatically when the user releases the mouse. As implemented in TToolButton, MouseUp first generates an OnMouseUp event. Then, if the left mouse button while over the tool button and the button’s style is tbsDropDown, MouseUp sets the Down property to False. Finally, MouseUp generates an OnClick event.

The Button parameter determines which mouse button the user released. Shift indicates which shift keys (Shift, Ctrl, or Alt) were down when the user released the mouse button. X and Y are the pixel coordinates of the mouse pointer within the client area of the control.

MouseUp helps ensure that the tool button’s behavior remains unchanged, regardless of the version of ComCtl32.dll that is installed on the users system.


TToolButton.Notification

TToolButton	See also

Responds to notifications that components are being created or destroyed.

procedure Notification(AComponent: TComponent; Operation: TOperation); override;

Description

Notification allows TToolButton to update its DropDownMenu or MenuItem property when the menu or menu item to which it refers is destroyed.

Override the Notification method to respond to notifications that other components are about to be destroyed or have just been created.


TToolButton.Paint

TToolButton	See also

Renders the image of the tool button.

procedure Paint; override;

Description

Paint draws the edges of the tool button to reflect the value of the Style property. If the tool button is not contained by a tool bar, Paint does nothing.


TToolButton.RefreshControl

TToolButton	See also

Repaints the button if necessary.

procedure RefreshControl; virtual;

Description

Use RefreshControl to repaint the button if necessary. Use RefreshControl rather than the Refresh method to ensure that the tool button honors the BeginUpdate method.

RefreshControl is called when the button is aligned, wrapped, or changed in style.


TToolButton.SetToolBar

TToolButton	See also

Associates the tool button with a tool bar.

procedure SetToolBar(AToolBar: TToolBar);

Description

Call SetToolBar to add the tool button to a tool bar. Specify the tool bar as the AToolBar parameter.

If the tool button is already contained by a tool bar, SetToolBar removes the button from its current tool bar before moving it to the new tool bar.


TToolButton.UpdateControl

TToolButton	See also

Ensures the associated tool bar responds to changes in the tool button.

procedure UpdateControl; virtual;

Description

Tool buttons call UpdateControl after any property changes that could affect the layout of the tool bar that contains the button. UpdateControl informs the tool bar that the button has changed so that it can make any necessary adjustments.


TToolButton.ValidateContainer

TToolButton	See also

Updates the tool button’s width and height when it is inserted into a tool bar.

procedure ValidateContainer(AComponent: TComponent); override;

Description

ValidateContainer is called when the tool button is about to be inserted into the container specified by the AComponent parameter. After calling the ValidateContainer method of TComponent to ensure that the insertion is legal, ValidateContainer checks whether AComponent is a tool bar. If so, it updates the Height and Width properties to reflect the tool bar’s ButtonHeight and ButtonWidth properties.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl


TToolDockForm

Hierarchy	Properties	Methods

A default floating dock site class for tool buttons.

Unit

Toolwin

Description

Assign TToolDockForm to the FloatingDockSiteClass property of tool buttons to get appropriate docking behavior.


TToolDockForm properties

TToolDockForm	Alphabetically	Legend

Derived from TCustomForm

Active

ActiveControl

ActiveOleControl

BorderStyle

Canvas

ClientRect

Designer

DropTarget

Floating

FormState

FormStyle

HelpFile

KeyPreview

Menu

ModalResult

Monitor

OleFormObject

Parent

PixelsPerInch

WindowState

Derived from TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

Brush

ClientOrigin

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

Caption

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TToolDockForm properties

TToolDockForm	By object	Legend

Action

Active

ActiveControl

ActiveOleControl

Align

Anchors

AutoScroll

BiDiMode

BorderStyle

BoundsRect

Brush

Canvas

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

Designer

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DropTarget

Enabled

Floating

FloatingDockSiteClass

Font

FormState

FormStyle

Handle

Height

HelpContext

HelpFile

Hint

HorzScrollBar

HostDockSite

KeyPreview

Left

LRDockWidth

Menu

ModalResult

Monitor

Name

OleFormObject

Owner

Parent

ParentWindow

PixelsPerInch

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

VertScrollBar

Visible

VisibleDockClientCount

Width

WindowProc

WindowState


TToolDockForm methods

TToolDockForm	Alphabetically	Legend

In TToolDockForm

CanResize

Create

CreateParams

DoAddDockClient

Derived from TCustomForm

AfterConstruction

BeforeDestruction

Close

CloseQuery

CreateNew

DefaultHandler

DefocusControl

Destroy

Dock

FocusControl

GetFormImage

Hide

IsShortCut

MouseWheelHandler

Print

Release

SendCancelMode

SetFocus

SetFocusedControl

Show

ShowModal

WantChildKey

Derived from TScrollingWinControl

DisableAutoRange

EnableAutoRange

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetParentComponent

GetTextBuf

GetTextLen

HasParent

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TToolDockForm methods

TToolDockForm	By object	Legend

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

CanResize

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

Close

CloseQuery

ContainsControl

ControlAtPos

Create

CreateNew

CreateParams

CreateParented

CreateParentedControl

DefaultHandler

DefocusControl

Destroy

DestroyComponents

Destroying

DisableAlign

DisableAutoRange

Dispatch

DoAddDockClient

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EnableAutoRange

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

FocusControl

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetFormImage

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

IsShortCut

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Print

Realign

Refresh

Release

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendCancelMode

SendToBack

SetBounds

SetFocus

SetFocusedControl

SetTextBuf

Show

ShowModal

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

WantChildKey


TToolDockForm.CanResize

TToolDockForm	Methods

Specifies whether the control can resize itself.

function CanResize(var NewWidth, NewHeight: Integer): Boolean; override;

Description

NewWidth and NewHeight are the new width and height of the control.

CanResize returns True if the control can resize itself to the new width and height.


TToolDockForm.Create

TToolDockForm	Methods 	See also

Creates an instance of TToolDockForm.

constructor Create(AOwner: TComponent); override;

Description

AOwner is the dock form’s owner.

Create calls the inherited Create method and then sets the BorderWidth property to 1.


TToolDockForm.CreateParams

TToolDockForm	Methods

Initializes the window-creation parameter record when the form window is created.

procedure CreateParams(var Params: TCreateParams); override;

Description

CreateParams calls the inherited CreateParams method, and then adds WS_POPUP to the Style property.


TToolDockForm.DoAddDockClient

TToolDockForm	Methods

Performs actions when a control is docked to the form.

procedure DoAddDockClient(Client: TControl; const ARect: TRect); override;

Description

DoAddDockClient sets the client’s Align property to alNone and its BoundsRect property to ClientRect. Then DoAddDockClient calls the inherited DoAddDockClient method and sets the form’s AutoSize property to True.


Scope

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TScrollingWinControl

TCustomForm

TCustomDockForm


TToolDockObject

Hierarchy	Properties	Methods

Handles drag-and-dock operations for toolbar controls.

Unit

Toolwin

Description

Use TToolDockObject to handle drag-and-dock operations for toolbar controls.


TToolDockObject properties

TToolDockObject	Alphabetically	Legend

Derived from TDragDockObject

Brush

DockRect

DropAlign

DropOnControl

Floating

FrameWidth

Derived from TBaseDragControlObject

Control

Derived from TDragObject

Cancelling

DragHandle

DragPos

DragTarget

DragTargetPos

MouseDeltaX

MouseDeltaY


TToolDockObject properties

TToolDockObject	By object	Legend

Brush

Cancelling

Control

DockRect

DragHandle

DragPos

DragTarget

DragTargetPos

DropAlign

DropOnControl

Floating

FrameWidth

MouseDeltaX

MouseDeltaY


TToolDockObject methods

TToolDockObject	Alphabetically	Legend

In TToolDockObject

AdjustDockRect

DrawDragDockImage

EraseDragDockImage

Derived from TDragDockObject

Assign

Create

Destroy

Derived from TDragObject

GetName

HideDragImage

Instance

ShowDragImage

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TToolDockObject methods

TToolDockObject	By object	Legend

AdjustDockRect

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

DrawDragDockImage

EraseDragDockImage

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetName

HideDragImage

InheritsFrom

InitInstance

Instance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

ShowDragImage


TToolDockObject.AdjustDockRect

TToolDockObject	See also

Adjusts the value of DockRect to reflect the dragged control’s current status.

procedure AdjustDockRect(ARect: TRect); override;

Description

AdjustDockRect is called automatically at points during the drag operation to adjust the value of the DockRect property. The adjustment ensures that the position where the control is docked reflects the current mouse position, and, if the control is floating, reflects the size and shape of the control’s floating dock site.


TToolDockObject.DrawDragDockImage

TToolDockObject	Methods

Called when the dock image for a toolbar control is drawn.

procedure DrawDragDockImage; override;

Description

DrawDragDockImage draws a control that is moved in a toolbar.


TToolDockObject.EraseDragDockImage

TToolDockObject	Methods

Called when the dock image for a toolbar control is erased.

procedure EraseDragDockImage; override;

Description

EraseDragDockImage erases a control that is moved in a toolbar.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TDragObject

TBaseDragControlObject

TDragDockObject


TToolWindow

Hierarchy	Properties	Methods	See also

TToolWindow is the abstract ancestor for windowed controls that require a custom client area and edge borders.

Unit

toolwin

Description

TToolWindow is the ancestor of the TCoolBar and TToolBar components, which facilitate the arrangement of buttons and other visual controls.


TToolWindow properties

TToolWindow	Alphabetically	Legend

In TToolWindow

EdgeBorders

EdgeInner

EdgeOuter

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TToolWindow properties

TToolWindow	By object	Legend

Action

Align

Anchors

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

EdgeBorders

EdgeInner

EdgeOuter

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

Left

LRDockWidth

Name

Owner

Parent

ParentWindow

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TToolWindow.EdgeBorders

TToolWindow	See also

Determines which sides of the control have visible borders.

type

TEdgeBorder = (ebLeft, ebTop, ebRight, ebBottom);

  TEdgeBorders = set of TEdgeBorder;

property EdgeBorders: TEdgeBorders;

Description

Use the EdgeBorders property to add or remove borders. The appearance of the borders can be set with the EdgeInner and EdgeOuter properties.


TToolWindow.EdgeInner

TToolWindow	See also

Determines the border style for the control’s inner edge.

type TEdgeStyle = (esNone, esRaised, esLowered);

property EdgeInner: TEdgeStyle;

Description

The possible values of EdgeInner are:

Value	Meaning

esNone	No inner edge is displayed.

esRaised	The inner edge is raised.

esLowered	The inner edge is lowered.

Use EdgeInner with EdgeOuter to give the component a three-dimensional look.


TToolWindow.EdgeOuter

TToolWindow	See also

Determines the border style for the control’s outer edge.

type TEdgeStyle = (esNone, esRaised, esLowered);

property EdgeOuter: TEdgeStyle;

Description

The possible values of EdgeOuter are:

Value	Meaning

esNone	No outer edge is displayed.

esRaised	The outer edge is raised.

esLowered	The outer edge is lowered.

Use EdgeOuter with EdgeInner to give the component a three-dimensional look.


TToolWindow methods

TToolWindow	Alphabetically

In TToolWindow

Create

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TToolWindow methods

TToolWindow	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create	CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TToolWindow.Create

TToolWindow

Creates and initializes a TToolWindow instance.

constructor Create(AOwner: TComponent); override;

Description

Create generates a TToolWindow and initializes its properties.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


 TTrackBar

Hierarchy	Properties	Methods	Events	See also

TTrackBar is a wrapper for the Windows track bar control.

Unit

comctrls

Description

Use TTrackBar to put a track bar on a form. A track bar represents a position along a continuum using a slider and, optionally, tick marks. A track bar can also display a selected range marked by triangular ticks at the starting and ending positions of the selection.

During program execution, the slider can be moved to the desired position by dragging it with the mouse or by clicking the mouse on the bar. To use the keyboard to move the slider, press the arrow keys or the PageUp and PageDown keys.


TTrackBar properties

TTrackBar	Alphabetically	Legend

In TTrackBar

Frequency

LineSize

Max

Min

Orientation

PageSize

Position

SelEnd

SelStart

SliderVisible

ThumbLength

TickMarks

TickStyle

Derived from TWinControl

BorderWidth

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

DragCursor

DragKind

DragMode

Enabled

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TTrackBar properties

TTrackBar	By object	Legend

Action

Align

Anchors

BiDiMode

BorderWidth

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

Enabled

Frequency

Handle

Height

HelpContext

Hint

HostDockSite

Left

LineSize

LRDockWidth

Max

Min

Name

Orientation

Owner

PageSize

Parent

ParentCtl3D

ParentShowHint

ParentWindow

PopupMenu

Position

SelEnd

SelStart

ShowHint

Showing

SliderVisible

TabOrder

TabStop

Tag

TBDockHeight

ThumbLength

TickMarks

TickStyle

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TTrackBar.Frequency

TTrackBar	See also

Specifies the increment between tick marks on the track bar.

property Frequency: Integer;

Description

Use Frequency to specify the spacing of the tick marks, using the logical units used by the Position property. For example, a Frequency of 5 sets a tick mark at every fifth possible increment. To provide visual feedback about the units used by the track bar, set Frequency to LineSize or PageSize.

Note:	If the value of the TickStyle property is not set to tsAuto, the value of Frequency is ignored.


TTrackBar.LineSize

TTrackBar	See also

Indicates the amount the value of Position changes when the user presses the arrow keys.

property LineSize: Integer;

Description

Use LineSize to specify the distance along the slider that represents a single unit. The current Position is marked by a slider. The right and down arrow keys increment the value of Position by LineSize, and the left and up arrow keys decrement the value of Position by LineSize.

Use the PageSize property to set the number of ticks moved using the PageUp and PageDown keys.


TTrackBar.Max

TTrackBar	See also

Specifies the maximum Position of a TTrackBar.

property Max: Integer;

Description

Use Max to set an upper limit to the value that can be represented using the track bar. A slider indicates the current Position in a range between Min and Max.


TTrackBar.Min

TTrackBar	See also

Specifies the minimum Position of a TTrackBar.

property Min: Integer;

Description

Use Min to set a lower limit to the value that can be represented using the track bar. A slider indicates the current Position in a range between Min and Max.


TTrackBarOrientation
TTrackBar.Orientation

TTrackBar	See also

Specifies whether the track bar is horizontal or vertical.

type TTrackBarOrientation = (trHorizontal, trVertical);{ trHorizontal, trVertical };

property Orientation: TTrackBarOrientation;

Description

Set Orientation to the desired orientation of the track bar. Orientation has these possible values:

Value	Meaning

tbHorizontal	The long edge of the track is parallel to the top of the form. The Min position is on the left and the Max position is on the right.

tbVertical	The long edge of the track is parallel to the side of the form. The Min position is on the top and the Max position is on the bottom.


TTrackBar.PageSize

TTrackBar	See also

Specifies the amount Position is changed when the PageUp or PageDown key is pressed, or when the bar is clicked.

property PageSize: Integer;

Description

Set PageSize to the distance along the track bar that corresponds to a single view. A slider marks the current Position. The PageUp key increments the value of Position by PageSize, and PageDown key decrements the value of Position by PageSize.

Use the LineSize property to set the number of ticks moved using the arrow keys.


TTrackBar.Position

TTrackBar	See also

Contains the current position of the slider of a TTrackBar.

property Position: Integer;

Description

Read Position to determine the current value represented by the track bar. Position is a value in the range between Min and Max (inclusive). Set Position to programmatically move the slider of the track bar to a new value.


TTrackBar.SelEnd

TTrackBar	See also

Specifies the position of the end point of the selection range.

property SelEnd: Integer;

Description

Set SelEnd to determine the length of a selection that begins at SelStart. The track bar indicates a selection range on the bar by placing special tick marks at the positions specified by the SelStart and SelEnd properties and high-lighting the selected portion of the bar.

SelEnd must be greater than or equal to Position. If SelEnd is set to a value less than Position, Position changes to SelEnd. SelEnd must be greater than or equal to SelStart. If SelEnd is the same as SelStart, there is no selection, and the value of Position is the same as SelStart and SelEnd.


TTrackBar.SelStart

TTrackBar	See also

Specifies the position of the starting point of the selection range.

property SelStart: Integer;

Description

Set SelStart to determine the beginning of a selection that runs to SelEnd. The track bar indicates a selection range on the bar by placing special tick marks at the positions specified by the SelStart and SelEnd properties and high-lighting the selected portion of the bar.

SelStart must be less than or equal to Position. If SelStart is set to a value greater than Position, Position changes to SelStart. SelStart must be less than or equal to SelEnd. If SelStart is the same as SelEnd, there is no selection, and the value of Position is the same as SelStart and SelEnd.


TTrackBar.SliderVisible

TTrackBar	Properties

Specifies whether the track bar’s slider is visible.

property SliderVisible: Boolean;

Description

Use SliderVisible to get or set whether the track bar’s slider is visible.


TTrackBar.ThumbLength

TTrackBar	Properties

Specifies the length of the track bar’s slider.

property ThumbLength: Integer;

Description

Use ThumbLength to get or set the length of the track bar’s slider.


 TTrackBar.TickMarks

TTrackBar	See also

Specifies the location of the tick marks.

type TTickMark = (tmBottomRight, tmTopLeft, tmBoth);

property TickMarks: TTickMark;

Description

Set TickMarks to specify where the tick marks should be drawn. TickMarks has these possible values:

Value	Meaning

tmBottomRight	Tick marks are on the bottom or right of the track bar, depending of the value of Orientation.

tmTopLeft	Tick marks are on the top or left of the track bar, depending of the value of Orientation.

tmBoth	Tick marks are on both sides of the track bar.

If the TickStyle property is tsNone, the value of TickMarks is ignored.


TTrackBar.TickStyle

TTrackBar	See also

Specifies how tick marks are placed on the track bar.

type TTickStyle = (tsNone, tsAuto, tsManual);

property TickStyle: TTickStyle;

Description

Set TickStyle to specify whether the track bar should display tick marks, and if so, how those tick marks are set. TickStyle has these possible values:

Value	Meaning

tsAuto	Tick marks are automatically displayed at increments equal to the value of the Frequency property.

tsManual	Tick marks are displayed at the Min and Max values. Additional tick marks can be set using the SetTick method.

tsNone	No tick marks are displayed.


TTrackBar events

TTrackBar	Alphabetically	Legend

In TTrackBar

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnStartDock

OnStartDrag


TTrackBar events

TTrackBar	By object	Legend

OnChange

OnContextPopup

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnStartDock

OnStartDrag


TTrackBar.OnChange

TTrackBar	See also

Occurs immediately after the value of Position changes.

property OnChange: TNotifyEvent;

Description

Write an OnChange event handler to take specific action whenever the position of the slider may have changed. For example, if the track bar is being used to control another object, update the other object from an OnChange event handler.


TTrackBar methods

TTrackBar	Alphabetically

In TTrackBar

Create

SetTick

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTrackBar methods

TTrackBar	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

SetTick

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


TTrackBar.Create

TTrackBar	See also

Creates and initializes an instance of TTrackBar.

constructor Create(AOwner: TComponent); override;

Description

Call Create to instantiate a TTrackBar object at runtime. Track bars placed on forms at design time are created automatically.

Create allocates memory and initializes the following properties:

ControlStyle is set to [csCaptureMouse, csClickEvents, csSetCaption].

Frequency is set to 1.

Height is set to 45 and Width to 150.

LineSize is set to 1 and PageSize to 2.

Max is set to 10 and Min to 0.

Orientation is set to trHorizontal.

TickMarks is set to tbBottomRight and TickStyle to tsAuto.

TabStop is set to True.


TTrackBar.SetTick

TTrackBar	See also

Adds a tick mark to the track bar at a specified location.

procedure SetTick(Value: Integer);

Description

Use SetTick to place a tick mark on the bar at the position that corresponds to the Value parameter. Tick marks specified in this manner are only displayed when the TickStyle is set to tsManual.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TTreeNode

Hierarchy	Properties	Methods	See also

TTreeNode describes an individual node in a tree view control.

Unit

comctrls

Description

Each node in a tree view control consists of a label and an optional bitmapped image. Each item can be the parent of a list of subitems. By clicking an item, the user can expand or collapse the associated list of subitems.


TTreeNode properties

TTreeNode	Alphabetically	Legend

In TTreeNode

AbsoluteIndex

Count

Cut

Data

Deleting

DropTarget

Expanded

Focused

Handle

HasChildren

ImageIndex

Index

IsVisible

Item

ItemId

Level

OverlayIndex

Owner

Parent

Selected

SelectedIndex

StateIndex

Text

TreeView


TTreeNode properties

TTreeNode	By object	Legend

AbsoluteIndex

Count

Cut

Data

Deleting

DropTarget

Expanded

Focused

Handle

HasChildren

ImageIndex

Index

IsVisible

Item

ItemId

Level

OverlayIndex

Owner

Parent

Selected

SelectedIndex

StateIndex

Text

TreeView


TTreeNode.AbsoluteIndex

TTreeNode	See also

Indicates the index of the tree node relative to the first tree node in a tree node.

property AbsoluteIndex: Integer;

Description

Use AbsoluteIndex to determine absolute position of a node in a tree nodes object. The first tree node in a tree nodes object has an index of 0 and subsequent nodes are numbered sequentially. If a node has any children, its AbsoluteIndex is one less than the index of its first child.


TTreeNode.Count

TTreeNode	See also

Indicates the number of direct descendants of a tree node.

property Count: Integer;

Description

Use Count to determine how many child nodes belong to a tree node. Count includes only immediate children, and not their descendants. Count can be useful when iterating through the children of a tree node.


TTreeNode.Cut

TTreeNode	See also

Indicates if the tree node object is drawn as if selected as part of a cut and paste operation.

property Cut: Boolean;

Description

Use Cut to alter the appearance of the tree node when it is selected as part of a cut and paste operation.


TTreeNode.Data

TTreeNode	Example

Points to application-defined data associated with the tree node.

property Data: Pointer;

Description

Use the Data property to associate data with a tree node. Data allows applications to quickly access information about the entity represented by the node.


TTreeNode.Deleting

TTreeNode	See also

Indicates whether a node's Destroy method has been called and it is in the process of being deleted.

property Deleting: Boolean;

Description

Use Deleting to avoid recursively trying to delete a node in response to events that occur as a result of the node being deleted.


TTreeNode.DropTarget

TTreeNode	See also

Indicates whether the tree node is drawn as a drag and drop target.

property DropTarget: Boolean;

Description

Use DropTarget to indicate that the node is a drag and drop target. When DropTarget is True, the node is drawn in a style used to indicate a drag and drop target.

Note:	Setting DropTarget to True does cause the node to automatically accept dragged objects when they are released. The application must still implement the drop behavior.


TTreeNode.Expanded

TTreeNode	See also

Specifies whether the tree node is expanded.

property Expanded: Boolean;

Description

When a tree node is expanded, the minus button is shown if the ShowButtons property of the tree view is True and child nodes are displayed. Set Expanded to True to display the children of a node. Set Expanded to False to collapse the node, hiding all of its descendants.


TTreeNode.Focused

TTreeNode	See also

Indicates whether the node appears to have focus.

property Focused: Boolean;

Description

Tree view nodes are not windowed controls and so can’t receive input focus. However, they can be edited by the user when the tree view control has focus. When Focused is True, the node is surrounded by a standard focus rectangle and the user can edit the label. Use Focused to determine if a particular node in a tree view can currently be edited by the user.


TTreeNode.Handle

TTreeNode	See also

Contains the window Handle of the tree view that contains the node.

property Handle: HWND;

Description

Use Handle to obtain the handle of the tree view that owns the node. This handle can be passed as a parameter to Windows API function calls that require a handle to the tree view.


TTreeNode.HasChildren

TTreeNode	See also

Indicates whether a node has any children.

property HasChildren: Boolean;

Description

HasChildren is True if the node has subnodes, or False if the node has no subnodes. If ShowButtons of the tree view is True, and HasChildren is True, a plus (+) button will appear to the left of the node when it is collapsed, and a minus (-) button will appear when the node is expanded.

Note:	If a node has no children, setting HasChildren to True will show a (+) plus button, but will not add any child nodes and the node cannot be expanded.


TTreeNode.ImageIndex

TTreeNode	See also

Specifies which image is displayed when a node is in its normal state and is not currently selected.

property ImageIndex: TImageIndex;

Description

Use the ImageIndex property with the Images property of the tree view to specify the image for the node in it’s normal state.


TTreeNode.Index

TTreeNode	See also

Specifies the position of the node in the list of child nodes maintained by its parent node.

property Index: Longint;

Description

Use Index to determine the position of the node relative to its sibling nodes. The first child of the parent node has an Index value of 0, and subsequent children are indexed sequentially.


TTreeNode.IsVisible

TTreeNode	See also

Indicates whether the tree node is currently visible in the tree view image.

property IsVisible: Boolean;

Description

A node is visible if it is on level 0 or if all its parents are expanded. IsVisible indicates whether the node is part of the current tree view image. It does not indicate whether or not the node is scrolled into view when the tree view image is larger than the size of the tree view control.


TTreeNode.Item

TTreeNode	See also 	Example

Provides access to a child node by its position in the list of child nodes.

property Item[Index: Integer]: TTreeNode;

Description

Use Item to access a child node based on its Index property. The first child node has an index of 0, the second an index of 1, and so on.


TTreeNode.ItemId

TTreeNode	See also

Contains a handle of type HTreeItem that uniquely identifies each node in a tree view.

property ItemId: HTreeItem;

Description

Use this property to reference the nodes when making Windows API calls or calling the GetNode method of the TTreeNodes that owns the item.


TTreeNode.Level

TTreeNode	See also	Example

Indicates the level of indentation of a node within the tree view control.

property Level: Integer;

Description

The value of Level is 0 for nodes on the top level. The value of Level is 1 for their children, and so on.


TTreeNode.OverlayIndex

TTreeNode	See also

Determines which image from the image list is used as an overlay mask.

property OverlayIndex: Integer;

Description

An overlay mask is an image drawn transparently over another image in the tree view. For example, to indicate that a node is no longer available, use an overlay image that puts an X over the current node's image.


TTreeNode.Owner

TTreeNode	See also

Indicates which tree nodes object contains the tree node.

property Owner: TTreeNodes;

Description

Use the Owner property to determine the owner of the tree node. Do not confuse Owner with the TreeView property. Owner is the list of nodes used by the tree view to manage its nodes. The TreeView property is the tree view that uses that list.


TTreeNode.Parent

TTreeNode	See also 	Example

Identifies the parent node of the tree node.

property Parent: TTreeNode;

Description

A Parent node is one level higher than the node and contains the node as a subnode.


TTreeNode.Selected

TTreeNode	See also

Determines whether the node is selected.

property Selected: Boolean;

Description

Set Selected to True to select the node. The appearance of a selected node depends on whether it has the focus and on whether the system colors are used for selection. When a node becomes selected, the tree view's OnChanging and OnChanged events are triggered.


TTreeNode.SelectedIndex

TTreeNode	See also

Specifies the index in the tree view’s image list of the image displayed for the node when it is selected.

property SelectedIndex: Integer;

Description

Use the SelectedIndex property to specify an image to display when the tree node is selected.


TTreeNode.StateIndex

TTreeNode	See also

Indicates which image from the StateImages list to display for the node.

property StateIndex: Integer;

Description

Use StateIndex to display an additional image for the node that reflects state information. If StateIndex is -1 then no state image is drawn.


TTreeNode.Text

TTreeNode	See also

Specifies the label that identifies a tree node.

property Text: string;

Description

Use Text to specify the string that is displayed in the tree view. The value of Text can be assigned directly at run-time or can be set within the TreeView Items Editor while modifying the Items property of the TTreeView component. If the tree view allows users to edit its nodes, read Text to determine the value given the node by the user.


TTreeNode.TreeView

TTreeNode	See also

Specifies the tree view that displays the node.

property TreeView: TCustomTreeView;

Description

Use TreeView to determine the tree view associated with the tree node.


TTreeNode methods

TTreeNode	Alphabetically

In TTreeNode

AlphaSort

Assign

Collapse

Create

CustomSort

Delete

DeleteChildren

Destroy

DisplayRect

EditText

EndEdit

Expand

GetFirstChild

GetHandle

GetLastChild

GetNext

GetNextChild

GetNextSibling

GetNextVisible

GetPrev

GetPrevChild

GetPrevSibling

GetPrevVisible

HasAsParent

IndexOf

MakeVisible

MoveTo

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TTreeNode methods

TTreeNode	By object

~

AfterConstruction

AlphaSort

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Collapse

Create

CustomSort

DefaultHandler

Delete

DeleteChildren

Destroy

Dispatch

DisplayRect

EditText

EndEdit

Expand

FieldAddress

Free

FreeInstance

GetFirstChild

GetHandle

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetLastChild

GetNamePath

GetNext

GetNextChild

GetNextSibling

GetNextVisible

GetPrev

GetPrevChild

GetPrevSibling

GetPrevVisible

HasAsParent

IndexOf

InheritsFrom

InitInstance

InstanceSize

MakeVisible

MethodAddress

MethodName

MoveTo

NewInstance

SafeCallException


TTreeNode.AlphaSort

TTreeNode	See also

Sorts the node’s children alphabetically based on their Text property.

function AlphaSort: Boolean;

Description

Call AlphaSort to sort the subtree of the tree view alphabetically. If successful, the method returns True.


TTreeNode.Assign

TTreeNode	See also

Copies the properties of another tree view node.

procedure Assign(Source: TPersistent); override;

Description

If the Source parameter is a TTreeNode object, Assign copies the Text, Data, ImageIndex, SelectedIndex, OverlayIndex, Focused, DropTarget, Cut, and HasChildren properties from the source node. If Source is any other type of object, Assign calls its inherited method, which copies information from any object that can copy to a tree node in its AssignTo method.

Note:	While Assign copies the HasChildren property, it does not copy the child nodes. Be sure to copy any descendants after assigning the properties of another node that has children.


TTreeNode.Collapse

TTreeNode	See also

Collapses a node.

procedure Collapse(Recurse: Boolean);

Description

When a node is collapsed, all of its subnodes are hidden. The plus button may be displayed, depending on whether the tree view's ShowButtons property is set. If Recurse is True, then all subnodes will be collapsed as well. When the node is next expanded the children will still be collapsed. If Recurse is False, the child nodes won't be collapsed and the next time the node is expanded, the children will be in the same state as when Collapse was called.


TTreeNode.Create

TTreeNode	See also

Creates an instance of TTreeNode.

constructor Create(AOwner: TTreeNodes);

Description

Call Create to instantiate a tree node at runtime. Nodes added to a tree view control at design time are created automatically. Use the methods of the TTreeNodes object instead to create nodes as part of an existing tree view.

After calling the inherited constructor, Create sets the OverlayIndex and StateIndex properties to -1 and then sets the Owner property of the tree node to the AOwner TTreeNodes object.


TTreeNode.CustomSort
TTreeNode.::CustomSort

TTreeNode	See also 	Example

Sorts the descendants based using a customized ordering function.

type TTVCompare = function(lParam1, lParam2, lParamSort: Longint): Integer stdcall;

function CustomSort(SortProc: TTVCompare; Data: Longint): Boolean;

Description

Use CustomSort to sort the descendants of a tree view nodes where the sort order is defined by the SortProc parameter. The lParam1 and lParam2 parameters of the sort procedure can be cast to TTreeNode objects are compared. The lParamSort parameter of the sort procedure is the value of Data parameter of CustomSort. The sort procedure should return a value less than 0 if lParam1 should come before lParam2, should return 0 if the two values are equivalent, and should return a value greater than 0 if lParam1 should follow lParam2.

If the SortProc parameter is nil, the AlphaSort method is called.


TTreeNode.Delete

TTreeNode	See also

Destroys the node and all its children.

procedure Delete;

Description

Use the Delete method to delete a tree node and free all associated memory.


TTreeNode.DeleteChildren

TTreeNode	See also

Deletes all children of the node.

procedure DeleteChildren;

Description

Use the DeleteChildren method to delete all children of a tree node, freeing all associated memory.


TTreeNode.Destroy

TTreeNode	See also

Destroys the tree node object.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, use the Delete method. Delete removes the image of the node and all its children from the tree view window, and guards against recursive deletes that could arise from the resulting Windows messages.


TTreeNode.DisplayRect

TTreeNode	See also	Example

Returns the bounding rectangle for a tree node.

function DisplayRect(TextOnly: Boolean): TRect;

Description

If the TextOnly parameter is True, the bounding rectangle includes only the text of the node. Otherwise, it includes the entire line that the node occupies in the tree-view control.


TTreeNode.EditText

TTreeNode	See also

Begins in-place editing of the specified node's text, replacing the text of the node with a single-line edit control containing the text.

function EditText: Boolean;

Description

Call EditText to allow the user to edit the node’s label. This method implicitly sets the Selected and Focused properties to True. When EditText is called, the tree view's OnEditing event is triggered.


TTreeNode.EndEdit

TTreeNode	See also

Ends the editing of a node's label.

procedure EndEdit(Cancel Boolean);

Description

Call EndEdit to take the node out of edit mode. If the Cancel parameter is True, all changes made by the user are discarded. If Cancel is False, EndEdit updates the node’s Text property and the tree view’s OnEdited event occurs.


TTreeNode.Expand

TTreeNode	See also

Expands the node to display all child nodes.

procedure Expand(Recurse: Boolean);

Description

When a node is expanded, its immediate subnodes are displayed. The minus '-' button may be displayed, depending on whether the tree view's ShowButtons property is set. If Recurse is True, all descendants of the immediate subnodes are expanded as well.


TTreeNode.GetFirstChild

TTreeNode	See also

Returns the first child node of a tree node.

function GetFirstChild: TTreeNode;

Description

Call GetFirstChild to access the first child node of the tree view node. If the node has no children, GetFirstChild returns nil.

Note:	GetFirstChild returns the same value as Item[0].


TTreeNode.GetHandle

TTreeNode	See also

Returns the Handle property.

function GetHandle: HWND;

Description

Calling GetHandle is the same as reading the Handle property.


TTreeNode.GetLastChild

TTreeNode	See also

Returns the last immediate child node of the calling node.

function GetLastChild: TTreeNode;

Description

Call GetLastChild to find the last immediate child of a node. If the calling node has no children, GetLastChild returns nil. GetLastChild returns the same value as Item[Count-1].


TTreeNode.GetNext

TTreeNode	See also 	Example

Returns the next node after the calling node in the tree view.

function GetNext: TTreeNode;

Description

If the calling node is the last node, GetNext returns nil. It will return the next node including nodes that aren't visible and child nodes. To get the next node at the same level as the calling node, use GetNextSibling. To get the next visible node, use GetNextVisible.


TTreeNode.GetNextChild

TTreeNode	See also 	Example

Returns the next child node after Value.

function GetNextChild(Value: TTreeNode): TTreeNode;

Description

Call GetNextChild to locate the next node in the list of immediate children of the tree view node. If the calling node has no children or there is no node after Value, GetNextChild returns nil.


TTreeNode.GetNextSibling

TTreeNode	See also

Returns the next node in the tree view at the same level as the calling node.

function GetNextSibling: TTreeNode;

Description

GetNextSibling will return the next node, regardless of whether it's visible. To find the next node in the tree view including child nodes, use GetNext.


TTreeNode.GetNextVisible

TTreeNode	See also

Returns the next visible node in the tree view after the calling node.

function GetNextVisible: TTreeNode;

Description

Use GetNextVisible when iterating through all the visible nodes in the tree view. A node is visible if all its parent nodes are expanded.


TTreeNode.GetPrev

TTreeNode	See also

Returns the previous node in the tree view before the calling node.

function GetPrev: TTreeNode;

Description

GetPrev will return the previous node whether or not it is visible. To get the previous visible node, use GetPrevVisible.


TTreeNode.GetPrevChild

TTreeNode	See also 	Example

Returns the previous child node before Value.

function GetPrevChild(Value: TTreeNode): TTreeNode;

Description

Call GetPrevChild to locate the previous node in the list of immediate children of the tree view node. If the calling node has no children or there is no node before Value, GetPrevChild returns nil.


TTreeNode.GetPrevSibling

TTreeNode	See also

Returns the previous node before the calling node and at the same level.

function GetPrevSibling: TTreeNode;

Description

GetPrevSibling returns the previous sibling node, regardless of whether it's visible. To find the previous node in the tree view including all levels, use GetPrev.


TTreeNode.GetPrevVisible

TTreeNode	See also

Returns the previous visible node before the calling node.

function GetPrevVisible: TTreeNode;

Description

To get the previous node, including non-visible, use GetPrev.


TTreeNode.HasAsParent

TTreeNode	See also

Returns True if Value is a parent node of the calling node.

function HasAsParent(Value: TTreeNode): Boolean;

Description

Use the HasAsParent method to determine if a node is a parent to a particular node.


TTreeNode.IndexOf

TTreeNode	See also

Returns the position of an immediate child node of the calling node.

function IndexOf(Value: TTreeNode): Integer;

Description

Call IndexOf to obtain the position of a child node among the children of the calling node. If Value isn't an immediate child of the calling node, IndexOf returns -1. The first child node has an index on 0, the second an index of 1, and so on.


TTreeNode.MakeVisible

TTreeNode	See also

Expands the parent nodes of a node.

procedure MakeVisible;

Description

If a node's parent node(s) are collapsed and the node isn't visible, MakeVisible will expand the nodes parents to make the node visible.


TTreeNode.MoveTo

TTreeNode	See also	Example

Moves the node to another location in the tree view.

type TNodeAttachMode = (naAdd, naAddFirst, naAddChild, naAddChildFirst, naInsert);

procedure MoveTo(Destination: TTreeNode; Mode: TNodeAttachMode);

Description

The Destination parameter determines where to move the node. The Mode parameter is of type TNodeAttachMode and specifies how the node is to be reattached. These are the possible values for the Mode parameter:

Value	Meaning

naAdd	Adds the node to the end of the list.

naAddFirst	Adds the node at the beginning of the list.

naAddChild	Adds the node as a child of the destination at the end of the child list.

naAddChildFirst	Adds the node as a child at the beginning of the child list of the destination.

naInsert	Insert the node before the destination node.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TTreeNodes

Hierarchy	Properties	Methods	See also

TTreeNodes maintains a list of tree nodes in a tree view control.

Unit

comctrls

Description

The Items property of the tree view control is a TTreeNodes object and maintains the collection of nodes in the tree view. Nodes can be added, deleted, inserted and moved within the tree view. Access the nodes in the tree view through the Items property of the tree view.


TTreeNodes properties

TTreeNodes	Alphabetically	Legend

In TTreeNodes

Count

Handle

Item

Owner


TTreeNodes properties

TTreeNodes	By object	Legend

Count

Handle

Item

Owner


TTreeNodes.Count

TTreeNodes	See also 	Example

Indicates the number of nodes maintained by the TTreeNodes object.

property Count: Integer;

Description

Use Count to determine the number of tree nodes in the tree view that owns the tree nodes object. Count provides an upper bound when iterating through the entries in the Item property array.


TTreeNodes.Handle

TTreeNodes	See also

Contains the window handle of the tree view control that owns the tree nodes object.

property Handle: HWND;

Description

Use Handle to obtain the handle of the tree view that owns the tree nodes object.


TTreeNodes.Item

TTreeNodes	See also

Lists all tree nodes managed by the TTreeNodes object.

property Item[Index: Integer]: TTreeNode; default;

Description

Use Item to access to a node by its position in the tree view. The first node has an index of 0, the second an index of 1, and so on. Item is the default property for TTreeNodes. This means that the name of the Item property can be omitted when indexing into the set of tree nodes. Thus, the line

FirstNode := TreeView1.Items.Item[0];

can be written

FirstNode := TreeView1.Items[0];


TTreeNodes.Owner

TTreeNodes	See also

Specifies the tree view control that uses the tree nodes object to implement its Items property.

property Owner: TCustomTreeView;

Description

Use the Owner property to access the tree view control that displays the nodes maintained by the TTreeNodes object.


TTreeNodes methods

TTreeNodes	Alphabetically

In TTreeNodes

Add

AddChild

AddChildFirst

AddChildObject

AddChildObjectFirst

AddFirst

AddObject

AddObjectFirst

Assign

BeginUpdate

Clear

Create

Delete

Destroy

EndUpdate

GetFirstNode

GetNode

Insert

InsertObject

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TTreeNodes methods

TTreeNodes	By object

Add

AddChild

AddChildFirst

AddChildObject

AddChildObjectFirst

AddFirst

AddObject

AddObjectFirst

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

Free

FreeInstance

GetFirstNode

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetNode

InheritsFrom

InitInstance

Insert

InsertObject

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TTreeNodes.Add

TTreeNodes	See also 	Example

Adds a new tree node to a tree view control.

function Add(Node: TTreeNode; const S: string): TTreeNode;

Description

The node is added as the last sibling of the Node parameter. The S parameter specifies the Text property of the new node. Add returns the node that has been added. If the tree view is sorted, Add inserts the node in the correct sort order position rather than as the last child of the Node parameter’s parent.


TTreeNodes.AddChild

TTreeNodes	See also 	Example

Adds a new tree node to a tree view.

function AddChild(Node: TTreeNode; const S: string): TTreeNode;

Description

The node is added as a child of the node specified by the Node parameter. It is added to the end of Node's list of child nodes. The S parameter specifies the Text property of the new node. AddChild returns the node that has been added. If the tree view is sorted, AddChild inserts the node in the correct sort order position, rather than as the last child of the Node parameter.


TTreeNodes.AddChildFirst

TTreeNodes	See also

Adds a new tree node to a tree view.

function AddChildFirst(Node: TTreeNode; const S: string): TTreeNode;

Description

Use AddChildFirst to insert a node as the first child of the node specified by the Node parameter. The S parameter specifies the Text property of the new node. Nodes that appear after the added node are moved down one row and reindexed with valid Index values. AddChildFirst returns the node that has been added.


TTreeNodes.AddChildObject

TTreeNodes	See also 	Example

Adds a new tree node containing data to a tree view.

function AddChildObject(Node: TTreeNode; const S: string; Ptr: Pointer): TTreeNode;

Description

The node is added as the last child of the node specified by the Node parameter. The S parameter specifies the Text property of the new node. The Ptr parameter specifies the Data property value of the new node. AddChildObject returns the node that has been added.

Note:	The memory referenced by Ptr is not freed when the tree nodes object is freed.


TTreeNodes.AddChildObjectFirst

TTreeNodes	See also 	Example

Adds a new tree node containing data to a tree view.

function AddChildObjectFirst(Node: TTreeNode; const S: string; Ptr: Pointer): TTreeNode;

Description

The node is added as the first child of the node specified by the Node parameter. Nodes that appear after the added node are moved down one row and reindexed with valid Index values. The S parameter specifies the Text property of the new node. The Ptr parameter specifies the Data property value of the new node. AddChildObjectFirst returns the node that has been added.

Note:	The memory referenced by Ptr is not freed when the tree nodes object is freed.


TTreeNodes.AddFirst

TTreeNodes	See also

Adds a new tree node to a tree view.

function AddFirst(Node: TTreeNode; const S: string): TTreeNode;

Description

The node is added as the first sibling of the node specified by the Node parameter. Nodes that appear after the added node are moved down one row and re-indexed with valid Index values. The S parameter specifies the Text property of the new node. AddFirst returns the node that has been added.


TTreeNodes.AddObject

TTreeNodes	See also 	Example

Adds a new node containing data to a tree view.

function AddObject(Node: TTreeNode; const S: string; Ptr: Pointer): TTreeNode;

Description

The node is added as the last sibling of the node specified by the Node parameter. The S parameter specifies the Text property of the new node. The Ptr parameter specifies the Data property value of the new node. AddObject returns the node that has been added.

Note:	The memory referenced by Ptr is not freed when the tree nodes object is freed.


TTreeNodes.AddObjectFirst

TTreeNodes	See also

Adds a new node containing data to a tree view.

function AddObjectFirst(Node: TTreeNode; const S: string; Ptr: Pointer): TTreeNode;

Description

The node is added first to the list to which the node specified by the Node parameter belongs. nodes that appear after the added node are moved down one row and reindexed with valid Index values. The S parameter specifies the Text property of the new node. The Ptr parameter specifies the Data property value of the new node. AddObjectFirst returns the node that has been added.


TTreeNodes.Assign

TTreeNodes	See also

Discards any current property information and replaces it with the information from the Source.

procedure Assign(Source: TPersistent);

Description

Use Assign to copy information from one tree nodes object to another. If Source is any other type of object, Assign calls its inherited method, which will copy properties from any object that can copy to a TTreeNodes object in its AssignTo method.


TTreeNodes.BeginUpdate

TTreeNodes	See also

Prevents the updating of the tree view until the EndUpdate method is called.

procedure BeginUpdate;

Description

BeginUpdate prevents the screen from being repainted when new nodes are added, deleted, or inserted. Tree nodes affected by the changes will have invalid Index values until EndUpdate is called.

Use BeginUpdate to prevent screen repaints and to speed processing time while adding nodes to the tree view.

Note:	Calls to BeginUpdate are cumulative; for every call to BeginUpdate there must be a corresponding call to EndUpdate.


TTreeNodes.Clear

TTreeNodes	See also

Deletes all tree nodes contained from the list managed by TTreeNodes.

procedure Clear;

Description

Use the Clear method to remove all the nodes of a tree view.


TTreeNodes.Create

TTreeNodes	See also

Creates an instance of a TTreeNodes object

constructor Create(AOwner: TCustomTreeView);

Description

Call Create to instantiate a TTreeNodes object at runtime. The TTreeNodes object used by TTreeView is created automatically from the constructor of the tree view object.

After calling the inherited constructor, Create sets the Owner property of the tree nodes object to the value of the AOwner parameter.


TTreeNodes.Delete

TTreeNodes	See also 	Example

Removes a node from the tree view.

procedure Delete(Node: TTreeNode);

Description

Delete removes a tree node in the tree view specified by the Node parameter.


TTreeNodes.Destroy

TTreeNodes	See also

Destroys an instance of TTreeNodes.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. The tree view that owns the TTreeNodes object destroys the tree nodes object by calling its Free method.


TTreeNodes.EndUpdate

TTreeNodes	See also

Re-enables screen repainting and node reindexing that was turned off with the BeginUpdate method.

procedure EndUpdate;

Description

Use the EndUpdate method to enable screen updating after BeginUpdate has been called. Calls to BeginUpdate are cumulative, so calling EndUpdate will only update the tree view if every other call to BeginUpdate has already been matched by a call to EndUpdate.


TTreeNodes.GetFirstNode

TTreeNodes	See also 	Example

Returns the first tree node in the tree view.

function GetFirstNode: TTreeNode;

Description

Use the GetFirstNode method to retrieve the first node in the tree view. GetFirstNode returns the value of Item[0].


TTreeNodes.GetNode

TTreeNodes	See also

Returns the tree node given the ItemId of the tree node.

function GetNode(ItemId: HTreeItem): TTreeNode;

Description

ItemId is a handle to the node in the tree view.


TTreeNodes.Insert

TTreeNodes	See also

Inserts a tree node into the tree view before the node specified by the Node parameter.

function Insert(Node: TTreeNode; const S: string): TTreeNode;

Description

Call Insert to add a new sibling to the Node parameter, immediately preceding Node. The S parameter specifies the Text property of the new node. Insert returns the new node.


TTreeNodes.InsertObject

TTreeNodes	See also

Inserts a tree node containing data into the tree view before the node specified by the Node parameter.

function InsertObject(Node: TTreeNode; const S: string; Ptr: Pointer): TTreeNode;

Description

Call InsertObject to add a new sibling to the Node parameter, immediately preceding Node. The S parameter specifies the Text property of the new node and the Ptr parameter specifies the Data property of the new node. InsertObject returns the new node.

Note:	The memory referenced by Ptr is not freed when the tree nodes object is freed.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


 TTreeView

Hierarchy	Properties	Methods	Events	See also

TTreeView represents a window that displays a hierarchical list of items, such as the headings in a document, the entries in an index, or the files and directories on a disk.

Unit

comctrls

Description

Use TTreeView to add an expanding and contracting outline to a form. Each node in a tree view control consists of a label and a number of optional bitmapped images. Each node can have a list of subnodes associated with it. By clicking on a node, the user can expand and collapse the associated list of subnodes. This control can be seen as the left pane of the Database Explorer.


TTreeView properties

TTreeView	Alphabetically	Legend

Derived from TCustomTreeView

AutoExpand

BorderStyle

Canvas

ChangeDelay

DragMode

DropTarget

HideSelection

HotTrack

Images

Indent

Items

ReadOnly

RightClickSelect

RowSelect

Selected

ShowButtons

ShowLines

ShowRoot

SortType

StateImages

ToolTips

TopItem

Derived from TWinControl

BorderWidth

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Color

Constraints

ControlState

ControlStyle

Cursor

DragCursor

DragKind

DragMode

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Font

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentBiDiMode

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TTreeView properties

TTreeView	By object	Legend

Action

Align

Anchors

AutoExpand

BiDiMode

BorderStyle

BorderWidth

BoundsRect

Brush

Canvas

ChangeDelay

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

DragCursor

DragKind

DragMode

DragMode

DropTarget

Enabled

Floating

FloatingDockSiteClass

Font

Handle

Height

HelpContext

HideSelection

Hint

HostDockSite

HotTrack

Images

Indent

Items

Left

LRDockWidth

Name

Owner

Parent

ParentBiDiMode

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

ParentWindow

PopupMenu

ReadOnly

RightClickSelect

RowSelect

Selected

ShowButtons

ShowHint

Showing

ShowLines

ShowRoot

SortType

StateImages

TabOrder

TabStop

Tag

TBDockHeight

ToolTips

Top

TopItem

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc


TTreeView events

TTreeView	Alphabetically	Legend

Derived from TCustomTreeView

OnAdvancedCustomDraw

OnAdvancedCustomDrawItem

OnChange

OnChanging

OnCollapsed

OnCollapsing

OnCompare

OnCustomDraw

OnCustomDrawItem

OnDeletion

OnEdited

OnEditing

OnExpanded

OnExpanding

OnGetImageIndex

OnGetSelectedIndex

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnContextPopup

OnDblClick

OnDragDrop

OnDragOver

OnEndDock

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TTreeView events

TTreeView	By object	Legend

OnAdvancedCustomDraw

OnAdvancedCustomDrawItem

OnChange

OnChanging

OnClick

OnCollapsed

OnCollapsing

OnCompare

OnContextPopup

OnCustomDraw

OnCustomDrawItem

OnDblClick

OnDeletion

OnDragDrop

OnDragOver

OnEdited

OnEditing

OnEndDock

OnEndDrag

OnEnter

OnExit

OnExpanded

OnExpanding

OnGetImageIndex

OnGetSelectedIndex

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDock

OnStartDrag


TTreeView methods

TTreeView	Alphabetically

Derived from TCustomTreeView

AlphaSort

Create

CustomSort

Destroy

FullCollapse

FullExpand

GetHitTestInfoAt

GetNodeAt

IsEditing

LoadFromFile

LoadFromStream

SaveToFile

SaveToStream

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

CreateParentedControl

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTreeView methods

TTreeView	By object

AfterConstruction

AlphaSort

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

CreateParentedControl

CustomSort

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

FullCollapse

FullExpand

GetControlsAlignment

GetHitTestInfoAt

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetNodeAt

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsEditing

IsRightToLeft

LoadFromFile

LoadFromStream

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

SaveToFile

SaveToStream

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomTreeView


Automation variable

Automation is for backward compatibility with Delphi 2.0.

Unit

Oleauto

var Automation: TAutomation;

Description

Declarations in the Oleauto unit are provided for backward compatibility.

Automation is a global instance of the automation manager class. It serves as the Automation manager for an OLE automation server written with Delphi.

When creating an OLE automation object (an object derived from the TAutoObject class in the Oleauto unit) the file that defines that object must call Automation.RegisterClass, passing a record of type TAutoClassInfo. The Automation manager then handles all interactions between the automation object and the OLE automation API.

Note:	New implementations of OLE and ActiveX in the current version of Delphi have replaced declarations in the Oleauto unit.


Data Dictionary ID types

See also

Identify entries in the Data Dictionary.

Unit

Drintf

type

  TID = packed record Reseved: array[1..6] of Byte; end;

  TDatabaseID = type TID;

  TTableID = type TID;

  TFieldID = type TID;

  TAttrID = type TID;

Description

The data dictionary ID types are all 6-byte arrays that are used internally by the data dictionary as identifiers. Applications do not assign values to these types. Rather, they are returned by functions that look up or create Data Dictionary entries.

The following table lists the different types of Data Dictionary IDs:

Type	Identifies

TID	Nothing. This is the generic type definition for a Data Dictionary identifier.

TDatabaseID	A database. This identifier can be obtained using the FindDatabaseID function.

TTableID	A database table. This identifier can be obtained using the FindTableID function.

TFieldID	A field (column) in a table. This identifier can be obtained using the FindFieldID function.

TAttrID	An attribute set for a field. This identifier can be obtained using the FindAttrID function or the GetAttrID function.


DBIResult type

See also

DBIResult is used to specify a BDE error code .

Unit

(BDE.int)

type DBIResult: Word;

Description

DBIResult is used to specify a Borland Database Engine error code for the DBIError procedure. Use DBIResult to declare the return value when making direct API calls to the BDE.


DBResult type

See also

DBResult is used to specify the error code returned by a database function.

Unit

Dsintf

type DBIResult = Word;

Description

DBResult is used to specify the error code returned by a function that performs some database action. DBResult is considered generic: it can return the result from functions that use different underlying database engines.


DWORD type

See also

DWORD represents a four-byte integer.

Unit

Windows

type DWORD = Longword;

Description

DWORD (double word) is used in Windows programming to represent a four-byte integer.


HMetafile type

See also

HMetafile is the Windows handle to a TMetafile object.

Unit

Graphics

type HMETAFILE = THandle;

Description

HMetafile is the type used by Windows API function calls that require a handle to a metafile for one of the arguments. It is also the type of the handle of a TMetafile object.


LongRec type

See also

LongRec stores high- and low-order bytes of a specified variable as a Word.

Unit

Sysutils

type

  LongRec = packed record

    Lo, Hi: Word;

  end;

Description

LongRec declares a utility record that stores the high- and low-order bytes of the specified variable as type Word.

LongRec is useful for typecasting four-byte datatypes (pointers, integers, and so on) to access their low and high words separately.


PNodeCache type

See also

A pointer to a TNodeCache object.

Unit

Comctrls

PNodeCache = ^TNodeCache;

Description

PNodeCache is a pointer to a cached node of a TTreeView object.


TActionEvent type

See also

The type of events that occur when processing actions.

Unit

Actnlist

type TActionEvent = procedure (Action: TBasicAction; var Handled: Boolean) of object;

Description

TActionEvent is the type of event handlers that respond at various points in the processing of actions. The Action parameter is the action that was triggered by a user action or that is currently being updated while the application is idle. The Handled parameter indicates whether the event handler executed or updated the action. Set Handled to True in the event handler to stop further processing of the action.


TActiveFormBorderStyle type

See also

Specifies the style of an active form's border.

Unit

Forms

type

  TActiveFormBorderStyle = (afbNone, afbSingle, afbSunken, afbRaised);

Description

The following are possible values of TActiveFormBorderStyle:

value	meaning

afbNone	The form has no border.

afbSingle	The form has a regular single-line border.

afbSunken	The form has a 3D look—that is, a border with a sunken edge.

afbRaised	The form has a border with a raised edge.


TActiveXRegType type

See also

Used when excluding a component class from the ActiveX Wizard.

Unit

Classes

type TActiveXRegType = (axrComponentOnly, axrIncludeDescendants);

Description

The TActiveXRegType type indicates whether a component’s descendants should be excluded from the ActiveX Wizard when the component is excluded. The following table lists the possible values:

Value	Meaning

axrComponentOnly	Only the component class is blocked from appearing in the ActiveX Wizard.

axrIncludeDescendants	The component class and any of its descendants are blocked from the Wizard.


TAlign, TAlignSet type

See also

Specifies an alignment.

Unit

Controls

type TAlignSet = set of TAlign;

type TAlign = (alNone, alTop, alBottom, alLeft, alRight, alClient);

Description

TAlignSet is a set of TAlign values. TAlign specifies how a control is placed relative to its parent. It can have one of the following values:

Value	Meaning

alNone	The control remains where it was placed. This is the default value.

alTop	The control moves to the top of its parent and resizes to fill the width of its parent. The height of the control is not affected.

alBottom	The control moves to the bottom of its parent and resizes to fill the width of its parent. The height of the control is not affected.

alLeft	The control moves to the left side of its parent and resizes to fill the height of its parent. The width of the control is not affected.

alRight	The control moves to the right side of its parent and resizes to fill the height of its parent. The width of the control is not affected.

alClient	The control resizes to fill the client area of its parent. If another control already occupies part of the client area, the control resizes to fit within the remaining client area.


TAlignment type

See also

Specifies how text is aligned within a control.

Unit

forms

type TAlignment = (taLeftJustify, taRightJustify, taCenter);

Description

The following are possible values of TAlignment:

Value	Meaning

taLeftJustify	Text is left-justified: Lines all begin at the left edge of the control.

taCenter	Text is centered in the control.

taRightJustify	Text is right-justified: Lines all end at the right edge of the control.


TAnchorKind, TAnchors type

Specifies how a control is anchored to its parent.

Unit

Controls

type TAnchors = set of TAnchorKind;

type TAnchorKind = (akTop, akLeft, akRight, akBottom);

Description

TAnchors is a set of TAnchorKind values. TAnchorKind can have one or more of the following values:

Value	Meaning

akTop	The control’s position is fixed with respect to the top edge of its parent.

akLeft	The control’s position is fixed with respect to the left edge of its parent.

akRight	The control’s position is fixed with respect to the right edge of its parent.

akBottom	The control’s position is fixed with respect to the bottom edge of its parent.


.TAttachMode type
TAttachMode type

See also

Indicates how an outline node should be inserted into an outline.

Unit

Outline

type  TAttachMode = (oaAdd, oaAddChild, oaInsert);

Description

TAttachMode is used by methods that move outline nodes within an outline. It includes the following values:

Value	Description

oaAdd	The item is attached as if added with the Add method. The moved item becomes the last sibling of the item specified by the Destination parameter, sharing the same parent as the Destination item.

oaAddChild	The item is attached as if added with the AddChild method. The moved item becomes the last child of the item specified by the Destination parameter. The Destination item becomes the parent of the moved item.

oaInsert	The item is attached as if inserted with the Insert method. The moved item replaces the Destination item in the outline, while the Destination item and all other following items are moved down one row.


TAutoRefreshFlag type

See also

Indicates the type of autorefresh support a field component uses.

Unit

Db

type TAutoRefreshFlag = (arNone, arAutoInc, arDefault);

Description

TAutoRefreshFlag is the type of the AutoGenerateValue property of a field component. It indicates whether the type of data contained in the field can be automatically refreshed. TAutoRefreshFlag includes the following values:

Value	Meaning

arNone	The field does not have a default value and is not an autoincrement field. Fields of this type are not automatically refreshed.

arAutoInc	The field is an autoincrement field.

arDefault	The field has a default value maintained by the server.


TBandInfoEvent type

The type of the OnBandInfo event handler.

Unit

Extctrls

TBandInfoEvent = procedure (Sender: TObject; Control: TControl; var Insets: TRect; var PreferredSize, RowCount: Integer) of object;

Description

Sender is the control bar containing the band.

Control is the control on the band that is moved (usually a TToolBar object).

Insets is the margin between the edges of the control and the edges of its band. This value can be adjusted by the event handler.

PreferredSize is the band’s preferred width. (The band’s width will be reduced if it can’t fit inside the control bar.) This value can be adjusted by the event handler.

RowCount is the number of control rows that the band spans in the control bar. This value can be adjusted by the event handler.


TBandMoveEvent type

The type of the OnBandMove event handler.

Unit

Extctrls

TBandMoveEvent = procedure (Sender: TObject; Control: TControl; var ARect: TRect) of object;

Description

Sender is the control bar in which a band is about to be moved.

Control is the control on the band that is about to be moved (usually a TToolBar object).

ARect is the area to which the control is about to be moved. This value can be adjusted from within the event handler.


TBandPaintEvent type

The type of the OnBandPaint event handler.

Unit

Extctrls

TBandPaintEvent = procedure (Sender: TObject; Control: TControl; Canvas: TCanvas; var ARect: TRect; var Options: TBandPaintOptions) of object;

Description

Sender is the control bar in which a band is about to be painted.

Control is the control on the band that is about to be painted.

Canvas is the control’s canvas.

ARect is the control’s area. This value can be adjusted by the event handler.

Options specifies which parts of the band are drawn. This value can be adjusted by the event handler.


TBandPaintOption, TBandPaintOptions type

Used in the OnBandPaint event handler to specify which parts of a band are painted.

Unit

Extctrls

type

  TBandPaintOption = (bpoGrabber, bpoFrame);

  TBandPaintOptions = set of TBandPaintOption;

Description

TBandPaintOptions has one or both of the following values:

Value	Meaning

bpoGrabber	The grabber is painted.

bpoFrame	The frame is painted.


TBatchMode type

Indicates the type of batch operation to be performed on a database table.

Unit

Dbtables

type TBatchMode = (batAppend, batUpdate, batAppendUpdate, batDelete, batCopy);

Description

TBatchMode can take the following values:

Value	Meaning

batAppend	Append all records from the source table to the end of destination table. The destination and source tables must not have records with duplicate keys.

batAppendUpdate	If a matching record exists in the destination table, replace it with the corresponding record from the source table. Otherwise, append records to the destination table. The destination table must have an index defined for matching records.

batCopy	Copy the structure and records from the source table into the destination table. If the destination table already exists,delete it, and replace it with the new copy of the source.

batDelete	Delete all records in the destination table that also appear in the source table.

batUpdate	If a matching record exists in the destination table, replace it with the corresponding record from the source table. The destination table must have an index defined for matching records.


TBcd type

The type that stores a binary coded decimal value.

Unit

Dbtables

type

  TBcd  = packed record

    Precision: Byte;         { 1..64 }

    SignSpecialPlaces: Byte; { Sign:1, Special:1, Places:6 }

    Fraction: packed array [0..31] of Byte; { BCD Nibbles, 00..99 per Byte, high Nibble 1st }

  end;

Description

TBcd represents a binary coded decimal value. It contains the following fields:

Field	Contents

Precision	The number of digits in the decimal version of the value.

SignSpecialPlaces	The sign bit (0 is positive, any other value negative)
the special bit (nonzero indicates that the value is blank)
the number of digits after the decimal (0 to Precision)

Fraction	An array of BCD nibbles, 00 to 99 per byte, high nibble first. Only the first Precision nibbles are used.


TBevelCut type

See also

Specifies a bevel’s cut.

Unit

Controls

type TBevelCut = (bvNone, bvLowered, bvRaised, bvSpace);

Description

TBevelCut can have one of the following values:

Value	Meaning

bvNone	The bevel does not exist.

bvLowered	The bevel appears lowered.

bvRaised	The bevel appears raised.

bvSpace	The bevel appears as a space if its kind is not bkTile. Otherwise, the bevel appears raised.


TBevelEdge, TBevelEdges type

Specifies which edges of a window are bevelled.

Unit

Controls

type

  TBevelEdge = (beLeft, beTop, beRight, beBottom);

  TBevelEdges = set of TBevelEdge;

Description

TBevelEdge can have one or more of the following values:

Value	Meaning

beLeft	The left edge is bevelled.

beTop	The top edge is bevelled.

beRight	The right edge is bevelled.

beBottom	The bottom edge is bevelled.


TBevelKind type

Specifies a bevel kind.

Unit

Controls

type TBevelKind = (bkNone, bkTile, bkSoft, bkFlat);

Description

TBevelKind can have one of the following values:

Value	Meaning

bkNone	No bevel is added.

bkTile	The bevel appears sharply defined.

bkSoft	The bevel uses softer contrasts than bkTile.

bkFlat	The bevel has a broad, flat appearance.


TBevelWidth type

Contains a bevel width.

Unit

Controls

type TBevelWidth = 1..MaxInt;

Description

Use TBevelWidth to specify the width of a bevel in pixels.


TBiDiMode type

Used to specify a bi-directional mode.

Unit

Controls

type TBiDiMode = (bdLeftToRight, bdRightToLeft, bdRightToLeftNoAlign, bdRightToLeftReadingOnly);

Description

TBiDiMode determines the reading order of the text, placement of the vertical scrollbar, and any alignment modifications. It is used to tailor the user interface for locales where text is bi-directional.

The following table describes the possible values:

Value	Meaning

bdLeftToRight	Reading order is left to right. Alignment is not changed. The vertical scroll bar appears on the right edge of the control.

bdRightToLeft	Reading order is right to left. Alignment is changed. The vertical scroll bar appears on the left edge of the control.

bdRightToLeftNoAlign	Reading order is right to left. Alignment is not changed. The vertical scroll bar appears on the left edge of the control.

bdRightToLeftReadingOnly	Reading order is right to left. Alignment and scroll bar are not changed.


TBlobByteData type

Stores the contents of a Binary Large Object (BLOB) field.

Unit

Controls

type TBlobByteData = array of Byte;

Description

TBlobByteData is the type for buffers that store information from a BLOB field.


TBlobStreamMode type

See also

Indicates how a BLOB stream can be used.

Unit

DB

type TBlobStreamMode = (bmRead, bmWrite, bmReadWrite);

Description

When a BLOB stream is first created, TBlobStreamMode is used to specify how that stream can be used. The following table lists the possible values.

Value	Meaning

bmRead	The stream is used to read from a BLOB field.

bmWrite	The stream is used to write from a BLOB field.

bwReadWrite	The stream is used to modify a BLOB field’s value.


TBlobType type

See also

Indicates the type of a BLOB field.

Unit

DB

type TBlobType = ftBlob..ftOraClob;

Description

TBlobType represents a range of TFieldType values. These are the values of in that range:

Value	Description

ftBlob	Binary Large Object field

ftMemo	Text memo field

ftGraphic	Bitmap field

ftFmtMemo	Formatted text memo field

ftParadoxOle	Paradox OLE field

ftDBaseOle	dBase OLE field

ftTypedBinary	Typed binary field

ftCursor	Not a valid blob type, don’t use.

ftFixedChar	Not a valid blob type, don’t use.

ftWideString	Not a valid blob type, don’t use.

ftLargeInt	Not a valid blob type, don’t use.

ftADT	Not a valid blob type, don’t use.

ftArray	Not a valid blob type, don’t use.

ftReference	Not a valid blob type, don’t use.

ftDataSet	Not a valid blob type, don’t use.

ftOraBlob	BLOB fields in Oracle 8 tables

ftOraClob	CLOB fields in Oracle 8 tables


TBookmark type

See also

Identifies a record in a dataset for later navigation.

Unit

DB

type TBookmark = Pointer;

Description

TBookmark is the type of the Bookmark parameter in the GetBookmark, GotoBookmark, and FreeBookmark methods of a dataset component.


TBorderWidth type

Represents the width of a control’s border.

Unit

Controls

type TBorderWidth = 0..MaxInt;

Description

Use TBorderWidth to specify the width of a border in pixels.


TButtonLayout type

See also

TButtonLayout defines values for the Layout property of TBitBtn or TSpeedButton.

Unit

Buttons

type TButtonLayout = (blGlyphLeft, blGlyphRight, blGlyphTop, blGlyphBottom);

Description

TButtonLayout defines the location of an image on a bitmap button (TBitBtn) or speed button (TSpeedButton). The following table lists the values for TButtonLayout:

Value	Meaning

blGlyphLeft	The image appears near the left side of the button.

blGlyphRight	The image appears near the right side of the button.

blGlyphTop	The image appears near the top of the button.

blGlyphBottom	The image appears near the bottom of the button.


TMPBtnType type, TButtonSet type

See also

TMPBtnType defines the possible buttons in a TMediaPlayer component. TButtonSet represents a set of those buttons.

Unit

mplayer

type

  TMPBtnType = (btPlay, btPause, btStop, btNext, btPrev, btStep, btBack, btRecord, btEject);

  TButtonSet = set of TMPBtnType;

Description

TMPBtnType represents the type of a media player button. TButtonSet is a set of button types for the media player.

Each button type has an associated action on the media player. The following table lists the button types and their associated actions:

Value	Action

btPlay	Plays the media player

btRecord	Starts recording

btStop	Stops playing or recording

btNext	Skips to the next track, or to the end if the medium doesn't use tracks

btPrev	Skips to the previous track, or to the beginning if the medium doesn't use tracks

btStep	Moves forward a number of frames

btBack	Moves backward a number of frames

btPause	Pauses playing or recording. If already paused when clicked, resumes playing or recording.

btEject	Ejects the medium.


TByteArray type

TByteArray is a general array of type Byte.

Unit

Sysutils

type

  PByteArray = ^TByteArray;

  TByteArray = array[0..32767] of Byte;

Description

TByteArray declares a general array of type Byte that can be used in typecasting.


TCalDayOfWeek type

See also

Represents a day of the week.

Unit

Comctrls

type TCalDayOfWeek = (dowMonday, dowTuesday, dowWednesday, dowThursday, dowFriday, dowSaturday, dowSunday, dowLocaleDefault);

Description

TCalDayOfWeek is used to represent a day of the week for a column in a calendar. It can be any of the following values:

Value	Meaning

dowMonday	Monday

dowTuesday	Tuesday

dowWednesday	Wednesday

dowThursday	Thursday

dowFriday	Friday

dowSaturday	Saturday

dowSunday	Sunday

dowLocaleDefault	The day of the week for the column is determined by the locale in which the application runs.


TCanResizeEvent type

The type of the OnCanResize event handler.

Unit

Controls

type TCanResizeEvent = procedure(Sender: TObject; var NewWidth, NewHeight: Integer; var Resize: Boolean) of object;

Description

Sender is the object that is being resized.

NewWidth returns the new width of the object.

NewHeight returns the new height of the object.

Resize returns True if the resize attempt can proceed and False if the attempt to resize should be aborted.


TChangeRange type

See also

Indicates the direction in which a node is moved.

Unit

Outline

type  TChangeRange = -1..1;

Description

TChangeRange is the type of the Value parameter of an outline nodes ChangeLevelby method. It can take one of the following values:

Value	Meaning

-1	Move the node toward the root by one level.

1	Move the node toward the leaf by one level.


TClassInstancing type

Used by COM factories to determine how COM objects are instantiated.

Unit

Comobj

type TClassInstancing = (ciInternal, ciSingleInstance, ciMultiInstance);

Description

TClassInstancing indicates the process space in which a COM factory can instantiate COM objects and whether a single process can create more than one instance. The following table lists the possible values of the TClassInstancing type:

Value	Meaning

ciInternal	The COM object is created by the same process as the COM server. That is, an external application cannot create an instance of this object directly.  Instead, external processes must call a method of the application that creates the document object.

ciSingleInstance	Allows only a single instance of the COM object for each executable (application).  If this single instance is not shared across multiple clients, then each client must launch its own instance of the executable.

ciMultiInstance	The COM object is created as one of multiple instances within the same executable. Any time a client requests service, a separate instance of the object gets invoked.


TColor type

TColor is used to specify the color of an object.

Unit

Graphics

type TColor = -(COLOR_ENDCOLORS + 1)..$02FFFFFF;

Description

TColor is used to specify the color of an object. It is used by the Color property of many components and by a number of other properties that specify color values.

The Graphics unit contains definitions of useful constants for TColor. These constants map either directly to the closest matching color in the system palette (for example, clBlue maps to blue) or to the corresponding system screen element color defined in the Color section of the Windows Control panel (for example, clBtnFace maps to the system color for button faces).

If you specify TColor as a specific 4-byte hexadecimal number instead of using the constants defined in the Graphics unit, the low three bytes represent RGB color intensities for blue, green, and red, respectively. The value $00FF0000 represents full-intensity, pure blue, $0000FF00 is pure green, and $000000FF is pure red. $00000000 is black and $00FFFFFF is white.

If the highest-order byte is zero ($00), the color obtained is the closest matching color in the system palette. If the highest-order byte is one ($01), the color obtained is the closest matching color in the currently realized palette. If the highest-order byte is two ($02), the value is matched with the nearest color in the logical palette of the current device context.

The following table lists the color constants from the Graphics unit. The first two columns list the colors that map to the closest matching color in the system palette, while the last two columns list the colors that are defined in the Windows Control panel.

Value	Meaning	Value	Meaning
clAqua	Aqua	clBackground	Current background color of the Windows desktop
clBlack	Black	clActiveCaption	Current color of the title bar of the active window
clBlue	Blue	clInactiveCaption	Current color of the title bar of inactive windows
clDkGray	Dark Gray	clMenu	Current background color of menus
clFuchsia	Fuchsia	clWindow	Current background color of windows
clGray	Gray	clWindowFrame	Current color of window frames
clGreen	Green	clMenuText	Current color of text on menus
clLime	Lime green	clWindowText	Current color of text in windows
clLtGray	Light Gray	clCaptionText	Current color of the text on the title bar of the active window
clMaroon	Maroon	clActiveBorder	Current border color of the active window
clNavy	Navy blue	clInactiveBorder	Current border color of inactive windows
clOlive	Olive green	clAppWorkSpace	Current color of the application workspace
clPurple	Purple	clHighlight	Current background color of selected text
clRed	Red	clHightlightText	Current color of selected text
clSilver	Silver	clBtnFace	Current color of a button face
clTeal	Teal	clBtnShadow	Current color of a shadow cast by a button
clWhite	White	clGrayText	Current color of text that is dimmed
clYellow	Yellow	clBtnText	Current color of text on a button
		clInactiveCaptionText	Current color of the text on the title bar of an inactive window
		clBtnHighlight	Current color of the highlighting on a button
		cl3DDkShadow	Windows 95 or NT 4.0 only: Dark shadow for three-dimensional display elements
		cl3DLight	Windows 95 or NT 4.0 only: Light color for three-dimensional display elements (for edges facing the light source)
		clInfoText	Windows 95 or NT 4.0 only: Text color for tool tip controls
		clInfoBk	Windows 95 or NT 4.0 only: Background color for tool tip controls


TComboBoxStyle type

TComboBoxStyle is the type for the Style property of combobox components.

Unit

Stdctrls

type TComboBoxStyle = (csDropDown, csSimple, csDropDownList, csOwnerDrawFixed, csOwnerDrawVariable);

Description

These are the values in the TComboBoxStyle type:

Value	Meaning

csDropDown	Creates a drop-down list with an edit box for manually entered text. All items are strings of the same height.

csSimple	Creates an edit box with a fixed list (list box) underneath. The length of the list is determined by the Height of the combo box.

csDropDownList	Creates a drop-down list with no edit box; the user cannot enter text manually. All items are strings of the same height.

csOwnerDrawFixed	Creates an owner-draw drop-down list with an edit box for manually entered text. Each item in the list is the height specified by the ItemHeight property.

csOwnerDrawVariable	Creates an owner-draw drop-down list with an edit box for manually entered text. List items can have varying heights.


TComponentName type

TComponentName is the type for the Name property for all components.

Unit

Classes

type TComponentName: string;

Description

TComponentName is the type of the Name property for all components.


TConnectChangeEvent type

See also

The type for a method that responds when a database connection is established or terminated.

Unit

Classes

type TConnectChangeEvent = procedure(Sender: TObject; Connecting: Boolean) of object;

Description

When an object is registered with a TCustomConnection descendant, it can ask to be notified when the connection is established or terminated. The TCustomConnection component notifies the object by calling a method of type TConnectChangeEvent. In effect, this allows the connection component to generate an event on another object.

Sender is the connection component that has just established a connection or is about to terminate a connection.

Connecting indicates whether the connection has just been created (True), or is about to be terminated (False).


TConstrainedResizeEvent type

The type of the OnConstrainedResize event handler.

Unit

Controls

type TConstrainedResizeEvent = procedure(Sender: TObject; var MinWidth, MinHeight, MaxWidth, MaxHeight: Integer) of object;

Description

Sender is the object that is being resized.

MinWidth returns the minimum width to which the object can be resized.

MinHeight returns the minimum height to which the object can be resized.

MaxWidth returns the maximum width to which the object can be resized.

MaxHeight returns the maximum height to which the object can be resized.


TContextPopupEvent type

The type of the OnContextPopup event handler.

Unit

Controls

type TContextPopupEvent = procedure(Sender: TObject; MousePos: TPoint, var Handled: Boolean) of object;

Description

Sender is the control for which the user requested a popup menu.

MousePos indicates the position of the mouse, in client coordinates, when the user clicked the right mouse button. If the user did not use a right click to invoke the popup (for example, if the event occurs in response to keyboard input), MousePos is (-1,-1).

Handled determines whether the control proceeds with its default context menu processing after the event handler exits. If the event handler sets Handled to True, the control does nothing more to respond to the user action. If the event handler leaves Handled as False, the control then looks up the associated popup menu and, if its AutoPopup property is True, displays it.


TCoolBandMaximize type

Specifies the conditions under which a TCoolBand is maximized.

Unit

Comctrls

type TCoolBandMaximize = (bmNone, bmClick, bmDblClick);

Description

TCoolBandMaximize specifies the conditions under which a TCoolBand becomes maximized:

Value	Meaning

bmNone	The Cool Band is never maximized.

bmClick	The Cool Band is maximized when the user clicks with the left mouse button.

bmDblClick	The CoolBand is maximized when the user double-clicks with the left mouse button.


TCreateInfo type

See also

TCreateInfo is a record used by TOleContainer's CreateObjectFromInfo method.

Unit

OleCtnrs

type

  TCreateInfo = record

    CreateType: TCreateType;

    ShowAsIcon: Boolean;

    IconMetaPict: HGlobal;

    ClassID: TCLSID;

    FileName: string;

    DataObject: IDataObject;

  end;

Description

TCreateInfo is a record used by TOleContainer's  CreateObjectFromInfo method. TCreateInfo's fields are  described in the following table:

Fields	Meaning

CreateType	Describes the source of the object. See TCreateType for details.

ShowAsIcon	Indicates whether the object is shown as an icon (True) or displayed as it would be in the server application (False).

IconMetaPict	Specifies a global memory handle to a metafile picture (TMetaFilePict) to display in place of the OLE object's default icon. IconMetaPict is optional; When set to 0, the object's default icon is used (when ShowAsIcon is True).

ClassID	The class identifier of the OLE object to create. ClassID is only used when CreateType is ctNewObject. You can use the ProgIDToClassID function to get the class identifier for an OLE object's class name (or programmatic identifier).

FileName	The name of a file to link or embed as an OLE object. FileName is only used when CreateType is ctFromFile or ctLinkToFile.

DataObject	An OLE data transfer object. DataObject is only used when CreateType is ctFromData or ctLinkFromData.


TCreateParams type

See also

TCreateParams is the window-creation parameter record used to specify the type of window to create for a windowed control.

Unit

Controls

type

  TCreateParams = record

    Caption: PChar;

    Style: DWORD;

    ExStyle: DWORD;

    X, Y: Integer;

    Width, Height: Integer;

    WndParent: HWND;

    Param: Pointer

    WindowClass: TWndClass;

    WinClassName: array[0..63] of Char;

  end;

Description

The TCreateParams type is a data structure holding information needed when telling Windows to create a window handle. The fields of a TCreateParams record become the parameters to a call to the CreateWindowEx API function.  TCreateParams contains the following fields:

Field	Meaning

Caption	The window caption.  This is usually the value of the Caption or Text property of the control.

Style	The Windows style for the window. This is a bit array of flags such as WS_CHILD or WS_DISABLED. See the Microsoft Windows documentation for possible flags.

ExStyle	The extended Windows style for the window. This is one of the Windows predefined extended style constants such as WS_EX_TOOLWINDOW or WS_EX_CONTROLPARENT. See the Microsoft Windows documentation for possible values.

X	The x coordinate of the left side of the window.  This is usually the same as the Left property.

Y	The y coordinate of the top of the window.  This is usually the same as the Top property.

Width	The width, in pixels, of the window. This is usually the same as the Width property.

Height	The height, in pixels, of the window. This is usually the same as the Height property.

WndParent	The window handle of the parent window. This is the same as the Handle property of the parent control or, if the Parent property is nil, the value of ParentWindow.

Param	A pointer to the windows creation parameter that is passed as the LParam of the WM_CREATE message.

WindowClass	The WindowClass record that describes the class of window being created. The WindowClass record includes information about the window procedure, style, default cursor, background brush, associated menus, and so on.

WinClassName	The window class name. This must be the name of a window class that has already been registered. Windows provides several built-in window classes with predefined names. Applications may also register their own custom window classes.


TCreateType type

See also

TCreateType is an enumerated type that defines values for TCreateInfo's CreateType field.

Unit

OleCtnrs

type TCreateType = (ctNewObject, ctFromFile, ctLinkToFile, ctFromData, ctLinkFromData);

Description

TCreateType defines the possible values for TCreateInfo's CreateType field which is passed to TOleContainer's  CreateObjectFromInfo method. Defined as follows:

Values	Meaning

ctNewObject	Creates an embedded OLE object given its class identifier (TCreateInfo.ClassID)

ctFromFile	Creates an embedded OLE object from the contents of the given file (TCreateInfo.FileName).

ctLinkToFile	Creates a linked OLE object from the contents of the given file (TCreateInfo.FileName)

ctFromData	Creates an embedded OLE object from the given data transfer object (TCreateInfo.DataObject)

ctLinkFromData	Creates a linked OLE object from the given data transfer object (TCreateInfo.DataObject)


TCursor type

See also

TCursor represents a mouse cursor image.

Unit

Controls

type TCursor = -32768..32767;

Description

TCursor is an index into the global list of available cursors maintained by the Screen variable. TCursor values can include indexes to custom cursors added by an application, in addition to the predefined constants defined in the controls unit. The following table lists the predefined cursor constants and their position in the Cursors property array:

Constant	Value	Image

crDefault	0	Whatever cursor is the default for the window class (usually crArrow).

crNone	-1

crArrow	 -2

crCross	-3

crIBeam	-4

crSizeNESW	-6

crSizeNS	-7

crSizeNWSE	-8

crSizeWE	-9

crUpArrow	-10

crHourGlass	-11

crDrag	-12

crNoDrop	-13

crHSplit	-14

crVSplit	-15

crMultiDrag	-16

crSQLWait	-17

crNo	-18

crAppStart	-19

crHelp	-20

crHandPoint	-21

crSize	-22	(obsolete)

crSizeAll	-22


TCustomDrawStage type

Used to specify a stage in the custom drawing process.

Unit

Comctrls

type TCustomDrawStage = (cdPrePaint, cdPostPaint, cdPreErase, cdPostErase);

Description

Use TCustomDrawStage to determine when an advanced custom drawing event occurs:

Value	Meaning

cdPrePaint	Before painting.

cdPostPaint	After painting.

cdPreErase	Before erasing.

cdPostErase	After erasing.


TCustomDrawState type

Used to specify a custom drawing state.

Unit

Comctrls

type TCustomDrawState = set of (cdsSelected, cdsGrayed, cdsDisabled, cdsChecked, cdsFocused, cdsDefault, cdsHot, cdsMarked, cdsIndeterminate);

Description

TCustomDrawState indicates state information that can affect how a control is drawn. It includes a set drawn from the following values:

Value	Meaning

cdsSelected	The control or item is selected.

cdsGrayed	The control or item should appear grayed.

cdsDisabled	The control or item is disabled.

cdsChecked	The item should appear checked.

cdsFocused	The control or item has input focus.

cdsDefault	The item is the default item.

cdsHot	The item is under the mouse and the HotTrack property is True.

cdsMarked	The item is marked (marked items appear shaded by default).

cdsIndeterminate	The item is neither selected nor unselected.


TCustomDrawTarget type

Used to specify the target of a custom drawing event.

Unit

Comctrls

type TCustomDrawTarget = (dtControl, dtItem, dtSubItem);

Description

TCustomDrawTarget is used to indicate a specific type of custom drawing event. The following table lists the possible values:

Value	Meaning

dtControl	The event occurs when the entire control needs to be painted.

dtItem	The event occurs when an individual item within the control needs to be painted.

dtSubItem	The event occurs when a subitem needs to be painted.


TDataAction type

Used to indicate how an application should respond to a database error condition.

Unit

Comctrls

type TDataAction = (daFail, daAbort, daRetry);

Description

TDataAction is the type of a parameter in certain dataset event handlers that indicates how the dataset should proceed after the event handler exits. The following table summarizes the possible values:

Value	Meaning

daFail	Abort the operation that led to an error and display an error message.

daAbort	Abort the operation that led to an error without displaying a message.

daRetry	Repeat the operation that led to an error. The cause of the error should be corrected within the event handler before returning this value.


TDataSetNotifyEvent type

TDataSetNotifyEvent is a pointer to a method used to notify a dataset component an event has occurred.

Unit

DB

type TDataSetNotifyEvent = procedure(DataSet: TDataSet) of object;

Description

TDataSetNotifyEvent specifies a method that notifies a dataset component when an event has occurred. It is used by most events on the various dataset components. The DataSet parameter is the dataset component that is receiving the notification.


TDataSetState type

See also

Indicates the current operating mode of a dataset component.

Unit

Db

type TDataSetState = (dsInactive, dsBrowse, dsEdit, dsInsert, dsSetKey, dsCalcFields, dsFilter, dsNewValue, dsOldValue, dsCurValue, dsBlockRead, dsInternalCalc, dsOpening);

Description

TDataSetState represents the values that may be in the State property of a dataset component. TDataSetState indicates the current operating mode of that dataset component. The following table lists all possible values in the TDataSetState type and describes what they indicate in the State property:

Value	Meaning

dsInactive	Dataset is closed, so its data is unavailable.

dsBrowse	Data can be viewed, but not changed. This is the default state of an open dataset.

dsEdit	Active record can be modified.

dsInsert	The active record is a newly inserted buffer that has not been posted. This record can be modified and then either posted or discarded.

dsSetKey	TTable and TClientDataSet only. Record searching is enabled, or a SetRange operation is under way. A restricted set of data can be viewed, and no data can be edited or inserted.

dsCalcFields	An OnCalcFields event is in progress. Noncalculated fields cannot be edited, and new records cannot be inserted.

dsFilter	An OnFilterRecord event is in progress. A restricted set of data can be viewed. No data can edited or inserted.

dsNewValue	Temporary state used internally to indicate that a field component’s NewValue property is being accessed.

dsOldValue	Temporary state used internally to indicate that a field component’s OldValue property is being accessed.

dsCurValue	Temporary state used internally to indicate that a field component’s CurValue property is being accessed.

dsBlockRead	Data-aware controls are not updated and events are not triggered when the cursor moves (Next is called).

dsInternalCalc	Temporary state used internally to indicate that values need to be calculated for a field that has a FieldKind of fkInternalCalc.

dsOpening	DataSet is in the process of opening but has not finished. This state occurs when the dataset is opened for asynchronous fetching.


TDataType type

Indicates the type of a parameter.

Unit

DB

type TDataType = TFieldType;

Description

TDataType represents a field type when it is applied to a parameter.


TDate type

See also

TDate is a used to represent a date.

Unit

Controls

type TDate = type TDateTime;

Description

TDate represents a special type of TDateTime value that has no decimal part. A TDate value represents the number of days that have elapsed since 12/30/1899.


TDateTime type

See also

TDateTime is a used by the date and time routines to hold date and time values.

Unit

System

type  TDateTime = type Double;

Description

Most VCL objects represent date and time values using the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is fraction of a 24 hour day that has elapsed.

Following are some examples of TDateTime values and their corresponding dates and times:

0	12/30/1899 12:00 am
2.75	1/1/1900 6:00 pm
-1.25	12/29/1899 6:00 am
35065	1/1/1996 12:00 am
To find the fractional number of days between two dates, simply subtract the two values. Likewise, to increment a date and time value by a certain fractional number of days, simply add the fractional number to the date and time value.

Note:	Delphi 1.0 calculated the date from year 1 instead of from 1899. To convert a Delphi 1.0 date to a Delphi 2.0 date, subtract 693594.0 from the Delphi 1.0 date. The date format changed to be more compatible with OLE 2.0 Automation.


TDateTimeColors type

See also

Specifies colors used in a calendar control.

Unit

Comctrls

type TDateTimeColors = TMonthCalColors;

Description

TDateTimeColors is provided for backward compatibility on the TDateTimePicker object.


TDimGroup type

See also

Indicates a group of dimensions in a decision source component.

Unit

Comctrls

type TDimGroup = (dgRow, dgCol, dgSum, dgPage, dgNone);

Description

Decision Source components use TDimGroup to identify a group of dimensions from a pivot state of the associated decision cube’s dimension map. Usually a TDimGroup value is used in combination with an index that specifies a particular dimension from the identified group.

The following table lists the possible values:

Value	Meaning

dgRow	Identifies the row dimensions of the current pivot state.

dgCol	Identifies the column dimensions of the current pivot state.

dgSum	Identifies the set of active summaries.

dgPage	Identifies a paged dimension in the current pivot state. Decision grids do not display paged dimensions. Rather, paged dimensions limit the entire display to summaries that represent a single value along the paged dimension.

dgNone	Not used.


TDockDropEvent type

Used in the OnDockDrop event.

Unit

Controls

type TDockDropEvent = procedure(Sender: TObject; Source: TDragDockObject;  X, Y: Integer) of object;

Description

Sender is the object on which another object is being dropped.

Source is information about the object that is being dropped.

X and Y are the coordinates of the mouse pointer.


TDockNotifyRec, PDockNotifyRec type

Contains a Windows Docking notification message.

Unit

Controls

type

  PDockNotifyRec = ^TDockNotifyRec;

  TDockNotifyRec = record

    ClientMsg: Cardinal;

    MsgWParam: Integer;

    MsgLParam: Integer;

  end;

Description

ClientMsg is the Windows message ID.

MsgWParam is the message’s WParam.

MsgLParam is the message’s LParam.


TDockOrientation type

Used to specify the orientation of controls in a docking zone.

Unit

Controls

type TDockOrientation = (doNoOrient, doHorizontal, doVertical);

Description

TDockOrientation can have one of the following values:

Value	Meaning

doNoOrient	The zone contains a control instead of child zones.

doHorizontal	The zone’s children are arranged top to bottom.

doVertical	The zone’s children are arranged left to right.


TDockOverEvent type

Used in the OnDockOver event.

Unit

Controls

type TDockOverEvent = procedure(Sender: TObject; Source: TDragDockObject; X, Y: Integer; State: TDragState; var Accept: Boolean) of object;

Description

Sender is the object over which another object is being dragged.

Source is information about the object that is being dragged.

X and Y are the coordinates of the mouse pointer.

DragState is the current drag state.

Accept returns whether or not the control accepts the dragged object for docking.


TDragKind type

Indicates the type of operation that occurs when the user drags a control.

Unit

Controls

type TDragKind = (dkDrag, dkDock);

Description

TDragKind can have one of the following values:

Value	Meaning

dkDrag	The object is being dragged for a drag-and-drop operation.

dkDock	The object is being dragged for a drag-and-dock operation.


TDragMode type

Indicates how a control initiates drag-and-drop or drag-and-dock operations.

Unit

Controls

type TDragMode = (dmManual, dmAutomatic);

Description

TDragMode can have one of the following values:

Value	Meaning

dmAutomatic	The control begins a drag operation automatically when the user clicks and drags it.

dmManual	The control can't be dragged until the application calls the BeginDrag method.


TDragState type

Used to specify how the mouse is moving in relation to a control.

Unit

Comctrls

type TDragState = (dsDragEnter, dsDragLeave, dsDragMove);

Description

TDragState describes how the mouse is moving in relation to a control that it is passing over. It has one of the following values:

Value	Meaning

dsDragEnter	The mouse just moved over the control.

dsDragLeave	The mouse is moving off of the control.

dsDragMove	The mouse is moving while over the control.


TDrawItemEvent type

The type of an OnDrawItem event handler.

type TDrawItemEvent = procedure(Control: TWinControl; Index: Integer Rect: TRect; State: TOwnerDrawState) of object;

Description

TDrawItemEvent includes the following parameters:

Control	A reference to the control containing the item.

Index	The index of the item in the Items property.

Rect	The coordinates of the item on the control’s canvas.

State	The state of the item, which indicates whether the item is selected, checked, focused, and so on.


TDrawTabEvent type

The type of the TCustomTabControl.OnDrawTab event handler.

Unit

Comctrls

type TDrawTabEvent = procedure(Control: TCustomTabControl; TabIndex: Integer; const Rect: TRect; Active: Boolean) of object;

Description

Control is the tab control in which a tab is about to be drawn.

TabIndex is the index of the tab that is about to be drawn.

Rect is the area in which the tab is about to be drawn.

Active specifies whether or not the tab is active.


TEndDragEvent type

Used for OnEndDrag and OnEndDock event handlers.

Unit

Controls

type TEndDragEvent = procedure(Sender, Target: TObject; X, Y: Integer) of object;

Description

The Sender is the object being dragged, Target is the object Sender is dragged to, and X and Y are screen coordinates in pixels.

The OnEndDrag event is received by Sender. If the dragged object was dropped or docked and accepted by a control, the Target parameter of the OnEndDrag event is set to the object that accepted the sender. If the object was not dropped successfully, the value of Target is nil.


TEnumModuleFunc type

See also

TEnumModuleFunc is the type of the callback function used in module enumeration.

Unit

System

type TEnumModuleFunc = function (HInstance: Integer; Data: Pointer): Boolean;

Description

TEnumModuleFunc is the type of a user-defined callback function passed as a parameter to the EnumModules and the EnumResourceModules procedures. TEnumModuleFunc receives an instance handle (HINSTANCE) and a user-defined data value for every module enumerated. The parameters to TEnumModuleFunc are as follows:

Parameter	Meaning

HInstance	The instance handle of the module being enumerated.

Data	A 32-bit user-defined value passed to the enumeration procedure.

To continue enumerating modules, TEnumModuleFunc must return True; to stop enumerating modules, it must return False.


TEnumModuleFuncLW type

See also

TEnumModuleFuncLW is the type of the callback function used in module enumeration.

Unit

System

type TEnumModuleFuncLW = function (HInstance: LongWord; Data: Pointer): Boolean;

Description

TEnumModuleFuncLW is the type of a user-defined callback function passed as a parameter to the EnumModules and the EnumResourceModules procedures. TEnumModuleFuncLW receives an instance handle (HInstance) and a user-defined data value for every module enumerated. The parameters to TEnumModuleFuncLW are as follows:

Parameter	Meaning

HInstance	The instance handle of the module being enumerated (as a long word).

Data	A 32-bit user-defined value passed to the enumeration procedure.

To continue enumerating modules, TEnumModuleFuncLW must return True; to stop enumerating modules, it must return False.


ExceptClass type

Specifies an exception class.

Unit

Sysutils

ExceptClass = class of Exception;

Description

Use ExceptClass to refer to the type of a descendant of Exception.


TTrackButton type

Used to specify which mouse button activates a tool button menu.

Unit

Menus

type TTrackButton = (tbRightButton, tbLeftButton);

Description

TTrackButton can have one of the following values:

Value	Meaning

tbRightButton	The right mouse button activates the tool button menu.

tbLeftButton	The left mouse button activates the tool button menu.


TFieldClass type

TFieldClass is the class type of a TField descendant.

Unit

DB

type TFieldClass = class of TField;

typedef

Description

Use TFieldClass to specify the type of a TField descendant.


TFieldType type

TFieldType is a set of values that parallel the data types of fields in tables.

Unit

DB

type TFieldType = (ftUnknown, ftString, ftSmallint, ftInteger, ftWord, ftBoolean, ftFloat, ftCurrency, ftBCD, ftDate, ftTime, ftDateTime, ftBytes, ftVarBytes, ftAutoInc, ftBlob, ftMemo, ftGraphic, ftFmtMemo, ftParadoxOle, ftDBaseOle, ftTypedBinary, ftCursor, ftFixedChar, ftWideString, ftLargeint, ftADT, ftArray, ftReference, ftDataSet, ftOraBlob, ftOraClob, ftVariant, ftInterface, ftIDispatch, ftGuid);

Description

TFieldType type is the set of values for the DataType property field objects, field definition objects, and parameter objects. Classes in which TFieldType values are used include TField (and descendants), TFieldDef, TParam, TParameter, and TAggregate. TFieldType values are also used in field-related functions and methods like TFieldDefs.Add. The following table describes each value:

Value	Description

ftUnknown	Unknown or undetermined

ftString	Character or string field

ftSmallint	16-bit integer field

ftInteger	32-bit integer field

ftWord	16-bit unsigned integer field

ftBoolean	Boolean field

ftFloat	Floating-point numeric field

ftCurrency	Money field

ftBCD	Binary-Coded Decimal field

ftDate	Date field

ftTime	Time field

ftDateTime	Date and time field

ftBytes	Fixed number of bytes (binary storage)

ftVarBytes	Variable number of bytes (binary storage)

ftAutoInc	Auto-incrementing 32-bit integer counter field

ftBlob	Binary Large OBject field

ftMemo	Text memo field

ftGraphic	Bitmap field

ftFmtMemo	Formatted text memo field

ftParadoxOle	Paradox OLE field

ftDBaseOle	dBASE OLE field

ftTypedBinary	Typed binary field

ftCursor	Output cursor from an Oracle stored procedure (TParam only)

ftFixedChar	Fixed character field

ftWideString	Wide string field

ftLargeInt	Large integer field

ftADT	Abstract Data Type field

ftArray	Array field

ftReference	REF field

ftDataSet	DataSet field

ftOraBlob	BLOB fields in Oracle 8 tables

ftOraClob	CLOB fields in Oracle 8 tables

ftVariant	Data of unknown or undetermined type

ftInterface	References to interfaces (IUnknown)

ftIDispatch	References to IDispatch interfaces

ftGuid	globally unique identifier (GUID) values


TFileName type

TFileName is a string that represents a file name.

Unit

Sysutils

type TFileName = String;

Description

Use TFileName to represent strings that are only used for file names.


TFileRec type

See also

TFileRec is the internal format for typed and untyped files.

Unit

Sysutils

type TFileRec = packed record
  Handle: Integer;
  Mode: Integer;
  RecSize: Cardinal;
  Private: array[1..28] of Byte;
  UserData: array[1..32] of Byte;
  Name: array[0..259] of Char;
end;

Description

TFileRec is the internal format for typed and untyped files. TFileRec enables you to typecast a file variable to access its internal fields.

Note:	You would normally never declare a variable of this type.


TFilterOption, TFilterOptions type

Influences how filter strings are applied.

Unit

Db

type

  TFilterOption = (foCaseInsensitive, foNoPartialCompare);

  TFilterOptions = set of TFilterOption;

Description

TFilterOptions is a set that specifies how filter expressions are applied to string fields. It can contain zero or more of the following values:

Value	Meaning

foCaseInsensitive	Literal strings in the filter are compared to string-valued fields case-insensitively.

foNoPartialCompare	Asterisks (*) in the filter are treated as literal characters rather than as wildcards. When filter options does not include foNoPartialCompare, strings that end in an asterisk signify a partial string match with the asterisk matching any number of characters.


TFloatFormat type

See also

TFloatFormat is an enumerated list of formatting codes for float functions.

Unit

Sysutils

type TFloatFormat = (ffGeneral, ffExponent, ffFixed, ffNumber, ffCurrency);

Description

TFloatFormat defines an enumerated list of formatting codes for the float functions.

Format	Defines
ffGeneral	General number format. The value is converted to the shortest possible decimal string using fixed or scientific format. Trailing zeros are removed from the resulting string, and a decimal point appears only if necessary. The resulting string uses fixed point format if the number of digits to the left of the decimal point in the value is less than or equal to the specified precision, and if the value is greater than or equal to 0.00001. Otherwise the resulting string uses scientific format, and the Digits parameter specifies the minimum number of digits in the exponent (between 0 and 4).
ffExponent	Scientific format. The value is converted to a string of the form "-d.ddd...E+dddd". The resulting string starts with a minus sign if the number is negative, and one digit always precedes the decimal point. The total number of digits in the resulting string (including the one before the decimal point) is given by the Precision parameter. The "E" exponent character in the resulting string is always followed by a plus or minus sign and up to four digits. The Digits parameter specifies the minimum number of digits in the exponent (between 0 and 4).
ffFixed	Fixed point format. The value is converted to a string of the form "-ddd.ddd...". The resulting string starts with a minus sign if the number is negative, and at least one digit always precedes the decimal point. The number of digits after the decimal point is given by the Digits parameter--it must be between 0 and 18. If the number of digits to the left of the decimal point is greater than the specified precision, the resulting value will use scientific format.
ffNumber	Number format. The value is converted to a string of the form "-d,ddd,ddd.ddd...". The ffNumber format corresponds to the ffFixed format, except that the resulting string contains thousand separators.
ffCurrency	Currency format. The value is converted to a string that represents a currency amount. The conversion is controlled by the CurrencyString, CurrencyFormat, NegCurrFormat, ThousandSeparator, and DecimalSeparator global variables, all of which are initialized from the Currency Format in the International section of the Windows Control Panel. The number of digits after the decimal point is given by the Digits parameter--it must be between 0 and 18.


TFloatRec type

TFloatRec is the result record for FloatToDecimal.

Unit

Sysutils

type TFloatRec = record
  Exponent: Smallint;
  Negative: Boolean;
  Digits: array[0..20] of Char;
end;

Description

TFloatRec is the FloatToDecimal result record. Values are stored in a TFloatRec record as follows:

Field	Value

Exponent	Contains the magnitude of the number, i.e. the number of significant digits to the right of the decimal point. The Exponent field is negative if the absolute value of the number is less than one. If the number is a NAN (not-a-number), Exponent is set to -32768. If the number is INF or -INF (positive or negative infinity), Exponent is set to 32767.

Negative	True if the number is negative, False if the number is zero or positive.

Digits	Contains up to 18 (for type Extended) or 19 (for type Currency) significant digits followed by a null terminator. The implied decimal point (if any) is not stored in Digits. Trailing zeros are removed, and if the resulting number is zero, NAN, or INF, Digits contains nothing but the null terminator.


TFloatValue type

TFloatValue is the type of the ValueType parameter for floating point conversion routines.

Unit

Sysutils

type TFloatValue = (fvExtended, fvCurrency);

Description

TFloatValue is the type of the ValueType parameter of the FloatToText, FloatToTextFmt and TextToFloat functions and the FloatToDecimal procedure. The ValueType parameter indicates whether the value being passed to the function or procedure is a currency value or a normal floating-point value.

Value	Meaning

fvExtended	The value is a normal floating-point type.

fvCurrency	The value is a currency type.


TFontCharset type

TFontCharset represents the character set of a font.

Unit

Sysutils

type TFontCharset = 0..255;

Description

Each Windows typeface supports one or more character sets. The particular character sets depend on the font. Check with the font vendor to determine which typeface’s are supported.

The following table lists the predefined constants provided for standard character sets:

Constant	Value	Description

ANSI_CHARSET	0	ANSI characters.

DEFAULT_CHARSET	1	Font is chosen based solely on Name and Size. If the described font is not available on the system, Windows will substitute another font.

SYMBOL_CHARSET	2	Standard symbol set.

MAC_CHARSET	77	Macintosh characters. Not available on NT 3.51.

SHIFTJIS_CHARSET	128	Japanese shift-jis characters.

HANGEUL_CHARSET	129	Korean characters (Wansung).

JOHAB_CHARSET	130	Korean characters (Johab). Not available on NT 3.51

GB2312_CHARSET	134	Simplified Chinese characters (mainland china).

CHINESEBIG5_CHARSET	136	Traditional Chinese characters (taiwanese).

GREEK_CHARSET	161	Greek characters. Not available on NT 3.51.

TURKISH_CHARSET	162	Turkish characters. Not available on NT 3.51

VIETNAMESE_CHARSET	163	Vietnamese characters. Not available on NT 3.51.

HEBREW_CHARSET	177	Hebrew characters. Not available on NT 3.51

ARABIC_CHARSET	178	Arabic characters. Not available on NT 3.51

BALTIC_CHARSET	186	Baltic characters. Not available on NT 3.51.

RUSSIAN_CHARSET	204	Cyrillic characters. Not available on NT 3.51.

THAI_CHARSET	222	Thai characters. Not available on NT 3.51

EASTEUROPE_CHARSET	238	Includes diacritical marks for eastern european countries. Not available on NT 3.51.

OEM_CHARSET	255	Depends on the codepage of the operating system.


TFormBorderStyle, TBorderStyle types

TFormBorderStyle is the type of the BorderStyle property for Forms and windows.  TBorderStyle is the type of the BorderStyle property for other controls.

Unit

Forms

type

  TFormBorderStyle = (bsNone, bsSingle, bsSizeable, bsDialog, bsToolWindow, bsSizeToolWin);

  TBorderStyle = bsNone..bsSingle;

Description

These are the possible values of the TFormBorderStyle type:

Value	Meaning

bsNone	No visible border. (not resizeable)

bsSingle	Single-line border. (not resizeable)

bsDialog	Standard dialog box border. (not resizeable)

bsSizeable	Standard resizeable border.

bsToolWindow	Like bsSingle but with a smaller caption.

bsSizeToolWin	Like bsSizeable but with a smaller caption.

Only the bsNone and bsSingle values are possible values of TBorderStyle.


TGetChildProc type

See also

The type of the Proc parameter of the GetChildren method.

Unit

Controls

type TGetChildProc = procedure (Child: TComponent) of object;

Description

The component streaming system uses TGetChildProc to execute callbacks for all the children of a given component. By using callbacks, the streaming system allows components to adjust which children are loaded and saved with the component.

The Child parameter is the child component for which the callback is executed. The GetChildren method calls the callback for each child that should be loaded or saved by the streaming system.


TGetSiteInfoEvent type

The type of the OnGetSiteInfo event handler.

Unit

Controls

type TGetSiteInfoEvent = procedure(Sender: TObject; DockClient: TControl; var InfluenceRect: TRect; MousePos: TPoint; var CanDock: Boolean) of object;

Description

Sender is the dock site.

DockClient is the control being dragged.

InfluenceRect is the rectangle in which DockClient will be docked. This can be adjusted by the event handler.

MousePos is the position of the mouse pointer. This can be adjusted by the event handler.

CanDock returns whether the dragged control can be docked to the dock site.


TGetStrProc type

TGetStrProc is the type for callback functions that are called once for every string in a set of strings.

Unit

Classes

type TGetStrProc = procedure(const S: string) of object;

Description

Use TGetStrProc as the type of a callback function that responds to a set of string values. The function is called once for every string in the set, with the S parameter set to the current string.


TGridDrawInfo type

Represents information that is useful when rendering a grid.

Unit

Grids

type

  TGetExtentsFunc = function(Index: Longint): Integer of object;

  TGridAxisDrawInfo = record

    EffectiveLineWidth: Integer;

    FixedBoundary: Integer;

    GridBoundary: Integer;

    GridExtent: Integer;

    LastFullVisibleCell: Longint;

    FullVisBoundary: Integer;

    FixedCellCount: Integer;

    FirstGridCell: Integer;

    GridCellCount: Integer;

    GetExtent: TGetExtentsFunc;

  end;

  TGridDrawInfo = record

    Horz, Vert: TGridAxisDrawInfo;

  end;

Description

TGridDrawInfo encapsulates information that reflects the layout of the grid axes.


TGridDrawState type

TGridDrawState represents information that is useful when rendering the cell of a grid.

Unit

Classes

type

  TGridDrawState = set of (gdSelected, gdFocused, gdFixed);

Description

TGridDrawState represents state information about the cell of a grid that is being rendered. It is a set that includes 0 or more of the following:

Value	Meaning

gdSelected	The cell is currently selected.

gdFocused	The cell has input focus.

gdFixed	The cell is in the fixed region of the grid.


TGridState type

TGridState indicates any user actions that are currently changing the layout of the grid.

Unit

Classes

type TGridState = (gsNormal, gsSelecting, gsRowSizing, gsColSizing, gsRowMoving, gsColMoving );

Description

TGridState represents state information about how the grid layout is changing. The following table lists the possible values:

Value	Meaning

gsNormal	The grid layout is not changing.

gsSelecting	The user is selecting a cell or row.

gsRowSizing	The user is changing the height of a row.

gsColSizing	The user is changing the width of a column.

gsRowMoving	The user is dragging a row to a new position.

gsColMoving	The user is dragging a column to a new position.


THeaderStyle type

Used to specify a header style.

Unit

Comctrls

type THeaderStyle = (hsButtons, hsFlat);

Description

THeaderStyle can have one of the following values:

Value	Meaning

hsButtons	The column sections are buttons.

hsFlat	The column sections are flat buttons.


THelpContext type

Represents a WinHelp context ID.

Unit

Classes

type THelpContext = -MaxLongInt..MaxLongInt;

Description

The Windows Help system associates each help topic with a unique number, or context ID. An application identifies the topic to WinHelp by passing this context ID.

THelpContext values are used both when associating controls, menu items, and dialogs with help topics and when invoking the Windows help system.


THintInfo type

THintInfo is used to define the appearance and behavior of the Help window.

Unit

Forms

type

  THintWindowClass = class of THintWindow;

  THintInfo = record

    HintControl: TControl;

    HintWindowClass: THintWindowClass;

    HintPos: TPoint;

    HintMaxWidth: Integer;

    HintColor: TColor;

    CursorRect: TRect;

    CursorPos: TPoint;

    ReshowTimeout: Integer;

    HideTimeout: Integer;

    HintStr: string;

    HintData: Pointer;

  end;

Description

The THintInfo type is used to define the appearance and behavior of the Help window in a TShowHintEvent type OnShowHint event handler.  The following table describes the meaning of its fields:

Field	Meaning

HintControl	The name of the control for which hint processing is occurring.

HintWindowClass	The class of the hint-window control. The default is THintWindow, but you can specify any class derived from THintWindow. Use this field if you want to substitute a custom hint window for the standard VCL component.

HintPos 	The default position in screen coordinates of the top-left corner of the hint window. Change where the window appears by changing this value.

HintMaxWidth	The maximum width of the hint window before word wrapping begins. By default, the value is the width of the screen (Screen.Width).

HintColor	The background color of the Hint window.

CursorRect	The rectangle the user's mouse pointer must be in for the hint window to appear. The default value for CursorRect is the client rectangle of the control. Change this value so that a single control can be divided into several hint regions. When the user moves the mouse pointer outside the rectangle, the hint window disappears.

CursorPos 	The location of the mouse pointer within the control.

ReshowTimeout 	How long the hint system should wait before asking about the hint status again. By default, this field is zero, indicating that the hint status will not change. Setting it to a non-zero value will cause the hint to act, after the requested milliseconds have elapsed, as if the user moved the mouse outside the hint rectangle and back in. This can be used to either put off hint processing for a period of time, or to allow the hint to be updated periodically.

HideTimeout 	The number of milliseconds to show the hint. It is set to Application.HintHidePause by default.

HintStr 	The string to be displayed in the hint window. This allows an OnHint event handler to modify the contents of a hint before it is displayed. By default it contains the value of the following expression: GetShortHint(Application.Hint).

  HintData	Additional data to be passed to the hint-window control. Use this field in conjunction with HintWindowClass.


THitTest, THitTests type

Used in the GetHitTestInfoAt method.

Unit

Comctrls

type

  THitTest = (htAbove, htBelow, htNowhere, htOnItem, htOnButton, htOnIcon, htOnIndent, htOnLabel, htOnRight, htOnStateIcon, htToLeft, htToRight);

  THitTests = set of THitTest;

Description

THitTests is a set of THitTest values. THitTest can have any of the following values:

Value	Means the point is

htAbove	Above the client area.

htBelow	Below the client area.

htNowhere	Inside the control, but not on an item.

htOnItem	On an item, its text, or its bitmap.

htOnButton	On a button.

htOnIcon	On an icon.

htOnIndent	On the indented area of an item.

htOnLabel	On a label.

htOnRight	On the right side of an item.

htOnStateIcon	On a state icon or bitmap associated with an item.

htToLeft	To the left of the client area.

htToRight	To the right of the client area.


THTMLAlign type

Represents horizontal alignment within an HTML document or the cell of an HTML table.

Unit

Httpapp

type THTMLAlign = (haDefault, haLeft, haRight, haCenter);

Description

THTMLAlign describes the value of an Align option in an HTML tag. The following table lists the possible values:

Value	Meaning

haDefault	The web browser can position the HTML control or text where it wants.

haLeft	Web browsers position the HTML control or text with its left edge on the left edge of the HTML document or HTML table cell in which it appears.

haRight	Web browsers position the HTML control or text with its right edge on the right edge of the HTML document or HTML table cell in which it appears.

haCenter	Web browsers horizontally center the HTML control or text within the HTML document or HTML table cell in which it appears.


THTMLBgColor type

Represents the background color of an HTML control or text element.

Unit

Httpapp

type THTMLBgColor = type string;

Description

THTMLBgColor describes the value of a BgColor option in an HTML tag. Its value is any string that a Web browser recognizes as the name of a color. Most browser recognize the following strings:

Aqua	Black	Blue
Fuschia	Gray	Green
Lime	Maroon	Navy
Olive	Purple	Red
Silver	Teal	White
Yellow


THTMLVAlign type

Represents vertical alignment within an the cell of an HTML table.

Unit

Httpapp

type THTMLVAlign = (haVDefault, haTop, haMiddle, haBottom, haBaseline);

Description

THTMLAlign describes the value of a VAlign option in a <TD> tag. The following table lists the possible values:

Value	Meaning

haVDefault	The Web browser can position contents of cells anywhere vertically.

haTop	Web browsers position the contents of cells in the column so that they appear lined up on the top.

haMiddle	Web browsers vertically center the contents of cells in the column.

haBottom	Web browsers position the contents of cells in the column so that they appear lined up on the bottom.

haBaseline	Web browsers position the contents of every cell within a row so that they all share the same baseline for the first line of text.


TIdentToInt type

See also

TIdentToInt is a function that converts a text identifier to an integer value.

Unit

classes

type TIdentToInt = function(const Ident: string; var Int: Longint): Boolean;

Description

TIdentToInt is the type of a function that is used in the streaming system to convert text identifiers in the stream to their integer values. Component writers can use this function to define their own named integer values.  The Ident parameter specifies a string identifier that stands for a numeric type value.  The Int parameter is used to return the corresponding integer value.  The return value indicates whether the identifier was successfully converted into an integer.

Note:	For more information about defining and using these types of functions, refer to the implementation of RegisterIntegerConsts in the Classes unit, and ColorToIdent, IdentToColor, CharsetToIdent, and IdentToCharset in the Graphics unit.


TImeMode type

TImeMode represents the current mode of an Input Method Editor (IME).

Unit

Controls

type TImeMode = (imDisable, imClose, imOpen, imDontCare, imSAlpha, imAlpha, imHira, imSKata, imKata, imChinese, imSHanguel, imHanguel);

Description

TImeMode represents the way an Input Method Editor operates to convert keyboard input typed on an Asian version of Windows. TImeMode has the following values:

Value	Meaning

imDisable	Shut down the IME. imDisable has no effect on Chinese, Taiwanese, or Korean IMEs.

imClose	Close the IME conversion window, but leave the IME running in the background. The IME can be re-activated by a hot key combination.

imOpen	Open the IME conversion window. The conversion mode is the last conversion mode used by the IME.

imDontCare	Launch the IME if it is disabled. The conversion mode is the last conversion mode used by the IME.

imSAlpha	Open the IME conversion window and set the conversion mode to accept single-width Roman alphabet input.

imAlpha	Open the IME conversion window and set the conversion mode to accept double-width Roman alphabet input.

imHira	Open the IME conversion window and set the conversion mode to double-width Hiragana. imHira is only available for Japanese IMEs.

imSKata	Open the IME conversion window and set the conversion mode to single-width Katakana (Hankaku Katakana). imSKata is only available for Japanese IMEs.

imKata	Open the IME conversion window and set the conversion mode to double-width Katakana (Zenkaku Katakana). imKata is only available for Japanese IMEs.

imChinese	Open the IME conversion window and set the conversion mode to double-width Chinese. imChinese is only available for Chinese IMEs.

imSHanguel	Open the IME conversion window and set the conversion mode to single-width Hanguel. imSHanguel is only available for Korean IMEs.

imHanguel	Open the IME conversion window and set the conversion mode to double-width Hanguel. imHanguel is only available for Korean IMEs.


TImageIndex type

See also

TImageIndex represents the index of an image in a TImageList component.

Unit

Imglist

type TImageIndex = type Integer;

Description

TImageIndex is the type for properties that represent an image in an image list. Each value is the index of an image in TImageList’s internal list, where 0 specifies the first image, 1 specifies the second image, and so on. To indicate that the property does not represent any of the images, use a TImageList value of –1.


TInAddr type

See also

TInAddr represents the internet socket address structure used in Windows socket API calls to represent a socket host.

Unit

Winsock

type

  SunB = packed record

    s_b1, s_b2, s_b3, s_b4: u_char;

  end;

  SunW = packed record

    s_w1, s_w2: u_short;

  end;

  TInAddr = packed record

    case integer of

      0: (S_un_b: SunB);

      1: (S_un_w: SunW);

      2: (S_addr: u_long);

  end;

Description

TSockAddrIn represents the portion of a Windows socket address that describes the host.


TIndexOptions type

Describes the attributes of an index.

Unit

Db

type

  TIndexOption = (ixPrimary, ixUnique, ixDescending, ixCaseInsensitive, ixExpression, ixNonMaintained);

  TIndexOptions = set of TIndexOption;

Description

TIndexOptions is a set of attributes that applies to a specific index. A TIndexOptions value can include zero or more of the following values:

Value	Description

ixPrimary	The index is the primary index of the table. (Not applicable to dBASE tables).

ixUnique	Each value in the index is unique; there are no duplicates. (Not applicable to all table types.)

ixDescending	The index imposes a descending sort order. (Not applicable to all table types.)

ixExpression	The index is based on a dBASE key expression. (Only applicable to dBASE tables).

ixCaseInsensitive	The index sorts records case insensitively. (Not applicable to all table types.)

ixNonMaintained	The index is not automatically updated when the data is edited. (Not applicable to all table types.)

Warning:	Attempting to create an index using options that are not applicable to the table type causes AddIndex to raise an exception.

Not all table types support use of all of the above index options. Even within a particular table type, any given option may only be supported in certain versions of a table type. See the BDE Administrator or Database Explorer utility for information on local table levels.

dBASE tables only support primary indexes and true unique indexes when the table level is 7 or higher (concurrent with Visual dBASE 7). dBASE tables do not support case-insensitive or descending indexes at all. Use the ixExpression constant when the index is based on multiple fields or uses dBASE data manipulation language functions (that is, for expression indexes). The ixExpression constant is only applicable to dBASE tables.

Paradox tables support the ixDescending for secondary indexes if the table level is 7 or higher and the ixUnique constant if the table level is 5 or higher. The ixDescending and ixCaseInsensitive constants are not applicable to primary indexes.

For other table types, see the vendor-supplied documentation for the particular database system for details on what index options are applicable.


TInterfaceEntry, PInterfaceEntry types

Encapsulates the information needed to dispatch interface calls.

Unit

system

type

  PInterfaceEntry = ^TInterfaceEntry;

  TInterfaceEntry = packed record

    IID: TGUID;

    VTable: Pointer;

    IOffset: Integer;

    ImplGetter: Integer;

  end;

Description

PInterfaceEntry is a pointer to a TInterfaceEntry record.

TInterfaceEntry contains the following fields:

IID:	The GUID that uniquely identifies the interface.

VTable:	The VTable to use for dispatching interface calls.

IOffset	The offset of the interface in the implementing object.

ImplGetter	A method pointer for accessing the interface if IOffset is not available.


TIntToIdent type

See also

IdentToInt is a pointer to a function that converts an integer to a text identifier.

Unit

classes

type TIntToIdent = function(Int: Longint; var Ident: string): Boolean;

Description

IntToIdent is the type of a function pointer that is used in the streaming system to convert integer values to text identifiers when saving property values. Component writers can use this function to define their own named integer values.  The Int parameter specifies a integer type value.  The Ident parameter is used to return the corresponding string identifier.  The return value indicates whether the integer was successfully converted into a string.

Note:	For more information about defining and using these types of functions, refer to the implementation of RegisterIntegerConsts in the Classes unit, and ColorToIdent, IdentToColor, CharsetToIdent, and IdentToCharset in the Graphics unit.


TItemChange type

See also

Describes what type of change a list item undergoes.

Unit

Comctrls

type TItemChange = (ctText, ctImage, ctState);

Description

TItemChange can have one of the following values:

Value	Meaning

ctText	A change to the Caption property of the list item.

ctImage	A change to the list item’s ImageIndex property or the list view’s image list.

ctState	A change to the list item’s Cut, Focused, or Selected property.


TItemFind type

Used in the TCustomListView.OnDataFind event handler to specify a type of search.

Unit

Comctrls

type TItemFind = (ifData, ifPartialString, ifExactString, ifNearest);

Description

TItemFind can have one of the following values:

Value	Meaning

ifData	Search for matching Data.

ifPartialString	Search for a partial string match.

ifExactString	Search for an exact string match.

ifNearest	Search for the nearest match.


TItemState, TItemStates type

Used to specify the state of an item in a list view control.

Unit

Comctrls

type

  TItemState = (isNone, isCut, isDropHilited, isFocused, isSelected);

  TItemStates = set of TItemState;

Description

TItemState indicates the state of an item in a list view. It can have any of the following values:

Value	Meaning

isNone	Item is in its default state

isCut	Item is cut (for cut and paste operation)

isDropHilited	Item is highlighted as a drag-and-drop target

isFocused	Item is focused

isSelected	Item is selected

isActivating	Item is active


TListHotTrackStyle, TListHotTrackStyles type

Used to specify hot tracking styles for a list view control.

Unit

Comctrls

type

  TListHotTrackStyle = (htHandPoint, htUnderlineCold, htUnderlineHot);

  TListHotTrackStyles = set of TListHotTrackStyle;

Description

TListHotTrackStyles describes how hot tracking occurs in a list view control. It can have any of the following values:

Value	Meaning

htHandPoint	The mouse cursor turns into a hand.

htUnderlineCold	An underline is displayed under all untracked items.

htUnderlineHot	An underline is displayed under the tracked item.


TLocale type

See also

TLocale is the type for the Locale or DBLocale property.  It is used for direct calls to BDE.

Unit

Dbtables

type TLocale = Pointer;

Description

The TLocale type is the type of a Locale or DBLocale property. These properties are only used or needed when making direct calls to the Borland Database Engine.

Note:	Do not confuse TLocale with the TSysLocale type that represents a Windows locale.  TLocale is specific to the Borland Database Engine.


TLocalMenuFilters type

Designates a group of standard menu items that are added to a components local menu in the form designer.

Unit

DB

type
  TLocalMenuFilter = (lmModule, lmComponent, lmDesigner);
  TLocalMenuFilters = set of TLocalMenuFilter;

Description

TLocalMenuFilter categorizes the standard menu items added to a component’s context menu. TLocalMenuFilters is a set of these categories that indicates which menu items are to be considered. The following table describes the possible values:

Value	Description

lmModule	Menu items that affect the module associated with the form being designed. For example “Text DFM”.

lmComponent	Menu items that operate on the control whose context menu is displayed. For example “Align to Grid”.

lmDesigner	Menu items that operate on multiple components in the designer. For example “Size”.


TLocateOptions type

TLocateOptions defines the values for the Options parameter of the Locate method of TTable, TQuery, and TStoredProc.

Unit

DB

type
  TLocateOption = (loCaseInsensitive, loPartialKey);
  TLocateOptions = set of TLocateOption;

Description

The TLocateOptions type defines the possible values for the Options parameter of the Locate method of the TTable, TQuery, and TStoredProc components, as described in the following table:

Value	Description

loCaseInsensitive	Key fields and key values are matched without regard to case.

loPartialKey	Key values can include only part of the matching key field value; for example, 'HAM' would match both 'HAMM' and 'HAMMER.'


TLockType type

Indicates how a Paradox or dBASE table can be locked.

Unit

Dbtables

type TLockType = (ltReadLock, ltWriteLock);

Description

TLockType identifies the type of a BDE lock on a Paradox or dBASE table. The following table lists the possible values:

Value	Description

ltReadLock	Other applications (or sessions) can not read from the table.

ltWriteLock	Other applications (or sessions) can not write to the table.'


TLVDrawItemEvent type

Used in the list view OnCustomDrawItem and OnDrawItem events.

Unit

Comctrls

type TLVDrawItemEvent = procedure(Sender: TCustomListView; Item: TListItem; Rect: TRect; State: TOwnerDrawState) of object;

Description

Sender is the list view control in which an item is about to be drawn.

Item is the item that is about to be drawn.

Rect defines the coordinates of the item on the list view’s canvas.

State indicates various conditions that can influence how the item is drawn, such as whether it is selected, grayed, or focused.


TLVNotifyEvent type

Used in the TCustomListView.OnGetImageIndex event.

Unit

Comctrls

type TLVNotifyEvent = procedure(Sender: TObject; Item: TListItem) of object;

Description

Sender is the list view control in which an item is about to be displayed.

Item is the item that is about to be displayed. Any changes you make to the item’s ImageIndex property will be reflected in the list view control.


TLVOwnerDataEvent type

Used in the TCustomListView.OnData event.

Unit

Comctrls

type LVOwnerDataEvent = procedure(Sender: TObject; Item: TListItem) of object;

Description

Sender is the list view control in which an item is about to be displayed.

Item is the item that is about to be displayed. Any changes that you make to the item will be reflected in the list view control.


TLVOwnerDataFindEvent type

Used on the TCustomListView.OnDataFind event.

Unit

Comctrls

type TLVOwnerDataFindEvent = procedure(Sender: TObject; Find: TItemFind; const FindString: string; const FindPosition: TPoint; FindData: Pointer; StartIndex: Integer; Direction: TSearchDirection; Wrap: Boolean; var Index: Integer) of object;

Description

Sender is the list view control in which a search has been requested.

Find specifies the type of search to perform (any of ifData, ifPartialString, ifExactString, ifNearest).

FindString specifies the item text to search for. FindString is ignored unless Find contains ifPartialString or ifExactString.

FindPosition specifies the point from which to start the search. FindPosition is ignored unless Find contains ifNearest.

FindData specifies the item data to search for. FindData is ignored unless Find contains ifData.

StartIndex specifies the index of the item from which the search should start.

Direction specifies the direction for the search (sdLeft, sdRight, sdAbove, sdBelow, or sdAll).

Wrap specifies whether the search should continue from the start of the list view control if no match is found.

Index is where to store the index of the found item. Set Index to –1 if no item is found.


TLVOwnerDataHintEvent type

See also

Used in the TCustomListView.OnDataHint event.

Unit

Comctrls

type TLVOwnerDataHintEvent = procedure(Sender: TObject; StartIndex, EndIndex: Integer) of object;

Description

StartIndex is the first item in the range for which the OnData event may occur.

EndIndex is the last item in the range for which the OnData event may occur.

Use the index information to update the items in the range before the OnData event occurs.


TLVOwnerDataStateChangeEvent type

See also

Used in the TCustomListView.OnDataStateChange event.

Unit

Comctrls

type TLVOwnerDataStateChangeEvent = procedure(Sender: TObject; StartIndex, EndIndex: Integer; OldState, NewState: TItemStates) of object;

Description

Sender is the list view control containing the items that have changed.

StartIndex is the index of the first item that has changed.

EndIndex is the index of the last item that has changed.

OldState is the old state of the items.

NewState is the new state of the items.


TLVSelectItemEvent type

See also

Used in the TCustomListView.OnSelectItem event.

Unit

Comctrls

type TLVSelectItemEvent = procedure(Sender: TObject; Item: TListItem; Selected: Boolean) of object;

Description

Sender is the list vew object in which an item has been selected or unselected.

Item is the item that has been selected or unselected.

Selected is True if the item has been selected; selected is False if the item has been unselected.


TMbcsByteType type

See also

TMbcsByteType represents the use of a single byte Char in a string that uses a multi byte character set (MBCS).

Unit

Sysutils

type TMbcsByteType = (mbSingleByte, mbLeadByte, mbTrailByte);

Description

TMbcsByteType represents the possible return values of the ByteType and StrByteType functions.  Possible values are as follows:

Values	Meaning

mbSingleByte	The Char is used to represent an entire character in the string. The value of Char can not be included in the LeadBytes set.

mbLeadByte	The Char is used to represent the first byte of a double byte character.  The value of Char must be included in the LeadBytes set.

mbTrailByte	The Char is used to represent the second byte of a double byte character. There are no a priori restrictions on the value of Char.


TMemoryManager type

See also

TMemoryManager defines the memory block entry points.

Unit

System

type
PMemoryManager = ^TMemoryManager;

  TMemoryManager = record
  GetMem: function(Size: Integer): Pointer;
  FreeMem: function(P: Pointer): Integer;
  ReallocMem: function(P: Pointer; Size: Integer): Pointer;
end;

Description

The TMemoryManager type is used by the GetMemoryManager and SetMemoryManager procedures. It defines the routines that allocate and free memory.

The GetMem field must specify a function that allocates the given number of bytes and returns a pointer to the newly allocated block. The Size parameter passed to the GetMem function will never be zero. If the GetMem function cannot allocate a block of the given size, it should return nil.

The FreeMem field must specify a function that deallocates the given block. The pointer parameter passed to the FreeMem function will never be nil. If the FreeMem function successfully deallocates the given block, it should return zero. Otherwise, it should return a non-zero value.

The ReallocMem field must specify a function that reallocates the given block to the given new size. The pointer parameter passed to the ReallocMem function will never be nil, and the Size parameter will never be zero. The ReallocMem function must reallocate the given block to the given new size, possibly moving the block if it cannot be resized in place. Any existing contents of the block must be preserved, but newly allocated space can be uninitialized. The ReallocMem function must return a pointer to the reallocated block, or nil if the block cannot be reallocated.


TMenuAnimations, TMenuAnimation type

See also

Indicates how a popup menu appears on screen.

Unit

Menus

type

  TMenuAnimations = (maLeftToRight, maRightToLeft, maTopToBottom, maBottomToTop, maNone);

  TMenuAnimation = set of TMenuAnimations;

Description

TMenuAnimations indicates the direction in which a menu can “slide” into view. TMenuAnimation is a set of TMenuAnimations values, which can be used to specify more than one direction (for a popup menu that slides in at a diagonal). Note that some TMenuAnimations values are mutually exclusive (for example maLeftToRight and maRightToLeft).

Value	Meaning

maLeftToRight	The popup menu appears like a window shade that pulls from left to right.

maRightToLeft	The popup menu appears like a window shade that pulls from right to left.

maTopToBottom	The popup menu appears like a window shade that pulls from top to bottom.

maBottomToTop	The popup menu appears like a window shade that pulls from bottom to top.

maNone	The popup menu appears as a whole with no animation effects.


TMenuItemAutoFlag, TMenuAutoFlag type

See also

Indicates when menu items are automatically maintained.

Unit

Menus

type

  TMenuItemAutoFlag = (maAutomatic, maManual, maParent);

  TMenuAutoFlag = maAutomatic..maManual;

Description

TMenuItemAutoFlag indicates when a submenu is checked for problems and updated. TMenuAutoFlag provides the same information for top-level menu items. The following table lists the possible values:

Values	Meaning

maAutomatic	The immediate submenu of the menu item or the top-level menu items of the menu are checked for problems and automatically corrected when the menu is displayed at runtime.

maManual	The immediate submenu of the menu item or the top-level menu items of the menu are checked for problems and automatically corrected only when the application specifically calls a method of the menu item to do so.

maParent	Automatic checking and correction of the immediate submenu follows the same rule as the menu item’s parent. This value is not applicable to menus, which have no parent menu item.


TMessage type

See also

TMessage represents a Windows message.

Unit

Messages

type

  TMessage = packed record

    Msg: Cardinal;

    case Integer of

      0: (

        WParam: Longint;

        LParam: Longint;

        Result: Longint);

      1: (

        WParamLo: Word;

        WParamHi: Word;

        LParamLo: Word;

        LParamHi: Word;

        ResultLo: Word;

        ResultHi: Word);

  end;

Description

The TMessage type represents a Windows message in WndProc and other methods.

The Msg field represents the Windows Message code.

The WParam field represents the WParam of the message. To access the low and high words of this field, use the WParamLo and WParamHi fields instead.

The LParam field represents the LParam of the message. To access the low and high words of this field, use the LParamLo and LParamHi fields instead.

The Result field holds the return value. To access the low and high words of this field, use the ResultLo and ResultHi fields instead.


TMethod type

TMethod is a record used to store Code and Data fields as type Pointer.

Unit

Sysutils

type

  TMethod = record

  Code, Data: Pointer;

  end;

Description

The TMethod type declares a record that stores the Code and Data fields.

This type can be used in a type cast of a method pointer to access the code and data parts of the method pointer.


TModalResult type

See also

TModalResult represents the return value from a modal dialog.

Unit

Forms

type TModalResult = Low(Integer)..High(Integer);

Description

TModalResult represents the value returned by a modal dialog. An application can use any integer value as a modal result value. For convenience, the controls unit defines a set of constants for commonly used TModalResult values:

Constant	Value	Meaning

mrNone	0	None. Used as a default value before the user exits.

mrOk	idOK	The user exited with OK button.

mrCancel	idCancel	The user exited with the CANCEL button.

mrAbort	idAbort	The user exited with the ABORT button.

mrRetry	idRetry	The user exited with the RETRY button.

mrIgnore	idIgnore	The user exited with the IGNORE button.

mrYes	idYes	The user exited with the YES button.

mrNo	idNo	The user exited with the NO button.

mrAll	mrNo + 1	Used to determine the last predefined constant.


TMouseButton type

See also

TMouseButton defines the mouse-button constants used by mouse-event handlers.

Unit

Controls

type TMouseButton = (mbLeft, mbRight, mbMiddle);

Description

The TMouseButton type defines the mouse-button constants used by mouse-event handlers to distinguish which button generated the mouse event.


TMouseWheelEvent type

The type of the OnMouseWheel event handler.

Unit

Controls

type TMouseWheelEvent = procedure(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean) of object;

Description

Sender is the object capturing the mouse wheel events.

Shift is the state of the Alt, Ctrl, and Shift keys and the mouse buttons.

WheelDelta is how many times the wheel was rotated.

MousePos is the position of the mouse pointer.

Handled is whether or the control handled the event. (Set handled to False to have the object’s parent handle the event.)


TMouseWheelUpDownEvent type

See also

Used in the OnMouseWheelUp and OnMouseWheelDown events.

Unit

Controls

type TMouseWheelUpDownEvent = procedure(Sender: TObject; Shift: TShiftState; MousePos: TPoint; var Handled: Boolean) of object;

Description

Sender is the object capturing the mouse events.

Shift is the state of the Alt, Ctrl, and Shift keys and the mouse buttons.

MousePos is the position of the mouse pointer.

Handled is whether or the control handled the event. (Set handled to False to have the object’s parent handle the event.)


TMsgDlgButtons type

TMsgDlgButtons defines a set of values used by MessageDlg and MessageDlgPos.

Unit

Dialogs

type

  TMsgDlgBtn = (mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore, mbAll, mnNoToAll, mbYesToAll, mbHelp);

const

  mbYesNoCancel = [mbYes, mbNo, mbCancel];

  mbOKCancel = [mbOK, mbCancel];

  mbAbortRetryIgnore = [mbAbort, mbRetry, mbIgnore];

TMsgDlgButtons = set of TMsgDlgBtn;

Description

The TMsgDlgButtons type defines the set of values a button in a message box can have. The TMsgDlgButtons type is used by the MessageDlg and MessageDlgPos functions. The following tables lists the possible values:

Value	Meaning

mbYes	A button with 'Yes' on its face.

mbNo	A button the text 'No' on its face.

mbOK	A button the text 'OK' on its face.

mbCancel	A button with the text 'Cancel' on its face.

mbAbort	A button with the text 'Abort' on its face

mbRetry	A button with the text 'Retry' on its face

mbIgnore	A button the text 'Ignore' on its face

mbAll	A button with the text 'All' on its face

mbNoToAll	A button with the text 'No to All' on its face

mbYesToAll	A button with the text 'Yes to All' on its face

mbHelp	A button with the text 'Help' on its face

In addition, the dialogs unit defines three constants for commonly used TMsgDlgButtons values:

Constant	Meaning

mbYesNoCancel	mbYes, mbNo, and mbCancel

mbOKCancel	mbOK and mbCancel

mbAbortRetryIgnore	mbAbort, mbRetry, and mbIgnore


TMsgDlgType type

TMsgDlgType defines values describing the type of message box.

Unit

Dialogs

type TMsgDlgType = (mtWarning, mtError, mtInformation, mtConfirmation, mtCustom);

Description

The TMsgDlgType type defines the values describing the type of message box. The TMsgDlgType is used by the MessageDlg and MessageDlgPos functions. The following table lists the possible values:

Value	Meaning

mtWarning	A message box containing a yellow exclamation point symbol.

mtError	A message box containing a red stop sign.

mtInformation	A message box containing a blue "i".

mtConfirmation	A message box containing a green question mark.

mtCustom	A message box containing no bitmap. The caption of the message box is the name of the application's executable file.


TNavigateBtn type

TNavigateBtn defines values identifying different possible buttons on a TDBNavigator object.

Unit

Dialogs

type TNavigateBtn = (nbFirst, nbPrior, nbNext, nbLast, nbInsert, nbDelete, nbEdit, nbPost, nbCancel, nbRefresh);

Description

Each TNavigateBtn value identifies a different button that can appear on a TDBNavigator object. The following table lists all the button types, their corresponding TNavigateBtn values, and the action associated with each button:

Button	Value	Action

First	nbFirst	Go to the first record

Prior	nbPrior	Go to the previous record

Next	nbNext	Go to the next record

Last	nbLast	Go to the last record

Insert	nbInsert	Insert a blank record

Delete	nbDelete	Delete the current record

Edit	nbEdit	Permit users to edit the current record

Post	nbPost	Post the current record

Cancel	nbCancel	Cancel the current edit

Refresh	nbRefresh	Refresh the data in the dataset


TNodeCache type

Used to cache a tree-view node.

Unit

Comctrls

type

  TNodeCache = record

    CacheNode: TTreeNode;

    CacheIndex: Integer;

  end;

Description

Use TNodeCache to cache a tree-view node.


TNotifyEvent type

TNotifyEvent is used for events that do not require parameters.

Unit

Classes

type TNotifyEvent = procedure (Sender: TObject) of object;

Description

The TNotifyEvent type is the type for events that have no event-specific parameters. These events simply notify the component that a specific event occurred. For example, OnClick, which is of type TNotifyEvent, notifies the control that a click event occurred on the control.

The Sender parameter is the object whose event handler is called.  For example,.with the OnClick event of a button, the Sender parameter is the button component that is clicked.


TOleEnum type

Represents enumerated types that must be sent over a COM interface.

Unit

Activex

type TOleEnum = type Integer;

Description

Dispatch interfaces do not marshal enumerated types. TOleEnum is used for interface parameters that are logically an enumerated type but must be passed as an integer value instead. Typically, each interface member that uses TOleEnum defines a set of integer constants to represent the enumerated values.


TOnGetMonthInfoEvent type

See also

Type used for the TCommonCalendar.OnGetMonthInfo event.

Unit

Comctrls

type TOnGetMonthInfoEvent = procedure(Sender: TObject; Month: LongWord; var MonthBoldInfo: LongWord) of object;

Description

Use TOnGetMonthInfoEvent along with the TCommonCalendar.BoldDays method to set which days are bold in the month that is about to be displayed in the calendar.

Sender is the TObject for the calendar.

Month is a value that corresponds to the month that is about to be displayed in the calendar. If Month is 1, January is about to be displayed, if Month is 2, February is about to be displayed, and so on.

MonthBoldInfo specifies which days of the month should be bold. You should pass MonthBoldInfo to the BoldDays method. You shouldn't work with BoldDays directly.

The first 31 bits of the MonthBoldInfo variable are used to determine whether a particular day of the month should be bold.


TOperation type

See also

TOperation represents the types of operations whose occurrence is broadcast by the Notification method.

Unit

Classes

type TOperation = (opInsert, opRemove);

Description

The TOperation type is used in the Notification method to indicate whether the notification indicates the creation or deletion of an object. The following table gives the possible values:

Value	Meaning

opInsert	The specified object has just been created.

opRemove	The specified object has been destroyed, and its memory is about to be freed.


TOutlineOption, TOutlineOptions type

See also

TOutlineOptions represents the style in which an outline is drawn.

Unit

Outline

type

  TOutlineOption = (ooDrawTreeRoot, ooDrawFocusRect, ooStretchBitmaps);

  TOutlineOptions = set of TOutlineOption;

Description

TOutlineOptions is a set of TOutlineOption values. Together they influence the way an outline is drawn. Each TOutlineOption value is described below:

Value	Meaning

ooDrawTreeRoot	The first item (Index value of 1) is connected to the root item by the outline tree. This means that the tree will extend from the top of the outline to all the first level items. Without ooDrawTreeRoot, all first level items appear leftmost in the outline, not connected by the tree.

ooDrawFocusRect	The outline draws a focus rectangle around the selected item.

ooStretchBitmaps	The outline stretches the standard bitmaps (PictureLeaf, PictureOpen, PictureClosed, PicturePlus, PictureMinus) to fit in the size of the item, determined by the size of the Font of the Text. Without ooStretchBitmap, the bitmaps  will be cropped if larger than the height of the item text, or won't fill up the entire item space if smaller than the text.


TOutlineStyle type

See also

TOutlineStyle determines how the nodes of an outline are drawn.

Unit

Outline

type TOutlineStyle = (osText, osPlusMinusText, osPictureText, osPlusMinusPictureText, osTreeText, osTreePictureText);

Description

TOutlineStyle is the type of TCustomOutline.OutlineStyle. It includes the following values:

Value	Meaning

osText	Only the text of nodes is drawn.

osPlusMinusText	In addition to the text, each node displays plus picture (when it can be expanded) or minus picture (when it can be collapsed).

osPictureText	In addition to the text, each node displays the open picture (when it is expanded), closed picture (when it is collapsed), or leaf picture (when it has no subnodes).

osPlusMinusPictureText	In addition to the text, each node displays the plus picture or minus picture (as in osPlusMinusText), and the open, closed or leaf picture (as in osPictureText).

osTreeText	Visible lines connect the outline nodes.

osTreePictureText	In addition to the text, each node displays the open picture (when it is expanded), closed picture (when it is collapsed), or leaf picture (when it has no subnodes). Visible lines connect the outline nodes.


TOutlineType type

See also

Indicates whether an outline is owner-drawn.

Unit

Outline

type   TOutlineType = (otStandard, otOwnerDraw);

Description

TOutlineType determines whether an outline is drawn automatically or by user code in an OnDrawItem event.

Value	Meaning

otStandardItems	Items are drawn automatically.

otOwnerDraw	Items are drawn on the Canvas by application code.


TOwnerDrawState type

Indicates state information that can influence how an item is drawn.

Unit

Windows

type TOwnerDrawState = set of (odSelected, odGrayed, odDisabled, odChecked odFocused, odDefault, odComboBoxEdit);

Description

TOwnerDrawState is used by event handlers in owner-draw controls to indicate the state of an item about to be drawn. It is a set that includes zero or more of the following:

Value	Meaning

odSelected	The item is selected.

odGrayed	The item should appear grayed.

odDisabled	The item is disabled.

odChecked	The item should appear checked. (This does not apply to all objects)

odFocused	Keyboard input is directed to the item.

odDefault	The item is the default item (This does not apply to all objects)

odComboBoxEdit	The drawing takes place in the edit box of a combo box control.


TPackageInfoProc type

See also

TPackageInfoProc is a pointer to a callback procedure used as a parameter type to the GetPackageInfo procedure.

Unit

Sysutils

type

  TNameType = (ntContainsUnit, ntRequiresPackage);

  TPackageInfoProc = procedure (const Name: string; NameType: TNameType; Flags: Byte; Param: Pointer);

Description

TPackageInfoProc is the type of the callback given to the GetPackageInfo procedure.  The callback procedure is called for every element in the package.

Name is the name of the package element for a specific call.  Depending on the value of the NameType parameter, it is either the name of a unit contained in the package or the name of another package that is required by the package.

The NameType parameter is of type TNameType. The following table lists the values of TNameType:

Value	Meaning

ntContainsUnit	The Name parameter is a unit contained in the package.

ntRequiresPackage	The Name parameter is another package required by the package.

Flags are the flags listed in the information table for the package.

Param is a user-defined value passed to GetPackageInfo.


TPageScrollerButton type

Used to specify a page scroller button.

Unit

Comctrls

type TPageScrollerButton = (sbFirst, sbLast);

Description

TPageScrollerButton has one of the following values:

Value	Meaning

sbFirst	The top button (vertical orientation) or the left button (horizontal orientation).

sbLast	The bottom button (vertical orientation) or the right button (horizontal orientation).


TPageScrollerButtonState type

Used to indicate the state of a page scroller button.

Unit

Comctrls

type TPageScrollerButtonState = (bsNormal, bsInvisible, bsGrayed, bsDepressed, bsHot);

Description

TPageScrollerButtonState has one of the following values:

Value	Meaning

bsNormal	The button is in normal state.

bsInvisible	The button is not visible.

bsGrayed	The button is grayed.

bsDepressed	The button is pressed.

bsHot	The button is hot (the mouse is hovering over the button).


TPageScrollerOrientation type

Used to specify the orientation of a page scroller control.

Unit

Comctrls

type TPageScrollerOrientation = (soHorizontal, soVertical);

Description

TPageScrollerOrientation has one of the following values:

Value	Meaning

soHorizontal	The page scroller is oriented horizontally.

soVertical	The page scroller is oriented vertically.


TPageScrollEvent type

See also

The type of the TPageScroller.OnScroll event handler.

Unit

Comctrls

TPageScrollEvent = procedure (Sender: TObject; Shift: TShiftState; X, Y: Integer; Orientation: TPageScrollerOrientation; var Delta: Integer);

Description

Sender is the page scroller that is being scrolled.

Shift is the state of the Shift, Alt, Ctrl keys and mouse buttons.

X is the horizontal position of the page scroller.

Y is the vertical position of the page scroller.

Orientation is the direction for the scroll.

Delta is the amount of the scroll.


TParamType, TParamTypes types

TParamType and TParamTypes represent the use of parameters for TQuery and TStoredProc components.

Unit

Db

type

  TParamType = (ptUnknown, ptInput, ptOutput, ptInputOutput, ptResult);

  TParamTypes = set of TParamType;

Description

TParamType indicates how the parameter of a TQuery or TStoredProc is used. TParamTypes is a set of parameter types that can be used to filter parameters so that an application need only work with those parameters that are of interest.

The DBClient unit defines a constant, AllParamTypes, of type TParamTypes that represents any possible parameter type:

const AllParamTypes = [ptUnknown, ptInput, ptOutput, ptInputOutput, ptResult];

TParamType includes the following values:

Value	Description

ptUnknown	Unknown or undetermined. Before executing a stored procedure, the application must set parameters of this type to another kind.

ptInput	Used to input a field value. Identifies a parameter used to pass values to a stored procedure for processing.

ptOutput	Used to output a field value. Identifies a parameter used by a stored procedure to return values to an application.

ptInputOutput	Used for both input and output.

ptResult	Used as a return value. Identifies a parameter used by a stored procedure to return an error or status value. A stored procedure can only have one parameter of type ptResult.


TPaymentTime type

TPaymentTime is an enumerated type used as a parameter in financial functions.

Unit

Math

type TPaymentTime = (ptEndOfPeriod, ptStartOfPeriod);

Description

TPaymentTime is an enumerated type used as a parameter in many of the financial functions. The following table lists the possible values:

Value	Meaning

ptStartOfPeriod	Interest is calculated on the principle balance at the beginning of the payment period

ptEndOfPeriod	Interest is calculated at the end of the payment period


TPoint type

TPoint type defines a pixel location onscreen.

Unit

Windows

type TPoint = record
  X: Longint;
  Y: Longint;
end;

Description

The TPoint type defines a pixel location onscreen, with the origin in the top left corner. X specifies the horizontal coordinate of the point, Y specifies the vertical coordinate.


TPopupAlignment type

TPopupAlignment represents the position of a popup menu relative to the mouse.

Unit

Menus

type TPopupAlignment = (paLeft, paRight, paCenter);

Description

These are the possible values:

Value	Meaning

paLeft	The pop-up menu appears with its top left corner under the mouse.

paCenter	The pop-up menu appears with the top center of the menu under the mouse.

paRight	The pop-up menu appears with its top right corner under the mouse.


TProcedure type

TProcedure is used as the type for generic procedures that do not have arguments.

Unit

Sysutils

type TProcedure = procedure;

Description

The TProcedure is used as the type for parameters to many routines when the procedure being passed in does not take any arguments.


TProgressBarOrientation type

See also

Used to specify the orientation of a progress bar.

Unit

Comctrls

type TProgressBarOrientation = (pbHorizontal, pbVertical);

Description

TProgressBarOrientation has one of the following values:

Value	Meaning

pbHorizontal	The progress bar is oriented horizontally.

pbVertical	The progress bar is oriented vertically.


TRect type

TRect type defines a rectangle.

Unit

Windows

type

  TRect = record
  case Integer of
    0: (Left, Top, Right, Bottom: Integer);
    1: (TopLeft, BottomRight: TPoint);
end;

Description

The coordinates are specified either as four separate integers representing the pixel locations of the left, top, right, and bottom sides, or as two points representing the pixel locations of the top left and bottom right corners. The origin of the pixel coordinate system is in the top left corner of the screen.


TResType type

TResType specifies a type of graphical resource to ImageList.

Unit

Imglist

type TResType = (rtBitmap, rtCursor, rtIcon);

Description

TResTypes is used by the image list methods ResourceLoad, GetResource and FileLoad to specify the type of graphical resource that is to be loaded or retrieved from the ImageList

Value	Meaning

rtBitmap	Loads or retrieves a bitmap

rtCursor	Loads or retrieves a cursor

rtIcon	Loads or retrieves an icon


TScrollBarStyle type

Specifies a scroll bar style.

Unit

Controls

TScrollBarStyle = (ssRegular, ssFlat, ssHotTrack);

Description

TScrollBarStyle can have one of the following values:

Value	Meaning

ssRegular	The scroll bar is normal.

ssFlat	The scroll bar is flat.

ssHotTrack	The scroll bar uses hot tracking.


TSearchDirection type

Indicates the direction in which to search for the nearest item to a specified item or point.

Unit

Comctrls

type TSearchDirection = (sdLeft, sdRight, sdAbove, sdBelow, or sdAll);

Description

The Direction parameter can be one of the following values:

Value	Meaning

sdLeft	Looks to the left of the specified item.

sdRight	Looks to the right of the specified item.

sdAbove	Looks above the specified item.

sdBelow	Looks below the specified item.

sdAll	Looks in the order that items appear in the Items property.


TSearchRec type

TSearchRec defines file information searched for by FindFirst or FindNext.

Unit

Sysutils

type

TSearchRec = record
Time: Integer;
Size: Integer;
Attr: Integer;
Name: TFileName;
ExcludeAttr: Integer;
FindHandle: THandle;
FindData: TWin32FindData;
end;

Description

The TSearchRec type defines file information searched for by a FindFirst or FindNext function call. If a file is found, the fields of the TSearchRec type parameter are modified to specify the found file.

Attr represents the file attributes the file attributes of the file. Test Attr against the following attribute constants or values to determine if a file has a specific attribute:

Constant	Value	Description

faReadOnly	$00000001	Read-only files

faHidden	$00000002	Hidden files

faSysFile	$00000004	System files

faVolumeID	$00000008	Volume ID files

faDirectory	$00000010	Directory files

faArchive	$00000020	Archive files

faAnyFile	$0000003F	Any file

To test for an attribute, combine the value of the Attr field with the attribute constant with the and operator. If the file has that attribute, the result will be greater than 0. For example, if the found file is a hidden file, the following expression will evaluate to True: (SearchRec.Attr and faHidden > 0).

Time contains the time stamp of the file. This is a DOS date-and-time stamp. It can be converted to a TDateTime value using FileDateToDateTime.

Size contains the size of the file in bytes.

Name contains the DOS file name and extension.

FindData contains additional information such as the file creation time, last access time, and both the long and short file names.


TSectionDragEvent type

See also

The type for event handlers that respond when the user drags a section in a header control.

Unit

Comctrls

type TSectionDragEvent = procedure(Sender: TObject; FromSection, ToSection: THeaderSection; var AllowDrag: Boolean) of object;

Description

Sender is the header control that includes the dragged section.

FromSection is the header section that the user is dragging.

ToSection is the header section currently in the position where the user dragged FromSection.

AllowDrag returns a value that indicates whether the header control repositions the headers to accomodate the user’s drag. If AllowDrag is False on exit from the event handler, the headers remain in their original positions, as if the user had not tried a drag operation.


TSelectDirOpt, TSelectDirOpts type

See also

Determines how a directory selection dialog responds when the user enters a nonexistent directory.

Unit

Filectrl

type

  TSelectDirOpt = (sdAllowCreate, sdPerformCreate, sdPrompt);

  TSelectDirOpts = set of TSelectDirOpt;

Description

These are the possible values that can be added to the set of options:

Value	Meaning

sdAllowCreate	An edit box allows the user to type in the name of a directory that does not exist. This option does not create a directory: the application must read the name of the selected directory and create it if desired.

sdPerformCreate	Used only in combination with sdAllowCreate. If the user enters a directory name that does not exist, the directory selection dialog creates it.

sdPrompt	Used only in combination with sdAllowCreate. Displays a message box that informs the user when the entered directory does not exist and asks if the directory should be created. If the user chooses OK, the directory is created if the option set includes sdPerformCreate. If the option set does not include sdPerformCreate, the directory is not created: the application must read the directory name and create it.


TServiceEvent type

TServiceEvent is the procedure type used for service events that do not require parameters.

Unit

Svcmgr

type TServiceEvent = procedure (Sender: TService) of object;

Description

TServiceEvent specifies a method used for service events that have no event-specific parameters. TServiceEvent is used to execute a process that occurs typically during installation, uninstallation, or shutdown.  It is also the event type for the main service execution. The Sender parameter is the service component receiving the event notification.


TShiftState type

See also

TShiftState indicates the state of the Alt, Ctrl, and Shift keys and the mouse buttons.

Unit

Classes

type TShiftState = set of (ssShift, ssAlt, ssCtrl, ssLeft, ssRight, ssMiddle, ssDouble);

Description

The TShiftState type is used by key-event and mouse-event handlers to determine the state of the Alt, Ctrl, and Shift keys and the state of the mouse buttons when the event occurred.  It is a set of flags that indicate the following:

Value	Meaning

ssShift	The Shift key is held down.

ssAlt	The Alt key is held down.

ssCtrl	The Ctrl key is held down.

ssLeft	The left mouse button is held down.

ssRight	The right mouse button is held down.

ssMiddle	The middle mouse button is held down.

ssDouble	The mouse was double-clicked.


TShortCut type

TShortCut represents a menu shortcut.

Unit

Classes

type TShortCut = Low(Word) .. High(Word);

Description

TShortCut types are the menu shortcuts that appear on menus and give the user an alternate way to select menu commands using the keyboard. The ShortCut property is of type TShortCut, and the ShortCutToText and ShortCutToKey routines use parameters of type TShortCut. TShortCut is also the return type of the TextToShortCut routine.


TShortCutEvent type

The type of an OnShortCut event handler.

Unit

Classes

TShortCutEvent = procedure (var Msg: TWMKey; var Handled: Boolean) of object;

Description

The TShortCutEvent type represents event handlers that respond to keystrokes before they enter the standard keystroke processing. These event handlers allow an application to bypass the standard keystroke processing for special shortcut keys.

The Msg parameter represents the Windows keystroke message. The virtual key code is given by the CharCode field, and the KeyData field contains a set of flags that indicate the repeat count, scan code, extended-key flag, context code, previous key-state flag and transition-state flag. See the Windows documentation for details on these fields.

The Handled parameter indicates whether the event handler processed the key. If Handled is set to True, then the application stops processing the keystroke. Otherwise (if Handled remains False) the application proceeds with normal keystroke processing.


TSizingOrientation type

Specifies the dimension along which a control’s size is adjusted when docked.

Unit

Controls

type TSizingOrientation = (soNone, soHorizontal, soVertical);

Description

TSizingOrientation can have one of the following values:

Value	Meaning

soNone	The control’s size is not readjusted when it is docked.

soHorizontal	The control’s width is adjusted when it is docked.

soVertical	The control’s height is adjusted when it is docked.


TSockAddrIn type

See also

TSockAddrIn represents the internet socket address structure used in Windows socket API calls to represent the full specification of a socket port.

Unit

Winsock

type

  TSockAddrIn = packed record

    case Integer of

      0: (sin_family: u_short;

          sin_port: u_short;

          sin_addr: TInAddr;

          sin_zero: array[0..7] of Char);

      1: (sa_family: u_short;

          sa_data: array[0..13] of Char)

  end;

Description

TSockAddrIn represents a Windows socket address, including information about the host, port, and protocol.


TSocket type

See also

TSocket represents the handle to a Windows socket.

Unit

Winsock

type

  u_int = Integer;

  TSocket = u_int;

Description

TSocket represents a Windows socket handle. TSocket values are used by TCustomWinSocket and its descendants for working directly with the Windows socket APIs. Use this type when using the Windows socket APIs directly in an application.


TSocketErrorEvent type

The type for event handlers that respond when a Windows socket reports an error.

Unit

ScktComp

type

  TErrorEvent = (eeGeneral, eeSend, eeReceive, eeConnect, eeDisconnect, eeAccept);

  TSocketErrorEvent = procedure (Sender: TObject; Socket: TCustomWinSocket; ErrorEvent: TErrorEvent; var ErrorCode: Integer) of object;

Description

The Sender parameter is the socket component that encountered the error.

The Socket parameter is the TCustomWinSocket object that receives the error notification.

The ErrorCode parameter is the error code returned by the Windows socket API call. Changing this to 0 within an error handler prevents an exception from being raised.

The ErrorEvent parameter indicates what Socket was attempting to do when the error occurred. It is of type TErrorEvent, which can have any of the following values:

Value	Meaning

eeGeneral	The socket received an error message that does not fit into any of the following categories.

eeSend	An error occurred when trying to write to the socket connection.

eeReceive	An error occurred when trying to read from the socket connection.

eeConnect	A connection request that was already accepted could not be completed.

eeDisconnect	An error occurred when trying to close a connection.

eeAccept	A problem occurred when trying to accept a client connection request.


TSocketEvent type

Identifies the operation of a socket.

Unit

ScktComp

type TSocketEvent = (seLookup, seConnecting, seConnect, seDisconnect, seListen, seAccept, seWrite, seRead);

Description

TSocketEvent is used to identify what a socket is doing when various methods or event handlers are called. It has one of the following values:

Value	Meaning

seLookup	(client sockets only) The Windows socket object is about to locate the server socket. Changing the properties of the client socket has no effect at this point, but changes to the Windows socket object specified by the Socket parameter will affect the attempted connection.

seConnecting	(client sockets only) The server socket has been located but the connection isn’t completed. This is the first opportunity to obtain the actual server port and IP address used for the connection, which may differ from those of the listening socket contacted initially.

seConnect	The socket connection has just been established. This is the point when a socket starts reading or writing over the connection.

seListen	(server sockets only) The Windows socket object has been initialized and is about to open a listening connection. Changing the properties of the server socket has no effect at this point, but changes to the Windows socket object specified by the Socket parameter will the listening connection.

seAccept	(server sockets only) A client connection request has just been accepted. This is the first opportunity to obtain the port and IP address of the individual client connection.

seWrite	The socket is ready for information to be written.

seRead	The socket is receiving information from a socket on the other end of the connection.


TSocketNotifyEvent type

See also

The type for event handlers which respond to events during the expected course of forming or using a socket connection.

Unit

ScktComp

type TSocketNotifyEvent = procedure (Sender: TObject; Socket: TCustomWinSocket) of object;

Description

The Sender parameter is the socket component or Windows socket object that owns the event handler.

The Socket parameter is the TCustomWinSocket object that represents the endpoint of the connection.

When the event handler belongs to a client Windows socket object, these two parameters are the same. For server Windows socket objects, the Sender parameter represents the listening connection while the Socket parameter represents a client connection.


TStartDockEvent type

See also

Used in the OnStartDock event.

Unit

Controls

type TStartDockEvent = procedure(Sender: TObject; var DragObject: TDragDockObject) of object;

Description

Sender is the object on which a control is being docked.

DragObject is information about the control that is being docked.


TStreamOriginalFormat type

Indicates the format in which a form file is saved.

Unit

Controls

type TStreamOriginalFormat = (sofUnknown, sofBinary, sofText);

Description

Form files can be saved in binary format or as a text file, depending on the options set in the Environment Options dialog. TStreamOriginalFormat specifies the format used for saving a form file. It is one of the following values:

Value	Meaning

sofUnknown	The format of the file from which a form is being read or to which it is being written is unknown. If the format can’t be deduced from the stream, an exception is raised.

sofBinary	The form is being read from or written to a form file that uses the original binary format.

sofText	The form is being read from or written to a text file.


TSysCharSet type

See also

Represents a set of characters that are used as separators when parsing a string.

Unit

Sysutils

type TSysCharSet = set of Char;

Description

TSysCharSet is a set containing special characters that can be used to parse a string. The elements of the set vary, depending on the type of parsing performed.


TSysLocale type

See also

TSysLocale represents a Windows locale.

Unit

Sysutils

type TSysLocale = packed record

  DefaultLCID: LCID;

  PriLangID: LANGID;

  SubLangID: LANGID;

  FarEast: Boolean;

  MiddleEast: Boolean;

end;

Description

The TSysLocale type represents a Windows locale. The locale determines how dates and times are formatted, how items are alphabetically sorted, and how strings are compared.

The DefaultLCID field represents the system Windows locale identifier. This is a 32-bit value that specifies a default sort order and a default language identifier.

The PirLangID field specifies the primary type of the language identifier. This is one of the Windows constants that identify a language group such as LANG_ENGLISH or LANG_FRENCH.

The SubLangID field specifies the subtype of the language identifier. This is one of the Windows constants that identify a language subgroup such as SUBLANG_ENGLISH_US or SUBLANG_FRENCH_CANADIAN.

FarEast indicates whether the locale represents an Asian locale.

MiddleEast indicates whether the local represents a Middle Eastern locale.


TSystemTime, PSystemTime type

See also

Represents date-time values in Windows 32 API function calls.

Unit

Windows

type

  PSystemTime = ^TSystemTime;

  TSystemTime = record

    wYear: Word;

    wMonth: Word;

    wDayOfWeek: Word;

    wDay: Word;

    wHour: Word;

    wMinute: Word;

    wSecond: Word;

    wMilliseconds: Word;

  end;

Description

Use TSystemTime to represent SYSTEMTIME values when making Windows 32 API function calls. Use the DateTimeToSystemTime and SystemTimeToDateTime functions to convert between TSystemTime values and Delphi TDateTime values.

PSystemTime is a pointer to a TSystemTime value.


TTabGetImageEvent type

See also

Used in the TCustomTabControl.OnGetImageIndex event.

Unit

Comctrls

type TTabGetImageEvent = procedure(Sender: TObject; TabIndex: Integer; var ImageIndex: Integer) of object;

Description

Sender is the tab control in which an image is about to be displayed.

TabIndex is the index of the tab for which an image is about to be displayed.

ImageIndex is the index of the image to display in the tab.


TTabStyle type

See also

Used in the TCustomTabControl.Style property.

Unit

Comctrls

type TTabStyle = (tsTabs, tsButtons, tsFlatButtons);

Description

TTabStyle can have one of the following values:

Value	Meaning

tsTabs	Standard tabs

tsButtons	Button tabs

tsFlatButtons	Flat button tabs


TTBCustomDrawFlags type

See also

Used in the OnAdvancedCustomDrawButton event handler.

Unit

Comctrls

type TTBCustomDrawFlags = set of (tbNoEdges, tbHiliteHotTrack, tbNoOffset, tbNoMark, tbNoEtchedEffect);

Description

TTBCustomDrawFlags influences the subsequent painting of a tool button following an OnAdvancedCustomDrawButton event in the cdPrePaint stage:

Value	Meaning

tbNoEdges	The button is drawn without edges to distinguish it from the tool bar.

tbHiliteHotTrack	Enables the change in background color when the button is hot tracked. If this is not included in the set, the background color does not change for hot tracking.

tbNoOffset	The button is not offset when in the “down” position.

tbNoMark	Disables the default change in background color on buttons with the Marked property set to True.

tbNoEtchedEffect	Disables the etched effect that appears by default on disabled tool buttons.


TTextRec type

TTextRec is the internal format for a variable of type text.

Unit

Sysutils

type

  PTextBuf = ^TTextBuf;

  TTextBuf = array[0..127] of Char;

  TTextRec = packed record

    Handle: Integer;

    Mode: Integer;

    BufSize: Cardinal;

    BufPos: Cardinal;

    BufEnd: Cardinal;

    BufPtr: PChar;

    OpenFunc: Pointer;

    InOutFunc: Pointer;

    FlushFunc: Pointer;

    CloseFunc: Pointer;

    UserData: array[1..32] of Byte;

    Name: array[0..259] of Char;

    Buffer: TTextBuf;

  end;

Description

TTextRec is the internal format of a variable of type text. You would never declare a variable of this type. However, you can use TTextRec to typecast a text file variable to access the internal data fields, such as the file name.

TextBuf is the type of the Buffer entry in the TTextRec record, and indicates the size of the buffer used.

Note:	Do not use this unless you are familiar with writing Object Pascal text file device drivers.


TThreadFunc type

See also

TThreadFunc is a pointer to the starting address of a routine for a new thread of execution.

Unit

System

type TThreadFunc = function(Parameter: Pointer): Integer;

Description

The TThreadFunc type defines a type of routine that is the starting address for a new thread of execution. A TThreadFunc routine is passed to the Delphi routine BeginThread or the Windows API CreateThread function. When BeginThread executes, TThreadFunc acts as the entry point for the new thread.

The Parameter pointer passed to the TThreadFunc routine is passed directly to BeginThread. Parameter can be a single 32-bit value or a 32-bit pointer to other data. The value in Parameter can be used within the TThreadFunc routine.

TThreadFunc returns the value of the thread entry point procedure. This result is usually passed to the EndThread routine. An application can retrieve the TThreadFunc return value by calling the Windows API GetExitCodeThread function.


TThreadingModel type

TThreadingModel indicates how COM serializes calls to a COM object.

Unit

Comobj

type TThreadingModel = (tmSingle, tmApartment, tmFree, tmBoth);

Description

ThreadingModel determines how COM serializes calls to a COM object. The application must ensure that the COM object implementation can safely handle the specified threading model.

The following table lists the possible values for TThreadingModel.

Value	Meaning

tmSingle	COM serializes all client requests. The object does not need to provide thread support.

tmApartment	COM ensures that any instance of the COM object services one request at a time. Different objects from the same server can be called on different threads, but each object is called only from that one thread. Instance data is safe, global data must be protected using critical sections or some other form of serialization. The thread’s local variables are reliable across multiple calls.

tmFree	Also called multi-threaded apartment. The COM object can receive calls from any thread at any time. Objects must protect all instance and global data using critical sections or some other form of serialization. Thread local variables are not reliable across multiple calls.

tmBoth	Objects can support clients that use either apartment or free threading models. It supports both threading models when clients may be using either single-threaded or free threading models.


TTimeStamp type

See also

TTimeStamp represents time and date values.

Unit

Sysutils

type

  TTimeStamp = record

    Time: Integer;      { Number of milliseconds since midnight }

    Date: Integer;      { One plus number of days since 1/1/0001 }

  end;

Description

Use TTimeStamp to represent date and time values when a great deal of accuracy is required for the time portion.  When the time values do not need to be precise to the millisecond, use the more compact TDateTime representation.

TTimeStamp is a record with a Time field that represents the number of seconds elapsed since midnight, and a Date field that represents the number of calendar days since the start of the calendar.


TTVAdvancedCustomDrawEvent type

See also

Used in the TCustomTreeView.OnAdvancedCustomDraw event.

Unit

Comctrls

type TTVAdvancedCustomDrawItemEvent = procedure(Sender: TCustomTreeView; const ARect: TRect; Stage: TCustomDrawStage; var DefaultDraw: Boolean) of object;

Description

Sender is the tree-view control that is being painted.

ARect is the rectangle that defines the boundaries of the tree-view control on its canvas.

Stage indicates the current stage of the painting process.

DefaultDraw specifies whether the control should paint itself after the event handler exits. This parameter is only used when Stage is cdPrePaint.


TTVAdvancedCustomDrawItemEvent type

See also

Used in the TCustomTreeView.OnAdvancedCustomDrawItem event.

Unit

Comctrls

type TTVAdvancedCustomDrawItemEvent = procedure(Sender: TCustomTreeView; Node: TTreeNode; State: TCustomDrawState; Stage: TCustomDrawStage; var PaintImages, DefaultDraw: Boolean) of object;

Description

Sender is the tree-view control in which an item is about to be painted.

Node is the item that is about to be painted.

State is the item's current state: one or more of dsSelected, dsGrayed, dsDisabled, dsChecked, dsFocused, dsDefault, dsHot, dsMarked, dsIndeterminate.

Stage indicates the current stage of the painting process.

PaintImages specifies whether the control should paint the images associated with the control. This parameter is only used when Stage is cdPrePaint.

DefaultDraw specifies whether the control should paint the text of the item after the event handler exits. This parameter is only used when Stage is cdPrePaint.


TTVCustomDrawEvent type

Used in the TCustomTreeView.OnCustomDraw event.

Unit

Comctrls

type TTVCustomDrawItemEvent = procedure(Sender: TCustomTreeView; ARect: TRect; var DefaultDraw: Boolean) of object;

Description

Sender is the tree-view control that is about to be painted.

ARect is the rectangle that defines the boundaries of the tree-view control.

DefaultDraw specifies whether the control should paint itself after the event handler exits.


TTVCustomDrawItemEvent type

See also

Used in the TCustomTreeView.OnCustomDrawItem event.

Unit

Comctrls

type TTVCustomDrawItemEvent = procedure(Sender: TCustomTreeView; Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean) of object;

Description

Sender is the tree-view control in which an item is about to be painted.

Node is the item that is about to be painted.

State is the item's current state: one or more of dsSelected, dsGrayed, dsDisabled, dsChecked, dsFocused, dsDefault, dsHot, dsMarked, dsIndeterminate.

DefaultDraw specifies whether the control should paint the item after the event handler exits.


TTVExpandedEvent type

See also

Represents the event handler for events that notify a tree view of changes to one of its nodes.

Unit

Comctrls

type TTVExpandedEvent = procedure(Sender: TObject; Node: TTreeNode) of object;

Description

TTVExpandedEvent is used to respond to notifications of events that occur to the nodes of a tree view control. It is not exclusive to the OnExpanded event, but rather represents a generic event handler for various events that notify the tree view of something that happened to a node.

Sender is the tree-view control that contains the node that is the focus of the notification.

Node is the item that has been expanded, collapsed, deleted, or which is about to be drawn.


TTypeData type

TTypeData is used internally to represent type information.

Unit

Typeinfo

type

  TTypeKind = (tkUnknown, tkInteger, tkChar, tkEnumeration, tkFloat, tkString, tkSet, tkClass, tkMethod, tkWChar, tkLString, tkWString, tkVariant, tkArray, tkRecord, tkInterface, tkInt64, tkDynArray);

  PPTypeInfo = ^PTypeInfo;

  PTypeInfo = ^TTypeInfo;

  TTypeInfo = record

    Kind: TTypeKind;

    Name: ShortString;

  end;

  ShortStringBase = string[255];

  TIntfFlag = (ifHasGuid, ifDispInterface, ifDispatch);

  TIntfFlags = set of TIntfFlag;

  TIntfFlagsBase = set of TIntfFlag;

  PTypeData = ^TTypeData;

  TTypeData = packed record

    case TTypeKind of

      tkUnknown, tkLString, tkWString, tkVariant: ();

      tkInteger, tkChar, tkEnumeration, tkSet, tkWChar: (

        OrdType: TOrdType;

        case TTypeKind of

          tkInteger, tkChar, tkEnumeration, tkWChar: (

            MinValue: Longint;

            MaxValue: Longint;

            case TTypeKind of

              tkInteger, tkChar, tkWChar: ();

              tkEnumeration: (

                BaseType: PPTypeInfo;

                NameList: ShortStringBase));

          tkSet: (CompType: PPTypeInfo));

      tkFloat: (FloatType: TFloatType);

      tkString: (MaxLength: Byte);

      tkClass: (

        ClassType: TClass;

        ParentInfo: PPTypeInfo;

        PropCount: SmallInt;

        UnitName: ShortStringBase );

      tkMethod: (

        MethodKind: TMethodKind;

        ParamCount: Byte;

        ParamList: array[0..1023] of Char );

      tkInterface: (

        IntfParent : PPTypeInfo; { ancestor }

        IntfFlags : TIntfFlagsBase;

        Guid : TGUID;

        IntfUnit : ShortStringBase; );

      tkInt64: (

        MinInt64Value, MaxInt64Value : Int64;

end;

Description

A TTypeData structure represents a category of properties, events, or methods in parameters passed to several routines in the TypInfo unit.


TUnDockEvent type

See also

Used in the OnUnDock event.

Unit

Controls

type TUnDockEvent = procedure(Sender: TObject; Client: TControl; NewTarget: TWinControl; var Allow: Boolean) of object;

Description

Sender is the object from which a control is being undocked.

Client is the control that is being undocked.

NewTarget is the control to which Client is being docked.

Allow is whether to allow the undocking.


TUpdateAction type

Indicates how an a dataset should proceed after an event handler has processed an update.

Unit

DB

type TUpdateAction = (uaFail, uaAbort, uaSkip, uaRetry, uaApplied);

Description

TUpdateAction is the type of a parameter on event handlers that intervene when applying cached updates (without using a client dataset and provider). The following table lists the possible values:

Value	Meaning

uaAbort	Abort the update operation without displaying an error message.

uaApplied	The event handler applied the update (not used in error handling event handlers). Free the current record update from the cache.

uaFail	Abort the update operation and display an error message.

uaRetry	Repeat the update operation that originally raised the error condition (not used in OnUpdateRecord event handlers).

uaSkip	Skip updating the current record and leave the unapplied changes in the cache.


TUpdateKind type

TUpdateKind defines the values for the UpdateKind parameter of  the OnUpdateError and OnUpdateRecord events.

Unit

DB

type TUpdateKind = (ukModify, ukInsert, ukDelete);

Description

The TUpdateKind type defines the possible values for the UpdateKind parameter of the OnUpdateError and OnUpdateRecord events of the TTable, TQuery, and TStoredProc components, as described in the following table:

Value	Description

ukModify	The cached update to the record is a modification to the record's contents.

ukInsert	The cached update is the insertion of a new record.

ukDelete	The cached update is the deletion of a record.


TUpdateMode type

See also

Indicates how to locate records so that they can be updated.

Unit

Db

type TUpdateMode = (upWhereAll, upWhereChanged, upWhereKeyOnly);

Description

TUpdateMode is the type of the UpdateMode property. UpdateMode specifies how the records are located when the ApplyUpdates method is called. TUpdateMode includes the following values:

Value	Meaning

upWhereAll	All columns (fields) are used to locate the record.

upWhereChanged	Only key field values and the original value of fields that have changed are used to find the record.

upWhereKeyOnly	Only key fields are used to find the record.


TUpdateStatus type

See also

Indicates the cached update status of a database record.

Unit

Db

type

  TUpdateStatus = (usUnmodified, usModified, usInserted, usDeleted);

Description

TUpdateStatus is the return type of the UpdateStatus method. UpdateStatus indicates what type of cached update, if any, exists for the current record of a dataset. TUpdateStatus includes the following values:

Value	Description

usUnmodified	The current record has no unapplied cached updates.

usModified	The current record has unapplied modifiecations.

usInserted	The current record has been inserted but the insertion was not applied.

usDeleted	The current record represents a deleted record, where the deletion has not yet been applied.


TUpDownDirection type

Indicates the direction in which the position of an updown control changes.

Unit

Db

type TUpDownDirection = (updNone, updUp, updDown);

Description

The following table lists the possible values:

Value	Description

updNone	The position is changing to an illegal value (less than the minimum value or greater than the maximum value).

updUp	The position is increasing.

updDown	The position is decreasing.


TValueType type

See also

TValueType defines the kinds of values written to and read from filer objects.

Unit

Classes

type TValueType = (vaNull, vaList, vaInt8, vaInt16, vaInt32, vaExtended, vaString, vaIdent, vaFalse, vaTrue, vaBinary, vaSet, vaLString, vaNil, vaCollection, vaSingle, vaCurrency, vaDate, vaWString, vaInt64);

Description

TValueType is the type used by the TReader and TWriter filer objects to type- check property values that are read from and written to streams when streaming components and their properties.

The VCL filers use a tagged value system, where each value on the stream is preceded by a prefix indicating its type. Those prefixes are of type TValueType. The following table lists the values for TValueType:

Value	Meaning

vaNull	identifies the type as the const Variant Null.

vaList	identifies the type as a list of tagged items ending with null.

vaInt8	identifies the type as a Shortint.

vaInt16	identifies the type as a Smallint.

vaInt32	identifies the type as a Longint.

vaExtended	identifies the type as a float.

vaString	identifies the type as a short string

vaIdent	identifies the type as a Pascal identifier string.

vaFalse	identifies the type as the Boolean False.

vaTrue	identifies the type as the Boolean True.

vaBinary	identifies the type as a block of binary proceeded by a length count.

vaSet	identifies the type as a set.

vaLString	identifies the type as a long string.

vaNil	identifies the type as nil.

vaCollection	identifies the type as a TCollection.

vaSingle	identifies the type as a Single.

vaCurrency	identifies the type as a Currency.

vaDate	identifies the type as a Date.

vaWSvaWString	identifies the type as a WideString.

vaInt64	identifies the type as an Int64.


TVarData type

See also 	Example

TVarData represents the internal structure of a Variant variable.

Unit

System

const
    varEmpty    = $0000;
    varNull     = $0001;
    varSmallint = $0002;
    varInteger  = $0003;
    varSingle   = $0004;
    varDouble   = $0005;
    varCurrency = $0006;
    varDate     = $0007;
    varOleStr   = $0008;
    varDispatch = $0009;
    varError    = $000A;
    varBoolean  = $000B;
    varVariant  = $000C;
    varUnknown  = $000D;
    varString   = $0100;
    varAny      = $0101;
    varTypeMask = $0FFF;
    varArray    = $2000;
    varByRef    = $4000;

type

  TVarArrayBound = packed record
  ElementCount: Integer;
  LowBound: Integer;
end;

  PVarArray = ^TVarArray;
TVarArray = packed record
  DimCount: Word;
  Flags: Word;
  ElementSize: Integer;
  LockCount: Integer;
  Data: Pointer;
  Bounds: array[0..255] of TVarArrayBound;
end;

  TVarData = packed record
    VType: Word;
    Reserved1, Reserved2, Reserved3: Word;
    case Integer of
      varSmallint: (VSmallint: Smallint);
      varInteger:  (VInteger: Integer);
      varSingle:   (VSingle: Single);
      varDouble:   (VDouble: Double);
      varCurrency: (VCurrency: Currency);
      varDate:     (VDate: Double);
      varOleStr:   (VOleStr: PWideChar);
      varDispatch: (VDispatch: Pointer);
      varError:    (VError: Longword);
      varBoolean:  (VBoolean: WordBool);
      varUnknown:  (VUnknown: Pointer);
      varByte:     (VByte: Byte);
      varString:   (VString: Pointer);
      varAny:      (VAny: Pointer);
      varArray:    (VArray: PVarArray);
      varByRef:    (VPointer: Pointer);
end;

Description

The TVarData type represents the internal structure of a Variant variable. The internal structure of a Variant is identical to the Variant type used by COM and the Win32 APIs.

The VType field of a TVarData record contains the type code of the variant in the lower twelve bits (the bits defined by the varTypeMask constant). In addition, the varArray bit may be set to indicate that the variant is an array, and the varByRef bit may be set to indicate that the variant contains a reference as opposed to a value.

The Reserved1, Reserved2, and Reserved3 fields of a TVarData record are unused.

The contents of the remaining eight bytes of a TVarData record depend on the VType field. If neither the varArray nor the varByRef bits are set, the variant contains a value of the given type.

If the varArray bit is set, the variant contains a pointer to a TVarArray structure that defines the specifics of the array. The type of each array element is given by the varTypeMask bits in the VType field.

If the varByRef bit is set, the variant contains a reference to a value of the type given by the varTypeMask and varArray bits in the VType field.

Note that the varString and varAny type codes are private to Delphi. Variants containing a varString value should never be passed to a non-Delphi function. Delphi's Automation support will automatically convert varString variants to varOleStr variants before passing them as parameters to external functions. Variants containing a varAny value should only be passed to CORBA functions.


TVarRec type

TVarRec is used inside a procedure with a parameter type of array of const.

Unit

System

const
vtInteger    = 0;
vtBoolean    = 1;
vtChar       = 2;
vtExtended   = 3;
vtString     = 4;
vtPointer    = 5;
vtPChar      = 6;
vtObject     = 7;
vtClass      = 8;
vtWideChar   = 9;
vtPWideChar  = 10;
vtAnsiString = 11;
vtCurrency   = 12;
vtVariant    = 13;
vtInterface  = 14;
vtWideString = 15;
vtInt64      = 16;

type
PVarRec = ^TVarRec;
TVarRec = record
case Byte of
vtInteger:    (VInteger: Integer; VType: Byte);
vtBoolean:    (VBoolean: Boolean);
vtChar:       (VChar: Char);
vtExtended:   (VExtended: PExtended);
vtString:     (VString: PShortString);
vtPointer:    (VPointer: Pointer);
vtPChar:      (VPChar: PChar);
vtObject:     (VObject: TObject);
vtClass:      (VClass: TClass);
vtWideChar:   (VWideChar: WideChar);
vtPWideChar:  (VPWideChar: PWideChar);
vtAnsiString: (VAnsiString: Pointer);
vtCurrency:   (VCurrency: PCurrency);
vtVariant:    (VVariant: PVariant);
vtInterface:  (VInterface: Pointer);
vtWideString: (VWideString: Pointer);
vtInt64:      (VInt64: PInt64);
end;

Description

TVarRec type is used inside a procedure with a parameter type of array of const. The VType field lets the procedure know the simple type of each parameter passed in the open array.

The variable type constants represent the values passed in the tag of the TVarRec structure.


TWindowHook type

See also

TWindowHook is the type for a dialog procedure.

Unit

Forms

type TWindowHook = function(var Message: TMessage): Boolean of object;

Description

TWindowHook is the type for the window procedure of a non-VCL dialog box. Like most window procedures, TWindowHook takes a message recordas an argument.

Except in response to the WM_INITDIALOG message, the window hook should return True if it processes the message, and False if it does not. When the Msg field of the Message parameter is WM_INITDIALOG, the window hook should return False if it explicitly sets the focus to one of the controls in the dialog box. Otherwise, it should return True, in which case the system sets the focus to the first control in the dialog box that can be given the focus.


TWindowState type

See also

TWindowState indicates whether a form is maximized, minimized, or normally sized.

Unit

Forms

type TWindowState = (wsNormal, wsMinimized, wsMaximized);

Description

TWindowState describes the state of a form window. The following table lists the possible values:

Value	Meaning

wsNormal	The form is in its normal state (that is, neither minimized nor maximized).

wsMinimized	The form is minimized.

wsMaximized	The form is maximized.


TWMKey type

See also

TWMKey represents a Windows Keystroke message.

Unit

Messages

type

  TWMKey = packed record

    Msg: Cardinal;

    CharCode: Word;

    Unused: Word;

    KeyData: Longint;

    Result: Longint;

  end;

Description

TWMKey is the message record for all Windows keyboard messages.

The Msg field is the Windows message code.

The CharCode field specifies the virtual key code for the key that the user pressed. This is either an ANSI character or a virtual key constant such as VK_CANCEL.

The KeyData field indicates the repeat count, scan code, extended-key flag, context code, and so on. See the Windows help system for a keystroke message such as WM_KEYDOWN for details on the possible values.

The Result field holds the value returned by the application processing the message.


TWMMouse type

See also

TWMMouse represents a Windows mouse message.

Unit

Messages

type

  TWMMouse = packed record

    Msg: Cardinal;

    Keys: Longint;

    case Integer of

      0: (

        XPos: Smallint;

        YPos: Smallint);

      1: (

        Pos: TSmallPoint;

        Result: Longint);

  end;

Description

TWMMouse is the message record for all Windows mouse messages.

The Msg field is the Windows message code.

The Keys field indicates whether various keys are down. It is a combination of the following values:

Value	Meaning

MK_CONTROL	The Control key is down.

MK_LBUTTON	The left mouse button is down.

MK_MBUTTON	The middle mouse button is down.

MK_RBUTTON	The right mouse button is down.

MK_SHIFT	The shift key is down.

The Pos field (or the XPos and YPos fields) indicates the global coordinates of the mouse pointer.

The Result field holds the value returned by the application processing the message.


TWMPaint type

See also

TWMKey represents a Windows Paint message.

Unit

Messages

type

  TWMPaint = packed record

    Msg: Cardinal;

    DC: HDC;

    Unused: Longint;

    Result: Longint;

  end;

Description

TWMPaint is the message record for all Windows Paint messages.

The Msg field is the Windows message code.

The DC field specifies handle to the device context that should be used for painting. This value should be assigned as the Handle property of the canvas of the object that needs painting. If DC is null, a valid device context must be obtained by calling the Windows API BeginPaint.

The Unused field is not used.

The Result field holds the value returned by the application processing the message.


TWordArray type

TWordArray declares a general array of type Word.

Unit

Sysutils

type

  PWordArray = ^TWordArray;

  TWordArray = array[0..16383] of Word;

Description

TWordArray declares a general array of type Word that can be used in typecasting.


Virtual key codes

See also

Virtual Key codes provide a symbolic representation of user key presses.

Unit

Windows

Description

Virtual key codes allow you to represent keyboard values for non-alphanumeric keys. Windows defines special constants for each key the user can press. These constants can then be used to refer to the keystroke in Windows API calls or in an OnKeyUp or OnKeyDown event handler.

Most of the virtual key codes are defined in the Windows unit. Additional key codes may be defined in special-purpose Windows wrappers such as the imm unit. To create a virtual key code for an alphanumeric value, use the Ord method. For example the virtual key code for ‘7’ is Ord(‘7’);

The following table lists the virtual key codes defined in the Windows unit:

Virtual Key Code	Corresponding key

VK_LBUTTON	Left mouse button

VK_RBUTTON	Right mouse button

VK_CANCEL	Control+Break

VK_MBUTTON	Middle mouse button

VK_BACK	Backspace key

VK_TAB	Tab key

VK_CLEAR	Clear key

VK_RETURN	Enter key

VK_SHIFT	Shift key

VK_CONTROL	Ctrl key

VK_MENU	Alt key

VK_PAUSE	Pause key

VK_CAPITAL	Caps Lock key

VK_KANA	Used with IME

VK_HANGUL	Used with IME

VK_JUNJA	Used with IME

VK_FINAL	Used with IME

VK_HANJA	Used with IME

VK_KANJI	Used with IME

VK_CONVERT	Used with IME

VK_NONCONVERT	Used with IME

VK_ACCEPT	Used with IME

VK_MODECHANGE	Used with IME

VK_ESCAPE	Esc key

VK_SPACE	Space bar

VK_PRIOR	Page Up key

VK_NEXT	Page Down key

VK_END	End key

VK_HOME	Home key

VK_LEFT	Left Arrow key

VK_UP	Up Arrow key

VK_RIGHT	Right Arrow key

VK_DOWN	Down Arrow key

VK_SELECT	Select key

VK_PRINT	Print key (keyboard-specific)

VK_EXECUTE	Execute key

VK_SNAPSHOT	Print Screen key

VK_INSERT	Insert key

VK_DELETE	Delete key

VK_HELP	Help key

VK_LWIN	Left Windows key (Microsoft keyboard)

VK_RWIN	Right Windows key (Microsoft keyboard)

VK_APPS	Applications key (Microsoft keyboard)

VK_NUMPAD0	0 key (numeric keypad)

VK_NUMPAD1	1 key (numeric keypad)

VK_NUMPAD2	2 key (numeric keypad)

VK_NUMPAD3	3 key (numeric keypad)

VK_NUMPAD4	4 key (numeric keypad)

VK_NUMPAD5	5 key (numeric keypad)

VK_NUMPAD6	6 key (numeric keypad)

VK_NUMPAD7	7 key (numeric keypad)

VK_NUMPAD8	8 key (numeric keypad)

VK_NUMPAD9	9 key (numeric keypad)

VK_MULTIPLY	Multiply key (numeric keypad)

VK_ADD	Add key (numeric keypad)

VK_SEPARATOR	Separator key (numeric keypad)

VK_SUBTRACT	Subtract key (numeric keypad)

VK_DECIMAL	Decimal key (numeric keypad)

VK_DIVIDE	Divide key (numeric keypad)

VK_F1	F1 key

VK_F2	F2 key

VK_F3	F3 key

VK_F4	F4 key

VK_F5	F5 key

VK_F6	F6 key

VK_F7	F7 key

VK_F8	F8 key

VK_F9	F9 key

VK_F10	F10 key

VK_F11	F11 key

VK_F12	F12 key

VK_F13	F13 key

VK_F14	F14 key

VK_F15	F15 key

VK_F16	F16 key

VK_F17	F17 key

VK_F18	F18 key

VK_F19	F19 key

VK_F20	F20 key

VK_F21	F21 key

VK_F22	F22 key

VK_F23	F23 key

VK_F24	F24 key

VK_NUMLOCK	Num Lock key

VK_SCROLL	Scroll Lock key

VK_LSHIFT	Left Shift key (only used with GetAsyncKeyState and GetKeyState)

VK_RSHIFT	Right Shift key  (only used with GetAsyncKeyState and GetKeyState)

VK_LCONTROL	Left Ctrl key  (only used with GetAsyncKeyState and GetKeyState)

VK_RCONTROL	Right Ctrl key  (only used with GetAsyncKeyState and GetKeyState)

VK_LMENU	Left Alt key  (only used with GetAsyncKeyState and GetKeyState)

VK_RMENU	Right Alt key  (only used with GetAsyncKeyState and GetKeyState)

VK_PROCESSKEY	Process key

VK_ATTN	Attn key

VK_CRSEL	CrSel key

VK_EXSEL	ExSel key

VK_EREOF	Erase EOF key

VK_PLAY	Play key

VK_ZOOM	Zoom key

VK_NONAME	Reserved for future use

VK_PA1	PA1 key

VK_OEM_CLEAR	Clear key


WordRec type

See also

WordRec declares a utility record to store high and low order bytes of a variable.

Unit

Sysutils

type

  WordRec = packed record

    Lo, Hi: Byte;

  end;

Description

The WordRec type declares a utility record that stores the high and low order bytes of the specified variable as type Byte. WordRec is used primarily for typecasting.


 TUpdateSQL

Hierarchy	Properties	Methods	See also	Example

TUpdateSQL applies cached updates on behalf of queries or stored procedures that can’t post updates directly.

Unit

dbtables

Description

Use a TUpdateSQL object to provide SQL statements used to update read-only datasets represented by TQuery or TStoredProc components when cached updates are enabled. A dataset is read-only either by design or circumstance. If a dataset is read-only by design, the application itself does not provide a user interface for updating data, but may institute a programmatic scheme behind the scenes. If a dataset is read-only by circumstance, it indicates that the Borland Database Engine (BDE) returned a read-only result set. This usually happens for queries made against multiple tables. Such queries are, by SQL-92 definitions, read-only.

TUpdateSQL provides a mechanism for circumventing what some developers consider an SQL-92 limitation. It enables a developer to provide INSERT, UPDATE, and DELETE statements for performing separate update queries on otherwise read-only result sets in such a manner that the separate update queries are transparent to the end user.

In practical application, a TUpdateSQL object is placed on a data module or form, and linked to a TQuery or TStoredProc component through that component’s UpdateObject property. If the UpdateObject property points to a valid TUpdateSQL object, the SQL statements belonging to the update object are automatically applied when cached updates are applied.


TUpdateSQL properties

TUpdateSQL	Alphabetically	Legend

In TUpdateSQL

DataSet

DeleteSQL

InsertSQL

ModifySQL

Query

SQL

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TUpdateSQL properties

TUpdateSQL	By object	Legend

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DataSet

DeleteSQL

DesignInfo

InsertSQL

ModifySQL

Name

Owner

Query

SQL

Tag

VCLComObject


TUpdateSQL.DataSet

TUpdateSQL	See also

Identifies the dataset to which a TUpdateSQL component belongs.

property DataSet: TBDEDataSet;

Description

At design time, setting the dataset object’s UpdateObject property automatically sets the DataSet property of the specified TUpdateSQL object. An application should only need to set this property if it creates a new update component at run time.


TUpdateSQL.DeleteSQL

TUpdateSQL	See also

Specifies the SQL DELETE statement to use when applying a cached deletion of a record.

property DeleteSQL: TStrings;

Description

Set DeleteSQL to the SQL DELETE statement to use when applying a deletion to a record. Statements can be parameterized queries. To create a DELETE statement at design time, use the UpdateSQL editor to create statements, such as:

DELETE FROM "Country.db"

WHERE Name = :OLD_Name

At run time, an application can write a statement directly to this property to set or change the DELETE statement.

Note:	As the example illustrates, DeleteSQL supports an extension to normal parameter binding. To retrieve the value of a field as it exists prior to application of cached updates, the field name with ‘OLD_’. This is especially useful when doing field comparisons in the WHERE clause of the statement.


TUpdateSQL.InsertSQL

TUpdateSQL	See also

Specifies the SQL INSERT statement to use when applying a cached insertion of a record.

property InsertSQL: TStrings;

Description

Set InsertSQL to the SQL INSERT statement to use when applying an insertion to a dataset. Statements can be parameterized queries. To create a INSERT statement at design time, use the UpdateSQL editor to create statements, such as:

INSERT INTO "Country.db"

(Name, Capital, Continent)

VALUES (:Name, :Capital, :Continent)

WHERE :OLD_Name = "Rangoon"

At run time, an application can write a statement directly to this property to set or change the INSERT statement.

Note:	As the example illustrates, InsertSQL supports an extension to normal parameter binding. To retrieve the value of a field as it exists prior to application of cached updates, the field name with ‘OLD_’. This is especially useful when doing field comparisons in the WHERE clause of the statement.


TUpdateSQL.ModifySQL

TUpdateSQL	See also

Specifies the SQL UPDATE statement to use when applying an update to a record and cached updates is enabled.

property ModifySQL: TStrings;

Description

Set ModifySQL to the SQL UPDATE statement to use when applying an updated record to a dataset. Statements can be parameterized queries. To create a UPDATE statement at design time, use the UpdateSQL editor to create statements, such as:

UPDATE "Country.db"

SET Name = :Name, Capital = :Capital, Continent = :Continent

WHERE Name = :OLD_Name

At run time, an application can write a statement directly to this property to set or change the UPDATE statement.

Note:	As the example illustrates, ModifySQL supports an extension to normal parameter binding. To retrieve the value of a field as it exists prior to application of cached updates, the field name with ‘OLD_’. This is especially useful when doing field comparisons in the WHERE clause of the statement.


TUpdateSQL.Query

TUpdateSQL	See also

Returns the query object used to perform a specified kind of update.

property Query[UpdateKind: TUpdateKind]: TQuery;

Description

Query is a read-only property that provides a reference to the internal TQuery that executes the SQL that applies the cached data updates. Use properties and methods of TQuery to work with this reference.

Using one of the TUpdateKind constants as an index for the Query property, the internal TQuery object will have the SQL specified in the corresponding update SQL property: DeleteSQL, InsertSQL, or ModifySQL. UpdateKind can be one of the following:

Value	Meaning

ukDelete	Return the query object used to execute DELETE statements (DeleteSQL).

ukInsert	Return the query object used to execute INSERT statements (InsertSQL).

ukModify	Return the query object used to execute UPDATE statements (ModifySQL).

Each query object executes a particular kind of SQL statement. The contents of the SQL statements executed by these objects can be accessed directly using the ModifySQL, InsertSQL, and DeleteSQL properties.

The main purpose of Query is to provide a a way for an application to set the properties for an update query object or to call the query object’s methods.

Note:	If a particular kind of update statement is not provided, then its corresponding query object is nil. For example, if an application does not provide an SQL statement for the DeleteSQL property, then setting Query[ukDelete] returns nil.


TUpdateSQL.SQL

TUpdateSQL	See also

Returns a specified SQL statement used when applying cached updates.

property SQL[UpdateKind: TUpdateKind]: TStrings;

Description

Returns the SQL statement in the ModifySQL, InsertSQL, or DeleteSQL property, depending on the setting of the UpdateKind index. UpdateKind can be any of the following:

Value	Meaning

ukDelete	Return the query object used to execute DELETE statements (DeleteSQL).

ukInsert	Return the query object used to execute INSERT statements (InsertSQL).

ukModify	Return the query object used to execute UPDATE statements (ModifySQL).


TUpdateSQL methods

TUpdateSQL	Alphabetically

In TUpdateSQL

Apply

Create

Destroy

ExecSQL

SetParams

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TUpdateSQL methods

TUpdateSQL	By object

AfterConstruction

Apply

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecSQL

ExecuteAction

FieldAddress

FindComponent

Free

FreeInstance

FreeNotification

FreeOnRelease

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SafeCallException

SetParams

UpdateAction


TUpdateSQL.Apply

TUpdateSQL	See also

Sets the parameters for a specified SQL statement type, and executes the resulting statement.

procedure Apply(UpdateKind: TUpdateKind);

Description

Call Apply to set parameters for an SQL statement and execute it to update a record. UpdateKind indicates which SQL statement to bind and execute, and can be one of the following values:

Value	Meaning

ukDelete	Bind and execute the SQL statement in the DeleteSQL property

ukInsert	Bind and execute the SQL statement in the InsertSQL property

ukModify	Bind and execute the SQL statement in the ModifySQL property

Apply is primarily intended for manually executing update statements from an OnUpdateRecord event handler.

Note:	If an SQL statement does not contain parameters, it is more efficient to call ExecSQL instead of Apply.


TUpdateSQL.Create
TUpdateSQL.CreateTUpdateSQL

TUpdateSQL	See also

Creates an instance of an update object.

constructor Create(AOwner: TComponent);

Description

Call Create to instantiate an update object at run time. You do not need to call Create for update objects placed in a data module or form at design time. Delphi automatically handles these objects.


TUpdateSQL.Destroy

TUpdateSQL	See also

Frees an instance of an update object.

constructor Destroy;

Description

Do not call Destroy directly in an application. Usually destruction of update objects is handled automatically by Delphi. If an application creates its own instance of an update object, however, the application should call Free, which verifies that the update object is not nil before calling Destroy


TUpdateSQL.ExecSQL

TUpdateSQL	See also

Executes a specified type of SQL statement to perform an update for an otherwise read-only results set when cached updates is enabled.

procedure ExecSQL(UpdateKind: TUpdateKind);

Description

Call ExecSQL to execute the SQL statement necessary for updating the records belonging to a read-only result set when cached updates is enabled. UpdateKind specifies the statement to execute, and can be one of the following values:

Value	Meaning

ukDelete	Execute the SQL statement used to delete records in the dataset (DeleteSQL).

ukInsert	Execute the SQL statement used to insert new records into the dataset (InsertSQL).

ukModify	Execute the SQL statement used to update records in the dataset (ModifySQL).

If the statement to execute contains any parameters, an application must call SetParams to bind the parameters before calling ExecSQL. To determine if a statement contains parameters, examine the appropriate ModifySQL, InsertSQL, or DeleteSQL property, depending on the statement type intended for execution.

Note:	To both bind parameters and execute a statement, call Apply.


TUpdateSQL.SetParams

TUpdateSQL	See also

Binds parameters in an SQL statement prior to statement execution.

procedure SetParams(UpdateKind: TUpdateKind);

Description

Call SetParams to bind parameters in an SQL statement associated with the update object prior to executing the statement. UpdateKind indicates the type of statement for which to bind parameters, and can be one of the following values:

Value	Meaning

ukDelete	Bind parameters for the SQL statement used to delete records (DeleteSQL).

ukInsert	Bind parameters for the SQL statement used to insert new records (InsertSQL).

ukModify	Bind parameters for SQL statement used to update records (ModifySQL).

Parameters are indicated in an SQL statement by a colon. Except for the leading colon in the parameter name, the parameter name must exactly match the name of an existing field name for the dataset.

Note:	Parameter names can be prefaced by the ‘OLD_’ indicator. If so, the old value of the field is used to perform the update instead of any updates in the cache.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TDataSetUpdateObject

TSQLUpdateObject


 TUpDown

Hierarchy	Properties	Methods	Events	See also

TUpDown is a wrapper for a Windows up-down control.

Unit

comctrls

Description

Use TUpDown to add an up-down control to a form. Up-down controls consist of a pair of arrow buttons, such as the arrows that appear in a spin box. Up-down controls allow users to change the size of a numerical value by clicking on arrow buttons.


TUpDown properties

TUpDown	Alphabetically	Legend

Derived from TCustomUpDown

AlignButton

ArrowKeys

Associate

Increment

Max

Min

Orientation

Position

Thousands

Wrap

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

DockClientCount

DockClients

DoubleBuffered

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

VisibleDockClientCount

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ParentShowHint

PopupMenu

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TUpDown properties

TUpDown	By object	Legend

Action

Align

AlignButton

Anchors

ArrowKeys

Associate

BiDiMode

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

Cursor

DesignInfo

DockClientCount

DockClients

DockOrientation

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

Increment

Left

LRDockWidth

Max

Min

Name

Orientation

Owner

Parent

ParentShowHint

ParentWindow

PopupMenu

Position

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Thousands

Top

UndockHeight

UndockWidth

VCLComObject

Visible

VisibleDockClientCount

Width

WindowProc

Wrap


TUpDown events

TUpDown	Alphabetically	Legend

Derived from TCustomUpDown

OnChanging

OnChangingEx

OnClick

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnContextPopup

OnMouseDown

OnMouseMove

OnMouseUp


TUpDown events

TUpDown	By object	Legend

OnChanging

OnChangingEx

OnClick

OnContextPopup

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp


TUpDown methods

TUpDown	Alphabetically

Derived from TCustomUpDown

CreateTCustomUpDown_Create>Main

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

CreateParented

Destroy

DisableAlign

DockDrop

EnableAlign

FindChildControl

FlipChildren

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

MouseWheelHandler

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TUpDown methods

TUpDown	By object

AfterConstruction

Assign

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

Create

CreateParented

DefaultHandler

Destroy

DestroyComponents

Destroying

DisableAlign

Dispatch

Dock

DockDrop

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetControlsAlignment

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsRightToLeft

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

SafeCallException

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomUpDown


About Object and Component Help

See also

The Object and Component Help is the complete source of Help on Delphi objects, components, global routines, types, and variables.It also includes information on general topics such as drag and drop and OLE Automation. The individual entries for objects, components, routines, types, and variables include the unit in which each is declared. These units are located in the sub-directories of the Delphi Source directory.

Objects

A Delphi object consists of methods, and in many cases, properties, and events. Properties represent the data contained in the object. Methods are the actions the object can perform. Events are conditions the object can react to. All objects descend from the ancestor object TObject.

Components

Components are visual objects that you can manipulate at design time. All components descend from TComponent.

Routines

Global routines are the procedures and functions from the runtime library and from the Visual Component Library (VCL). These routines are not part of a class, but can be called either directly or from within class methods.

Types

The types described in the Help are used as return types and parameter types for object methods, properties and events, and for global routines. In most cases types are documented in the entry for the method, property, event or global routine in which they are used.

Variables

The variables defined in the Help are declared in the runtime library and in the VCL. Some of these variables are instantiations of objects. Examples are the Application and ComServer variables.

The Help on all of these topics can be accessed either by using the F1 key from the IDE or by using the Contents, Index, or Find from Help.


How to find Help using F1

See also

To display Help on a property or event, press the F1 key while the cursor is that property or event as it appears in a cell in the Object Inspector.

To bring up Help on objects, components, methods, global routines, variables, types, or general topics, as well as on properties and events, type the word in your source code and press F1 while the cursor in on that word.


How to find Help by selecting Contents

See also

The Contents tab in Help provides information in 5 groups:

A list of objects and components by unit

An alphabetical list of objects and components

A list of global routines by category

A list of global routines by unit

An alphabetical list of global routines


How to find Help by selecting Index or Find

See also

To find Help on an object, component, method, property, event, global routine, type, variable, or topic, type the word in the edit window and press Enter or click on the topic found.

To access Help from Find, type the word in the edit window, select matching words to narrow your search, and click on the topic you want to display.


How to use examples in Help

See also

The Object and Component Help includes complete object examples (compilable), as well as code fragments for methods, properties, and events.

For object examples, you can view the source code or the .dfm files from help. The pathname is given for the entire example, including the project, .dfm, and source code files, so that you can choose to load and run the example yourself.

Object examples are located in subdirectories of the Delphi\Help\Examples directory.

Code fragments for the methods, properties, and events are accessible by clicking the example link.


How to program with a component

See also

1.	Select a component from the Component palette and add it to a form.

2.	Set property values of the component using the Object Inspector.

3.	Respond to events that might occur to the component at runtime. To respond to an event, you write code within an event handler. Your code modifies property values and calls methods.


TVariantField

Hierarchy	Properties	Methods	Events	See also

TVariantField represents a variant field in a dataset.

Unit

DB

Description

TVariantField is a persistent field object that encapsulates the fundamental behavior common to Variant data. In addition to the properties, methods, and events common to all fields that are introduced by the TVariantField class, TVariantField includes many properties, methods, and events that are useful for managing the value and properties of a string field in a database. TVariantField introduces no new methods or events, but reimplements a number of properties to adapt them to accessing string fields and to manage language driver conversions.

As with all persistent field objects, a TVariantField can be created at design-time using the Fields Editor or at runtime by calling the constructor for the class. Persistent field objects exist solely in the memory space of an application. Creating a persistent field object only creates an object in the application, and does not result in the creation of a field in a table.

Fields in a table can be accessed without use of persistent field objects. Virtual field objects are created to provide access to a field when the field is referenced through such means as the TDataSet.Fields property or the TDataSet.FieldByName method. However, as both the Fields property and the FieldByName method return a value of type TVariantField, the return value must be typecast as a TVariantField before using any property specific to TVariantField.


TVariantField properties

TVariantField	Alphabetically	Legend

In TVariantField

AsBoolean

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

Value

Derived from TField

Alignment

AsCurrency

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TVariantField properties

TVariantField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

ValidChars

Value

VCLComObject

Visible


TVariantField.AsBoolean

TVariantField	See also

Represents the field’s value as a Boolean value.

property AsBoolean: Boolean;

Description

AsBoolean provides a property to read the value of the field’s data into a Boolean, or to assign a Boolean value to the contents of the field.

Table1TheVariantField.AsBoolean := True;


TVariantField.AsDateTime

TVariantField	See also

Represents the field’s value as a TDateTime value.

property AsDateTime: TDateTime;

Description

AsDateTime provides a property to read the value of the field’s data into an object or variable of type TDateTime, or to assign a TDateTime value to the contents of the field.

Table1TheVariantField.AsDateTime := Now;


TVariantField.AsFloat

TVariantField	See also

Represents the field’s value as an Double value.

property AsFloat: Double;

Description

AsFloat provides a property to read the value of the field’s data into a Double, or to assign a Double value to the contents of the field.

Table1TheVariantField.AsFloat := 100.45;


TVariantField.AsInteger

TVariantField	See also

Represents the field’s value as a 32-bit integer.

property AsInteger: Integer;

Description

AsInteger provides a property to read the value of the field’s data into an integer, or to assign an integer value to the contents of the field.

Table1TheVariantField.AsInteger := 400;


TVariantField.AsString

TVariantField	See also

Represents the field’s value as a string.

property AsString: String;

Description

AsString provides a property to read the value of the field’s data into a String, or to assign a String value to the contents of the field.

Table1TheVariantField.AsString := 'This is a variant field';


TVariantField.AsVariant

TVariantField	See also

Represents the Value of the field as type Variant.

property AsVariant: Variant;

Description

AsVariant provides a property to read the value of the field’s data into a Variant, or to assign a Variant value to the contents of the field.

Table1TheVariantField.AsVariant := VariantTypeVariable;


TVariantField.Value

TVariantField	See also

Represents the data in a field component.

property Value: Variant

Description

Use Value to read data directly from and write data directly to a field component at runtime. For example, use the Value property to affect the contents of a field that is not Visible.

Table1TheVariantField.Value := VariantTypeVariable;


TVariantField events

TVariantField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TVariantField events

TVariantField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TVariantField methods

TVariantField	Alphabetically

In TVariantField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

GetParentComponent

HasParent

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TVariantField methods

TVariantField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TVariantField.Create

TVariantField	See also

Creates and initializes a variant field component.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TInterfaceField. After calling the inherited constructor, Create sets the DataType property to ftVariant.

After instantiating a TInterfaceField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TInterfaceField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TInterfaceField with a dataset component by setting its DataSet property to the name of the dataset component.

The example below creates a TInterfaceField object for a field named UnknownData accessed through a TQuery named Query1.

var

  T: TInterfaceField;

begin

  Query1.Close;

  T := TInterfaceField.Create(Self);

  T.FieldName := 'UnknownData';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField


TVarBytesField

Hierarchy	Properties	Methods	Events	See also

TVarBytesField represents a variable-length untyped binary field in a dataset.

Unit

db

Description

A variable bytes field value is a set of bytes of variable size, with the actual length of the value stored in the first two bytes.

TVarBytesField differs from its immediate ancestor TBytesField only in the data type it represents. Except for the constructor and the DataSize property, all of the properties, methods, and events are the same as those of TBytesField, and provide functionality that is useful for managing unformatted binary data fields in a dataset.


TVarBytesField properties

TVarBytesField	Alphabetically	Legend

In TVarBytesField

DataSize

Derived from TBinaryField

AsString

AsVariant

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TVarBytesField properties

TVarBytesField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ReadOnly

Required

Size

Tag

Text

ValidChars

Value

VCLComObject

Visible


TVarBytesField.DataSize

TVarBytesField	See also	Example

Indicates the amount of memory needed to store the value of a variable bytes field in its native database format.

property DataSize: Word;

Description

Check DataSize to determine the number of bytes required to store a variable bytes field component’s value. Use DataSize to determine the size needed for a buffer when working with the GetData and SetData methods.

For variable bytes fields, DataSize is Size + 2. The unformatted data can take up to Size bytes, and the extra 2 bytes store the length of the unformatted data.


TVarBytesField events

TVarBytesField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TVarBytesField events

TVarBytesField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TVarBytesField methods

TVarBytesField	Alphabetically

In TVarBytesField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TVarBytesField methods

TVarBytesField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TVarBytesField.Create

TVarBytesField	See also

Creates an instance of TVarBytesField.

constructor Create(AOwner: TComponent); override;

Description

It is seldom necessary to call Create directly, because a VarBytes field object is instantiated automatically for all variable bytes fields in a dataset.

After calling the inherited constructor, Create sets the DataType to ftVarBytes and initializes the Size property to 16.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TBinaryField

TBytesField


TWinControlActionLink

Hierarchy	Properties	Methods	Events

TWinControlActionLink is an action link designed for generic windowed control clients.

Unit

Controls

Description

TWinControlActionLink is designed to link actions to generic windowed control clients. TWinControlActionLink overrides methods to determine whether the action and client are linked, and to ensure that action events are appropriate for properties of windowed control clients.

TWinControlActionLink inherits, from its ancestors, support for linking actions with the properties of components and controls. TWinControlActionLink adds support for linking the help context action to the appropriate behavior for a windowed control.


TWinControlActionLink properties

TWinControlActionLink	Alphabetically

Derived from TBasicActionLink

Action


TWinControlActionLink properties

TWinControlActionLink	By object

Action


TWinControlActionLink events

TWinControlActionLink	Alphabetically

Derived from TBasicActionLink

OnChange


TWinControlActionLink events

TWinControlActionLink	By object

OnChange


TWinControlActionLink methods

TWinControlActionLink	Alphabetically	Legend

In TWinControlActionLink

AssignClient

IsHelpContextLinked

SetHelpContext

Derived from TBasicActionLink

Create

Destroy

Execute

Update

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TWinControlActionLink methods

TWinControlActionLink	By object	Legend

AfterConstruction

AssignClient

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

Execute

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

IsHelpContextLinked

MethodAddress

MethodName

NewInstance

SafeCallException

SetHelpContext

Update


TWinControlActionLink.AssignClient

TWinControlActionLink

Specifies the client used with the TWinControlActionLink.

procedure AssignClient(AClient: TObject); override;

Description

TWinControlActionLink overrides AssignClient to ensure that the client for the action is a windowed control.


TWinControlActionLink.IsHelpContextLinked

TWinControlActionLink	See also

Indicates whether the action for the Help context and the client are linked.

function IsHelpContextLinked: Boolean; override;

Description

IsHelpContextLinked indicates whether the action, for the Help context, is linked to the appropriate client property. IsHelpContextLinked returns True if the client requests that the action control this event, False otherwise.


TWinControlActionLink.SetHelpContext

TWinControlActionLink	See also

Sets the Help context of a windowed control if the client is linked to the action for this event.

procedure SetHelpContext(Value: THelpContext); override;

Description

SetHelpContext sets the help context of a client windowed control, and is called only if the client is linked for this event. Value specifies whether what the help context should be.


Scope

Protected


Hierarchy

TObject

TBasicActionLink

TActionLink

TControlActionLink


TWinControl

Hierarchy	Properties	Methods	Events	See also

TWinControl is the base class for all windowed controls.

Unit

controls

Description

Windowed controls are controls that

Can receive focus while the application is running.

Other controls may display data, but the user can use the keyboard to interact with a control only if the control is a windowed control.

Can contain other controls.

A control that contains other controls is a parent. Only a windowed control can be a parent of one or more other child controls.

Have a window handle.

A window handle is the identifier provided by Windows for a window. Windowed controls can represent standard control windows provided by the Windows operating environment, or custom windows defined by the application.

Newly created components are seldom derived directly from TWinControl. Base most new controls on TCustomControl, which provides a canvas and handles paint messages, or on any of several more specialized controls, such as TButtonControl, TCustomComboBox, TCustomEdit, or TCustomListBox.


TWinControl properties

TWinControl	Alphabetically	Legend

In TWinControl

BevelEdges

BevelInner

BevelKind

BevelOuter

BevelWidth

BorderWidth

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DefWndProc

DockClientCount

DockClients

DockManager

DockSite

DoubleBuffered

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

UseDockManager

VisibleDockClientCount

WheelAccumulator

WindowHandle

Derived from TControl

Action

Align

Anchors

BiDiMode

BoundsRect

ClientHeight

ClientWidth

Constraints

ControlState

ControlStyle

Cursor

DockOrientation

Enabled

Floating

FloatingDockSiteClass

Height

Hint

HostDockSite

Left

LRDockWidth

Name

Parent

ShowHint

TBDockHeight

Top

UndockHeight

UndockWidth

Visible

Width

WindowProc

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag

VCLComObject


TWinControl properties

TWinControl	By object	Legend

Action

Align

Anchors

BevelEdges

BevelInner

BevelKind

BevelOuter

BevelWidth

BiDiMode

BorderWidth

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

Constraints

ControlCount

Controls

ControlState

ControlStyle

Ctl3D

Cursor

DefWndProc

DesignInfo

DockClientCount

DockClients

DockManager

DockOrientation

DockSite

DoubleBuffered

Enabled

Floating

FloatingDockSiteClass

Handle

Height

HelpContext

Hint

HostDockSite

ImeMode

ImeName

Left

LRDockWidth

Name

Owner

Parent

ParentCtl3D

ParentWindow

ShowHint

Showing

TabOrder

TabStop

Tag

TBDockHeight

Top

UndockHeight

UndockWidth

UseDockManager

VCLComObject

Visible

VisibleDockClientCount

WheelAccumulator

Width

WindowHandle

WindowProc


TWinControl.BevelEdges

TWinControl	Properties 	See also

Specifies which edges of the control are beveled.

property BevelEdges: TBevelEdges;

Description

Use BevelEdges to get or set which edges of the control are beveled. The BevelInner, BevelOuter, and BevelKind properties determine the appearance of the specified edges.


TWinControl.BevelInner

TWinControl	Properties 	See also

Specifies the cut of the inner bevel.

property BevelInner: TBevelCut;

Description

Use BevelInner to specify whether the inner bevel has a raised, lowered, or flat look.

The inner bevel appears immediately inside the outer bevel. If there is no outer bevel (BevelOuter is bvNone), the inner bevel appears immediately inside the border.


TWinControl.BevelKind

TWinControl	Properties 	See also

Specifies the control’s bevel style.

property BevelKind: TBevelKind;

Description

Use BevelKind to modify the appearance of a bevel. BevelKind influences how sharply the bevel stands out.

BevelKind, in combination with BevelWidth and the cut of the bevel specified by BevelInner or BevelOuter, can create a variety of effects. Experiment with various combinations to get the look you want.


TWinControl.BevelOuter

TWinControl	Properties 	See also

Specifies the cut of the outer bevel.

property BevelOuter: TBevelCut;

Description

Use BevelInner to specify whether the outer bevel has a raised, lowered, or flat look.

The outer bevel appears immediately inside the border and outside the inner bevel.


TWinControl.BevelWidth

TWinControl	Properties 	See also

Specifies the width of the inner and outer bevels.

property BevelWidth: TBevelWidth;

Description

Use BevelWidth to specify the width, in pixels, of the inner and outer bevels.


TWinControl.BorderWidth

TWinControl	Properties 	See also

Specifies the width of the control’s border.

property BorderWidth: TBorderWidth;

Description

Use BorderWidth to get or set the width of the control’s border. The border is the area just inside the edges of the control in which no other controls can be placed. It appears immediately outside any bevels.


TWinControl.Brush

TWinControl	See also

Determines the color and pattern used for painting the background of the control.

property Brush: TBrush;

Description

Read the Brush property to determine the style and color of the control’s background. Brush is a read-only property, because a windowed control owns a single Brush object to handle the painting of its background. The attributes of the brush can be changed, however, by using the Color and Style properties of the TBrush object. Further, all of the attributes of the brush can be changed to match those of another brush, by using the Assign method of the TBrush object.


TWinControl.ClientOrigin

TWinControl	See also

Indicates the screen coordinates (in pixels) of the top left corner of the client area of the control.

property ClientOrigin: TPoint;

Description

Read ClientOrigin to discover where the top-left corner of the control is on the screen. ClientOrigin returns X and Y coordinates in a record of type TPoint. The TPoint type defines a pixel location onscreen, with the origin in the top left corner of the control. X specifies the horizontal coordinate of the point, Y specifies the vertical coordinate.


TWinControl.ClientRect

TWinControl	See also 	Example

Indicates the size (in pixels) of a control’s client area.

property ClientRect: TRect;

Description

Read ClientRect to learn the size of the client area of a control. ClientRect returns a rectangle defining the client area of the control. It is equivalent to Rect(0, 0, ClientWidth, ClientHeight).

Note:	ClientRect is the size of the physical client area of the control, not its logical client area. If the control supports scrolling, the ClientRect is not the entire scrolling range, but only the region that is available at any time.


TWinControl.ControlCount

TWinControl	See also 	Example

Indicates the number of controls that are children of the windowed control.

property ControlCount: Integer;

Description

Read ControlCount when iterating over all the children of this control. The children of the control are listed in the Controls property array.

ControlCount is a read-only property.

Note:	The value of ControlCount is always 1 greater than the highest Controls index, because the first Controls index is 0.


TWinControl.Controls

TWinControl	See also 	Example

Lists all children of the windowed control.

property Controls[Index: Integer]: TControl;

Description

Controls is an array of all the child controls of the windowed control. All of the child controls of the windowed control list the windowed control as their Parent property. The Controls property is convenient for referring to the children of a control by number rather than name. For example, Controls may be used to iterate over all the children of the windowed control.

Don't confuse the Controls property with the Components property. The Controls property lists all the controls that are child windows of the control, while the Components property lists all components that it owns. The form owns all components put on it, and therefore, they appear in the form's Components property list, even when they are child windows of a control on the form.

Controls is a read-only property. To add or delete a child control, use the InsertControl or RemoveControl methods. To move a child control from one parent to another, set the Parent of the child control, as that will handle both the RemoveControl from the original parent and the InsertControl to the new parent.


TWinControl.Ctl3D

TWinControl	See also

Determines whether a control has a three-dimensional (3-D) or two-dimensional look.

property Ctl3D: Boolean;

Description

Use Ctl3D to control the appearance of the control. If Ctl3D is True, the control has a beveled appearance. If Ctl3D is False, the control appears flat. The default value of Ctl3D is True.

If a control's ParentCtl3D property is True, then changes in the Ctl3D property of the control's parent automatically changes the Ctl3D property of the control. When assigning a value directly to a control's Ctl3D property, the control's ParentCtl3D property is automatically set to False.

Some controls, such as TPanel and TControlBar use the BevelInner and BevelOuter properties to provide greater control over the appearance of bevels. When the BevelInner and BevelOuter properties are used, changing the value of Ctl3D has no effect.

Note:	For Ctl3D to work with radio buttons, check boxes, and any of the common dialog boxes on Windows NT 3.51, CTL3D32.DLL must be installed in the System32 directory. 32-bit versions of Windows and NT 4.0 and later do not require CTL3D32.DLL.


TWinControl.DefWndProc

TWinControl	See also

Specifies the default window procedure for the windowed control.

property DefWndProc: Pointer;

Description

Windowed controls use the Windows API function CallWindowProc with DefWndProc to invoke the standard Windows message handling for a window message. Using DefWndProc instead of the WndProc method bypasses any message processing introduced by the WndProc method.

DefWndProc fills the role for windowed controls that DefaultHandler fills for all objects. The DefaultHandler for TWinControl uses DefWndProc to pass messages to Windows for processing.

For windowed controls, DefWndProc is initially set to the window procedure of the window class specified in the Params parameter in the CreateParams method. Change DefWndProc to subclass the window class of a windowed control.


TWinControl.DockClientCount

TWinControl	See also	Example

Specifies the number of controls that are docked on the windowed control.

property DockClientCount: Integer;

Description

Use DockClientCount to get the number of controls that are docked to the windowed control. This value can be used as an upper bound when iterating through the DockClients property.

Note:	The DockClients property can contain controls that are not visible. To get the number of docked clients that are visible, use the VisibleDockClientCount property instead.


TWinControl.DockClients

TWinControl	See also

Lists the controls that are docked to the windowed control.

property DockClients[Index: Integer]: TControl;

Description

Use DockClients to access any control that is docked to the windowed control.


TWinControl.DockManager

TWinControl	See also

Specifies the control’s dock manager interface.

property DockManager: IDockManager;

Description

Use DockManager to specify the control’s dock manager. The dock manager controls common drag-and-dock behavior such as the painting of drag rectangles while objects are dragged and managing the placement of docked and undocked objects.

DockManager can be nil if the DockSite property or the UseDockManager property is False.


TWinControl.DockSite

TWinControl	Example

Specifies whether the control can be the target of drag-and-dock operations.

property DockSite: Boolean;

Description

Use DockSite to determine whether the control can be the target of drag-and-dock operations.


TWinControl.DoubleBuffered

TWinControl	See also

Determines whether the control’s image is rendered directly to the window or painted to an in-memory bitmap first.

property DoubleBuffered: Boolean;

Description

When DoubleBuffered is False, the windowed control paints itself directly to the window. When DoubleBuffered is True, the windowed control paints itself to an in-memory bitmap that is then used to paint the window. Double buffering reduces the amount of flicker when the control repaints, but is more memory intensive.

When a windowed control is a dock site and has an associated dock manager, it must be double-buffered.


TWinControl.Handle

TWinControl	See also 	Example

Provides access to the window handle of the control.

property Handle: HWND;

Description

Use the Handle when making Windows API function calls that requires a window handle.

If a window handle for the control doesn’t exist, the Handle property creates one by calling the HandleNeeded method when your application reads the Handle property value. Therefore, do not use the Handle property during component creation or streaming.

Handle is a read-only property.


TWinControl.HelpContext

TWinControl	See also

Provides a context number for use in calling context-sensitive online Help.

property HelpContext: THelpContext;

Description

Assign a value to HelpContext to determine which help screen appears when the user presses F1 to request help.

Each screen in the Help system should have a unique context number. When a control is selected in the application, pressing F1 displays a Help screen. Which Help screen appears depends on the value of the HelpContext property.

If HelpContext is zero, then the control inherits the help context of its parent control. For example, if a button with a HelpContext of zero is contained in a form with a non-zero help context and F1 is pressed, the context screen for the form will be shown.


TWinControl.ImeMode

TWinControl	See also

Determines the behavior of the input method editor (IME).

property ImeMode: TImeMode;

Description

Set ImeMode to configure the way an IME processes user keystrokes. An IME is a front-end input processor for Asian language characters. The IME hooks all keyboard input, converts it to Asian characters in a conversion window, and sends the converted characters or strings on to the Delphi application.

ImeMode allows a control to influence the type of conversion performed by the IME so that it is appropriate for the input expected by the control. For example, a control that only accepts numeric input might specify an ImeMode of imClose, as no conversion is necessary for numeric input.

Note:	The value of ImeMode only takes effect when the control receives focus. To change the value of ImeMode when the control already has input focus, call the SetIme method.


TWinControl.ImeName

TWinControl	See also

Specifies the input method editor (IME) to use for converting keyboard input to Asian language characters.

type TImeName = type string;

property ImeName: TImeName;

Description

Set ImeName to specify which IME to use for converting keystrokes. An IME is a front-end input processor for Asian language characters. The IME hooks all keyboard input, converts it to Asian characters in a conversion window, and sends the converted characters or strings on to the Delphi application.

ImeName must specify one of the IMEs that has been installed through the Windows control panel. The property inspector provides a drop-down list of all currently installed IMEs on the system. At runtime, applications can obtain a list of currently installed IMEs from the global Screen variable.

If ImeName specifies an unavailable IME, the IME that was active when the application started is used instead. No exception is generated.

Note:	The value of ImeName only takes effect when the control receives focus. To change the value of ImeName after the control has input focus, call the SetIme method.


TWinControl.ParentCtl3D

TWinControl	See also

Determines where a component looks to determine if it should appear three dimensional.

property ParentCtl3D: Boolean;

Description

Use ParentCtl3D to ensure that all the components on a form have a uniform appearance. For example, to make all components on a form appear beveled, set the form's Ctl3D property to True and each control's ParentCtl3D property to True. Not only will all components have a beveled appearance, but to change to a uniform two-dimensional appearance, you only have to change the Ctl3D property of the form and all the components will appear flat.

If ParentCtl3D is True, the component uses the value of its parent component's Ctl3D property. If ParentCtl3D is False, the control uses the value of its own Ctl3D property. The default value is True.

To specify either a 2D or 3D appearance for a particular component, set Ctl3D to True (for 3D) or False (for 2D). When setting the Ctl3D property of a control, ParentCtl3D automatically gets set to False.


TWinControl.ParentWindow

TWinControl	See also

Contains the window handle of a non-VCL window that contains the control.

property ParentWindow: HWnd;

Description

Set ParentWindow to host a windowed control in a non-VCL parent window. Setting ParentWindow moves the control so that it is contained in the specified window. For example, TActiveXControl objects use ParentWindow to insert a control in an ActiveX container window. ParentWindow is set automatically when a control is created using the CreateParented method.

Use ParentWindow with windowed controls that are packaged in a DLL so that they may be used by a VB, OWL or MFC application.

A TWinControl object can have either a Parent property or a ParentWindow property, but not both. If the Parent property of a control is not nil, the value of ParentWindow is ignored.


TWinControl.Showing

TWinControl	See also

Indicates whether the control is showing on the screen.

property Showing: Boolean;

Description

Showing is used internally to optimize the allocation of Windows resources. Use Showing to determine when you must allocate resources that are required when the control is visible. When Showing is False, the control is not visible and can delay the allocation of resources.

If the Visible properties of a component and all the parents in its parent hierarchy are True, Showing is guaranteed to be True. If one of the parents containing the control has a Visible property value of False, Showing may be either True or False.

Showing is a read-only property.


TWinControl.TabOrder

TWinControl	See also

Indicates the position of the control in its parent's tab order.

type TTabOrder = -1..32767;

property TabOrder: TTabOrder;

Description

TabOrder is the order in which child windows are visited when the user presses the Tab key. The control with the TabOrder value of 0 is the control that has the focus when the form first appears.

Initially, the tab order is always the order in which the controls were added to the form. The first control added to the form has a TabOrder value of 0, the second is 1, the third is 2, and so on. Change this by changing the TabOrder property.

Each control has a unique tab-order value within its parent. If you change the TabOrder property value of one control to be the same as the value of a second control, the TabOrder value for all the other controls changes. For example, suppose a control is sixth in the tab order. If you change the control's TabOrder property value to 3 (making the control fourth in the tab order), the control that was originally fourth in the tab order now becomes fifth, and the control that was fifth becomes sixth.

Assigning TabOrder a value greater than the number of controls contained in the parent control moves the control to the end of the tab order. The control does not take on the assigned value of TabOrder, but instead is given the number that assures the control is the last in the tab order.

TabOrder is meaningful only if the TabStop property is True and if the control has a parent. (The TabOrder property of a form is not used unless the form is the child of another form.) A control with a TabOrder of -1 has no parent, and therefore cannot be reached by pressing the Tab key. To remove a parented control from the Tab order, set its TabStop property to False.


TWinControl.TabStop

TWinControl	See also

Determines if the user can tab to a control.

property TabStop: Boolean;

Description

Use the TabStop to allow or disallow access to the control using the Tab key.

If TabStop is True, the control is in the tab order. If TabStop is False, the control is not in the tab order and the user can't press the Tab key to move to the control.

Note:	TabStop is not meaningful for a form unless the form assigns another form to be its parent.


TWinControl.UseDockManager

TWinControl	See also

Specifies whether the dock manager is used in drag-and-dock operations.

property UseDockManager: Boolean;

Description

Use UseDockManager to get or set whether a dock manager is used in drag-and-dock operations. The Dock manager handles the painting of drag outlines and the positioning of docked controls.


TWinControl.VisibleDockClientCount

TWinControl	See also

Specifies the number of visible controls that are docked on the windowed control.

property VisibleDockClientCount: Integer;

Description

Use VisibleDockClientCount to determine the number of controls in the DockClients list that have a Visible property value of True. This value is less than or equal to the value of DockClientCount.


TWinControl.WheelAccumulator

TWinControl	See also

Accumulates mouse wheel rotations.

property WheelAccumulator: Integer;

Description

WheelAccumulator is used in the OnMouseWheel event handler to determine how much the wheel has been rotated.


TWinControl.WindowHandle

TWinControl	See also

Provides access to a window handle for the control.

property WindowHandle: Hwnd;

Description

The WindowHandle property provides access to the same window handle as the Handle property, but WindowHandle is protected, and therefore only accessible to code inside the control.

The advantage to using WindowHandle is that it can be written to, while the Handle property is read-only. Use WindowHandle when implementing methods that need to change the value of the control’s window handle. Unlike the Handle property, reading the value of WindowHandle doesn’t automatically create a valid handle. Reading WindowHandle can return a zero value.


TWinControl events

TWinControl	Alphabetically	Legend

In TWinControl

OnDockDrop

OnDockOver

OnEnter

OnExit

OnGetSiteInfo

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseWheel

OnMouseWheelDown

OnMouseWheelUp

OnUnDock


TWinControl events

TWinControl	By object	Legend

OnDockDrop

OnDockOver

OnEnter

OnExit

OnGetSiteInfo

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseWheel

OnMouseWheelDown

OnMouseWheelUp

OnUnDock


TWinControl.OnDockDrop

TWinControl	See also

Occurs when another control is docked to the control.

property OnDockDrop: TDockDropEvent;

Description

Write code in the OnDockDrop event to perform actions when another control is docked on the control.

OnDockDrop can only occur if DockSite is True.


TWinControl.OnDockOver

TWinControl	See also	Example

Occurs when another control is dragged over the control.

property OnDockOver: TDockOverEvent;

Description

Write code in the OnDockOver event to indicate whether a dockable control that is dragged over the windowed control can be accepted as a dock client. OnDockOver occurs after the TDragDockObject has been initialized by an OnGetSiteInfo event.

OnDockOver occurs only if DockSite is True.


TWinControl.OnEnter

TWinControl	See also 	Example

Occurs when a control receives the input focus.

property OnEnter: TNotifyEvent;

Description

Use the OnEnter event handler to cause any special processing to occur when a windowed component becomes active.

The OnEnter event does not occur when switching between forms or between another Windows application and the application that includes the windowed control.

When switching between controls in separate container controls such as the TPanel and the TGroupBox controls, an OnEnter event occurs for the container before the OnEnter event of the contained control.

Similarly, an OnExit event of the container occurs after the OnExit event of the control in a container when focus moves to another control outside the container.

For example, consider a form with an OK button and a group box that contains three radio buttons, where focus is currently on the OK button. When the user clicks one of the radio buttons, an OnExit event of the button occurs, followed by an OnEnter event on the group box, and finally an OnEnter event on the radio button that was clicked. If the user then clicks on the OK button, an OnExit event for the radio button occurs followed by an OnExit event for the group box, and then the button’s OnEnter event occurs.


TWinControl.OnExit

TWinControl	See also 	Example

Occurs when the input focus shifts away from one control to another.

property OnExit: TNotifyEvent;

Description

Use the OnExit event handler to provide special processing when the control ceases to be active.

The OnExit event does not occur when switching between forms or between another Windows application and your application.

When switching between controls in separate container controls such as the TPanel and the TGroupBox controls, an OnExit event occurs for the control inside the container before the OnExit event of the container.

Similarly, an OnEnter event of the container occurs before the OnEnter event of the control in a container when focus moves to a control inside a container.

For example, consider a form with an OK button and a group box that contains three radio buttons, where focus is currently on the OK button. When the user clicks one of the radio buttons, an OnExit event of the button occurs, followed by an OnEnter event on the group box, and finally an OnEnter event on the radio button that was clicked. If the user then clicks on the OK button, an OnExit event for the radio button occurs followed by an OnExit event for the group box, and then the button’s OnEnter event occurs.

Note:	The value of the ActiveControl property updates before the OnExit event occurs.


TWinControl.OnGetSiteInfo

TWinControl	See also

Returns the control’s docking information.

property OnGetSiteInfo: TGetSiteInfoEvent;

Description

Write code in the OnGetSiteInfo event handler to initialize a TDragDockObject with information about where a dragged object can be docked, if at all. OnGetSiteInfo occurs before the OnDockDrop event.

OnGetSiteInfo occurs only if DockSite is True.


TWinControl.OnKeyDown

TWinControl	See also 	Example

Occurs when a user presses any key while the control has focus.

type

  TKeyEvent = procedure (Sender: TObject; var Key: Word; Shift: TShiftState) of object;

property OnKeyDown: TKeyEvent;

Description

Use the OnKeyDown event handler to specify special processing to occur when a key is pressed. The OnKeyDown handler can respond to all keyboard keys, including function keys and keys combined with the Shift, Alt, and Ctrl keys, and pressed mouse buttons.

The TKeyEvent type points to a method that handles keyboard events.

The Key parameter is the key on the keyboard. For non-alphanumeric keys, use WinAPI virtual key codes to determine the key pressed. For more information, see Virtual Key codes.

The Shift parameter indicates whether the Shift, Alt, or Ctrl keys are combined with the keystroke.


TWinControl.OnKeyPress

TWinControl	See also 	Example

Occurs when a user presses a single character key.

type TKeyPressEvent = procedure (Sender: TObject; var Key: Char) of object;

property OnKeyPress: TKeyPressEvent;

Description

Use the OnKeyPress event handler to make something happen as a result of a single character key press.

The Key parameter in the OnKeyPress event handler is of type Char; therefore, the OnKeyPress event registers the ASCII character of the key pressed. Keys that don't correspond to an ASCII Char value (Shift or F1, for example) don't generate an OnKeyPress event. Key combinations (such as Shift+A), generate only one OnKeyPress event (for this example, Shift+A results in a Key value of “A” if Caps Lock is off). To respond to non-ASCII keys or key combinations, use the OnKeyDown or OnKeyUp event handlers.


TWinControl.OnKeyUp

TWinControl	See also 	Example

Occurs when the user releases a key that has been pressed.

type

  TKeyEvent = procedure (Sender: TObject; var Key: Word; Shift: TShiftState) of object;

property OnKeyUp: TKeyEvent;

Description

Use the OnKeyUp event handler to provide special processing that occurs when a key is released. The OnKeyUp handler can respond to all keyboard keys, including function keys and keys combined with the Shift, Alt, and Ctrl keys.

The TKeyEvent type points to a method that handles keyboard events. The Key parameter is the key on the keyboard. For non-alphanumeric keys, you must use WinAPI virtual key codes to determine the key pressed. For more information, see Virtual Key codes.

The Shift parameter indicates whether the Shift, Alt, or Ctrl keys are combined with the keystroke.


TWinControl.OnMouseWheel

TWinControl	See also

Occurs when the mouse wheel is rotated.

property OnMouseWheel: TMouseWheelEvent;

Description

Write code in the OnMouseWheel event handler to respond to mouse wheel messages. If there is no OnMouseWheel event handler, or if the mouse wheel message is not handled in the OnMouseWheel event handler, then an OnMouseWheelUp or OnMouseWheelDown message occurs, depending on the direction the mouse wheel was rotated.


TWinControl.OnMouseWheelDown

TWinControl	See also

Occurs when the mouse wheel is rotated downward.

property OnMouseWheelDown: TMouseWheelUpDownEvent;

Description

Write code in the OnMouseWheelDown event handler to perform actions when the mouse wheel is rotated downward. OnMouserWheelDown occurs only if the message is not already handled in an OnMouseWheel event handler.


TWinControl.OnMouseWheelUp

TWinControl	See also

Occurs when the mouse wheel is rotated upward.

property OnMouseWheelUp: TMouseWheelUpDownEvent;

Description

Write code in the OnMouseWheelUp event handler to perform actions when the mouse wheel is rotated upward. OnMouserWheelUp occurs only if the message is not already handled in an OnMouseWheel event handler.


TWinControl.OnUnDock

TWinControl	See also	Example

Occurs when the application tries to undock a control that is docked to the windowed control.

property OnUnDock: TUnDockEvent;

Description

Write an OnUnDock event handler to adjust the windowed control when a dock client is undocked. The OnUnDock event handler can make any necessary adjustments, or it can block the undock attempt by setting the Allow parameter to False.


TWinControl methods

TWinControl	Alphabetically	Legend

In TWinControl

ActionChange

AddBiDiModeExStyle

AdjustClientRect

AdjustSize

AlignControls

AssignTo

Broadcast

CanAutoSize

CanFocus

CanResize

ChangeScale

ConstrainedResize

ContainsControl

ControlAtPos

Create

CreateDockManager

CreateHandle

CreateParams

CreateParented

CreateParentedControl

CreateSubClass

CreateWindowHandle

CreateWnd

DefaultHandler

Destroy

DestroyHandle

DestroyWindowHandle

DestroyWnd

DisableAlign

DoAddDockClient

DockDrop

DockOver

DoDockOver

DoEnter

DoExit

DoFlipChildren

DoKeyDown

DoKeyPress

DoKeyUp

DoMouseWheel

DoMouseWheelUp

DoMouseWheelDown

DoRemoveDockClient

DoUnDock

EnableAlign

FindChildControl

FindNextControl

FixupTabList

FlipChildren

Focused

GetActionLinkClass

GetChildren

GetClientOrigin

GetClientRect

GetControlExtents

GetDeviceContext

GetParentHandle

GetSiteInfo

GetTabOrderList

GetTopParentHandle

HandleAllocated

HandleNeeded

InsertControl

Invalidate

IsControlMouseMsg

KeyDown

KeyPress

KeyUp

MainWndProc

MouseWheelHandler

NotifyControls

PaintControls

PaintHandler

PaintTo

PaintWindow

PaletteChanged

ReadState

Realign

RecreateWnd

ReloadDockedControl

RemoveControl

Repaint

ResetIme

ResetImeComposition

ScaleBy

ScaleControls

ScrollBy

SelectFirst

SelectNext

SetBounds

SetChildOrder

SetFocus

SetIme

SetImeCompositionWindow

SetZOrder

ShowControl

Update

UpdateControlState

WndProc

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

Dock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EndDrag

GetControlsAlignment

GetTextBuf

GetTextLen

Hide

InitiateAction

IsRightToLeft

ManualDock

ManualFloat

Perform

Refresh

ReplaceDockedControl

ScreenToClient

SendToBack

SetTextBuf

Show

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWinControl methods

TWinControl	By object	Legend

ActionChange

AddBiDiModeExStyle

AdjustClientRect

AdjustSize

AfterConstruction

AlignControls

Assign

AssignTo

BeforeDestruction

BeginDrag

BringToFront

Broadcast

CanAutoSize

CanFocus

CanResize

ChangeScale

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

ClientToScreen

ConstrainedResize

ContainsControl

ControlAtPos

Create

CreateDockManager

CreateHandle

CreateParams

CreateParented

CreateParentedControl

CreateSubClass

CreateWindowHandle

CreateWnd

DefaultHandler

Destroy

DestroyComponents

DestroyHandle

Destroying

DestroyWindowHandle

DestroyWnd

DisableAlign

Dispatch

DoAddDockClient

Dock

DockDrop

DockOver

DoDockOver

DoEnter

DoExit

DoFlipChildren

DoKeyDown

DoKeyPress

DoKeyUp

DoMouseWheel

DoMouseWheelDown

DoMouseWheelUp

DoRemoveDockClient

DoUnDock

DragDrop

Dragging

DrawTextBiDiModeFlags

DrawTextBiDiModeFlagsReadingOnly

EnableAlign

EndDrag

ExecuteAction

FieldAddress

FindChildControl

FindComponent

FindNextControl

FixupTabList

FlipChildren

Focused

Free

FreeInstance

FreeNotification

FreeOnRelease

GetActionLinkClass

GetChildren

GetClientOrigin

GetClientRect

GetControlExtents

GetControlsAlignment

GetDeviceContext

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

GetParentHandle

GetSiteInfo

GetTabOrderList

GetTextBuf

GetTextLen

GetTopParentHandle

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitiateAction

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsControlMouseMsg

IsRightToLeft

KeyDown

KeyPress

KeyUp

MainWndProc

ManualDock

ManualFloat

MethodAddress

MethodName

MouseWheelHandler

NewInstance

NotifyControls

PaintControls

PaintHandler

PaintTo

PaintWindow

PaletteChanged

Perform

ReadState

Realign

RecreateWnd

Refresh

ReloadDockedControl

RemoveComponent

RemoveControl

Repaint

ReplaceDockedControl

ResetIme

ResetImeComposition

SafeCallException

ScaleBy

ScaleControls

ScreenToClient

ScrollBy

SelectFirst

SelectNext

SendToBack

SetBounds

SetChildOrder

SetFocus

SetIme

SetImeCompositionWindow

SetTextBuf

SetZOrder

Show

ShowControl

Update

UpdateAction

UpdateControlState

UseRightToLeftAlignment

UseRightToLeftReading

UseRightToLeftScrollBar

WndProc


TWinControl.ActionChange

TWinControl	See also

Updates the windowed control to reflect changes in its associated action.

procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;

Description

ActionChange is called automatically when the associated action changes. It updates the windowed control to reflect the action’s current Caption, Enabled, Hint, Visible, and HelpContext properties and its OnClick event handler.

The Sender parameter is the associated action. The CheckDefaults parameter specifies whether properties and event handlers should be changed if they differ from the default values. When CheckDefaults is True, properties and event handlers are only changed when the current values are the default values (that is, when the values have not been previously changed). When CheckDefaults is False, properties and event handlers are changed, regardless of their current values.


TWinControl.AddBiDiModeExStyle

TWinControl	See also

Sets control’s window style according to its bi-directional support.

procedure AddBiDiModeExStyle(var ExStyle: DWORD);

Description

The CreateParams method calls AddBiDiModeExStyle to update the control’s style flags (passed as the ExStyle parameter) according the control’s bi-directional support. AddBiDiModeExStyle uses the UseRightToLeftReading, UseRightToLeftScrollbar, UseRightToLeftAlignment, and GetControlsAlignment methods to determine the current bi-directional support.


TWinControl.AdjustClientRect

TWinControl	See also

Provides the interface that adjusts the ClientRect property for idiosyncrasies of the window.

procedure AdjustClientRect(var Rect: TRect); virtual;

Description

AdjustClientRect is called internally when the windowed control needs accurate information on where to place child controls within the client area. As implemented in TWinControl, AdjustClientRect does nothing. Override this method in descendants such as TTabControl where the ClientRect property is not the same as the region in which child objects can appear.


TWinControl.AdjustSize

TWinControl	See also

Adjusts the control’s size according to its contents and constraints.

procedure AdjustSize; override;

Description

If the AutoSize property is True, AdjustSize is called automatically when the control needs to automatically resize itself to its contents. As implemented in TWinControl, AdjustSize calls SetBounds with the values of its Left, Top, Width, and Height properties. This call can result in a change of size if these values are altered in the control’s OnCanResize or OnConstrainedResize event handlers, or if the control’s OnResize event handler makes any final adjustments.

Descendant classes override AdjustSize to change the size of the control to adjust to its contents.

Component writers may call AdjustSize when making changes to a control’s contents.


TWinControl.AlignControls

TWinControl	See also

Aligns any controls for which the control is the parent within a specified area of the control.

procedure AlignControls(AControl: TControl; var Rect: TRect); virtual;

Description

Use AlignControls to align all controls within an area of a form, panel, group box, scroll box, or any windowed control that contains several other controls. Specify the area in which to align the controls as the value of the Rect parameter.

AlignControls uses the Align property value for each child control to determine how to align it. The AControl parameter can be nil. If you specify a control in AControl, that control takes precedence in alignment over other, similarly-aligned controls.


TWinControl.AssignTo

TWinControl	See also

Copies the properties of the windowed control to another object.

procedure AssignTo(Dest: TPersistent); override;

Description

Do not call the protected AssignTo method. Instead, applications call the Assign method to copy the properties of another object. If the object’s Assign method does not include the ability to copy from the source object, the Assign method calls the source object’s protected AssignTo method, to copy the source objects properties to the object specified by the Dest parameter. This allows objects to expand the abilities of another object’s Assign method to copy from additional sources.

The AssignTo method implemented in TWinControl copies the Caption, Enabled, Hint, Visible, and HelpContext properties and the OnClick event handler to a TCustomAction object.


TWinControl.Broadcast

TWinControl	See also

Sends a message to each of the child controls of the windowed control.

procedure Broadcast(var Message);

Description

Use Broadcast when you want to send the same message to each of the child controls contained within the windowed control. Specify the message to be passed as the value of the Message parameter.


TWinControl.CanAutoSize

TWinControl	See also

Indicates how the control can be resized.

function CanAutoSize(var NewWidth, NewHeight: Integer): Boolean; override;

Description

CanAutoSize is called automatically when the AutoSize property is True and an attempt is made to resize the control. It allows controls to implement the AutoSize property before the resize sequence that begins with the OnCanResize and OnConstrainedResize events and ends with the OnResize event.

When CanAutoSize is called, the NewWidth and NewHeight parameters indicate the proposed new dimensions of the control. CanAutoSize adjusts these values so that the control’s size adjusts to its contents. If the adjustment results in values of NewWidth and NewHeight that differ from the control’s current width and height, CanAutoSize returns True, indicating that the resize sequence should proceed. If, after adjustment, NewWidth and NewHeight equal Width and Height, CanAutoSize returns False, and the resize sequence is aborted.

As implemented in TWinControl, CanAutoSize returns True, adjusting NewWidth and NewHeight so that all the control’s children fit.


TWinControl.CanFocus

TWinControl	See also

Indicates whether a control can receive focus.

function CanFocus: Boolean; dynamic;

Description

Call CanFocus to find out if the control can receive input from the user.

CanFocus returns True if both the control and its parent(s) have their Visible and Enabled properties set to True. If any of the Visible and Enabled properties of the control or the controls in which it is contained are not True, then CanFocus returns False.


TWinControl.CanResize

TWinControl	See also

Indicates how the control can respond to a resize attempt.

function CanResize(var NewWidth, NewHeight: Integer): Boolean; override;

Description

CanResize is called automatically when an attempt is made to resize the control. The NewWidth and NewHeight parameters specify the attempted new values for the control’s height and width. CanResize returns True if the control can be resized to the returned values of NewWidth and NewHeight. CanResize returns False if the control can’t be resized.

CanResize generates an OnCanResize event. An OnCanResize event handler may change the values of NewHeight and NewWidth.


TWinControl.ChangeScale

TWinControl	See also

Resizes and repositions the control, rescaling the children of the control before the control itself is rescaled.

procedure ChangeScale(M, D: Integer); override;

Description

ChangeScale can be used to change the scale of a form and all its controls for a different screen resolution or font size. Because ChangeScale modifies the control’s Top, Left, Width, and Height properties, it changes the position of the control and its children as well as their size.

The M parameter is the multiplier and the D parameter is the divisor. For example, to change a control and its children to be 75% of their original sizes, specify the value of M as 75, and the value of D as 100 (75/100). Alternately, specify the value of M as 3, and the value of D as 4 (3/4). Both fractions are equal and result in the controls being scaled by the same amount, 75%.

To make the control and its children 33% larger than their previous sizes, specify the value of M as 133, and the value of D as 100 (133/100). You can also obtain the same results by specifying the value of M as 4, and the value of D as 3 (4/3).

Note:	Because control sizes and coordinates are integers, scaling them by the M/D ratio incurs some degree of roundoff error. Calling ChangeScale repeatedly can mean that at some point the control disappears (when the roundoff errors make the control smaller), or at some point it creeps off the form (when the roundoff errors move the location of control). If rescaling a form repeatedly, destroy and reload the form after several rescalings to eliminate the accumulating roundoff error.


TWinControl.ConstrainedResize

TWinControl	See also

Generates an OnConstrainedResize event.

procedure ConstrainedResize(var MinWidth, MinHeight, MaxWidth, MaxHeight: Integer); override;

Description

ConstrainedResize is called automatically as part of a control’s resize sequence. It generates an OnConstrainedResize event, passing in the MinWidth, MinHeight, MaxWidth, and MaxHeight parameters, which can be altered by the event handler before they are applied to the attempted resize.


TWinControl.ContainsControl

TWinControl	See also

Indicates whether a specified control exists within the control.

function ContainsControl(Control: TControl): Boolean;

Description

Use ContainsControl to find out if a particular control exists within this control. ContainsControl returns True if the specified value of the Control parameter is a child control of the windowed control. The Control parameter need not be an immediate child (in the Controls property), but may be contained in a child of the windowed control, or in a child of a child of the windowed control, for indefinitely many levels deep.

If the method returns False, the specified control is not within the control.


TWinControl.ControlAtPos

TWinControl	See also

Returns the child control located at a specified position within the control.

function ControlAtPos(const Pos: TPoint; AllowDisabled: Boolean, AllowWinControls:Boolean=False): TControl;

Description

Use ControlAtPos to determine which child control is at the specified location within the control. ControlAtPos returns an immediate child of the windowed control; that is, one of the entries of the Controls property, that has the windowed control for its Parent property.

Specify the position in client coordinates as the value of the Pos parameter. Pos can be anywhere within the boundaries of the child control, not just the upper left corner.

The AllowDisabled parameter determines whether the search for controls includes disabled controls.

The AllowWinControls parameter determines whether descendants of TWinControl are considered when looking for the child control.

If there is no control that matches the AllowDisabled and AllowWinControls parameters at the specified position, ControlAtPos returns nil.


TWinControl.Create

TWinControl	See also

Creates an instance of TWinControl.

constructor Create(AOwner: TComponent); override;

Description

Call Create to construct and initialize a new windowed control insert the newly-constructed control into its owner, as specified by the AOwner parameter. Create inserts the control in the owner by calling the owner's InsertComponent method.

After calling the inherited constructor, Create

Creates and initializes the Brush.

Initializes the ParentCtl3D property to True.

Sets the TabOrder property to -1.

Most controls override Create to initialize their unique properties. Objects that override the Create method must always call the inherited Create method first, and then proceed with the component-specific initialization. Specify the override directive when overriding the Create method.

If a component's Create method allocates resources or memory, override the Destroy method to free those resources.


TWinControl.CreateDockManager

TWinControl	See also

Creates the dock manager for the control.

function CreateDockManager: IDockManager; dynamic;

Description

CreateDockManager is called automatically during drag-and-dock operations when the UseDockManager property is True. CreateDockManager creates the object that implements the DockManager property.

Override CreateDockManager to create a custom dock manager for the control.


TWinControl.CreateHandle

TWinControl	See also

Generates a window for the control if it does not already exist.

procedure CreateHandle; virtual;

Description

CreateHandle calls the CreateWnd method to create the window if the control has a parent. The Window handle for this window becomes the value of the Handle property.

CreateHandle creates or locates the parent control’s window before it creates a window for the control itself.

Note:	If the Parent property is nil, CreateHandle raises an exception.


TWinControl.CreateParams

TWinControl	See also

Initializes a window-creation parameter record passed as the Params parameter.

procedure CreateParams(var Params: TCreateParams); virtual;

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle. Override CreateParams to customize the way a control creates its Windows representation. When overriding CreateParams, always call the inherited method first to set the default values, then make any desired adjustments.

CreateParams fills in the parameter record that is passed as the value of the Params parameter. This data structure holds information needed when telling Windows to create a window handle. The fields of a TCreateParams record become the parameters to a call to the CreateWindowEx API function.

TWinControl implements CreateParams by setting all the fields of Params to generic base values. A number of the standard controls override CreateParams to change one or more of the default values in Params.


TWinControl.CreateParented

TWinControl	See also

Creates and initializes a control as the child of a specified non-VCL window.

constructor CreateParented(ParentWindow: HWnd);

Description

Call CreateParented to embed a windowed control in a non-VCL parent window. TActiveXControl objects call CreateParented to create an ActiveX control as a child of the host application’s client site window.

CreateParented calls the Create method to initialize the control normally, but with the ParentWindow property set to the ParentWindow parameter, and the Owner property set to nil.


TWinControl.CreateParentedControl

TWinControl	See also

Creates and initializes a TWinControl as the child of a specified non-VCL window.

class function CreateParentedControl(ParentWindow: HWnd): TWinControl;

Description

Call CreateParentedControl to embed a TWinControl in a non-VCL parent window.

CreateParentedControl allocates memory for a new instance of the same class as the windowed control, sets its Parent property to ParentWindow, and calls the constructor, passing in nil for the Owner parameter. CreateParentedControl returns the newly created control.


TWinControl.CreateSubClass

TWinControl	See also

Creates a windowed control derived from an existing Windows window class.

procedure CreateSubClass(var Params: TCreateParams; ControlClassName: PChar);

Description

Call CreateSubClass in the CreateParams method of a subclassed control, after calling the inherited CreateParams. Specify the parameter record as the value of the Params parameter. CreateSubClass allows VCL controls to create registered Windows controls.


TWinControl.CreateWindowHandle

TWinControl	See also

Creates a Windows control to represent the control.

procedure CreateWindowHandle(const Params: TCreateParams); virtual;

Description

The CreateWnd method calls CreateWindowHandle to create the window for a control. CreateWindowHandle creates the window by calling the CreateWindowEx API function, passing parameters from the record passed in the Params parameter. Once the window is created, its handle is available as the Handle property.


TWinControl.CreateWnd

TWinControl	See also

Creates the window used by the windowed-control component.

procedure CreateWnd; virtual;

Description

CreateWnd is called automatically when the windowed control is first created or when the window must be destroyed and recreated to reflect property changes. Override CreateWnd to pass additional initialization messages to the window when it is first created.

CreateWnd first calls the CreateParams method to initialize the window-creation parameters, then calls CreateWindowHandle to create the window for the control. CreateWnd adjusts the size of the newly-created window and then sets the control's font by calling the Perform method, passing the WM_SETFONT message.


TWinControl.DefaultHandler

TWinControl	See also

Provides message handling for all messages that the control does not fully process itself.

procedure DefaultHandler(var Message); virtual;

Description

Override DefaultHandler to change the default message handling for the control. The Message parameter can be cast to a TMessage type, to obtain the WParam, LParam, and Result of the message. If the Result of the message is non-zero, the message has already been handled. Set the Result field to a non-zero value to prevent further processing of the message by the inherited method.

Calling inherited in a message-handling method results in a call to the ancestor's DefaultHandler method unless that ancestor specifies an explicit handler for the message.

TWinControl overrides the TControl DefaultHandler method to handle messages for all its descendant types. DefaultHandler passes any otherwise-unhandled messages to the control's window procedure using the CallWindowProc API function.


TWinControl.Destroy

TWinControl	See also

Destroys an instance of TWinControl.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TWinControl reference is not nil, and only then calls Destroy.


TWinControl.DestroyHandle

TWinControl	See also

Destroys the windowed control's window without destroying the control.

procedure DestroyHandle;

Description

Call DestroyHandle to dispose of the window, but leave the control intact. The control can later recreate the window if needed. DestroyHandle is the converse operation to CreateHandle. Applications should call the high-level CreateHandle and DestroyHandle methods, rather than the lower-level methods of CreateWnd and DestroyWnd, whenever possible.

If the control has windowed controls as child controls, DestroyHandle calls each of their DestroyHandle methods before calling DestroyWnd to destroy its own handle.


TWinControl.DestroyWindowHandle

TWinControl	See also

Destroys the window created in the CreateWindowHandle method.

procedure DestroyWindowHandle; virtual;

Description

Call DestroyWindowHandle to dispose of the window for the control.

TWinControl's Destroy method calls DestroyWindowHandle to destroy any window associated with a windowed control before destroying the object. The DestroyWnd method also calls DestroyWindowHandle.


TWinControl.DestroyWnd

TWinControl	See also

Destroys the control's window.

procedure DestroyWnd; virtual;

Description

DestroyWnd is called when the control needs to replace its window.  For example, changing properties that are implemented by window parameter settings require the control to be destroyed and then recreated using the CreateWnd method.

Before the window is destroyed, DestroyWnd saves a copy of the control's text in memory, frees any device contexts, and finally calls DestroyWindowHandle.  When the window is recreated, the stored copy of the control’s text is assigned to the new window.


TWinControl.DisableAlign

TWinControl	See also

Disables the realigning of controls within the windowed control.

procedure DisableAlign;

Description

Call DisableAlign to temporarily prevent child controls from realigning. For example, while performing multiple manipulations of controls, such as reading from a form file or scaling, performance improves if child controls are not realigned until all manipulations are complete. Each call to DisableAlign must be followed by a corresponding call to EnableAlign.

DisableAlign increments a reference count that EnableAlign later decrements. When the reference count reaches zero, EnableAlign performs any needed realignment.

Be sure to pair each call to DisableAlign with a call to EnableAlign. If an exception could be raised after the call to DisableAlign, use a try .. finally statement to ensure that the corresponding call to EnableAlign is executed.


TWinControl.DoAddDockClient

TWinControl	See also

Performs actions when a control is docked to the windowed control.

procedure DoAddDockClient(Client: TControl; const ARect: TRect); dynamic;

Description

DoAddDockClient is called automatically when a client control is docked to the windowed control.  As implemented in TWinControl, DoAddDockClient sets the client’s Parent property to the control.

Client is the control that has been docked.

ARect describes the boundaries of the region where Client has been docked.

Override DoAddDockClient to perform actions when a control is docked to the windowed control.


TWinControl.DockDrop

TWinControl	See also

Generates an OnDockDrop event.

procedure DockDrop(Source: TDragDockObject; X, Y: Integer); dynamic;

Description

DockDrop is called automatically when a control is docked to the windowed control. Override DockDrop to perform actions in addition to the generated OnDockDrop event.

DockDrop is called only if DockSite is True.


TWinControl.DockOver

TWinControl	See also

Responds when a docking client is dragged over the windowed control.

procedure DockOver(Source: TDragDockObject; X, Y: Integer; State: TDragState; var Accept: Boolean); dynamic;

Description

DockOver is called automatically for dock sites when a dockable object is dragged over them. As implemented in TWinControl, DockOver positions the docking rectangle and then calls DoDockOver to generate an OnDockOver event.

Override DockOver to perform additional actions when another control is dragged over the control.

DockOver is called only if DockSite is True.


TWinControl.DoDockOver

TWinControl	See also

Generates an OnDockOver event.

procedure DoDockOver(Source: TDragDockObject; X, Y: Integer; State: TDragState; var Accept: Boolean); dynamic;

Description

DoDockOver is called by the DockOver method to generate an OnDockOver event when the user drags a dockable control over the windowed control. Override this method to perform some other action or to suppress the event.


TWinControl.DoEnter

TWinControl	See also

Generates an OnEnter event.

procedure DoEnter; dynamic;

Description

DoEnter method calls any event handler attached to the OnEnter event. Override DoEnter to provide other responses in addition to the inherited event-handler call or to suppress the OnEnter event.


TWinControl.DoExit

TWinControl	See also

Generates an OnExit event.

procedure DoExit; dynamic;

Description

DoExit calls any event handler attached to the OnExit event. Override DoExit to provide other responses in addition to the inherited event-handler call or to suppress the OnExit event.


TWinControl.DoFlipChildren

TWinControl	See also

Flips the control’s children.

procedure DoFlipChildren; dynamic;

Description

The FlipChildren method calls DoFlipChildren to reverse the positions of child controls. DoFlipChildren moves the control’s children to opposite positions on the control; that is, children on the left side of the control are moved to the right side of the control and vice versa.

Override FlipChildren to control how the control’s children are flipped.

Note:	DoFlipChildren is a protected helper method for the public FlipChildren method. Unlike FlipChildren, DoFlipChildren does not adjust the alignment of controls that are aligned to one of the edges of the windowed control.


TWinControl.DoKeyDown

TWinControl	See also

Performs some preprocessing before generating an OnKeyDown event.

function DoKeyDown(var Message: TWMKey): Boolean;

Description

The return value from DoKeyDown determines if the control should continue processing key-down messages passed in the Message parameter. A return value of True indicates that the key-down occurrence has been handled completely, and no further processing is needed. A return value of False indicates that the application should continue passing the key-down message through the inherited processing.

DoKeyDown checks whether the KeyPreview property of the parent form is True; if so, it allows the form to preemptively process key-down messages before they are handled by the windowed control. If the form does not handle the message, DoKeyDown translates the message parameters into the appropriate types and calls KeyDown, which in turn calls the OnKeyDown event handler, if any.


TWinControl.DoKeyPress

TWinControl	See also

Performs some preprocessing before generating an OnKeyPress event.

function DoKeyPress(var Message: TWMKey): Boolean;

Description

The return value from DoKeyPress determines whether the control should continue processing the key-press message passed in the Message parameter. A return value of True indicates that the key-press occurrence has been handled completely, and no further processing is needed. A return value of False indicates that the application should continue passing the key-press message through the inherited processing.

DoKeyPress checks whether the KeyPreview property of the parent form is True, and if so, allows the form to preemptively process key-press messages before they are handled by the windowed control. If the form does not handle the message, DoKeyPress translates the message parameters into the appropriate types and calls KeyPress, which in turn calls the OnKeyPress event handler, if any.


TWinControl.DoKeyUp

TWinControl	See also

Performs some preprocessing before generating an OnKeyUp event.

function DoKeyUp(var Message: TWMKey): Boolean;

Description

The return value from DoKeyUp determines whether the control should continue processing the key-up message passed in the Message parameter. A return value of True indicates that the key-up occurrence has been handled completely, and no further processing is needed. A return value of False indicates that the application should continue passing the key-up message through the inherited processing.

DoKeyUp checks whether the KeyPreview property of the parent form is True, and if so, allows the form to preemptively process key-up messages before they are handled by the windowed control. If the form does not handle the message, DoKeyUp translates the message parameters into the appropriate types and calls KeyUp, which in turn calls the OnKeyUp event handler, if any.


TWinControl.DoMouseWheel

TWinControl	See also

Processes mouse wheel messages.

procedure DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; dynamic;

Description

DoMouseWheel is called automatically when the user rotates the mouse wheel. It governs the processing of mouse wheel messages.

DoMouseWheel first generates an OnMouseWheel event. If the event handler handles the message, DoMouseWheel returns True. Otherwise, DoMouseWheel generates an OnMouseWheelUp or OnMouseWheelDown event, depending on the direction the user turned the mouse wheel.

The Shift parameter indicates the current state of the Shift, Alt, and Ctrl keys.

The WheelDelta parameter indicates the number of rotations indicated by the mouse wheel message. WheelDelta is positive if the mouse was rotated upward, negative if the mouse was rotated downward.

The MousePos parameter indicates the current position of the mouse pointer.

DoMouseWheel returns True if one of the event handlers signals that it has handled the mouse message. DoMouseWheel returns False if the message was not handled.

Override DoMouseWheel to change the way the windowed control processes mouse wheel messages.


TWinControl.DoMouseWheelDown

TWinControl	See also

Generates an OnMouseWheelDown event.

procedure DoMouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean; dynamic;

Description

The DoMouseWheel method calls DoMouseWheelDown to generate an OnMouseWheelDown event.

The Shift parameter indicates the state of the Shift, Alt, and Ctrl keys.

The MousePos parameter indicates the position of the mouse pointer.

DoMouseWheelDown returns True if an event handler indicates that it handled the message, and False otherwise.

Override DoMouseWheelDown to perform class-specific tasks in addition to calling the event handler when the mouse wheel is rotated downward.


TWinControl.DoMouseWheelUp

TWinControl	See also

Generates an OnMouseWheelUp event.

procedure DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean; dynamic;

Description

The DoMouseWheel method calls DoMouseWheelUp to generate an OnMouseWheelUp event.

The Shift parameter indicates the state of the Shift, Alt, and Ctrl keys.

The MousePos parameter indicates the position of the mouse pointer.

DoMouseWheelUp returns True if an event handler indicates that it handled the message, and False otherwise.

Override DoMouseWheelUp to perform class-specific tasks in addition to calling the event handler when the mouse wheel is rotated upward.


TWinControl.DoRemoveDockClient

TWinControl	See also

Responds when a control is undocked from the windowed control.

procedure DoRemoveDockClient(Client: TControl); dynamic;

Description

DoRemoveDockClient is called automatically when a client control is undocked from the windowed control.  As implemented in TWinControl, DoRemoveDockClient does nothing.

Client is the control that has been undocked.

Override DoRemoveDockClient to perform any necessary adjustments when a control is undocked from the windowed control.


TWinControl.DoUnDock

TWinControl	See also

Undocks a control that is currently docked to the windowed control.

function DoUnDock(NewTarget: TWinControl; Client: TControl): Boolean; dynamic;

Description

DoUnDock is called automatically when a control is undocked from the windowed control. It handles all necessary changes to the windowed control to accomplish the undocking. These are

1.	Generates an OnUndock event.

2.	If there is no OnUndock event handler, or if the event handler indicates that the client can be undocked, it removes the client from the DockClients property list.

The NewTarget parameter indicates the new host to which the undocked control is moving.

The Client parameter indicates the control to be undocked from the windowed control.

DoUnDock returns True if the client is successfully undocked, False if the undocking attempt was blocked by an OnUndock event handler.

Override DoUnDock to change the way controls are undocked from the windowed control.


TWinControl.EnableAlign

TWinControl	See also

Decrements the reference count incremented by the DisableAlign method, eventually realigning the child controls of the windowed control.

procedure EnableAlign;

Description

Call EnableAlign to allow child controls within the control to realign again after they were prevented from realigning by a call to DisableAlign.

Each time the DisableAlign method is called, it increments a reference count. Each time EnableAlign is called, it decrements the same reference count. When the reference count reaches zero, EnableAlign calls the Realign method to perform any pending realignments.

Be sure to pair each call to DisableAlign with a call to EnableAlign. If an exception could be raised after the call to DisableAlign, use a try .. finally statement to ensure that the corresponding call to EnableAlign is executed.


TWinControl.FindChildControl

TWinControl	See also

Returns a child control given its name.

function FindChildControl(const ControlName: string): TControl;

Description

Call FindChildControl to locate a specified child of the windowed control. FindChildControl searches the control’s children and returns the control with the specified name. If no child controls match the specified name, FindChildControl returns nil.

Note:	FindChildControl only locates immediate children of the windowed control. It can’t return a child control that is a child of one of the windowed control’s children.


TWinControl.FindNextControl

TWinControl	See also

Returns the windowed control's next child control in the tab order after the specified control.

function FindNextControl(CurControl: TWinControl; GoForward, CheckTabStop, CheckParent: Boolean): TWinControl;

Description

Call FindNextControl to find the next child control in the tab order after CurControl. If CurControl is not a child of the windowed control, FindNextControl returns the first child control in the tab order.

The GoForward parameter controls the direction of the search. If GoForward is True, FindNextControl searches forward through the child controls in tab order. If Go Forward is False, FindNextControl searches backward through the controls.

The CheckTabStop and CheckParent parameters control whether FindNextControl performs certain checks on the controls it finds. If CheckTabStop is True, the returned control must have its TabStop property set to True. If CheckParent is True, the returned control's Parent property must indicate the windowed control.

FindNextControl calls the GetTabOrderList method to build its list of possible "next" controls.


TWinControl.FixupTabList

TWinControl	See also

Sorts the child controls of this control by their tab order.

procedure FixupTabList;

Description

Applications should not call FixupTabList directly. The ReadState method calls FixupTabList to initialize the tab order list based on the TabOrder properties of the child controls being read from a stream.


TWinControl.FlipChildren

TWinControl	See also

Reverses the positions of the windowed control’s children.

procedure FlipChildren(AllLevels: Boolean); dynamic;

Description

Call FlipChildren to flip the control’s children; that is, to move children on the left side of the control to the right side and vice versa. FlipChildren reverses the position of all child controls and adjusts their Align properties, if necessary, to enforce the new position.

AllLevels specifies whether FlipChildren should be called recursively on the control’s children.

FlipChildren can be used to reverse the layout of an application when it is running in Middle Eastern locales where users read from right to left instead of left to right: Call UseRightToLeftAlignment to determine whether the BiDiMode property dictates a reversal of alignment based on the system locale.

Note:	FlipChildren does the same thing as the Flip Children command on the control’s context menu in the IDE.


TWinControl.Focused

TWinControl	See also 	Example

Determines whether the windowed control has input focus.

function Focused: Boolean; dynamic;

Description

Use the Focused method to see if the control is the active control. When Focused is True, the control has the input focus. If Focused is False, the user cannot interact with the control.


TWinControl.GetActionLinkClass

TWinControl	See also

Returns the appropriate action link class that is associated with windowed controls.

function GetActionLinkClass: TControlActionLinkClass; reintroduce; dynamic;

Description

GetActionLinkClass returns the appropriate class type for the action link used with a control. This class is used internally to create an action link object for the windowed control when it has an associated action. The action link links the action to the windowed control client. Each Action link class is designed to link specific properties and event handlers of the action to its client, based on the types of properties the client supports.

As implemented in TWinControl, GetActionLinkClass returns the TWinControlActionLink class type, which associates the HelpContext, ShowHint, Caption, Enabled and Visible properties and the OnClick event handler. Descendants of TWinControl override this method to specify a descendant of TControlActionLink that handles their configuration of properties and events.


TWinControl.GetChildren

TWinControl	See also

Calls a specified method for each child of the windowed control.

procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;

Description

GetChildren is called by the VCL streaming system that loads and saves components. Applications seldom need to call this routine.

GetChildren executes the callback specified by the Proc parameter for every child control listed by the Controls property that lists the Root parameter as its Owner.

Override GetChildren to limit or augment which child controls are saved with the windowed control. When overriding GetChildren, call the procedure passed as the Proc parameter for every child control that should be saved. The Root parameter indicates the component (usually a form) that owns the windowed control.


TWinControl.GetClientOrigin

TWinControl	See also

Returns the value of the ClientOrigin property.

function GetClientOrigin: TPoint; override;

Description

GetClientOrigin is the protected implementation of the ClientOrigin property.

GetClientOrigin returns a point indicating the position of the top-left corner of the control in screen coordinates. GetClientOrigin calls the Windows API function ClientToScreen to return the position of top-left corner of the windowed control on the screen in screen coordinates.


TWinControl.GetClientRect

TWinControl	See also

Returns the value of the ClientRect property.

function GetClientRect: TRect; override;

Description

GetClientRect is the protected implementation of the ClientRect property. GetClientRect returns a rectangle with the rectangle’s Top and Left fields set to zero, and its Bottom and Right fields set to the control's ClientHeight and ClientWidth, respectively. GetClientRect calls the Windows API function GetClientRect.


TWinControl.GetControlExtents

TWinControl	See also

Returns the smallest rectangle in which all the control’s children fit.

function GetControlExtents: TRect; virtual;

Description

Call GetControlExtents to determine the smallest rectangle in which all the control’s children fit. Windowed controls call GetControlExtents when implementing the AutoSize property.


TWinControl.GetDeviceContext

TWinControl	See also	Example

Provides access to a device context for the control.

function GetDeviceContext(var WindowHandle: HWnd): HDC; override;

Description

Call GetDeviceContext to obtain a handle to a device context for the control.

GetDeviceContext calls the Windows API function GetDC, passing the windowed control's Handle property. It returns the window’s handle in the WindowHandle parameter and the HDC as the return value. If the call is unsuccessful, the EOutOfResources exception is raised.


TWinControl.GetParentHandle

TWinControl	See also

Returns the window handle for the window of the control’s parent.

function GetParentHandle: HWnd;

Description

Use the handle returned by GetParentHandle as a parameter to Windows API function calls that need the window handle for the parent window of the control. If the Parent property is not nil, GetParentHandle returns the Handle property of the parent control. If the Parent property is nil, GetParentHandle returns the value of ParentWindow.


TWinControl.GetSiteInfo

TWinControl	See also

Generates an OnGetSiteInfo event

procedure GetSiteInfo(Client: TControl; var InfluenceRect: TRect; MousePos: TPoint; var CanDock: Boolean); dynamic;

Description

GetSiteInfo is called automatically during drag-and-dock operations to initialize a TDragDockObject with information about where a dragged object can be docked, if at all.

Client is a potential docking client.

InfluenceRect returns the area in which the client would be docked.

MousePos is the current mouse position.

CanDock returns whether the client can dock to the windowed control.

As implemented in TWinControl, GetSiteInfo generates an influence rectangle equal to BoundsRect expanded by 10 pixels on every side, and then calls the OnGetSiteInfo event handler.


TWinControl.GetTabOrderList

TWinControl	See also

Builds a list of controls in tab order.

procedure GetTabOrderList(List: TList);

Description

Call GetTabOrderList to construct a list of child controls in tab order.

GetTabOrderList iterates through the windowed control's internal tab-order list, adding each of the controls to List, including any controls contained in those controls. The result is a list of all the controls and their owned controls, in tab order.

The FindNextControl method calls GetTabOrderList to build a complete list of the controls that FindNextControl uses to locate the next control in the tab order.


TWinControl.GetTopParentHandle

TWinControl	See also

Returns the window handle of the first window not associated with a VCL control that contains the windowed control.

function GetTopParentHandle: HWnd;

Description

Use GetTopParentHandle to access the handle of the window that is hosting the windowed control. GetTopParentHandle walks up the containers of the windowed control until it finds a control whose Parent property is nil. If that topmost parent is contained in a non-VCL window (its ParentWindow is nonzero), GetTopParentHandle returns the non-VCL window. If the windowed control is not contained in a non-VCL window, GetTopParentHandle returns the windowed control’s own window handle.


TWinControl.HandleAllocated

TWinControl	See also

Reports whether a window handle exists for the control.

function HandleAllocated: Boolean;

Description

Query HandleAllocated to find out if the control’s window has been generated.

If a window exists, HandleAllocated returns True. If no window exists, HandleAllocated returns False. Testing the Handle property of a control directly causes the window to be created if it does not already exist. Call the HandleAllocated method to determine whether a window exists without creating one as a side effect.


TWinControl.HandleNeeded

TWinControl	See also

Creates a window for the control if it doesn't already exist.

procedure HandleNeeded;

Description

Call HandleNeeded to create a window for the control.

If no window exists, HandleNeeded calls the CreateHandle method for the parent of the control before it creates a window for this control.


TWinControl.InsertControl

TWinControl	See also 	Example

Inserts a control into the Controls array property of the windowed control.

procedure InsertControl(AControl: TControl);

Description

Applications should not need to call InsertControl directly. Child controls are automatically inserted and removed when added or deleted at design time. At runtime, use the Parent property of the child control to insert it in the Controls array. If the child control is already the child of another windowed control, setting the Parent property ensures that the child is removed from the Controls of the original parent.

InsertControl makes the inserted control a child, and the containing control the parent. The AControl parameter is the child control that is inserted into the Controls array.


TWinControl.Invalidate

TWinControl	See also

Tells Windows to repaint the control after other important Windows messages are handled.

procedure Invalidate; override;

Description

Use Invalidate when the entire control needs to be repainted. When more than one region within the control needs repainting, Invalidate will cause the entire window to be repainted in a single pass, avoiding flicker caused by redundant repaints. There is no performance penalty for calling Invalidate multiple times before the control is actually repainted.


TWinControl.IsControlMouseMsg

TWinControl	See also

Indicates whether a specified mouse message is directed to one of the windowed control’s child controls.

function IsControlMouseMsg(var Message: TWMMouse): Boolean;

Description

Call IsControlMouseMsg to find out if a mouse message is directed to one of the control’s child controls. Specify the mouse message as the value of the Message parameter.

Windows takes care of sending messages to windowed child controls, but for nonwindowed child controls, Windows sends the messages to the parent control, which must then determine which, if any, of its child controls should receive the message.

The WndProc method of a windowed control calls IsControlMouseMsg to process all mouse message sent to the windowed control.


TWinControl.KeyDown

TWinControl	See also

Generates an OnKeyDown event.

procedure KeyDown(var Key: Word; Shift: TShiftState); dynamic;

Description

When a windowed control receives a key-down message (WM_KEYDOWN) from Windows, its message handler calls the DoKeyDown method. If DoKeyDown determines that the control should, in fact, process the character, it calls KeyDown, passing the key code and shift-key state in the Key and Shift parameters, respectively.

KeyDown calls any event handler attached to the OnKeyDown event. Override KeyDown to provide other responses in addition to the event-handler call.

The Key parameter is the key on the keyboard. For non-alphanumeric keys, you must use WinAPI virtual key codes to determine the key pressed. For more information, search for virtual key codes in the Win32 Developer's Reference (WIN32.HLP).

The Shift parameter indicates whether the Shift, Alt, or Ctrl keys are combined with the keystroke.

Either KeyDown or the OnKeyDown event handler it calls can suppress further processing of a key by setting the Key parameter to zero.


TWinControl.KeyPress

TWinControl	See also

Generates an OnKeyPress event.

procedure KeyPress(var Key: Char); dynamic;

Description

When a windowed control receives a key-press message (WM_CHAR) from Windows, its message handler calls the DoKeyPress method. If DoKeyPress determines that the control should, in fact, process the character, it calls KeyPress, passing the key code in the Key parameter.

KeyPress calls any event handler attached to the OnKeyPress event. Override KeyPress to provide other responses in addition to the event-handler call.

Either KeyPress or the OnKeyPress event handler it calls can suppress further processing of a character by setting the Key parameter to zero.

Note:	The Key parameter is the character represented by the key that is pressed, not a Windows virtual key code.


TWinControl.KeyUp

TWinControl	See also

Generates an OnKeyUp event.

procedure KeyUp(var Key: Word; Shift: TShiftState); dynamic;

Description

When a windowed control receives a key-up message (WM_KEYUP) from Windows, its message handler calls the DoKeyUp method. If DoKeyUp determines that the control should, in fact, process the character, it calls KeyUp, passing the key code and shift-key state to KeyUp in the Key and Shift parameters, respectively.

KeyUp calls any event handler attached to the OnKeyUp event. Override KeyUp to provide other responses in addition to the event-handler call.

Either KeyUp or the OnKeyUp event handler it calls can suppress further processing of a key by setting the Key parameter to zero.

The Key parameter is the key on the keyboard. For non-alphanumeric keys, use WinAPI virtual key codes to determine the key pressed. For more information, search virtual key codes in the Win32 Developer's Reference (WIN32.HLP).

The Shift parameter indicates whether the Shift, Alt, or Ctrl keys are combined with the keystroke.


TWinControl.MainWndProc

TWinControl	See also

Receives Windows messages for the control.

procedure MainWndProc(var Message: TMessage);

Description

MainWndProc is the window procedure for the control that is associated with the control’s window when it is created. When Windows sends a message to the control’s window, MainWndProc receives it.

MainWndProc does not process or dispatch the messages itself, but rather calls the method specified by WindowProc to do that. MainWndProc provides an exception-handling block around WindowProc, ensuring that if any unhandled exceptions occur during the processing of a message, the application’s HandleException method will handle them.


TWinControl.MouseWheelHandler

TWinControl	See also

Dispatches messages received from a mouse wheel.

procedure MouseWheelHandler(var Message: TMessage); dynamic;

Description

The WndProc method calls MouseWheelHandler when it receives a mouse wheel message. MouseWheelHandler checks whether the windowed control is embedded in a form, and if so, calls the form’s MouseWheelHandler method. This allows the form to respond to mouse wheel messages before they are handled by individual controls. If the windowed control is not in a form, MouseWheelHandler passes the mouse wheel message to the Perform method, which generates an OnMouseWheel event, followed (if necessary) by an OnMouseWheelUp or OnMouseWheelDown event.


TWinControl.NotifyControls

TWinControl	See also

Sends a message to all the child windows of the windowed control.

procedure NotifyControls(Msg: Word);

Description

NotifyControls sends a message with the message ID passed in the Msg parameter to all the controls in the windowed control's Controls array property. Delphi uses NotifyControls to update all the controls in a form of such occurrences as changes in the parent color or font.

NotifyControls constructs a generic message record, filling its message ID field with the value of Msg and setting its parameter and result fields to zeros, then calls the Broadcast method to send the message to all the child controls.


TWinControl.PaintControls

TWinControl	See also

Paints each of the child controls in a windowed control using the specified device context.

procedure PaintControls(DC: HDC; First: TControl);

Description

Call PaintControls to paint all the child controls of this control. Pass the device context as the value of the DC parameter. The First parameter indicates the starting point in the windowed control's child-control list to paint. If First is nil or does not indicate one of the child controls, PaintControls paints all the child controls.

The Repaint method calls PaintControls for the control's parent, passing the control in First to repaint the control and any controls it might intersect. PaintHandler also calls PaintControls after calling PaintWindow.


TWinControl.PaintHandler

TWinControl	See also

Responds to WM_PAINT messages.

procedure PaintHandler(var Message: TWMPaint);

Description

PaintHandler is called automatically when the control receives a WM_PAINT message. It calls the BeginPaint and EndPaint API functions, and between them paints the control's background by calling PaintWindow and any child controls by calling PaintControls.


TWinControl.PaintTo

TWinControl	See also 	Example

Draws the windowed control to a device context.

procedure PaintTo(DC: HDC; X, Y: Integer);

Description

Call PaintTo to draw the control on a device context. Specify the device context as the value of the DC parameter and specify the X and Y coordinates on the device context where the top-left corner of the windowed control is to be drawn. PaintTo first erases the background of the device context and then paints the control.

PaintTo is useful for drawing an image of the control into a bitmap DC.


TWinControl.PaintWindow

TWinControl	See also

Renders the image of a windowed control.

procedure PaintWindow(DC: HDC); virtual;

Description

Call PaintWindow to repaint the control. PaintWindow sends a WM_PAINT message to the windowed control's DefaultHandler method, setting the message record's WParam field to the value passed in DC and the other parameter and result fields to zeros.


TWinControl.PaletteChanged

TWinControl	See also

Responds to changes in the system's palette by realizing the control's palette and the palette for each child control.

function PaletteChanged(Foreground: Boolean): Boolean; dynamic;

Description

PaletteChanged is called automatically when the Windows system palette changes. TWinControl responds to these notifications by trying to realize the windowed control’s palette, if any, into the current device context, and then passing on the PaletteChanged notification to each of the child controls in turn. If the change in the system palette causes the actual value of the control’s palette to change, PaletteChanged will invalidate the control so that it can repaint with the new palette.

Windows paints the active window with a foreground palette, while other windows are forced to use background palettes. Background palettes are approximate matches to the colors specified by the control’s logical palette, given the limitations imposed by implementing the foreground palette. Windows only allows a single foreground palette.

PaletteChanged allows the control to obtain a new realization of its palette when the system palette changes. When ForeGround is True, the form has been activated and the control is specifying the new foreground palette. When ForeGround is False, another application or form has changed the foreground palette, and controls that are sensitive to the available palette should realize new background palettes to best match their logical palettes.

If the control does not have a logical palette to be realized into the current device context, GetPalette will return a handle of 0, and PaletteChanged will not try to realize a palette for the windowed control. Instead, it simply passes the notification on to the child controls. If the windowed control or any of its child controls realize a palette into the current device context in response to PaletteChanged, this method returns True.

Override PaletteChanged to change the way in which controls are given an opportunity to realize a new palette when the Windows system palette changes. For example, override PaletteChanged to change the order in which child controls realize their palettes, giving a particular control the foreground palette when the form is activated, or to pass palette change notification to custom controls implemented outside of the VCL such as in DLLs.

Override GetPalette instead to affect whether the windowed control actually has a palette to realize, or to change the value of the control’s logical palette.

Note:	PaletteChanged is called only when the run-time video mode requires palette support, such as for 256 color mode, but not 16 million color mode.


TWinControl.ReadState

TWinControl	See also

Prepares the control for having its properties assigned values from a stream.

procedure ReadState(Reader: TReader); override;

Description

Override ReadState to change the preparations the control makes as it readies itself to have its property values assigned from a stream. For example, the windowed control might destroy temporary internal data structures or objects before new instances are loaded from the stream. Be sure to include a call to the inherited method when overriding ReadState.

ReadState disables control alignment until all the child controls have been read from the stream, calls the inherited ReadState method, and re-enables the alignment of all the controls. The method then builds the tab order list of controls and synchronizes its Ctl3D property and its visibility with that of its parent control.


TWinControl.Realign

TWinControl	See also

Forces the windowed control to realign the controls within it.

procedure Realign;

Description

The EnableAlign method calls Realign when its reference count reaches zero. It adjusts the size and position of any child controls according to their Align properties.

If all of the child controls of this control have their Align properties set to alNone, Realign has no effect.


TWinControl.RecreateWnd

TWinControl	See also

Destroys the window associated with a windowed control so that another can be generated to reflect the control’s current state.

procedure RecreateWnd;

Description

Call RecreateWnd to recreate the control. RecreateWnd destroys the window used by the control, setting the window handle to NULL. The next time the window handle is needed, such as when the control needs to be painted, a new window is created that reflect the properties of the control.

Windows does not reflect certain kinds of changes to a control without destroying the window and recreating it. For example, to reflect a change in the border style of an edit box, the window for the control must be recreated.


TWinControl.ReloadDockedControl

TWinControl	See also

Reloads a docked control.

procedure ReloadDockedControl(const AControlName: string; var AControl: TControl); dynamic;

Description

Use ReloadDockedControl to obtain a reference to control given its name. The AControlName parameter is the name of the child control. The corresponding control is returned as the AControl parameter. ReloadDockedControl can only locate a control if it has the same Owner as the windowed control.

The dock manager calls ReloadDockedControl to obtain a control reference that it then docks to the windowed control.


TWinControl.RemoveControl

TWinControl	See also 	Example

Removes a specified control from the Controls array.

procedure RemoveControl(AControl: TControl);

Description

RemoveControl removes a child control from the Controls property. After calling RemoveControl, the windowed control is no longer the parent of the child specified by the AControl parameter.

Applications should not call RemoveControl directly. Child controls are automatically inserted and removed when added or deleted at design time. At runtime, use the Parent property of the child control to remove it from the Controls array.


TWinControl.Repaint

TWinControl	See also

Repaints the windowed control’s image on the screen.

procedure Repaint; override;

Description

Call Repaint to repaint the control.

Repaint calls the Invalidate method and then the Update method to repaint the control.


TWinControl.ResetIme

TWinControl	See also

Restores the input method editor (IME) that was active when the application started.

procedure ResetIme;

Description

For controls that specify the ImeName property, call ResetIme to revert to the IME that was active when the application started. If the IME was deactivated by setting the IMEMode property to imDisable, ResetIme restarts the default IME.

Applications cannot call ResetIme. ResetIme is called automatically when the control loses input focus. It is exposed as a protected method so descendant objects can restore the default IME at other times.


TWinControl.ResetImeComposition

TWinControl	See also

Directs the composition window of the input method editor (IME) to perform a specific action.

function ResetImeComposition(Action: DWORD): Boolean;

Description

Call ResetImeComposition to direct what the composition window does with the input typed by the user. The composition window is the window displayed by the IME that provides feedback to the user about what keystrokes have been typed, and how they are converted into asian characters.

The Action parameter indicates what the composition window should do with its current contents. Action can have one of the following values:

Value	Meaning

CPS_CANCEL	Clear the composition string and set the status to no composition string.

CPS_COMPLETE	Set the composition string as the result string.

CPS_CONVERT	Convert the composition string.

CPS_REVERT	Cancel the current composition string and revert to the unconverted string.

ResetImeComposition returns True if the composition window performs the requested action.


TWinControl.ScaleBy

TWinControl	See also

Rescales a windowed control and any of its children to a percentage of their former size.

procedure ScaleBy(M, D: Integer);

Description

Call ScaleBy to rescale the control and all its children. ScaleBy modifies the Height and Width properties of the controls, but it does not change the Top and Left properties; therefore, the size of the controls changes, but not the coordinates of the top-left corners of the controls.

The M and D parameters determine the percentage by which the control and its children are scaled. The M parameter is the multiplier and the D parameter is the divisor. For example, to change a control to be 75% of its original size, specify the value of M as 75, and the value of D as 100 (75/100). Alternately, obtain the same results by specifying the value of M as 3, and the value of D as 4 (3/4). Both fractions are equal and result in the control being scaled by the same amount, 75%.

To make the control 33% larger than its previous size, specify the value of M as 133, and the value of D as 100 (133/100). Alternately, specify the value of M as 4, and the value of D as 3 (4/3), as the fraction 133/100 is approximately equal to 4/3.

Note:	Because control sizes and coordinates are integers, scaling them by the M/D ratio incurs some degree of roundoff error. Calling ScaleBy repeatedly may mean that at some point the control disappears (when the roundoff errors make the control smaller). When rescaling controls repeatedly, consider destroying and reloading the form after several rescalings so that the coordinates are rescaled without most of the accumulating roundoff error.


TWinControl.ScaleControls

TWinControl	See also

Rescales the child controls of a windowed control without rescaling the control itself.

procedure ScaleControls(M, D: Integer);

Description

Call ScaleControls to rescale only the children of the control, while leaving the control itself the same size.

ScaleControls calls the ChangeScale method of each child control, specifying the percentage to scale by through the M and D parameters. M is the multiplier and D is the divisor. For example, to change the child controls to be 75% of their original size, specify the value of M as 75, and the value of D as 100 (75/100). Alternately, specify the value of M as 3, and the value D as 4 (3/4). Both fractions are equal and result in the controls being scaled by the same amount, 75%.

Note:	Because control sizes and coordinates are integers, scaling them by the M/D ratio incurs some degree of roundoff error. Calling ScaleBy repeatedly means that at some point the control may disappear (when the roundoff errors make the control smaller), or creep off the form (when the roundoff errors move the location of control). When rescaling controls repeatedly, consider destroying and reloading the form after several rescalings so that the coordinates are rescaled without most of the accumulating roundoff error.


TWinControl.ScrollBy

TWinControl	See also

Scrolls the contents of a windowed control.

procedure ScrollBy(DeltaX, DeltaY: Integer);

Description

Call ScrollBy to scroll the contents within the control. While ScrollBy can be used for any windowed control, it makes the most sense to use it for descendants of TScrollingWinControl.

Applications seldom need to call the ScrollBy method unless they implement their own scrolling interface rather than relying on a scroll bar.

The DeltaX parameter is the change in pixels along the X axis. A positive DeltaX value scrolls the contents to the right; a negative value scrolls the contents to the left. The DeltaY parameter is the change in pixels along the Y axis. A positive DeltaY value scrolls the contents down; a negative value scrolls the contents up.


TWinControl.SelectFirst

TWinControl	See also

Locates the first child selectable control in the tab order within the windowed control.

procedure SelectFirst;

Description

Call SelectFirst to find the first child that can be selected within the control’s tab order. SelectFirst calls the FindNextControl method, passing nil as the current control. Once the first selectable control is found, SelectFirst makes the control the active control on the form.


TWinControl.SelectNext

TWinControl	See also

Moves the input focus from the current child control to the next one in the tab order.

procedure SelectNext(CurControl: TWinControl; GoForward, CheckTabStop: Boolean);

Description

Call SelectNext to find the next child control in the control’s tab order. Specify the current control from which to begin the search as the value of the CurControl parameter. The GoForward parameter controls the direction of the search. If GoForward is True, FindNextControl searches forward through the child controls in tab order. If GoForward is False, FindNextControl searches backward through the controls.

The CheckTabStop parameter controls whether the control SelectNext finds must be a tab stop. If CheckTabStop is True, the returned control must have its TabStop property set to True, or the search for the next control continues.

If SelectNext doesn’t locate an appropriate control (as defined by the GoForward and the CheckTabStop parameters), the focus remains with CurControl.


TWinControl.SetBounds

TWinControl	See also

Sets the windowed control's boundary properties all at once.

procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;

Description

Use SetBounds to change all of the control’s boundary properties at once. The same effect can be achieved by setting the Left, Top, Width, and Height properties separately. By setting all four properties at once, SetBounds ensures that the control will not repaint between changes

Specify the values for the Left, Top, Width, and Height properties as the value of the ALeft, ATop, AWidth, and AHeight parameters, respectively.


TWinControl.SetChildOrder

TWinControl	See also

Changes the order in which the child component appears in the list of child components returned by the GetChildren method.

procedure SetChildOrder(Child: TComponent; Order: Integer); override;

Description

Use SetChildOrder when you want to change the order in which child objects are streamed in. Specify the child component whose order you want to change as the value of the Child parameter. Indicate the position you want the component to be in as the value of the Order parameter.

When SetChildOrder is called, items previously below the child's old position move up, and those below the new position move down.


TWinControl.SetFocus

TWinControl	See also 	Example

Gives the input focus to the control.

procedure SetFocus; virtual;

Description

Use SetFocus to change input focus to the windowed control. When a control has focus, it receives keyboard events.


TWinControl.SetIme

TWinControl	See also

Activates an input method editor (IME) using the values specified by the ImeMode and ImeName properties.

procedure SetIme;

Description

Applications cannot call SetIme. SetIme is called automatically when the control receives input focus. It is exposed as a protected method so that descendant objects can cause the ImeMode and ImeName properties to take effect at other times.


TWinControl.SetImeCompositionWindow

TWinControl	See also

Sets the position and font of the composition window.

function SetImeCompositionWindow( Font: TFont; XPos, YPos: Integer): Boolean;

Description

Call SetImeComposition to change the position or font of the composition window. The composition window is the window displayed by the input method editor (IME) that provides feedback to the user about what keystrokes have been typed, and how they are converted into asian characters.

The Font parameter describes the font that the composition window should use. Setting the Font parameter to nil repositions the composition window without changing the font. XPos and YPos specify the desired global coordinates for the composition window.

SetImeCompositionWindow returns True if the font and position are successfully assigned.


TWinControl.SetZOrder

TWinControl	See also

Moves the control within the parent’s control list to either the top or bottom of the windowed controls; or, if the control has no parent, makes the control either the top or bottom window on the screen.

procedure SetZOrder(TopMost: Boolean); override;

Description

Use SetZOrder to move rearrange overlapping controls within a parent control or overlapping windows on the screen. If the TopMost parameter is True, the control becomes the top control; otherwise, it becomes the bottom control.

Windowed controls always stack on top of non-windowed controls. Thus, if the Parent contains any non-windowed controls, calling SetZOrder with a TopMost value of False will still keep the windowed control above all the non-windowed controls.

After changing the order, SetZOrder invalidates the control to ensure repainting to reflect the new order.


TWinControl.ShowControl

TWinControl	See also

Ensures that a specified child control is visible.

procedure ShowControl(AControl: TControl); virtual;

Description

Call ShowControl to display a child control. Specify the control you want to ensure will be visible as the value of the AControl parameter.

As implemented in TWinControl, ShowControl simply calls the ShowControl method of the windowed control’s parent. Derived objects override ShowControl to perform whatever actions are necessary to allow the indicated child object to be visible. Possible actions include scrolling the particular child object into view, or changing to the appropriate notebook page.

ShowControl is used in the implementation of the Show method.


TWinControl.Update

TWinControl	See also 	Example

Processes any pending paint messages immediately.

procedure Update; override;

Description

Call Update to force the control to be repainted before any more, possibly time-consuming, processing takes place. Use Update to provide immediate feedback to the user that cannot wait for the Windows paint message to arrive. Update does not invalidate the control, but simply forces a repaint of any regions that have already been invalidated. Call Repaint instead if you need to invalidate the control as well.

Update calls the Windows API UpdateWindow function, which processes any pending paint messages. For more information, see the Win32 Developer's Reference (WIN32.HLP).


TWinControl.UpdateControlState

TWinControl	See also

Shows the windowed control, causing all parent objects to make any necessary adjustments.

procedure UpdateControlState;

Description

UpdateControlState is used internally to show controls and create handles for controls at the time they are displayed. UpdateControlState calls the Show method to show the windowed control. To ensure that the windowed control will be visible, it creates the window handle for the object or any parent objects that do not yet have one, and calls the ShowControl method of all parent controls to ensure that the control is in view.

UpdateControlState shows the control only if its parent is showing and the control’s Visible property is True.


TWinControl.WndProc

TWinControl 	See also	Example

Provides specific message responses for the control.

procedure WndProc(var Message: TMessage); override;

Description

Override WndProc to change the initial Windows message handler for the control. The WindowProc property is initialized to point to the WndProc method.

WndProc for TWinControl overrides the inherited method to define responses for focus, mouse, and keyboard messages. It sends all others to its inherited WndProc.

When overriding WndProc to provide specialized responses to messages, call the inherited WndProc at the end to dispatch any unhandled messages.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl


TWordField

Hierarchy	Properties	Methods	Events	See also

TWordField represents an unsigned 16-bit integer field in a dataset.

Unit

db

Description

TWordField is a persistent field object that encapsulates the fundamental behavior common to integer data. TWordField differs from its immediate ancestor TIntegerField only in the data type it represents. Except for the constructor and the DataSize property, all of the properties, methods, and events are the same as those of TIntegerField, and provide functionality that is useful for managing the value and properties of an integral numeric field in a database.

As with all persistent field objects, a TWordField can be created at design-time using the Fields Editor or at runtime by calling the constructor for the class. Persistent field objects exist solely in the memory space of a Delphi application. Creating a persistent field object only creates an object in the application, and does not result in the creation of a field in a table.

Fields in a table can be accessed without use of persistent field objects. Virtual field objects are created to provide access to a field when the field is referenced through such means as the TDataSet.Fields property or the TDataSet.FieldByName method. However, as both the Fields property and the FieldByName method return a value of type TField, the return value must be typecast as a TIntegerField or TWordField before using any property specific to TIntegerField or TWordField.

Word fields can hold values in the range 0 to 65535, and are used to hold values that are unsigned 16-bit whole numbers.


TWordField properties

TWordField	Alphabetically	Legend

In TWordField

DataSize

Derived from TIntegerField

AsFloat

AsInteger

AsString

AsVariant

MaxValue

MinValue

Value

Derived from TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TWordField properties

TWordField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

MaxValue

MinValue

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ReadOnly

Required

Size

Tag

Text

ValidChars

Value

VCLComObject

Visible


TWordField.DataSize

TWordField	See also	Example

Indicates the amount of memory needed to store the value of a word field in its native database format.

property DataSize: Word;

Description

Check DataSize to determine the number of bytes required to store a word field component’s value. Use DataSize to determine the size needed for a buffer when working with the GetData and SetData methods.

For word fields, DataSize is always 2. This is the size of unsigned word values in the database tables, not the size of the LongInt data type used to store and manipulate values by TWordField.


TWordField events

TWordField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TWordField events

TWordField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TWordField methods

TWordField	Alphabetically

In TWordField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TPersistent

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWordField methods

TWordField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TWordField.Create

TWordField	See also

Creates an instance of TWordField.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TWordField. After calling the inherited constructor, Create sets the DataType property to ftWord, MinValue to 0, and MaxValue to 65535.

After instantiating a TWordField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TWordField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TWordField with a dataset component by setting its DataSet property to the name of the dataset component.

The example below creates a TWordField object for a field named Counter accessed through a TQuery named Query1.

var

  T: TWordField;

begin

  Query1.Close;

  T := TWordField.Create(Self);

  T.FieldName := 'Counter';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TNumericField

TIntegerField


TWorkArea

Hierarchy	Properties	Methods	See also

TWorkArea represents a rectangular subregion of a list view’s client area.

Unit

comctrls

Description

Use TWorkArea to describe the dimensions and display characteristics of one work area of a list view component. Work Areas divide the client area of a list view into logical subregions. The icons of the list view are then arranged within each work area, to provide an additional layer of organization.

Each list item in the list view belongs to a single work area. This association is based on whether the position of the list item falls within the bounding rectangle specified by the work area’s Rect property.

In addition, If the list view’s ShowWorkAreas property is True, the list view draws the work area, using its Color and DisplayName properties.

Note:	Work areas are only used when the list view has a ViewStyle of vsIcon or vsSmallIcon.


TWorkArea properties

TWorkArea	Alphabetically	Legend

In TWorkArea

Color

Rect

Derived from TCollectionItem

Collection

DisplayName

ID

Index


TWorkArea properties

TWorkArea	By object	Legend

Collection

Color

DisplayName

ID

Index

Rect


TWorkArea.Color

TWorkArea	See also

Specifies the background color of the work area.

property Color: TColor;

Description

Use Color to specify the color in which the list view paints the portion of its client area circumscribed by the Rect property. Color is not used unless the list view’s ShowWorkAreas property is True.


TWorkArea.Rect

TWorkArea	See also

Indicates the portion of the list view’s client area covered by the work area.

property Rect: TRect;

Description

Set Rect to specify the sphere of influence of a work area. Rect is the bounding rectangle of a portion of the list view’s client area. If Rect specifies a region larger than the list view’s client area, the list view introduces scroll bars to support the logical size specified by Rect.

List items are assigned to the work area when they fall into the region of the list view bounded by Rect. If a list item falls into a region that is contained by more than one work area, it is assigned to the list item with the lowest Index property.

If the list view paints itself to display work areas, it paints the portion of its client area that is outlined by Rect using the color specified by the Color property.


TWorkArea methods

TWorkArea	Alphabetically

In TWorkArea

Create

GetDisplayName

GetDisplayName

Derived from TCollectionItem

Destroy

GetNamePath

Derived from TPersistent

Assign

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TWorkArea methods

TWorkArea	By object

AfterConstruction

Assign

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

Destroy

Dispatch

FieldAddress

Free

FreeInstance

GetDisplayName

GetDisplayName

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


;TWorkArea.Create
TWorkArea.Create

TWorkArea	See also

Creates an instance of TWorkArea.

constructor Create(Collection: TCollection); override;

Description

It is seldom necessary to call the constructor for TWorkArea directly.  Instead, create TWorkArea objects indirectly by calling the Add method of TWorkAreas.


TWorkArea.GetDisplayName

TWorkArea	See also

Returns the value of the DisplayName property.

function GetDisplayName: string; override;

Description

GetDisplayName is the read implementor of the DisplayName property. The DisplayName indicates the name that appears as a label for the work area in the list view when the list view’s ShowWorkAreas property is True.


TWorkArea.SetDisplayName

TWorkArea	See also

Sets the value of the DisplayName property.

procedure SetDisplayName(const Value: string); override;

Description

SetDisplayName is the write implementor of the DisplayName property. The DisplayName indicates the name that appears as a label for the work area in the list view when the list view’s ShowWorkAreas property is True.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem


TWriter

Hierarchy	Properties	Events	Methods	See also

TWriter is a specialized filer object that writes data to its associated stream.

Unit

classes

Description

TWriter is used internally by the VCL streaming system to write information associated with a component, such as published properties of components or custom property data, to a stream. TWriter handles the mechanics of writing the data associated with a component to a stream. It is the writer object, rather than the stream, that is responsible for handling the complexities of streaming components. These include methods for:

Writing different kinds of items to the associated stream.

Writing property deltas used for streaming inherited forms and properties with default values.

Writing nested groups of items or collections to the stream.

Other methods and properties of TWriter are used for interacting with stream and component objects.

Do not directly create writer objects. Writers are automatically created in stream object methods or in global routines that initiate the streaming process. These include:

the global routine ObjectTextToBinary procedure, which directly creates a writer.

the global WriteComponentResFile function, which creates a file stream that creates a writer.

the TStream.WriteDescendent method, which creates a writer object.

Once the streaming process is underway, programs do not need to directly manipulate writer objects. The interaction between the writer, component, and stream objects happens automatically in methods of these objects that make calls to each other.


TWriter properties

TWriter	Alphabetically

In TWriter

Position

RootAncestor

Derived from TFiler

Ancestor

IgnoreChildren

LookupRoot

Root


TWriter properties

TWriter	By object

Ancestor

IgnoreChildren

LookupRoot

Position

Root

RootAncestor


TWriter.Position

TWriter	See also

Represents the current writing position in the associated stream.

property Position: Longint;

Description

Position is used internally by writer objects to indicate the current writing position in the stream.

The value of Position will be inside the most recent buffer block read or the next block to be written. Thus, for writing, Position will generally be less than the stream's Position. When Position is set to a location outside the current buffer, the writer’s buffer is flushed to the stream.


TWriter.RootAncestor

TWriter	See also

Represents the ancestor of the component in the Root property.

property RootAncestor: TComponent;

Description

RootAncestor is used internally by writer objects for dealing with form inheritance. It is used to iterate through ancestor components when writing properties in inherited forms.

RootAncestor is always the ancestor form. For each component in Root, which is the inherited form, the Ancestor property tracks a corresponding component in RootAncestor.

The writer object iterates through each of the Root form's owned components, comparing each to the corresponding component in the RootAncestor form. It then writes only those properties in the current component that differ in some way from those in the Ancestor component.


TWriter events

TWriter	Alphabetically

In TWriter

OnFindAncestor


TWriter events

TWriter	By object

OnFindAncestor


TWriter.OnFindAncestor

TWriter	See also

Occurs when a component is about to be written to a stream.

type TFindAncestorEvent = procedure(Writer: TWriter; Component: TComponent; const Name: string; var Ancestor, RootAncestor: TComponent) of object;

property OnFindAncestor: TFindAncestorEvent;

Description

OnFindAncestor allows the writer to explicitly specify the ancestor of a component when it is written to a stream. The WriteComponent method generates this event to override the value of the Ancestor property before writing a component to a stream.

The Writer parameter is the writer that is streaming the component.

The Component parameter is the component that is being streamed out.

The Name parameter is the name of the ancestor component.

On entry to the event handler, Ancestor is the ancestor component from which Component inherits its properties (if this is known). If the writer does not know the ancestor component, Ancestor is nil. The event handler sets Ancestor to the ancestor component for Component.

On entry to the event handler, RootAncestor is the value of the RootAncestor property. Changing this value in the event handler changes the value of the property.


TWriter methods

TWriter	Alphabetically

In TWriter

DefineBinaryProperty

DefineProperty

Destroy

FlushBuffer

Write

WriteBoolean

WriteChar

WriteCollection

WriteComponent

WriteCurrency

WriteDate

WriteDescendent

WriteFloat

WriteIdent

WriteInteger

WriteListBegin

WriteListEnd

WriteRootComponent

WriteSignature

WriteSingle

WriteStr

WriteString

WriteWideString

Derived from TFiler

Create

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TWriter methods

TWriter	By object

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Create

DefaultHandler

DefineBinaryProperty

DefineProperty

Destroy

Dispatch

FieldAddress

FlushBuffer

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException

Write

WriteBoolean

WriteChar

WriteCollection

WriteComponent

WriteCurrency

WriteDate

WriteDescendent

WriteFloat

WriteIdent

WriteInteger

WriteListBegin

WriteListEnd

WriteRootComponent

WriteSignature

WriteSingle

WriteStr

WriteString

WriteWideString


TWriter.DefineBinaryProperty

TWriter	See also

Treats unformatted data as if it were the value of a published property, and writes it directly to a memory stream.

type TStreamProc = procedure(Stream: TStream) of object;

procedure DefineBinaryProperty(const Name: string; ReadData, WriteData: TStreamProc; HasData: Boolean); override;

Description

DefineBinaryProperty is called internally by the DefineProperties method of an object that has data it needs to store. DefineProperties takes a generic filer object as its parameter.

For writing binary data DefineProperties takes a TWriter object and then calls its DefineBinaryProperty method. DefineBinaryProperty writes the property’s name and it’s data, but only if the HasData parameter is True. Otherwise it does nothing.

The Name parameter specifies the name of the “fake” property to be written to the stream. A “fake” property is a property that is not published, and that exists only in the code for the DefineBinaryProperty method. The Top and Left properties of a non-visual component are examples of “fake” properties. These are also called “defined properties” or “custom defined properties.”

The TStreamProc type is the type of the ReadData and WriteData parameters. It is the method-pointer type that points to a procedure (defined in the storing object) that reads or writes a binary representation of the object's data directly to or from the stream passed as its Stream parameter. For TWriter the ReadData parameter is ignored.

The HasData parameter determines at run time whether the "fake" property has data to store (write).

Defined binary properties are quite rare. VCL objects that store graphics as binary data are the most common use of filer objects to store and retrieve that data. More commonly objects use the DefineProperty method. The difference between DefineBinaryProperty and DefineProperty is that with DefineBinaryProperty the component reads or writes the binary property directly to or from a memory stream object, rather than going through a filer object.

Note:	Streamable objects that are descended from TPersistent inherit a DefineProperties method, however DefineProperties does not do anything until TComponent. It is TComponent’s DefineProperties method that calls the writer’s DefineBinaryProperty when writing out binary data.


TWriter.DefineProperty

TWriter	See also	Example

Defines data the writer object writes as if the data were a property.

type

  TReaderProc = procedure(Reader: TReader) of object;

  TWriterProc = procedure(Writer: TWriter) of object;

procedure DefineProperty(const Name: string; ReadData: TReaderProc; WriteData: TWriterProc; HasData: Boolean); override;

Description

DefineProperty is called internally by the DefineProperties method of an object that has data it needs to store. DefineProperties takes a generic filer object as its parameter. For writing data, DefineProperties takes a TWriter object and calls its DefineProperty method. DefineProperty then writes the property’s name and its data, but only if the HasData parameter is True. Otherwise it does nothing.

The Name parameter specifies the name of the “fake” property to be written to the stream.

The TWriterProc type is the type of the WriteData parameter. It is the method-pointer type that points to a procedure (defined in the component object) that writes the object's data, that represents a property value, to the writer object. For TWriter the ReadData parameter is ignored.

The HasData parameter determines at run time whether the "fake" property has data to store (write). Thus, writer objects only use HasData when writing data.

The difference between DefineBinaryProperty and DefineProperty is that with DefineBinaryProperty, the binary data is written directly to a stream object, rather than going through a filer object.

When writing a component that has special (large) data storage requirements, the component’s DefineProperties can be overriden. For each special or “fake” property item, call TFiler.DefineProperty or TFiler.DefineBinaryProperty. For the ReadData and WriteData parameters, pass in methods of the component that know how to handle that special data type. When reading, ReadData is called. When writing, WriteData is called.

Note:	When defining properties, a component should be aware of the Ancestor property, which, if non-nil, indicates that the component should only write the values of properties that differ from those inherited from Ancestor.


TWriter.Destroy

TWriter	See also

Destroys of an instance of a writer.

destructor Destroy; override;

Description

Do not call Destroy directly in an application. Writers are created indirectly by the global routines or stream methods that use them. When these routines are finished, they handle disposing of the writer.

Destroy writes the buffer before calling the inherited Destroy, which frees the buffer.


TWriter.FlushBuffer

TWriter

Synchronizes the writer's buffer with the associated stream by writing the current buffer.

procedure FlushBuffer; override;

Description

FlushBuffer is not generally used except for internal implementation in Delphi.

FlushBuffer writes the current buffer to the stream, then resets an internal pointer to the correct position.


TWriter.Write

TWriter	See also

Writes Count bytes from Buf to the writer object's associated stream.

procedure Write(const Buf; Count: Longint);

Description

Do not call Write directly. It is used internally to write data to the stream. Many other writer methods call Write, usually after setting pertinent values or verifying data types.


TWriter.WriteBoolean

TWriter	See also	Example

Writes the Boolean value passed in Value to the writer object's stream.

procedure WriteBoolean(Value: Boolean);

Description

WriteBoolean is used internally by the Delphi streaming system to write component properties to a stream. Use WriteBoolean for writing component boolean properties to streams.

WriteBoolean checks to ensure that Value is the correct type before calling Write to write the boolean value and its value type to the stream.


TWriter.WriteChar

TWriter	See also

Writes the character passed in Value to the writer object's stream.

procedure WriteChar(Value: Char);

Description

WriteChar is used internally by the Delphi streaming system to write component properties to a stream. Use WriteChar for writing component character properties to streams.

WriteChar calls WriteString which checks to ensure that Value is the correct type before calling Write to write the character and its value type to the stream.

Note:	WriteChar calls StringChar to enable writing character properties that are upwardly compatible with string properties.


TWriter.WriteCollection

TWriter	See also

Writes the collection of objects passed in Value to the writer object's stream.

procedure WriteCollection(Value: TCollection);

Description

WriteCollection is used internally by the Delphi streaming system to write component properties to a stream. Use WriteCollection for writing component properties that are collections to streams.

WriteCollection checks to ensure that Value is the correct type before calling Write to write the collection and its value type to the stream. WriteCollection bounds the collection with start-of-list and end-of- list markers.


TWriter.WriteComponent

TWriter	See also	Example

Writes the component specified by Component to a stream.

procedure WriteComponent(Component: TComponent);

Description

Never call WriteComponent directly. WriteComponent is recursively called for each owned component in Root.

WriteComponent sets the csWriting state in Component's ComponentState property before calling the WriteState method of Component and clears the csWriting flag when WriteState returns.

Note:	The sequence of events is as follows: the writer’s WriteComponent method calls the Component’s WriteState method, which calls the writer’s WriteData method. That method writes the properties for each child component, then calls WriteComponent.

Because the Component’s WriteState is virtual, it is the Component’s only opportunity to prepare itself to be streamed (i.e. to consolidate its data.)


TWriter.WriteCurrency

TWriter

Writes a currency value to the writer’s stream.

procedure WriteCurrency(const Value: Currency);

Description

WriteChar is used internally by the Delphi streaming system to write component properties to a stream. Use WriteCurrency for writing component properties of type currency to streams.

WriteCurrency first writes a type identifier before writing the currency value.


TWriter.WriteDate

TWriter

Writes a datetime value to the writer’s stream.

procedure WriteDate(const Value: TDateTime);

Description

WriteDate is used internally by the Delphi streaming system to write component properties to a stream. Use WriteDate for writing component properties of type TDateTime to streams.

WriteDate first writes a type identifier before writing the TDateTime value.


TWriter.WriteDescendent

TWriter	See also

Triggers the writing of descendant components in inherited forms.

procedure WriteDescendent(Root: TComponent; AAncestor: TComponent);

Description

Never call WriteDescendent directly. It is part of a sequence of calls used for streaming descendant components in inherited forms.

WriteDescendent sets the writer object's Ancestor and RootAncestor properties to the value passed in AAncestor, sets the Root property to the value passed in Root, then calls WriteSignature and WriteComponent to write Root and any components it owns to the writer object's stream.

WriteDescendent differs from WriteComponent in that, by setting Ancestor, it uses Ancestor's property values as the defaults, rather than those defined by Root's type.


TWriter::WriteFloat
TWriter.WriteFloat

TWriter	See also

Writes the floating-point value passed in Value to the writer object's stream.

procedure WriteFloat(const Value: Extended);

Description

WriteFloat is used internally by the Delphi streaming system to write component properties to a stream. Use WriteFloat for writing floating point data to streams.

WriteFloat checks to ensure that Value is the correct type before calling Write to write the float value and its value type to the stream.


TWriter.WriteIdent

TWriter	See also

Writes the identifier passed in Ident to the writer object's stream.

procedure WriteIdent(const Ident: string);

Description

WriteIdent is used internally by the Delphi streaming system to write component properties to a stream. Use WriteIdent for writing component identifier properties to streams. Component names and enumerated type elements are examples of strings which must be restricted to Pascal identifier syntax.

WriteFloat checks to ensure that Value is the correct type before calling Write to write the identifier and its value type to the stream.


TWriter.WriteInteger

TWriter	See also

Writes the integer value passed in Value to the writer object's stream.

procedure WriteInteger(Value: Longint); overload;

procedure WriteInteger(Value: Int64); overload;

Description

WriteInteger is used internally by the Delphi streaming system to write component properties to a stream. Use WriteInteger for writing component integer properties to streams.

WriteInteger checks to ensure that Value is the correct type before calling Write to write the integer value and its value type to the stream. WriteInteger handles integers of different sizes.


TWriter.WriteListBegin

TWriter	See also

Writes a start-of-list marker to the writer object's associated stream.

procedure WriteListBegin;

Description

WriteListBegin is used by other methods that iterate through a group of items about to be written to the stream. WriteListBegin writes a start-of-list marker to the writer object's associated stream. Every call to WriteListBegin must have a corresponding call to WriteListEnd.


TWriter.WriteListEnd

TWriter	See also

Writes an end-of-list marker to the writer object's associated stream.

procedure WriteListEnd;

Description

WriteListEnd is used by other methods that iterate through a group of items that are sequentially written to the stream during a single process.

A call to WriteListEnd is generally preceded by a writing loop. A call to WriteListEnd must correspond to a preceding call to WriteListBegin.


TWriter.WriteRootComponent

TWriter	See also

Calls the WriteDescendent method.

procedure WriteRootComponent(Root: TComponent);

Description

WriteRootComponent is provided for backward compatibility only.


TWriter.WriteSignature

TWriter

Writes a filer signature to the writer object's associated stream.

procedure WriteSignature;

Description

WriteSignature is used internally by several methods that write the filer signature before processing some action. For example, the WriteRootComponent method calls WriteSignature before writing its component to the stream. By checking for the signature before loading objects, reader objects can guard against inadvertently reading invalid or corrupted data.


TWriter.WriteSingle

TWriter

Writes a value of type Single to the writer’s stream.

procedure WriteSingle(const Value: Single);

Description

WriteSingle is used internally by the Delphi streaming system to write component properties to a stream. Use WriteSingle for writing component properties of type single to streams.

WriteSingle first writes a type identifier before writing the value.


TWriter.WriteStr

TWriter	See also

Writes raw data to the writer object's stream.

procedure WriteStr(const Value: string);

Description

Do not call WriteStr directly. WriteStr is for internal use by certain VCL components. WriteStr writes the string passed in Value to the writer object's stream.

Warning:	Always use WriteString for writing component strings to streams. WriteStr can corrupt data if not used correctly.


TWriter::WriteString
TWriter.WriteString

TWriter	See also

Writes tagged data to the writer object's stream.

procedure WriteString(const Value: string);

Description

WriteString is used internally by the Delphi streaming system to write component properties to a stream. WriteString is otherwise only used by component writers in the DefineProperties and WriteData procedures.

WriteString writes the string passed in Value to the writer object's stream. WriteString checks to ensure that Value is the correct type before calling Write to write the string and its value type to the stream.

Warning: 	Always use WriteString for writing component strings to streams. The similarly-named WriteStr method is for internal use by certain VCL components and can corrupt data if not used correctly.


TWriter.WriteWideString

TWriter	See also

WriteWideString writes a wide string to the writer’s stream.

procedure WriteWideString(const Value: WideString);

Description

WriteWideString is used internally by the VCL streaming system to write component properties to a stream. Use WriteWideString for writing WideString component to streams.

WriteWideString first writes a type identifier and the length of the string before writing the value.


Hierarchy

TObject

TFiler


TWorkAreas

Hierarchy	Properties	Methods	See also

TWorkAreas is a collection of TWorkArea objects.

Unit

comctrls

Description

Use TWorkAreas to represent the work areas of a list view control. Each work area is represented by a single TWorkArea object.  Most importantly, these work areas define rectangles that cover portions of the list view’s client area. List items are associated with a work area when they are placed in the portion of the client area covered by a work area’s rectangle. These associations are used to add an extra level of organization to the list view, with list items arranged within each work area.


TWorkAreas properties

TWorkAreas	Alphabetically	Legend

In TWorkAreas

Items

Derived from TCollection

Count

ItemClass


TWorkAreas properties

TWorkAreas	By object	Legend

Count

ItemClass

Items


TWorkAreas.Items

TWorkAreas	See also

Provides indexed access to the TWorkArea objects.

property Items[Index: Integer]:TWorkArea; default;

Description

Use Items to access the properties of the TWorkArea objects maintained by TWorkAreas. Items is the default property of TWorkAreas, so the name of the Items property can be left off when using this property. Thus the line

ListView1.WorkAreas.Items[0].Color := 'clLtGray';

can be written

ListView1.WorkAreas[0].Color := 'clLtGray';


TWorkAreas methods

TWorkAreas	Alphabetically

In TWorkAreas

Add

Delete

Insert

Derived from TOwnedCollection

Create

Derived from TCollection

Assign

BeginUpdate

Clear

Destroy

EndUpdate

FindItemID

GetNamePath

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TWorkAreas methods

TWorkAreas	By object

Add

AfterConstruction

Assign

BeforeDestruction

BeginUpdate

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Delete

Destroy

Dispatch

EndUpdate

FieldAddress

FindItemID

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

SafeCallException


TWorkAreas.Add

TWorkAreas	See also

Creates a new TWorkArea object and adds it to the end of the Items property array.

function Add: TWorkArea;

Description

Call Add to add a new work area to the list view that owns this TWorkAreas object.  Add returns the newly created TWorkArea object. After adding a new work area, set the work area’s Rect property to indicate what portion of the list view’s client area it represents.


TWorkAreas.Delete

TWorkAreas	See also

Removes a TWorkArea object from the Items property array.

procedure Delete(Index: Integer);

Description

Call Delete to remove the work area specified by Items[Index]. Delete removes the work area from the Items property array and frees the TWorkArea object.


TWorkAreas.Insert

TWorkAreas	See also

Creates a new TWorkArea object and adds it to the Items property array in a specified position.

function Insert(Index: Integer): TWorkArea;

Description

Call Insert to add a new work area to the list view that owns this TWorkAreas object.  Insert adds a new work area at the position specified by the Index parameter. Existing work areas (starting from the specified position) are moved up in the Items array. Insert returns the newly created TWorkArea object. After inserting a new work area, set the work area’s Rect property to indicate what portion of the list view’s client area it represents.

Note:	Usually, there is no meaningful difference between using the Add method or the Insert method to add work areas. However, if two or more work areas specify overlapping regions, then the order of the work areas in the Items array determines which work area is associated with list items in the overlapping region. Specifically, list items in the overlapping region are associated with the work area that has the lower index.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection

TOwnedCollection


TWideStringField

Hierarchy	Properties	Methods	Events	See also

TWideStringField represents a large string field in a dataset.

Unit

DB

Description

TWideStringField is a persistent field object that encapsulates the fundamental behavior common to wide string fields. Wide string fields are similar to simple string fields except that their storage capacity is virtually unlimited and the server specifically returns the field as wide string and not string. And example of a wide string field is the unicode field in Microsoft SQL Server. In all other ways, wide string fields serve the same purpose as string fields.

TWideStringField introduces no new properties, methods or events, but reimplements the AsString, AsVariant, DataSize, and Value properties to adapt them to accessing wide string fields.


TWideStringField properties

TWideStringField	Alphabetically	Legend

In TWideStringField

AsString

AsVariant

DataSize

Value

Derived from TStringField

AsBoolean

AsDateTime

AsFloat

AsInteger

FixedChar

Transliterate

Derived from TField

Alignment

AsCurrency

AttributeSet

AutoGenerateValue

Calculated

CanModify

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataType

DefaultExpression

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

NewValue

Offset

OldValue

Origin

ParentField

ProviderFlags

ReadOnly

Required

Size

Text

ValidChars

Visible

Derived from TComponent

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag

VCLComObject


TWideStringField properties

TWideStringField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

AutoGenerateValue

Calculated

CanModify

ComObject

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

ConstraintErrorMessage

CurValue

CustomConstraint

DataSet

DataSize

DataType

DefaultExpression

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

FixedChar

FullName

HasConstraints

ImportedConstraint

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupCache

LookupDataSet

LookupKeyFields

LookupList

LookupResultField

Name

NewValue

Offset

OldValue

Origin

Owner

ParentField

ProviderFlags

ReadOnly

Required

Size

Tag

Text

Transliterate

ValidChars

Value

VCLComObject

Visible


TWideStringField.AsString

TWideStringField	See also

Represents the value of the field as a string.

property AsString: String;

Description

Use AsString to get or set the field’s value as a string type.

When setting the AsString property, TWideStringField converts the assigned string from ANSI, using the language driver for the dataset, if the Transliterate property is True.

Table1TheWideStringField.AsString := WideStringVariable;


TWideStringField.AsVariant

TWideStringField	See also

Represents the value of a string field as a variant value.

property AsVariant: Variant;

 Description

Use AsVariant to

•	Assign the string field value to a variant variable.

•	Assign a variant value to the string field.

Using variants is useful when both the field type and the type of the value to be assigned to the field are unknown.

Table1TheWideStringField.AsVariant := VariantVariable;


TWideStringField.DataSize

TWideStringField	See also

Indicates amount of memory needed to store the string field in its native database format.

property DataSize: Word;

Description

Inspect DataSize to determine the number of bytes required to store the fields value. Use DataSize to determine the size needed for a buffer when working with the GetData and SetData methods.

For wide string fields, DataSize is the value of the Size property plus one (for the trailing NULL character), multiplied by two.


TWideStringField.Value

TWideStringField	See also

Represents the data in the string field.

property Value: String;

Description

Use Value to read data directly from and write data directly to a string field component at runtime. Using the Value property is the same as using the AsString property. Use Value when you know the field component is a string field. Use AsString when working with a generic field component.

When setting the Value property, TWideStringField converts the assigned string from ANSI, using the language driver for the dataset, if the Transliterate property is True. Strings that have more characters than permitted by the value of the Size property are truncated when setting Value.

Table1TheWideStringField.Value := WideStringVariable;


TWideStringField events

TWideStringField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TWideStringField events

TWideStringField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TWideStringField methods

TWideStringField	Alphabetically

In TWideStringField

Create

Derived from TField

Assign

AssignValue

Clear

Destroy

FocusControl

GetData

IsBlob

IsValidChar

RefreshLookupList

SetData

SetFieldType

Validate

Derived from TComponent

DestroyComponents

Destroying

ExecuteAction

FindComponent

FreeNotification

FreeOnRelease

GetNamePath

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

UpdateAction

Derived from TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWideStringField methods

TWideStringField	By object

AfterConstruction

Assign

AssignValue

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Clear

Create

DefaultHandler

Destroy

DestroyComponents

Destroying

Dispatch

ExecuteAction

FieldAddress

FindComponent

FocusControl

Free

FreeInstance

FreeNotification

FreeOnRelease

GetData

GetInterface

GetInterfaceEntry

GetInterfaceTable

GetNamePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsBlob

IsValidChar

MethodAddress

MethodName

NewInstance

RefreshLookupList

RemoveComponent

SafeCallException

SetData

SetFieldType

UpdateAction

Validate


TWideStringField.Create

TWideStringField	See also

Creates an instance of a TWideStringField object.

constructor Create(AOwner: TComponent); override;

Description

Call Create to create and initialize an instance of TWideStringField. After calling the inherited constructor, Create sets the DataType property to ftWideString.

After instantiating a TWideStringField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TWideStringField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Associate the TWideStringField with a dataset component by setting its DataSet property to the name of the dataset component.

The example below creates a TWideStringField object for a field named BookList accessed through a TQuery named Query1.

var

  T: TWideStringField;

begin

  Query1.Close;

  T := TWideStringField.Create(Self);

  T.FieldName := 'BookList';

  T.Name := Query1.Name + T.FieldName;

  T.Index := Query1.FieldCount;

  T.DataSet := Query1;

  Query1.FieldDefs.UpDate;

  Query1.Open;

end;


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TStringField


The IUknown interface and methods
The IUnknown interface and methods

For the definition of the IUnknown interface and its methods—QueryInterface, AddRef, and Release—see the Microsoft online Help.

For an overview of the implementation of the IUnknown interface in the VCL classes, see Implementing IUnknown, TInterfacedObject and Using interfaces.


Actnlist unit

Actnlist routines

Other objects and components, by unit

TAction

TAction is the generic class for creating action objects that implement user commands across a range of different controls.

TActionLink

TActionLink is the base class for action links that connect actions to commonly used properties of VCL objects, components and controls.

TActionList

TActionList is the generic class for creating components that maintain lists of actions used with components and controls, such as menu items and buttons.

TContainedAction

TContainedAction is the base class for actions that can be grouped by category and that can appear in action lists.

TCustomAction

TCustomAction is the base class for actions meant to be used with menu items and controls.

TCustomActionList

TCustomActionList is the base class for action list objects that provide the IDE user interface to actions.


Adodb unit

Other objects and components, by unit

EADOError

EADOError is the exception class for database errors generated by ADO databases.

TADOBlobStream

TADOBlobStream is a stream object that reads from and writes to field objects that represent Binary large object (BLOB) fields.

TADOCommand

TADOCommand represents an ADO command object.

TADOConnection

TADOConnection is provides a connection to an ADO data store.

TADODataSet

TADODataSet represents a dataset retrieved from an ADO data store.

TADOQuery

TADOQuery provides the means for issuing SQL against an ADO data store.

TADOStoredProc

TADOStoredProc encapsulates a stored procedure in an ADO database.

TADOTable

TADOTable is a dataset component that encapsulates a table accessed through an ADO data store.

TCustomADODataSet

TCustomADODataSet is the virtualized base class for all ADO dataset components.

TParameter

TParameter represents a parameter.

TParameters

TParameters manages a collection of parameters.

TRDSConnection

TRDSConnection is the VCL implementation of an RDS DataSpace object.


Appevnts unit

Other objects and components, by unit

TApplicationEvents

TApplicationEvents intercepts application-level events.

TCustomApplicationEvents

TCustomApplicationEvents intercepts application-level events.


Axctrls unit

Axctrls routines

Other objects and components, by unit

TActiveForm

TActiveForm is the base class for a VCL Form exposed as an ActiveX control. TActiveForm represents a form that is created via a class factory and used as an ActiveX control in ActiveX host applications.

TActiveFormControl

A COM object which provides the interfaces necessary to support an ActiveX control.

TActiveFormFactory

The ActiveFormFactory object is the class factory for TActiveForm.

TActiveXControl

TActiveXControl is an abstract class that provides the functionality to embed a VCL control into an ActiveX Container window.

TActiveXControlFactory

TActiveXControlFactory is the factory class for ActiveX control objects.

TActiveXPropertyPage

TActiveXPropertyPage represents a COM object that provides the interfaces for supporting an ActiveX property page.

TActiveXPropertyPageFactory

TActiveXPropertyPageFactory implements a COM factory for an ActiveX property page.

TAdapterNotifier

TAdapterNotifier provides the binding between a Delphi type object and comparable OLE type object.

TAggregatedObject

TAggregatedObject provides the functionality for an inner object of an aggregate by implementing the IUnknown methods to delegate to the controlling IUnknown.

TConnectionPoint

TConnectionPoint is the class used to create connection point objects for connection point containers.

TConnectionPoints

TConnectionPoints implements a container for connection points.

TContainedObject

TContainedObject implements the IUnknown interface as an inner object in an aggregate.

TCustomAdapter

TCustomAdapter is a base class for objects that bind VCL objects to COM interfaces.

TFontAdapter

TFontAdapter is a helper class used to connect a TFont object to an OLE font object.

TOLEStream

TOleStream reads and writes information over a streaming interface that is provided by an OLE object.

TOleGraphic

TOleGraphic is a wrapper for an OLE graphical interface.

TPictureAdapter

TPictureAdapter connects a native TPicture object to an OLE picture object.

TPropertyPage

TPropertyPage is an abstract class that implements a property page for an ActiveX control.

TPropertyPageImpl

TPropertyPageImpl implements the IPropertyPage interface to provide the interfaces needed to support an ActiveX property page.

TReflectorWindow

TReflectorWindow ensures that ActiveX controls respond properly to Windows messages.

TStringsAdapter

TStringsAdapter is a helper class used to allow a TStrings object to implement an IStrings interface for use with OLE.


Buttons unit

Other objects and components, by unit

TBitBtn

TBitBtn is a push button control that can include a bitmap on its button face.

TSpeedButton

TSpeedButton is a button that is used to execute commands or set modes.


Cgiapp unit

Other objects and components, by unit

TCGIApplication

TCGIApplication encapsulates a CGI server application.

TCGIRequest

TCGIRequest represents client request information that is passed to a CGI Web server application.

TCGIResponse

TCGIResponse represents HTTP messages sent by a CGI application in response to an HTTP request message.

TWinCGIRequest

TWinCGIRequest represents client request information that is passed to a Windows hosted CGI Web server application.

TWinCGIResponse

TWinCGIResponse represents HTTP messages sent by a Windows hosted CGI application in response to an HTTP request message.


Checklst unit

Other objects and components, by unit

TCheckListBox

TCheckListBox displays a scrollable list with check boxes next to each item.


Classes unit

Classes routines

Other objects and components, by unit

EBitsError

EBitsError is the exception class for invalid attempts to access an array of Boolean values.

EClassNotFound

EClassNotFound is the exception class for the failure to find a specified component when reading from a stream.

EComponentError

EComponentError is the exception class for registering and renaming components.

EFCreateError

EFCreateError is the exception class for streaming file-creation errors.

EFOpenError

EFOpenError is the exception class for file-opening errors during streaming.

EFilerError

EFilerError is the exception class for file stream errors.

EInvalidImage

EInvalidImage is the exception class for unsuccessful attempts to read resource files.

EInvalidOperation

EInvalidOperation is the exception class for invalid operations on a component.

EListError

EListError is the exception class for list and string errors.

EOutOfResources

EOutOfResources is the exception class for unsuccessful attempts to allocate Windows handles.

EParserError

EParserError is the exception class for text-to-binary streaming conversion errors.

EReadError

EReadError is the exception class for unsuccessful attempts to read data from a stream.

EResNotFound

EResNotFound is the exception class for unlocatable resources.

EStreamError

EStreamError is the exception class for streaming errors.

EStringListError

EStringListError is the exception class for invalid list-box references.

EThread

EThread is the exception class for thread synchronization errors.

EWriteError

EWriteError is the exception class for unsuccessful attempts to write data to a stream.

IDesignerNotify

IDesignerNotify is the interface for responding to notifications about changes to components in the designer.

TBasicAction

TBasicAction is the ancestor base class for all action objects.

TBasicActionLink

TBasicActionLink is the base class for action link classes and introduces the fundamental behavior that enables action link classes to communicate between actions and clients.

TBits

TBits stores an “array” of Boolean values.

TCollection

TCollection is a container for TCollectionItem objects.

TCollectionItem

TCollectionItem represents an item in a collection.

TComponent

TComponent is the common ancestor of all VCL components

TCustomMemoryStream

TCustomMemoryStream is an abstract base class used as the common ancestor for memory streams.

TFileStream

TFileStream enables applications to read from and write to a file on disk.

TFiler

TFiler is the abstract base class for reader and writer objects, which are used for loading and saving components and their properties.

THandleStream

THandleStream enables applications to read from and write to communications resources identified by a Windows handle.

TInterfaceList

TInterfaceList represents a list of interfaces.

TList

TList stores an array of pointers.

TMemoryStream

TMemoryStream is a stream that stores its data in dynamic memory.

TOwnedCollection

TOwnedCollection is a collection that maintains information about its owner.

TPersistent

TPersistent is the ancestor for all objects that have assignment and streaming capabilities

TReader

TReader is a specialized filer object that reads component data from an associated stream.

TResourceStream

TResourceStream is a memory stream that provides access to the compiled resources in a Windows application.

TStream

TStream is the base class type for stream objects that can read from or write to various kinds of storage media, such as disk files, dynamic memory, and so on.

TStringList

TStringList maintains a list of strings.

TStringStream

TStringStream provides file-like access to information stored as a long string.

TStrings

TStrings is an abstract base class for objects that represent a list of strings.

TThread

TThread is an abstract class that enables creation of separate threads of execution in an application.

TThreadList

TThreadList represents a thread-safe list.

TWriter

TWriter is a specialized filer object that writes data to its associated stream.


Clipbrd unit

Clipbrd routines

Other objects and components, by unit

TClipboard

TClipboard represents the Windows clipboard.


Comctrls unit

Comctrls routines

Other objects and components, by unit

ECommonCalendarError

ECommonCalendarError is the exception class for invalid entries in a TCommonCalendar component.

EDateTimeError

EDateTimeError is the exception class for invalid date and time entries.

EMonthCalError

EMonthCalError is the exception class for invalid entries in a TMonthCalendar component.

ETreeViewError

ETreeViewError is the exception class for unsuccessful attempts to access a tree view node.

TAnimate

TAnimate is a wrapper for a Windows animation control.

TCommonCalendar

TCommonCalendar is the base class for the TDateTimePicker!ALink(TDateTimePicker_Object,1) and TMonthCalendar!ALink(TMonthCalendar_Object,1) controls.

TConversion

TConversion converts rich text data from one encoding format to another, at the point when the data is streamed from a storage medium that uses one format to a storage medium that uses the other.

TCoolBand

TCoolBand represents a band within a TCoolBar.

TCoolBands

TCoolBands is a container for TCoolBand objects.

TCoolBar

TCoolBar displays a collection of windowed controls within movable, resizable bands.

TCustomHotKey

TCustomHotKey is the base class for objects that wrap the Windows hot key Common Control.

TCustomListView

TCustomListView is the base type for all list view components, including TListView.

TCustomRichEdit

TCustomRichEdit is the abstract base type for rich edit controls such as TRichEdit.

TCustomTabControl

TCustomTabControl is the base type for tab-control components such as TTabControl and TPageControl.

TCustomTreeView

TCustomTreeView is the base type for tree-view components such as TTreeView.

TCustomUpDown

TCustomUpDown is the base type for up-down size controls such as TUpDown.

TDateTimePicker

TDateTimePicker displays a list box for entering dates or times.

THeaderControl

THeaderControl is a container for THeaderSection objects. It provides a set of resizable column headers.

THeaderSection

THeaderSection represents a section of a header control.

THeaderSections

THeaderSections is a container for THeaderSection objects.

THotKey

THotKey is a wrapper for a hot key Windows Common Control.

TIconOptions

TIconOptions describes how the icons in a list view should be arranged.

TListColumn

TListColumn represents a column in a report-style list view.

TListColumns

TListColumns is a collection of TListColumn objects.

TListItem

TListItem is an individual item of a TListView control.

TListItems

TListItems maintains the list of items that appear in a list view control.

TListView

TListView displays a list of items in various ways.

TMonthCalColors

TMonthCalColors defines a color scheme for TDateTimePicker’s drop-down calendar.

TMonthCalendar

TMonthCalendar is stand-alone calendar in which a user can select a date or range of dates.

TPageControl

TPageControl is a set of pages used to make a multiple page dialog box.

TPageScroller

TPageScroller defines a display area for a narrow window, such as a toolbar.

TParaAttributes

TParaAttributes represents paragraph formatting properties for a rich edit control.

TProgressBar

TProgressBar is a wrapper for a Windows progress bar.

TRichEdit

TRichEdit is a wrapper for a Windows rich text edit control.

TStatusBar

TStatusBar represents a Windows status bar.

TStatusPanel

TStatusPanel represents a single panel of a status bar.

TStatusPanels

TStatusPanels is a container for TStatusPanel objects.

TTabControl

TTabControl is a tab set that has the appearance of notebook dividers.

TTabSheet

TTabSheet is an individual page in a TPageControl object.

TTextAttributes

TTextAttributes represents the font characteristics of a section of text in a rich edit control.

TToolBar

TToolBar manages tool buttons and other controls, arranging them in rows and automatically adjusting their sizes and positions.

TToolButton

TToolButton is a button control in a TToolBar object.

TToolButtonActionLink

TToolButtonActionLink is an action link designed for tool button control clients.

TTrackBar

TTrackBar is a wrapper for the Windows track bar control.

TTreeNode

TTreeNode describes an individual node in a tree view control.

TTreeNodes

TTreeNodes maintains a list of tree nodes in a tree view control.

TTreeView

TTreeView represents a window that displays a hierarchical list of items, such as the headings in a document, the entries in an index, or the files and directories on a disk.

TUpDown

TUpDown is a wrapper for a Windows up-down control.

TWorkArea

TWorkArea represents a rectangular subregion of a list view’s client area.

TWorkAreas

TWorkAreas is a collection of TWorkArea objects.


Comobj unit

Comobj routines

Other objects and components, by unit

EOleError

EOleError is the exception class for low-level OLE errors.

EOleException

EOleException is the exception class for OLE automation errors that occur in methods or properties of an object.

EOleRegistrationError

EOleRegistrationError is the exception class for errors that occur when registering an OLE object.

EOleSysError

EOleSysError is the exception class for errors specific to the OLE IDispatch interface.

TAutoIntfObject

TAutoIntfObject supports the IDispatch and ISupportErrorInfo interfaces.

TAutoObject

TAutoObject is a CoClass that supports the IDispatch interface, and that can be used as a base class for ActiveX Automation servers.

TAutoObjectFactory

TAutoObjectFactory is the class factory for TAutoObject.

TComClassManager

TComClassManager is the class type of the ComClassManager variable in the ComObj unit.

TComObject

TComObject is the base class for creating simple COM classes, such as those used for creating Shell extensions.

TComObjectFactory

TComObjectFactory is the type of the class factory object used to instantiate a TComObject class.

TComServerObject

TComServerObject is the abstract base class for TComServer.

TTypedComObject

TTypedComObject supports the IProvideClassInfo interface and is the class type for COM objects that can provide the type information without requring a type library to be loaded.

TTypedComObjectFactory

TTypedComObjectFactory is the type of the class factory object used to instantiate a TypedComObject class.


Compprod unit

Other objects and components, by unit

TComponentsPageProducer

TComponentsPageProducer produces a string of HTML commands based on an input template.


Comserv unit

Comserv routines

Other objects and components, by unit

TComServer

TComServer is the class type of the ComServ variable that is declared and instantiated in the ComServ unit.


Contnrs unit

Other objects and components, by unit

TClassList

TClassList maintains a list of classes.

TComponentList

TComponentList maintains a list of components, updating itself when a component is freed.

TObjectList

TObjectList maintains a list of (owned) objects.

TObjectQueue

TObjectQueue maintains a first-in first-out list of objects.

TObjectStack

TObjectStack maintains a last-in first-out list of objects.

TOrderedList

TOrderedList maintains an array of pointers that must be accessed in serial order.

TQueue

TQueue maintains a first-in first-out array of pointers.

TStack

TStack maintains a last-in first-out array of pointers.


Controls unit

Controls routines

Other objects and components, by unit

TBaseDragControlObject

TBaseDragControlObject object provides support for drag-and-drop or drag-and-dock operations.

TChangeLink

The TImageList component uses TChangeLink internally to notify other objects when changes are made to the image list.

TControl

TControl is the base class for all components that are visible at runtime.

TControlActionLink

TControlActionLink links action objects to clients that descend from TControl.

TControlCanvas

TControlCanvas is a specialized canvas object associated with a control.

TCustomControl

TCustomControl is the base class for windowed controls that need a Canvas for drawing complex visual images.

TDragControlObject

TDragControlObject object provides for normal drag and drop operations.

TDragDockObject

Contains drag-and-dock information for a control.

TDragImageList

TDragImageList represents a set of images that appear during drag and drop operations.

TDragObject

TDragObject is a base class used for managing drag operations.

TGraphicControl

TGraphicControl is the base class for all nonwindowed custom controls.

THintWindow

THintWindow implements the small pop-up window that appears over a control at runtime when the control has its ShowHint property set to True.

TImageList

TImageList represents a collection of same-sized images, each of which can be referred to by its index.

TMouse

Contains information about the mouse.

TSizeConstraints

Contains size constraints for a control.

TWinControl

TWinControl is the base class for all windowed controls.

TWinControlActionLink

TWinControlActionLink is an action link designed for generic windowed control clients.


Corbacon unit

Other objects and components, by unit

TCorbaConnection

TCorbaConnection connects CORBA client applications to an application server.


Corbardm unit

Other objects and components, by unit

TCorbaDataModule

TCorbaDataModule encapsulates the objects and interfaces of a CORBA application server.


Ctlpanel unit

Ctlpanel routines

Other objects and components, by unit

EAppletException

EAppletException is the exception class for errors that occur in a Control Panel Application.

TAppletApplication

TAppletApplication is a singleton class that may contain multiple AppletModules.

TAppletModule

TAppletModule is an encapsulation of a Control Panel Applet.


Databkr unit

Databkr routines

Other objects and components, by unit

TRemoteDataModule

TRemoteDataModule encapsulates the objects and interfaces of a MIDAS application server.


Db unit

Db routines

Other objects and components, by unit

EDatabaseError

EDatabaseError is the exception class for database errors.

EUpdateError

EUpdateError is the exception class for dataset provider update errors.

IProviderSupport

IProviderSupport is the interface that datasets use to enable a provider to represent them in a multi-tiered database application.

TADTField

A TADTField object represents an ADT (Abstract Data Type) field in a dataset.

TAggregateField

TAggregate field represents a maintained aggregate in a client dataset and enables a data-aware control to bind to the aggregate field.

TArrayField

TArrayField represents an Array field in a dataset.

TAutoIncField

TAutoIncField is a persistent field object for an autoincrement field in a dataset.

TBCDField

TBCDField represents a binary-coded decimal (BCD) field in a dataset.

TBinaryField

TBinaryField represents an untyped binary field in a dataset.

TBlobField

TBlobField represents a field in a dataset that holds a reference to a binary large object (BLOB).

TBooleanField

TBooleanField represents a field containing Boolean values.

TBytesField

TBytesField represents a bytes field in a dataset.

TCheckConstraint

TCheckConstraint represents a check constraint on a dataset component.

TCheckConstraints

TCheckConstraints contains a collection of check constraints for a dataset component.

TCurrencyField

TCurrencyField represents a field that contains currency values in a dataset.

TCustomConnection

TCustomConnection is the base class for components that connect datasets to their source of data.

TDataLink

TDataLink is a helper class used by data-aware objects to coordinate the actions of TDataSource and TDataSet, and to respond to data events.

TDataSet

TDataSet is the base class for all dataset components that represent data in rows and columns.

TDataSetDesigner

TDataSetDesigner is the base class for all dataset designers.

TDataSetField

TDataSetField provides access to nested datasets.

TDataSource

TDataSource provides an interface between a dataset component and data-aware controls on a form.

TDateField

TDateField represents a date field in a dataset.

TDateTimeField

TDateTimeField represents a date-time field in a dataset.

TDefCollection

TDefCollection holds the definition objects (TNamedItem) that represent the specifications for database entities such as fields or indexes.

TDetailDataLink

TDetailDataLink is the ancestor to TMasterDataLink and provides base functionality for establishing a master/detail relationship.

TField

TField is the common ancestor of all the field components in a dataset.

TFieldDef

TFieldDef is a field definition that corresponds to a physical field of a record in a table underlying a dataset.

TFieldDefList

TFieldDefList contains a list of field names used to access the field definition (TFieldDef) objects stored in the FieldDefs property.

TFieldDefs

TFieldDefs holds the field definition (TFieldDef) objects that represent the physical fields underlying a dataset.

TFieldList

TFieldList contains a list of field names used to access the field (TField) objects stored in the dataset’s Fields property.

TFields

TFields holds the field (TField) objects that represent the physical fields underlying a dataset or an object field such as TADTField and TArrayField.

TFlatList

TFlatList is an abstract base class for objects that represent a list of fields.

TFloatField

TFloatField represents a field that contains floating-point values in a dataset.

TGraphicField

TGraphicField represents a graphics field in a dataset.

TGuidField

TGuidField represents a guid field in a dataset.

TIDispatchField

TIDispatchField represents an IDispatch field in a dataset.

TIndexDef

TIndexDef describes an index in a database table.

TIndexDefs

TIndexDefs holds the list of available index definitions for a table.

TIntegerField

TIntegerField represents a signed 32-bit integer field in a dataset.

TInterfaceField

TInterFaceField represents an interface field in a dataset.

TLargeintField

A TLargeintField object represents a large integer field in a dataset.

TLookupList

TLookupList maintains a list of lookup values associated with a set of key field values.

TMasterDataLink

TMasterDataLink allows a dataset to establish a master/detail relationship.

TMemoField

TMemoField represents a memo field in a dataset.

TNamedItem

TNamedItem is the base class for definitions used by datasets.

TNumericField

TNumericField is the common ancestor of all the numeric fields in a dataset.

TObjectField

TObjectField is the common ancestor of TADTField, TArrayField, TDataSetField, and TReferenceField components in a dataset.

TParam

TParam represents a field parameter for a BDE-enabled query or stored procedure.

TParams

TParams manages a list of field parameters.

TReferenceField

A TReferenceField object represents a REF field in a dataset.

TSmallIntField

TSmallintField represents a signed 16-bit integer field in a dataset.

TStringField

TStringField represents a string field in a dataset.

TTimeField

TTimeField represents a time field in a dataset.

TVarBytesField

TVarBytesField represents a variable-length untyped binary field in a dataset.

TVariantField

TVariantField represents a variant field in a dataset.

TWideStringField

TWideStringField represents a large string field in a dataset.

TWordField

TWordField represents an unsigned 16-bit integer field in a dataset.


Dbcgrids unit

Other objects and components, by unit

TDBCtrlGrid

TDBCtrlGrid displays records from a data source in a free-form layout.

TDBCtrlGridLink

TDBCtrlGridLink helps manage data events for a TDBCtrlGrid object.

TDBCtrlPanel

TDBCtrlPanel represents a panel in a TDBCtrlGrid object.


Dbclient unit

Dbclient routines

Other objects and components, by unit

EDBClient

EDBClient is the exception class for client dataset errors.

EReconcileError

EReconcileError is the exception class for client dataset errors.

TAggregate

TAggregate represents a maintained aggregate in a client dataset.

TAggregates

TAggregates is a collection of TAggregate objects.

TClientBlobStream

TClientBlobStream lets applications read from or write to BLOB fields in a client dataset.

TClientDataSet

TClientDataSet implements a database-independent dataset.

TCustomRemoteServer

TCustomRemoteServer is the base class for all components that connect to an application server in a multi-tiered database application.


Dbctrls unit

Dbctrls routines

Other objects and components, by unit

TDBCheckBox

TDBCheckBox is a data aware control that allows the user to select or deselect a single value.

TDBComboBox

TDBComboBox represents a data-aware combo box control.

TDBEdit

TDBEdit represents a single-line edit control that can display and edit a field in a dataset.

TDBImage

TDBImage represents a graphic image from a BLOB (binary large object) field of the current record of a dataset.

TDBListBox

TDBListBox represents a data-aware list box that allows the user to change the value of the field of the current record in a dataset by selecting an item from a list.

TDBLookupComboBox

TDBLookupComboBox represents a combo box that identifies a set of field values in one dataset with a corresponding set of values from another dataset.

TDBLookupControl

TDBLookupControl is the base class for controls that provide the user with a list of lookup items for filling in fields that require data from another dataset.

TDBLookupListBox

TDBLookupListBox provides a list of lookup items for filling in fields that require data from another dataset.

TDBMemo

TDBMemo represents a multiline edit control that can display and edit a field in a dataset.

TDBNavigator

TDBNavigator (the database navigator) is used to move through the data in a dataset and perform operations on the data, such as inserting a blank record or posting a record.

TDBRadioGroup

TDBRadioGroup represents a group of radio buttons connected to a database.

TDBRichEdit

TDBRichEdit represents a multiline edit control that can display and edit a rich text memo field in a dataset.

TDBText

TDBText represents a data-aware control that displays the value of a field on a form.

TDataSourceLink

TDataSourceLink helps manage the link to the data source for a TDBLookupControl object.

TFieldDataLink

TFieldDataLink helps a data-aware windowed control manage its link to a TField object and respond to data events.

TListSourceLink

TListSourceLink helps manage the link to the ListSource of a TDBLookupControl object.

TNavDataLink

TNavDataLink helps manage the link to the dataset for a TDBNavigator object.

TPaintControl

TPaintControl draws data aware controls that are replicated in a data control grid.


Dbexcept unit

Other objects and components, by unit

TDBEngineErrorDlg

TDBEngineErrorDlg replaces the normal message box for EDBEngineError exceptions raised at design time.


Dbgrids unit

Other objects and components, by unit

TBookmarkList

TBookmarkList is a collection of bookmarks that identify a set of records in a dataset.

TColumn

TColumn represents a column in a data grid (TDBGrid).

TColumnTitle

TColumnTitle represents the title of a data-grid column (TColumn).

TCustomDBGrid

TCustomDBGrid is the abstract base class for grid controls that display the records from a dataset in a tabular format.

TDBGrid

TDBGrid displays and manipulates records from a dataset in a tabular grid.

TDBGridColumns

TDBGridColumns represents a container for TColumn objects.

TGridDataLink

TGridDataLink helps manage the link to a data source and maintain the field mapping for a TCustomDBGrid object.


Dblogdlg unit

Dblogdlg routines

Other objects and components, by unit

TLoginDialog

TLoginDialog is a login dialog box that can be used to provide login security within an application.


Dbolectl unit

Other objects and components, by unit

TDBOleControl

Supports simple data binding for ActiveX controls.

TDataBindItem

TDateBindItem represents a data binding in a data-aware ActiveX control.

TDataBindings

TDataBindings holds a group of TDataBindItem objects.


Dbpwdlg unit

Dbpwdlg routines

Other objects and components, by unit

TPasswordDialog

TPasswordDialog is a dialog box that allows the user to specify passwords for the current session.


Dbtables unit

Dbtables routines

Other objects and components, by unit

EDBEngineError

EDBEngineError is the exception class for Borland Database Engine errors.

ENoResultSet

ENoResultSet is the exception class for unsuccessful attempts to open a dataset query.

TBDECallback

TBDECallback is a wrapper for a Borland Database Engine (BDE) callback function.

TBDEDataSet

Encapsulates Borland Database Engine (BDE) functionality for descendant dataset objects.

TBatchMove

TBatchMove enables applications to perform database operations on groups of records or entire tables.

TBlobStream

TBlobStream is a stream object that provides services which allow applications to read from or write to field objects that represent Binary large object (BLOB) fields.

TDBDataSet

TDBDataSet encapsulates database connectivity for descendant dataset objects.

TDBError

TDBError represents Borland Database Engine errors for the EDBEngineError exception class.

TDataSetUpdateObject

TDataSetUpdateObject is the abstract base class for update objects used to update otherwise unupdateable queries or stored procedures in applications that cache updates.

TDatabase

TDatabase provides discrete control over a connection to a single database in a BDE-based database application.

TNestedTable

A nested table is a dataset component that encapsulates a database table that is nested as a field within another table.

TParamList

TParamList manages a list of session parameters.

TQuery

TQuery encapsulates a dataset with a result set that is based on an SQL statement.

TSQLUpdateObject

TSQLUpdateObject is the base class for classes that use an SQL command to apply cached updates on behalf of queries or stored procedures that can’t post updates directly.

TSession

TSession provides global management of a group of database connections within an application.

TSessionList

TSessionList provides management of Borland Database Engine (BDE) sessions within a database application.

TStoredProc

TStoredProc encapsulates a stored procedure on a database server.

TTable

TTable encapsulates a database table.

TUpdateSQL

TUpdateSQL applies cached updates on behalf of queries or stored procedures that can’t post updates directly.


Dbweb unit

Dbweb routines

Other objects and components, by unit

TDSTableProducer

TDSTableProducer is the abstract base class for objects that produce a set of HTML commands to display the records from a dataset in a tabular format.

TDSTableProducerEditor

TDSTableProducer is the base class for the helper object used by TDSTableProducer objects to communicate with a property editor at design time.

TDataSetTableProducer

TDataSetTableProducer assembles a sequence of HTML commands to display the records from a dataset in a tabular format.

THTMLTableColumn

THTMLTableColumn represents the display attributes and field binding of a column in the HTML representation of a dataset.

THTMLTableColumns

THTMLTableColumns is a collection of THTMLTableColumn objects that describe the display attributes and field bindings of the columns in an HTML representation of tabular data.

THTTPDataLink

THTTPDataLink helps TDSTableProducer manage its link to the data source.

TQueryTableProducer

TQueryTableProducer assembles a sequence of HTML commands to display the result set of a query in a tabular format.


Ddeman unit

Other objects and components, by unit

TDdeClientConv

TDdeClientConv represents a DDE conversation with a DDE server application.

TDdeClientItem

TDdeClientItem defines an item in a DDE conversation.

TDdeServerConv

TDdeServerConv represents a DDE topic of conversation with a DDE client.

TDdeServerItem

TDdeServerItem defines the item of a DDE conversation.


Dialogs unit

Dialogs routines

Other objects and components, by unit

TColorDialog

TColorDialog displays a modal color-selection dialog.

TCommonDialog

TCommonDialog is the ancestor of all components that represent Windows common dialog boxes.

TFindDialog

TFindDialog displays a Find dialog that allows users to search for text in a file.

TFontDialog

TFontDialog displays a font-selection dialog.

TOpenDialog

TOpenDialog displays a file-selection dialog.

TPrintDialog

TPrintDialog displays a Print dialog.

TPrinterSetupDialog

TPrinterSetupDialog displays a print-setup dialog for configuring printers.

TReplaceDialog

TReplaceDialog displays a search-and-replace dialog.

TSaveDialog

TSaveDialog displays a “Save As” dialog for saving files.


Dsgnintf unit

Dsgnintf routines

Other objects and components, by unit

IComponent

IComponent is the interface used by the IDE when working with components

IFormDesigner

IFormDesigner is an interface to the form designer in the IDE.

IPersistent

IPersistent is the interface used by the IDE when working with persistent objects

TComponentEditor

TComponentEditor is the base class for all component editors.

TDefaultEditor

TDefaultEditor is the component editor for components that do not explicitly register a component editor.

TDesignerSelectionList

TDesignerSelectionList maintains a list of persistent objects.

TPropertyCategory

Contains a list of property filters.

TPropertyCategoryList

Contains a list of property categories.

TPropertyEditor

TPropertyEditor is the base class for all property editors.

TPropertyFilter

Contains information about a single property filter.


Dsprod unit

Other objects and components, by unit

TCustomMidasPageProducer

TCustomMidasPageProducer is the base class for page producers that display live database information.

TDataSetPageProducer

TDataSetPageProducer produces a string of HTML commands based on an input template.

TMidasPageProducer

TMidasPageProducer assembles an HTML document that represents live database information from an application server.


Extctrls unit

Extctrls routines

Other objects and components, by unit

TBevel

TBevel represents a beveled outline.

TControlBar

TControlBar manages the layout of toolbar components.

TCustomControlBar

TCustomControlBar is the base class for control bar components.

TCustomPanel

TCustomPanel is the abstract base class for all panel components.

TCustomRadioGroup

TCustomRadioGroup is the base class for radio-group components.

THeader

THeader is a sectioned visual control that displays text and allows each section to be resized with the mouse.

TImage

TImage displays a graphical image.

TNotebook

TNotebook displays multiple pages, each with its own set of controls.

TPaintBox

TPaintBox is a simple graphic control that provides a canvas for applications to use for rendering an image.

TPanel

TPanel implements a generic panel control.

TRadioGroup

TRadioGroup represents a group of radio buttons that function together.

TShape

TShape represents a geometric shape that can be drawn on a form.

TSplitter

TSplitter divides the client area of a form into resizable panes.

TTimer

TTimer encapsulates the Windows API timer functions.


Extdlgs unit

Other objects and components, by unit

TOpenPictureDialog

TOpenPictureDialog displays a graphics-file selection dialog.

TSavePictureDialog

TSavePictureDialog displays a “Save As” dialog for saving graphics files.


Filectrl unit

Filectrl routines

Other objects and components, by unit

TDirectoryListBox

TDirectoryListBox represents a list box control that is aware of the directory structure of the current drive.

TDriveComboBox

TDriveComboBox implements a specialized combo box that displays all the drives available when the application runs.

TFileListBox

TFileListBox is a specialized list box that lists all the files in a specified directory.

TFilterComboBox

TFilterComboBox is a specialized combo box that presents the user with a choice of file filters.


Forms unit

Forms routines

Other objects and components, by unit

IDesigner

IDesigner is an interface that allows component writers to interact with the form designer in the IDE.

TApplication

TApplication is the type used for a Delphi Windows application.

TControlScrollBar

TControlScrollBar displays a horizontal or vertical scroll bar.

TCustomActiveForm

TCustomActiveForm is the base class for Active Forms.

TCustomDockForm

The default floating dock site class for TControl objects.

TCustomForm

TCustomForm is the abstract base class from which to derive a window such as a form or dialog.

TCustomFrame

TCustomFrame is the base class from which TFrame descends.

TDataModule

TDataModule centralizes the handling of nonvisual components in an application.

TForm

TForm is the component for a standard application window (form).

TFrame

TFrame is a container for components; it can be nested within forms or other frames.

TMonitor

TMonitor represents a monitor on which an application runs.

TScreen

TScreen represents the state of the screen in which an application runs.

TScrollBox

TScrollBox represents a scrolling area (a scroll box) in a window.

TScrollingWinControl

TScrollingWinControl is the base class for windowed controls that support scrolling.


Graphics unit

Graphics routines

Other objects and components, by unit

EInvalidGraphic

EInvalidGraphic is the exception class for unrecognized graphic files.

EInvalidGraphicOperation

EInvalidGraphicOperation is the exception class for illegal operations on graphics.

TBitmap

TBitmap is an encapsulation of a Windows bitmap (HBITMAP), including its palette (HPALETTE).

TBitmapImage

TBitmapImage is the internal representation of the bitmap image for a TBitmap object.

TBrush

TBrush represents the color and pattern used to fill solid shapes.

TCanvas

TCanvas provides an abstract drawing space for objects that must render their own images.

TFont

TFont encapsulates a windows logical font.

TGraphic

TGraphic is the abstract base class type for objects such as icons, bitmaps, and metafiles that can store and display visual images.

TGraphicsObject

TGraphicsObject is the abstract base class for objects which encapsulate a Windows graphics object: TBrush, TFont, and TPen.

TIcon

TIcon is an encapsulation of a Windows icon.

TIconImage

TIconImage is the internal representation of the bitmap image for a TIcon object.

TMetaFileCanvas

TMetafileCanvas allows applications to create metafile images from scratch.

TMetafile

TMetafile is an encapsulation of the Win32 Enhanced metafile.

TMetafileImage

TMetafileImage is the internal representation of the metafile image for a TMetafile object.

TPen

TPen is used to draw lines or outline shapes on a canvas.

TPicture

TPicture contains a bitmap, icon, metafile graphic, or user-defined graphic.

TSharedImage

TSharedImage is the abstract base class for classes that contain images used for graphics objects.


Grids unit

Other objects and components, by unit

EInvalidGridOperation

EInvalidGridOperation is the exception class for illegal grid operations.

TCustomGrid

TCustomGrid is the base type for all components that present information in a two-dimensional grid.

TDrawGrid

TDrawGrid represents a grid control that displays information in column and row format.

TInplaceEdit

TInPlaceEdit provides text editing capabilities for grid controls.

TStringGrid

TStringGrid represents a grid control designed to simplify the handling of strings and associated objects.

TStringGridStrings

TStringGridStrings maintains a list of the strings that appear in the cells of a string grid.


Httpapp unit

Httpapp routines

Other objects and components, by unit

TCookie

TCookie represents a Cookie header in an HTTP response message.

TCookieCollection

TCookieCollection is a collection of TCookie objects.

TCustomContentProducer

TCustomContentProducer is the base class for all objects that produce the string that is sent as the contents of an HTTP response message.

TCustomPageProducer

TCustomPageProducer is the base class for objects that produce a string of HTML commands based on an input template.

TCustomWebDispatcher

TCustomWebDispatcher is the abstract base class for Web dispatcher objects.

THTMLTableAttributes

THTMLTableAttributes represents the display attributes of an HTML table tag.

THTMLTableCellAttributes

THTMLTableCellAttributes represents the display attributes of an HTML table cell tag.

THTMLTableElementAttributes

THTMLTableElementAttributes is the common base class for objects that describe the display attributes of parts of an HTML table.

THTMLTableHeaderAttributes

THTMLTableHeaderAttributes represents the display attributes of the header tag in an HTML table.

THTMLTableRowAttributes

THTMLTableRowAttributes represents the display attributes of the row tag in an HTML table.

THTMLTagAttributes

THTMLTagAttributes is the base class for all objects that represent the attributes of an HTML tag.

TPageProducer

TPageProducer produces a string of HTML commands based on an input template.

TWebActionItem

TWebActionItem allows a Web server application to create and send responses to HTTP request messages.

TWebActionItems

TWebActionItems is a collection of TWebActionItem objects.

TWebDispatcher

TWebDispatcher passes HTTP request message on to the appropriate action items that assemble a response.

TWebModule

TWebModule is the automatically generated Web module for a Web server application.

TWebRequest

TWebRequest is the base class for all objects that represent client request information that is passed to a Web server application.

TWebResponse

TWebResponse is the base class for all objects that represent HTTP messages sent in response to an HTTP request message.


Imglist unit

Other objects and components, by unit

TCustomImageList

TCustomImageList is the abstract base class for collections of same-sized images, each of which can be referred to by its index.


Inifiles unit

Other objects and components, by unit

TCustomIniFile

TCustomIniFile is the abstract base type for components that encapsulate access to 16-bit Windows 3.x INI files or provide similar access to the system registry on 32-bit platforms.

TIniFile

TIniFile is a low-level wrapper for the 16-bit Windows 3.x INI file system that enables storage and retrieval of application-specific information and settings in an application-specific INI file.

TMemIniFile

TMemIniFile is a wrapper for the Windows INI file system that enables storage and retrieval of application-specific information and settings in an INI file.


Isapiapp unit

Isapiapp routines

Other objects and components, by unit

TISAPIApplication

TISAPIApplication encapsulates an ISAPI or NSAPI server application.

TISAPIRequest

TISAPIRequest represents client request information that is passed to a server application DLL.

TISAPIResponse

TISAPIResponse represents HTTP messages sent by an ISAPI application in response to an HTTP request message.


Jpeg unit

Other objects and components, by unit

TJPEGData

TJPEGData encapsulates the compressed file that contains the data source for the original compressed JPEG image used by a TJPEGImage object.

TJPEGImage

TJPEGImage encapsulates a JPEG graphic.


Mask unit

Mask routines

Other objects and components, by unit

EDBEditError

EDBEditError is the exception class for data that are incompatible with a specified mask.

TCustomMaskEdit

TCustomMaskEdit is the base type for edit controls that provide a mask for checking the validity of text typed into the control.

TMaskEdit

TMaskEdit implements a generic masked edit control.


Masks unit

Masks routines

Other objects and components, by unit

TMask

TMask allows the comparison of strings containing wildcards to a file mask.


Math unit

Math routines

Other objects and components, by unit

EInvalidArgument

EInvalidArgument is the exception class for out-of-range parameters in specialized math and accounting functions.


Mconnect unit

Other objects and components, by unit

TCOMConnection

TCOMConnection is the base class for components that connect to application servers using DCOM or OLE.

TCustomObjectBroker

TCustomObjectBroker is the abstract base class for components that locate available application servers for a connection component.

TDCOMConnection

TDCOMConnection handles a client application’s DCOM connection to the remote server in a in a multi-tiered application.

TDispatchConnection

TDispatchConnection is the base class for objects that connect client applications to a COM-based application server.

TOLEnterpriseConnection

TOLEnterpriseConnection is provided for backward compatibility with applications that connect to a MIDAS application server using OLEnterprise.


Menus unit

Menus routines

Other objects and components, by unit

EMenuError

EMenuError is the exception class for errors involving menu items.

TMainMenu

TMainMenu encapsulates a menu bar and its accompanying drop-down menus for a form.

TMenu

TMenu is the base type for menu components such as TMainMenu and TPopupMenu.

TMenuActionLink

TMenuActionLink menu item clients to the corresponding menu action.

TMenuItem

TMenuItem describes the properties of an item in a menu.

TPopupList

TPopupList manages the window that handles popup menu messages.

TPopupMenu

TPopupMenu encapsulates the properties, methods, and events of a pop-up menu.


Midas unit

Other objects and components, by unit

IAppServer

IAppServer is the interface that client datasets use to communicate with a provider component on an application server.


Midascon unit

Other objects and components, by unit

TMidasConnection

TMidasConnection handles a server connection for the client of a multi-tiered application.

TRemoteServer

TRemoteServer handles a remote server connection in a client application that is part of a multi-tiered application.


Miditems unit

Other objects and components, by unit

TApplyUpdatesButton

TApplyUpdatesButton generates an HTML control that sends an Update message to the XML broker on the MIDAS Web application.

TCaptionAttributes

TCaptionAttributes customizes the appearance of the label that identifies a display control in a MIDAS Web application.

TCustomDataGrid

TCustomDataGrid is the base class for Web items that generate an HTML table to display a dataset in an XML data packet.

TCustomDataNavigator

TCustomDataNavigator assembles the HTML generated by a set of TDataSetButton and TXMLButton descendants.

TCustomFieldGroup

TCustomFieldGroup is the base class for Web items that arrange information on an HTML form as a set of labeled fields.

TCustomLayoutGroup

TCustomLayoutGroup is the base class for Web items that arrange content produced by arbitrary Web items.

TCustomQueryButtons

TCustomQueryButtons assembles the HTML generated by a set of TQueryButton descendants.

TCustomQueryForm

TCustomQueryForm is the base class for Web items that generate HTML forms for letting users enter application-defined values.

TDataForm

TDataForm generates an HTML form that displays database information and lets users apply updates.

TDataGrid

TDataGrid generates an HTML table to display a dataset in an XML data packet.

TDataNavigator

TDataNavigator assembles the HTML generated by a set of TDataSetButton and TXMLButton descendants.

TDataSetButton

TDataSetButton is the base class for Web items that create HTML buttons for navigating or editing data.

TDeleteButton

TDeleteButton generates an HTML control that deletes a record from an XML data packet.

TFieldGroup

TFieldGroup arranges database information on an HTML form as a set of labeled fields.

TFieldRadioGroup

TFieldRadioGroup creates an HTML radio group control to represent a field in an XML data packet.

TFieldSelectOptions

TFieldSelectOptions creates an HTML list control to represent a field in an XML data packet.

TFieldStatus

TFieldStatus generates an HTML control that indicates whether a record in an XML data packet has been modified by the end user.

TFieldText

TFieldText creates a single-line HTML input control to represent a field in an XML data packet.

TFieldTextArea

TFieldTextArea creates a multi-line HTML input control to represent a field in an XML data packet.

TFirstButton

TFirstButton generates an HTML control that moves to the first record in an XML data packet.

TGridAttributes

TGridAttributes describes the options the TDataGrid component adds to an HTML <TABLE> tag.

TGridRowAttributes

TGridRowAttributes describes the options the TDataGrid component adds to its HTML row tags (<TR>).

TInsertButton

TInsertButton generates an HTML control that inserts a new record in an XML data packet.

TLastButton

TLastButton generates an HTML control that moves to the last record in an XML data packet.

TLayoutGroup

TLayoutGroup generates the HTML to arrange content produced by other Web items.

TNextButton

TNextButton generates an HTML control that moves to the next record in an XML data packet.

TNextPageButton

TNextPageButton generates an HTML control that moves to the next set of records in an XML data packet.

TPostButton

TPostButton generates an HTML control that posts changes to an XML delta packet.

TPriorButton

TPriorButton generates an HTML control that moves to the previous record in an XML data packet.

TPriorPageButton

TPriorPageButton generates an HTML control that moves to the previous set of records in an XML data packet.

TQueryButton

TQueryButton is the base class for Web items that create HTML buttons that manage application-defined values.

TQueryButtons

TQueryButtons assembles the HTML generated by a set of TQueryButton descendants.

TQueryFieldGroup

TQueryFieldGroup arranges information on an HTML form as a set of labeled fields.

TQueryForm

TQueryForm generates HTML forms for letting users enter application-defined values.

TQueryRadioGroup

TQueryRadioGroup creates an HTML radio group control to represent named parameter.

TQuerySelectOptions

TQuerySelectOptions creates an HTML list control to represent a named parameter.

TQueryText

TQueryText creates a single-line HTML input control to represent a named parameter.

TQueryTextArea

TQueryTextArea creates a multi-line HTML input control to represent named parameter.

TResetQueryButton

TResetQueryButton generates an HTML control that backs out changes to the values on a query form.

TSelectOptionsColumn

TSelectOptionsColumn creates an HTML list control to represent a field value in a data grid.

TStatusColumn

TStatusColumn generates an HTML control that indicates whether a record in a data grid has been modified by the end user.

TSubmitQueryButton

TSubmitQueryButton generates an HTML control that backs out changes to the values on a query form.

TTextAreaColumn

TTextAreaColumn creates a multi-line HTML input control to represent a field value in a data grid.

TTextColumn

TTextColumn creates a single-line HTML input control to represent a field value in a data grid.

TUndoButton

TUndoButton generates an HTML control that backs out changes to the current.

TWebButton

TWebButton is the base class for Web items that create HTML button controls.

TWebControlGroup

TWebControlGroup is the base class for Web items that arrange HTML controls.

TWebDataDisplay

TWebDataDisplay is the base class for Web items that create HTML display controls.

TWebDataInput

TWebDataInput is the base class for Web items that create HTML display controls for entering information.

TWebForm

TWebForm is the base class for Web items that create HTML forms.

TWebListInput

TWebListInput is the base class for Web items that create HTML display controls which present a fixed set of possible values.

TWebRadioGroupInput

TWebRadioGroupInput is the base class for Web items that create HTML radio group controls.

TWebSelectOptionsInput

TWebSelectOptionsInput is the base class for Web items that create HTML list controls.

TWebStatus

TWebStatus is the base class for Web items that indicate the status of records in an XML data packet.

TWebTextAreaInput

TWebTextAreaInput is the base class for Web items that create HTML multi-line text controls.

TWebTextInput

TWebTextInput is the base class for Web items that create HTML single-line text controls.

TXMLButton

TXMLButton is the base class for Web items that create HTML buttons that perform some action with the XML data packet.

TXMLDisplayGroup

TXMLDisplayGroup is the base class for Web items that arrange a set of special-purpose controls in an HTML form.

TXMLDisplayReferenceButton

TXMLDisplayReferenceButton is the base class for Web items that generate HTML buttons for influencing controls that display data.

TXMLDisplayReferenceGroup

TXMLDisplayReferenceGroup is the base class for Web items that arrange a set of button controls that influence a control that displays data.


Mplayer unit

Other objects and components, by unit

EMCIDeviceError

EMCIDeviceError is the exception class for devices that provide a Media Control Interface (MCI) driver.

TMediaPlayer

TMediaPlayer controls devices that provide a Media Control Interface (MCI) driver.


Mtsobj unit

Other objects and components, by unit

TMtsAutoObject

TMtsAutoObject encapsulates the objects and interfaces of the MTS application server.


Mtsrdm unit

Other objects and components, by unit

TMtsDataModule

TMtsDataModule encapsulates the objects and interfaces of an MTS application server.


Mxarrays unit

Other objects and components, by unit

EArrayError

EArrayError is the exception class for failures that occur when manipulating a descendant of TBaseArray.

ELowCapacityError

ELowCapacityError is the exception class for when an attempt is made to allocate more memory than is available for the decision cube.

EUnsupportedTypeError

EUnsupportedTypeError is the exception class for failures that occur when adding dimensions to the cache of a decision cube.

TBaseArray

TBaseArray is the base class for all arrays used by the decision cube components.

TSmallIntArray

TSmallIntArray is a dynamically resizeable array of 16-bit integers.

TValueArray

TValueArray is a dynamically resizeable array of 16-bit integers.


Mxcommon unit

Other objects and components, by unit

TDimensionItem

TDimensionItem is the base class for objects that represent dimensions and summaries in a crosstabulated data store.

TDimensionItems

TDimensionItems is the base class for objects that represent dimension maps.


Mxdb unit

Other objects and components, by unit

EDimIndexError

EDimIndexError is the exception class for when an invalid index is used to specify a dimension in a decision source.

EDimensionMapError

EDimensionMapError is the exception class for when the dataset of a decision cube does not have the proper format.

TDecisionCube

TDecisionCube maintains crosstabulated data that it provides to a TDecisionSource object.

TDecisionSource

TDecisionSource links a decision control to a configuration (pivot state) of the data from a decision cube.


Mxgraph unit

Other objects and components, by unit

TCustomDecisionGraph

TCustomDecisionGraph is the base class for controls that graph crosstabulated data.

TDecisionGraph

TDecisionGraph displays a graph of crosstabulated data.


Mxgrid unit

Other objects and components, by unit

TCustomDecisionGrid

TCustomDecisonGrid is the base class for controls that present crosstabulated data in a two-dimensional grid.

TDecisionGrid

TDecisionGrid presents crosstabulated data from a decision source in a grid format.

TDisplayDim

TDisplayDim represents a dimension in a decision grid.

TDisplayDims

TDisplayDims represents a collection of TDisplayDim objects.


Mxpivsrc unit

Other objects and components, by unit

TDecisionPivot

TDecisionPivot allows the user to control the pivot state of a decision source.


Mxstore unit

Other objects and components, by unit

ECacheError

ECacheError is the exception class for failures that occur when building the cache of a decision cube.

TCubeDim

TCubeDim represents an entry in the dimension map of a decision cube.

TCubeDims

TCubeDims is a collection of TCubeDim objects.

TCustomDataStore

TCustomDataStore is the base class for components that analyze and maintain crosstabulated data.


Mxtables unit

Other objects and components, by unit

TDecisionQuery


Objbrkr unit

Other objects and components, by unit

EBrokerException

EBrokerException is the exception raised by simple object brokers when they can’t locate an available server.

TServerCollection

TServerCollection is a collection of TServerItem objects.

TServerItem

TServerItem describes an application server for a simple object broker.

TSimpleObjectBroker

TSimpleObjectBroker maintains a list of available application servers for a connection component.


Olectnrs unit

Olectnrs routines

Other objects and components, by unit

TOleContainer

TOleContainer embeds or links OLE objects.

TOleForm

TOleForm is an object that provides OLE support for a TForm object.


Olectrls unit

Olectrls routines

Other objects and components, by unit

EOleCtrlError

EOleCtrlError is the exception class for ActiveX controls.

TEnumPropDesc

TEnumPropDesc provides the mapping between strings used to name the values of a property in an OLE control object and the values themselves.

TOleControl

TOleControl is the base class from which ActiveX controls are derived.


Oleserver unit

Other objects and components, by unit

TOleServer

TOleServer is the base class for components that represent an imported COM server.


Outline unit

Other objects and components, by unit

EOutlineError

EOutlineError is the exception class for outline components.

OutlineError

OutlineError is a special exception class for invalid outline-node indexes.

TCustomOutline

TCustomOutline is the base class for controls that display outline nodes (TOutlineNode objects).

TOutline

TOutline is a multilevel outline that displays the values of TOutlineNode objects.

TOutlineNode

TOutlineNode represents a node in a TCustomOutline object.


Pagitems unit

Other objects and components, by unit

TPageItemsProducer

TPageItemsProducer maintains a list of Web item components for producing a string of HTML commands based on an input template.


Printers unit

Printers routines

Other objects and components, by unit

EPrinter

EPrinter is the exception class for printing errors.

TPrinter

TPrinter encapsulates the Windows printer interface.


Provider unit

Other objects and components, by unit

EDSWriter

EDSWriter is the exception class for errors that occur when creating data packets to represent the data or metadata in a dataset.

TBaseProvider

TBaseProvider is a base class for all data providers.

TCustomProvider

TCustomProvider is the base class for data providers.

TCustomResolver

TCustomResolver is the base class for components that apply updates on behalf of a provider.

TDataSetProvider

TDataSetProvider provides data from and resolves data to a dataset or database.

TDataSetResolver

TDataSetResolver applies updates to a dataset on behalf of a provider.

TPacketDataSet

TPacketDataSet represents a data packet or delta packet in a multi-tiered application.

TProvider

TProvider provides data to and applies updates from a client dataset.

TSQLResolver

TSQLResolver applies updates to a database server on behalf of a provider.

TUpdateTree

TUpdateTree stores information about a delta packet on behalf of a resolver.


Registry unit

Other objects and components, by unit

ERegistryException

ERegistryException is the exception class for registry errors.

TRegIniFile

TRegIniFile is a low-level wrapper for the Windows 95/NT system registry.

TRegistry

TRegistry is a low-level wrapper for the system registry and functions that operate on the registry.

TRegistryIniFile

TRegistryIniFile is a wrapper for the Windows system registry.


Scktcomp unit

Scktcomp routines

Other objects and components, by unit

ESocketError

ESocketError is the exception class for failures that occur when trying to create, use, or shut down Windows socket objects.

TAbstractSocket

TAbstractSocket is the abstract base class for all socket components.

TClientSocket

TClientSocket manages socket connections for a TCP/IP client.

TClientWinSocket

TClientWinSocket describes the client endpoint of a Windows socket connection.

TCustomServerSocket

TCustomServerSocket is the base class for all server socket components.

TCustomSocket

TCustomSocket is an abstract base class for socket components.

TCustomWinSocket

TCustomWinSocket is the base class for all Windows socket objects.

TServerClientThread

TServerClientThread is an execution thread used for a single connection to a client socket accepted by a Windows server socket.

TServerClientWinSocket

TServerClientWinSocket describes the server endpoint of a socket connection to a client socket.

TServerSocket

TServerSocket manages server socket connections for a TCP/IP server.

TServerWinSocket

TServerWinSocket describes the endpoint of a listening server socket connection.

TWinSocketStream

TWinSocketStream is a stream that provides services which allow applications to read from or write to socket connections.


Sconnect unit

Other objects and components, by unit

EInterpreterError

EInterpreterError is the exception class for errors that arise when trying to interpret COM calls that have been marshaled to a data block.

ESocketConnectionError

ESocketConnectionError is the exception class for errors that arise when sending or receiving messages using TSocketConnection.

IDataBlock

IDataBlock is the interface used by TDataBlockInterpreter to access memory buffers.

IDataIntercept

IDataIntercept is the interface used by TSocketConnection components to transform data that is communicated over the socket connection.

ISendDataBlock

ISendDataBlock is the interface used by TDataBlockInterpreter to send messages to application server after they are marshaled.

ITransport

ITransport is the interface used by TStreamedConnection to connect to, read from, and write to a remote application server.

TDataBlockInterpreter

TDataBlockInterpreter marshals COM interface calls for non COM-based connection components.

TSocketConnection

TSocketConnection uses Windows sockets to manage the connection to an application server.

TStreamedConnection

TStreamedConnection is the base class for components that handle their own marshaling of interface calls when connecting to application servers.

TWebConnection

TWebConnection uses HTTP to manage the connection to an application server.


Shdocvw unit

Other objects and components, by unit

TWebBrowser

TWebBrowser provides access to the WebBrowser functionality of Microsoft’s Shell Doc Object and Control Library (SHDOCVW.DLL).


Stdctrls unit

Other objects and components, by unit

TButton

TButton is a push button control.

TButtonActionLink

TButtonActionLink is an action link designed specifically for button control clients.

TButtonControl

TButtonControl is the base class for objects that represent Windows button controls.

TCheckBox

TCheckBox represents a Windows check box.

TComboBox

TComboBox combines an edit box with a scrollable list.

TCustomCheckBox

TCustomCheckBox is the ancestor of all check-box components.

TCustomComboBox

TCustomComboBox is the base class for combo-box components.

TCustomEdit

TCustomEdit is the base class from which all edit-box and memo controls are derived.

TCustomGroupBox

TCustomGroupBox is the abstract base class for all group-box components.

TCustomLabel

TCustomLabel is the base class for non-windowed controls that display text on a form.

TCustomListBox

TCustomListBox is the base class for list-box objects that are wrappers for Windows list box controls.

TCustomMemo

TCustomMemo is the abstract base type for memo components, which are multiline edit boxes, including TMemo and TDBMemo.

TCustomStaticText

TCustomStaticText is the abstract base class for TStaticText.

TEdit

TEdit is a wrapper for a Windows single-line edit control.

TGroupBox

TGroupBox represents a Windows group box.

TLabel

TLabel is a nonwindowed control that displays text on a form. This text can be used to label another control, and can set focus to that control when the user types an accelerator key.

TListBox

TListBox is a wrapper for a Windows list box control.

TMemo

TMemo is a wrapper for a windows multiline edit control.

TRadioButton

TRadioButton is a wrapper for a Windows radio button.

TScrollBar

TScrollBar is a Windows scroll bar, which is used to scroll the contents of a window, form, or control.

TStaticText

TStaticText is a windowed control that displays text on a form.


Svcmgr unit

Svcmgr routines

Other objects and components, by unit

TDependencies

TDependencies is a container for TDependency objects.

TDependency

TDependency object represents a dependent service or load ordering group used by TService objects.

TService

TService encapsulates a Windows NT service.

TServiceApplication

TServiceApplication encapsulates a Windows NT service application.

TServiceThread

TServiceThread represents the thread associated with a specific service (TService object).


Syncobjs unit

Other objects and components, by unit

TCriticalSection

TCriticalSection allows a single thread in a multi-threaded application to temporarily block the execution of all other threads.

TEvent

TEvent is a wrapper for a Windows event.

THandleObject

THandleObject is the base class for all thread synchronization objects that use a handle.

TSimpleEvent

TSimpleEvent represents an unnamed manual event object.

TSynchroObject

TSynchroObject is the base class for all thread synchronization objects.


System unit

System routines

Other objects and components, by unit

TInterfacedObject

TInterfacedObject implements the IUnknown interface, and can be used as a base for simple COM-compatible classes that benefit from having the IUnknown methods implemented.

TObject

TObject is the ultimate ancestor for all VCL objects and components.


Sysutils unit

Sysutils routines

Other objects and components, by unit

EAbort

EAbort is the exception class for errors that should not display an error message dialog box.

EAbstractError

EAbstractError is the exception class for attempts to call an abstract method.

EAccessViolation

EAccessViolation is the exception class for invalid memory access errors.

EAssertionFailed

EAssertionFailed is the exception class for Assert procedures performed on Boolean expressions that return False.

EControlC

EControlC is the exception class for Ctrl+C key presses in console applications.

EConvertError

EConvertError is the exception class for string and object conversion errors.

EDivByZero

EDivByZero is the exception class for integer divide-by-zero errors.

EExternal

EExternal is the exception class that captures Windows exception records.

EExternalException

EExternalException is the exception class for invalid exception codes.

EHeapException

EHeapException is the exception class for errors related to heap-allocated memory.

EInOutError

EInOutError is the exception class for file input/output errors.

EIntError

EIntError is the base class for integer math error exceptions.

EIntOverflow

EIntOverflow is the exception class for integer calculations whose results are too large to fit in the allocated register.

EIntfCastError

EIntfCastError is the exception class for interface casting errors.

EInvalidCast

EInvalidCast is the exception class for typecasting errors.

EInvalidOp

EInvalidOp is the exception class for undefined floating-point operations.

EInvalidPointer

EInvalidPointer is the exception class for invalid pointer operations.

EMathError

EMathError is the exception class for floating-point math errors.

EOutOfMemory

EOutOfMemory is the exception class for unsuccessful attempts to allocate memory.

EOverflow

EOverflow is the exception class for floating-point register overflows.

EPackageError

EPackageError is the exception class for package-related errors.

EPrivilege

EPrivilege is the exception class for processor privilege violations.

EPropReadOnly

EPropReadOnly is the exception class for invalid attempts to write to a property using OLE automation.

EPropWriteOnly

EPropWriteOnly is the exception class for invalid attempts to read a property using OLE automation.

ERangeError

ERangeError is the exception class for integer values that are too large for the declared type to which they are assigned.

EStackOverflow

EStackOverflow is the exception class for stack overflows.

EUnderflow

EUnderflow is the exception class for values that are too small to be represented with a floating-point variable.

EVariantError

EVariantError is the exception class for errors involving variant data types.

EWin32Error

EWin32Error is the exception class for Windows errors.

EZeroDivide

EZeroDivide is the exception class for floating-point divide-by-zero errors.

Exception

Exception is the base class for all runtime exceptions.

TLanguages

TLanguages lists all available Windows locales.

TMultiReadExclusiveWriteSynchronizer

TMultiReadExclusiveWriteSynchronizer protects memory in a multi-threaded application.


Tabnotbk unit

Other objects and components, by unit

TTabPage

TTabPage implements an individual tab page of a tabbed notebook control.

TTabbedNotebook

TTabbedNotebook contains multiple pages, each with its own set of controls.


Tabs unit

Other objects and components, by unit

TScroller

TScroller is a horizontal scrolling control that provides basic horizontal scrolling capabilities.

TTabSet

The TTabSet component presents horizontal tabs users can click to initiate actions.


Toolwin unit

Other objects and components, by unit

TToolDockForm

A default floating dock site class for tool buttons.

TToolDockObject

Handles drag-and-dock operations for toolbar controls.

TToolWindow

TToolWindow is the abstract ancestor for windowed controls that require a custom client area and edge borders.


Typinfo unit

Other objects and components, by unit

EPropertyConvertError

EPropertyConvertError is the exception class for type errors when attempting to get or set the value of a property.

EPropertyError

EPropertyError is the exception class for unsuccessful attempts to set the value of a property.


Vclcom unit

Other objects and components, by unit

TComponentFactory

TComponentFactory is the class factory for creating instances of Delphi components that support interfaces.


Webbroker unit

Webbroker routines

Other objects and components, by unit

TWebApplication

TWebApplication encapsulates a Web server application.


Webcomp unit

Other objects and components, by unit

IWebComponent

IWebComponent is the interface supported by components that TWebComponentList manages.

IWebContent

IWebContent is an interface that allows components page producers and Web items to access the HTML generated by other components.

TLayoutAttributes

TLayoutAttributes describes how an HTML control should be laid out.

TWebComponentList

TWebComponentList maintains a list of Web item components.

TWebContentOptions

TWebContentOptions controls what a Web item can include in its generated HTML.


Xmlbroker unit

Other objects and components, by unit

TWebDispatch

TWebDispatch describes the HTTP messages to which an auto-dispatching component responds.


Xmlbrokr unit

Other objects and components, by unit

TXMLBroker

TXMLBroker fetches XML data packets from an application server and applies XML updates to the application server.

TXMLParams

TXMLParams manages a list of parameters for an XML broker.


Action support

Other routines, by category

Other routines, by unit

CreateAction function

Creates an action, of the specified type, which is displayed in the action list editor.

EnumRegisteredActions procedure

Iterates through the list of registered actions passing them to a user-defined callback.

RegisterActions procedure

Registers action classes so that they appear as a selection option in the action list editor.

UnRegisterActions procedure

Unregisters a set of actions.


Application-level information

Other routines, by category

Other routines, by unit

Application variable (for standard applications)

Represents application-level information.

CmdShow variable

CmdShow is passed to the Windows ShowWindow WinAPI routine.

HInstance variable

Indicates the handle provided by Windows for an application or library.

HintWindowClass variable

Specifies the class for the window used to display help hints.

IsConsole variable

Indicates whether the module was compiled as a console application.

IsLibrary variable

Indicates whether the module is a DLL.

JITEnable variable

Controls when the just-in-time debugger is called.

Languages function

Lists the locales for which support is available.

MainInstance variable

The Instance handle for the main executable.

MainThreadID variable

The Instance handle for the current modules main thread of execution.

NoErrMsg variable

Controls whether the application displays an error message when a runtime error occurs.

PopupList variable

Provides centralized handling of Windows messages directed at popup menus.

Screen variable

Represents a screen device.

Win32Platform variable

Specifies the Win32 platform identifier.


Arithmetic routines

Other routines, by category

Other routines, by unit

Abs function

Returns an absolute value.

Ceil function

Rounds variables up toward positive infinity.

Exp function

Returns the exponential of X.

Floor function

Rounds variables toward negative infinity.

Frac function

Returns the fractional part of a real number.

Frexp procedure

Separates the Mantissa and Exponent of X

Int function

Returns the integer part of a real number.

IntPower function

Calculates the integral power of a base value.

Ldexp function

Calculates X * (2**P)

Ln function

Returns the natural log of a real expression.

LnXP1 function

Returns the natural log of (X+1)

Log10 function

Calculates log base 10.

Log2 function

Calculates log base 2.

LogN function

Calculates log base N.

Max function

Returns the greater of two numeric values.

Min function

Returns the lesser of two numeric values.

Pi function

Returns 3.1415926535897932385.

Poly function

Evaluates a uniform polynomial of one variable at the value X.

Power function

Raises Base to any power.

Round function

Returns the value of X rounded to the nearest whole number.

Sqr function

Returns the square of a number.

Sqrt function

Returns the square root of X.

Trunc function

Truncates a real number to an integer.


Backward compatibility routines

Other routines, by category

Other routines, by unit

AddExitProc procedure

Provided for backward compatibility only.

AppendStr procedure

Appends a dynamically allocated string to an existing string.

AssignStr procedure

Assigns a new dynamically allocated string to a specified pointer.

Close procedure

Terminates the association between a file variable and an external file (Pascal).

DisposeStr procedure

Disposes of a string pointer that was allocated using NewStr.

ExitCode variable

Contains the application's exit code.  (provided for backward compatibility)

LoadStr function

Loads a string from the application's executable file.

NewStr function

Allocates a string on the heap.

StrAlloc function

Allocates a buffer for a null-terminated string and returns a pointer to its first character.

StrBufSize function

Returns the maximum number of characters that can be stored in a buffer allocated by StrAlloc.

StrDispose procedure

Disposes of a string.

StrNew function

Allocates space on and copies a string to the heap; returning a pointer to the string.

StrPas function

Converts null-terminated string to a Pascal string.

Swap function

Exchanges high order byte with the low order byte of an integer or word.


Bde support routines

Other routines, by category

Other routines, by unit

AnsiToNative function

Converts a string from the ANSI character set to the character set associated with a given locale.

AnsiToNativeBuf procedure

Converts a string from the ANSI character set to the character set associated with a given locale.

Check procedure

Determines whether a value returned from the Borland Database Engine (BDE) represents an error condition.

DBIError procedure

Creates and raises an EDBEngineError exception for an error code returned by the Borland Database Engine (BDE).

GetFieldProperty function

Returns a TField object for a dataset and data control.

NativeCompareStr function

Compares strings based on a database locale case sensitively.

NativeCompareStrBuf function

Compares null-terminated strings based on a database locale case sensitively.

NativeCompareText function

Compares strings based on a database locale without case sensitivity.

NativeCompareTextBuf function

Compares null-terminated strings based on a database locale and is not case sensitive.

NativeToAnsi function

Converts a string from the character set of the given locale to the ANSI character set.

NativeToAnsiBuf procedure

Converts a string from the character set of a specified locale into the ANSI character set.

PasswordDialog function

Displays a dialog box that prompts the user for the password of a local password-protected table.

Session variable

Maintains database components used by an application.

Sessions variable

Provides access to TSessionList methods and properties.


Bidimode support routines

Other routines, by category

Other routines, by unit

DBUseRightToLeftAlignment function

Indicates whether a data-aware control’s alignment is reversed to a right-to-left mode.


Business and finance routines

Other routines, by category

Other routines, by unit

DoubleDecliningBalance function

Calculates the depreciation of an asset using the double-declining balance method.

FutureValue function

Calculates the future value of an investment.

InterestPayment function

Calculates the interest portion of a loan payment.

InterestRate function

Returns the interest rate required to increase PresentValue to FutureValue.

InternalRateOfReturn function

Calculates the internal rate of return for an investment.

NetPresentValue function

Calculates the current value from an array of estimated cash flow values.

NumberOfPeriods function

Returns the number of payment periods for an investment.

Payment function

Calculates a fully amortized payment.

PeriodPayment function

Returns the principal amount from a full payment.

PresentValue function

Calculates the present value of an investment.

SLNDepreciation function

Returns the straight-line depreciation allowance of an asset.

SYDDepreciation function

Calculates depreciation for an asset.


Clipboard routines

Other routines, by category

Other routines, by unit

Clipboard function

Returns an instance of TClipboard.

SetClipboard function

Replaces the single global clipboard instance with another clipboard object.


Com utilities

Other routines, by category

Other routines, by unit

ClassIDToProgID function

Returns the programmatic ID for a specified class given its class ID (CLSID).

CoInitFlags variable

Specifies the level of threading support requested for a COM server .EXE.

ComClassManager function

Returns a TComClassManager object.

ComServer variable

Provides class and registry information about server objects.

CreateClassID function

CreateClassID generates a new GUID and returns it as a string.

CreateComObject function

Instantiates a single instance of a COM object.

CreateOleObject function

Instantiates a single instance of an Automation object.

CreateRegKey procedure

Creates or opens a registry key that is a subkey of HKEY_CLASSES_ROOT.

CreateRemoteComObject function

Creates a Com object on another machine and returns an IUnknown interface for it.

CreateSharedPropertyGroup function

Returns the interface for a SharedPropertyGroup that allows MTS objects within a server process to share state.

CreateSharedPropertyGroupManager function

Returns an interface for a new shared property group manager that creates and coordinates shared properties of MTS objects.

CreateTransactionContext function

Starts an MTS transaction.

CreateTransactionContextEx function

Instantiates a TransactionContextEx object, which marks the beginning of a transaction.

DLLCanUnloadNow function

Tells Windows whether it can unload the in-process server exporting this function.

DeleteRegKey procedure

Deletes a single key that is a subkey of HKEY_CLASSES_ROOT from the system registry.

DllGetClassObject function

Obtains a class factory for an ActiveX object when the ActiveX object resides in an in-process ActiveX server (DLL).

DllRegisterServer function

Registers an in-process ActiveX server in the current module within the system registry.

DllUnregisterServer function

Unregisters an OLE automation server in the current module with the system registry.

EmptyParam variable

Specifies that an optional parameter on a dual interface is not used.

EnumDispatchProperties procedure

Fills a TStringList will all the property names and DispIDs in a specified IDispatch interface.

FontToOleFont function

Returns a Variant containing an IFontDispatch interface that represents a TFont object.

GUIDToString function

Converts a class identifier GUID to a string.

GetActiveOleObject function

Retrieves a reference to an IDispatch interface to a currently running, registered COM object.

GetDispatchPropValue function

Returns the value of a property on an IDispatch interface.

GetOleFont procedure

Creates an OLE font object that is directly mapped to a native TFont.

GetOlePicture procedure

Creates an OLE picture object that is directly mapped to a native TPicture.

GetOleStrings procedure

Implements a TStrings object as an IStrings interface for use by OLE objects.

GetRegStringValue function

Retrieves a value stored under a subkey of HKEY_CLASSES_ROOT from the system registry.

InterfaceConnect procedure

Connects an IConnectionPoint interface.

InterfaceDisconnect procedure

Disconnects an IConnectionPoint interface connection that was previously made by the InterfaceConnect procedure.

OleCheck procedure

Throws an EOleSysError exception if the result code indicates an error.

OleError procedure

Raises an EOleSysError exception.

OleFontToFont procedure

Fills in a TFont structure to represent an IFontDispatch.

OleStrToStrVar procedure

Copies a string from its COM representation to an existing Pascal string.

OleStrToString function

Copies data received from a COM interface to a string.

ParkingWindow function

Provides a temporary parent window for activeX controls when the container is not ready to act as a parent.

ProgIDToClassID function

Returns the class ID (CLSID) TGUID that corresponds to the string specified as the ProgID parameter.

RegisterAsService procedure

Registers a COM object as an NT service.

RegisterComServer procedure

Registers an in-process COM server with the operating system.

SafeRef function

Returns a reference to an MTS object that is safe to pass outside its context.

SetDispatchPropValue procedure

Sets the value of a property on an IDispatch interface.

SetOleFont procedure

Connects an OLE font object to a TFont object and copies the properties of the OLE font object to the TFont.

SetOlePicture procedure

Connects an OLE picture object to a TPicture object, and copies the properties of the OLE picture object to the TPicture.

SetOleStrings procedure

Uses an IStrings interface to assign the contents of a TStrings object.

StringToGUID function

Converts a string to a GUID.

StringToOleStr function

Allocates memory and copies a string to the OLE format.

Supports function

Indicates whether a given object or IUnknown interface supports a specified interface.


Command line utilities

Other routines, by category

Other routines, by unit

CmdLine variable

CmdLine is a pointer to the command-line arguments specified when the application is invoked.

FindCmdLineSwitch function

Determines whether a string was passed as a command line argument to the application.

ParamCount function

Returns the number of parameters passed on the command line.

ParamStr function

Returns a specified parameter from the command-line.


Component registration routines

Other routines, by category

Other routines, by unit

RegisterComponents procedure

Registers a set of components so that they all appear on the same page of the component palette.

RegisterFields procedure

Registers a set of field components so that they appear in the Dataset designer.

RegisterNoIcon procedure

Registers a set of components but does not add them to the component palette.

RegisterNonActiveX procedure

Prevents a set of components from being made available to the ActiveX wizard.


Control panel applications

Other routines, by category

Other routines, by unit

Application variable (for control panel applets)

Represents the application for a control panel applet project.


Cursor management routines

Other routines, by category

Other routines, by unit

CursorToIdent function

Returns the name of the predefined constant that corresponds to a cursor.

CursorToString function

Returns the AnsiString representation of a cursor.

GetCursorValues procedure

Passes the name of every predefined cursor constant to a callback.

IdentToCursor function

Translates a predefined cursor constant into a cursor.

StringToCursor function

Returns a TCursor value given its string representation.


Data dictionary routines

Other routines, by category

Other routines, by unit

AssociateAttr procedure

Sets up an association between an attribute ID and a field ID.

CreateField function

Creates a new field from information stored in the Data Dictionary.

DictionaryActive function

Indicates whether there is an active Data Dictionary.

DictionaryDeactivate procedure

Deactivates the Data Dictionary.

FindAttrID function

Returns the ID of a specified attribute set.

FindDatabaseID function

Returns the ID of a specified database.

FindFieldID function

Returns the ID of a specified field.

FindTableID function

Returns the ID of a specified table.

GetAttrID function

Returns the ID of the attribute set associated with a field.

GetAttrName function

Returns the name of an attribute set given its ID.

GetAttrNames procedure

Executes a callback for every attribute set name.

GetControlClass function

Returns the class associated with an attribute set.

HasConstraints function

Indicates whether there are any data constraints for a dataset stored in the Data Dictionary.

IsNullID function

Indicates whether a Data Dictionary Identifier is null.

NewAttr function

Creates an attribute set based on the properties of a field component.

QualifyTableName function

Returns the fully qualified name of a table in the Data Dictionary.

QualifyTableNameByName function

Returns the fully qualified name of a table in the Data Dictionary.

UnassociateAttr procedure

Removes the association between an attribute ID and a field ID.

UpdateAttr procedure

Updates an attribute set to match the properties of a field component.

UpdateConstraints procedure

Replaces all imported constraints for a dataset with the current constraints in the Data Dictionary.

UpdateDataset procedure

Updates a dataset and all its field components to match the Data Dictionary.

UpdateField procedure

Updates a field component to match the associated attribute set in the Data Dictionary.


Date/time routines

Other routines, by category

Other routines, by unit

Date function

Returns the current date.

DateDelta constant

Specifies the correction factor when computing the difference between two date and time types that do not begin in the same year.

DateTimeToFileDate function

Converts a TDateTime object to a DOS date-and-time value.

DateTimeToStr function

Converts a TDateTime value to a string.

DateTimeToString procedure

Converts a TDateTime value to a string using a specified Format.

DateTimeToSystemTime procedure

Converts a TDateTime value into the Win32 API's TSystemTime type.

DateTimeToTimeStamp function

Converts a TDateTime value into the corresponding TTimeStamp value.

DateToStr function

Converts a TDateTime value to a string.

DayOfWeek function

Returns the day of the week for a specified date.

DecodeDate procedure

Returns Year, Month, and Day values for a TDateTime value.

DecodeTime procedure

Breaks a TDateTime value into hours, minutes, seconds, and milliseconds.

EncodeDate function

Returns a TDateTime value that represents a specified Year, Month, and Day.

EncodeTime function

Returns a TDateTime value for a specified Hour, Min, Sec, and MSec.

FormatDateTime function

Formats a TDateTime value.

IncMonth function

Returns a date shifted by a specified number of months.

IsLeapYear function

Indicates whether a specified year is a leap year.

MSecsPerDay constant

Specifies the number of milliseconds per day.

MSecsToTimeStamp function

Converts a specified number of milliseconds into a TTimeStamp value.

Now function

Returns the current date and time.

ReplaceDate procedure

Replaces the date portion of a TDateTime value with a specified date.

ReplaceTime procedure

Replaces the time portion of a TDateTime value with a specified time.

SecsPerDay constant

Indicates the number of seconds per day.

StrToDate function

Converts a string to a TDateTime value.

StrToDateTime function

Converts a string to a TDateTime value.

StrToTime function

Converts a string to a TDateTime value.

SystemTimeToDateTime function

Converts a TSystemTime value into a TDateTime value.

Time function

Returns the current time.

TimeStampToDateTime function

Converts a TTimeStamp value into the corresponding TDateTime value.

TimeStampToMSecs function

Converts a TTimeStamp value into an absolute number of milliseconds.

TimeToStr function

Returns a string that represents a TDateTime value.


Design tool registration routines

Other routines, by category

Other routines, by unit

RegisterComponentEditor procedure

Registers an editor so that it is available at design time.

RegisterLibraryExpert procedure

Registers an expert so that it is installed when a package is installed.

RegisterPropertyEditor procedure

Allows a component to bring up a custom property editor from the Object Inspector.


Dialog and message routines

Other routines, by category

Other routines, by unit

CreateMessageDialog function

Creates a specified message dialog.

ForceCurrentDirectory variable

Indicates whether open and save dialogs should display the current directory if no initial directory is assigned.

InputBox function

Displays an input dialog box that enables the user to enter a string.

InputQuery function

Displays an input dialog that enables the user to enter a string.

LoginDialog function

Brings up the database Login dialog to allow the user to connect to a database server.

LoginDialogEx function

Brings up the database Login dialog to allow the user to connect to a database server.

MessageDlg function

Displays a message dialog box in the center of the screen.

MessageDlgPos function

Displays a message dialog box at the specified screen coordinates.

MessageDlgPosHelp function

Displays a message dialog box whose help is supplied in a named help file.

SelectDirectory function

Brings up a dialog to allow the user to enter a directory name.

ShowMessage procedure

Displays a message box with an OK button.

ShowMessageFmt procedure

Displays a message box with a formatted message.


Drag and drop routines

Other routines, by category

Other routines, by unit

CancelDrag procedure

Cancels a drag-and-drop or drag-and-dock operation that is in progress.

FindDragTarget function

Returns the control at a specified screen coordinate.

IsDragObject function

Indicates whether a specified object is a TDragObject descendant.


Dynamic allocation routines

Other routines, by category

Other routines, by unit

Dispose procedure

Releases memory allocated for a dynamic variable.

Finalize procedure

Uninitializes a dynamically allocated variable.

FreeMem procedure

Disposes of a dynamic variable of a given size.

GetMem procedure

Creates a dynamic variable and a pointer to the address of the block.

Initialize procedure

Initializes a dynamically allocated variable.

New procedure

Creates a new dynamic variable and sets P to point to it.


Exception handling routines

Other routines, by category

Other routines, by unit

DatabaseError procedure

Creates and raises an EDatabaseError exception.

DatabaseErrorFmt procedure

Creates and raises an EDatabaseError exception with a formatted error message.

ErrorAddr variable

Contains the address of a statement causing a runtime error.

ErrorProc variable

Points to the RTL run-time error handler.

ExceptAddr function

Returns the address at which the current exception was raised.

ExceptObject function

Returns a reference to the object associated with the current exception.

ExceptProc variable

Points to the lowest-level RTL exception handler.

ExceptionErrorMessage function

Formats a standard error message.

OutOfMemoryError procedure

Raises an EOutOfMemory exception.

RaiseLastWin32Error procedure

Raises an exception for the last occurring Win32 error.

SetErrorProc function

Replaces the exception handler for error messages that are received from a Windows socket connection.

ShowException procedure

Displays an exception message with its physical address

SysErrorMessage function

Converts Win32 API error codes into strings.

Win32Check function

Checks the return value of a Windows API call and raises an appropriate exception when it indicates failure.


File management routines

Other routines, by category

Other routines, by unit

AssignFile procedure

Associates the name of an external file with a file variable.

ChDir procedure

Changes the current directory.

CloseFile procedure

Terminates the association between file variable and an external disk file (Delphi).

CreateDir function

Creates a new directory.

DeleteFile function

Deletes a file from disk.

DirectoryExists function

Determines whether a specified directory exists.

DiskFree function

Returns the number of free bytes on a specified drive.

DiskSize function

Returns the size, in bytes, of a specified drive.

File mode constants

File mode constants are used to open and close disk files.

File open mode constants

File open mode constants are used to control the access mode to a file or stream.

FileClose procedure

Closes a specified file.

FileDateToDateTime function

Converts a DOS date-time value to TDateTime value.

FileExists function

Tests if a specified file exists.

FileGetAttr function

Returns the file attributes of FileName.

FileGetDate function

Returns a DOS date-time stamp for a specified file.

FileOpen function

Opens a specified file using a specified access mode.

FileRead function

Reads a specified number of bytes from a file.

FileSearch function

Searches a specified DOS path for a file.

FileSeek function

Positions the current file pointer in a previously opened file.

FileSetAttr function

Sets the file attributes of a specified file.

FileSetDate function

Sets the DOS time stamp for a specified file.

FileWrite function

Writes the contents of a buffer to the current position in a file.

FindClose procedure

Releases memory allocated by FindFirst.

FindFirst function

Searches for the first instance of a file name with a given set of attributes in a specified directory.

FindNext function

Returns the next entry matching the name and attributes specified in a previous call to FindFirst.

ForceDirectories function

Creates all the directories along a directory path if they do not already exist.

GetCurrentDir function

Returns the name of the current directory.

GetDir procedure

Returns the current directory for a specified drive.

RemoveDir function

Deletes an existing empty directory.

RenameFile function

Changes a file name.

SetCurrentDir function

Sets the current directory.


File name utilities

Other routines, by category

Other routines, by unit

ChangeFileExt function

Changes the extension of a file name.

ExcludeTrailingBackslash function

Returns a path name after removing any '

t the end.

ExpandFileName function

Returns the full path name for a relative file name.

ExpandUNCFileName function

Returns the full path of a file name with the network drive portion in UNC format.

ExtractFileDir function

Extracts the drive and directory parts from FileName.

ExtractFileDrive function

Returns the drive portion of a file name.

ExtractFileExt function

Returns the extension portions of a file name.

ExtractFileName function

Extracts the name and extension parts of a file name.

ExtractFilePath function

Returns the drive and directory portions of a file name.

ExtractRelativePath function

Returns a relative path name, relative to a specific base directory.

ExtractShortPathName function

Converts a file name to the short 8.3 form.

IncludeTrailingBackslash function

Returns a path name after adding a '_o the end if it is not already there.

IsPathDelimiter function

Indicates whether the byte at position Index of a string is the backslash character.

MatchesMask function

Indicates whether a file name conforms to the format specified by a filter string.

ProcessPath procedure

Parses a file name into its constituent parts.


Floating point conversion routines

Other routines, by category

Other routines, by unit

FloatToDecimal procedure

Converts a floating-point value to a decimal representation.

FloatToStr function

Converts a floating point value to a string.

FloatToStrF function

Converts a floating point value to a string, using a specified Format, Precision, and Digits.

FloatToText function

Converts a floating-point value to an unterminated character string, using a specified Format, Precision and Digits.

FloatToTextFmt function

Converts a floating-point value to to an unterminated character string, using a specified format.

FormatFloat function

Formats a floating point value.

StrToCurr function

Converts a string to a Currency value.

StrToFloat function

Converts a given string to a floating-point value.

TextToFloat function

Returns a floating-point value from a null-terminated string.


Flow control routines

Other routines, by category

Other routines, by unit

Abort procedure

Ends the current process without reporting an error.

Break procedure

Causes the flow of control to exit a for, while, or repeat statement.

Continue procedure

Allows the flow of control to proceed to the next iteration of for, while, or repeat statements.

Exit procedure

Exits from the current procedure.

Halt procedure

Initiates abnormal termination of a program.

RunError procedure

Stops execution and generates a run-time error.


Graphics utilities

Other routines, by category

Other routines, by unit

CharsetToIdent function

Obtains the name of a character set.

ColorToIdent function

Provides the symbolic name of a TColor value.

ColorToRGB function

Converts a TColor value into an RGB representation of the color.

ColorToString function

Returns a string that represents the name of a TColor value.

CopyPalette function

Creates a new palette object that matches an existing palette.

CreateGrayMappedBmp function

Remaps the standard gray colors in a bitmap with the system grays.

CreateGrayMappedRes function

Remaps the standard gray colors in a bitmap resource with the system grays.

CreateMappedBmp function

Changes the color table in a bitmap.

CreateMappedRes function

Changes the color table in a bitmap resource.

DDBsOnly variable

Determines whether bitmap handles are created as device-dependent bitmaps (DDB).

Frame3D procedure

Draws a three dimensional frame on a canvas.

GetCharSetValues procedure

Passes the name of every predefined character set string to a callback function.

GetColorValues procedure

Passes the name of every predefined color constant to a callback function.

GetDIB function

Returns the info header and image for a device independent bitmap.

GetDIBSizes procedure

Returns the size of the info header and of the image for a device independent bitmap.

GetDefFontCharset function

Returns the character set of the default system font.

GraphicExtension function

Returns the default file-name extension of a graphics object.

GraphicFileMask function

Returns a file mask that specifies the valid extensions for a graphic class.

GraphicFilter function

Returns a file filter compatible with the Filter property of an Open or Save dialog.

IdentToCharset function

Translates the name of a character set constant to the corresponding character set.

IdentToColor function

Translates the name of a color constant to the corresponding TColor value.

MoveWindowOrg procedure

Changes the location of the point (0,0) within a device context.

StringToColor function

Translates a string representation of a color to the corresponding TColor value.

SystemPalette16 variable

Contains the 16 VGA system colors.


Help hint routines

Other routines, by category

Other routines, by unit

GetLongHint function

Returns the second part of a two-part hint string.

GetShortHint function

Returns the first part of a two-part hint string.


Http utilities

Other routines, by category

Other routines, by unit

Application variable (for Web server applications)

Represents a web server application for an internet project.

ExtractHTTPFields procedure

Parses a multi-valued string into its constituent fields.

GetExtensionVersion function

Returns the name and version number of an ISAPI or NSAPI application.

HTTPDecode function

Decodes a string that includes HTTP escape characters.

HTTPEncode function

Converts a string into a form that contains no values that are illegal in an HTTP message header.

HTTPExtensionProc function

Receives an HTTP request message for an ISAPI or NSAPI application.

ParseDate function

Converts a date value from an HTTP message header into a TDateTime value.

StatusString function

Returns the explanatory string associated with one of the predefined HTTP response status codes.

UnixPathToDosPath function

Converts a Unix-compatible path specification to a Dos-compatible path specification.


I/o routines

Other routines, by category

Other routines, by unit

Append procedure

Prepares an existing file for adding text to the end.

BlockRead procedure

Reads one or more records from an open file into a variable.

BlockWrite procedure

Writes one or more records from a variable to an open file.

Eof function

Tests whether the file position is at the end of a file.

FileMode variable

Indicates the access mode on typed and untyped files opened by the Reset class.

FilePos function

Returns the current file position.

FileSize function

Returns the size of a file in bytes or the number of records in a record file.

IOResult function

Returns the status of the last I/O operation performed.

Input variable

Specifies a read-only file associated with an operating system's standard input device.

MkDir procedure

Creates a new subdirectory.

Output variable

Specifies a write-only file associated with standard output, usually the display.

Rename procedure

Changes the name of an external file.

Reset procedure

Opens an existing file.

Rewrite procedure

Creates a new file and opens it.

RmDir procedure

Deletes an empty subdirectory.

Seek procedure

Moves the current position of a file to a specified component.

Truncate procedure

Deletes all the records after the current file position.

Write procedure (for typed files)

Writes to a typed file.


Mbcs utilities

Other routines, by category

Other routines, by unit

AnsiCompareFileName function

Compares file names based on the current locale.

AnsiLastChar function

Returns a pointer to the last character in a string.

AnsiLowerCaseFileName function

Converts a file name to lower case.

AnsiStrLastChar function

Returns a pointer to the last character in a null-terminated string.

AnsiUpperCaseFileName function

Converts a file name to upper case.

ByteToCharIndex function

Returns the position of the character that contains a specified byte in a string.

ByteToCharLen function

Returns the number of characters fully contained in the first MaxLen bytes of a string.

ByteType function

Indicates whether a byte in a string is a single byte character, the first byte of a double byte character, or the second byte of a double byte character.

CharToByteIndex function

Returns the 1-based index of the first byte of a specified character in a string.

CharToByteLen function

Returns the length, in bytes, of the first MaxLen characters of a string.

LeadBytes variable

Lists all Char values that can be the first byte of a double byte character on the local system.

StrByteType function

Indicates whether a byte in a string is a single byte character, the first byte of a double byte character, or the second byte of a double byte character.


Measurement conversion routines

Other routines, by category

Other routines, by unit

CycleToRad function

Converts an angle measurement from cycles to radians.

DegToRad function

Returns the value of a degree measurement expressed in radians.

GradToRad function

Converts grad measurements to radians.

RadToCycle function

Converts radians to cycles.

RadToDeg function

Converts radians to degrees.

RadToGrad function

Converts radians to grads.


Memory management routines

Other routines, by category

Other routines, by unit

AllocMem function

Allocates a memory block and initializes each byte to zero.

AllocMemCount variable

Represents the total number of allocated memory blocks in an application.

AllocMemSize variable

Represents the total size of allocated memory blocks.

GetHeapStatus function

Returns the current status of the memory manager.

GetMemoryManager procedure

Returns the entry points of the currently installed memory manager.

HeapAllocFlags variable

Flags that indicate how the memory manager obtains memory from the operating system.

IsMemoryManagerSet function

Indicates whether the memory manager has been overridden using the SetMemoryManager procedure.

ReallocMem procedure

Reallocates a dynamic variable.

SetMemoryManager procedure

Sets entry points of the memory manager.

SysFreeMem function

Frees the memory pointed to by a specified pointer.

SysGetMem function

Allocates a specified number of bytes and returns a pointer to them.

SysReallocMem function

Returns a pointer to a specified number of bytes, preserving the values pointed to by the Pointer parameter.


Menu support routines

Other routines, by category

Other routines, by unit

AnsiSameCaption function

Indicates whether two strings are the same based on the current Windows locale, ignoring case information and accelerator characters.

NewItem function

Creates and initializes a menu item.

NewLine function

Creates a menu item for a separator.

NewMenu function

Creates and initializes a main menu.

NewPopupMenu function

Creates and initializes a popup menu.

NewSubMenu function

Creates and initializes a menu item that represents a submenu.

ShortCut function

Creates a menu shortcut for a specified key combination.

ShortCutToKey procedure

Returns the virtual key code and shift state of a menu shortcut.

ShortCutToText function

Converts a menu shortcut into a string that describes the shortcut.

StripHotKey function

Removes the accelerator character marker from a string.

TextToShortCut function

Creates a menu shortcut from a text AnsiString.

ValidHotkeys variable

Determines what accelerator keys can be automatically assigned to a menu item caption.


Midas utilities

Other routines, by category

Other routines, by unit

DisableSocketTransport procedure

Unregisters a remote data module so clients can’t access it using a Socket connection.

DisableWebTransport procedure

Unregisters a remote data module so clients can’t access it using a Web connection.

EnableSocketTransport procedure

Registers a remote data module so clients can access it using a Socket connection.

EnableWebTransport procedure

Registers a remote data module so clients can access it using a Web connection.

PackageParams function

Converts a TParams object into an OleVariant that can be used in MIDAS applications.

RegisterPooled procedure

Registers a remote data module so that instances are pooled.

UnpackParams procedure

Converts an OleVariant that represents a set of parameters into a TParams object.

UnregisterPooled procedure

Removes the object pooling registry entries for a remote data module.


Miscellaneous routines

Other routines, by category

Other routines, by unit

Assert procedure

Tests whether a boolean expression is successful.

Assigned function

Tests for a nil (unassigned) pointer or procedural variable.

Beep procedure

Generates a standard beep using the computer speaker.

Chr function

Returns the character for a specified ASCII value.

CollectionsEqual function

Compares the contents of two collections.

CompareMem function

Performs a binary comparison of two memory images.

DLLProc variable

Points to a procedure invoked by a DLL entry point.

Default8087CW variable

Specifies the Default 8087 control word.

FillChar procedure

Fills contiguous bytes with a specified value.

FormatMaskText function

Returns a string formatted using an edit mask.

FreeAndNil procedure

Frees an object reference and replaces the reference with nil..

Hi function

Returns the high-order byte of X as an unsigned value.

High function

Returns the highest value in the range of an argument.

HtmlTable function

Generates the HTML image of a dataset, using the properties and events of a table producer object.

IsAccel function

Indicates whether a particular character is an accelerator character (or hot key) within a given menu caption or other text string.

IsValidIdent function

Tests for a valid Pascal identifier.

Lo function

Returns the low order Byte of argument X.

Low function

Returns the lowest value in a range.

MaxInt constant

The maximum value of the Integer data type.

MaxLongint constant

The maximum value of the Longint data type.

Move procedure

Copies bytes from a source to a destination.

Printer function

Returns a global instance of TPrinter to manage interaction with the printer.

Set8087CW procedure

Sets both the control word in the floating point unit and the variable NoErrMsg declared in the system unit.

SizeOf function

Returns the number of bytes occupied by a variable or type.

Slice function

Returns a sub-section of an array.

UniqueString procedure

Ensures that a given string has a reference count of one.

UpCase function

Converts a character to uppercase.

ValidParentForm function

Returns the form or property page that contains a specified control.


Mouse handling utilities

Other routines, by category

Other routines, by unit

FindVCLWindow function

Returns the windowed control, if any, at the specified location.

GetCaptureControl function

Returns the control, if any, that currently receives all mouse messages.

Mouse variable

Contains information about the system’s mouse.

SetCaptureControl procedure

Causes the specified control to receive all mouse messages.


Numeric formatting routines

Other routines, by category

Other routines, by unit

CurrToStr function

Formats a Currency value as a string.

CurrToStrF function

Converts a Currency value to a string, using a specified format.

DoubleToComp function

Converts a Double value to a Comp.

FormatCurr function

Formats a Currency object.

IntToHex function

Returns the hex representation of an integer.

IntToStr function

Converts an integer to a string.


Ordinal routines

Other routines, by category

Other routines, by unit

Dec procedure

Decrements a variable by 1 or N.

Inc procedure

Increments an ordinal value by one or N.

Odd function

Returns True if argument is an odd number.

Ord function

Returns the ordinal value of an ordinal-type expression.

Pred function

Returns the predecessor of the argument.

Succ function

Returns the successor of an argument.


Package support routines

Other routines, by category

Other routines, by unit

CurrentGroup variable

Keeps track of which objects are associated with which packages.

EnumModules procedure

Executes a callback for all the modules in an application.

EnumResourceModules procedure

Executes a callback for all resource modules in an application.

FinalizePackage procedure

Finalizes the specified package .BPL.

GetPackageDescription function

Returns the description resource from a package.

GetPackageInfo procedure

Enumerates all the units and required packages for a package.

InitializePackage procedure

Validates and initializes a given package.

LibModuleList variable

Lists module records for enumeration procedures.

LoadPackage function

Loads a specified package.

SafeLoadLibrary function

Loads a DLL while suppressing error dialogs and preventing the DLL from changing the FPU control word.

UnloadPackage procedure

Unloads a package.


Pointer and address routines

Other routines, by category

Other routines, by unit

Addr function

Returns a pointer to a specified object.

Ptr function

Converts a specified address to a pointer.


Property category routines

Other routines, by category

Other routines, by unit

IsPropertyInCategory function

Indicates whether a property is in a specific property category.

PropertyCategoryList function

Returns a reference to a TPropertyCategoryList.

RegisterPropertiesInCategory function

Registers multiple properties in a specific property category.

RegisterPropertyInCategory function

Registers a single property in a specific property category.


Random number routines

Other routines, by category

Other routines, by unit

RandG function

Generates random numbers with Gaussian distribution.

RandSeed variable

RandSeed stores the built-in random number generator's seed.

Random function

Generates random numbers within a specified range.

Randomize procedure

Initializes the random number generator with a random value.


Service applications

Other routines, by category

Other routines, by unit

Application variable (for service applications)

Represents a service application for a service project.


Set handling routines

Other routines, by category

Other routines, by unit

Exclude procedure

Removes an element from a set.

Include procedure

Adds an element to a set.


Statistical routines

Other routines, by category

Other routines, by unit

MaxIntValue function

Returns the largest signed value in an integer array.

MaxValue function

Returns the largest signed value in an array.

Mean function

Returns the average of all values in an array.

MeanAndStdDev procedure

Calculates the mean and standard deviation of array elements.

MinIntValue function

Returns the smallest signed value in an integer array.

MinValue function

Returns smallest signed value in an array.

MomentSkewKurtosis procedure

Calculates the mean, variance, skew, and kurtosis.

Norm function

Returns the Euclidean 'L-2' norm.

PopnStdDev function

Calculates the population standard deviation.

PopnVariance function

Calculates the population variance.

StdDev function

Returns the sample standard deviation for elements in an array.

Sum function

Returns the sum of the elements in an array.

SumInt function

Returns the sum of the elements in an integer array.

SumOfSquares function

Returns the sum of the squared values from a data array.

SumsAndSquares procedure

Returns the sum of the values and the sum of the squared values in an array.

TotalVariance function

Returns the statistical variance from an array of values.

Variance function

Calculates statistical sample variance from an array of data.


Streaming utilities

Other routines, by category

Other routines, by unit

FindClass function

Finds and returns a class that is derived from TPersistent.

FindClassHInstance function

Returns the instance handle for the module in which a class type is defined.

FindGlobalComponent variable

Returns a top-level container component.

FindHInstance function

Returns the instance handle of the module that contains a specified address.

FindResourceHInstance function

Returns the instance handle of the resource module associated with a specified HINSTANCE.

GetClass function

Returns a registered persistent class given its name.

ObjectBinaryToText procedure

Converts the binary representation of an object into more readily understandable text.

ObjectResourceToText procedure

Converts the binary representation of an object resource into more readily understandable text.

ObjectTextToBinary procedure

Converts a symbolic text representation of an object into the binary version that is used to save the object to files or memory streams.

ObjectTextToResource procedure

Converts a symbolic text representation of an object into an internal binary representation.

ReadComponentRes function

Reads components and their properties from a specified Windows resource.

ReadComponentResEx function

Reads a component from a resource.

ReadComponentResFile function

Reads components and their properties from a specified Windows resource file.

RegisterClass procedure

Registers a class of persistent object so that it’s class type can be retrieved.

RegisterClassAlias procedure

Registers a class that is identical to another class except for the name.

RegisterClasses procedure

Registers a set of classes.

RegisterIntegerConsts procedure

Registers conversion functions for string identifiers that represent type values.

TypeInfo function

Returns a pointer to compiler generated run-time type information for a type identifier.

UnregisterClass procedure

Unregisters an object class.

UnregisterClasses procedure

Unregisters a set of classes.

UnregisterModuleClasses procedure

Unregisters all classes defined in a specified module.

WriteComponentResFile procedure

Writes components and their properties to a file using a Windows resource file format.


String formatting routines

Other routines, by category

Other routines, by unit

FmtLoadStr function

Returns formatted output using a resourced format string.

FmtStr procedure

Assembles a formatted string using a format string and an array of arguments.

Format function

Returns a formatted string assembled from a format string and an array of arguments.

Format strings

FormatBuf function

Formats the arguments from an array, placing the result in a buffer.

GetFormatSettings procedure

Resets the date and number format parameters to default values.

StrFmt function

Formats entries in an array.

StrLFmt function

Formats a series of arguments from a specified open array into a buffer.


String handling routines (null-terminated)

Other routines, by category

Other routines, by unit

AnsiStrComp function

Compares null-terminated character strings case sensitively.

AnsiStrIComp function

Compares null terminated character strings case insensitively.

AnsiStrLComp function

Compares the first MaxLen bytes of two null-terminated strings, case-sensitively.

AnsiStrLIComp function

Compares two strings, case-insensitively, up to the first MaxLen bytes.

AnsiStrLower function

Converts all characters in a null-terminated string to lower case.

AnsiStrPos function

Returns a pointer to the first occurrence of SubStr in Str.

AnsiStrRScan function

Returns a pointer to the last occurrence of a specified character in a specified string.

AnsiStrScan function

Returns a pointer to first occurrence of a character in a string.

AnsiStrUpper function

Converts all characters in a null-terminated string to upper case.

LineStart function

Finds the end of the last whole line in a buffer.

StrCat function

Appends a copy of Source to the end of Dest and returns the concatenated string.

StrComp function

Compares two strings case sensitively.

StrCopy function

Copies Source to Dest and returns Dest.

StrECopy function

Copies Source to Dest and returns a pointer to the null character ending the destination string.

StrEnd function

Returns a pointer to the end of a null terminated string.

StrIComp function

Compares two strings without case sensitivity.

StrLCat function

Appends up to a specified maximum number of characters to string.

StrLComp function

Compares up to a specified maximum number of characters in two strings.

StrLCopy function

Copies up to a specified maximum number of characters from Source to Dest.

StrLIComp function

Compares strings up to a specified maximum number of characters, without case sensitivity.

StrLen function

Returns number of characters in a string excluding the null terminator.

StrLower function

Converts a string to lowercase.

StrMove function

Copies specified number of characters to string.

StrPCopy function

Copies a Pascal string to a null-terminated string.

StrPLCopy function

Copies characters from a Pascal-style string into a null-terminated string.

StrPos function

Returns a pointer to the first occurrence of STR2 in STR1.

StrRScan function

Returns a pointer to the last occurrence of a specified character in a string.

StrScan function

Returns a pointer to first occurrence of a specified character in a string.

StrUpper function

Returns a string in upper case.


String handling routines

Other routines, by category

Other routines, by unit

AdjustLineBreaks function

Standardizes line break characters to CR/LF.

AnsiCompareStr function

Compares strings based on the current Windows locale with case sensitivity.

AnsiCompareText function

Compares strings based on the current Windows locale without case sensitivity.

AnsiExtractQuotedStr function

Converts a quoted string into an unquoted string.

AnsiLowerCase function

Returns a string that is a copy of the given string converted to lower case.

AnsiPos function

Locates the position of a sub-string within a string.

AnsiQuotedStr function

Returns the quoted version of a string.

AnsiSameStr function

Compares strings based on the current Windows locale with case sensitivity.

AnsiSameText function

Compares strings based on the current Windows locale without case sensitivity.

AnsiUpperCase function

Converts a string to upper case.

CompareStr function

Compares two strings case sensitively.

CompareText function

Compares two strings by ordinal value without case sensitivity.

Concat function

Concatenates two or more strings into one.

Copy function

Returns a substring of a string or a segment of a dynamic array.

Delete procedure

Removes a substring from a s string.

Insert procedure

Inserts a substring into a string beginning at a specified point.

IsDelimiter function

Indicates whether a specified character in a string matches one of a set of delimiters.

LastDelimiter function

Returns the byte index in S of the last character that matches any character in the Delimiters AnsiString.

Length function

Returns the number of characters in a string or elements in an array.

LowerCase function

Converts an ASCII string to lowercase.

NullStr constant

Declares a pointer to EmptyStr.

Pos function

Returns the index value of the first character in a specified substring that occurs in a given string.

QuotedStr function

Returns the quoted version of a string.

SetLength procedure

Sets the length of a string or dynamic-array variable.

SetString procedure

Sets the contents and length of the given string.

Str procedure

Formats a string and returns it to a variable.

StringOfChar function

Returns a string with a specified number of repeating characters.

StringReplace function

Returns a string with occurrences of one substring replaced by another substring.

Trim function

Trims leading and trailing spaces and control characters from a string.

TrimLeft function

Trims leading spaces and control characters from a string.

TrimRight function

Trims trailing spaces and control characters from a string.

UpperCase function

Returns a copy of a string in uppercase.

Val procedure

Converts a string to a numeric representation.

WrapText function

Splits a string into multiple lines as its length approaches a specified size.


Termination procedure support

Other routines, by category

Other routines, by unit

AddTerminateProc procedure

Adds a terminate procedure to the system list of termination procedures.

CallTerminateProcs function

Calls all of the functions in the termination procedure list.

ExitProc variable

Points to a program's exit procedure.


Text file routines

Other routines, by category

Other routines, by unit

AssignPrn procedure

Assigns a text-file variable to the printer.

Eoln function

Tests whether the file pointer is at the end of a line.

Erase procedure

Deletes an external file.

Flush procedure

Empties the buffer of a text file opened for output.

Read procedure

Read reads data from a file.

Readln procedure

Reads a line of text from a file.

SeekEof function

Returns the end-of-file status of a file.

SeekEoln function

Returns the end-of-line status of a file.

SetTextBuf procedure

Assigns an I/O buffer to a text file.

Write procedure (for text files)

Writes to a text file.

Writeln procedure

Writes an end-of-line marker to a text file.


Thread management routines

Other routines, by category

Other routines, by unit

BeginThread function

Spawns a separate thread of execution.

EndThread function

Terminates the execution of a thread.

IsMultiThread variable

Indicates whether the application spawned additional threads using BeginThread or TThread objects.


Trigonometry routines

Other routines, by category

Other routines, by unit

ArcCos function

Calculates the inverse cosine of a given number.

ArcCosh function

Calculates the inverse hyperbolic cosine of a given number.

ArcSin function

Calculates the inverse sine of a given number.

ArcSinh function

Calculates the inverse hyperbolic sine of a given number.

ArcTan function

Calculates the arctangent of a given number.

ArcTan2 function

Calculates the arctangent angle and quadrant of a given number.

ArcTanh function

Calculates the inverse hyperbolic tangent of a given number.

Cos function

Calculates the cosine of an angle.

Cosh function

Calculates the hyperbolic cosine of an angle.

Cotan function

Calculates the cotangent of an angle.

Hypot function

Calculates the length of the hypotenuse.

Sin function

Returns the sine of the angle in radians.

SinCos procedure

Returns sine and cosine of an angle.

Sinh function

Returns the hyperbolic sine of an angle.

Tan function

Returns the tangent of X.

Tanh function

Returns the hyperbolic tangent of X.


Type conversion routines

Other routines, by category

Other routines, by unit

BCDToCurr function

Converts a binary coded decimal value (BCD) to the corresponding Currency value.

Bounds function

Returns the TRect for a rectangle of given dimensions.

CompToCurrency function

Converts a Comp value to a Currency value.

CompToDouble function

Converts a Comp value to a Double value.

CurrToBCD function

Converts a Currency value to the corresponding binary coded decimal (BCD) value.

CurrencyToComp procedure

Converts a Currency value to a Comp value.

Point function

Creates a TPoint structure from a pair of coordinates.

Rect function

Creates a TRect structure from a set of coordinates.

StrToInt function

Converts a string that represents an integer (decimal or hex notation) to a number.

StrToInt64 function

Converts a string that represents an integer (decimal or hex notation) to a number.

StrToInt64Def function

Converts a string that represents an integer (decimal or hex notation) to a number.

StrToIntDef function

Converts a string that represents an integer (decimal or hex notation) to a number.


Variant support routines

Other routines, by category

Other routines, by unit

Null variable

Null represents the null Variant.

Unassigned constant

Used for a Variant variable not yet assigned a value.

VarArrayCreate function

Creates a Variant array.

VarArrayDimCount function

Returns number of dimensions of a Variant array.

VarArrayHighBound function

Returns high bound for a dimension in a Variant array.

VarArrayLock function

Locks a Variant array and returns a pointer to the data.

VarArrayLowBound function

Returns the low bound of a dimension in a Variant array.

VarArrayOf function

Creates and fills a one-dimensional Variant array.

VarArrayRedim procedure

VarArrayRedim resizes a Variant array.

VarArrayRef function

Returns a reference to the specified Variant array.

VarArrayUnlock procedure

Unlocks a Variant array.

VarAsType function

Converts a Variant to specified type.

VarCast procedure

Converts a Variant to a specified type, storing the result in a variable.

VarClear procedure

Empties a Variant, so that it is unassigned.

VarCopy procedure

Copies a Variant.

VarFromDateTime function

Returns a Variant containing a specified data and time.

VarIsArray function

Indicates whether the specified Variant is an array.

VarIsEmpty function

Indicates whether the specified Variant is unassigned.

VarIsNull function

Indicates whether the specified Variant is Null.

VarToDateTime function

Converts a specified Variant to a TDateTime value.

VarToStr function

Converts a Variant to a string.

VarType function

Returns the type code of a specified Variant.

VarTypeToDataType function

Returns the field type value that most closely corresponds to a Variant type.


Wide character routines

Other routines, by category

Other routines, by unit

StringToWideChar function

Returns a UNICODE string from a Pascal string.

WideCharLenToStrVar procedure

WideCharLenToStrVar converts Unicode characters to single or multi byte character data.

WideCharLenToString function

Converts Unicode characters to single or multi byte character data.

WideCharToStrVar procedure

Converts Unicode string to a single or multi byte character data.

WideCharToString function

Converts null-terminated Unicode string to single or multi byte character data.


Windows controls utilities

Other routines, by category

Other routines, by unit

CheckToolMenuDropdown procedure

Displays a tool button’s dropdown menu.

DestroyMetaPict procedure

Frees a metafile resource given its handle.

FindControl function

Returns the windowed control whose window is identified by the specified window handle.

GetComCtlVersion function

Indicates which version of ComCtl32.dll is installed.

GetParentForm function

Returns the form or property page that contains a specified control.

InitCommonControl function

Wraps the API routine, InitCommonControlsEx, which registers common control classes from ComCtl32.dll.


Actnlist routines

Actnlist objects/components

Other routines, by unit

CreateAction function

Creates an action, of the specified type, which is displayed in the action list editor.

EnumRegisteredActions procedure

Iterates through the list of registered actions passing them to a user-defined callback.

RegisterActions procedure

Registers action classes so that they appear as a selection option in the action list editor.

UnRegisterActions procedure

Unregisters a set of actions.


Axctrls routines

Axctrls objects/components

Other routines, by unit

EnumDispatchProperties procedure

Fills a TStringList will all the property names and DispIDs in a specified IDispatch interface.

GetDispatchPropValue function

Returns the value of a property on an IDispatch interface.

GetOleFont procedure

Creates an OLE font object that is directly mapped to a native TFont.

GetOlePicture procedure

Creates an OLE picture object that is directly mapped to a native TPicture.

GetOleStrings procedure

Implements a TStrings object as an IStrings interface for use by OLE objects.

ParkingWindow function

Provides a temporary parent window for activeX controls when the container is not ready to act as a parent.

SetDispatchPropValue procedure

Sets the value of a property on an IDispatch interface.

SetOleFont procedure

Connects an OLE font object to a TFont object and copies the properties of the OLE font object to the TFont.

SetOlePicture procedure

Connects an OLE picture object to a TPicture object, and copies the properties of the OLE picture object to the TPicture.

SetOleStrings procedure

Uses an IStrings interface to assign the contents of a TStrings object.


Classes routines

Classes objects/components

Other routines, by unit

Bounds function

Returns the TRect for a rectangle of given dimensions.

CollectionsEqual function

Compares the contents of two collections.

CurrentGroup variable

Keeps track of which objects are associated with which packages.

FindClass function

Finds and returns a class that is derived from TPersistent.

FindGlobalComponent variable

Returns a top-level container component.

GetClass function

Returns a registered persistent class given its name.

LineStart function

Finds the end of the last whole line in a buffer.

ObjectBinaryToText procedure

Converts the binary representation of an object into more readily understandable text.

ObjectResourceToText procedure

Converts the binary representation of an object resource into more readily understandable text.

ObjectTextToBinary procedure

Converts a symbolic text representation of an object into the binary version that is used to save the object to files or memory streams.

ObjectTextToResource procedure

Converts a symbolic text representation of an object into an internal binary representation.

Point function

Creates a TPoint structure from a pair of coordinates.

ReadComponentRes function

Reads components and their properties from a specified Windows resource.

ReadComponentResEx function

Reads a component from a resource.

ReadComponentResFile function

Reads components and their properties from a specified Windows resource file.

Rect function

Creates a TRect structure from a set of coordinates.

RegisterClass procedure

Registers a class of persistent object so that it’s class type can be retrieved.

RegisterClassAlias procedure

Registers a class that is identical to another class except for the name.

RegisterClasses procedure

Registers a set of classes.

RegisterComponents procedure

Registers a set of components so that they all appear on the same page of the component palette.

RegisterIntegerConsts procedure

Registers conversion functions for string identifiers that represent type values.

RegisterNoIcon procedure

Registers a set of components but does not add them to the component palette.

RegisterNonActiveX procedure

Prevents a set of components from being made available to the ActiveX wizard.

UnregisterClass procedure

Unregisters an object class.

UnregisterClasses procedure

Unregisters a set of classes.

UnregisterModuleClasses procedure

Unregisters all classes defined in a specified module.

WriteComponentResFile procedure

Writes components and their properties to a file using a Windows resource file format.


Clipbrd routines

Clipbrd objects/components

Other routines, by unit

Clipboard function

Returns an instance of TClipboard.

SetClipboard function

Replaces the single global clipboard instance with another clipboard object.


Comctrls routines

Comctrls objects/components

Other routines, by unit

CheckToolMenuDropdown procedure

Displays a tool button’s dropdown menu.

GetComCtlVersion function

Indicates which version of ComCtl32.dll is installed.

InitCommonControl function

Wraps the API routine, InitCommonControlsEx, which registers common control classes from ComCtl32.dll.


Comobj routines

Comobj objects/components

Other routines, by unit

ClassIDToProgID function

Returns the programmatic ID for a specified class given its class ID (CLSID).

CoInitFlags variable

Specifies the level of threading support requested for a COM server .EXE.

ComClassManager function

Returns a TComClassManager object.

CreateClassID function

CreateClassID generates a new GUID and returns it as a string.

CreateComObject function

Instantiates a single instance of a COM object.

CreateOleObject function

Instantiates a single instance of an Automation object.

CreateRegKey procedure

Creates or opens a registry key that is a subkey of HKEY_CLASSES_ROOT.

CreateRemoteComObject function

Creates a Com object on another machine and returns an IUnknown interface for it.

DeleteRegKey procedure

Deletes a single key that is a subkey of HKEY_CLASSES_ROOT from the system registry.

GUIDToString function

Converts a class identifier GUID to a string.

GetActiveOleObject function

Retrieves a reference to an IDispatch interface to a currently running, registered COM object.

GetRegStringValue function

Retrieves a value stored under a subkey of HKEY_CLASSES_ROOT from the system registry.

InterfaceConnect procedure

Connects an IConnectionPoint interface.

InterfaceDisconnect procedure

Disconnects an IConnectionPoint interface connection that was previously made by the InterfaceConnect procedure.

OleCheck procedure

Throws an EOleSysError exception if the result code indicates an error.

OleError procedure

Raises an EOleSysError exception.

ProgIDToClassID function

Returns the class ID (CLSID) TGUID that corresponds to the string specified as the ProgID parameter.

RegisterAsService procedure

Registers a COM object as an NT service.

RegisterComServer procedure

Registers an in-process COM server with the operating system.

StringToGUID function

Converts a string to a GUID.


Comserv routines

Comserv objects/components

Other routines, by unit

ComServer variable

Provides class and registry information about server objects.

DLLCanUnloadNow function

Tells Windows whether it can unload the in-process server exporting this function.

DllGetClassObject function

Obtains a class factory for an ActiveX object when the ActiveX object resides in an in-process ActiveX server (DLL).

DllRegisterServer function

Registers an in-process ActiveX server in the current module within the system registry.

DllUnregisterServer function

Unregisters an OLE automation server in the current module with the system registry.


Controls routines

Controls objects/components

Other routines, by unit

CancelDrag procedure

Cancels a drag-and-drop or drag-and-dock operation that is in progress.

CursorToIdent function

Returns the name of the predefined constant that corresponds to a cursor.

CursorToString function

Returns the AnsiString representation of a cursor.

FindControl function

Returns the windowed control whose window is identified by the specified window handle.

FindDragTarget function

Returns the control at a specified screen coordinate.

FindVCLWindow function

Returns the windowed control, if any, at the specified location.

GetCaptureControl function

Returns the control, if any, that currently receives all mouse messages.

GetCursorValues procedure

Passes the name of every predefined cursor constant to a callback.

GetLongHint function

Returns the second part of a two-part hint string.

GetShortHint function

Returns the first part of a two-part hint string.

IdentToCursor function

Translates a predefined cursor constant into a cursor.

IsDragObject function

Indicates whether a specified object is a TDragObject descendant.

Mouse variable

Contains information about the system’s mouse.

MoveWindowOrg procedure

Changes the location of the point (0,0) within a device context.

SetCaptureControl procedure

Causes the specified control to receive all mouse messages.

StringToCursor function

Returns a TCursor value given its string representation.


Ctlpanel routines

Ctlpanel objects/components

Other routines, by unit

Application variable (for control panel applets)

Represents the application for a control panel applet project.


Databkr routines

Databkr objects/components

Other routines, by unit

DisableSocketTransport procedure

Unregisters a remote data module so clients can’t access it using a Socket connection.

DisableWebTransport procedure

Unregisters a remote data module so clients can’t access it using a Web connection.

EnableSocketTransport procedure

Registers a remote data module so clients can access it using a Socket connection.

EnableWebTransport procedure

Registers a remote data module so clients can access it using a Web connection.

RegisterPooled procedure

Registers a remote data module so that instances are pooled.

UnregisterPooled procedure

Removes the object pooling registry entries for a remote data module.


Db routines

Db objects/components

Other routines, by unit

BCDToCurr function

Converts a binary coded decimal value (BCD) to the corresponding Currency value.

DatabaseError procedure

Creates and raises an EDatabaseError exception.

DatabaseErrorFmt procedure

Creates and raises an EDatabaseError exception with a formatted error message.

GetFieldProperty function

Returns a TField object for a dataset and data control.

RegisterFields procedure

Registers a set of field components so that they appear in the Dataset designer.

VarTypeToDataType function

Returns the field type value that most closely corresponds to a Variant type.


Dbclient routines

Dbclient objects/components

Other routines, by unit

PackageParams function

Converts a TParams object into an OleVariant that can be used in MIDAS applications.

UnpackParams procedure

Converts an OleVariant that represents a set of parameters into a TParams object.


Dbcommon routines

Other routines, by unit

CurrToBCD function

Converts a Currency value to the corresponding binary coded decimal (BCD) value.


Dbctrls routines

Dbctrls objects/components

Other routines, by unit

DBUseRightToLeftAlignment function

Indicates whether a data-aware control’s alignment is reversed to a right-to-left mode.


Dblogdlg routines

Dblogdlg objects/components

Other routines, by unit

LoginDialog function

Brings up the database Login dialog to allow the user to connect to a database server.

LoginDialogEx function

Brings up the database Login dialog to allow the user to connect to a database server.


Dbpwdlg routines

Dbpwdlg objects/components

Other routines, by unit

PasswordDialog function

Displays a dialog box that prompts the user for the password of a local password-protected table.


Dbtables routines

Dbtables objects/components

Other routines, by unit

AnsiToNative function

Converts a string from the ANSI character set to the character set associated with a given locale.

AnsiToNativeBuf procedure

Converts a string from the ANSI character set to the character set associated with a given locale.

Check procedure

Determines whether a value returned from the Borland Database Engine (BDE) represents an error condition.

DBIError procedure

Creates and raises an EDBEngineError exception for an error code returned by the Borland Database Engine (BDE).

NativeCompareStr function

Compares strings based on a database locale case sensitively.

NativeCompareStrBuf function

Compares null-terminated strings based on a database locale case sensitively.

NativeCompareText function

Compares strings based on a database locale without case sensitivity.

NativeCompareTextBuf function

Compares null-terminated strings based on a database locale and is not case sensitive.

NativeToAnsi function

Converts a string from the character set of the given locale to the ANSI character set.

NativeToAnsiBuf procedure

Converts a string from the character set of a specified locale into the ANSI character set.

Session variable

Maintains database components used by an application.

Sessions variable

Provides access to TSessionList methods and properties.


Dbweb routines

Dbweb objects/components

Other routines, by unit

HtmlTable function

Generates the HTML image of a dataset, using the properties and events of a table producer object.


Dialogs routines

Dialogs objects/components

Other routines, by unit

CreateMessageDialog function

Creates a specified message dialog.

ForceCurrentDirectory variable

Indicates whether open and save dialogs should display the current directory if no initial directory is assigned.

InputBox function

Displays an input dialog box that enables the user to enter a string.

InputQuery function

Displays an input dialog that enables the user to enter a string.

MessageDlg function

Displays a message dialog box in the center of the screen.

MessageDlgPos function

Displays a message dialog box at the specified screen coordinates.

MessageDlgPosHelp function

Displays a message dialog box whose help is supplied in a named help file.

ShowMessage procedure

Displays a message box with an OK button.

ShowMessageFmt procedure

Displays a message box with a formatted message.


Drintf routines

Other routines, by unit

AssociateAttr procedure

Sets up an association between an attribute ID and a field ID.

CreateField function

Creates a new field from information stored in the Data Dictionary.

DictionaryActive function

Indicates whether there is an active Data Dictionary.

DictionaryDeactivate procedure

Deactivates the Data Dictionary.

FindAttrID function

Returns the ID of a specified attribute set.

FindDatabaseID function

Returns the ID of a specified database.

FindFieldID function

Returns the ID of a specified field.

FindTableID function

Returns the ID of a specified table.

GetAttrID function

Returns the ID of the attribute set associated with a field.

GetAttrName function

Returns the name of an attribute set given its ID.

GetAttrNames procedure

Executes a callback for every attribute set name.

GetControlClass function

Returns the class associated with an attribute set.

HasConstraints function

Indicates whether there are any data constraints for a dataset stored in the Data Dictionary.

IsNullID function

Indicates whether a Data Dictionary Identifier is null.

NewAttr function

Creates an attribute set based on the properties of a field component.

QualifyTableName function

Returns the fully qualified name of a table in the Data Dictionary.

QualifyTableNameByName function

Returns the fully qualified name of a table in the Data Dictionary.

UnassociateAttr procedure

Removes the association between an attribute ID and a field ID.

UpdateAttr procedure

Updates an attribute set to match the properties of a field component.

UpdateConstraints procedure

Replaces all imported constraints for a dataset with the current constraints in the Data Dictionary.

UpdateDataset procedure

Updates a dataset and all its field components to match the Data Dictionary.

UpdateField procedure

Updates a field component to match the associated attribute set in the Data Dictionary.


Dsgnintf routines

Dsgnintf objects/components

Other routines, by unit

IsPropertyInCategory function

Indicates whether a property is in a specific property category.

PropertyCategoryList function

Returns a reference to a TPropertyCategoryList.

RegisterComponentEditor procedure

Registers an editor so that it is available at design time.

RegisterPropertiesInCategory function

Registers multiple properties in a specific property category.

RegisterPropertyEditor procedure

Allows a component to bring up a custom property editor from the Object Inspector.

RegisterPropertyInCategory function

Registers a single property in a specific property category.


Exptintf routines

Other routines, by unit

RegisterLibraryExpert procedure

Registers an expert so that it is installed when a package is installed.


Extctrls routines

Extctrls objects/components

Other routines, by unit

Frame3D procedure

Draws a three dimensional frame on a canvas.


Filectrl routines

Filectrl objects/components

Other routines, by unit

DirectoryExists function

Determines whether a specified directory exists.

ForceDirectories function

Creates all the directories along a directory path if they do not already exist.

ProcessPath procedure

Parses a file name into its constituent parts.

SelectDirectory function

Brings up a dialog to allow the user to enter a directory name.


Forms routines

Forms objects/components

Other routines, by unit

Application variable (for standard applications)

Represents application-level information.

GetParentForm function

Returns the form or property page that contains a specified control.

HintWindowClass variable

Specifies the class for the window used to display help hints.

IsAccel function

Indicates whether a particular character is an accelerator character (or hot key) within a given menu caption or other text string.

Screen variable

Represents a screen device.

ValidParentForm function

Returns the form or property page that contains a specified control.


Graphics routines

Graphics objects/components

Other routines, by unit

CharsetToIdent function

Obtains the name of a character set.

ColorToIdent function

Provides the symbolic name of a TColor value.

ColorToRGB function

Converts a TColor value into an RGB representation of the color.

ColorToString function

Returns a string that represents the name of a TColor value.

CopyPalette function

Creates a new palette object that matches an existing palette.

CreateGrayMappedBmp function

Remaps the standard gray colors in a bitmap with the system grays.

CreateGrayMappedRes function

Remaps the standard gray colors in a bitmap resource with the system grays.

CreateMappedBmp function

Changes the color table in a bitmap.

CreateMappedRes function

Changes the color table in a bitmap resource.

DDBsOnly variable

Determines whether bitmap handles are created as device-dependent bitmaps (DDB).

GetCharSetValues procedure

Passes the name of every predefined character set string to a callback function.

GetColorValues procedure

Passes the name of every predefined color constant to a callback function.

GetDIB function

Returns the info header and image for a device independent bitmap.

GetDIBSizes procedure

Returns the size of the info header and of the image for a device independent bitmap.

GetDefFontCharset function

Returns the character set of the default system font.

GraphicExtension function

Returns the default file-name extension of a graphics object.

GraphicFileMask function

Returns a file mask that specifies the valid extensions for a graphic class.

GraphicFilter function

Returns a file filter compatible with the Filter property of an Open or Save dialog.

IdentToCharset function

Translates the name of a character set constant to the corresponding character set.

IdentToColor function

Translates the name of a color constant to the corresponding TColor value.

StringToColor function

Translates a string representation of a color to the corresponding TColor value.

SystemPalette16 variable

Contains the 16 VGA system colors.


Httpapp routines

Httpapp objects/components

Other routines, by unit

DosPathToUnixPath function

Converts a DOS-compatible path specification to a Unix-compatible path specification.

ExtractHTTPFields procedure

Parses a multi-valued string into its constituent fields.

HTTPDecode function

Decodes a string that includes HTTP escape characters.

HTTPEncode function

Converts a string into a form that contains no values that are illegal in an HTTP message header.

ParseDate function

Converts a date value from an HTTP message header into a TDateTime value.

StatusString function

Returns the explanatory string associated with one of the predefined HTTP response status codes.

UnixPathToDosPath function

Converts a Unix-compatible path specification to a Dos-compatible path specification.


Isapiapp routines

Isapiapp objects/components

Other routines, by unit

GetExtensionVersion function

Returns the name and version number of an ISAPI or NSAPI application.

HTTPExtensionProc function

Receives an HTTP request message for an ISAPI or NSAPI application.

TerminateExtension function

Indicates whether an ISAPI or NSAPI application is ready to be shut down.


Mask routines

Mask objects/components

Other routines, by unit

FormatMaskText function

Returns a string formatted using an edit mask.


Masks routines

Masks objects/components

Other routines, by unit

MatchesMask function

Indicates whether a file name conforms to the format specified by a filter string.


Math routines

Math objects/components

Other routines, by unit

ArcCos function

Calculates the inverse cosine of a given number.

ArcCosh function

Calculates the inverse hyperbolic cosine of a given number.

ArcSin function

Calculates the inverse sine of a given number.

ArcSinh function

Calculates the inverse hyperbolic sine of a given number.

ArcTan2 function

Calculates the arctangent angle and quadrant of a given number.

ArcTanh function

Calculates the inverse hyperbolic tangent of a given number.

Ceil function

Rounds variables up toward positive infinity.

Cosh function

Calculates the hyperbolic cosine of an angle.

Cotan function

Calculates the cotangent of an angle.

CycleToRad function

Converts an angle measurement from cycles to radians.

DegToRad function

Returns the value of a degree measurement expressed in radians.

DoubleDecliningBalance function

Calculates the depreciation of an asset using the double-declining balance method.

Floor function

Rounds variables toward negative infinity.

Frexp procedure

Separates the Mantissa and Exponent of X

FutureValue function

Calculates the future value of an investment.

GradToRad function

Converts grad measurements to radians.

Hypot function

Calculates the length of the hypotenuse.

IntPower function

Calculates the integral power of a base value.

InterestPayment function

Calculates the interest portion of a loan payment.

InterestRate function

Returns the interest rate required to increase PresentValue to FutureValue.

InternalRateOfReturn function

Calculates the internal rate of return for an investment.

Ldexp function

Calculates X * (2**P)

LnXP1 function

Returns the natural log of (X+1)

Log10 function

Calculates log base 10.

Log2 function

Calculates log base 2.

LogN function

Calculates log base N.

Max function

Returns the greater of two numeric values.

MaxIntValue function

Returns the largest signed value in an integer array.

MaxValue function

Returns the largest signed value in an array.

Mean function

Returns the average of all values in an array.

MeanAndStdDev procedure

Calculates the mean and standard deviation of array elements.

Min function

Returns the lesser of two numeric values.

MinIntValue function

Returns the smallest signed value in an integer array.

MinValue function

Returns smallest signed value in an array.

MomentSkewKurtosis procedure

Calculates the mean, variance, skew, and kurtosis.

NetPresentValue function

Calculates the current value from an array of estimated cash flow values.

Norm function

Returns the Euclidean 'L-2' norm.

NumberOfPeriods function

Returns the number of payment periods for an investment.

Payment function

Calculates a fully amortized payment.

PeriodPayment function

Returns the principal amount from a full payment.

Poly function

Evaluates a uniform polynomial of one variable at the value X.

PopnStdDev function

Calculates the population standard deviation.

PopnVariance function

Calculates the population variance.

Power function

Raises Base to any power.

PresentValue function

Calculates the present value of an investment.

RadToCycle function

Converts radians to cycles.

RadToDeg function

Converts radians to degrees.

RadToGrad function

Converts radians to grads.

RandG function

Generates random numbers with Gaussian distribution.

SLNDepreciation function

Returns the straight-line depreciation allowance of an asset.

SYDDepreciation function

Calculates depreciation for an asset.

SinCos procedure

Returns sine and cosine of an angle.

Sinh function

Returns the hyperbolic sine of an angle.

StdDev function

Returns the sample standard deviation for elements in an array.

Sum function

Returns the sum of the elements in an array.

SumInt function

Returns the sum of the elements in an integer array.

SumOfSquares function

Returns the sum of the squared values from a data array.

SumsAndSquares procedure

Returns the sum of the values and the sum of the squared values in an array.

Tan function

Returns the tangent of X.

Tanh function

Returns the hyperbolic tangent of X.

TotalVariance function

Returns the statistical variance from an array of values.

Variance function

Calculates statistical sample variance from an array of data.


Menus routines

Menus objects/components

Other routines, by unit

AnsiSameCaption function

Indicates whether two strings are the same based on the current Windows locale, ignoring case information and accelerator characters.

NewItem function

Creates and initializes a menu item.

NewLine function

Creates a menu item for a separator.

NewMenu function

Creates and initializes a main menu.

NewPopupMenu function

Creates and initializes a popup menu.

NewSubMenu function

Creates and initializes a menu item that represents a submenu.

PopupList variable

Provides centralized handling of Windows messages directed at popup menus.

ShortCut function

Creates a menu shortcut for a specified key combination.

ShortCutToKey procedure

Returns the virtual key code and shift state of a menu shortcut.

ShortCutToText function

Converts a menu shortcut into a string that describes the shortcut.

StripHotKey function

Removes the accelerator character marker from a string.

TextToShortCut function

Creates a menu shortcut from a text AnsiString.

ValidHotkeys variable

Determines what accelerator keys can be automatically assigned to a menu item caption.


Mtx routines

Other routines, by unit

CreateSharedPropertyGroup function

Returns the interface for a SharedPropertyGroup that allows MTS objects within a server process to share state.

CreateSharedPropertyGroupManager function

Returns an interface for a new shared property group manager that creates and coordinates shared properties of MTS objects.

CreateTransactionContext function

Starts an MTS transaction.

CreateTransactionContextEx function

Instantiates a TransactionContextEx object, which marks the beginning of a transaction.

SafeRef function

Returns a reference to an MTS object that is safe to pass outside its context.


Olectnrs routines

Olectnrs objects/components

Other routines, by unit

DestroyMetaPict procedure

Frees a metafile resource given its handle.


Olectrls routines

Olectrls objects/components

Other routines, by unit

FontToOleFont function

Returns a Variant containing an IFontDispatch interface that represents a TFont object.

OleFontToFont procedure

Fills in a TFont structure to represent an IFontDispatch.


Printers routines

Printers objects/components

Other routines, by unit

AssignPrn procedure

Assigns a text-file variable to the printer.

Printer function

Returns a global instance of TPrinter to manage interaction with the printer.


Scktcomp routines

Scktcomp objects/components

Other routines, by unit

SetErrorProc function

Replaces the exception handler for error messages that are received from a Windows socket connection.


Svcmgr routines

Svcmgr objects/components

Other routines, by unit

Application variable (for service applications)

Represents a service application for a service project.


Sysinit routines

Other routines, by unit

HInstance variable

Indicates the handle provided by Windows for an application or library.


System or sharemem routines

Other routines, by unit

GetHeapStatus function

Returns the current status of the memory manager.

SysFreeMem function

Frees the memory pointed to by a specified pointer.

SysGetMem function

Allocates a specified number of bytes and returns a pointer to them.

SysReallocMem function

Returns a pointer to a specified number of bytes, preserving the values pointed to by the Pointer parameter.


System routines

System objects/components

Other routines, by unit

Abs function

Returns an absolute value.

Addr function

Returns a pointer to a specified object.

AllocMemCount variable

Represents the total number of allocated memory blocks in an application.

AllocMemSize variable

Represents the total size of allocated memory blocks.

Append procedure

Prepares an existing file for adding text to the end.

ArcTan function

Calculates the arctangent of a given number.

Assert procedure

Tests whether a boolean expression is successful.

AssignFile procedure

Associates the name of an external file with a file variable.

Assigned function

Tests for a nil (unassigned) pointer or procedural variable.

BlockRead procedure

Reads one or more records from an open file into a variable.

BlockWrite procedure

Writes one or more records from a variable to an open file.

Break procedure

Causes the flow of control to exit a for, while, or repeat statement.

ChDir procedure

Changes the current directory.

Chr function

Returns the character for a specified ASCII value.

Close procedure

Terminates the association between a file variable and an external file (Pascal).

CloseFile procedure

Terminates the association between file variable and an external disk file (Delphi).

CmdLine variable

CmdLine is a pointer to the command-line arguments specified when the application is invoked.

CmdShow variable

CmdShow is passed to the Windows ShowWindow WinAPI routine.

CompToCurrency function

Converts a Comp value to a Currency value.

CompToDouble function

Converts a Comp value to a Double value.

Concat function

Concatenates two or more strings into one.

Continue procedure

Allows the flow of control to proceed to the next iteration of for, while, or repeat statements.

Copy function

Returns a substring of a string or a segment of a dynamic array.

Cos function

Calculates the cosine of an angle.

CurrencyToComp procedure

Converts a Currency value to a Comp value.

DLLProc variable

Points to a procedure invoked by a DLL entry point.

Dec procedure

Decrements a variable by 1 or N.

Default8087CW variable

Specifies the Default 8087 control word.

Delete procedure

Removes a substring from a s string.

Dispose procedure

Releases memory allocated for a dynamic variable.

DoubleToComp function

Converts a Double value to a Comp.

EmptyParam variable

Specifies that an optional parameter on a dual interface is not used.

EnumModules procedure

Executes a callback for all the modules in an application.

EnumResourceModules procedure

Executes a callback for all resource modules in an application.

Eof function

Tests whether the file position is at the end of a file.

Eoln function

Tests whether the file pointer is at the end of a line.

Erase procedure

Deletes an external file.

ErrorAddr variable

Contains the address of a statement causing a runtime error.

ErrorProc variable

Points to the RTL run-time error handler.

ExceptProc variable

Points to the lowest-level RTL exception handler.

Exclude procedure

Removes an element from a set.

Exit procedure

Exits from the current procedure.

ExitCode variable

Contains the application's exit code.  (provided for backward compatibility)

ExitProc variable

Points to a program's exit procedure.

Exp function

Returns the exponential of X.

FileMode variable

Indicates the access mode on typed and untyped files opened by the Reset class.

FilePos function

Returns the current file position.

FileSize function

Returns the size of a file in bytes or the number of records in a record file.

FillChar procedure

Fills contiguous bytes with a specified value.

Finalize procedure

Uninitializes a dynamically allocated variable.

FindClassHInstance function

Returns the instance handle for the module in which a class type is defined.

FindHInstance function

Returns the instance handle of the module that contains a specified address.

FindResourceHInstance function

Returns the instance handle of the resource module associated with a specified HINSTANCE.

Flush procedure

Empties the buffer of a text file opened for output.

Frac function

Returns the fractional part of a real number.

FreeMem procedure

Disposes of a dynamic variable of a given size.

GetDir procedure

Returns the current directory for a specified drive.

GetMem procedure

Creates a dynamic variable and a pointer to the address of the block.

GetMemoryManager procedure

Returns the entry points of the currently installed memory manager.

Halt procedure

Initiates abnormal termination of a program.

HeapAllocFlags variable

Flags that indicate how the memory manager obtains memory from the operating system.

Hi function

Returns the high-order byte of X as an unsigned value.

High function

Returns the highest value in the range of an argument.

IOResult function

Returns the status of the last I/O operation performed.

Inc procedure

Increments an ordinal value by one or N.

Include procedure

Adds an element to a set.

Initialize procedure

Initializes a dynamically allocated variable.

Input variable

Specifies a read-only file associated with an operating system's standard input device.

Insert procedure

Inserts a substring into a string beginning at a specified point.

Int function

Returns the integer part of a real number.

IsConsole variable

Indicates whether the module was compiled as a console application.

IsLibrary variable

Indicates whether the module is a DLL.

IsMemoryManagerSet function

Indicates whether the memory manager has been overridden using the SetMemoryManager procedure.

IsMultiThread variable

Indicates whether the application spawned additional threads using BeginThread or TThread objects.

JITEnable variable

Controls when the just-in-time debugger is called.

Length function

Returns the number of characters in a string or elements in an array.

LibModuleList variable

Lists module records for enumeration procedures.

Ln function

Returns the natural log of a real expression.

Lo function

Returns the low order Byte of argument X.

Low function

Returns the lowest value in a range.

MainInstance variable

The Instance handle for the main executable.

MainThreadID variable

The Instance handle for the current modules main thread of execution.

MaxInt constant

The maximum value of the Integer data type.

MaxLongint constant

The maximum value of the Longint data type.

MkDir procedure

Creates a new subdirectory.

Move procedure

Copies bytes from a source to a destination.

New procedure

Creates a new dynamic variable and sets P to point to it.

NoErrMsg variable

Controls whether the application displays an error message when a runtime error occurs.

Null variable

Null represents the null Variant.

Odd function

Returns True if argument is an odd number.

OleStrToStrVar procedure

Copies a string from its COM representation to an existing Pascal string.

OleStrToString function

Copies data received from a COM interface to a string.

Ord function

Returns the ordinal value of an ordinal-type expression.

Output variable

Specifies a write-only file associated with standard output, usually the display.

ParamCount function

Returns the number of parameters passed on the command line.

ParamStr function

Returns a specified parameter from the command-line.

Pi function

Returns 3.1415926535897932385.

Pos function

Returns the index value of the first character in a specified substring that occurs in a given string.

Pred function

Returns the predecessor of the argument.

Ptr function

Converts a specified address to a pointer.

RandSeed variable

RandSeed stores the built-in random number generator's seed.

Random function

Generates random numbers within a specified range.

Randomize procedure

Initializes the random number generator with a random value.

Read procedure

Read reads data from a file.

Readln procedure

Reads a line of text from a file.

ReallocMem procedure

Reallocates a dynamic variable.

Rename procedure

Changes the name of an external file.

Reset procedure

Opens an existing file.

Rewrite procedure

Creates a new file and opens it.

RmDir procedure

Deletes an empty subdirectory.

Round function

Returns the value of X rounded to the nearest whole number.

RunError procedure

Stops execution and generates a run-time error.

Seek procedure

Moves the current position of a file to a specified component.

SeekEof function

Returns the end-of-file status of a file.

SeekEoln function

Returns the end-of-line status of a file.

Set8087CW procedure

Sets both the control word in the floating point unit and the variable NoErrMsg declared in the system unit.

SetLength procedure

Sets the length of a string or dynamic-array variable.

SetMemoryManager procedure

Sets entry points of the memory manager.

SetString procedure

Sets the contents and length of the given string.

SetTextBuf procedure

Assigns an I/O buffer to a text file.

Sin function

Returns the sine of the angle in radians.

SizeOf function

Returns the number of bytes occupied by a variable or type.

Slice function

Returns a sub-section of an array.

Sqr function

Returns the square of a number.

Sqrt function

Returns the square root of X.

Str procedure

Formats a string and returns it to a variable.

StringOfChar function

Returns a string with a specified number of repeating characters.

StringToOleStr function

Allocates memory and copies a string to the OLE format.

StringToWideChar function

Returns a UNICODE string from a Pascal string.

Succ function

Returns the successor of an argument.

Swap function

Exchanges high order byte with the low order byte of an integer or word.

Trunc function

Truncates a real number to an integer.

Truncate procedure

Deletes all the records after the current file position.

TypeInfo function

Returns a pointer to compiler generated run-time type information for a type identifier.

Unassigned constant

Used for a Variant variable not yet assigned a value.

UniqueString procedure

Ensures that a given string has a reference count of one.

UpCase function

Converts a character to uppercase.

Val procedure

Converts a string to a numeric representation.

VarArrayCreate function

Creates a Variant array.

VarArrayDimCount function

Returns number of dimensions of a Variant array.

VarArrayHighBound function

Returns high bound for a dimension in a Variant array.

VarArrayLock function

Locks a Variant array and returns a pointer to the data.

VarArrayLowBound function

Returns the low bound of a dimension in a Variant array.

VarArrayOf function

Creates and fills a one-dimensional Variant array.

VarArrayRedim procedure

VarArrayRedim resizes a Variant array.

VarArrayRef function

Returns a reference to the specified Variant array.

VarArrayUnlock procedure

Unlocks a Variant array.

VarAsType function

Converts a Variant to specified type.

VarCast procedure

Converts a Variant to a specified type, storing the result in a variable.

VarClear procedure

Empties a Variant, so that it is unassigned.

VarCopy procedure

Copies a Variant.

VarFromDateTime function

Returns a Variant containing a specified data and time.

VarIsArray function

Indicates whether the specified Variant is an array.

VarIsEmpty function

Indicates whether the specified Variant is unassigned.

VarIsNull function

Indicates whether the specified Variant is Null.

VarToDateTime function

Converts a specified Variant to a TDateTime value.

VarToStr function

Converts a Variant to a string.

VarType function

Returns the type code of a specified Variant.

WideCharLenToStrVar procedure

WideCharLenToStrVar converts Unicode characters to single or multi byte character data.

WideCharLenToString function

Converts Unicode characters to single or multi byte character data.

WideCharToStrVar procedure

Converts Unicode string to a single or multi byte character data.

WideCharToString function

Converts null-terminated Unicode string to single or multi byte character data.

Write procedure (for text files)

Writes to a text file.

Write procedure (for typed files)

Writes to a typed file.

Writeln procedure

Writes an end-of-line marker to a text file.


Sysutils routines

Sysutils objects/components

Other routines, by unit

Abort procedure

Ends the current process without reporting an error.

AddExitProc procedure

Provided for backward compatibility only.

AddTerminateProc procedure

Adds a terminate procedure to the system list of termination procedures.

AdjustLineBreaks function

Standardizes line break characters to CR/LF.

AllocMem function

Allocates a memory block and initializes each byte to zero.

AnsiCompareFileName function

Compares file names based on the current locale.

AnsiCompareStr function

Compares strings based on the current Windows locale with case sensitivity.

AnsiCompareText function

Compares strings based on the current Windows locale without case sensitivity.

AnsiExtractQuotedStr function

Converts a quoted string into an unquoted string.

AnsiLastChar function

Returns a pointer to the last character in a string.

AnsiLowerCase function

Returns a string that is a copy of the given string converted to lower case.

AnsiLowerCaseFileName function

Converts a file name to lower case.

AnsiPos function

Locates the position of a sub-string within a string.

AnsiQuotedStr function

Returns the quoted version of a string.

AnsiSameStr function

Compares strings based on the current Windows locale with case sensitivity.

AnsiSameText function

Compares strings based on the current Windows locale without case sensitivity.

AnsiStrComp function

Compares null-terminated character strings case sensitively.

AnsiStrIComp function

Compares null terminated character strings case insensitively.

AnsiStrLComp function

Compares the first MaxLen bytes of two null-terminated strings, case-sensitively.

AnsiStrLIComp function

Compares two strings, case-insensitively, up to the first MaxLen bytes.

AnsiStrLastChar function

Returns a pointer to the last character in a null-terminated string.

AnsiStrLower function

Converts all characters in a null-terminated string to lower case.

AnsiStrPos function

Returns a pointer to the first occurrence of SubStr in Str.

AnsiStrRScan function

Returns a pointer to the last occurrence of a specified character in a specified string.

AnsiStrScan function

Returns a pointer to first occurrence of a character in a string.

AnsiStrUpper function

Converts all characters in a null-terminated string to upper case.

AnsiUpperCase function

Converts a string to upper case.

AnsiUpperCaseFileName function

Converts a file name to upper case.

AppendStr procedure

Appends a dynamically allocated string to an existing string.

AssignStr procedure

Assigns a new dynamically allocated string to a specified pointer.

Beep procedure

Generates a standard beep using the computer speaker.

BeginThread function

Spawns a separate thread of execution.

ByteToCharIndex function

Returns the position of the character that contains a specified byte in a string.

ByteToCharLen function

Returns the number of characters fully contained in the first MaxLen bytes of a string.

ByteType function

Indicates whether a byte in a string is a single byte character, the first byte of a double byte character, or the second byte of a double byte character.

CallTerminateProcs function

Calls all of the functions in the termination procedure list.

ChangeFileExt function

Changes the extension of a file name.

CharToByteIndex function

Returns the 1-based index of the first byte of a specified character in a string.

CharToByteLen function

Returns the length, in bytes, of the first MaxLen characters of a string.

CompareMem function

Performs a binary comparison of two memory images.

CompareStr function

Compares two strings case sensitively.

CompareText function

Compares two strings by ordinal value without case sensitivity.

CreateDir function

Creates a new directory.

CurrToStr function

Formats a Currency value as a string.

CurrToStrF function

Converts a Currency value to a string, using a specified format.

Currency and date/time formatting variables

Influence the way numeric or date/time values are formatted.

Date function

Returns the current date.

DateDelta constant

Specifies the correction factor when computing the difference between two date and time types that do not begin in the same year.

DateTimeToFileDate function

Converts a TDateTime object to a DOS date-and-time value.

DateTimeToStr function

Converts a TDateTime value to a string.

DateTimeToString procedure

Converts a TDateTime value to a string using a specified Format.

DateTimeToSystemTime procedure

Converts a TDateTime value into the Win32 API's TSystemTime type.

DateTimeToTimeStamp function

Converts a TDateTime value into the corresponding TTimeStamp value.

DateToStr function

Converts a TDateTime value to a string.

DayOfWeek function

Returns the day of the week for a specified date.

DecodeDate procedure

Returns Year, Month, and Day values for a TDateTime value.

DecodeTime procedure

Breaks a TDateTime value into hours, minutes, seconds, and milliseconds.

DeleteFile function

Deletes a file from disk.

DiskFree function

Returns the number of free bytes on a specified drive.

DiskSize function

Returns the size, in bytes, of a specified drive.

DisposeStr procedure

Disposes of a string pointer that was allocated using NewStr.

EncodeDate function

Returns a TDateTime value that represents a specified Year, Month, and Day.

EncodeTime function

Returns a TDateTime value for a specified Hour, Min, Sec, and MSec.

EndThread function

Terminates the execution of a thread.

ExceptAddr function

Returns the address at which the current exception was raised.

ExceptObject function

Returns a reference to the object associated with the current exception.

ExceptionErrorMessage function

Formats a standard error message.

ExcludeTrailingBackslash function

Returns a path name after removing any '

t the end.

ExpandFileName function

Returns the full path name for a relative file name.

ExpandUNCFileName function

Returns the full path of a file name with the network drive portion in UNC format.

ExtractFileDir function

Extracts the drive and directory parts from FileName.

ExtractFileDrive function

Returns the drive portion of a file name.

ExtractFileExt function

Returns the extension portions of a file name.

ExtractFileName function

Extracts the name and extension parts of a file name.

ExtractFilePath function

Returns the drive and directory portions of a file name.

ExtractRelativePath function

Returns a relative path name, relative to a specific base directory.

ExtractShortPathName function

Converts a file name to the short 8.3 form.

File mode constants

File mode constants are used to open and close disk files.

File open mode constants

File open mode constants are used to control the access mode to a file or stream.

FileAge function

Returns the date-and-time stamp of a specified file.

FileClose procedure

Closes a specified file.

FileCreate function

Creates a new file.

FileDateToDateTime function

Converts a DOS date-time value to TDateTime value.

FileExists function

Tests if a specified file exists.

FileGetAttr function

Returns the file attributes of FileName.

FileGetDate function

Returns a DOS date-time stamp for a specified file.

FileOpen function

Opens a specified file using a specified access mode.

FileRead function

Reads a specified number of bytes from a file.

FileSearch function

Searches a specified DOS path for a file.

FileSeek function

Positions the current file pointer in a previously opened file.

FileSetAttr function

Sets the file attributes of a specified file.

FileSetDate function

Sets the DOS time stamp for a specified file.

FileWrite function

Writes the contents of a buffer to the current position in a file.

FinalizePackage procedure

Finalizes the specified package .BPL.

FindClose procedure

Releases memory allocated by FindFirst.

FindCmdLineSwitch function

Determines whether a string was passed as a command line argument to the application.

FindFirst function

Searches for the first instance of a file name with a given set of attributes in a specified directory.

FindNext function

Returns the next entry matching the name and attributes specified in a previous call to FindFirst.

FloatToDecimal procedure

Converts a floating-point value to a decimal representation.

FloatToStr function

Converts a floating point value to a string.

FloatToStrF function

Converts a floating point value to a string, using a specified Format, Precision, and Digits.

FloatToText function

Converts a floating-point value to an unterminated character string, using a specified Format, Precision and Digits.

FloatToTextFmt function

Converts a floating-point value to to an unterminated character string, using a specified format.

FmtLoadStr function

Returns formatted output using a resourced format string.

FmtStr procedure

Assembles a formatted string using a format string and an array of arguments.

Format function

Returns a formatted string assembled from a format string and an array of arguments.

FormatBuf function

Formats the arguments from an array, placing the result in a buffer.

FormatCurr function

Formats a Currency object.

FormatDateTime function

Formats a TDateTime value.

FormatFloat function

Formats a floating point value.

FreeAndNil procedure

Frees an object reference and replaces the reference with nil..

GetCurrentDir function

Returns the name of the current directory.

GetFormatSettings procedure

Resets the date and number format parameters to default values.

GetPackageDescription function

Returns the description resource from a package.

GetPackageInfo procedure

Enumerates all the units and required packages for a package.

IncMonth function

Returns a date shifted by a specified number of months.

IncludeTrailingBackslash function

Returns a path name after adding a '_o the end if it is not already there.

InitializePackage procedure

Validates and initializes a given package.

IntToHex function

Returns the hex representation of an integer.

IntToStr function

Converts an integer to a string.

IsDelimiter function

Indicates whether a specified character in a string matches one of a set of delimiters.

IsLeapYear function

Indicates whether a specified year is a leap year.

IsPathDelimiter function

Indicates whether the byte at position Index of a string is the backslash character.

IsValidIdent function

Tests for a valid Pascal identifier.

Languages function

Lists the locales for which support is available.

LastDelimiter function

Returns the byte index in S of the last character that matches any character in the Delimiters AnsiString.

LeadBytes variable

Lists all Char values that can be the first byte of a double byte character on the local system.

LoadPackage function

Loads a specified package.

LoadStr function

Loads a string from the application's executable file.

LowerCase function

Converts an ASCII string to lowercase.

MSecsPerDay constant

Specifies the number of milliseconds per day.

MSecsToTimeStamp function

Converts a specified number of milliseconds into a TTimeStamp value.

NewStr function

Allocates a string on the heap.

Now function

Returns the current date and time.

NullStr constant

Declares a pointer to EmptyStr.

OutOfMemoryError procedure

Raises an EOutOfMemory exception.

QuotedStr function

Returns the quoted version of a string.

RaiseLastWin32Error procedure

Raises an exception for the last occurring Win32 error.

RemoveDir function

Deletes an existing empty directory.

RenameFile function

Changes a file name.

ReplaceDate procedure

Replaces the date portion of a TDateTime value with a specified date.

ReplaceTime procedure

Replaces the time portion of a TDateTime value with a specified time.

SafeLoadLibrary function

Loads a DLL while suppressing error dialogs and preventing the DLL from changing the FPU control word.

SecsPerDay constant

Indicates the number of seconds per day.

SetCurrentDir function

Sets the current directory.

ShowException procedure

Displays an exception message with its physical address

StrAlloc function

Allocates a buffer for a null-terminated string and returns a pointer to its first character.

StrBufSize function

Returns the maximum number of characters that can be stored in a buffer allocated by StrAlloc.

StrByteType function

Indicates whether a byte in a string is a single byte character, the first byte of a double byte character, or the second byte of a double byte character.

StrCat function

Appends a copy of Source to the end of Dest and returns the concatenated string.

StrComp function

Compares two strings case sensitively.

StrCopy function

Copies Source to Dest and returns Dest.

StrDispose procedure

Disposes of a string.

StrECopy function

Copies Source to Dest and returns a pointer to the null character ending the destination string.

StrEnd function

Returns a pointer to the end of a null terminated string.

StrFmt function

Formats entries in an array.

StrIComp function

Compares two strings without case sensitivity.

StrLCat function

Appends up to a specified maximum number of characters to string.

StrLComp function

Compares up to a specified maximum number of characters in two strings.

StrLCopy function

Copies up to a specified maximum number of characters from Source to Dest.

StrLFmt function

Formats a series of arguments from a specified open array into a buffer.

StrLIComp function

Compares strings up to a specified maximum number of characters, without case sensitivity.

StrLen function

Returns number of characters in a string excluding the null terminator.

StrLower function

Converts a string to lowercase.

StrMove function

Copies specified number of characters to string.

StrNew function

Allocates space on and copies a string to the heap; returning a pointer to the string.

StrPCopy function

Copies a Pascal string to a null-terminated string.

StrPLCopy function

Copies characters from a Pascal-style string into a null-terminated string.

StrPas function

Converts null-terminated string to a Pascal string.

StrPos function

Returns a pointer to the first occurrence of STR2 in STR1.

StrRScan function

Returns a pointer to the last occurrence of a specified character in a string.

StrScan function

Returns a pointer to first occurrence of a specified character in a string.

StrToCurr function

Converts a string to a Currency value.

StrToDate function

Converts a string to a TDateTime value.

StrToDateTime function

Converts a string to a TDateTime value.

StrToFloat function

Converts a given string to a floating-point value.

StrToInt function

Converts a string that represents an integer (decimal or hex notation) to a number.

StrToInt64 function

Converts a string that represents an integer (decimal or hex notation) to a number.

StrToInt64Def function

Converts a string that represents an integer (decimal or hex notation) to a number.

StrToIntDef function

Converts a string that represents an integer (decimal or hex notation) to a number.

StrToTime function

Converts a string to a TDateTime value.

StrUpper function

Returns a string in upper case.

StringReplace function

Returns a string with occurrences of one substring replaced by another substring.

Supports function

Indicates whether a given object or IUnknown interface supports a specified interface.

SysErrorMessage function

Converts Win32 API error codes into strings.

SystemTimeToDateTime function

Converts a TSystemTime value into a TDateTime value.

TextToFloat function

Returns a floating-point value from a null-terminated string.

Time function

Returns the current time.

TimeStampToDateTime function

Converts a TTimeStamp value into the corresponding TDateTime value.

TimeStampToMSecs function

Converts a TTimeStamp value into an absolute number of milliseconds.

TimeToStr function

Returns a string that represents a TDateTime value.

Trim function

Trims leading and trailing spaces and control characters from a string.

TrimLeft function

Trims leading spaces and control characters from a string.

TrimRight function

Trims trailing spaces and control characters from a string.

UnloadPackage procedure

Unloads a package.

UpperCase function

Returns a copy of a string in uppercase.

Win32Check function

Checks the return value of a Windows API call and raises an appropriate exception when it indicates failure.

Win32Platform variable

Specifies the Win32 platform identifier.

WrapText function

Splits a string into multiple lines as its length approaches a specified size.


Webbroker routines

Webbroker objects/components

Other routines, by unit

Application variable (for Web server applications)

Represents a web server application for an internet project.


All elements are displayed here

No additional elements exist for this unit or routine.